ソースを参照

垫款 初版1.2优化修改

zhaoxian 2 年 前
コミット
38d3dfcd01

+ 7 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/service/impl/FinancePaymentApplicationServiceImpl.java

@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -76,7 +77,7 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
         boolean save = this.save(application);
         if (save) {
             //添加申请记录 0 创建
-            insertRecord(application.getId(), application.getApplicanterId(), "0", null, application.getFiles());
+            insertRecord(application.getId(), application.getApplicanterId(), "0", null, application.getFiles(), new Date());
             //消息通知内容
             String message = messageTemplate.getFinancePaymentApplicationMessage(application);
             //审核人为 财务审核角色
@@ -133,7 +134,7 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
             }
             this.updateById(application);
             //添加记录
-            insertRecord(application.getId(), application.getUserId(), oldApplication.getAuditStatus(), oldApplication.getApprovalContent(), oldApplication.getFiles());
+            insertRecord(application.getId(), application.getUserId(), oldApplication.getAuditStatus(), oldApplication.getApprovalContent(), oldApplication.getFiles(), oldApplication.getUpdateTime());
             String failMessage = messageTemplate.getFinancePaymentApplicationFailMessage(oldApplication);
             sendMessageService.sendMessage(oldApplication.getApplicanterId(), failMessage);
         }
@@ -160,7 +161,7 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
         getRevieweder(application);
         this.updateById(application);
         //添加修改记录
-        insertRecord(application.getId(), application.getApplicanterId(), "-1", null, application.getFiles());
+        insertRecord(application.getId(), application.getApplicanterId(), "-1", null, application.getFiles(), new Date());
         //消息通知内容
         String message = messageTemplate.getFinancePaymentApplicationMessage(application);
         //审核人为 财务审核角色
@@ -198,7 +199,7 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
             }
             this.updateById(application);
             //添加审核记录
-            insertRecord(application.getId(), oldApplication.getReviewederId(), auditStatus, oldApplication.getApprovalContent(), oldApplication.getFiles());
+            insertRecord(application.getId(), oldApplication.getReviewederId(), auditStatus, oldApplication.getApprovalContent(), oldApplication.getFiles(), oldApplication.getUpdateTime());
         }
         return Result.ok();
     }
@@ -250,7 +251,7 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
         }
     }
 
-    private void insertRecord(Long applicationId, String operatorId, String status, String txt, String files) {
+    private void insertRecord(Long applicationId, String operatorId, String status, String txt, String files, Date time) {
         if ("1".equals(status)) {
             return;
         }
@@ -260,6 +261,7 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
         record.setAuditStatus(status);
         record.setApprovalContent(txt);
         record.setFiles(files);
+        record.setCreateTime(time);
         recordMapper.insert(record);
     }
 

+ 8 - 9
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/service/impl/FinancePaymentRechargeApplicationServiceImpl.java

@@ -32,6 +32,7 @@ import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -133,7 +134,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             }
             rechargeAccountService.saveBatch(accountList);
             //添加申请记录
-            insertRecord(recharge.getId(), recharge.getApplicanterId(), "0", null, recharge.getFiles());
+            insertRecord(recharge.getId(), recharge.getApplicanterId(), "0", null, recharge.getFiles(), new Date());
             //消息通知内容
             String message = null;
             List<SysUser> users = null;
@@ -208,7 +209,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
         rechargeAccountService.saveBatch(accountList);
 
         //添加申请记录 -1 退回修改
-        insertRecord(recharge.getId(), recharge.getApplicanterId(), "-1", null, recharge.getFiles());
+        insertRecord(recharge.getId(), recharge.getApplicanterId(), "-1", null, recharge.getFiles(), new Date());
         //消息通知内容
         String message = null;
         List<SysUser> users = null;
@@ -258,7 +259,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
                 sendMessageService.sendMessage(u.getId(), message);
             }
             //添加审核记录 1:财务审核完成
-            insertRecord(recharge.getId(), recharge.getUserId(), "1", recharge.getApprovalContent(), recharge.getFiles());
+            insertRecord(recharge.getId(), recharge.getUserId(), "1", recharge.getApprovalContent(), recharge.getFiles(), new Date());
         } else if ("3".equals(auditStatus) || "4".equals(auditStatus)) {
             recharge.setReviewederId(recharge.getUserId());
             SysUser user = userService.getById(recharge.getUserId());
@@ -279,7 +280,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             }
             this.updateById(recharge);
             //添加审核记录
-            insertRecord(recharge.getId(), recharge.getUserId(), oldRecharge.getAuditStatus(), oldRecharge.getApprovalContent(), oldRecharge.getFiles());
+            insertRecord(recharge.getId(), recharge.getUserId(), oldRecharge.getAuditStatus(), oldRecharge.getApprovalContent(), oldRecharge.getFiles(), oldRecharge.getUpdateTime());
             JSONObject oldData = JSONObject.parseObject(JSONObject.toJSONString(oldRecharge)).toJavaObject(JSONObject.class);
             String failMessage = null;
             List<SysUser> users = null;
@@ -315,7 +316,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             }
             this.updateById(recharge);
             //添加审核记录
-            insertRecord(recharge.getId(), oldApplication.getRevieweder(), auditStatus, oldApplication.getApprovalContent(), oldApplication.getFiles());
+            insertRecord(recharge.getId(), oldApplication.getRevieweder(), auditStatus, oldApplication.getApprovalContent(), oldApplication.getFiles(), oldApplication.getUpdateTime());
         }
         return Result.ok();
     }
@@ -337,16 +338,14 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
         }
     }
 
-    private void insertRecord(Long rechargeId, String operatorId, String status, String txt, String files) {
-        if ("1".equals(status)) {
-            return;
-        }
+    private void insertRecord(Long rechargeId, String operatorId, String status, String txt, String files, Date time) {
         FinancePaymentRechargeApplicationRecord record = new FinancePaymentRechargeApplicationRecord();
         record.setRechargeId(rechargeId);
         record.setReviewederId(operatorId);
         record.setAuditStatus(status);
         record.setApprovalContent(txt);
         record.setFiles(files);
+        record.setCreateTime(time);
         recordMapper.insert(record);
     }