Commit 4028c3e3 by manxiaoqiang

app排序

parent 4b8bfbac
...@@ -11,6 +11,7 @@ import org.joda.time.DateTime; ...@@ -11,6 +11,7 @@ import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -27,6 +28,7 @@ import java.io.File; ...@@ -27,6 +28,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Date; import java.util.Date;
...@@ -51,28 +53,64 @@ public class ContractController { ...@@ -51,28 +53,64 @@ public class ContractController {
return ResultModel.OK(service.findAll(startDate, endDate, platform)); return ResultModel.OK(service.findAll(startDate, endDate, platform));
} }
@RequestMapping(value = "export", method = RequestMethod.GET) @RequestMapping(value = "export", method = RequestMethod.GET,produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
@ResponseBody @ResponseBody
public ResponseEntity<byte[]> export(@PathVariable String platform, @RequestParam String startDate public ResponseEntity<byte[]> export(@PathVariable String platform, @RequestParam String startDate
, @RequestParam String endDate, HttpServletRequest request, HttpServletResponse response) { , @RequestParam String endDate, HttpServletRequest request, HttpServletResponse response) {
List<Contract> contractList = service.findAll(startDate, endDate, platform); List<Contract> contractList = service.findAll(startDate, endDate, platform);
InputStream in = null;
byte[] content = new byte[0]; byte[] content = new byte[0];
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("时间,合同编号,客户账号,签约方,销售,开始日期,结束日期,套餐类型,合同金额,折扣,收款金额,合同状态\r\n"); sb.append("时间,合同编号,客户账号,签约方,销售,开始日期,结束日期,套餐类型,合同金额,折扣,收款金额,合同状态\r\n");
if(ValidateUtil.isValid(contractList)){ if(ValidateUtil.isValid(contractList)){
for (Contract c : contractList){ for (Contract c : contractList){
sb.append(c.getDs()).append(c.getContractCode()).append(c.getEmail()).append(c.getCustomerBody()).append(c.getSaleName()) sb.append(c.getDs()).append(",").append(c.getContractCode()).append(",").append(c.getEmail()).append(",").append(c.getCustomerBody()).append(",").append(c.getSaleName()).append(",")
.append(c.getStartDate()).append(c.getEndDate()).append(c.getPriceLevelName()).append(c.getMoney()).append(c.getPayMoney()) .append(c.getStartDate()).append(",").append(c.getEndDate()).append(",").append(c.getPriceLevelName()).append(",").append(c.getMoney()).append(",").append(c.getPayMoney()).append(",")
.append(c.getStatus()).append("\r\n"); .append(c.getStatus()).append(",").append("\r\n");
}
}
InputStream in = new ByteArrayInputStream(sb.toString().getBytes());
try {
content = IOUtils.toByteArray(in);
} catch (IOException e) {
e.printStackTrace();
}
HttpHeaders headers = new HttpHeaders();
response.setHeader("filename", "contract.txt");
response.setHeader("content-disposition", "attachment; filename=contract.txt");
response.setHeader("Content-Type", "application/octet-stream;charset=UTF-8");
//返回文件字符串
return new ResponseEntity<byte[]>(content, headers, HttpStatus.CREATED);
}
@RequestMapping(value = "pay/export", method = RequestMethod.GET,produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
@ResponseBody
public ResponseEntity<byte[]> exportPay( @RequestParam String startDate, @RequestParam String endDate,
HttpServletRequest request, HttpServletResponse response) {
List<ContractMoney> moneyList = service.findPay(startDate, endDate);
byte[] content = new byte[0];
StringBuilder sb = new StringBuilder();
sb.append("合同编号 ,客户账号 ,签约方 ,事项 ,金额 ,日期 ,修改人 \r\n");
if(ValidateUtil.isValid(moneyList)){
for (ContractMoney c : moneyList){
sb.append(c.getContractCode()).append(",").append(c.getEmail()).append(",").append(c.getCompany()).append(",").append(c.getType()).append(",")
.append(c.getMoney()).append(",").append(c.getDs()).append(",").append(c.getCreateName()).append("\r\n");
}
} }
InputStream in = new ByteArrayInputStream(sb.toString().getBytes());
try {
content = IOUtils.toByteArray(in);
} catch (IOException e) {
e.printStackTrace();
} }
content = sb.toString().getBytes();
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
response.setHeader("filename", "contraact.xls"); response.setHeader("filename", "contract_pay.txt");
response.setHeader("content-disposition", "attachment; filename=contraact.xls"); response.setHeader("content-disposition", "attachment; filename=contract_pay.txt");
response.setHeader("Content-Type", "application/vnd.ms-excel"); response.setHeader("Content-Type", "application/octet-stream;charset=UTF-8");
//返回文件字符串 //返回文件字符串
return new ResponseEntity<byte[]>(content, headers, HttpStatus.CREATED); return new ResponseEntity<byte[]>(content, headers, HttpStatus.CREATED);
......
...@@ -53,7 +53,7 @@ public class UserController { ...@@ -53,7 +53,7 @@ public class UserController {
public ResultModel create(@CurrentAccount User loginAccount, @RequestBody User resource, HttpServletRequest request) { public ResultModel create(@CurrentAccount User loginAccount, @RequestBody User resource, HttpServletRequest request) {
if(userService.validEmail(resource.getEmail())){ if(userService.validEmail(resource.getEmail())){
userService.create(loginAccount, resource); userService.create(loginAccount, resource);
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), resource.getEmail(), "创建系统账号", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), resource.getEmail(), "创建系统账号", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(true); return ResultModel.OK(true);
}else{ }else{
...@@ -64,7 +64,7 @@ public class UserController { ...@@ -64,7 +64,7 @@ public class UserController {
@RequestMapping(value = "/update", method = RequestMethod.PUT) @RequestMapping(value = "/update", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ResultModel update(@CurrentAccount User loginAccount, @RequestBody User resource, HttpServletRequest request) { public ResultModel update(@CurrentAccount User loginAccount, @RequestBody User resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), resource.getEmail(), "修改系统账号", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), resource.getEmail(), "修改系统账号", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(userService.update(loginAccount, resource)); return ResultModel.OK(userService.update(loginAccount, resource));
} }
...@@ -97,7 +97,7 @@ public class UserController { ...@@ -97,7 +97,7 @@ public class UserController {
@ResponseBody @ResponseBody
public ResultModel delete(@CurrentAccount User loginAccount, @PathVariable Long id, HttpServletRequest request) { public ResultModel delete(@CurrentAccount User loginAccount, @PathVariable Long id, HttpServletRequest request) {
User user = userService.delete(loginAccount, id); User user = userService.delete(loginAccount, id);
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), user.getEmail(), "删除系统账号", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), user.getEmail(), "删除系统账号", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(user); return ResultModel.OK(user);
} }
...@@ -106,7 +106,7 @@ public class UserController { ...@@ -106,7 +106,7 @@ public class UserController {
@ResponseBody @ResponseBody
public ResultModel enable(@CurrentAccount User loginAccount, @PathVariable Long id, HttpServletRequest request) { public ResultModel enable(@CurrentAccount User loginAccount, @PathVariable Long id, HttpServletRequest request) {
User user = userService.enable(loginAccount, id); User user = userService.enable(loginAccount, id);
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), user.getEmail(), "启用系统账号", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), user.getEmail(), "启用系统账号", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(user); return ResultModel.OK(user);
} }
...@@ -115,7 +115,7 @@ public class UserController { ...@@ -115,7 +115,7 @@ public class UserController {
@ResponseBody @ResponseBody
public ResultModel forbiden(@CurrentAccount User loginAccount, @PathVariable Long id, HttpServletRequest request) { public ResultModel forbiden(@CurrentAccount User loginAccount, @PathVariable Long id, HttpServletRequest request) {
User user = userService.forbiden(loginAccount, id); User user = userService.forbiden(loginAccount, id);
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), user.getEmail(), "停用系统账号", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), user.getEmail(), "停用系统账号", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(user); return ResultModel.OK(user);
} }
...@@ -126,7 +126,7 @@ public class UserController { ...@@ -126,7 +126,7 @@ public class UserController {
User login = userRepository.login(name); User login = userRepository.login(name);
if(null == login){ if(null == login){
User user = userService.updateName(loginAccount, name); User user = userService.updateName(loginAccount, name);
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), user.getEmail(), "修改系统账号名字", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), user.getEmail(), "修改系统账号名字", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(true); return ResultModel.OK(true);
}else{ }else{
...@@ -141,7 +141,7 @@ public class UserController { ...@@ -141,7 +141,7 @@ public class UserController {
User login = userRepository.login(loginAccount.getEmail(), CipherUtil.generatePassword(oldpwd)); User login = userRepository.login(loginAccount.getEmail(), CipherUtil.generatePassword(oldpwd));
if(null != login){ if(null != login){
User user = userService.updatePwd(loginAccount, pwd); User user = userService.updatePwd(loginAccount, pwd);
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), user.getEmail(), "修改系统账号密码", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.INNERUSER.getKey(), user.getEmail(), "修改系统账号密码", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(true); return ResultModel.OK(true);
}else{ }else{
...@@ -153,7 +153,7 @@ public class UserController { ...@@ -153,7 +153,7 @@ public class UserController {
@RequestMapping(value = "/update/pwd", method = RequestMethod.PUT) @RequestMapping(value = "/update/pwd", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ResultModel updatePwd(@RequestParam String email, @RequestParam String pwd, HttpServletRequest request) { public ResultModel updatePwd(@RequestParam String email, @RequestParam String pwd, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(email, email, OperateObjectTypeEnum.INNERUSER.getKey(), email, "修改系统账号密码", request); UserLogThread userlog = new UserLogThread(email, email, OperateObjectTypeEnum.INNERUSER.getKey(), email, "修改系统账号密码", request,null);
userlog.start(); userlog.start();
return ResultModel.OK(userService.updatePwd(email, pwd)); return ResultModel.OK(userService.updatePwd(email, pwd));
} }
......
...@@ -2,6 +2,7 @@ package common.model; ...@@ -2,6 +2,7 @@ package common.model;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import java.util.Date; import java.util.Date;
...@@ -30,7 +31,7 @@ public class ContractChange { ...@@ -30,7 +31,7 @@ public class ContractChange {
private Date createTime; private Date createTime;
@Id @Id
@GeneratedValue @GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() { public Long getId() {
return id; return id;
} }
......
...@@ -23,6 +23,7 @@ public class UserLog ...@@ -23,6 +23,7 @@ public class UserLog
private String location; private String location;
private String OldObject; private String OldObject;
private String newObject; private String newObject;
private Long role;
@Id @Id
@GeneratedValue @GeneratedValue
...@@ -132,6 +133,14 @@ public class UserLog ...@@ -132,6 +133,14 @@ public class UserLog
this.newObject = newObject; this.newObject = newObject;
} }
public Long getRole() {
return role;
}
public void setRole(Long role) {
this.role = role;
}
@Override @Override
public String toString() { public String toString() {
return "UserLog{" + return "UserLog{" +
......
...@@ -50,7 +50,7 @@ public class TkioAccountController { ...@@ -50,7 +50,7 @@ public class TkioAccountController {
@RequestMapping(value = "/forbiden", method = RequestMethod.PUT) @RequestMapping(value = "/forbiden", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ResultModel forbiden(@CurrentAccount User loginAccount, @RequestBody Reminder resource, HttpServletRequest request) { public ResultModel forbiden(@CurrentAccount User loginAccount, @RequestBody Reminder resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "关闭异常状态跟进", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "关闭异常状态跟进", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(tkioAccountService.forbiden(loginAccount, resource)); return ResultModel.OK(tkioAccountService.forbiden(loginAccount, resource));
} }
...@@ -59,7 +59,7 @@ public class TkioAccountController { ...@@ -59,7 +59,7 @@ public class TkioAccountController {
@RequestMapping(value = "/enable", method = RequestMethod.PUT) @RequestMapping(value = "/enable", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ResultModel enable(@CurrentAccount User loginAccount, @RequestBody Reminder resource, HttpServletRequest request) { public ResultModel enable(@CurrentAccount User loginAccount, @RequestBody Reminder resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "开启异常状态跟进", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "开启异常状态跟进", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(tkioAccountService.enable(loginAccount, resource)); return ResultModel.OK(tkioAccountService.enable(loginAccount, resource));
} }
...@@ -68,7 +68,7 @@ public class TkioAccountController { ...@@ -68,7 +68,7 @@ public class TkioAccountController {
@RequestMapping(value = "/pay", method = RequestMethod.PUT) @RequestMapping(value = "/pay", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ResultModel pay(@CurrentAccount User loginAccount, @RequestBody Payment resource, HttpServletRequest request) { public ResultModel pay(@CurrentAccount User loginAccount, @RequestBody Payment resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "缴费", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "缴费", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(tkioAccountService.pay(loginAccount, resource)); return ResultModel.OK(tkioAccountService.pay(loginAccount, resource));
} }
...@@ -77,7 +77,7 @@ public class TkioAccountController { ...@@ -77,7 +77,7 @@ public class TkioAccountController {
@RequestMapping(value = "/visit", method = RequestMethod.PUT) @RequestMapping(value = "/visit", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ResultModel visit(@CurrentAccount User loginAccount, @RequestBody BackVisit resource, HttpServletRequest request) { public ResultModel visit(@CurrentAccount User loginAccount, @RequestBody BackVisit resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "回访", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "回访", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK( tkioAccountService.visit(loginAccount, resource)); return ResultModel.OK( tkioAccountService.visit(loginAccount, resource));
} }
......
...@@ -44,7 +44,7 @@ public class TrackAccountController { ...@@ -44,7 +44,7 @@ public class TrackAccountController {
@RequestMapping(value = "/forbiden", method = RequestMethod.PUT) @RequestMapping(value = "/forbiden", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ResultModel forbiden(@CurrentAccount User loginAccount, @RequestBody Reminder resource, HttpServletRequest request) { public ResultModel forbiden(@CurrentAccount User loginAccount, @RequestBody Reminder resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "关闭到期提醒", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "关闭到期提醒", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(tkioAccountService.forbiden(loginAccount, resource)); return ResultModel.OK(tkioAccountService.forbiden(loginAccount, resource));
} }
...@@ -53,7 +53,7 @@ public class TrackAccountController { ...@@ -53,7 +53,7 @@ public class TrackAccountController {
@RequestMapping(value = "/enable", method = RequestMethod.PUT) @RequestMapping(value = "/enable", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ResultModel enable(@CurrentAccount User loginAccount, @RequestBody Reminder resource, HttpServletRequest request) { public ResultModel enable(@CurrentAccount User loginAccount, @RequestBody Reminder resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "开启到期提醒", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "开启到期提醒", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(tkioAccountService.enable(loginAccount, resource)); return ResultModel.OK(tkioAccountService.enable(loginAccount, resource));
} }
...@@ -62,7 +62,7 @@ public class TrackAccountController { ...@@ -62,7 +62,7 @@ public class TrackAccountController {
@RequestMapping(value = "/pay", method = RequestMethod.PUT) @RequestMapping(value = "/pay", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ResultModel pay(@CurrentAccount User loginAccount, @RequestBody Payment resource, HttpServletRequest request) { public ResultModel pay(@CurrentAccount User loginAccount, @RequestBody Payment resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "缴费", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "缴费", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK(tkioAccountService.pay(loginAccount, resource)); return ResultModel.OK(tkioAccountService.pay(loginAccount, resource));
} }
...@@ -71,7 +71,7 @@ public class TrackAccountController { ...@@ -71,7 +71,7 @@ public class TrackAccountController {
@RequestMapping(value = "/visit", method = RequestMethod.PUT) @RequestMapping(value = "/visit", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ResultModel visit(@CurrentAccount User loginAccount, @RequestBody BackVisit resource, HttpServletRequest request) { public ResultModel visit(@CurrentAccount User loginAccount, @RequestBody BackVisit resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "回访", request); UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "回访", request,loginAccount.getRole());
userlog.start(); userlog.start();
return ResultModel.OK( tkioAccountService.visit(loginAccount, resource)); return ResultModel.OK( tkioAccountService.visit(loginAccount, resource));
} }
......
...@@ -32,12 +32,14 @@ public class UserLogThread ...@@ -32,12 +32,14 @@ public class UserLogThread
//为了获取ip及解析地点 //为了获取ip及解析地点
private HttpServletRequest request; private HttpServletRequest request;
private Long role;
/** /**
* 传入内容为对象 * 传入内容为对象
* UserLogThread userlog = new UserLogThread("zxy@reyun.com", "zxy", OperateObjectTypeEnum.CUSTOMER.getKey(), "app", "查看app", request); * UserLogThread userlog = new UserLogThread("zxy@reyun.com", "zxy", OperateObjectTypeEnum.CUSTOMER.getKey(), "app", "查看app", request);
* userlog.start(); * userlog.start();
*/ */
public UserLogThread(String operaAccount, String accountName, String operateObjectType, String operateObject, String operateType, HttpServletRequest request) public UserLogThread(String operaAccount, String accountName, String operateObjectType, String operateObject, String operateType, HttpServletRequest request, Long role)
{ {
this.operaAccount = operaAccount; this.operaAccount = operaAccount;
this.accountName = accountName; this.accountName = accountName;
...@@ -45,6 +47,7 @@ public class UserLogThread ...@@ -45,6 +47,7 @@ public class UserLogThread
this.operateObject = operateObject; this.operateObject = operateObject;
this.operateType = operateType; this.operateType = operateType;
this.request = request; this.request = request;
this.role = role;
} }
...@@ -60,6 +63,7 @@ public class UserLogThread ...@@ -60,6 +63,7 @@ public class UserLogThread
audit.setOperateObject(this.operateObject); audit.setOperateObject(this.operateObject);
audit.setOperateTime(DateUtil.format(new Date(), DateUtil.C_TIME_PATTON_DEFAULT)); audit.setOperateTime(DateUtil.format(new Date(), DateUtil.C_TIME_PATTON_DEFAULT));
audit.setOperateType(this.operateType); audit.setOperateType(this.operateType);
audit.setRole(this.role);
if (this.request != null) { if (this.request != null) {
String ipAddr = IPAddrUtil.getIpAddrNew(request); String ipAddr = IPAddrUtil.getIpAddrNew(request);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment