Ver Fonte

财务结算-修改

yumeng há 1 ano atrás
pai
commit
b954d3dda6

+ 9 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouRuleSettlementCheckController.java

@@ -10,6 +10,7 @@ import com.ruixuan.common.core.controller.BaseController;
 import com.ruixuan.common.core.domain.AjaxResult;
 import com.ruixuan.common.core.page.TableDataInfo;
 import com.ruixuan.common.enums.BusinessType;
+import com.ruixuan.common.utils.Check;
 import com.ruixuan.common.utils.poi.ExcelUtil;
 import com.ruixuan.isc.entity.KuaishouRuleSettlementCheck;
 import com.ruixuan.isc.service.IKuaishouRuleSettlementCheckService;
@@ -58,10 +59,13 @@ public class KuaishouRuleSettlementCheckController extends BaseController {
     }
 
     @GetMapping("/updateFinancialReviewStatusTotal")
-    public JSONObject updateFinancialReviewStatusTotal(String statDate, Long promoterId, Integer status) {
+    public JSONObject updateFinancialReviewStatusTotal(String statDate, Long promoterId, Integer status, String promoterInfo) {
 
         JSONObject returnJson = new JSONObject();
         try {
+            if (!Check.isNull(promoterInfo)) {
+                kuaishouRuleSettlementCheckService.replacePromoterInfo(promoterId, promoterInfo);
+            }
             Long date = Long.valueOf(statDate.replace("-", ""));
             kuaishouRuleSettlementCheckService.updateFinancialReviewStatusTotal(date, promoterId, status);
             returnJson.put("code", 200);
@@ -74,7 +78,7 @@ public class KuaishouRuleSettlementCheckController extends BaseController {
     }
 
     @GetMapping("/updateFinancialReviewDetails")
-    public JSONObject updateFinancialReviewDetails(Long id, Integer status) {
+    public JSONObject updateFinancialReviewDetails(Long id, Integer status, Long promoterId, String promoterInfo) {
 
         JSONObject returnJson = new JSONObject();
         try {
@@ -82,6 +86,9 @@ public class KuaishouRuleSettlementCheckController extends BaseController {
             update.setId(id);
             update.setSettlementStatus(status);
             kuaishouRuleSettlementCheckService.updateKuaishouRuleSettlementCheck(update);
+            if (!Check.isNull(promoterInfo)) {
+                kuaishouRuleSettlementCheckService.replacePromoterInfo(promoterId, promoterInfo);
+            }
             returnJson.put("code", 200);
             returnJson.put("message", "修改成功");
         } catch (Exception e) {

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouRuleSettlementCheckMapper.java

@@ -71,5 +71,7 @@ public interface KuaishouRuleSettlementCheckMapper
     void updateFinancialReviewStatusTotal(@Param("statDate") Long statDate, @Param("promoterId") Long promoterId, @Param("status") Integer status);
 
     List<JSONObject> detailList(@Param("date") Long date, @Param("promoterId") Long promoterId, @Param("itemId") Long itemId);
+
+    void replacePromoterInfo(@Param("promoterId") Long promoterId, @Param("promoterInfo") String promoterInfo);
 }
 

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouRuleSettlementCheckService.java

@@ -71,5 +71,7 @@ public interface IKuaishouRuleSettlementCheckService
     void updateFinancialReviewStatusTotal(Long statDate, Long promoterId, Integer status);
 
     List<JSONObject> detailList(Long date, Long promoterId, Long itemId);
+
+    void replacePromoterInfo(Long promoterId, String promoterInfo);
 }
 

+ 8 - 3
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouRuleSettlementCheckServiceImpl.java

@@ -98,17 +98,22 @@ public class KuaishouRuleSettlementCheckServiceImpl implements IKuaishouRuleSett
 
     @Override
     public List<JSONObject> getTotalList(Long date, Long promoterId, String promoterName) {
-        return kuaishouRuleSettlementCheckMapper.getTotalList(date,promoterId,promoterName);
+        return kuaishouRuleSettlementCheckMapper.getTotalList(date, promoterId, promoterName);
     }
 
     @Override
     public void updateFinancialReviewStatusTotal(Long statDate, Long promoterId, Integer status) {
-        kuaishouRuleSettlementCheckMapper.updateFinancialReviewStatusTotal(statDate,promoterId,status);
+        kuaishouRuleSettlementCheckMapper.updateFinancialReviewStatusTotal(statDate, promoterId, status);
     }
 
     @Override
     public List<JSONObject> detailList(Long date, Long promoterId, Long itemId) {
-        return kuaishouRuleSettlementCheckMapper.detailList(date,promoterId,itemId);
+        return kuaishouRuleSettlementCheckMapper.detailList(date, promoterId, itemId);
+    }
+
+    @Override
+    public void replacePromoterInfo(Long promoterId, String promoterInfo) {
+        kuaishouRuleSettlementCheckMapper.replacePromoterInfo(promoterId, promoterInfo);
     }
 }
 

+ 30 - 21
ruixuan-live/src/main/resources/mapper/isc/KuaishouRuleSettlementCheckMapper.xml

@@ -66,7 +66,7 @@
         where id = #{id}
     </select>
     <select id="getTotalList" resultType="com.alibaba.fastjson.JSONObject">
-        select *
+        select t.*,t2.promoter_info as 'promoterInfo'
         from (select promoter_create_name as 'userName',
         promoter_id as 'promoterId',
         promoter_name as 'promoterName',
@@ -86,35 +86,38 @@
         <if test="promoterName != null and promoterName != '' ">
             AND promoter_name LIKE CONCAT('%', #{promoterName}, '%')
         </if>
-        group by promoter_id) t
+        group by promoter_id) t left join kuaishou_rule_settlement_mentor t2
+        on t.promoterId = t2.promoter_id
         order by t.referenceAmount desc, t.promoterId asc
     </select>
     <select id="detailList" resultType="com.alibaba.fastjson.JSONObject">
-        select id as 'id',
-        item_ids as 'itemIds',
-        item_title as 'itemName',
-        promoter_id as 'promoterId',
-        promoter_create_name as 'promoterCreateName',
-        promoter_name as 'promoterName',
-        item_create_id as 'itemCreateId',
-        item_create_name as 'itemCreateName',
-        anchor_amount as 'anchorAmount',
-        reference_amount as 'referenceAmount',
+        select t.id as 'id',
+        t.item_ids as 'itemIds',
+        t.item_title as 'itemName',
+        t.promoter_id as 'promoterId',
+        t.promoter_create_name as 'promoterCreateName',
+        t.promoter_name as 'promoterName',
+        t.item_create_id as 'itemCreateId',
+        t.item_create_name as 'itemCreateName',
+        t.anchor_amount as 'anchorAmount',
+        t.reference_amount as 'referenceAmount',
         (case
-        when settlement_status = 1 then '待付款'
-        when settlement_status = 2 then '已付款'
+        when t.settlement_status = 1 then '待付款'
+        when t.settlement_status = 2 then '已付款'
         else ''
         end
         ) as 'settlementStatusStr',
-        settlement_status as 'settlementStatus',
-        remarks as 'remarks'
-        from kuaishou_rule_settlement_check
-        where promoter_id = #{promoterId}
-        and stat_date = #{date}
+        t.settlement_status as 'settlementStatus',
+        t.remarks as 'remarks',
+        t2.promoter_info as 'promoterInfo'
+        from kuaishou_rule_settlement_check t left join kuaishou_rule_settlement_mentor t2
+        on t.promoter_id = t2.promoter_id
+        where t.promoter_id = #{promoterId}
+        and t.stat_date = #{date}
         <if test="itemId != null  ">
-            and item_ids like concat('%',concat(#{itemId},'%'))
+            and t.item_ids like concat('%',concat(#{itemId},'%'))
         </if>
-        order by anchorAmount desc, item_ids asc
+        order by t.anchor_amount desc, t.item_ids asc
     </select>
 
     <insert id="insertKuaishouRuleSettlementCheck" parameterType="com.ruixuan.isc.entity.KuaishouRuleSettlementCheck"
@@ -205,6 +208,12 @@
         </foreach>
 
     </insert>
+    <insert id="replacePromoterInfo">
+        replace into kuaishou_rule_settlement_mentor(promoter_id,promoter_info) values (
+        #{promoterId},
+        #{promoterInfo}
+        )
+    </insert>
 
     <update id="updateKuaishouRuleSettlementCheck" parameterType="com.ruixuan.isc.entity.KuaishouRuleSettlementCheck">
         update kuaishou_rule_settlement_check