浏览代码

成本管理

yumeng 7 月之前
父节点
当前提交
418b89091f

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouRewardBaseInfoController.java

@@ -92,7 +92,7 @@ public class KuaishouRewardBaseInfoController extends BaseController {
             requestMap.put("promoterName", promoterName);
             requestMap.put("promoterName", promoterName);
         }
         }
         startPage();
         startPage();
-        List<KuaishouRewardBaseInfo> list = kuaishouRewardBaseInfoService.totalListInfo(requestMap);
+        List<JSONObject> list = kuaishouRewardBaseInfoService.totalListInfo(requestMap);
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouRewardBaseInfo.java

@@ -124,6 +124,6 @@ public class KuaishouRewardBaseInfo extends BaseEntity {
         this.setSettlementPrice(obj.getBigDecimal("7"));//结算单价
         this.setSettlementPrice(obj.getBigDecimal("7"));//结算单价
         this.setAnchorAmount(obj.getBigDecimal("8"));//奖励
         this.setAnchorAmount(obj.getBigDecimal("8"));//奖励
         this.setStatDate(obj.getString("9"));//日期
         this.setStatDate(obj.getString("9"));//日期
-        this.setPromoterType(2);//日期
+
     }
     }
 }
 }

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouRewardBaseInfoMapper.java

@@ -78,6 +78,6 @@ public interface KuaishouRewardBaseInfoMapper {
 
 
     BigDecimal getTotalAmount(@Param("promoterId") String promoterId, @Param("itemId") Long itemId);
     BigDecimal getTotalAmount(@Param("promoterId") String promoterId, @Param("itemId") Long itemId);
 
 
-    List<KuaishouRewardBaseInfo> totalListInfo(Map<String, Object> requestMap);
+    List<JSONObject> totalListInfo(Map<String, Object> requestMap);
 }
 }
 
 

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouRewardBaseInfoService.java

@@ -81,5 +81,5 @@ public interface IKuaishouRewardBaseInfoService {
 
 
     BigDecimal getTotalAmount(String promoterId, Long itemId);
     BigDecimal getTotalAmount(String promoterId, Long itemId);
 
 
-    List<KuaishouRewardBaseInfo> totalListInfo(Map<String, Object> requestMap);
+    List<JSONObject> totalListInfo(Map<String, Object> requestMap);
 }
 }

+ 3 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouRewardBaseInfoServiceImpl.java

@@ -42,7 +42,7 @@ public class KuaishouRewardBaseInfoServiceImpl implements IKuaishouRewardBaseInf
      * @return 【请填写功能名称】
      * @return 【请填写功能名称】
      */
      */
     @Override
     @Override
-    public List<KuaishouRewardBaseInfo> selectKuaishouRewardBaseInfoList(Map<String,Object> map) {
+    public List<KuaishouRewardBaseInfo> selectKuaishouRewardBaseInfoList(Map<String, Object> map) {
         return kuaishouRewardBaseInfoMapper.selectKuaishouRewardBaseInfoList(map);
         return kuaishouRewardBaseInfoMapper.selectKuaishouRewardBaseInfoList(map);
     }
     }
 
 
@@ -131,6 +131,7 @@ public class KuaishouRewardBaseInfoServiceImpl implements IKuaishouRewardBaseInf
                     continue;
                     continue;
                 }
                 }
                 KuaishouRewardBaseInfo baseInfo = new KuaishouRewardBaseInfo(o);
                 KuaishouRewardBaseInfo baseInfo = new KuaishouRewardBaseInfo(o);
+                baseInfo.setPromoterType(2);
                 infoList.add(baseInfo);
                 infoList.add(baseInfo);
             }
             }
             if (!Check.isNull(infoList)) {
             if (!Check.isNull(infoList)) {
@@ -162,7 +163,7 @@ public class KuaishouRewardBaseInfoServiceImpl implements IKuaishouRewardBaseInf
     }
     }
 
 
     @Override
     @Override
-    public List<KuaishouRewardBaseInfo> totalListInfo(Map<String, Object> requestMap) {
+    public List<JSONObject> totalListInfo(Map<String, Object> requestMap) {
         return kuaishouRewardBaseInfoMapper.totalListInfo(requestMap);
         return kuaishouRewardBaseInfoMapper.totalListInfo(requestMap);
     }
     }
 }
 }

+ 21 - 34
ruixuan-live/src/main/resources/mapper/isc/KuaishouRewardBaseInfoMapper.xml

@@ -57,8 +57,8 @@
         t1.reference_amount,
         t1.reference_amount,
         t1.total_amount,
         t1.total_amount,
         t1.remarks,
         t1.remarks,
-        t2.user_name as 'itemCreateName',
-        t3.user_name as 'promoterCreateName',
+        ifnull(t2.user_name,'-') as 'itemCreateName',
+        ifnull(t3.user_name,'-') as 'promoterCreateName',
         t1.create_time,
         t1.create_time,
         t1.update_time
         t1.update_time
         FROM kuaishou_reward_base_info t1 LEFT JOIN kuaishou_item_list t2
         FROM kuaishou_reward_base_info t1 LEFT JOIN kuaishou_item_list t2
@@ -71,7 +71,10 @@
         ) t3 on t1.promoter_id = t3.promoter_id
         ) t3 on t1.promoter_id = t3.promoter_id
         <where>
         <where>
             <if test="itemId != null  and itemId != '' ">and t1.item_id = #{itemId}</if>
             <if test="itemId != null  and itemId != '' ">and t1.item_id = #{itemId}</if>
-            <if test="itemTitle != null  and itemTitle != ''">and t1.item_title = #{itemTitle}</if>
+            <if test="itemTitle != null  and itemTitle != ''">and t1.item_title like concat('%',
+                #{itemTitle},
+                '%')
+            </if>
             <if test="promoterId != null and promoterId != '' ">and t1.promoter_id = #{promoterId}</if>
             <if test="promoterId != null and promoterId != '' ">and t1.promoter_id = #{promoterId}</if>
             <if test="promoterName != null  and promoterName != ''">and t1.promoter_name like concat('%',
             <if test="promoterName != null  and promoterName != ''">and t1.promoter_name like concat('%',
                 #{promoterName},
                 #{promoterName},
@@ -81,7 +84,7 @@
             <if test="endDate != null and endDate != ''">and t1.stat_date &lt;= #{endDate}</if>
             <if test="endDate != null and endDate != ''">and t1.stat_date &lt;= #{endDate}</if>
 
 
         </where>
         </where>
-        order by t1.create_time desc
+        order by t1.stat_date desc
     </select>
     </select>
 
 
     <select id="selectKuaishouRewardBaseInfoById" parameterType="java.lang.Long"
     <select id="selectKuaishouRewardBaseInfoById" parameterType="java.lang.Long"
@@ -143,21 +146,18 @@
         WHERE promoter_id = #{promoterId}
         WHERE promoter_id = #{promoterId}
           AND item_id = #{itemId}
           AND item_id = #{itemId}
     </select>
     </select>
-    <select id="totalListInfo" resultMap="KuaishouRewardBaseInfoResult">
+    <select id="totalListInfo" resultType="com.alibaba.fastjson.JSONObject">
 
 
         SELECT * from (
         SELECT * from (
         SELECT t1.id,
         SELECT t1.id,
-        t1.item_id,
-        t1.item_title,
-        t1.promoter_id,
-        t1.promoter_name,
-        sum(t1.current_settlement_num) as 'total_settlement_num',
-        sum(t1.anchor_amount) as 'anchor_amount',
-        sum(t1.reference_amount) as 'reference_amount',
-        sum(t1.reference_amount + t1.anchor_amount ) as 'total_amount',
-        t2.user_name as 'itemCreateName',
-        t3.user_name as 'promoterCreateName',
-        max(t1.create_time) as 'createTime'
+        t1.item_id as 'itemId',
+        t1.item_title as 'itemTitle',
+        t1.promoter_id as 'promoterId',
+        t1.promoter_name as 'promoterName',
+        sum(t1.current_settlement_num) as 'totalSettlementNum',
+        max(t1.stat_date) as 'maxDate',
+        ifnull(t2.user_name,'-') as 'itemCreateName',
+        ifnull(t3.user_name,'-') as 'promoterCreateName'
         FROM kuaishou_reward_base_info t1 LEFT JOIN kuaishou_item_list t2
         FROM kuaishou_reward_base_info t1 LEFT JOIN kuaishou_item_list t2
         on t1.item_id = t2.item_id
         on t1.item_id = t2.item_id
         LEFT JOIN (
         LEFT JOIN (
@@ -174,26 +174,11 @@
                 #{promoterName},
                 #{promoterName},
                 '%')
                 '%')
             </if>
             </if>
-            <if test="startDate != null and startDate != ''">and t1.stat_date &gt;= #{startDate}</if>
-            <if test="endDate != null and endDate != ''">and t1.stat_date &lt;= #{endDate}</if>
         </where>
         </where>
-
-        <if test="itemId != null and promoterId != null">
-            group by t1.item_id,t1.promoter_id
-        </if>
-        <if test="itemId == null and promoterId == null">
-            group by t1.item_id,t1.promoter_id
-        </if>
-
-        <if test="itemId != null and  promoterId == null ">
-            group by t1.item_id
-        </if>
-        <if test="promoterId != null  and itemId == null ">
-            group by t1.promoter_id
-        </if>
-
+        and t1.promoter_type = 1
+        group by t1.promoter_id,t1.item_id
         ) t
         ) t
-        order by t.createTime desc
+        order by t.maxDate desc
     </select>
     </select>
 
 
 
 
@@ -274,6 +259,7 @@
         kuaishou_reward_base_info
         kuaishou_reward_base_info
         (
         (
         item_id,
         item_id,
+        promoter_type,
         item_title,
         item_title,
         promoter_id,
         promoter_id,
         promoter_name,
         promoter_name,
@@ -290,6 +276,7 @@
         <foreach collection="infoList" item="info" separator=",">
         <foreach collection="infoList" item="info" separator=",">
             (
             (
             #{info.itemId},
             #{info.itemId},
+            #{info.promoterType},
             #{info.itemTitle},
             #{info.itemTitle},
             #{info.promoterId},
             #{info.promoterId},
             #{info.promoterName},
             #{info.promoterName},