瀏覽代碼

Merge remote-tracking branch 'origin/master'

yumeng 2 年之前
父節點
當前提交
d97ff2cc58

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/controller/FinancePaymentApplicationController.java

@@ -77,9 +77,9 @@ public class FinancePaymentApplicationController {
         if (!Check.isNull(application.getAuditRole())) {
             queryWrapper.like("audit_status", "1");
             if ("finance".equals(application.getAuditRole())) {
-                queryWrapper.like("revieweder_id", "financialReview");
+                queryWrapper.like("revieweder_id", "financ");
             } else {
-                queryWrapper.notLike("revieweder_id", "financialReview");
+                queryWrapper.notLike("revieweder_id", "financ");
             }
         }
         if (!Check.isNull(application.getAdvertiserName())) {

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

@@ -54,6 +54,11 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
     @Autowired
     private IMessageTemplate messageTemplate;
 
+    //财务审核角色ID
+    public static final String FINANCIAL_REVIEW_ROLE_ID = "32825ea6b43cb61bffa09bf05ad69cf2";
+    //财务角色ID
+    public static final String FINANCIAL_ROLE_ID = "5f3ee6bbd66cbd2df404cdec4ad7e5a3";
+
     @Override
     public void add(JSONObject request) throws InterruptedException {
         FinancePaymentApplication application = JSONObject.parseObject(JSONObject.toJSONString(request), FinancePaymentApplication.class);
@@ -85,9 +90,9 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
         insertRecord(application.getId(), application.getApplicanterId(), "0", null, application.getFiles(), createTime);
         String message = messageTemplate.getFinancePaymentApplicationMessage(application);
         //审核人为 财务审核角色
-        if ("financialReview".equals(application.getReviewederId())) {
-            //roleID:32825ea6b43cb61bffa09bf05ad69cf2
-            List<SysUser> users = userService.getUserListByRoleId("32825ea6b43cb61bffa09bf05ad69cf2");
+        if (application.getReviewederId().contains("financ")) {
+            List<SysUser> users = userService.getUserListByRoleId(FINANCIAL_REVIEW_ROLE_ID);
+            users.addAll(userService.getUserListByRoleId(FINANCIAL_ROLE_ID));
             for (SysUser u : users) {
                 sendMessageService.sendMessage(u.getId(), message);
             }
@@ -119,7 +124,7 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
         String reviewederId = oldApplication.getReviewederId();
         String auditStatus = application.getAuditStatus();//1-待审核、3-审核通过、4-临时通过、5-审核拒绝
         if ("3".equals(auditStatus) || "4".equals(auditStatus)) {
-            if ("financialReview".equals(reviewederId)) {
+            if (reviewederId.contains("financ")) {
                 application.setReviewederId(application.getUserId());
                 SysUser user = userService.getById(application.getUserId());
                 if (!Check.isNull(user)) {
@@ -177,9 +182,9 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
         //消息通知内容
         String message = messageTemplate.getFinancePaymentApplicationMessage(application);
         //审核人为 财务审核角色
-        if ("financialReview".equals(application.getReviewederId())) {
-            //roleID:32825ea6b43cb61bffa09bf05ad69cf2
-            List<SysUser> users = userService.getUserListByRoleId("32825ea6b43cb61bffa09bf05ad69cf2");
+        if (application.getReviewederId().contains("financ")) {
+            List<SysUser> users = userService.getUserListByRoleId(FINANCIAL_REVIEW_ROLE_ID);
+            users.addAll(userService.getUserListByRoleId(FINANCIAL_ROLE_ID));
             for (SysUser u : users) {
                 sendMessageService.sendMessage(u.getId(), message);
             }
@@ -242,7 +247,7 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
         String rebateType = application.getPaymentType();//类型:1-预付款、2-垫款
         if ("1".equals(rebateType)) {
             //返回财务
-            application.setReviewederId("financialReview");
+            application.setReviewederId("financ");
             application.setRevieweder("-");
         } else {
             String paymentMedia = application.getPaymentMedia();//媒体类型 1-头条、2-快手、7-磁力金牛、9-广点通

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

@@ -68,6 +68,8 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
 
     //财务审核角色ID
     public static final String FINANCIAL_REVIEW_ROLE_ID = "32825ea6b43cb61bffa09bf05ad69cf2";
+    //财务角色ID
+    public static final String FINANCIAL_ROLE_ID = "5f3ee6bbd66cbd2df404cdec4ad7e5a3";
     //媒介审核角色ID
     public static final String MEIDA_MANAGER_ROLE_ID = "4e9ba2fe611ef62a8ce1d4df086f94c3";
 
@@ -156,14 +158,15 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             }
             rechargeAccountService.saveBatch(accountList);
             data.put("displayAmount", displayAmount);
-            data.put("amends",recharge.getAmends());
+            data.put("amends", recharge.getAmends());
             //消息通知内容
             String message = null;
             List<SysUser> users = null;
-            if ("financialReview".equals(recharge.getReviewederId())) {
+            if (recharge.getReviewederId().contains("financ")) {
                 //财务
                 message = messageTemplate.getFinancePaymentApplicationCWRechargeMessage(data);
                 users = userService.getUserListByRoleId(FINANCIAL_REVIEW_ROLE_ID);
+                users.addAll(userService.getUserListByRoleId(FINANCIAL_ROLE_ID));
             } else {
                 //媒介
                 data.put("accountIds", accountIds.substring(0, accountIds.length() - 1));
@@ -247,14 +250,15 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
         rechargeAccountService.saveBatch(accountList);
 
         data.put("displayAmount", displayAmount);
-        data.put("amends",recharge.getAmends());
+        data.put("amends", recharge.getAmends());
         //消息通知内容
         String message = null;
         List<SysUser> users = null;
-        if ("financialReview".equals(recharge.getReviewederId())) {
+        if (recharge.getReviewederId().contains("financ")) {
             //财务
             message = messageTemplate.getFinancePaymentApplicationCWRechargeMessage(data);
             users = userService.getUserListByRoleId(FINANCIAL_REVIEW_ROLE_ID);
+            users.addAll(userService.getUserListByRoleId(FINANCIAL_ROLE_ID));
         } else {
             //媒介
             data.put("accountIds", accountIds.substring(0, accountIds.length() - 1));
@@ -283,7 +287,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             //添加审核记录 1:财务审核完成
             insertRecord(recharge.getId(), recharge.getUserId(), "6", recharge.getApprovalContent(), recharge.getFiles(), new Date());
             JSONObject oldData = JSONObject.parseObject(JSONObject.toJSONString(oldRecharge)).toJavaObject(JSONObject.class);
-            oldData.put("amends",oldRecharge.getAmends());
+            oldData.put("amends", oldRecharge.getAmends());
             JSONObject amount = rechargeAccountService.queryAmounts(recharge.getId());
             if (!Check.isNull(amount)) {
                 oldData.put("accountIds", amount.getString("accountIds"));
@@ -306,7 +310,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             poolService.reduce(oldRecharge, null);
 
             JSONObject oldData = JSONObject.parseObject(JSONObject.toJSONString(oldRecharge)).toJavaObject(JSONObject.class);
-            oldData.put("amends",oldRecharge.getAmends());
+            oldData.put("amends", oldRecharge.getAmends());
             JSONObject amount = rechargeAccountService.queryAmounts(recharge.getId());
             if (!Check.isNull(amount)) {
                 oldData.put("accountIds", amount.getString("accountIds"));
@@ -330,12 +334,13 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
             //添加审核记录
             insertRecord(recharge.getId(), recharge.getUserId(), oldRecharge.getAuditStatus(), oldRecharge.getApprovalContent(), oldRecharge.getFiles(), oldRecharge.getUpdateTime());
             JSONObject oldData = JSONObject.parseObject(JSONObject.toJSONString(oldRecharge)).toJavaObject(JSONObject.class);
-            oldData.put("amends",oldRecharge.getAmends());
+            oldData.put("amends", oldRecharge.getAmends());
             String failMessage = null;
             List<SysUser> users = null;
-            if ("financialReview".equals(oldRecharge.getReviewederId())) {
+            if (oldRecharge.getReviewederId().contains("financ")) {
                 failMessage = messageTemplate.getFinancePaymentApplicationCWRechargeRefuseMessage(oldData);
                 users = userService.getUserListByRoleId(FINANCIAL_REVIEW_ROLE_ID);
+                users.addAll(userService.getUserListByRoleId(FINANCIAL_ROLE_ID));
             } else {
                 failMessage = messageTemplate.getFinancePaymentApplicationMJRechargeRefuseMessage(oldData);
                 users = userService.getUserListByRoleId(MEIDA_MANAGER_ROLE_ID);
@@ -383,7 +388,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
     private void getReviewedRole(FinancePaymentRechargeApplication recharge) {
         String financialReview = recharge.getFinancialReview();
         if (!Check.isNull(financialReview) && "1".equals(financialReview)) {
-            recharge.setReviewederId("financialReview");
+            recharge.setReviewederId("financ");
             recharge.setRevieweder("-");
             recharge.setAuditStatus("1");//待审核
         } else {