Просмотр исходного кода

用戶軌跡,異常報表,權限分配

fangq 4 лет назад
Родитель
Сommit
500d5d335c
19 измененных файлов с 922 добавлено и 58 удалено
  1. 6 0
      pom.xml
  2. 61 7
      src/main/java/org/springblade/bank/cardswallow/controller/CardSwallowController.java
  3. 65 2
      src/main/java/org/springblade/bank/checklist/controller/ChecklistController.java
  4. 87 11
      src/main/java/org/springblade/bank/goodsuse/controller/GoodsUseController.java
  5. 4 2
      src/main/java/org/springblade/bank/handoverstandard/controller/HandoverStandardController.java
  6. 75 18
      src/main/java/org/springblade/bank/keypwd/controller/KeyPwdController.java
  7. 9 5
      src/main/java/org/springblade/bank/postchange/controller/PostChangeController.java
  8. 8 5
      src/main/java/org/springblade/bank/returns/controller/ReturnsController.java
  9. 62 4
      src/main/java/org/springblade/bank/sealhandover/controller/SealHandoverController.java
  10. 61 4
      src/main/java/org/springblade/bank/tellertrunk/controller/TellerTrunkController.java
  11. 129 0
      src/main/java/org/springblade/bank/userlog/controller/UserLogController.java
  12. 34 0
      src/main/java/org/springblade/bank/userlog/dto/UserLogDTO.java
  13. 82 0
      src/main/java/org/springblade/bank/userlog/entity/UserLog.java
  14. 42 0
      src/main/java/org/springblade/bank/userlog/mapper/UserLogMapper.java
  15. 30 0
      src/main/java/org/springblade/bank/userlog/mapper/UserLogMapper.xml
  16. 41 0
      src/main/java/org/springblade/bank/userlog/service/IUserLogService.java
  17. 41 0
      src/main/java/org/springblade/bank/userlog/service/impl/UserLogServiceImpl.java
  18. 36 0
      src/main/java/org/springblade/bank/userlog/vo/UserLogVO.java
  19. 49 0
      src/main/java/org/springblade/bank/userlog/wrapper/UserLogWrapper.java

+ 6 - 0
pom.xml

@@ -200,6 +200,12 @@
             <artifactId>lombok</artifactId>
             <scope>provided</scope>
         </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.6.5</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 61 - 7
src/main/java/org/springblade/bank/cardswallow/controller/CardSwallowController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.bank.cardswallow.controller;
 
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@@ -32,9 +33,13 @@ import org.springblade.bank.cardswallow.entity.CardSwallowExcel;
 import org.springblade.bank.cardswallow.service.ICardSwallowService;
 import org.springblade.bank.cardswallow.vo.CardSwallowVO;
 import org.springblade.bank.cardswallow.wrapper.CardSwallowWrapper;
+import org.springblade.bank.keypwd.entity.KeyPwd;
 import org.springblade.bank.returns.entity.Returns;
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.service.IUserLogService;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.log.logger.BladeLogger;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
@@ -70,6 +75,7 @@ public class CardSwallowController extends BladeController {
 	private final ICardSwallowService cardSwallowService;
 	private final IUserService userService;
 	private final IDeptService deptService;
+	private final IUserLogService userLogService;
 
 	/**
 	 * 详情
@@ -153,7 +159,28 @@ public class CardSwallowController extends BladeController {
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "逻辑删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(cardSwallowService.deleteLogic(Func.toLongList(ids)));
+		List<Long> idList = Func.toLongList(ids);
+
+		if (cardSwallowService.deleteLogic(idList)){
+			// 日誌記錄
+			BladeUser currentUser = AuthUtil.getUser();
+			User user = userService.getById(currentUser.getUserId());
+			Dept dept = deptService.getById(user.getDeptId());
+			idList.forEach(id -> {
+				UserLog userLog = new UserLog();
+				CardSwallow cardSwallow = cardSwallowService.getById(id);
+
+				userLog.setTableName("cardswallow");
+				userLog.setOperationType("del");
+				userLog.setBankNo(dept.getBankNo());
+				userLog.setOrgNo(dept.getOrgNo());
+				userLog.setOldData(JSONUtil.toJsonStr(cardSwallow));
+				userLog.setPersonNo(user.getEhr());
+				userLog.setPersonName(user.getName());
+				userLogService.save(userLog);
+			});
+		}
+		return R.status(true);
 	}
 
 	/**
@@ -220,9 +247,14 @@ public class CardSwallowController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入cardSwallow")
 	public R cardswallowSubmit(@Valid @RequestBody CardSwallow cardSwallow) {
-		CardSwallow setting = cardSwallowService.getOne(new QueryWrapper<>(new CardSwallow()).lambda().eq(CardSwallow::getId, 1L));
-		Assert.notNull(setting, "請先設置發佈人!");
 
+		if (cardSwallow.getPersonId() == null || cardSwallow.getPersonNo() == null){
+			CardSwallow setting = cardSwallowService.getOne(new QueryWrapper<>(new CardSwallow()).lambda().eq(CardSwallow::getId, 1L));
+			Assert.notNull(setting, "請先設置發佈人!");
+			cardSwallow.setPersonId(setting.getPersonId());
+			cardSwallow.setPersonNo(setting.getPersonNo());
+			cardSwallow.setPersonName(setting.getPersonName());
+		}
 		if (StringUtils.isNotBlank(cardSwallow.getPersonNo())){
 			User user = userService.getById(AuthUtil.getUser().getUserId());
 			if (user.getEhr().equals(cardSwallow.getPersonNo())){
@@ -230,11 +262,33 @@ public class CardSwallowController extends BladeController {
 			}
 		}
 
-		cardSwallow.setPersonId(setting.getPersonId());
-		cardSwallow.setPersonNo(setting.getPersonNo());
-		cardSwallow.setPersonName(setting.getPersonName());
 		cardSwallow.setProcess(2);
-		return R.status(cardSwallowService.saveOrUpdate(cardSwallow));
+		cardSwallow.setSendStatus("1");//待發送
+
+		boolean isAdd = cardSwallow.getId() == null;
+		BladeUser currentUser = AuthUtil.getUser();
+		User user = userService.getById(currentUser.getUserId());
+		Dept dept = deptService.getById(user.getDeptId());
+		UserLog userLog = new UserLog();
+
+		if (cardSwallowService.saveOrUpdate(cardSwallow)){
+			userLog.setTableName("cardswallow");
+			userLog.setBankNo(dept.getBankNo());
+			userLog.setOrgNo(dept.getOrgNo());
+			userLog.setNewData(JSONUtil.toJsonStr(cardSwallow));
+			userLog.setPersonNo(user.getEhr());
+			userLog.setPersonName(user.getName());
+
+			if (isAdd){
+				userLog.setOperationType("add");
+			}else{
+				userLog.setOperationType("edit");
+				CardSwallow old = cardSwallowService.getById(cardSwallow.getId());
+				userLog.setOldData(JSONUtil.toJsonStr(old));
+			}
+			userLogService.save(userLog);
+		}
+		return R.status(true);
 	}
 
 	/**

+ 65 - 2
src/main/java/org/springblade/bank/checklist/controller/ChecklistController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.bank.checklist.controller;
 
+import cn.hutool.json.JSONUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -24,11 +25,21 @@ import lombok.AllArgsConstructor;
 import javax.validation.Valid;
 
 import org.apache.commons.lang.StringUtils;
+import org.springblade.bank.keypwd.entity.KeyPwd;
+import org.springblade.bank.sealhandover.entity.SealHandover;
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.service.IUserLogService;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.service.IUserService;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -54,6 +65,9 @@ import java.util.*;
 public class ChecklistController extends BladeController {
 
 	private final IChecklistService checklistService;
+	private final IUserService userService;
+	private final IDeptService deptService;
+	private final IUserLogService userLogService;
 
 	/**
 	 * 详情
@@ -134,10 +148,39 @@ public class ChecklistController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入checklist")
 	public R submit(@Valid @RequestBody Checklist checklist) {
+
+		boolean isAdd = checklist.getId() == null;
+		BladeUser currentUser = AuthUtil.getUser();
+		User user = userService.getById(currentUser.getUserId());
+		Dept dept = deptService.getById(user.getDeptId());
+		UserLog userLog = new UserLog();
+
+		if (isAdd){
+			checklist.setFillingDate(DateUtil.now());
+		}
+
+		if (checklistService.saveOrUpdate(checklist)){
+			userLog.setTableName("checklist");
+			userLog.setBankNo(dept.getBankNo());
+			userLog.setOrgNo(dept.getOrgNo());
+			userLog.setNewData(JSONUtil.toJsonStr(checklist));
+			userLog.setPersonNo(user.getEhr());
+			userLog.setPersonName(user.getName());
+
+			if (isAdd){
+				userLog.setOperationType("add");
+			}else{
+				userLog.setOperationType("edit");
+				Checklist old = checklistService.getById(checklist.getId());
+				userLog.setOldData(JSONUtil.toJsonStr(old));
+			}
+			userLogService.save(userLog);
+		}
+
 		if (checklist.getId() == null){
 			checklist.setFillingDate(DateUtil.now());
 		}
-		return R.status(checklistService.saveOrUpdate(checklist));
+		return R.status(true);
 	}
 
 
@@ -148,7 +191,27 @@ public class ChecklistController extends BladeController {
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "逻辑删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(checklistService.deleteLogic(Func.toLongList(ids)));
+		List<Long> idList = Func.toLongList(ids);
+
+		if (checklistService.deleteLogic(idList)){
+			// 日誌記錄
+			BladeUser currentUser = AuthUtil.getUser();
+			User user = userService.getById(currentUser.getUserId());
+			Dept dept = deptService.getById(user.getDeptId());
+			idList.forEach(id -> {
+				UserLog userLog = new UserLog();
+				Checklist checklist = checklistService.getById(id);
+				userLog.setTableName("checklist");
+				userLog.setOperationType("del");
+				userLog.setBankNo(dept.getBankNo());
+				userLog.setOrgNo(dept.getOrgNo());
+				userLog.setOldData(JSONUtil.toJsonStr(checklist));
+				userLog.setPersonNo(user.getEhr());
+				userLog.setPersonName(user.getName());
+				userLogService.save(userLog);
+			});
+		}
+		return R.status(true);
 	}
 
 	/**

+ 87 - 11
src/main/java/org/springblade/bank/goodsuse/controller/GoodsUseController.java

@@ -16,6 +16,8 @@
  */
 package org.springblade.bank.goodsuse.controller;
 
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -26,6 +28,11 @@ import javax.validation.Valid;
 
 import org.apache.commons.lang.StringUtils;
 import org.springblade.bank.cardswallow.entity.CardSwallow;
+import org.springblade.bank.keypwd.entity.KeyPwd;
+import org.springblade.bank.postchange.entity.PostChange;
+import org.springblade.bank.sealhandover.entity.SealHandover;
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.service.IUserLogService;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
@@ -33,7 +40,9 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.Dept;
 import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.service.IDeptService;
 import org.springblade.modules.system.service.IUserService;
 import org.springframework.util.Assert;
 import org.springframework.web.bind.annotation.*;
@@ -61,6 +70,8 @@ public class GoodsUseController extends BladeController {
 
 	private final IGoodsUseService goodsUseService;
 	private final IUserService userService;
+	private final IDeptService deptService;
+	private final IUserLogService userLogService;
 
 	/**
 	 * 详情
@@ -138,26 +149,54 @@ public class GoodsUseController extends BladeController {
 	@ApiOperation(value = "新增或修改", notes = "传入goodsUse")
 	public R submit(@Valid @RequestBody GoodsUse goodsUse) {
 
-		GoodsUse setting = goodsUseService.getOne(new QueryWrapper<>(new GoodsUse()).lambda().eq(GoodsUse::getId, 1L));
-		Assert.notNull(setting, "請先設置發佈人!");
+		if (goodsUse.getPersonId() == null || goodsUse.getPersonNo() == null){
+			GoodsUse setting = goodsUseService.getOne(new QueryWrapper<>(new GoodsUse()).lambda().eq(GoodsUse::getId, 1L));
+			Assert.notNull(setting, "請先設置確認人!");
+			goodsUse.setPersonId(setting.getPersonId());
+			goodsUse.setPersonNo(setting.getPersonNo());
+			goodsUse.setPersonName(setting.getPersonName());
+		}
 
 		if (StringUtils.isNotBlank(goodsUse.getPersonNo())){
 			User user = userService.getById(AuthUtil.getUser().getUserId());
 			if (user.getEhr().equals(goodsUse.getPersonNo())){
-				Assert.notNull(null, "發佈人和發起人不能為同一人!");
+				Assert.notNull(null, "確認人和發起人不能為同一人!");
 			}
 		}
+		goodsUse.setProcess(2);
 
-		goodsUse.setPersonId(setting.getPersonId());
-		goodsUse.setPersonNo(setting.getPersonNo());
-		goodsUse.setPersonName(setting.getPersonName());
 
-		goodsUse.setProcess(2);
+		boolean isAdd = goodsUse.getId() == null;
 		BladeUser currentUser = AuthUtil.getUser();
 		User user = userService.getById(currentUser.getUserId());
-		goodsUse.setFillingDate(DateUtil.now());
-		goodsUse.setFillingNo(user.getEhr());
-		goodsUse.setFillingName(user.getName());
+		Dept dept = deptService.getById(user.getDeptId());
+		UserLog userLog = new UserLog();
+
+		if (isAdd){
+			goodsUse.setFillingDate(DateUtil.now());
+			goodsUse.setFillingNo(user.getEhr());
+			goodsUse.setFillingName(user.getName());
+		}
+
+		if (goodsUseService.saveOrUpdate(goodsUse)){
+			userLog.setTableName("goodsuse");
+			userLog.setBankNo(dept.getBankNo());
+			userLog.setOrgNo(dept.getOrgNo());
+			userLog.setNewData(JSONUtil.toJsonStr(goodsUse));
+			userLog.setPersonNo(user.getEhr());
+			userLog.setPersonName(user.getName());
+
+			if (isAdd){
+				userLog.setOperationType("add");
+			}else{
+				userLog.setOperationType("edit");
+				GoodsUse old = goodsUseService.getById(goodsUse.getId());
+				userLog.setOldData(JSONUtil.toJsonStr(old));
+			}
+			userLogService.save(userLog);
+
+		}
+
 		return R.status(goodsUseService.saveOrUpdate(goodsUse));
 	}
 
@@ -169,7 +208,28 @@ public class GoodsUseController extends BladeController {
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "逻辑删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(goodsUseService.deleteLogic(Func.toLongList(ids)));
+		List<Long> idList = Func.toLongList(ids);
+
+		if (goodsUseService.deleteLogic(idList)){
+			// 日誌記錄
+			BladeUser currentUser = AuthUtil.getUser();
+			User user = userService.getById(currentUser.getUserId());
+			Dept dept = deptService.getById(user.getDeptId());
+			idList.forEach(id -> {
+				UserLog userLog = new UserLog();
+				GoodsUse goodsUse = goodsUseService.getById(id);
+
+				userLog.setTableName("goodsuse");
+				userLog.setOperationType("del");
+				userLog.setBankNo(dept.getBankNo());
+				userLog.setOrgNo(dept.getOrgNo());
+				userLog.setOldData(JSONUtil.toJsonStr(goodsUse));
+				userLog.setPersonNo(user.getEhr());
+				userLog.setPersonName(user.getName());
+				userLogService.save(userLog);
+			});
+		}
+		return R.status(true);
 	}
 
 	/**
@@ -243,5 +303,21 @@ public class GoodsUseController extends BladeController {
 		return R.status(goodsUseService.updateById(goodsUse));
 	}
 
+	/**
+	 * 根据类型,获取最新一条记录
+	 */
+	@GetMapping("/getLastByType")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "获取审批人设置", notes = "")
+	public R getLastByType(@ApiParam(value = "主键集合", required = true) @RequestParam String type) {
+
+		LambdaQueryWrapper<GoodsUse> wrapper = new QueryWrapper<>(new GoodsUse()).lambda().eq(GoodsUse::getType, type).orderByDesc(GoodsUse::getCreateTime);
+		wrapper.last("limit " + 2);
+		List<GoodsUse> list = goodsUseService.list(wrapper);
+		if (list != null && list.size() > 0){
+			return R.data(list.get(0));
+		}
+		return R.data(null);
+	}
 
 }

