Pārlūkot izejas kodu

Merge branch 'V2.0.1' into test

zhaoxian 3 gadi atpakaļ
vecāks
revīzija
49c317d229

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

@@ -42,8 +42,8 @@ public interface BytedanceAccountReportDailyDwMapper {
 
     List<JSONObject> getToutiaoOperateInfo( @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") List<String>  operatorUserIds);
 
-    KuaiShouOperateGroupVo getToutiaoOperateGroupInfoHourly(@Param("hour") Integer hour, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") Set<String> operatorUserIds);
+    JSONObject getToutiaoOperateGroupInfoHourly(@Param("hour") Integer hour, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") Set<String> operatorUserIds);
 
-    KuaiShouOperateGroupVo getToutiaoOperateGroupInfo(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") Set<String> operatorUserIds);
+    JSONObject getToutiaoOperateGroupInfo(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") Set<String> operatorUserIds);
 
 }

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

@@ -41,7 +41,7 @@ public interface KuaishouAccountReportDailyDwMapper {
 
     List<JSONObject> getKuaishouOperateInfo(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") List<String> operatorUserIds);
 
-    KuaiShouOperateGroupVo getKuaishouOperateGroupInfoHourly(@Param("hour") Integer hour, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") Set<String> operatorUserIds);
+    JSONObject getKuaishouOperateGroupInfoHourly(@Param("hour") Integer hour, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") Set<String> operatorUserIds);
 
-    KuaiShouOperateGroupVo getKuaishouOperateGroupInfo(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") Set<String> operatorUserIds);
+    JSONObject getKuaishouOperateGroupInfo(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("lastTimeEnd") Long lastTimeEnd, @Param("lastTimeStart") Long lastTimeStart, @Param("list") Set<String> operatorUserIds);
 }

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

@@ -435,7 +435,7 @@
     </select>
 
 
-    <select id="getToutiaoOperateGroupInfoHourly" resultType="org.jeecg.ctop.material.entity.vo.KuaiShouOperateGroupVo">
+    <select id="getToutiaoOperateGroupInfoHourly" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         IFNULL( count( t1.user_id ), 0 ) AS 'operationNum',
         IFNULL( SUM( t1.accountNum ), 0 ) AS 'accountNum',
@@ -496,7 +496,7 @@
 
     </select>
 
-    <select id="getToutiaoOperateGroupInfo" resultType="org.jeecg.ctop.material.entity.vo.KuaiShouOperateGroupVo">
+    <select id="getToutiaoOperateGroupInfo" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         IFNULL( count( t1.user_id ), 0 ) AS 'operationNum',
         IFNULL( SUM( t1.accountNum ), 0 ) AS 'accountNum',

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

@@ -488,8 +488,7 @@
         ORDER BY SUM(t.charge) DESC
     </select>
 
-    <select id="getKuaishouOperateGroupInfoHourly"
-            resultType="org.jeecg.ctop.material.entity.vo.KuaiShouOperateGroupVo">
+    <select id="getKuaishouOperateGroupInfoHourly" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         IFNULL( count( t1.user_id ), 0 ) AS 'operationNum',
         IFNULL( SUM( t1.accountNum ), 0 ) AS 'accountNum',
@@ -550,7 +549,7 @@
 
     </select>
 
-    <select id="getKuaishouOperateGroupInfo" resultType="org.jeecg.ctop.material.entity.vo.KuaiShouOperateGroupVo">
+    <select id="getKuaishouOperateGroupInfo" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         IFNULL( count( t1.user_id ), 0 ) AS 'operationNum',
         IFNULL( SUM( t1.accountNum ), 0 ) AS 'accountNum',

+ 20 - 21
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/BytedanceAccountReportDailyDwServiceImpl.java

@@ -131,7 +131,8 @@ public class BytedanceAccountReportDailyDwServiceImpl implements IBytedanceAccou
             //当前小时
             Integer hour = DateUtils.getNowHour();
             //当天日期
-            Long nowDate = Long.valueOf(DateUtils.getDateInteger(DateUtils.formatDate(new Date())));
+            String nowDateStr = DateUtils.formatDate(new Date());
+            Long nowDate = Long.valueOf(DateUtils.getDateInteger(nowDateStr));
 
             Long startDate = Long.valueOf(DateUtils.getDateInteger(startTime));
             Long entDate = Long.valueOf(DateUtils.getDateInteger(endTime));
@@ -146,7 +147,7 @@ public class BytedanceAccountReportDailyDwServiceImpl implements IBytedanceAccou
 
             List<String> userIds = materialStareMapper.getAllOperationByMediaId("1");
             List<JSONObject> list = new ArrayList<>();
-            if (startDate == entDate && nowDate == startDate) {
+            if (startTime.equals(endTime) && startTime.equals(nowDateStr)) {
                 list = bytedanceAccountReportDailyDwMapper.getToutiaoOperateInfoHourly(hour, startDate, entDate, lastTimeEnd, lastTimeStart, userIds);
             } else {
                 list = bytedanceAccountReportDailyDwMapper.getToutiaoOperateInfo(startDate, entDate, lastTimeEnd, lastTimeStart, userIds);
@@ -165,7 +166,8 @@ public class BytedanceAccountReportDailyDwServiceImpl implements IBytedanceAccou
             //当前小时
             Integer hour = DateUtils.getNowHour();
             //当天日期
-            Long nowDate = Long.valueOf(DateUtils.getDateInteger(DateUtils.formatDate(new Date())));
+            String nowDateStr = DateUtils.formatDate(new Date());
+            Long nowDate = Long.valueOf(DateUtils.getDateInteger(nowDateStr));
 
             Long startDate = Long.valueOf(DateUtils.getDateInteger(startTime));
             Long entDate = Long.valueOf(DateUtils.getDateInteger(endTime));
@@ -179,7 +181,7 @@ public class BytedanceAccountReportDailyDwServiceImpl implements IBytedanceAccou
             Long lastTimeStart = Long.valueOf(DateUtils.getDateInteger(DateUtils.getLastDay(lastDay, days)));
 
             List<KuaiShouOperateGroupVo> operationManagerList = materialStareMapper.getOperationManagerUser("touTiaoOperationManager");
-            List<KuaiShouOperateGroupVo> list = new ArrayList<>();
+            List<JSONObject> list = new ArrayList<>();
             for (KuaiShouOperateGroupVo groupVo : operationManagerList) {
                 //有消耗的运营人员
                 Set<String> operatorUserIds = materialStareMapper.queryToutiaoOperateTeamMember(groupVo.getUserId(), startDate, entDate);
@@ -189,43 +191,40 @@ public class BytedanceAccountReportDailyDwServiceImpl implements IBytedanceAccou
                 //运营数量
                 int operationNum = operatorUserIds.size();
                 //查询账户数据
-                KuaiShouOperateGroupVo vo = new KuaiShouOperateGroupVo();
-                if (startDate == entDate && nowDate == startDate) {
+                JSONObject vo = new JSONObject();
+                if (startTime.equals(endTime) && startTime.equals(nowDateStr)) {
                     //时报
                     vo = bytedanceAccountReportDailyDwMapper.getToutiaoOperateGroupInfoHourly(hour, startDate, entDate, lastTimeEnd, lastTimeStart, operatorUserIds);
                 } else {
                     vo = bytedanceAccountReportDailyDwMapper.getToutiaoOperateGroupInfo(startDate, entDate, lastTimeEnd, lastTimeStart, operatorUserIds);
                 }
-                if (Check.isNull(vo.getTotalCost())) {
-                    continue;
-                }
-                vo.setUserId(groupVo.getUserId());
-                vo.setRealname(groupVo.getRealname());
-                vo.setOperationNum(operationNum);
+                vo.put("userId", groupVo.getUserId());
+                vo.put("realname", groupVo.getRealname());
+                vo.put("operationNum", operationNum);
                 //总花费
-                Double totalCost = vo.getTotalCost();
+                Double totalCost = vo.getDouble("totalCost");
                 //日均消耗 总花费/天数
                 Double aveDay = totalCost / (days + 1);
-                vo.setAverageDayCost(new BigDecimal(aveDay).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
+                vo.put("averageDayCost", new BigDecimal(aveDay).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
                 //人均消耗
                 Double avePeople = totalCost / operationNum;
-                vo.setAveragePeopleCost(new BigDecimal(avePeople).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
+                vo.put("averagePeopleCost", new BigDecimal(avePeople).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
                 //账户数量
-                long accountNum = vo.getAccountNum();
+                Long accountNum = vo.getLong("accountNum");
                 //平均账户消耗 总花费/账户数量
                 Double aveAccount = accountNum == 0 ? 0 : totalCost / accountNum;
-                vo.setAverageAccountCost(new BigDecimal(aveAccount).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
+                vo.put("averageAccountCost", new BigDecimal(aveAccount).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
                 list.add(vo);
             }
             if (!Check.isNull(list)) {
-                Collections.sort(list, new Comparator<KuaiShouOperateGroupVo>() {
+                Collections.sort(list, new Comparator<JSONObject>() {
                     @Override
-                    public int compare(KuaiShouOperateGroupVo o1, KuaiShouOperateGroupVo o2) {
-                        return o2.getTotalCost().compareTo(o1.getTotalCost());
+                    public int compare(JSONObject o1, JSONObject o2) {
+                        return o2.getDouble("totalCost").compareTo(o1.getDouble("totalCost"));
                     }
                 });
             }
-            PageInfo<KuaiShouOperateGroupVo> pageInfo = new PageInfo<>(list);
+            PageInfo<JSONObject> pageInfo = new PageInfo<>(list);
             return Result.successMsg("查询成功。", pageInfo);
         } catch (Exception e) {
             e.printStackTrace();

+ 20 - 21
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/KuaishouAccountReportDailyDwServiceImpl.java

@@ -131,7 +131,8 @@ public class KuaishouAccountReportDailyDwServiceImpl implements IKuaishouAccount
             //当前小时
             Integer hour = DateUtils.getNowHour();
             //当天日期
-            Long nowDate = Long.valueOf(DateUtils.getDateInteger(DateUtils.formatDate(new Date())));
+            String nowDateStr = DateUtils.formatDate(new Date());
+            Long nowDate = Long.valueOf(DateUtils.getDateInteger(nowDateStr));
 
             Long startDate = Long.valueOf(DateUtils.getDateInteger(startTime));
             Long entDate = Long.valueOf(DateUtils.getDateInteger(endTime));
@@ -145,7 +146,7 @@ public class KuaishouAccountReportDailyDwServiceImpl implements IKuaishouAccount
 
             List<String> userIds = materialStareMapper.getAllOperationByMediaId("2");
             List<JSONObject> list = new ArrayList<>();
-            if (startDate == entDate && nowDate == startDate) {
+            if (startTime.equals(endTime) && startTime.equals(nowDateStr)) {
                 list = kuaishouAccountReportDailyDwMapper.getKuaishouOperateInfoHourly(hour, startDate, entDate, lastTimeEnd, lastTimeStart, userIds);
             } else {
                 list = kuaishouAccountReportDailyDwMapper.getKuaishouOperateInfo(startDate, entDate, lastTimeEnd, lastTimeStart, userIds);
@@ -164,7 +165,8 @@ public class KuaishouAccountReportDailyDwServiceImpl implements IKuaishouAccount
             //当前小时
             Integer hour = DateUtils.getNowHour();
             //当天日期
-            Long nowDate = Long.valueOf(DateUtils.getDateInteger(DateUtils.formatDate(new Date())));
+            String nowDateStr = DateUtils.formatDate(new Date());
+            Long nowDate = Long.valueOf(DateUtils.getDateInteger(nowDateStr));
 
             Long startDate = Long.valueOf(DateUtils.getDateInteger(startTime));
             Long entDate = Long.valueOf(DateUtils.getDateInteger(endTime));
@@ -178,7 +180,7 @@ public class KuaishouAccountReportDailyDwServiceImpl implements IKuaishouAccount
             Long lastTimeStart = Long.valueOf(DateUtils.getDateInteger(DateUtils.getLastDay(lastDay, days)));
 
             List<KuaiShouOperateGroupVo> operationManagerList = materialStareMapper.getOperationManagerUser("kuaishouOperationManager");
-            List<KuaiShouOperateGroupVo> list = new ArrayList<>();
+            List<JSONObject> list = new ArrayList<>();
             for (KuaiShouOperateGroupVo groupVo : operationManagerList) {
                 //下级员工
                 Set<String> operatorUserIds = materialStareMapper.queryKuaishouOperateTeamMember(groupVo.getUserId(), startDate, entDate);
@@ -188,43 +190,40 @@ public class KuaishouAccountReportDailyDwServiceImpl implements IKuaishouAccount
                 //运营数量
                 int operationNum = operatorUserIds.size();
                 //查询账户数据
-                KuaiShouOperateGroupVo vo = new KuaiShouOperateGroupVo();
-                if (startDate == entDate && nowDate == startDate) {
+                JSONObject vo = new JSONObject();
+                if (startTime.equals(endTime) && startTime.equals(nowDateStr)) {
                     //时报
                     vo = kuaishouAccountReportDailyDwMapper.getKuaishouOperateGroupInfoHourly(hour, startDate, entDate, lastTimeEnd, lastTimeStart, operatorUserIds);
                 } else {
                     vo = kuaishouAccountReportDailyDwMapper.getKuaishouOperateGroupInfo(startDate, entDate, lastTimeEnd, lastTimeStart, operatorUserIds);
                 }
-                if (Check.isNull(vo.getTotalCost())) {
-                    continue;
-                }
-                vo.setUserId(groupVo.getUserId());
-                vo.setRealname(groupVo.getRealname());
-                vo.setOperationNum(operationNum);
+                vo.put("userId", groupVo.getUserId());
+                vo.put("realname", groupVo.getRealname());
+                vo.put("operationNum", operationNum);
                 //总花费
-                Double totalCost = vo.getTotalCost();
+                Double totalCost = vo.getDouble("totalCost");
                 //日均消耗 总花费/天数
                 Double aveDay = totalCost / (days + 1);
-                vo.setAverageDayCost(new BigDecimal(aveDay).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
+                vo.put("averageDayCost", new BigDecimal(aveDay).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
                 //人均消耗
                 Double avePeople = totalCost / operationNum;
-                vo.setAveragePeopleCost(new BigDecimal(avePeople).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
+                vo.put("averagePeopleCost", new BigDecimal(avePeople).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
                 //账户数量
-                long accountNum = vo.getAccountNum();
+                Long accountNum = vo.getLong("accountNum");
                 //平均账户消耗 总花费/账户数量
                 Double aveAccount = accountNum == 0 ? 0 : totalCost / accountNum;
-                vo.setAverageAccountCost(new BigDecimal(aveAccount).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
+                vo.put("averageAccountCost", new BigDecimal(aveAccount).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue());
                 list.add(vo);
             }
             if (!Check.isNull(list)) {
-                Collections.sort(list, new Comparator<KuaiShouOperateGroupVo>() {
+                Collections.sort(list, new Comparator<JSONObject>() {
                     @Override
-                    public int compare(KuaiShouOperateGroupVo o1, KuaiShouOperateGroupVo o2) {
-                        return o2.getTotalCost().compareTo(o1.getTotalCost());
+                    public int compare(JSONObject o1, JSONObject o2) {
+                        return o2.getDouble("totalCost").compareTo(o1.getDouble("totalCost"));
                     }
                 });
             }
-            PageInfo<KuaiShouOperateGroupVo> pageInfo = new PageInfo<>(list);
+            PageInfo<JSONObject> pageInfo = new PageInfo<>(list);
             return Result.successMsg("查询成功。", pageInfo);
         } catch (Exception e) {
             e.printStackTrace();