Commit 697ed7a7 authored by mcb's avatar mcb

Merge branch 'dmp_dev' of http://gitlab.ioubuy.cn/yaobenzhang/jz-dmp-service into dmp_dev

parents 75ecc423 2640489e
...@@ -17,4 +17,6 @@ public @interface SysOperationLogAnnotation { ...@@ -17,4 +17,6 @@ public @interface SysOperationLogAnnotation {
//定义成员 //定义成员
String descrption() default "" ;//描述 String descrption() default "" ;//描述
String actionType() default "" ;//操作的类型,1、添加 2、修改 3、删除 4、查询 String actionType() default "" ;//操作的类型,1、添加 2、修改 3、删除 4、查询
String optModular() default "" ;//操作功能模块
boolean isProjOpt() default true ;//是否项目操作
} }
...@@ -3,7 +3,9 @@ package com.jz.common.aspect; ...@@ -3,7 +3,9 @@ package com.jz.common.aspect;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -22,7 +24,9 @@ import com.alibaba.fastjson.JSONObject; ...@@ -22,7 +24,9 @@ import com.alibaba.fastjson.JSONObject;
import com.jz.common.annotation.SysOperationLogAnnotation; import com.jz.common.annotation.SysOperationLogAnnotation;
import com.jz.common.utils.HttpRequestUtil; import com.jz.common.utils.HttpRequestUtil;
import com.jz.common.utils.web.SessionUtils; import com.jz.common.utils.web.SessionUtils;
import com.jz.dmp.modules.model.DmpMember;
import com.jz.dmp.modules.model.DmpOptLog; import com.jz.dmp.modules.model.DmpOptLog;
import com.jz.dmp.modules.model.DmpRole;
import com.jz.dmp.modules.service.DmpOptLogService; import com.jz.dmp.modules.service.DmpOptLogService;
/**系统操作日志 /**系统操作日志
...@@ -57,6 +61,13 @@ public class SysOperationLogAspect { ...@@ -57,6 +61,13 @@ public class SysOperationLogAspect {
dmpOptLog.setOptTime(optTime); dmpOptLog.setOptTime(optTime);
dmpOptLog.setCreateTime(optTime); dmpOptLog.setCreateTime(optTime);
// 保存操作用户信息
DmpMember dmpMember = SessionUtils.getSecurityUser();
dmpOptLog.setUserId(dmpMember.getUserId());
dmpOptLog.setUserName(dmpMember.getUserName());
dmpOptLog.setCreateUserId(dmpMember.getUserId());
//从切面织入点处通过反射机制获取织入点处的方法 //从切面织入点处通过反射机制获取织入点处的方法
MethodSignature signature = (MethodSignature) pjp.getSignature(); MethodSignature signature = (MethodSignature) pjp.getSignature();
//获取切入点所在的方法 //获取切入点所在的方法
...@@ -66,8 +77,25 @@ public class SysOperationLogAspect { ...@@ -66,8 +77,25 @@ public class SysOperationLogAspect {
if (operationLogAnnotation != null) { if (operationLogAnnotation != null) {
String optType = operationLogAnnotation.actionType(); String optType = operationLogAnnotation.actionType();
String optDesc = operationLogAnnotation.descrption(); String optDesc = operationLogAnnotation.descrption();
String optModular = operationLogAnnotation.optModular();
boolean isProjOpt = operationLogAnnotation.isProjOpt();
dmpOptLog.setOptType(optType);//保存获取的操作 dmpOptLog.setOptType(optType);//保存获取的操作
dmpOptLog.setOptDesc(optDesc); dmpOptLog.setOptDesc(optDesc);
dmpOptLog.setOptModular(optModular);
if (isProjOpt) {
dmpOptLog.setProjectId(dmpMember.getCurrentProjectId());
List<DmpRole> mprojRoleList = dmpMember.getMemberProjectRoleList();
String userRoles = mprojRoleList.stream().map(x->{
return x.getRoleName();
}).collect(Collectors.joining(","));
dmpOptLog.setUserRoles(userRoles);
}else {
List<DmpRole> memberRoleList = dmpMember.getMemberRoleList();
String userRoles = memberRoleList.stream().map(x->{
return x.getRoleName();
}).collect(Collectors.joining(","));
dmpOptLog.setUserRoles(userRoles);
}
} }
//获取请求的类名 //获取请求的类名
String className = pjp.getTarget().getClass().getName(); String className = pjp.getTarget().getClass().getName();
...@@ -89,12 +117,6 @@ public class SysOperationLogAspect { ...@@ -89,12 +117,6 @@ public class SysOperationLogAspect {
} }
dmpOptLog.setRequestParam(JSONObject.toJSONString(paramMap)); dmpOptLog.setRequestParam(JSONObject.toJSONString(paramMap));
// 保存操作用户信息
String userId = SessionUtils.getCurrentUserId();
dmpOptLog.setUserId(Integer.parseInt(userId));
dmpOptLog.setUserName(SessionUtils.getCurrentUserName());
dmpOptLog.setCreateUserId(Integer.parseInt(userId));
//设置ip //设置ip
String optIp = ""; String optIp = "";
try { try {
......
...@@ -46,7 +46,7 @@ public class DmpDevelopTaskController { ...@@ -46,7 +46,7 @@ public class DmpDevelopTaskController {
*/ */
@RequestMapping(method = RequestMethod.POST, value = "/findListWithPage") @RequestMapping(method = RequestMethod.POST, value = "/findListWithPage")
@ApiOperation(value = "分頁列表查询任务开发", notes = "分頁列表查询任务开发") @ApiOperation(value = "分頁列表查询任务开发", notes = "分頁列表查询任务开发")
@SysOperationLogAnnotation(actionType = "分頁列表查询任务开发", descrption = "分頁列表查询任务开发") @SysOperationLogAnnotation(actionType = "列表查询", descrption = "分頁列表查询任务开发", optModular = "任务开发--查询", isProjOpt = true)
public PageInfoResponse<DmpDevelopTaskDto> findListWithPage(@RequestBody DmpDevelopTaskRequest dmpDevelopTaskRequest, HttpServletRequest httpRequest){ public PageInfoResponse<DmpDevelopTaskDto> findListWithPage(@RequestBody DmpDevelopTaskRequest dmpDevelopTaskRequest, HttpServletRequest httpRequest){
PageInfoResponse<DmpDevelopTaskDto> pageInfo = new PageInfoResponse<DmpDevelopTaskDto>(); PageInfoResponse<DmpDevelopTaskDto> pageInfo = new PageInfoResponse<DmpDevelopTaskDto>();
try { try {
......
package com.jz.dmp.modules.controller;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.jz.common.annotation.MethodCallLogPrint;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.StatuConstant;
import com.jz.dmp.modules.controller.bean.DmpOptLogBatch;
import com.jz.dmp.modules.controller.bean.DmpOptLogDto;
import com.jz.dmp.modules.controller.bean.DmpOptLogRequest;
import com.jz.dmp.modules.model.DmpOptLog;
import com.jz.dmp.modules.service.DmpOptLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 操作日志表Controller
* @author ybz
*
*/
@RestController
@RequestMapping("/dmp/opt/log")
@Api(tags = "操作日志表")
public class DmpOptLogController {
@Autowired
private DmpOptLogService dmpOptLogService;
/**列表查询操作日志表
* @param dmpOptLogRequest
* @return
*/
@MethodCallLogPrint
@RequestMapping(method = RequestMethod.POST, value = "/findListWithPage")
@ApiOperation(value = "分頁列表查询操作日志表", notes = "分頁列表查询操作日志表")
public PageInfoResponse<DmpOptLogDto> findListWithPage(@RequestBody DmpOptLogRequest dmpOptLogRequest, HttpServletRequest httpRequest){
PageInfoResponse<DmpOptLogDto> pageInfo = new PageInfoResponse<DmpOptLogDto>();
try {
pageInfo = dmpOptLogService.findListWithPage(dmpOptLogRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
/**列表查询操作日志表
* @param dmpOptLogRequest
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.POST, value = "/findList")
//@ApiOperation(value = "列表查询操作日志表", notes = "列表查询操作日志表")
public BaseBeanResponse<DmpOptLogDto> findList(@RequestBody DmpOptLogRequest dmpOptLogRequest, HttpServletRequest httpRequest){
BaseBeanResponse<DmpOptLogDto> baseBeanResponse = new BaseBeanResponse<DmpOptLogDto>();
try {
baseBeanResponse = dmpOptLogService.findList(dmpOptLogRequest, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("查询失败");
baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**主键查询操作日志表
* @param dmpOptLogRequest
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.GET, value = "/view")
//@ApiOperation(value = "主键查询操作日志表", notes = "主键查询操作日志表")
//@ApiImplicitParam(name = "optId", value = "操作日志表主键")
public BaseBeanResponse<DmpOptLogDto> view(@RequestParam(name = "optId", required = true ) Integer optId, HttpServletRequest httpRequest){
BaseBeanResponse<DmpOptLogDto> baseBeanResponse = new BaseBeanResponse<DmpOptLogDto>();
try {
baseBeanResponse = dmpOptLogService.findById(optId, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("请求失败");
baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**删除操作日志表
* @param optId
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.GET, value = "/deleteById")
//@ApiOperation(value = "删除操作日志表", notes = "删除操作日志表")
//@ApiImplicitParam(name = "optId", value = "操作日志表主键")
public BaseResponse deleteById(@RequestParam(name = "optId", required = true ) Integer optId, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
baseResponse = dmpOptLogService.deleteById(optId, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("删除失败");
baseResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
/**软删除操作日志表
* @param optId
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.GET, value = "/softDeleteById")
//@ApiOperation(value = "软删除操作日志表", notes = "软删除操作日志表")
//@ApiImplicitParam(name = "optId", value = "操作日志表主键")
public BaseResponse softDeleteById(@RequestParam(name = "optId", required = true ) Integer optId, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
baseResponse = dmpOptLogService.softDeleteById(optId, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("软删除失败");
baseResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
/**删除操作日志表
* @param optId
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.GET, value = "/delete")
//@ApiOperation(value = "删除操作日志表", notes = "删除操作日志表")
//@ApiImplicitParam(name = "ids", value = "操作日志表主键集(逗号隔开)")
public BaseResponse delete(@RequestParam(name = "ids", required = true ) String ids, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
//参数封装
String[] idStrs = ids.split(",");
List<Integer> idList = Arrays.asList(idStrs).stream().map(x->{
return Integer.parseInt(x);
}).collect(Collectors.toList());
baseResponse = dmpOptLogService.deleteByIds(idList, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("删除失败");
baseResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
/**软删除操作日志表
* @param optId
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.GET, value = "/softDelete")
//@ApiOperation(value = "软删除操作日志表", notes = "软删除操作日志表")
//@ApiImplicitParam(name = "ids", value = "操作日志表主键集(逗号隔开)")
public BaseResponse softDelete(@RequestParam(name = "ids", required = true ) String ids, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
//参数封装
String[] idStrs = ids.split(",");
List<Integer> idList = Arrays.asList(idStrs).stream().map(x->{
return Integer.parseInt(x);
}).collect(Collectors.toList());
baseResponse = dmpOptLogService.softDeleteByIds(idList, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("软删除失败");
baseResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
/**条件删除操作日志表
* @param optId
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.POST, value = "/deleteByPojo")
//@ApiOperation(value = "条件删除操作日志表", notes = "条件删除操作日志表")
public BaseResponse deleteByPojo(@RequestBody DmpOptLogRequest dmpOptLogRequest, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
baseResponse = dmpOptLogService.delete(dmpOptLogRequest, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("删除失败");
baseResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
/**条件软删除操作日志表
* @param optId
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.POST, value = "/softDeleteByPojo")
//@ApiOperation(value = "条件软删除操作日志表", notes = "条件软删除操作日志表")
public BaseResponse softDeleteByPojo(@RequestBody DmpOptLogRequest dmpOptLogRequest, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
baseResponse = dmpOptLogService.softDelete(dmpOptLogRequest, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("软删除失败");
baseResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
/**新增操作日志表
* @param dmpOptLogRequest
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.POST, value = "/add")
//@ApiOperation(value = "新增操作日志表", notes = "新增操作日志表")
public BaseBeanResponse<DmpOptLog> add(@RequestBody DmpOptLog dmpOptLog, HttpServletRequest httpRequest){
BaseBeanResponse<DmpOptLog> baseBeanResponse = new BaseBeanResponse<DmpOptLog>();
try {
baseBeanResponse = dmpOptLogService.add(dmpOptLog, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("新增失败");
baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**批量新增操作日志表
* @param dmpOptLogRequest
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.POST, value = "/addBatch")
//@ApiOperation(value = "批量新增操作日志表", notes = "批量新增操作日志表")
public BaseBeanResponse<DmpOptLogBatch> addBatch(@RequestBody DmpOptLogBatch dmpOptLogBatch, HttpServletRequest httpRequest){
BaseBeanResponse<DmpOptLogBatch> baseBeanResponse = new BaseBeanResponse<DmpOptLogBatch>();
try {
baseBeanResponse = dmpOptLogService.addBatch(dmpOptLogBatch, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("批量新增失败");
baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**修改操作日志表
* @param dmpOptLogRequest
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.POST, value = "/edit")
//@ApiOperation(value = "修改操作日志表", notes = "修改操作日志表")
public BaseBeanResponse<DmpOptLog> edit(@RequestBody DmpOptLog dmpOptLog, HttpServletRequest httpRequest){
BaseBeanResponse<DmpOptLog> baseBeanResponse = new BaseBeanResponse<DmpOptLog>();
try {
baseBeanResponse = dmpOptLogService.edit(dmpOptLog, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("修改失败");
baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**新增或修改操作日志表
* @param dmpOptLogRequest
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.POST, value = "/addOrEdit")
//@ApiOperation(value = "新增或修改操作日志表", notes = "新增或修改操作日志表")
public BaseBeanResponse<DmpOptLog> addOrEdit(@RequestBody DmpOptLog dmpOptLog, HttpServletRequest httpRequest){
BaseBeanResponse<DmpOptLog> baseBeanResponse = new BaseBeanResponse<DmpOptLog>();
try {
baseBeanResponse = dmpOptLogService.addOrEdit(dmpOptLog, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("新增或修改失败");
baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
}
package com.jz.dmp.modules.controller.bean; package com.jz.dmp.modules.controller.bean;
import java.util.List; import java.util.List;
import com.jz.dmp.modules.model.DmpOptLog; import com.jz.dmp.modules.model.DmpOptLog;
/** /**
......
...@@ -16,23 +16,37 @@ public class DmpOptLogRequest extends BasePageBean { ...@@ -16,23 +16,37 @@ public class DmpOptLogRequest extends BasePageBean {
* 主键 * 主键
*/ */
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
@FieldAssist(orderBy = "log.opt_id") @FieldAssist(orderBy = "_log.opt_id")
private Integer optId; private Integer optId;
/** /**
* 操作人ID * 操作人ID
*/ */
@ApiModelProperty(value = "操作人ID") @ApiModelProperty(value = "操作人ID")
@FieldAssist(orderBy = "log.user_id") @FieldAssist(orderBy = "_log.user_id")
private Integer userId; private Integer userId;
/** /**
* 操作人姓名 * 操作人姓名
*/ */
@ApiModelProperty(value = "操作人姓名") @ApiModelProperty(value = "操作人姓名")
@FieldAssist(orderBy = "log.user_name") @FieldAssist(orderBy = "_log.user_name")
private String userName; private String userName;
/**
*
*/
@ApiModelProperty(value = "")
@FieldAssist(orderBy = "_log.user_roles")
private String userRoles;
/**
* 操作时间
*/
@ApiModelProperty(value = "操作时间")
@FieldAssist(orderBy = "_log.opt_time")
private Date optTime;
/** /**
* 操作时间起 * 操作时间起
*/ */
...@@ -45,69 +59,90 @@ public class DmpOptLogRequest extends BasePageBean { ...@@ -45,69 +59,90 @@ public class DmpOptLogRequest extends BasePageBean {
@ApiModelProperty(value = "操作时间止") @ApiModelProperty(value = "操作时间止")
private Date optTimeEnd; private Date optTimeEnd;
/**
* 操作功能模块
*/
@ApiModelProperty(value = "操作功能模块")
@FieldAssist(orderBy = "_log.opt_modular")
private String optModular;
/** /**
* 操作类型 * 操作类型
*/ */
@ApiModelProperty(value = "操作类型") @ApiModelProperty(value = "操作类型")
@FieldAssist(orderBy = "log.opt_type") @FieldAssist(orderBy = "_log.opt_type")
private String optType; private String optType;
/** /**
* 操作描述 * 操作描述
*/ */
@ApiModelProperty(value = "操作描述") @ApiModelProperty(value = "操作描述")
@FieldAssist(orderBy = "log.opt_desc") @FieldAssist(orderBy = "_log.opt_desc")
private String optDesc; private String optDesc;
/** /**
* 操作方法 * 操作方法
*/ */
@ApiModelProperty(value = "操作方法") @ApiModelProperty(value = "操作方法")
@FieldAssist(orderBy = "log.method") @FieldAssist(orderBy = "_log.method")
private String method; private String method;
/** /**
* 请求参数 * 请求参数
*/ */
@ApiModelProperty(value = "请求参数") @ApiModelProperty(value = "请求参数")
@FieldAssist(orderBy = "log.request_param") @FieldAssist(orderBy = "_log.request_param")
private String requestParam; private String requestParam;
/** /**
* 操作结果 * 操作结果
*/ */
@ApiModelProperty(value = "操作结果") @ApiModelProperty(value = "操作结果")
@FieldAssist(orderBy = "log.opt_result") @FieldAssist(orderBy = "_log.opt_result")
private String optResult; private String optResult;
/** /**
* IP地址 * IP地址
*/ */
@ApiModelProperty(value = "IP地址") @ApiModelProperty(value = "IP地址")
@FieldAssist(orderBy = "log.opt_ip") @FieldAssist(orderBy = "_log.opt_ip")
private String optIp; private String optIp;
/**
*
*/
@ApiModelProperty(value = "")
@FieldAssist(orderBy = "_log.project_id")
private Integer projectId;
/** /**
* 备注 * 备注
*/ */
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
@FieldAssist(orderBy = "log.remark") @FieldAssist(orderBy = "_log.remark")
private String remark; private String remark;
/** /**
* 数据状态(0:删除,1,未删除) * 数据状态(0:删除,1,未删除)
*/ */
@ApiModelProperty(value = "数据状态(0:删除,1,未删除)") @ApiModelProperty(value = "数据状态(0:删除,1,未删除)")
@FieldAssist(orderBy = "log.data_status") @FieldAssist(orderBy = "_log.data_status")
private String dataStatus; private String dataStatus;
/** /**
* 创建用户ID * 创建用户ID
*/ */
@ApiModelProperty(value = "创建用户ID") @ApiModelProperty(value = "创建用户ID")
@FieldAssist(orderBy = "log.create_user_id") @FieldAssist(orderBy = "_log.create_user_id")
private Integer createUserId; private Integer createUserId;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@FieldAssist(orderBy = "_log.create_time")
private Date createTime;
/** /**
* 创建时间起 * 创建时间起
*/ */
...@@ -124,9 +159,16 @@ public class DmpOptLogRequest extends BasePageBean { ...@@ -124,9 +159,16 @@ public class DmpOptLogRequest extends BasePageBean {
* 修改用户ID * 修改用户ID
*/ */
@ApiModelProperty(value = "修改用户ID") @ApiModelProperty(value = "修改用户ID")
@FieldAssist(orderBy = "log.update_user_id") @FieldAssist(orderBy = "_log.update_user_id")
private Integer updateUserId; private Integer updateUserId;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
@FieldAssist(orderBy = "_log.update_time")
private Date updateTime;
/** /**
* 修改时间起 * 修改时间起
*/ */
...@@ -163,6 +205,22 @@ public class DmpOptLogRequest extends BasePageBean { ...@@ -163,6 +205,22 @@ public class DmpOptLogRequest extends BasePageBean {
this.userName = userName; this.userName = userName;
} }
public String getUserRoles() {
return userRoles;
}
public void setUserRoles(String userRoles) {
this.userRoles = userRoles;
}
public Date getOptTime() {
return optTime;
}
public void setOptTime(Date optTime) {
this.optTime = optTime;
}
public Date getOptTimeStart() { public Date getOptTimeStart() {
return optTimeStart; return optTimeStart;
} }
...@@ -179,6 +237,14 @@ public class DmpOptLogRequest extends BasePageBean { ...@@ -179,6 +237,14 @@ public class DmpOptLogRequest extends BasePageBean {
this.optTimeEnd = optTimeEnd; this.optTimeEnd = optTimeEnd;
} }
public String getOptModular() {
return optModular;
}
public void setOptModular(String optModular) {
this.optModular = optModular;
}
public String getOptType() { public String getOptType() {
return optType; return optType;
} }
...@@ -227,6 +293,14 @@ public class DmpOptLogRequest extends BasePageBean { ...@@ -227,6 +293,14 @@ public class DmpOptLogRequest extends BasePageBean {
this.optIp = optIp; this.optIp = optIp;
} }
public Integer getProjectId() {
return projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
public String getRemark() { public String getRemark() {
return remark; return remark;
} }
...@@ -251,6 +325,14 @@ public class DmpOptLogRequest extends BasePageBean { ...@@ -251,6 +325,14 @@ public class DmpOptLogRequest extends BasePageBean {
this.createUserId = createUserId; this.createUserId = createUserId;
} }
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getCreateTimeStart() { public Date getCreateTimeStart() {
return createTimeStart; return createTimeStart;
} }
...@@ -275,6 +357,14 @@ public class DmpOptLogRequest extends BasePageBean { ...@@ -275,6 +357,14 @@ public class DmpOptLogRequest extends BasePageBean {
this.updateUserId = updateUserId; this.updateUserId = updateUserId;
} }
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Date getUpdateTimeStart() { public Date getUpdateTimeStart() {
return updateTimeStart; return updateTimeStart;
} }
......
...@@ -27,6 +27,9 @@ public class MyDmpDevelopTaskConverter { ...@@ -27,6 +27,9 @@ public class MyDmpDevelopTaskConverter {
} }
public DmpDevelopTaskDto domain2dto(DmpDevelopTask dmpDevelopTask) { public DmpDevelopTaskDto domain2dto(DmpDevelopTask dmpDevelopTask) {
if (dmpDevelopTask == null) {
return null;
}
DmpDevelopTaskDto dmpDevelopTaskDto = new DmpDevelopTaskDto(); DmpDevelopTaskDto dmpDevelopTaskDto = new DmpDevelopTaskDto();
BeanUtils.copyProperties(dmpDevelopTask, dmpDevelopTaskDto); BeanUtils.copyProperties(dmpDevelopTask, dmpDevelopTaskDto);
......
package com.jz.dmp.modules.controller.bean;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.BeanUtils;
import com.jz.dmp.modules.controller.sys.bean.DmpMemberDto;
import com.jz.dmp.modules.model.DmpMember;
public class MyDmpMemberConverter {
private static MyDmpMemberConverter instance;
private MyDmpMemberConverter() {};
public synchronized static MyDmpMemberConverter INSTANCE() {
if (instance==null) {
instance = new MyDmpMemberConverter();
}
return instance;
}
public DmpMemberDto domain2dto(DmpMember dmpMember) {
if (dmpMember==null) {
return null;
}
DmpMemberDto dmpMemberDto = new DmpMemberDto();
BeanUtils.copyProperties(dmpMember, dmpMemberDto);
return dmpMemberDto;
}
public List<DmpMemberDto> domain2dto(List<DmpMember> dmpMembers) {
List<DmpMemberDto> dmpMemberDtos = new ArrayList<DmpMemberDto>();
dmpMembers.stream().forEach(x -> {
dmpMemberDtos.add(domain2dto(x));
});
return dmpMemberDtos;
}
public DmpMember dto2domain(DmpMemberDto dmpMemberDto) {
if (dmpMemberDto==null) {
return null;
}
DmpMember dmpMember = new DmpMember();
BeanUtils.copyProperties(dmpMemberDto, dmpMember);
return dmpMember;
}
public List<DmpMember> dto2domain(List<DmpMemberDto> dmpMemberDtos) {
List<DmpMember> dmpMembers = new ArrayList<DmpMember>();
dmpMemberDtos.stream().forEach(x -> {
dmpMembers.add(dto2domain(x));
});
return dmpMembers;
}
}
...@@ -45,7 +45,7 @@ public class MyDmpOptLogConverter { ...@@ -45,7 +45,7 @@ public class MyDmpOptLogConverter {
public List<DmpOptLog> dto2domain(List<DmpOptLogDto> dmpOptLogDtos) { public List<DmpOptLog> dto2domain(List<DmpOptLogDto> dmpOptLogDtos) {
List<DmpOptLog> dmpOptLogs = new ArrayList<DmpOptLog>(); List<DmpOptLog> dmpOptLogs = new ArrayList<DmpOptLog>();
dmpOptLogDtos.stream().forEach(x -> { dmpOptLogDtos.stream().forEach(x -> {
dmpOptLogs.add(domain2dto(x)); dmpOptLogs.add(dto2domain(x));
}); });
return dmpOptLogs; return dmpOptLogs;
......
...@@ -99,6 +99,25 @@ public class DmpMemberController { ...@@ -99,6 +99,25 @@ public class DmpMemberController {
return baseBeanResponse; return baseBeanResponse;
} }
/**获取登录用户信息
* @param dmpMemberRequest
* @return
*/
@RequestMapping(method = RequestMethod.GET, value = "/getLoginUserInfo")
@ApiOperation(value = "获取登录用户信息", notes = "获取登录用户信息")
public BaseBeanResponse<DmpMemberDto> getLoginUserInfo(HttpServletRequest httpRequest){
BaseBeanResponse<DmpMemberDto> baseBeanResponse = new BaseBeanResponse<DmpMemberDto>();
try {
baseBeanResponse = dmpMemberService.getLoginUserInfo(httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("请求失败");
baseBeanResponse.setCode(ResultCode.INTERNAL_SERVER_ERROR.val());
e.printStackTrace();
}
return baseBeanResponse;
}
/**删除用户表 /**删除用户表
* @param userId * @param userId
* @return * @return
......
...@@ -36,6 +36,12 @@ public class DmpOptLog implements Serializable{ ...@@ -36,6 +36,12 @@ public class DmpOptLog implements Serializable{
@ApiModelProperty(value = "操作人姓名") @ApiModelProperty(value = "操作人姓名")
private String userName; private String userName;
/**
*
*/
@ApiModelProperty(value = "")
private String userRoles;
/** /**
* 操作时间 * 操作时间
*/ */
...@@ -43,6 +49,12 @@ public class DmpOptLog implements Serializable{ ...@@ -43,6 +49,12 @@ public class DmpOptLog implements Serializable{
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date optTime; private Date optTime;
/**
* 操作功能模块
*/
@ApiModelProperty(value = "操作功能模块")
private String optModular;
/** /**
* 操作类型 * 操作类型
*/ */
...@@ -79,6 +91,12 @@ public class DmpOptLog implements Serializable{ ...@@ -79,6 +91,12 @@ public class DmpOptLog implements Serializable{
@ApiModelProperty(value = "IP地址") @ApiModelProperty(value = "IP地址")
private String optIp; private String optIp;
/**
*
*/
@ApiModelProperty(value = "")
private Integer projectId;
/** /**
* 备注 * 备注
*/ */
...@@ -141,6 +159,14 @@ public class DmpOptLog implements Serializable{ ...@@ -141,6 +159,14 @@ public class DmpOptLog implements Serializable{
this.userName = userName; this.userName = userName;
} }
public String getUserRoles() {
return userRoles;
}
public void setUserRoles(String userRoles) {
this.userRoles = userRoles;
}
public Date getOptTime() { public Date getOptTime() {
return optTime; return optTime;
} }
...@@ -149,6 +175,14 @@ public class DmpOptLog implements Serializable{ ...@@ -149,6 +175,14 @@ public class DmpOptLog implements Serializable{
this.optTime = optTime; this.optTime = optTime;
} }
public String getOptModular() {
return optModular;
}
public void setOptModular(String optModular) {
this.optModular = optModular;
}
public String getOptType() { public String getOptType() {
return optType; return optType;
} }
...@@ -197,6 +231,14 @@ public class DmpOptLog implements Serializable{ ...@@ -197,6 +231,14 @@ public class DmpOptLog implements Serializable{
this.optIp = optIp; this.optIp = optIp;
} }
public Integer getProjectId() {
return projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
public String getRemark() { public String getRemark() {
return remark; return remark;
} }
......
...@@ -5,9 +5,7 @@ import java.util.HashMap; ...@@ -5,9 +5,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -15,7 +13,6 @@ import org.springframework.stereotype.Service; ...@@ -15,7 +13,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -78,6 +75,10 @@ public class DmpOptLogServiceImpl extends BaseService implements DmpOptLogServic ...@@ -78,6 +75,10 @@ public class DmpOptLogServiceImpl extends BaseService implements DmpOptLogServic
if (dmpOptLogRequest.getOptTimeEnd() != null) { if (dmpOptLogRequest.getOptTimeEnd() != null) {
param.put("optTimeEnd", dmpOptLogRequest.getOptTimeEnd()); param.put("optTimeEnd", dmpOptLogRequest.getOptTimeEnd());
} }
//操作功能模块
if (!StringUtils.isEmpty(dmpOptLogRequest.getOptModular())) {
param.put("optModular", dmpOptLogRequest.getOptModular());
}
//操作类型 //操作类型
if (!StringUtils.isEmpty(dmpOptLogRequest.getOptType())) { if (!StringUtils.isEmpty(dmpOptLogRequest.getOptType())) {
param.put("optType", dmpOptLogRequest.getOptType()); param.put("optType", dmpOptLogRequest.getOptType());
...@@ -187,6 +188,10 @@ public class DmpOptLogServiceImpl extends BaseService implements DmpOptLogServic ...@@ -187,6 +188,10 @@ public class DmpOptLogServiceImpl extends BaseService implements DmpOptLogServic
if (dmpOptLogRequest.getOptTimeEnd() != null) { if (dmpOptLogRequest.getOptTimeEnd() != null) {
param.put("optTimeEnd", dmpOptLogRequest.getOptTimeEnd()); param.put("optTimeEnd", dmpOptLogRequest.getOptTimeEnd());
} }
//操作功能模块
if (!StringUtils.isEmpty(dmpOptLogRequest.getOptModular())) {
param.put("optModular", dmpOptLogRequest.getOptModular());
}
//操作类型 //操作类型
if (!StringUtils.isEmpty(dmpOptLogRequest.getOptType())) { if (!StringUtils.isEmpty(dmpOptLogRequest.getOptType())) {
param.put("optType", dmpOptLogRequest.getOptType()); param.put("optType", dmpOptLogRequest.getOptType());
...@@ -444,6 +449,10 @@ public class DmpOptLogServiceImpl extends BaseService implements DmpOptLogServic ...@@ -444,6 +449,10 @@ public class DmpOptLogServiceImpl extends BaseService implements DmpOptLogServic
if (dmpOptLogRequest.getOptTimeEnd() != null) { if (dmpOptLogRequest.getOptTimeEnd() != null) {
param.put("optTimeEnd", dmpOptLogRequest.getOptTimeEnd()); param.put("optTimeEnd", dmpOptLogRequest.getOptTimeEnd());
} }
//操作功能模块
if (!StringUtils.isEmpty(dmpOptLogRequest.getOptModular())) {
param.put("optModular", dmpOptLogRequest.getOptModular());
}
//操作类型 //操作类型
if (!StringUtils.isEmpty(dmpOptLogRequest.getOptType())) { if (!StringUtils.isEmpty(dmpOptLogRequest.getOptType())) {
param.put("optType", dmpOptLogRequest.getOptType()); param.put("optType", dmpOptLogRequest.getOptType());
...@@ -542,6 +551,10 @@ public class DmpOptLogServiceImpl extends BaseService implements DmpOptLogServic ...@@ -542,6 +551,10 @@ public class DmpOptLogServiceImpl extends BaseService implements DmpOptLogServic
if (dmpOptLogRequest.getOptTimeEnd() != null) { if (dmpOptLogRequest.getOptTimeEnd() != null) {
param.put("optTimeEnd", dmpOptLogRequest.getOptTimeEnd()); param.put("optTimeEnd", dmpOptLogRequest.getOptTimeEnd());
} }
//操作功能模块
if (!StringUtils.isEmpty(dmpOptLogRequest.getOptModular())) {
param.put("optModular", dmpOptLogRequest.getOptModular());
}
//操作类型 //操作类型
if (!StringUtils.isEmpty(dmpOptLogRequest.getOptType())) { if (!StringUtils.isEmpty(dmpOptLogRequest.getOptType())) {
param.put("optType", dmpOptLogRequest.getOptType()); param.put("optType", dmpOptLogRequest.getOptType());
......
...@@ -145,4 +145,15 @@ public interface DmpMemberService { ...@@ -145,4 +145,15 @@ public interface DmpMemberService {
*/ */
public BaseResponse softDeleteByIds(List<Integer> idList, HttpServletRequest httpRequest)throws Exception; public BaseResponse softDeleteByIds(List<Integer> idList, HttpServletRequest httpRequest)throws Exception;
/**
* @Title: getLoginUserInfo
* @Description: TODO(获取当前登录用户信息)
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseBeanResponse<DmpMemberDto> 返回类型
* @throws
*/
public BaseBeanResponse<DmpMemberDto> getLoginUserInfo(HttpServletRequest httpRequest)throws Exception;
} }
...@@ -31,6 +31,7 @@ import com.jz.common.constant.ResultCode; ...@@ -31,6 +31,7 @@ import com.jz.common.constant.ResultCode;
import com.jz.common.constant.StatuConstant; import com.jz.common.constant.StatuConstant;
import com.jz.common.persistence.BaseService; import com.jz.common.persistence.BaseService;
import com.jz.common.utils.web.SessionUtils; import com.jz.common.utils.web.SessionUtils;
import com.jz.dmp.modules.controller.bean.MyDmpMemberConverter;
import com.jz.dmp.modules.controller.sys.bean.DmpMemberBatch; import com.jz.dmp.modules.controller.sys.bean.DmpMemberBatch;
import com.jz.dmp.modules.controller.sys.bean.DmpMemberDto; import com.jz.dmp.modules.controller.sys.bean.DmpMemberDto;
import com.jz.dmp.modules.controller.sys.bean.DmpMemberRequest; import com.jz.dmp.modules.controller.sys.bean.DmpMemberRequest;
...@@ -543,5 +544,22 @@ public class DmpMemberServiceImpl extends BaseService implements DmpMemberServic ...@@ -543,5 +544,22 @@ public class DmpMemberServiceImpl extends BaseService implements DmpMemberServic
return baseResponse; return baseResponse;
} }
/**
*获取当前登录用户信息
*/
@Override
public BaseBeanResponse<DmpMemberDto> getLoginUserInfo(HttpServletRequest httpRequest) throws Exception {
BaseBeanResponse<DmpMemberDto> baseBeanResponse = new BaseBeanResponse<>();
DmpMember dmpMember = SessionUtils.getSecurityUser();
DmpMemberDto dmpMemberDto = MyDmpMemberConverter.INSTANCE().domain2dto(dmpMember);
baseBeanResponse.setCode(ResultCode.SUCCESS.val());
baseBeanResponse.setMessage("查询成功");
baseBeanResponse.setData(dmpMemberDto);
return baseBeanResponse;
}
} }
...@@ -5,13 +5,16 @@ ...@@ -5,13 +5,16 @@
<result column="opt_id" property="optId" jdbcType="INTEGER" /> <result column="opt_id" property="optId" jdbcType="INTEGER" />
<result column="user_id" property="userId" jdbcType="INTEGER" /> <result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="user_name" property="userName" jdbcType="VARCHAR" /> <result column="user_name" property="userName" jdbcType="VARCHAR" />
<result column="user_roles" property="userRoles" jdbcType="VARCHAR" />
<result column="opt_time" property="optTime" jdbcType="TIMESTAMP" /> <result column="opt_time" property="optTime" jdbcType="TIMESTAMP" />
<result column="opt_modular" property="optModular" jdbcType="VARCHAR" />
<result column="opt_type" property="optType" jdbcType="VARCHAR" /> <result column="opt_type" property="optType" jdbcType="VARCHAR" />
<result column="opt_desc" property="optDesc" jdbcType="VARCHAR" /> <result column="opt_desc" property="optDesc" jdbcType="VARCHAR" />
<result column="method" property="method" jdbcType="VARCHAR" /> <result column="method" property="method" jdbcType="VARCHAR" />
<result column="request_param" property="requestParam" jdbcType="LONGVARCHAR" /> <result column="request_param" property="requestParam" jdbcType="LONGVARCHAR" />
<result column="opt_result" property="optResult" jdbcType="LONGVARCHAR" /> <result column="opt_result" property="optResult" jdbcType="LONGVARCHAR" />
<result column="opt_ip" property="optIp" jdbcType="VARCHAR" /> <result column="opt_ip" property="optIp" jdbcType="VARCHAR" />
<result column="project_id" property="projectId" jdbcType="INTEGER" />
<result column="remark" property="remark" jdbcType="VARCHAR" /> <result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="data_status" property="dataStatus" jdbcType="CHAR" /> <result column="data_status" property="dataStatus" jdbcType="CHAR" />
<result column="create_user_id" property="createUserId" jdbcType="INTEGER" /> <result column="create_user_id" property="createUserId" jdbcType="INTEGER" />
...@@ -25,10 +28,10 @@ ...@@ -25,10 +28,10 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
log.opt_id, log.user_id, log.user_name, log.opt_time, log.opt_type, _log.opt_id, _log.user_id, _log.user_name, _log.user_roles, _log.opt_time,
log.opt_desc, log.method, log.request_param, log.opt_result, log.opt_ip, _log.opt_modular, _log.opt_type, _log.opt_desc, _log.method, _log.request_param,
log.remark, log.data_status, log.create_user_id, log.create_time, log.update_user_id, _log.opt_result, _log.opt_ip, _log.project_id, _log.remark, _log.data_status,
log.update_time _log.create_user_id, _log.create_time, _log.update_user_id, _log.update_time
</sql> </sql>
<sql id="BaseDto_Column_List"> <sql id="BaseDto_Column_List">
...@@ -40,9 +43,9 @@ ...@@ -40,9 +43,9 @@
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from dmp_opt_log log from dmp_opt_log _log
where log.opt_id = #{optId,jdbcType=INTEGER} where _log.opt_id = #{optId,jdbcType=INTEGER}
AND log.data_status='1' AND _log.data_status='1'
</select> </select>
<!-- 根据主键删除操作日志表 --> <!-- 根据主键删除操作日志表 -->
...@@ -65,61 +68,70 @@ ...@@ -65,61 +68,70 @@
delete from dmp_opt_log delete from dmp_opt_log
<where> <where>
<if test="optId != null" > <if test="optId != null" >
AND log.opt_id = #{optId,jdbcType=INTEGER} AND _log.opt_id = #{optId,jdbcType=INTEGER}
</if> </if>
<if test="userId != null" > <if test="userId != null" >
AND log.user_id = #{userId,jdbcType=INTEGER} AND _log.user_id = #{userId,jdbcType=INTEGER}
</if> </if>
<if test="userName != null" > <if test="userName != null" >
AND log.user_name = #{userName,jdbcType=VARCHAR} AND _log.user_name = #{userName,jdbcType=VARCHAR}
</if>
<if test="userRoles != null" >
AND _log.user_roles = #{userRoles,jdbcType=VARCHAR}
</if> </if>
<if test="optTimeStart != null" > <if test="optTimeStart != null" >
AND log.opt_time >= #{optTimeStart,jdbcType=TIMESTAMP} AND _log.opt_time >= #{optTimeStart,jdbcType=TIMESTAMP}
</if> </if>
<if test="optTimeEnd != null" > <if test="optTimeEnd != null" >
AND log.opt_time <![CDATA[ <= ]]> #{optTimeEnd,jdbcType=TIMESTAMP} AND _log.opt_time <![CDATA[ <= ]]> #{optTimeEnd,jdbcType=TIMESTAMP}
</if>
<if test="optModular != null" >
AND _log.opt_modular = #{optModular,jdbcType=VARCHAR}
</if> </if>
<if test="optType != null" > <if test="optType != null" >
AND log.opt_type = #{optType,jdbcType=VARCHAR} AND _log.opt_type = #{optType,jdbcType=VARCHAR}
</if> </if>
<if test="optDesc != null" > <if test="optDesc != null" >
AND log.opt_desc = #{optDesc,jdbcType=VARCHAR} AND _log.opt_desc = #{optDesc,jdbcType=VARCHAR}
</if> </if>
<if test="method != null" > <if test="method != null" >
AND log.method = #{method,jdbcType=VARCHAR} AND _log.method = #{method,jdbcType=VARCHAR}
</if> </if>
<if test="requestParam != null" > <if test="requestParam != null" >
AND log.request_param = #{requestParam,jdbcType=LONGVARCHAR} AND _log.request_param = #{requestParam,jdbcType=LONGVARCHAR}
</if> </if>
<if test="optResult != null" > <if test="optResult != null" >
AND log.opt_result = #{optResult,jdbcType=LONGVARCHAR} AND _log.opt_result = #{optResult,jdbcType=LONGVARCHAR}
</if> </if>
<if test="optIp != null" > <if test="optIp != null" >
AND log.opt_ip = #{optIp,jdbcType=VARCHAR} AND _log.opt_ip = #{optIp,jdbcType=VARCHAR}
</if>
<if test="projectId != null" >
AND _log.project_id = #{projectId,jdbcType=INTEGER}
</if> </if>
<if test="remark != null" > <if test="remark != null" >
AND log.remark = #{remark,jdbcType=VARCHAR} AND _log.remark = #{remark,jdbcType=VARCHAR}
</if> </if>
<if test="dataStatus != null" > <if test="dataStatus != null" >
AND log.data_status = #{dataStatus,jdbcType=CHAR} AND _log.data_status = #{dataStatus,jdbcType=CHAR}
</if> </if>
<if test="createUserId != null" > <if test="createUserId != null" >
AND log.create_user_id = #{createUserId,jdbcType=INTEGER} AND _log.create_user_id = #{createUserId,jdbcType=INTEGER}
</if> </if>
<if test="createTimeStart != null" > <if test="createTimeStart != null" >
AND log.create_time >= #{createTimeStart,jdbcType=TIMESTAMP} AND _log.create_time >= #{createTimeStart,jdbcType=TIMESTAMP}
</if> </if>
<if test="createTimeEnd != null" > <if test="createTimeEnd != null" >
AND log.create_time <![CDATA[ <= ]]> #{createTimeEnd,jdbcType=TIMESTAMP} AND _log.create_time <![CDATA[ <= ]]> #{createTimeEnd,jdbcType=TIMESTAMP}
</if> </if>
<if test="updateUserId != null" > <if test="updateUserId != null" >
AND log.update_user_id = #{updateUserId,jdbcType=INTEGER} AND _log.update_user_id = #{updateUserId,jdbcType=INTEGER}
</if> </if>
<if test="updateTimeStart != null" > <if test="updateTimeStart != null" >
AND log.update_time >= #{updateTimeStart,jdbcType=TIMESTAMP} AND _log.update_time >= #{updateTimeStart,jdbcType=TIMESTAMP}
</if> </if>
<if test="updateTimeEnd != null" > <if test="updateTimeEnd != null" >
AND log.update_time <![CDATA[ <= ]]> #{updateTimeEnd,jdbcType=TIMESTAMP} AND _log.update_time <![CDATA[ <= ]]> #{updateTimeEnd,jdbcType=TIMESTAMP}
</if> </if>
AND data_status='1' AND data_status='1'
</where> </where>
...@@ -133,61 +145,70 @@ ...@@ -133,61 +145,70 @@
</set> </set>
<where> <where>
<if test="optId != null" > <if test="optId != null" >
AND log.opt_id = #{optId,jdbcType=INTEGER} AND _log.opt_id = #{optId,jdbcType=INTEGER}
</if> </if>
<if test="userId != null" > <if test="userId != null" >
AND log.user_id = #{userId,jdbcType=INTEGER} AND _log.user_id = #{userId,jdbcType=INTEGER}
</if> </if>
<if test="userName != null" > <if test="userName != null" >
AND log.user_name = #{userName,jdbcType=VARCHAR} AND _log.user_name = #{userName,jdbcType=VARCHAR}
</if>
<if test="userRoles != null" >
AND _log.user_roles = #{userRoles,jdbcType=VARCHAR}
</if> </if>
<if test="optTimeStart != null" > <if test="optTimeStart != null" >
AND log.opt_time >= #{optTimeStart,jdbcType=TIMESTAMP} AND _log.opt_time >= #{optTimeStart,jdbcType=TIMESTAMP}
</if> </if>
<if test="optTimeEnd != null" > <if test="optTimeEnd != null" >
AND log.opt_time <![CDATA[ <= ]]> #{optTimeEnd,jdbcType=TIMESTAMP} AND _log.opt_time <![CDATA[ <= ]]> #{optTimeEnd,jdbcType=TIMESTAMP}
</if>
<if test="optModular != null" >
AND _log.opt_modular = #{optModular,jdbcType=VARCHAR}
</if> </if>
<if test="optType != null" > <if test="optType != null" >
AND log.opt_type = #{optType,jdbcType=VARCHAR} AND _log.opt_type = #{optType,jdbcType=VARCHAR}
</if> </if>
<if test="optDesc != null" > <if test="optDesc != null" >
AND log.opt_desc = #{optDesc,jdbcType=VARCHAR} AND _log.opt_desc = #{optDesc,jdbcType=VARCHAR}
</if> </if>
<if test="method != null" > <if test="method != null" >
AND log.method = #{method,jdbcType=VARCHAR} AND _log.method = #{method,jdbcType=VARCHAR}
</if> </if>
<if test="requestParam != null" > <if test="requestParam != null" >
AND log.request_param = #{requestParam,jdbcType=LONGVARCHAR} AND _log.request_param = #{requestParam,jdbcType=LONGVARCHAR}
</if> </if>
<if test="optResult != null" > <if test="optResult != null" >
AND log.opt_result = #{optResult,jdbcType=LONGVARCHAR} AND _log.opt_result = #{optResult,jdbcType=LONGVARCHAR}
</if> </if>
<if test="optIp != null" > <if test="optIp != null" >
AND log.opt_ip = #{optIp,jdbcType=VARCHAR} AND _log.opt_ip = #{optIp,jdbcType=VARCHAR}
</if>
<if test="projectId != null" >
AND _log.project_id = #{projectId,jdbcType=INTEGER}
</if> </if>
<if test="remark != null" > <if test="remark != null" >
AND log.remark = #{remark,jdbcType=VARCHAR} AND _log.remark = #{remark,jdbcType=VARCHAR}
</if> </if>
<if test="dataStatus != null" > <if test="dataStatus != null" >
AND log.data_status = #{dataStatus,jdbcType=CHAR} AND _log.data_status = #{dataStatus,jdbcType=CHAR}
</if> </if>
<if test="createUserId != null" > <if test="createUserId != null" >
AND log.create_user_id = #{createUserId,jdbcType=INTEGER} AND _log.create_user_id = #{createUserId,jdbcType=INTEGER}
</if> </if>
<if test="createTimeStart != null" > <if test="createTimeStart != null" >
AND log.create_time >= #{createTimeStart,jdbcType=TIMESTAMP} AND _log.create_time >= #{createTimeStart,jdbcType=TIMESTAMP}
</if> </if>
<if test="createTimeEnd != null" > <if test="createTimeEnd != null" >
AND log.create_time <![CDATA[ <= ]]> #{createTimeEnd,jdbcType=TIMESTAMP} AND _log.create_time <![CDATA[ <= ]]> #{createTimeEnd,jdbcType=TIMESTAMP}
</if> </if>
<if test="updateUserId != null" > <if test="updateUserId != null" >
AND log.update_user_id = #{updateUserId,jdbcType=INTEGER} AND _log.update_user_id = #{updateUserId,jdbcType=INTEGER}
</if> </if>
<if test="updateTimeStart != null" > <if test="updateTimeStart != null" >
AND log.update_time >= #{updateTimeStart,jdbcType=TIMESTAMP} AND _log.update_time >= #{updateTimeStart,jdbcType=TIMESTAMP}
</if> </if>
<if test="updateTimeEnd != null" > <if test="updateTimeEnd != null" >
AND log.update_time <![CDATA[ <= ]]> #{updateTimeEnd,jdbcType=TIMESTAMP} AND _log.update_time <![CDATA[ <= ]]> #{updateTimeEnd,jdbcType=TIMESTAMP}
</if> </if>
AND data_status='1' AND data_status='1'
</where> </where>
...@@ -196,34 +217,34 @@ ...@@ -196,34 +217,34 @@
<!-- 插入操作日志表 --> <!-- 插入操作日志表 -->
<insert id="insert" parameterType="com.jz.dmp.modules.model.DmpOptLog"> <insert id="insert" parameterType="com.jz.dmp.modules.model.DmpOptLog">
insert into dmp_opt_log ( insert into dmp_opt_log (
opt_id, user_id, user_name, opt_time, opt_type, opt_id, user_id, user_name, user_roles, opt_time,
opt_desc, method, request_param, opt_result, opt_ip, opt_modular, opt_type, opt_desc, method, request_param,
remark, data_status, create_user_id, create_time, update_user_id, opt_result, opt_ip, project_id, remark, data_status,
update_time create_user_id, create_time, update_user_id, update_time
) )
values ( values (
#{optId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{optTime,jdbcType=TIMESTAMP}, #{optType,jdbcType=VARCHAR}, #{optId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{userRoles,jdbcType=VARCHAR}, #{optTime,jdbcType=TIMESTAMP},
#{optDesc,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{requestParam,jdbcType=LONGVARCHAR}, #{optResult,jdbcType=LONGVARCHAR}, #{optIp,jdbcType=VARCHAR}, #{optModular,jdbcType=VARCHAR}, #{optType,jdbcType=VARCHAR}, #{optDesc,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{requestParam,jdbcType=LONGVARCHAR},
#{remark,jdbcType=VARCHAR}, #{dataStatus,jdbcType=CHAR}, #{createUserId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=INTEGER}, #{optResult,jdbcType=LONGVARCHAR}, #{optIp,jdbcType=VARCHAR}, #{projectId,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{dataStatus,jdbcType=CHAR},
#{updateTime,jdbcType=TIMESTAMP} #{createUserId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}
) )
</insert> </insert>
<!-- 批量新增操作日志表 --> <!-- 批量新增操作日志表 -->
<insert id="insertBatch" parameterType="com.jz.dmp.modules.model.DmpOptLog"> <insert id="insertBatch" parameterType="com.jz.dmp.modules.model.DmpOptLog">
insert into dmp_opt_log ( insert into dmp_opt_log (
opt_id, user_id, user_name, opt_time, opt_type, opt_id, user_id, user_name, user_roles, opt_time,
opt_desc, method, request_param, opt_result, opt_ip, opt_modular, opt_type, opt_desc, method, request_param,
remark, data_status, create_user_id, create_time, update_user_id, opt_result, opt_ip, project_id, remark, data_status,
update_time create_user_id, create_time, update_user_id, update_time
) )
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.optId,jdbcType=INTEGER}, #{item.userId,jdbcType=INTEGER}, #{item.userName,jdbcType=VARCHAR}, #{item.optTime,jdbcType=TIMESTAMP}, #{item.optType,jdbcType=VARCHAR}, #{item.optId,jdbcType=INTEGER}, #{item.userId,jdbcType=INTEGER}, #{item.userName,jdbcType=VARCHAR}, #{item.userRoles,jdbcType=VARCHAR}, #{item.optTime,jdbcType=TIMESTAMP},
#{item.optDesc,jdbcType=VARCHAR}, #{item.method,jdbcType=VARCHAR}, #{item.requestParam,jdbcType=LONGVARCHAR}, #{item.optResult,jdbcType=LONGVARCHAR}, #{item.optIp,jdbcType=VARCHAR}, #{item.optModular,jdbcType=VARCHAR}, #{item.optType,jdbcType=VARCHAR}, #{item.optDesc,jdbcType=VARCHAR}, #{item.method,jdbcType=VARCHAR}, #{item.requestParam,jdbcType=LONGVARCHAR},
#{item.remark,jdbcType=VARCHAR}, #{item.dataStatus,jdbcType=CHAR}, #{item.createUserId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateUserId,jdbcType=INTEGER}, #{item.optResult,jdbcType=LONGVARCHAR}, #{item.optIp,jdbcType=VARCHAR}, #{item.projectId,jdbcType=INTEGER}, #{item.remark,jdbcType=VARCHAR}, #{item.dataStatus,jdbcType=CHAR},
#{item.updateTime,jdbcType=TIMESTAMP} #{item.createUserId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateUserId,jdbcType=INTEGER}, #{item.updateTime,jdbcType=TIMESTAMP}
) )
</foreach> </foreach>
</insert> </insert>
...@@ -241,9 +262,15 @@ ...@@ -241,9 +262,15 @@
<if test="userName != null" > <if test="userName != null" >
user_name, user_name,
</if> </if>
<if test="userRoles != null" >
user_roles,
</if>
<if test="optTime != null" > <if test="optTime != null" >
opt_time, opt_time,
</if> </if>
<if test="optModular != null" >
opt_modular,
</if>
<if test="optType != null" > <if test="optType != null" >
opt_type, opt_type,
</if> </if>
...@@ -262,6 +289,9 @@ ...@@ -262,6 +289,9 @@
<if test="optIp != null" > <if test="optIp != null" >
opt_ip, opt_ip,
</if> </if>
<if test="projectId != null" >
project_id,
</if>
<if test="remark != null" > <if test="remark != null" >
remark, remark,
</if> </if>
...@@ -291,9 +321,15 @@ ...@@ -291,9 +321,15 @@
<if test="userName != null" > <if test="userName != null" >
#{userName,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR},
</if> </if>
<if test="userRoles != null" >
#{userRoles,jdbcType=VARCHAR},
</if>
<if test="optTime != null" > <if test="optTime != null" >
#{optTime,jdbcType=TIMESTAMP}, #{optTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="optModular != null" >
#{optModular,jdbcType=VARCHAR},
</if>
<if test="optType != null" > <if test="optType != null" >
#{optType,jdbcType=VARCHAR}, #{optType,jdbcType=VARCHAR},
</if> </if>
...@@ -312,6 +348,9 @@ ...@@ -312,6 +348,9 @@
<if test="optIp != null" > <if test="optIp != null" >
#{optIp,jdbcType=VARCHAR}, #{optIp,jdbcType=VARCHAR},
</if> </if>
<if test="projectId != null" >
#{projectId,jdbcType=INTEGER},
</if>
<if test="remark != null" > <if test="remark != null" >
#{remark,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
</if> </if>
...@@ -339,13 +378,16 @@ ...@@ -339,13 +378,16 @@
opt_id = #{optId,jdbcType=INTEGER}, opt_id = #{optId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER}, user_id = #{userId,jdbcType=INTEGER},
user_name = #{userName,jdbcType=VARCHAR}, user_name = #{userName,jdbcType=VARCHAR},
user_roles = #{userRoles,jdbcType=VARCHAR},
opt_time = #{optTime,jdbcType=TIMESTAMP}, opt_time = #{optTime,jdbcType=TIMESTAMP},
opt_modular = #{optModular,jdbcType=VARCHAR},
opt_type = #{optType,jdbcType=VARCHAR}, opt_type = #{optType,jdbcType=VARCHAR},
opt_desc = #{optDesc,jdbcType=VARCHAR}, opt_desc = #{optDesc,jdbcType=VARCHAR},
method = #{method,jdbcType=VARCHAR}, method = #{method,jdbcType=VARCHAR},
request_param = #{requestParam,jdbcType=LONGVARCHAR}, request_param = #{requestParam,jdbcType=LONGVARCHAR},
opt_result = #{optResult,jdbcType=LONGVARCHAR}, opt_result = #{optResult,jdbcType=LONGVARCHAR},
opt_ip = #{optIp,jdbcType=VARCHAR}, opt_ip = #{optIp,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
data_status = #{dataStatus,jdbcType=CHAR}, data_status = #{dataStatus,jdbcType=CHAR},
create_user_id = #{createUserId,jdbcType=INTEGER}, create_user_id = #{createUserId,jdbcType=INTEGER},
...@@ -368,9 +410,15 @@ ...@@ -368,9 +410,15 @@
<if test="userName != null" > <if test="userName != null" >
user_name = #{userName,jdbcType=VARCHAR}, user_name = #{userName,jdbcType=VARCHAR},
</if> </if>
<if test="userRoles != null" >
user_roles = #{userRoles,jdbcType=VARCHAR},
</if>
<if test="optTime != null" > <if test="optTime != null" >
opt_time = #{optTime,jdbcType=TIMESTAMP}, opt_time = #{optTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="optModular != null" >
opt_modular = #{optModular,jdbcType=VARCHAR},
</if>
<if test="optType != null" > <if test="optType != null" >
opt_type = #{optType,jdbcType=VARCHAR}, opt_type = #{optType,jdbcType=VARCHAR},
</if> </if>
...@@ -389,6 +437,9 @@ ...@@ -389,6 +437,9 @@
<if test="optIp != null" > <if test="optIp != null" >
opt_ip = #{optIp,jdbcType=VARCHAR}, opt_ip = #{optIp,jdbcType=VARCHAR},
</if> </if>
<if test="projectId != null" >
project_id = #{projectId,jdbcType=INTEGER},
</if>
<if test="remark != null" > <if test="remark != null" >
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
</if> </if>
...@@ -415,64 +466,73 @@ ...@@ -415,64 +466,73 @@
<select id="findList" resultMap="BaseDtoResultMap"> <select id="findList" resultMap="BaseDtoResultMap">
SELECT SELECT
<include refid="BaseDto_Column_List"/> <include refid="BaseDto_Column_List"/>
FROM dmp_opt_log log FROM dmp_opt_log _log
<where> <where>
<if test="optId != null" > <if test="optId != null" >
AND log.opt_id = #{optId,jdbcType=INTEGER} AND _log.opt_id = #{optId,jdbcType=INTEGER}
</if> </if>
<if test="userId != null" > <if test="userId != null" >
AND log.user_id = #{userId,jdbcType=INTEGER} AND _log.user_id = #{userId,jdbcType=INTEGER}
</if> </if>
<if test="userName != null" > <if test="userName != null" >
AND log.user_name = #{userName,jdbcType=VARCHAR} AND _log.user_name = #{userName,jdbcType=VARCHAR}
</if>
<if test="userRoles != null" >
AND _log.user_roles = #{userRoles,jdbcType=VARCHAR}
</if> </if>
<if test="optTimeStart != null" > <if test="optTimeStart != null" >
AND log.opt_time >= #{optTimeStart,jdbcType=TIMESTAMP} AND _log.opt_time >= #{optTimeStart,jdbcType=TIMESTAMP}
</if> </if>
<if test="optTimeEnd != null" > <if test="optTimeEnd != null" >
AND log.opt_time <![CDATA[ <= ]]> #{optTimeEnd,jdbcType=TIMESTAMP} AND _log.opt_time <![CDATA[ <= ]]> #{optTimeEnd,jdbcType=TIMESTAMP}
</if>
<if test="optModular != null" >
AND _log.opt_modular = #{optModular,jdbcType=VARCHAR}
</if> </if>
<if test="optType != null" > <if test="optType != null" >
AND log.opt_type = #{optType,jdbcType=VARCHAR} AND _log.opt_type = #{optType,jdbcType=VARCHAR}
</if> </if>
<if test="optDesc != null" > <if test="optDesc != null" >
AND log.opt_desc = #{optDesc,jdbcType=VARCHAR} AND _log.opt_desc = #{optDesc,jdbcType=VARCHAR}
</if> </if>
<if test="method != null" > <if test="method != null" >
AND log.method = #{method,jdbcType=VARCHAR} AND _log.method = #{method,jdbcType=VARCHAR}
</if> </if>
<if test="requestParam != null" > <if test="requestParam != null" >
AND log.request_param = #{requestParam,jdbcType=LONGVARCHAR} AND _log.request_param = #{requestParam,jdbcType=LONGVARCHAR}
</if> </if>
<if test="optResult != null" > <if test="optResult != null" >
AND log.opt_result = #{optResult,jdbcType=LONGVARCHAR} AND _log.opt_result = #{optResult,jdbcType=LONGVARCHAR}
</if> </if>
<if test="optIp != null" > <if test="optIp != null" >
AND log.opt_ip = #{optIp,jdbcType=VARCHAR} AND _log.opt_ip = #{optIp,jdbcType=VARCHAR}
</if>
<if test="projectId != null" >
AND _log.project_id = #{projectId,jdbcType=INTEGER}
</if> </if>
<if test="remark != null" > <if test="remark != null" >
AND log.remark = #{remark,jdbcType=VARCHAR} AND _log.remark = #{remark,jdbcType=VARCHAR}
</if> </if>
<if test="dataStatus != null" > <if test="dataStatus != null" >
AND log.data_status = #{dataStatus,jdbcType=CHAR} AND _log.data_status = #{dataStatus,jdbcType=CHAR}
</if> </if>
<if test="createUserId != null" > <if test="createUserId != null" >
AND log.create_user_id = #{createUserId,jdbcType=INTEGER} AND _log.create_user_id = #{createUserId,jdbcType=INTEGER}
</if> </if>
<if test="createTimeStart != null" > <if test="createTimeStart != null" >
AND log.create_time >= #{createTimeStart,jdbcType=TIMESTAMP} AND _log.create_time >= #{createTimeStart,jdbcType=TIMESTAMP}
</if> </if>
<if test="createTimeEnd != null" > <if test="createTimeEnd != null" >
AND log.create_time <![CDATA[ <= ]]> #{createTimeEnd,jdbcType=TIMESTAMP} AND _log.create_time <![CDATA[ <= ]]> #{createTimeEnd,jdbcType=TIMESTAMP}
</if> </if>
<if test="updateUserId != null" > <if test="updateUserId != null" >
AND log.update_user_id = #{updateUserId,jdbcType=INTEGER} AND _log.update_user_id = #{updateUserId,jdbcType=INTEGER}
</if> </if>
<if test="updateTimeStart != null" > <if test="updateTimeStart != null" >
AND log.update_time >= #{updateTimeStart,jdbcType=TIMESTAMP} AND _log.update_time >= #{updateTimeStart,jdbcType=TIMESTAMP}
</if> </if>
<if test="updateTimeEnd != null" > <if test="updateTimeEnd != null" >
AND log.update_time <![CDATA[ <= ]]> #{updateTimeEnd,jdbcType=TIMESTAMP} AND _log.update_time <![CDATA[ <= ]]> #{updateTimeEnd,jdbcType=TIMESTAMP}
</if> </if>
</where> </where>
</select> </select>
...@@ -481,9 +541,9 @@ ...@@ -481,9 +541,9 @@
<select id="findById" resultMap="BaseDtoResultMap"> <select id="findById" resultMap="BaseDtoResultMap">
select select
<include refid="BaseDto_Column_List" /> <include refid="BaseDto_Column_List" />
from dmp_opt_log log from dmp_opt_log _log
where log.opt_id = #{optId,jdbcType=INTEGER} where _log.opt_id = #{optId,jdbcType=INTEGER}
AND log.data_status='1' AND _log.data_status='1'
</select> </select>
<!-- 根据主键批量删除操作日志表 --> <!-- 根据主键批量删除操作日志表 -->
......
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