yumeng 1 tahun lalu
induk
melakukan
8da5e685d6

+ 39 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouRuleSettlementDataController.java

@@ -266,6 +266,45 @@ public class KuaishouRuleSettlementDataController extends BaseController {
     }
 
 
+    @PutMapping("/updateSettlement")
+    public AjaxResult updateSettlement(@RequestBody KuaishouRuleSettlementData kuaishouRuleSettlementData) {
+        KuaishouRuleSettlementData updateKuaishouRuleSettlementData = new KuaishouRuleSettlementData();
+        updateKuaishouRuleSettlementData.setId(kuaishouRuleSettlementData.getId());
+        if (!Check.isNull(kuaishouRuleSettlementData.getAnchorAmount())) {
+            updateKuaishouRuleSettlementData.setAnchorAmount(kuaishouRuleSettlementData.getAnchorAmount());
+        }
+        if (!Check.isNull(kuaishouRuleSettlementData.getReferenceAmount())) {
+            updateKuaishouRuleSettlementData.setReferenceAmount(kuaishouRuleSettlementData.getReferenceAmount());
+        }
+        if (!Check.isNull(kuaishouRuleSettlementData.getRemarks())) {
+            updateKuaishouRuleSettlementData.setRemarks(kuaishouRuleSettlementData.getRemarks());
+
+        }
+        KuaishouRuleSettlementData selectData = kuaishouRuleSettlementDataService.selectKuaishouRuleSettlementDataById(kuaishouRuleSettlementData.getId());
+        KuaishouRuleSettlementCheck check = new KuaishouRuleSettlementCheck();
+        //  kuaishouRuleSettlementCheckService
+        Long relateId = selectData.getRelateId();
+        Long promoterId = selectData.getPromoterId();
+        Long statDate = selectData.getStatDate();
+        check.setRelateId(relateId);
+        check.setPromoterId(promoterId);
+        check.setStatDate(statDate);
+        if (!Check.isNull(kuaishouRuleSettlementData.getAnchorAmount())) {
+            check.setAnchorAmount(kuaishouRuleSettlementData.getAnchorAmount());
+        }
+        if (!Check.isNull(kuaishouRuleSettlementData.getReferenceAmount())) {
+            check.setReferenceAmount(kuaishouRuleSettlementData.getReferenceAmount());
+        }
+        if (!Check.isNull(kuaishouRuleSettlementData.getRemarks())) {
+            check.setRemarks(kuaishouRuleSettlementData.getRemarks());
+        }
+
+        kuaishouRuleSettlementCheckService.updateCheck(check);
+
+        return toAjax(kuaishouRuleSettlementDataService.updateKuaishouRuleSettlementData(updateKuaishouRuleSettlementData));
+    }
+
+
     @GetMapping("/getPromoterSettlementDetail")
     public TableDataInfo getPromoterSettlementDetail(String statDate, Long promoterId, Integer settlementStatus, Long itemId) {
         Long date = Long.valueOf(statDate.replace("-", ""));

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

@@ -73,5 +73,7 @@ public interface KuaishouRuleSettlementCheckMapper
     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);
+
+    void updateCheck(KuaishouRuleSettlementCheck check);
 }
 

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

@@ -73,5 +73,7 @@ public interface IKuaishouRuleSettlementCheckService
     List<JSONObject> detailList(Long date, Long promoterId, Long itemId);
 
     void replacePromoterInfo(Long promoterId, String promoterInfo);
+
+    void updateCheck(KuaishouRuleSettlementCheck check);
 }
 

+ 5 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouRuleSettlementCheckServiceImpl.java

@@ -115,5 +115,10 @@ public class KuaishouRuleSettlementCheckServiceImpl implements IKuaishouRuleSett
     public void replacePromoterInfo(Long promoterId, String promoterInfo) {
         kuaishouRuleSettlementCheckMapper.replacePromoterInfo(promoterId, promoterInfo);
     }
+
+    @Override
+    public void updateCheck(KuaishouRuleSettlementCheck check) {
+        kuaishouRuleSettlementCheckMapper.updateCheck(check);
+    }
 }
 

+ 16 - 0
ruixuan-live/src/main/java/com/ruixuan/jiaoyang/controller/JiaoYangReportController.java

@@ -468,6 +468,22 @@ public class JiaoYangReportController extends BaseController {
     }
 
 