+ 4 - 2
src/main/java/org/springblade/bank/handoverstandard/controller/HandoverStandardController.java

@@ -117,8 +117,10 @@ public class HandoverStandardController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入handoverStandard")
 	public R submit(@Valid @RequestBody HandoverStandard handoverStandard) {
-		HandoverStandard one = handoverStandardService.getOne(new QueryWrapper<>(new HandoverStandard()).lambda().eq(HandoverStandard::getCode, handoverStandard.getCode()));
-		Assert.isNull(one, "該業務的交接標準已存在!");
+		if (handoverStandard.getId() == null){
+			HandoverStandard one = handoverStandardService.getOne(new QueryWrapper<>(new HandoverStandard()).lambda().eq(HandoverStandard::getCode, handoverStandard.getCode()));
+			Assert.isNull(one, "該業務的交接標準已存在!");
+		}
 		return R.status(handoverStandardService.saveOrUpdate(handoverStandard));
 	}
 

+ 75 - 18
src/main/java/org/springblade/bank/keypwd/controller/KeyPwdController.java

@@ -16,18 +16,23 @@
  */
 package org.springblade.bank.keypwd.controller;
 
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
-import javax.validation.Valid;
-
 import org.apache.commons.lang.StringUtils;
-import org.springblade.core.datascope.annotation.DataAuth;
-import org.springblade.core.datascope.enums.DataScopeEnum;
+import org.springblade.bank.keypwd.entity.KeyPwd;
+import org.springblade.bank.keypwd.service.IKeyPwdService;
+import org.springblade.bank.keypwd.vo.KeyPwdVO;
+import org.springblade.bank.keypwd.wrapper.KeyPwdWrapper;
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.service.IUserLogService;
+import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
@@ -35,17 +40,18 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.service.IUserService;
+import org.springframework.util.Assert;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.bind.annotation.RequestParam;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.bank.keypwd.entity.KeyPwd;
-import org.springblade.bank.keypwd.vo.KeyPwdVO;
-import org.springblade.bank.keypwd.wrapper.KeyPwdWrapper;
-import org.springblade.bank.keypwd.service.IKeyPwdService;
-import org.springblade.core.boot.ctrl.BladeController;
 
