Browse Source

盯盘-个人月消耗

yangzian 3 years ago
parent
commit
79e4063ff3

+ 2 - 2
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/MaterialStareMapper.java

@@ -55,8 +55,8 @@ public interface MaterialStareMapper {
     JSONObject getKuaiShouAccountBalance(@Param("accountId")Long accountId);
     //快手 账户 消耗以及状态
     JSONObject getKuaiShouAccountTotalCost(@Param("accountId")Long accountId,@Param("statDate")Long statDate);
-    //快手-账户 月总消耗
-    JSONObject getKuaiShouAccountCostMonth(@Param("accountId")Long accountId,@Param("statDate")Long statDate,@Param("endDate")Long endDate);
+    //快手-运营 月总消耗
+    JSONObject getKuaiShouAccountCostMonth(@Param("userId")String userId,@Param("statDate")Long statDate,@Param("endDate")Long endDate);
 
     //快手 账户趋势图-时报
     List<JSONObject> getKuaiShouAccountInfoBrokenLineHour(@Param("type")String type,@Param("accountId")Long accountId,@Param("statDate")Long statDate,@Param("endDate")Long endDate);

+ 3 - 3
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialStareMapper.xml

@@ -380,15 +380,15 @@
     </select>
 
 
-    <!-- 快手-账户 月总消耗 -->
+    <!-- 快手-运营 月总消耗 -->
     <select id="getKuaiShouAccountCostMonth" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
             SUM( d.charge ) cost
         FROM
             application.kuaishou_account_report_daily_dw d
         <where>
-            <if test="accountId != null and accountId != '' ">
-                and d.account_id = #{accountId}
+            <if test="userId != null and userId != '' ">
+                and d.user_id = #{userId}
             </if>
             <if test="statDate != null and statDate != '' ">
                 and d.stat_date &gt;= #{statDate}

+ 1 - 4
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialStareServiceImpl.java

@@ -300,7 +300,7 @@ public class MaterialStareServiceImpl implements MaterialStareService {
             resultMap.put("contractCharged",nowMonthCost.getString("contractCharged"));//激励
 
             //当前月消耗
-            JSONObject monthCost = materialStareMapper.getKuaiShouAccountCostMonth(null, monthFirstDay,nowDate);
+            JSONObject monthCost = materialStareMapper.getKuaiShouAccountCostMonth(userId, monthFirstDay,nowDate);
             resultMap.put("monthCost",Check.isNull(monthCost) ? "0" : monthCost.getString("cost"));
 
 
@@ -593,9 +593,6 @@ public class MaterialStareServiceImpl implements MaterialStareService {
         //0-开 1-关
         resultMap.put("state", Check.isNull(totalCost) ? "1" : totalCost.getString("accountStatus"));
 
-        //月消耗
-        JSONObject monthCost = materialStareMapper.getKuaiShouAccountCostMonth(accountId, monthFirstDay,nowDate);
-        resultMap.put("monthCost",Check.isNull(monthCost) ? "0" : monthCost.getString("cost"));
         return Result.successMsg("账户查询成功",resultMap);
     }