Kaynağa Gözat

默认变更列表

lw 1 yıl önce
ebeveyn
işleme
5d336c6b26

+ 19 - 0
module_kzks/src/main/java/org/jeecg/dataSync/task/removeRedisCacheTask.java

@@ -0,0 +1,19 @@
+package org.jeecg.dataSync.task;
+
+import org.jeecg.modules.Index.util.RedisCacheMethod;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class removeRedisCacheTask implements Job {
+
+    @Autowired
+    private RedisCacheMethod redisCacheMethod;
+    @Override
+    public void execute(JobExecutionContext context) throws JobExecutionException {
+        redisCacheMethod.removeAllRedisCache();
+    }
+}

+ 78 - 40
module_kzks/src/main/java/org/jeecg/modules/Index/mapper/xml/IndexKpiMapper.xml

@@ -23,7 +23,7 @@
 
     <!--项目成本表    根据责任部门分组找出当年当月的合同额总和和已收款总和 -->
     <select id="getHteReceivedZrbmCost" resultType="org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate">
-        select zrbm as depart, sum((case when contractfpe != 0.00 then contractfpe * processPercent else EstimationCoat*processPercent end) / 100.0) as contractAmount, sum(TaskMoney) as received from kzks_project_cost
+        select zrbm as depart, sum((case when contractfpe != 0.00 then contractfpe * processPercent else (EstimationCoat*10000)*processPercent end) / 100.0) as contractAmount, sum(TaskMoney) as received from kzks_project_cost
         where status='0' and (zrbm in
         <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
             #{item}
@@ -43,59 +43,97 @@
 
     <!-- 下达部门 合同额 -->
     <select id="getXdbmHte" resultType="org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate">
+<!--        SELECT-->
+<!--            jycs as depart,-->
+<!--            SUM( contractfpe ) as contractAmount-->
+<!--        FROM-->
+<!--            kzks_project_cost-->
+<!--        WHERE-->
+<!--            taskno IN ( SELECT rwbh FROM com_contract_info_exchange WHERE sjly = '20' AND qsrq LIKE CONCAT(#{date},'%') )-->
+<!--          AND jycs IN-->
+<!--            <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>-->
+<!--                #{item}-->
+<!--            </foreach>-->
+<!--          AND status='0'-->
+<!--        GROUP BY-->
+<!--            jycs-->
+
         SELECT
-            jycs as depart,
-            SUM( contractfpe ) as contractAmount
+        k.jycs as depart,
+        SUM( c.htfpe ) as contractAmount
         FROM
-            kzks_project_cost
+        com_contract_info_exchange c
+        INNER JOIN
+        (
+        SELECT taskno, jycs FROM ky_task_info WHERE jycs IN
+        <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        ) k ON c.rwbh = k.taskno
         WHERE
-            taskno IN ( SELECT rwbh FROM com_contract_info_exchange WHERE sjly = '20' AND qsrq LIKE CONCAT(#{date},'%') )
-          AND jycs IN
-            <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
-                #{item}
-            </foreach>
+        c.sjly = '20'
+        AND qsrq LIKE CONCAT(#{date},'%')
         GROUP BY
-            jycs
+        k.jycs
     </select>
 
     <!-- 下达部门 已收款 -->
     <select id="getXdbmYsk" resultType="org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate">
+<!--        SELECT-->
+<!--            jycs as depart,-->
+<!--            SUM( TaskMoney ) as received-->
+<!--        FROM-->
+<!--            kzks_project_cost-->
+<!--        WHERE-->
+<!--            taskno IN ( SELECT rwbh FROM com_contract_info_exchange WHERE sjly = '40' AND dkhpdqrq LIKE CONCAT(#{date},'%') )-->
+<!--          AND jycs IN-->
+<!--            <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>-->
+<!--                #{item}-->
+<!--            </foreach>-->
+<!--          AND status='0'-->
+<!--        GROUP BY-->
+<!--            jycs-->
+
         SELECT
-            jycs as depart,
-            SUM( TaskMoney ) as received
+        k.jycs as depart,
+        SUM( c.rwskje ) as received
         FROM
-            kzks_project_cost
+        com_contract_info_exchange c
+        INNER JOIN
+        (
+        SELECT taskno, jycs FROM ky_task_info WHERE jycs IN
+        <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        ) k ON c.rwbh = k.taskno
         WHERE
-            taskno IN ( SELECT rwbh FROM com_contract_info_exchange WHERE sjly = '40' AND dkhpdqrq LIKE CONCAT(#{date},'%') )
-          AND jycs IN
-            <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
-                #{item}
-            </foreach>
+        c.sjly = '40'
+        AND dkhpdqrq LIKE  CONCAT(#{date},'%')
         GROUP BY
-            jycs
+        k.jycs
     </select>
 
 
 
-    <!-- 责任部门 合同额 -->
-    <select id="getZrbmHte" resultType="org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate">
-        SELECT
-            k.zrbm as depart,
-            SUM( c.htfpe ) as contractAmount
-        FROM
-            com_contract_info_exchange c
-                LEFT JOIN
-                (
-                    SELECT taskno, zrbm FROM ky_task_info WHERE zrbm IN
-                    <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
-                        #{item}
-                    </foreach>
-                    AND yearmonth = #{date}
-                ) k ON c.rwbh = k.taskno
-        WHERE
-            c.sjly = '20'
-          AND qsrq LIKE CONCAT(#{date},'%')
-        GROUP BY
-            k.zrbm
-    </select>
+<!--    &lt;!&ndash; 责任部门 合同额 &ndash;&gt;-->
+<!--    <select id="getZrbmHte" resultType="org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate">-->
+<!--        SELECT-->
+<!--            k.zrbm as depart,-->
+<!--            SUM( c.htfpe ) as contractAmount-->
+<!--        FROM-->
+<!--            com_contract_info_exchange c-->
+<!--                LEFT JOIN-->
+<!--                (-->
+<!--                    SELECT taskno, zrbm FROM ky_task_info WHERE zrbm IN-->
+<!--                    <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>-->
+<!--                        #{item}-->
+<!--                    </foreach>-->
+<!--                    AND yearmonth = #{date}-->
+<!--                ) k ON c.rwbh = k.taskno-->
+<!--        WHERE-->
+<!--            c.sjly = '20'-->
+<!--          AND qsrq LIKE CONCAT(#{date},'%')-->
+<!--        GROUP BY-->
+<!--            k.zrbm-->
+<!--    </select>-->
 </mapper>

+ 4 - 3
module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexKpiServiceImpl.java

@@ -47,6 +47,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
     private CommonMethod commonMethod;
 
     @Autowired
+    @SuppressWarnings("all")
     private DepartKpiMapper departKpiMapper;
 
     @Autowired
@@ -541,7 +542,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
                                 if(kpiDataXdbm.getDepartKpi().equals(BigDecimal.valueOf(0))){
                                     kpiDataXdbm.setKpiCompletRate(BigDecimal.valueOf(1));
                                 }else{
-                                    kpiDataXdbm.setKpiCompletRate(kpiDataXdbm.getContractAmount().divide(kpiDataXdbm.getDepartKpi(), 2, RoundingMode.HALF_UP));
+                                    kpiDataXdbm.setKpiCompletRate(kpiDataXdbm.getReceived().divide(kpiDataXdbm.getDepartKpi(), 2, RoundingMode.HALF_UP));
                                 }
                             }
                         }
@@ -623,7 +624,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
                                 if(kpiDataXdbm.getDepartKpi().equals(BigDecimal.valueOf(0))){
                                     kpiDataXdbm.setKpiCompletRate(BigDecimal.valueOf(1));
                                 }else{
-                                    kpiDataXdbm.setKpiCompletRate(kpiDataXdbm.getContractAmount().divide(kpiDataXdbm.getDepartKpi(), 2, RoundingMode.HALF_UP));
+                                    kpiDataXdbm.setKpiCompletRate(kpiDataXdbm.getReceived().divide(kpiDataXdbm.getDepartKpi(), 2, RoundingMode.HALF_UP));
                                 }
                             }
                         }
@@ -769,7 +770,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
                         if(kpiDataJycs.getDepartKpi().equals(BigDecimal.valueOf(0))){
                             kpiDataJycs.setKpiCompletRate(BigDecimal.valueOf(1));
                         }else{
-                            kpiDataJycs.setKpiCompletRate(kpiDataJycs.getContractAmount().divide(kpiDataJycs.getDepartKpi(), 2, RoundingMode.HALF_UP));
+                            kpiDataJycs.setKpiCompletRate(kpiDataJycs.getReceived().divide(kpiDataJycs.getDepartKpi(), 2, RoundingMode.HALF_UP));
                         }
                     }
                     ////根据部门找到今年的合同额和已收款

+ 80 - 51
module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexServiceImpl.java

@@ -90,7 +90,6 @@ public class IndexServiceImpl implements IndexService {
     private IndexZcbService indexZcbService;
 
 
-
     /**
      * 科研任务信息表
      */
@@ -165,8 +164,10 @@ public class IndexServiceImpl implements IndexService {
         }
 
         Calendar instance = Calendar.getInstance();
-
-        Date currentYearEndDate = instance.getTime();
+        setZeroMonth(instance);
+        instance.add(Calendar.MONTH,1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        Date currentYearEndDate = instance.getTime(); //加一天
         setZeroYear(instance);
         Date currentYearBeginDate = instance.getTime();
 
@@ -186,7 +187,11 @@ public class IndexServiceImpl implements IndexService {
         instance.setTime(new Date());
         instance.add(Calendar.YEAR, -1);
         //去年的今日
+        setZeroMonth(instance);
+        instance.add(Calendar.MONTH,1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
         Date LastTqEndDate = instance.getTime();
+
         setZeroYear(instance);
         Date LastYearBeginDate = instance.getTime();
 
@@ -202,10 +207,16 @@ public class IndexServiceImpl implements IndexService {
             return lastYearTqTotal;
         });
 
-        instance.setTime(new Date());
+/*        instance.setTime(new Date());
         Date currentMothEndDate = instance.getTime();
         setZeroMonth(instance);
+        Date currentMothBginDate = instance.getTime();*/
+        instance.setTime(new Date());
+        setZeroMonth(instance);
         Date currentMothBginDate = instance.getTime();
+        instance.add(Calendar.MONTH, 1);
+        instance.add(Calendar.DATE, 1);
+        Date currentMothEndDate = instance.getTime();
 
         CompletableFuture<BigDecimal> currentMonthTotalFuture = CompletableFuture.supplyAsync(() -> {
             BigDecimal currentMonthTotal = null;
@@ -221,6 +232,9 @@ public class IndexServiceImpl implements IndexService {
 
         instance.setTime(new Date());
         instance.add(Calendar.MONTH, -1);
+        setZeroMonth(instance);
+        instance.add(Calendar.MONTH,1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
         Date LastMothTqEndDate = instance.getTime();
         setZeroMonth(instance);
         Date LastMothTqBeginDate = instance.getTime();
@@ -240,6 +254,9 @@ public class IndexServiceImpl implements IndexService {
 
         instance.setTime(new Date());
         instance.add(Calendar.YEAR, -1);
+        setZeroMonth(instance);
+        instance.add(Calendar.MONTH,1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
         Date lastYearMonthTqEndDate = instance.getTime();
         setZeroMonth(instance);
         Date lastYearMonthTqBeginDate = instance.getTime();
@@ -558,6 +575,9 @@ public class IndexServiceImpl implements IndexService {
         }
 
         Calendar instance = Calendar.getInstance();
+        setZeroMonth(instance);
+        instance.add(Calendar.MONTH,1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
         Date currentYearEndDate = instance.getTime();
         setZeroYear(instance);
         Date currentYearBeginDate = instance.getTime();
@@ -577,6 +597,9 @@ public class IndexServiceImpl implements IndexService {
 
         instance.setTime(new Date());
         instance.add(Calendar.YEAR, -1);
+        setZeroMonth(instance);
+        instance.add(Calendar.MONTH,1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
         //去年的今日
         Date LastTqEndDate = instance.getTime();
         setZeroYear(instance);
@@ -594,9 +617,11 @@ public class IndexServiceImpl implements IndexService {
         });
 
         instance.setTime(new Date());
-        Date currentMothEndDate = instance.getTime();
         setZeroMonth(instance);
         Date currentMothBginDate = instance.getTime();
+        instance.add(Calendar.MONTH, 1);
+        instance.add(Calendar.DATE, 1);
+        Date currentMothEndDate = instance.getTime();
 
         CompletableFuture<BigDecimal> currentMonthTotalFuture = CompletableFuture.supplyAsync(() -> {
             BigDecimal currentMonthTotal = null;
@@ -612,6 +637,9 @@ public class IndexServiceImpl implements IndexService {
 
         instance.setTime(new Date());
         instance.add(Calendar.MONTH, -1);
+        setZeroMonth(instance);
+        instance.add(Calendar.MONTH,1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
         Date LastMothTqEndDate = instance.getTime();
         setZeroMonth(instance);
         Date LastMothTqBeginDate = instance.getTime();
@@ -631,6 +659,9 @@ public class IndexServiceImpl implements IndexService {
 
         instance.setTime(new Date());
         instance.add(Calendar.YEAR, -1);
+        setZeroMonth(instance);
+        instance.add(Calendar.MONTH,1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
         Date lastYearMonthTqEndDate = instance.getTime();
         setZeroMonth(instance);
         Date lastYearMonthTqBeginDate = instance.getTime();
@@ -1750,24 +1781,19 @@ public class IndexServiceImpl implements IndexService {
         //结束时间
         String endString = indexInfoParamDto.getEndDate();
 
-        if(timeType.equals("year")){
+        if (timeType.equals("year")) {
             List<LreInfoByDate> lreDetail = indexMapper.getTasknoByGroupYear(startString, endString);
             System.out.println(lreDetail);
-        }else if(timeType.equals("month")){
+        } else if (timeType.equals("month")) {
             List<LreInfoByDate> lreDetail = indexMapper.getTasknoByGroupMonth(startString, endString);
             System.out.println(lreDetail);
         }
 
 
-
         return tasknoList;
     }
 
 
-
-
-
-
     /**
      * 首页一层利润额参数类 IndexTotalVo 初始化
      */
@@ -2296,7 +2322,7 @@ public class IndexServiceImpl implements IndexService {
 
         //4.计算该时间列表中某年或某月对应的总收款
         List<ReceivedByDate> receivedByDates = new ArrayList<>();
-        if(timeType.equals("year")){
+        if (timeType.equals("year")) {
             receivedByDates = exchangeMapper.getReceivedAllByYear(startString, endString);
 //            System.out.println("已收款二层按年查询结果:");
 //            for(ReceivedByDate receivedByDate:receivedByDates){
@@ -2305,7 +2331,7 @@ public class IndexServiceImpl implements IndexService {
 //            }
 //            System.out.println(receivedByDates);
 
-        }else if(timeType.equals("month")){
+        } else if (timeType.equals("month")) {
             receivedByDates = exchangeMapper.getReceivedAllByYMonth(startString, endString);
 //            System.out.println("已收款二层按月查询结果:");
 //            for(ReceivedByDate receivedByDate:receivedByDates){
@@ -2314,11 +2340,11 @@ public class IndexServiceImpl implements IndexService {
 //            }
 //            System.out.println(receivedByDates);
         }
-        if(receivedByDates.isEmpty()) return indexChartInfoVo;
+        if (receivedByDates.isEmpty()) return indexChartInfoVo;
 
-        for(ReceivedByDate receivedByDate:receivedByDates){
+        for (ReceivedByDate receivedByDate : receivedByDates) {
             String date = receivedByDate.getDate();
-            if(timeRangeList.contains(date)){
+            if (timeRangeList.contains(date)) {
                 seriesDataList.set(timeRangeList.indexOf(date), receivedByDate.getReceived());
             }
         }
@@ -2429,7 +2455,7 @@ public class IndexServiceImpl implements IndexService {
         List<String> sysDepartNames = sysDepartMapper.getSysUserOfDepartNameList(userId);
         System.out.println("查出的部门列表:");
         System.out.println(sysDepartNames);
-        if(sysDepartNames.isEmpty()) return indexChartInfoVo;
+        if (sysDepartNames.isEmpty()) return indexChartInfoVo;
 
 //        ArrayList<String> tasknoList = new ArrayList<>();
 //        List<String> ZrbmTasknoList = projectCostMapper.queryZrbmTasknoListbydepartNames(sysDepartNames);
@@ -2445,29 +2471,29 @@ public class IndexServiceImpl implements IndexService {
 
         //4.计算该时间列表中某年或某月对应的总收款
         List<ReceivedByDate> receivedByDates = new ArrayList<>();
-        if(timeType.equals("year")){
+        if (timeType.equals("year")) {
             receivedByDates = exchangeMapper.getReceivedByYear2(sysDepartNames, startString, endString);
             System.out.println("部门领导已收款二层按年查询结果:");
-            for(ReceivedByDate receivedByDate:receivedByDates){
+            for (ReceivedByDate receivedByDate : receivedByDates) {
                 System.out.println(receivedByDate.getDate());
                 System.out.println(receivedByDate.getReceived());
             }
             System.out.println(receivedByDates);
 
-        }else if(timeType.equals("month")){
+        } else if (timeType.equals("month")) {
             receivedByDates = exchangeMapper.getReceivedByYMonth2(sysDepartNames, startString, endString);
             System.out.println("部门领导已收款二层按月查询结果:");
-            for(ReceivedByDate receivedByDate:receivedByDates){
+            for (ReceivedByDate receivedByDate : receivedByDates) {
                 System.out.println(receivedByDate.getDate());
                 System.out.println(receivedByDate.getReceived());
             }
             System.out.println(receivedByDates);
         }
-        if(receivedByDates.isEmpty()) return indexChartInfoVo;
+        if (receivedByDates.isEmpty()) return indexChartInfoVo;
 
-        for(ReceivedByDate receivedByDate:receivedByDates){
+        for (ReceivedByDate receivedByDate : receivedByDates) {
             String date = receivedByDate.getDate();
-            if(timeRangeList.contains(date)){
+            if (timeRangeList.contains(date)) {
                 seriesDataList.set(timeRangeList.indexOf(date), receivedByDate.getReceived());
             }
         }
@@ -2542,6 +2568,7 @@ public class IndexServiceImpl implements IndexService {
         //获取一层已收款
         CompletableFuture<IndexTotalVo> getYskFuture = CompletableFuture.supplyAsync(() -> {
             return getTotalReceived(request);
+//            return getTotalIncome(request);
         });
 //        IndexTotalVo hteindexTotalVo = getTotalIncome(request);
         //获取一层支出成本额
@@ -2549,7 +2576,7 @@ public class IndexServiceImpl implements IndexService {
             return indexZcbService.getZhiChuTotalList(request).get(0);
         });
 //        IndexTotalVo zceindexTotalVo = indexZcbService.getZhiChuTotalList(request).get(0);
-        CompletableFuture<Void> future1 = CompletableFuture.allOf(getYskFuture,getZcbFuture);
+        CompletableFuture<Void> future1 = CompletableFuture.allOf(getYskFuture, getZcbFuture);
         future1.join();
         IndexTotalVo yskindexTotalVo = getYskFuture.join();
         IndexTotalVo zceindexTotalVo = getZcbFuture.join();
@@ -2559,45 +2586,45 @@ public class IndexServiceImpl implements IndexService {
 
 
         //当年利润额 已收款-成本额
-        if(yskindexTotalVo.getYearTotal() == null) yskindexTotalVo.setYearTotal(BigDecimal.valueOf(0));
-        if(zceindexTotalVo.getYearTotal() == null) zceindexTotalVo.setYearTotal(BigDecimal.valueOf(0));
+        if (yskindexTotalVo.getYearTotal() == null) yskindexTotalVo.setYearTotal(BigDecimal.valueOf(0));
+        if (zceindexTotalVo.getYearTotal() == null) zceindexTotalVo.setYearTotal(BigDecimal.valueOf(0));
         BigDecimal lreYearTotal = yskindexTotalVo.getYearTotal().subtract(zceindexTotalVo.getYearTotal());
         //去年同期利润额 去年同期合同额-去年同期成本额
-        if(yskindexTotalVo.getYearTq() == null) yskindexTotalVo.setYearTq(BigDecimal.valueOf(0));
-        if(zceindexTotalVo.getYearTq() == null) zceindexTotalVo.setYearTq(BigDecimal.valueOf(0));
+        if (yskindexTotalVo.getYearTq() == null) yskindexTotalVo.setYearTq(BigDecimal.valueOf(0));
+        if (zceindexTotalVo.getYearTq() == null) zceindexTotalVo.setYearTq(BigDecimal.valueOf(0));
         BigDecimal lreLastYearTotal = yskindexTotalVo.getYearTq().subtract(zceindexTotalVo.getYearTq());
         //当月利润额 当月合同额-当月成本额
-        if(yskindexTotalVo.getMonthTotal() == null) yskindexTotalVo.setMonthTotal(BigDecimal.valueOf(0));
-        if(zceindexTotalVo.getMonthTotal() == null) zceindexTotalVo.setMonthTotal(BigDecimal.valueOf(0));
+        if (yskindexTotalVo.getMonthTotal() == null) yskindexTotalVo.setMonthTotal(BigDecimal.valueOf(0));
+        if (zceindexTotalVo.getMonthTotal() == null) zceindexTotalVo.setMonthTotal(BigDecimal.valueOf(0));
         BigDecimal lreMonthTotal = yskindexTotalVo.getMonthTotal().subtract(zceindexTotalVo.getMonthTotal());
         //去年同期月份利润额 去年同期月份合同额-去年同期月份成本额
-        if(yskindexTotalVo.getMonthTq() == null) yskindexTotalVo.setMonthTq(BigDecimal.valueOf(0));
-        if(zceindexTotalVo.getMonthTq() == null) zceindexTotalVo.setMonthTq(BigDecimal.valueOf(0));
+        if (yskindexTotalVo.getMonthTq() == null) yskindexTotalVo.setMonthTq(BigDecimal.valueOf(0));
+        if (zceindexTotalVo.getMonthTq() == null) zceindexTotalVo.setMonthTq(BigDecimal.valueOf(0));
         BigDecimal lreTqMonthTotal = yskindexTotalVo.getMonthTq().subtract(zceindexTotalVo.getMonthTq());
         //上个月利润额 上个月合同额-上个月成本额
-        if(yskindexTotalVo.getMonthLast() == null) yskindexTotalVo.setMonthLast(BigDecimal.valueOf(0));
-        if(zceindexTotalVo.getMonthLast() == null) zceindexTotalVo.setMonthLast(BigDecimal.valueOf(0));
+        if (yskindexTotalVo.getMonthLast() == null) yskindexTotalVo.setMonthLast(BigDecimal.valueOf(0));
+        if (zceindexTotalVo.getMonthLast() == null) zceindexTotalVo.setMonthLast(BigDecimal.valueOf(0));
         BigDecimal lreLastMonthTotal = yskindexTotalVo.getMonthLast().subtract(zceindexTotalVo.getMonthLast());
 
         //年同比   (当年利润-去年利润)/去年利润
         BigDecimal lrYearTb = BigDecimal.valueOf(0);
-        if(lreLastYearTotal.compareTo(BigDecimal.valueOf(0)) == 0){
+        if (lreLastYearTotal.compareTo(BigDecimal.valueOf(0)) == 0) {
             lrYearTb = BigDecimal.valueOf(1);
-        }else {
+        } else {
             lrYearTb = (lreYearTotal.subtract(lreLastYearTotal)).divide(lreLastYearTotal, 2, RoundingMode.HALF_UP);
         }
         //月同比   (当月利润-去年同期月份利润)/去年同期月份利润
         BigDecimal lrMonthTb = BigDecimal.valueOf(0);
-        if(lreTqMonthTotal.compareTo(BigDecimal.valueOf(0)) == 0){
+        if (lreTqMonthTotal.compareTo(BigDecimal.valueOf(0)) == 0) {
             lrMonthTb = BigDecimal.valueOf(1);
-        }else {
+        } else {
             lrMonthTb = (lreMonthTotal.subtract(lreTqMonthTotal)).divide(lreTqMonthTotal, 2, RoundingMode.HALF_UP);
         }
         //月环比   (当月利润-上个月利润)/上个月利润
         BigDecimal lrMonthHb = BigDecimal.valueOf(0);
-        if(lreLastMonthTotal.compareTo(BigDecimal.valueOf(0)) == 0){
+        if (lreLastMonthTotal.compareTo(BigDecimal.valueOf(0)) == 0) {
             lrMonthHb = BigDecimal.valueOf(1);
-        }else {
+        } else {
             lrMonthHb = (lreMonthTotal.subtract(lreLastMonthTotal)).divide(lreLastMonthTotal, 2, RoundingMode.HALF_UP);
         }
 
@@ -2654,8 +2681,9 @@ public class IndexServiceImpl implements IndexService {
         indexChartInfoVo.setSeriesData(seriesDataList);
 
         //获取二层合同额
-        CompletableFuture<ContractChartInfoVo> getHteFuture = CompletableFuture.supplyAsync(() -> {
-            return getContractAmountInfo(request, indexInfoParamDto);
+        CompletableFuture<IndexChartInfoVo> getHteFuture = CompletableFuture.supplyAsync(() -> {
+//            return getContractAmountInfo(request, indexInfoParamDto);
+            return getReceivedDetailByRoleDate(indexInfoParamDto);
         });
 //        ContractChartInfoVo contractChartInfoVo = getContractAmountInfo(request, indexInfoParamDto);
 
@@ -2664,9 +2692,9 @@ public class IndexServiceImpl implements IndexService {
             return indexZcbService.getEightCostsList(indexInfoParamDto, request);
         });
 //        List<EightCostChartInfoVo> resultList = indexZcbService.getEightCostsList(indexInfoParamDto, request);
-        CompletableFuture<Void> future1 = CompletableFuture.allOf(getHteFuture,getZcbFuture);
+        CompletableFuture<Void> future1 = CompletableFuture.allOf(getHteFuture, getZcbFuture);
         future1.join();
-        ContractChartInfoVo contractChartInfoVo = getHteFuture.join();
+        IndexChartInfoVo contractChartInfoVo = getHteFuture.join();
         List<EightCostChartInfoVo> resultList = getZcbFuture.join();
         System.out.println("日期列表:");
         System.out.println(xAxisDataList);
@@ -2676,17 +2704,18 @@ public class IndexServiceImpl implements IndexService {
 
         //日期列表
         xAxisDataList.addAll(contractChartInfoVo.getXAxisData());
-        if(xAxisDataList.size() == 0) return indexChartInfoVo;//如果日期长度为0,返回空列表
+        if (xAxisDataList.size() == 0) return indexChartInfoVo;//如果日期长度为0,返回空列表
         //合同额列表
-        List<BigDecimal> contractAmountList = contractChartInfoVo.getContractAmount();
+//        List<BigDecimal> contractAmountList = contractChartInfoVo.getContractAmount();
+        List<BigDecimal> contractAmountList = contractChartInfoVo.getSeriesData();
         //总成本列表
         List sumZcbDataList = resultList.get(0).getSumZcbData();
         //利润额列表
         List<BigDecimal> lreList = new ArrayList<>();
-        for(int i=0;i<contractAmountList.size();i++){
+        for (int i = 0; i < contractAmountList.size(); i++) {
             //计算每个年或月的利润额  合同额-成本额
-            if(contractAmountList.get(i) == null) contractAmountList.set(i, BigDecimal.valueOf(0));
-            if(sumZcbDataList.get(i) == null) sumZcbDataList.set(i, BigDecimal.valueOf(0));
+            if (contractAmountList.get(i) == null) contractAmountList.set(i, BigDecimal.valueOf(0));
+            if (sumZcbDataList.get(i) == null) sumZcbDataList.set(i, BigDecimal.valueOf(0));
             lreList.add(contractAmountList.get(i).subtract((BigDecimal) sumZcbDataList.get(i)));
         }
         System.out.println("二层利润额:");

+ 1 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/util/RedisCacheMethod.java

@@ -17,6 +17,7 @@ public class RedisCacheMethod {
         redisUtil.removeAll(CacheKey.INCOME_DATA_REDIS_KEY + ":*");
         redisUtil.removeAll(CacheKey.RECEIVED_DATA_REDIS_KEY + ":*");
         redisUtil.removeAll(CacheKey.PROJECT_COST_HUIJI + ":*");
+        redisUtil.removeAll(CacheKey.PROJECT_COST + ":*");
         redisUtil.removeAll(CacheKey.CLF_COMPARE_RESULT_VOS+":*");
     }
 }

+ 1 - 1
module_kzks/src/main/java/org/jeecg/modules/costModelClPrice/service/impl/CostModelClPriceServiceImpl.java

@@ -19,7 +19,7 @@ import java.util.List;
  * @Version: V1.0
  */
 @Service
-@TargetDataSource
+//@TargetDataSource
 public class CostModelClPriceServiceImpl extends ServiceImpl<CostModelClPriceMapper, CostModelClPrice> implements ICostModelClPriceService {
 
     @Autowired

+ 1 - 1
module_kzks/src/main/java/org/jeecg/modules/projectChbSwf/mapper/xml/ProjectChbSwfMapper.xml

@@ -12,7 +12,7 @@
                 SELECT
                     id
                 FROM
-                ( SELECT MIN( id ) AS id FROM kzks_project_chb_swf GROUP BY pzrq,pzh,fzje ) e
+                ( SELECT MIN( id ) AS id FROM kzks_project_chb_swf GROUP BY pzrq,pzh,fzje,zy,xmbh,xmmc,taskno ) e
             )
     </delete>
 

+ 1 - 1
module_kzks/src/main/java/org/jeecg/modules/projectChbWxf/mapper/xml/ProjectChbWxfMapper.xml

@@ -12,7 +12,7 @@
                 SELECT
                     id
                 FROM
-                        ( SELECT MIN( id ) AS id FROM kzks_project_chb_wxf GROUP BY pzrq,pzh,fzje ) e
+                        ( SELECT MIN( id ) AS id FROM kzks_project_chb_wxf GROUP BY pzrq,pzh,fzje,zy,xmbh,xmmc,taskno ) e
             )
     </delete>
 

+ 1 - 1
module_kzks/src/main/java/org/jeecg/modules/projectChbZyf/mapper/xml/ProjectChbZyfMapper.xml

@@ -12,7 +12,7 @@
                 SELECT
                     id
                 FROM
-                        ( SELECT MIN( id ) AS id FROM kzks_project_chb_zyf GROUP BY pzrq,pzh,fzje ) e
+                        ( SELECT MIN( id ) AS id FROM kzks_project_chb_zyf GROUP BY pzrq,pzh,fzje,zy,xmbh,xmmc,taskno ) e
             )
     </delete>
 

+ 2 - 2
module_kzks/src/main/java/org/jeecg/modules/projectCost/mapper/xml/ProjectCostMapper.xml

@@ -82,7 +82,7 @@
                     #{item}
                 </foreach>
                   AND processPercent = "100"
-                  AND yearmonth = #{date}
+                  AND processDate like CONCAT(#{date},'%')
             )
         group by zrbm
     </select>
@@ -131,7 +131,7 @@
             #{item}
         </foreach>
         AND processPercent = "100"
-        AND yearmonth >= "2023-01" and yearmonth <![CDATA[ <= ]]> "2023-10"
+        AND DATE_FORMAT(processDate,'%Y-%m') >= "2023-01" and DATE_FORMAT(processDate,'%Y-%m') <![CDATA[ <= ]]> "2023-10"
         )
         group by zrbm
     </select>

+ 40 - 38
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/mapper/xml/WzOutboundOrderHMapper.xml

@@ -67,45 +67,47 @@
     </select>
     <select id="getCLFCompareDoListByTaskNoListHasPcCode"
             resultType="org.jeecg.modules.wzOutboundOrder.entity.CLfCompareDO">
-        SELECT b.wlbm                   as wlbm,
-               b.wlmc                   as wlmc,
-               b.ggxh                   as ggxh,
-               b.totalAmount            as totalAmount,
-               b.totalCount             as totalCount,
-               totalAmount / totalCount as unitPrice,
-               #{taskno}                as rwh,
-               #{hasPcCode}             as hasPcCode,
-               #{proportion}            as proportion
+        SELECT b.wlbm as wlbm,
+        b.wlmc as wlmc,
+        b.ggxh as ggxh,
+        b.totalAmount as totalAmount,
+        b.totalCount as totalCount,
+        totalAmount / totalCount as unitPrice,
+        #{taskno} as rwh,
+        #{hasPcCode} as hasPcCode,
+        #{proportion} as proportion
         FROM (SELECT a.wlbm,
-                     a.wlmc,
-                     a.ggxh,
-                     SUM(sfzsl * cgdj) AS totalAmount,
-                     sum(sfzsl)        AS totalCount
-              FROM (SELECT wlbm,
-                           wlmc,
-                           ggxh,
-                           sfzsl,
-                           cgdj
-                    FROM wz_outbound_order_b wb
-                    WHERE ckdh IN (SELECT ckdh
-                                   FROM wz_outbound_order_h
-                                   WHERE rwh in (select pcCode
-                                                 from ky_task_info
-                                                 where taskno = #{taskno}
-                                                 UNION all
-                                                 SELECT taskno
-                                                 from ky_task_info
-                                                 where refTaskNo in (select pcCode from ky_task_info where taskno = #{taskno})))
-                    GROUP BY ckrq,
-                             hh,
-                             wlbm,
-                             ggxh,
-                             yfzsl,
-                             sfzsl,
-                             tm) a
-              GROUP BY a.wlbm,
-                       a.wlmc,
-                       a.ggxh) b
+        a.wlmc,
+        a.ggxh,
+        SUM(sfzsl * cgdj) AS totalAmount,
+        sum(sfzsl) AS totalCount
+        FROM (SELECT wlbm,
+        wlmc,
+        ggxh,
+        sfzsl,
+        cgdj
+        FROM wz_outbound_order_b wb
+        WHERE ckdh IN (SELECT ckdh
+        FROM wz_outbound_order_h h
+        inner join (select pcCode
+        from ky_task_info
+        where taskno = #{taskno}
+        UNION all
+        SELECT taskno
+        from ky_task_info
+        where refTaskNo in (select pcCode from ky_task_info where taskno = #{taskno})) s
+        on h.rwh = s.pcCode
+        )
+        GROUP BY ckrq,
+        hh,
+        wlbm,
+        ggxh,
+        yfzsl,
+        sfzsl,
+        tm) a
+        GROUP BY a.wlbm,
+        a.wlmc,
+        a.ggxh) b
     </select>
 
 </mapper>

+ 20 - 22
module_kzks/src/main/java/org/jeecg/modules/xmcbDetail/mapper/xml/ComContractInfoExchangeMapper.xml

@@ -5,8 +5,8 @@
     <select id="getIncomeYearTotalByTasknoListAndByQsrqRange" resultType="java.math.BigDecimal">
         select sum(a.htfpe)
         from (select rwbh,htfpe,qsrq from com_contract_info_exchange where sjly = 20) a
-        where a.qsrq between #{beginDate}
-        and #{endDate}
+        where a.qsrq > #{beginDate}
+        and a.qsrq <![CDATA[ <= ]]> #{endDate}
         and a.rwbh in
         <foreach item='item' index='index' collection='tasknoList' open='(' separator=',' close=')'>
             #{item}
@@ -16,16 +16,16 @@
     <select id="getIncomeYearTotalByTasknoListAndByQsrqRangeIfBoss" resultType="java.math.BigDecimal">
         select sum(a.htfpe)
         from (select htfpe, qsrq from com_contract_info_exchange where sjly = 20) a
-        where a.qsrq between #{beginDate}
-                  and #{endDate}
+        where a.qsrq > #{beginDate}
+                  and a.qsrq <![CDATA[ <= ]]> #{endDate}
     </select>
 
 
     <select id="getContractNumYearTotalByTasknoListAndByQsrqRange" resultType="java.math.BigDecimal">
         select count(distinct(a.htbh))
         from (select rwbh,qsrq,htbh from com_contract_info_exchange where sjly = 20) a
-        where a.qsrq between #{beginDate}
-        and #{endDate}
+        where a.qsrq > #{beginDate}
+        and  a.qsrq <![CDATA[ <= ]]> #{endDate}
         and a.htbh is not null
         and a.rwbh in
         <foreach item='item' index='index' collection='tasknoList' open='(' separator=',' close=')'>
@@ -36,16 +36,16 @@
     <select id="getContractNumYearTotalByTasknoListAndByQsrqRangeIfBoss" resultType="java.math.BigDecimal">
         select count(distinct(a.htbh))
         from (select qsrq,htbh from com_contract_info_exchange where sjly = 20) a
-        where a.qsrq between #{beginDate}
-            and #{endDate}
+        where a.qsrq > #{beginDate}
+            and a.qsrq <![CDATA[ <= ]]> #{endDate}
           and a.htbh is not null
     </select>
 
     <select id="getReceivedYearTotalByTasknoListAndByQsrqRange" resultType="java.math.BigDecimal">
         select sum(a.rwskje)
         from (select rwbh,dkhpdqrq,rwskje from com_contract_info_exchange where sjly = 40) a
-        where a.dkhpdqrq between #{beginDate}
-        and #{endDate}
+        where a.dkhpdqrq > #{beginDate}
+        and a.dkhpdqrq <![CDATA[ <= ]]> #{endDate}
         and a.rwbh in
         <foreach item='item' index='index' collection='tasknoList' open='(' separator=',' close=')'>
             #{item}
@@ -55,12 +55,11 @@
     <select id="getReceivedYearTotalByTasknoListAndByQsrqRangeIfBoss" resultType="java.math.BigDecimal">
         select sum(a.rwskje)
         from (select dkhpdqrq, rwskje from com_contract_info_exchange where sjly = 40) a
-        where a.dkhpdqrq between #{beginDate}
-                  and #{endDate}
+        where a.dkhpdqrq > #{beginDate}
+                  and a.dkhpdqrq <![CDATA[ <= ]]> #{endDate}
     </select>
 
 
-
     <select id="getContractAmountandNumByMonth" resultType="org.jeecg.modules.Index.entity.pojo.ContractAmount">
         SELECT
         sum(htfpe) AS contractAmount,
@@ -71,8 +70,8 @@
         "-",
         LPAD( MONTH (qsrq), 2, "0" )) AS date
         from (select rwbh,htfpe,qsrq,htbh from com_contract_info_exchange where sjly = 20) a
-        where a.qsrq between #{beginDate}
-        and #{endDate}
+        where a.qsrq > #{beginDate}
+        and a.qsrq <![CDATA[ <= ]]> #{endDate}
         and a.rwbh in
         <foreach item='item' index='index' collection='tasknoList' open='(' separator=',' close=')'>
             #{item}
@@ -91,8 +90,8 @@
         "-",
         LPAD( MONTH (qsrq), 2, "0" )) AS date
         from (select rwbh,htfpe,qsrq,htbh from com_contract_info_exchange where sjly = 20) a
-        where a.qsrq between #{beginDate}
-        and #{endDate}
+        where a.qsrq > #{beginDate}
+        and a.qsrq <![CDATA[ <= ]]> #{endDate}
         GROUP BY YEAR(qsrq),MONTH (qsrq)
     </select>
 
@@ -103,8 +102,8 @@
         DISTINCT (htbh)) AS contractTotal,
         YEAR (qsrq) AS Date
         from (select rwbh,htfpe,qsrq,htbh from com_contract_info_exchange where sjly = 20) a
-        where a.qsrq between #{beginDate}
-        and #{endDate}
+        where a.qsrq > #{beginDate}
+        and a.qsrq <![CDATA[ <= ]]> #{endDate}
         and a.rwbh in
         <foreach item='item' index='index' collection='tasknoList' open='(' separator=',' close=')'>
             #{item}
@@ -120,8 +119,8 @@
         DISTINCT (htbh)) AS contractTotal,
         YEAR (qsrq) AS Date
         from (select rwbh,htfpe,qsrq,htbh from com_contract_info_exchange where sjly = 20) a
-        where a.qsrq between #{beginDate}
-        and #{endDate}
+        where a.qsrq > #{beginDate}
+        and a.qsrq <![CDATA[ <= ]]> #{endDate}
         GROUP BY YEAR(qsrq)
     </select>
 
@@ -182,5 +181,4 @@
     </select>
 
 
-
 </mapper>