-import java.time.ZoneId;
-import java.util.*;
+import javax.validation.Valid;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 網點鎖匙/密碼登記表 控制器
@@ -60,6 +66,9 @@ import java.util.*;
 public class KeyPwdController extends BladeController {
 
 	private final IKeyPwdService keyPwdService;
+	private final IUserLogService userLogService;
+	private final IUserService userService;
+	private final IDeptService deptService;
 
 	/**
 	 * 详情
@@ -171,12 +180,39 @@ public class KeyPwdController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入keyPwd")
 	public R submit(@Valid @RequestBody KeyPwd keyPwd) {
-		if (keyPwd.getId() == null){
-			BladeUser currentUser = AuthUtil.getUser();
+
+
+		boolean isAdd = keyPwd.getId() == null;
+		BladeUser currentUser = AuthUtil.getUser();
+		User user = userService.getById(currentUser.getUserId());
+		Dept dept = deptService.getById(user.getDeptId());
+		UserLog userLog = new UserLog();
+		Assert.isTrue(keyPwd.getReceiverNo().equals(user.getEhr()), "當前填報人不能作為接收人!請重新選擇!");
+
+		if (isAdd){
 			keyPwd.setFillingPerson(currentUser.getUserName());
 			keyPwd.setFillingDate(DateUtil.now());
 		}
-		return R.status(keyPwdService.saveOrUpdate(keyPwd));
+
+		if (keyPwdService.saveOrUpdate(keyPwd)){
+			userLog.setTableName("keypwd");
+			userLog.setBankNo(dept.getBankNo());
+			userLog.setOrgNo(dept.getOrgNo());
+			userLog.setNewData(JSONUtil.toJsonStr(keyPwd));
+			userLog.setPersonNo(user.getEhr());
+			userLog.setPersonName(user.getName());
+
+			if (isAdd){
+				userLog.setOperationType("add");
+			}else{
+				userLog.setOperationType("edit");
+				KeyPwd old = keyPwdService.getById(keyPwd.getId());
+				userLog.setOldData(JSONUtil.toJsonStr(old));
+			}
+			userLogService.save(userLog);
+		}
+
+		return R.status(true);
 	}
 
 
@@ -187,7 +223,28 @@ public class KeyPwdController extends BladeController {
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "逻辑删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(keyPwdService.deleteLogic(Func.toLongList(ids)));
+		List<Long> idList = Func.toLongList(ids);
+
+		if (keyPwdService.deleteLogic(idList)){
+			// 日誌記錄
+			BladeUser currentUser = AuthUtil.getUser();
+			User user = userService.getById(currentUser.getUserId());
+			Dept dept = deptService.getById(user.getDeptId());
+			idList.forEach(id -> {
+				UserLog userLog = new UserLog();
+				KeyPwd keyPwd = keyPwdService.getById(id);
+
+				userLog.setTableName("keypwd");
+				userLog.setOperationType("del");
+				userLog.setBankNo(dept.getBankNo());
+				userLog.setOrgNo(dept.getOrgNo());
+				userLog.setOldData(JSONUtil.toJsonStr(keyPwd));
+				userLog.setPersonNo(user.getEhr());
+				userLog.setPersonName(user.getName());
+				userLogService.save(userLog);
+			});
+		}
+		return R.status(true);
 	}
 
 	@GetMapping("/getByCategoryAndType")

+ 9 - 5
src/main/java/org/springblade/bank/postchange/controller/PostChangeController.java

@@ -131,8 +131,14 @@ public class PostChangeController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入postChange")
 	public R submit(@Valid @RequestBody PostChange postChange) {
-		PostChange setting = postChangeService.getOne(new QueryWrapper<>(new PostChange()).lambda().eq(PostChange::getId, 1L));
-		Assert.notNull(setting, "請先設置審批人!");
+
+		if (postChange.getPersonId() == null || postChange.getPersonNo() == null){
+			PostChange setting = postChangeService.getOne(new QueryWrapper<>(new PostChange()).lambda().eq(PostChange::getId, 1L));
+			Assert.notNull(setting, "請先設置審批人!");
+			postChange.setPersonId(setting.getPersonId());
+			postChange.setPersonNo(setting.getPersonNo());
+			postChange.setPersonName(setting.getPersonName());
+		}
 
 		if (StringUtils.isNotBlank(postChange.getPersonNo())){
 			User user = userService.getById(AuthUtil.getUser().getUserId());
@@ -141,9 +147,7 @@ public class PostChangeController extends BladeController {
 			}
 		}
 
-		postChange.setPersonId(setting.getPersonId());
-		postChange.setPersonNo(setting.getPersonNo());
-		postChange.setPersonName(setting.getPersonName());
+
 		postChange.setProcess(2);
 
 		PostChange last = postChangeService.getLastRecord();

+ 8 - 5
src/main/java/org/springblade/bank/returns/controller/ReturnsController.java

@@ -187,8 +187,13 @@ public class ReturnsController extends BladeController {
 	@ApiOperation(value = "", notes = "")
 	public R returnsSubmit(@Valid @RequestBody Returns returns) {
 
-		Returns setting = returnsService.getOne(new QueryWrapper<>(new Returns()).lambda().eq(Returns::getId, 1L));
-		Assert.notNull(setting, "請先設置發佈人!");
+		if (returns.getPersonId() == null || returns.getPersonNo() == null){
+			Returns setting = returnsService.getOne(new QueryWrapper<>(new Returns()).lambda().eq(Returns::getId, 1L));
+			Assert.notNull(setting, "請先設置發佈人!");
+			returns.setPersonId(setting.getPersonId());
+			returns.setPersonNo(setting.getPersonNo());
+			returns.setPersonName(setting.getPersonName());
+		}
 
 		if (StringUtils.isNotBlank(returns.getPersonNo())){
 			User user = userService.getById(AuthUtil.getUser().getUserId());
@@ -197,9 +202,7 @@ public class ReturnsController extends BladeController {
 			}
 		}
 
-		returns.setPersonId(setting.getPersonId());
-		returns.setPersonNo(setting.getPersonNo());
-		returns.setPersonName(setting.getPersonName());
+
 		returns.setProcess(2);
 		boolean save = returnsService.saveOrUpdate(returns);
 		return R.status(save);

+ 62 - 4
src/main/java/org/springblade/bank/sealhandover/controller/SealHandoverController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.bank.sealhandover.controller;
 
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import io.swagger.annotations.Api;
@@ -28,6 +29,8 @@ import javax.validation.Valid;
 import org.apache.commons.lang.StringUtils;
 import org.springblade.bank.keypwd.entity.KeyPwd;
 import org.springblade.bank.keypwd.vo.KeyPwdVO;
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.service.IUserLogService;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
@@ -35,6 +38,11 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.service.IUserService;
+import org.springframework.util.Assert;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -62,6 +70,9 @@ import java.util.Map;
 public class SealHandoverController extends BladeController {
 
 	private final ISealHandoverService sealHandoverService;
+	private final IUserLogService userLogService;
+	private final IUserService userService;
+	private final IDeptService deptService;
 
 	/**
 	 * 详情
@@ -170,12 +181,38 @@ public class SealHandoverController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入sealHandover")
 	public R submit(@Valid @RequestBody SealHandover sealHandover) {
-		if (sealHandover.getId() == null){
-			BladeUser currentUser = AuthUtil.getUser();
+		boolean isAdd = sealHandover.getId() == null;
+		BladeUser currentUser = AuthUtil.getUser();
+		User user = userService.getById(currentUser.getUserId());
+		Dept dept = deptService.getById(user.getDeptId());
+		UserLog userLog = new UserLog();
+		Assert.isTrue(sealHandover.getReceiverNo().equals(user.getEhr()), "當前填報人不能作為接收人!請重新選擇!");
+
+		if (isAdd){
 			sealHandover.setFillingPerson(currentUser.getUserName());
 			sealHandover.setFillingDate(DateUtil.now());
 		}
-		return R.status(sealHandoverService.saveOrUpdate(sealHandover));
+
+		if (sealHandoverService.saveOrUpdate(sealHandover)){
+			userLog.setTableName("sealhandover");
+			userLog.setBankNo(dept.getBankNo());
+			userLog.setOrgNo(dept.getOrgNo());
+			userLog.setNewData(JSONUtil.toJsonStr(sealHandover));
+			userLog.setPersonNo(user.getEhr());
+			userLog.setPersonName(user.getName());
+
+			if (isAdd){
+				userLog.setOperationType("add");
+			}else{
+				userLog.setOperationType("edit");
+				SealHandover old = sealHandoverService.getById(sealHandover.getId());
+				userLog.setOldData(JSONUtil.toJsonStr(old));
+			}
+			userLogService.save(userLog);
+
+		}
+
+		return R.status(true);
 	}
 
 
@@ -186,7 +223,28 @@ public class SealHandoverController extends BladeController {
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "逻辑删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(sealHandoverService.deleteLogic(Func.toLongList(ids)));
+		List<Long> idList = Func.toLongList(ids);
+
+		if (sealHandoverService.deleteLogic(idList)){
+			// 日誌記錄
+			BladeUser currentUser = AuthUtil.getUser();
+			User user = userService.getById(currentUser.getUserId());
+			Dept dept = deptService.getById(user.getDeptId());
+			idList.forEach(id -> {
+				UserLog userLog = new UserLog();
+				SealHandover sealHandover = sealHandoverService.getById(id);
+
+				userLog.setTableName("sealhandover");
+				userLog.setOperationType("del");
+				userLog.setBankNo(dept.getBankNo());
+				userLog.setOrgNo(dept.getOrgNo());
+				userLog.setOldData(JSONUtil.toJsonStr(sealHandover));
+				userLog.setPersonNo(user.getEhr());
+				userLog.setPersonName(user.getName());
+				userLogService.save(userLog);
+			});
+		}
+		return R.status(true);
 	}
 
 	@GetMapping("/getByNoAndType")

+ 61 - 4
src/main/java/org/springblade/bank/tellertrunk/controller/TellerTrunkController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.bank.tellertrunk.controller;
 
+import cn.hutool.json.JSONUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -24,6 +25,10 @@ import lombok.AllArgsConstructor;
 import javax.validation.Valid;
 
 import org.apache.commons.lang.StringUtils;
+import org.springblade.bank.keypwd.entity.KeyPwd;
+import org.springblade.bank.sealhandover.entity.SealHandover;
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.service.IUserLogService;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
@@ -31,6 +36,10 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.service.IUserService;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -55,6 +64,9 @@ import java.util.List;
 public class TellerTrunkController extends BladeController {
 
 	private final ITellerTrunkService tellerTrunkService;
+	private final IUserService userService;
+	private final IDeptService deptService;
+	private final IUserLogService userLogService;
 
 	/**
 	 * 详情
@@ -129,12 +141,36 @@ public class TellerTrunkController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入tellerTrunk")
 	public R submit(@Valid @RequestBody TellerTrunk tellerTrunk) {
-		if (tellerTrunk.getId() == null){
-			BladeUser currentUser = AuthUtil.getUser();
+		boolean isAdd = tellerTrunk.getId() == null;
+		BladeUser currentUser = AuthUtil.getUser();
+		User user = userService.getById(currentUser.getUserId());
+		Dept dept = deptService.getById(user.getDeptId());
+		UserLog userLog = new UserLog();
+
+		if (isAdd){
 			tellerTrunk.setFillingPerson(currentUser.getUserName());
 			tellerTrunk.setFillingDate(DateUtil.now());
 		}
-		return R.status(tellerTrunkService.saveOrUpdate(tellerTrunk));
+
+		if (tellerTrunkService.saveOrUpdate(tellerTrunk)){
+			userLog.setTableName("tellertrunk");
+			userLog.setBankNo(dept.getBankNo());
+			userLog.setOrgNo(dept.getOrgNo());
+			userLog.setNewData(JSONUtil.toJsonStr(tellerTrunk));
+			userLog.setPersonNo(user.getEhr());
+			userLog.setPersonName(user.getName());
+
+			if (isAdd){
+				userLog.setOperationType("add");
+			}else{
+				userLog.setOperationType("edit");
+				TellerTrunk old = tellerTrunkService.getById(tellerTrunk.getId());
+				userLog.setOldData(JSONUtil.toJsonStr(old));
+			}
+			userLogService.save(userLog);
+
+		}
+		return R.status(true);
 	}
 
 
@@ -145,7 +181,28 @@ public class TellerTrunkController extends BladeController {
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "逻辑删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(tellerTrunkService.deleteLogic(Func.toLongList(ids)));
+		List<Long> idList = Func.toLongList(ids);
+
+		if (tellerTrunkService.deleteLogic(idList)){
+			// 日誌記錄
+			BladeUser currentUser = AuthUtil.getUser();
+			User user = userService.getById(currentUser.getUserId());
+			Dept dept = deptService.getById(user.getDeptId());
+			idList.forEach(id -> {
+				UserLog userLog = new UserLog();
+				TellerTrunk tellerTrunk = tellerTrunkService.getById(id);
+
+				userLog.setTableName("tellertrunk");
+				userLog.setOperationType("del");
+				userLog.setBankNo(dept.getBankNo());
+				userLog.setOrgNo(dept.getOrgNo());
+				userLog.setOldData(JSONUtil.toJsonStr(tellerTrunk));
+				userLog.setPersonNo(user.getEhr());
+				userLog.setPersonName(user.getName());
+				userLogService.save(userLog);
+			});
+		}
+		return R.status(true);
 	}
 
 

+ 129 - 0
src/main/java/org/springblade/bank/userlog/controller/UserLogController.java

@@ -0,0 +1,129 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.bank.userlog.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.vo.UserLogVO;
+import org.springblade.bank.userlog.wrapper.UserLogWrapper;
+import org.springblade.bank.userlog.service.IUserLogService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 用戶軌跡 控制器
+ *
+ * @author BladeX
+ * @since 2021-09-10
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("bank/userlog")
+@Api(value = "用戶軌跡", tags = "用戶軌跡接口")
+public class UserLogController extends BladeController {
+
+	private final IUserLogService userLogService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入userLog")
+	public R<UserLogVO> detail(UserLog userLog) {
+		UserLog detail = userLogService.getOne(Condition.getQueryWrapper(userLog));
+		return R.data(UserLogWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页 用戶軌跡
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入userLog")
+	public R<IPage<UserLogVO>> list(UserLog userLog, Query query) {
+		IPage<UserLog> pages = userLogService.page(Condition.getPage(query), Condition.getQueryWrapper(userLog));
+		return R.data(UserLogWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页 用戶軌跡
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入userLog")
+	public R<IPage<UserLogVO>> page(UserLogVO userLog, Query query) {
+		IPage<UserLogVO> pages = userLogService.selectUserLogPage(Condition.getPage(query), userLog);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 用戶軌跡
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入userLog")
+	public R save(@Valid @RequestBody UserLog userLog) {
+		return R.status(userLogService.save(userLog));
+	}
+
+	/**
+	 * 修改 用戶軌跡
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入userLog")
+	public R update(@Valid @RequestBody UserLog userLog) {
+		return R.status(userLogService.updateById(userLog));
+	}
+
+	/**
+	 * 新增或修改 用戶軌跡
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入userLog")
+	public R submit(@Valid @RequestBody UserLog userLog) {
+		return R.status(userLogService.saveOrUpdate(userLog));
+	}
+
+	
+	/**
+	 * 删除 用戶軌跡
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(userLogService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	
+}

+ 34 - 0
src/main/java/org/springblade/bank/userlog/dto/UserLogDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.bank.userlog.dto;
+
+import org.springblade.bank.userlog.entity.UserLog;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 用戶軌跡数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-09-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class UserLogDTO extends UserLog {
+	private static final long serialVersionUID = 1L;
+
+}

+ 82 - 0
src/main/java/org/springblade/bank/userlog/entity/UserLog.java

@@ -0,0 +1,82 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.bank.userlog.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 用戶軌跡实体类
+ *
+ * @author BladeX
+ * @since 2021-09-10
+ */
+@Data
+@TableName("zh_user_log")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "UserLog对象", description = "用戶軌跡")
+public class UserLog extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 銀行號
+	*/
+		@ApiModelProperty(value = "銀行號")
+		private String bankNo;
+	/**
+	* 機構號
+	*/
+		@ApiModelProperty(value = "機構號")
+		private String orgNo;
+	/**
+	* 表名
+	*/
+		@ApiModelProperty(value = "表名")
+		private String tableName;
+	/**
+	* 員工號
+	*/
+		@ApiModelProperty(value = "員工號")
+		private String personNo;
+	/**
+	* 用戶姓名
+	*/
+		@ApiModelProperty(value = "用戶姓名")
+		private String personName;
+	/**
+	* 操作類型
+	*/
+		@ApiModelProperty(value = "操作類型")
+		private String operationType;
+	/**
+	* 舊數據
+	*/
+		@ApiModelProperty(value = "舊數據")
+		private String oldData;
+	/**
+	* 新數據
+	*/
+		@ApiModelProperty(value = "新數據")
+		private String newData;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/bank/userlog/mapper/UserLogMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.bank.userlog.mapper;
+
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.vo.UserLogVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 用戶軌跡 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-09-10
+ */
+public interface UserLogMapper extends BaseMapper<UserLog> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param userLog
+	 * @return
+	 */
+	List<UserLogVO> selectUserLogPage(IPage page, UserLogVO userLog);
+
+}