+
+    @GetMapping("/getTopItem")
+    public TableDataInfo getTopItem(String statDate, Long promoterId) {
+        Long date = Long.valueOf(statDate.replace("-", ""));
+        startPage();
+        List<JSONObject> list = jiaoYangReportService.getTopItem(date, promoterId);
+        return getDataTable(list);
+    }
+
+    @GetMapping("/getTopItemUser")
+    public List<JSONObject> getTopItemUser() {
+        List<JSONObject> list = jiaoYangReportService.getTopItemUser();
+
+        return list;
+    }
+
     @GetMapping("/indexOrderInfo")
     @ApiOperation(value = "首页-订单数据")
     public JSONObject orderTotal(

+ 4 - 0
ruixuan-live/src/main/java/com/ruixuan/jiaoyang/mapper/JiaoYangReportMapper.java

@@ -46,4 +46,8 @@ public interface JiaoYangReportMapper {
     JSONObject dayData(@Param("date") Long date, @Param("lastDate") Long lastDate);
 
     JSONObject monthData(@Param("nowMonthStartDate") Long nowMonthStartDate, @Param("nowMonthEndDate") Long nowMonthEndDate, @Param("lastMonthStartDate") Long lastMonthStartDate, @Param("lastMonthEndDate") Long lastMonthEndDate);
+
+    List<JSONObject> getTopItem(@Param("date") Long date, @Param("promoterId") Long promoterId);
+
+    List<JSONObject> getTopItemUser();
 }

+ 4 - 0
ruixuan-live/src/main/java/com/ruixuan/jiaoyang/service/IJiaoYangReportService.java

@@ -45,4 +45,8 @@ public interface IJiaoYangReportService {
     JSONObject dayData(Long date, Long lastDate);
 
     JSONObject monthData(Long nowMonthStartDate, Long nowMonthEndDate, Long lastMonthStartDate, Long lastMonthEndDate);
+
+    List<JSONObject> getTopItem(Long date, Long promoterId);
+
+    List<JSONObject> getTopItemUser();
 }

+ 10 - 0
ruixuan-live/src/main/java/com/ruixuan/jiaoyang/service/impl/JiaoYangReportServiceImpl.java

@@ -113,4 +113,14 @@ public class JiaoYangReportServiceImpl implements IJiaoYangReportService {
     public JSONObject monthData(Long nowMonthStartDate, Long nowMonthEndDate, Long lastMonthStartDate, Long lastMonthEndDate) {
         return jiaoYangReportMapper.monthData(nowMonthStartDate, nowMonthEndDate, lastMonthStartDate, lastMonthEndDate);
     }
+
+    @Override
+    public List<JSONObject> getTopItem(Long date, Long promoterId) {
+        return jiaoYangReportMapper.getTopItem(date,promoterId);
+    }
+
+    @Override
+    public List<JSONObject> getTopItemUser() {
+        return jiaoYangReportMapper.getTopItemUser();
+    }
 }

+ 6 - 0
ruixuan-live/src/main/resources/mapper/isc/KuaishouRuleSettlementCheckMapper.xml

@@ -245,6 +245,12 @@
         and  stat_date = #{statDate}
         and  settlement_status = 1
     </update>
+    <update id="updateCheck" parameterType="com.ruixuan.isc.entity.KuaishouRuleSettlementCheck">
+        update kuaishou_rule_settlement_check set anchor_amount = #{anchorAmount},reference_amount = #{referenceAmount},remarks = #{remarks}
+        where promoter_id = #{promoterId}
+        and  stat_date = #{statDate}
+        and  relate_id = #{relateId}
+    </update>
 
     <delete id="deleteKuaishouRuleSettlementCheckById" parameterType="java.lang.Long">
         delete from kuaishou_rule_settlement_check where id = #{id}

+ 42 - 1
ruixuan-live/src/main/resources/mapper/jiaoyang/JiaoYangReportMapper.xml

@@ -130,7 +130,7 @@
         <if test="type != null and type != '' ">
             and ttt.type = #{type}
         </if>
-        order by t.orderNum desc
+        order by t.payAmount desc
     </select>
     <select id="anchorOrderDetail" resultType="com.alibaba.fastjson.JSONObject">
         select t.*
@@ -689,6 +689,47 @@ from (select date_format(#{date},'%Y/%m/%d')
         and t2.type = 1
         ) t2
     </select>
+    <select id="getTopItem" resultType="com.alibaba.fastjson.JSONObject">
+        select t1.*,
+        t2.promotionVolume as 'yesPromotionVolume',
+        t1.promotionVolume - t2.promotionVolume as 'difference',
+        concat(round((t1.promotionVolume - t2.promotionVolume) / t2.promotionVolume * 100, 2), '%') as
+        'increaseInPrice',
+        (
+        case when t2.itemId is null
+        then 1
+        else 2
+        end
+        ) as 'isNew'
+        from (select clip_id as 'clipId',
+        clip_name as 'clipName',
+        item_id as 'itemId',
+        item_name as 'itemName',
+        item_img_url as 'itemImgUrl',
+        item_price as 'itemPrice',
+        promotion_volume as 'promotionVolume',
+        promotion_promoter_count as 'promotionPromoterCount'
+        from jy_clip_top_list
+        where stat_date = #{date}
+        <if test="promoterId != null and promoterId != ''">
+            and clip_id = #{promoterId}
+        </if>
+        ) t1
+        left join (select clip_id as 'clipId',
+        item_id as 'itemId',
+        promotion_volume as 'promotionVolume'
+        from jy_clip_top_list
+        where stat_date = DATE_FORMAT(DATE_ADD(#{date}, INTERVAL -1 DAY),'%Y%m%d')
+        <if test="promoterId != null and promoterId != ''">
+            and clip_id = #{promoterId}
+        </if>
+        ) t2
+        on t1.clipId = t2.clipId and t1.itemId = t2.itemId
+        order by difference desc
+    </select>
+    <select id="getTopItemUser" resultType="com.alibaba.fastjson.JSONObject">
+        select id,name  from jy_fx_top_item_config
+    </select>
 
 
 </mapper>