Pārlūkot izejas kodu

垫款 初版1.1优化修改

zhaoxian 2 gadi atpakaļ
vecāks
revīzija
93ad39c331

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

@@ -199,9 +199,9 @@ public class FinancePaymentApplicationController {
      * 获取广告主
      */
     @GetMapping(value = "/getAdvertisers")
-    public Result<Object> getAdvertisers() {
+    public Result<Object> getAdvertisers(String mediaType) {
         try {
-            return financePaymentApplicationService.getAdvertisers();
+            return financePaymentApplicationService.getAdvertisers(mediaType);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/FinancePaymentApplicationMapper.java

@@ -16,7 +16,7 @@ import java.util.List;
  */
 public interface FinancePaymentApplicationMapper extends BaseMapper<FinancePaymentApplication> {
 
-    List<JSONObject> getAdvertisers();
+    List<JSONObject> getAdvertisers(String mediaType);
 
     List<JSONObject> getProductByAdvertiserIds(@Param("advertiserIds") List<String> advertiserIds);
 

+ 23 - 19
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentApplicationMapper.xml

@@ -8,6 +8,7 @@
                  LEFT JOIN
              ctop_advertiser t2 ON t1.advertiser_name = t2.name
         WHERE t2.id is not null
+          AND media_type = #{mediaType}
         GROUP BY t1.advertiser_name
     </select>
 
@@ -80,25 +81,28 @@
 
 
     <select id="queryAuditProcess" resultType="com.alibaba.fastjson.JSONObject">
-        (SELECT t1.audit_status as 'auditStatus', t1.revieweder_id as 'userId', t2.realname as 'userName', t4.role_name as 'roleName', t1.approval_content as 'approvalContent', t1.files as 'files', t1.create_time as 'time'
-         FROM finance_payment_application_record t1
-                  LEFT JOIN sys_user t2 ON t1.revieweder_id = t2.id
-                  LEFT JOIN sys_user_role t3 ON t2.id = t3.user_id
-                  LEFT JOIN sys_role t4 ON t3.role_id = t4.id
-         WHERE t1.application_id = #{id}
-         ORDER BY t1.create_time)
-        UNION ALL
-        SELECT t1.audit_status,
-               t1.applicanter_id,
-               t1.applicanter,
-               t4.role_name,
-               t1.approval_content,
-               t1.files,
-               t1.update_time
-        FROM finance_payment_application t1
-                 LEFT JOIN sys_user_role t3 ON t1.applicanter_id = t3.user_id
-                 LEFT JOIN sys_role t4 ON t3.role_id = t4.id
-        WHERE t1.id = #{id}
+        SELECT *
+        FROM (
+                 SELECT t1.audit_status as 'auditStatus', t1.revieweder_id as 'userId', t2.realname as 'userName', t4.role_name as 'roleName', t1.approval_content as 'approvalContent', t1.files as 'files', t1.create_time as 'time'
+                 FROM finance_payment_application_record t1
+                          LEFT JOIN sys_user t2 ON t1.revieweder_id = t2.id
+                          LEFT JOIN sys_user_role t3 ON t2.id = t3.user_id
+                          LEFT JOIN sys_role t4 ON t3.role_id = t4.id
+                 WHERE t1.application_id = #{id}
+                 UNION ALL
+                 SELECT t1.audit_status,
+                        '-',
+                        '-',
+                        t4.role_name,
+                        t1.approval_content,
+                        t1.files,
+                        t1.update_time
+                 FROM finance_payment_application t1
+                          LEFT JOIN sys_user_role t3 ON t1.applicanter_id = t3.user_id
+                          LEFT JOIN sys_role t4 ON t3.role_id = t4.id
+                 WHERE t1.id = #{id}
+             ) t
+        ORDER BY t.time
     </select>
 
 </mapper>

+ 25 - 20
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentRechargeApplicationMapper.xml

@@ -3,25 +3,28 @@
 <mapper namespace="cn.com.ctop.finance.payment.mapper.FinancePaymentRechargeApplicationMapper">
 
     <select id="queryAuditProcess" resultType="com.alibaba.fastjson.JSONObject">
-        (SELECT t1.audit_status as 'auditStatus', t1.recharge_id as 'userId', t2.realname as 'userName', t4.role_name as 'roleName', t1.approval_content as 'approvalContent', t1.files as 'files', t1.create_time as 'time'
-         FROM finance_payment_recharge_application_record t1
-                  LEFT JOIN sys_user t2 ON t1.revieweder_id = t2.id
-                  LEFT JOIN sys_user_role t3 ON t2.id = t3.user_id
-                  LEFT JOIN sys_role t4 ON t3.role_id = t4.id
-         WHERE t1.recharge_id = #{id}
-         ORDER BY t1.create_time)
-        UNION ALL
-        SELECT t1.audit_status,
-               t1.applicanter_id,
-               t1.applicanter,
-               t4.role_name,
-               t1.approval_content,
-               t1.files,
-               t1.update_time
-        FROM finance_payment_recharge_application t1
-                 LEFT JOIN sys_user_role t3 ON t1.applicanter_id = t3.user_id
-                 LEFT JOIN sys_role t4 ON t3.role_id = t4.id
-        WHERE t1.id = #{id}
+        SELECT *
+        FROM (
+                 SELECT t1.audit_status as 'auditStatus', t1.recharge_id as 'userId', t2.realname as 'userName', t4.role_name as 'roleName', t1.approval_content as 'approvalContent', t1.files as 'files', t1.create_time as 'time'
+                 FROM finance_payment_recharge_application_record t1
+                          LEFT JOIN sys_user t2 ON t1.revieweder_id = t2.id
+                          LEFT JOIN sys_user_role t3 ON t2.id = t3.user_id
+                          LEFT JOIN sys_role t4 ON t3.role_id = t4.id
+                 WHERE t1.recharge_id = #{id}
+                 UNION ALL
+                 SELECT t1.audit_status,
+                        '-',
+                        '-',
+                        t4.role_name,
+                        t1.approval_content,
+                        t1.files,
+                        t1.update_time
+                 FROM finance_payment_recharge_application t1
+                          LEFT JOIN sys_user_role t3 ON t1.applicanter_id = t3.user_id
+                          LEFT JOIN sys_role t4 ON t3.role_id = t4.id
+                 WHERE t1.id = #{id}
+             ) t
+        ORDER BY t.time
     </select>
 
 
@@ -44,7 +47,9 @@
         t1.audit_status as 'auditStatus',
         t1.payment_media as 'paymentMedia',
         t1.recharge_type as 'rechargeType',
-        t2.rebate_rate as 'rebateRate'
+        t2.rebate_rate as 'rebateRate',
+        t1.revieweder_id as 'reviewederId',
+        t1.revieweder as 'revieweder'
         FROM finance_payment_recharge_application t1
         LEFT JOIN finance_payment_recharge_account t2 ON t1.id = t2.recharge_id
         <where>

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/service/IFinancePaymentApplicationService.java

@@ -15,7 +15,7 @@ public interface IFinancePaymentApplicationService extends IService<FinancePayme
 
     void add(JSONObject request);
 
-    Result<Object> getAdvertisers();
+    Result<Object> getAdvertisers(String mediaType);
 
     Result<Object> getProductByAdvertiserIds(String ids);
 

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

@@ -93,8 +93,8 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
     }
 
     @Override
-    public Result<Object> getAdvertisers() {
-        return Result.ok(baseMapper.getAdvertisers());
+    public Result<Object> getAdvertisers(String mediaType) {
+        return Result.ok(baseMapper.getAdvertisers(mediaType));
     }
 
     @Override
@@ -190,7 +190,7 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
         String auditStatus = oldApplication.getAuditStatus();//4-临时通过
         if ("4".equals(auditStatus)) {
             application.setAuditStatus("3");
-            application.setApprovalContent(Check.isNull(application.getApprovalContent()) ? "补传文件" : application.getApprovalContent());
+            application.setApprovalContent(Check.isNull(application.getApprovalContent()) ? "-" : application.getApprovalContent());
             application.setReviewederId(application.getUserId());
             SysUser user = userService.getById(application.getApplicanterId());
             if (!Check.isNull(user)) {
@@ -239,7 +239,7 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
 //TODO                    application.setReviewederId("b161b7d9793942f980dbfe8c931cd1b0");
 //                    application.setRevieweder("丁兆明");
                     application.setReviewederId("1506873789009489921");
-                    application.setRevieweder("芮珊珊 ");
+                    application.setRevieweder("芮珊珊");
                 } else {
 //TODO                    application.setReviewederId("00d630a129e4487cba5427788a1f08ce");
 //                    application.setRevieweder("赵旺");
@@ -251,6 +251,9 @@ public class FinancePaymentApplicationServiceImpl extends ServiceImpl<FinancePay
     }
 
     private void insertRecord(Long applicationId, String operatorId, String status, String txt, String files) {
+        if ("1".equals(status)) {
+            return;
+        }
         FinancePaymentApplicationRecord record = new FinancePaymentApplicationRecord();
         record.setApplicationId(applicationId);
         record.setReviewederId(operatorId);

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

@@ -307,7 +307,7 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
         String auditStatus = oldApplication.getAuditStatus();//4-临时通过
         if ("4".equals(auditStatus)) {
             recharge.setAuditStatus("3");
-            recharge.setApprovalContent(Check.isNull(recharge.getApprovalContent()) ? "补传文件" : recharge.getApprovalContent());
+            recharge.setApprovalContent(Check.isNull(recharge.getApprovalContent()) ? "-" : recharge.getApprovalContent());
             recharge.setReviewederId(recharge.getUserId());
             SysUser user = userService.getById(recharge.getUserId());
             if (!Check.isNull(user)) {
@@ -338,6 +338,9 @@ public class FinancePaymentRechargeApplicationServiceImpl extends ServiceImpl<Fi
     }
 
     private void insertRecord(Long rechargeId, String operatorId, String status, String txt, String files) {
+        if ("1".equals(status)) {
+            return;
+        }
         FinancePaymentRechargeApplicationRecord record = new FinancePaymentRechargeApplicationRecord();
         record.setRechargeId(rechargeId);
         record.setReviewederId(operatorId);