+ 30 - 0
src/main/java/org/springblade/bank/userlog/mapper/UserLogMapper.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.bank.userlog.mapper.UserLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="userLogResultMap" type="org.springblade.bank.userlog.entity.UserLog">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="bank_no" property="bankNo"/>
+        <result column="org_no" property="orgNo"/>
+        <result column="table_name" property="tableName"/>
+        <result column="person_no" property="personNo"/>
+        <result column="person_name" property="personName"/>
+        <result column="operation_type" property="operationType"/>
+        <result column="old_data" property="oldData"/>
+        <result column="new_data" property="newData"/>
+    </resultMap>
+
+
+    <select id="selectUserLogPage" resultMap="userLogResultMap">
+        select * from zh_user_log where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/bank/userlog/service/IUserLogService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.bank.userlog.service;
+
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.vo.UserLogVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 用戶軌跡 服务类
+ *
+ * @author BladeX
+ * @since 2021-09-10
+ */
+public interface IUserLogService extends BaseService<UserLog> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param userLog
+	 * @return
+	 */
+	IPage<UserLogVO> selectUserLogPage(IPage<UserLogVO> page, UserLogVO userLog);
+
+}

+ 41 - 0
src/main/java/org/springblade/bank/userlog/service/impl/UserLogServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.bank.userlog.service.impl;
+
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.vo.UserLogVO;
+import org.springblade.bank.userlog.mapper.UserLogMapper;
+import org.springblade.bank.userlog.service.IUserLogService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 用戶軌跡 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-09-10
+ */
+@Service
+public class UserLogServiceImpl extends BaseServiceImpl<UserLogMapper, UserLog> implements IUserLogService {
+
+	@Override
+	public IPage<UserLogVO> selectUserLogPage(IPage<UserLogVO> page, UserLogVO userLog) {
+		return page.setRecords(baseMapper.selectUserLogPage(page, userLog));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/bank/userlog/vo/UserLogVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.bank.userlog.vo;
+
+import org.springblade.bank.userlog.entity.UserLog;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 用戶軌跡视图实体类
+ *
+ * @author BladeX
+ * @since 2021-09-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "UserLogVO对象", description = "用戶軌跡")
+public class UserLogVO extends UserLog {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/bank/userlog/wrapper/UserLogWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.bank.userlog.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.vo.UserLogVO;
+import java.util.Objects;
+
+/**
+ * 用戶軌跡包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-09-10
+ */
+public class UserLogWrapper extends BaseEntityWrapper<UserLog, UserLogVO>  {
+
+	public static UserLogWrapper build() {
+		return new UserLogWrapper();
+ 	}
+
+	@Override
+	public UserLogVO entityVO(UserLog userLog) {
+		UserLogVO userLogVO = Objects.requireNonNull(BeanUtil.copy(userLog, UserLogVO.class));
+
+		//User createUser = UserCache.getUser(userLog.getCreateUser());
+		//User updateUser = UserCache.getUser(userLog.getUpdateUser());
+		//userLogVO.setCreateUserName(createUser.getName());
+		//userLogVO.setUpdateUserName(updateUser.getName());
+
+		return userLogVO;
+	}
+
+}