Bläddra i källkod

513现场问题修改+月进度导入

丁治程 1 år sedan
förälder
incheckning
b5e5a3140e
15 ändrade filer med 887 tillägg och 403 borttagningar
  1. 0 53
      module_kzks/src/main/java/org/jeecg/modules/Index/mapper/xml/IndexKpiMapper.xml
  2. 15 14
      module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexKpiServiceImpl.java
  3. 227 116
      module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexServiceImpl.java
  4. 37 36
      module_kzks/src/main/java/org/jeecg/modules/comContractInfoExchangeNew/entity/ComContractInfoExchangeNew.java
  5. 25 0
      module_kzks/src/main/java/org/jeecg/modules/comContractInfoExchangeNew/mapper/ComContractInfoExchangeNewMapper.java
  6. 164 0
      module_kzks/src/main/java/org/jeecg/modules/comContractInfoExchangeNew/mapper/xml/ComContractInfoExchangeNewMapper.xml
  7. 4 0
      module_kzks/src/main/java/org/jeecg/modules/comContractInfoExchangeNew/service/IComContractInfoExchangeNewService.java
  8. 18 0
      module_kzks/src/main/java/org/jeecg/modules/comContractInfoExchangeNew/service/impl/ComContractInfoExchangeNewServiceImpl.java
  9. 30 15
      module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/entity/KpiProjectMonth.java
  10. 140 0
      module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/listener/KpiProjectMonthListener.java
  11. 3 0
      module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/service/IKpiProjectMonthService.java
  12. 50 0
      module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/service/impl/KpiProjectMonthServiceImpl.java
  13. 164 167
      module_kzks/src/main/java/org/jeecg/modules/kyTaskInfoNew/entity/KyTaskInfoNew.java
  14. 1 1
      module_kzks/src/main/java/org/jeecg/modules/kyTaskInfoNew/listener/KyTaskInfoNewListener.java
  15. 9 1
      module_kzks/src/main/java/org/jeecg/modules/projectImportList/controller/ProjectImportListController.java

+ 0 - 53
module_kzks/src/main/java/org/jeecg/modules/Index/mapper/xml/IndexKpiMapper.xml

@@ -43,21 +43,6 @@
 
     <!-- 下达部门 合同额 -->
     <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
         k.jycs as depart,
         SUM( c.rwyingsk ) as contractAmount
@@ -79,21 +64,6 @@
 
     <!-- 下达部门 已收款 -->
     <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
         k.jycs as depart,
         SUM( c.rwskje ) as received
@@ -115,29 +85,6 @@
 
 
 
-<!--    &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>-->
-
-
     <select id="getFinallNum" resultType="org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate">
         select e.depart as depart , sum(case when e.contractfpe != 0.00 then e.contractfpe * e.newJd else (e.EstimationCoat*10000)*e.newJd end) as contractAmount ,
         sum(e.received) as received

+ 15 - 14
module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexKpiServiceImpl.java

@@ -14,9 +14,12 @@ import org.jeecg.modules.Index.service.IndexKpiService;
 import org.jeecg.modules.Index.util.AuthMark;
 import org.jeecg.modules.Index.util.CacheKey;
 import org.jeecg.modules.Index.util.CommonMethod;
+import org.jeecg.modules.comContractInfoExchangeNew.mapper.ComContractInfoExchangeNewMapper;
+import org.jeecg.modules.comContractInfoExchangeNew.service.IComContractInfoExchangeNewService;
 import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
 import org.jeecg.modules.projectCost.service.IProjectCostService;
 import org.jeecg.modules.system.service.ISysDepartService;
+import org.jeecg.modules.xmcbDetail.mapper.ComContractInfoExchangeMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Async;
@@ -64,6 +67,10 @@ public class IndexKpiServiceImpl implements IndexKpiService {
     @Autowired
     private RedisUtil redisUtil;
 
+    @Autowired
+    @SuppressWarnings("all")
+    private ComContractInfoExchangeNewMapper contractInfoExchangeNewMapper;
+
     /**
      * 工具类
      * 根据日期字符串求上一个月的字符串
@@ -244,7 +251,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
                     CompletableFuture<Map<String,IndexKpiCompletByDate>> getHtereceivedXdbmHteMapFuture = CompletableFuture.supplyAsync(() -> {
                         Map<String, IndexKpiCompletByDate> htereceivedXdbmHteMap = new TreeMap<>();//用来保存部门上月合计的合同额、已收款以及责任部门
                         if (xdbmList.isEmpty()) return htereceivedXdbmHteMap;
-                        List<IndexKpiCompletByDate> xdbmHte = indexKpiMapper.getXdbmHte(indexKpiParamDto.getBeginDate(), xdbmList);
+                        List<IndexKpiCompletByDate> xdbmHte = contractInfoExchangeNewMapper.getXdbmHte(indexKpiParamDto.getBeginDate(), xdbmList);
                         for (IndexKpiCompletByDate d:xdbmHte) {
                             htereceivedXdbmHteMap.put(d.getDepart(),d);
                         }
@@ -255,7 +262,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
                     CompletableFuture<Map<String,IndexKpiCompletByDate>> getHtereceivedXdbmYskMapFuture = CompletableFuture.supplyAsync(() -> {
                         Map<String, IndexKpiCompletByDate> htereceivedXdbmYskMap = new TreeMap<>();//用来保存部门上月合计的合同额、已收款以及责任部门
                         if (xdbmList.isEmpty()) return htereceivedXdbmYskMap;
-                        List<IndexKpiCompletByDate> xdbmHte = indexKpiMapper.getXdbmYsk(indexKpiParamDto.getBeginDate(), xdbmList);
+                        List<IndexKpiCompletByDate> xdbmHte = contractInfoExchangeNewMapper.getXdbmYsk(indexKpiParamDto.getBeginDate(), xdbmList);
                         for (IndexKpiCompletByDate d:xdbmHte) {
                             htereceivedXdbmYskMap.put(d.getDepart(),d);
                         }
@@ -341,7 +348,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
                     CompletableFuture<Map<String,IndexKpiCompletByDate>> getHtereceivedXdbmHteMapFuture = CompletableFuture.supplyAsync(() -> {
                         Map<String, IndexKpiCompletByDate> htereceivedXdbmHteMap = new TreeMap<>();//用来保存部门上月合计的合同额、已收款以及责任部门
                         if (xdbmList.isEmpty()) return htereceivedXdbmHteMap;
-                        List<IndexKpiCompletByDate> xdbmHte = indexKpiMapper.getXdbmHte(indexKpiParamDto.getBeginDate(), xdbmList);
+                        List<IndexKpiCompletByDate> xdbmHte = contractInfoExchangeNewMapper.getXdbmHte(indexKpiParamDto.getBeginDate(), xdbmList);
                         for (IndexKpiCompletByDate d:xdbmHte) {
                             htereceivedXdbmHteMap.put(d.getDepart(),d);
                         }
@@ -352,7 +359,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
                     CompletableFuture<Map<String,IndexKpiCompletByDate>> getHtereceivedXdbmYskMapFuture = CompletableFuture.supplyAsync(() -> {
                         Map<String, IndexKpiCompletByDate> htereceivedXdbmYskMap = new TreeMap<>();//用来保存部门上月合计的合同额、已收款以及责任部门
                         if (xdbmList.isEmpty()) return htereceivedXdbmYskMap;
-                        List<IndexKpiCompletByDate> xdbmHte = indexKpiMapper.getXdbmYsk(indexKpiParamDto.getBeginDate(), xdbmList);
+                        List<IndexKpiCompletByDate> xdbmHte = contractInfoExchangeNewMapper.getXdbmYsk(indexKpiParamDto.getBeginDate(), xdbmList);
                         for (IndexKpiCompletByDate d:xdbmHte) {
                             htereceivedXdbmYskMap.put(d.getDepart(),d);
                         }
@@ -419,13 +426,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
             //责任部门 获取选择年月的数据  合同额、已收款
             CompletableFuture<Map<String, IndexKpiCompletByDate>> getHtereceivedZrbmMapFuture = CompletableFuture.supplyAsync(() -> {
                 Map<String, IndexKpiCompletByDate> htereceivedZrbmMap = new TreeMap<>();//用来保存部门该月合计的合同额、已收款以及责任部门
-                List<IndexKpiCompletByDate> htereceivedZrbmList;
-                //如果选择的日期是当年当月,则从项目成本表里取数据,否则从每月月底项目进度考核表中取
-                if(finalIsCurrentDate){
-                    htereceivedZrbmList = indexKpiMapper.getHteReceivedZrbmCost(zrbmList);
-                }else{
-                    htereceivedZrbmList = indexKpiMapper.getHteReceivedZrbmYm(finalDateYm, zrbmList);
-                }
+                List<IndexKpiCompletByDate> htereceivedZrbmList = indexKpiMapper.getHteReceivedZrbmYm(finalDateYm, zrbmList);
                 for(IndexKpiCompletByDate htereceivedZrbm:htereceivedZrbmList){
                     htereceivedZrbmMap.put(htereceivedZrbm.getDepart(), htereceivedZrbm);
                 }
@@ -446,7 +447,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
             CompletableFuture<Map<String,IndexKpiCompletByDate>> getHtereceivedXdbmHteMapFuture = CompletableFuture.supplyAsync(() -> {
                 Map<String, IndexKpiCompletByDate> htereceivedXdbmHteMap = new TreeMap<>();//用来保存部门上月合计的合同额、已收款以及责任部门
                 if (xdbmList.isEmpty()) return htereceivedXdbmHteMap;
-                List<IndexKpiCompletByDate> xdbmHte = indexKpiMapper.getXdbmHte(indexKpiParamDto.getBeginDate(), xdbmList);
+                List<IndexKpiCompletByDate> xdbmHte = contractInfoExchangeNewMapper.getXdbmHte(indexKpiParamDto.getBeginDate(), xdbmList);
                 for (IndexKpiCompletByDate d:xdbmHte) {
                     htereceivedXdbmHteMap.put(d.getDepart(),d);
                 }
@@ -457,7 +458,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
             CompletableFuture<Map<String,IndexKpiCompletByDate>> getHtereceivedXdbmYskMapFuture = CompletableFuture.supplyAsync(() -> {
                 Map<String, IndexKpiCompletByDate> htereceivedXdbmYskMap = new TreeMap<>();//用来保存部门上月合计的合同额、已收款以及责任部门
                 if (xdbmList.isEmpty()) return htereceivedXdbmYskMap;
-                List<IndexKpiCompletByDate> xdbmHte = indexKpiMapper.getXdbmYsk(indexKpiParamDto.getBeginDate(), xdbmList);
+                List<IndexKpiCompletByDate> xdbmHte = contractInfoExchangeNewMapper.getXdbmYsk(indexKpiParamDto.getBeginDate(), xdbmList);
                 for (IndexKpiCompletByDate d:xdbmHte) {
                     htereceivedXdbmYskMap.put(d.getDepart(),d);
                 }
@@ -512,7 +513,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
             CompletableFuture<Void> setKpiDataZrbmList = CompletableFuture.runAsync(() -> {
                 //责任部门列表填充合同额、已收款、完成度
                 for(IndexKpiCompletByDate kpiDataZrbm:kpiDataZrbmList){
-                    //根据部门找到今年的合同额和已收款
+                    //如果是当前年/月 去项目成本表中查询进度 然后计算;否则就从进度表中计算
                     if(finalIsCurrentDate){
                         IndexKpiCompletByDate htereceivedZrbmFinal = htereceivedZrbmFinalMap.getOrDefault(kpiDataZrbm.getDepart(), kpiDataZrbm);
                         IndexKpiCompletByDate htereceivedZrbmNew = htereceivedZrbmNewMap.getOrDefault(kpiDataZrbm.getDepart(), kpiDataZrbm);

+ 227 - 116
module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexServiceImpl.java

@@ -11,6 +11,7 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.util.JwtUtil;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.RedisUtil;
 import org.jeecg.modules.Index.entity.pojo.LreInfoByDate;
 import org.jeecg.modules.Index.entity.pojo.ReceivedByDate;
@@ -201,6 +202,12 @@ public class IndexServiceImpl implements IndexService {
         Calendar instance = Calendar.getInstance();
         setZeroMonth(instance);
         instance.add(Calendar.MONTH, 1);
+        instance.setTime(new Date());
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        instance.set(Calendar.HOUR_OF_DAY, 0);
+        instance.set(Calendar.MINUTE, 0);
+        instance.set(Calendar.SECOND, 0);
+        instance.set(Calendar.MILLISECOND, 0);
         Date currentYearEndDate = instance.getTime();
         setZeroYear(instance);
         Date currentYearBeginDate = instance.getTime();
@@ -230,6 +237,13 @@ public class IndexServiceImpl implements IndexService {
         setZeroMonth(instance);
         instance.add(Calendar.MONTH, 1);
         //去年的今日
+        instance.setTime(new Date());
+        instance.add(Calendar.YEAR, -1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        instance.set(Calendar.HOUR_OF_DAY, 0);
+        instance.set(Calendar.MINUTE, 0);
+        instance.set(Calendar.SECOND, 0);
+        instance.set(Calendar.MILLISECOND, 0);
         Date LastTqEndDate = instance.getTime();
         setZeroYear(instance);
         Date LastYearBeginDate = instance.getTime();
@@ -256,7 +270,13 @@ public class IndexServiceImpl implements IndexService {
         instance.setTime(new Date());
         setZeroMonth(instance);
         Date currentMothBginDate = instance.getTime();
-        instance.add(Calendar.MONTH, 1);
+//        instance.add(Calendar.MONTH, 1);
+        instance.setTime(new Date());
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        instance.set(Calendar.HOUR_OF_DAY, 0);
+        instance.set(Calendar.MINUTE, 0);
+        instance.set(Calendar.SECOND, 0);
+        instance.set(Calendar.MILLISECOND, 0);
         Date currentMothEndDate = instance.getTime();
 
 
@@ -280,6 +300,13 @@ public class IndexServiceImpl implements IndexService {
         //上月同期已收款,例:>= 2023-11-01 00:00:00   < 2023-12-01 00:00:00
         instance.setTime(new Date());
         setZeroMonth(instance);
+        instance.setTime(new Date());
+        instance.add(Calendar.MONTH, -1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        instance.set(Calendar.HOUR_OF_DAY, 0);
+        instance.set(Calendar.MINUTE, 0);
+        instance.set(Calendar.SECOND, 0);
+        instance.set(Calendar.MILLISECOND, 0);
         Date LastMothTqEndDate = instance.getTime();
         setZeroMonth(instance);
         Date LastMothTqBeginDate = instance.getTime();
@@ -306,7 +333,14 @@ public class IndexServiceImpl implements IndexService {
         instance.setTime(new Date());
         instance.add(Calendar.YEAR, -1);
         setZeroMonth(instance);
-        instance.add(Calendar.MONTH, 1);
+//        instance.add(Calendar.MONTH, 1);
+        instance.setTime(new Date());
+        instance.add(Calendar.YEAR, -1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        instance.set(Calendar.HOUR_OF_DAY, 0);
+        instance.set(Calendar.MINUTE, 0);
+        instance.set(Calendar.SECOND, 0);
+        instance.set(Calendar.MILLISECOND, 0);
         Date lastYearMonthTqEndDate = instance.getTime();
         setZeroMonth(instance);
         Date lastYearMonthTqBeginDate = instance.getTime();
@@ -506,6 +540,12 @@ public class IndexServiceImpl implements IndexService {
         Calendar instance = Calendar.getInstance();
         setZeroMonth(instance);
         instance.add(Calendar.MONTH, 1);
+        instance.setTime(new Date());
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        instance.set(Calendar.HOUR_OF_DAY, 0);
+        instance.set(Calendar.MINUTE, 0);
+        instance.set(Calendar.SECOND, 0);
+        instance.set(Calendar.MILLISECOND, 0);
         Date currentYearEndDate = instance.getTime();
         setZeroYear(instance);
         Date currentYearBeginDate = instance.getTime();
@@ -535,6 +575,13 @@ public class IndexServiceImpl implements IndexService {
         setZeroMonth(instance);
         instance.add(Calendar.MONTH, 1);
         //去年的今日
+        instance.setTime(new Date());
+        instance.add(Calendar.YEAR, -1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        instance.set(Calendar.HOUR_OF_DAY, 0);
+        instance.set(Calendar.MINUTE, 0);
+        instance.set(Calendar.SECOND, 0);
+        instance.set(Calendar.MILLISECOND, 0);
         Date LastTqEndDate = instance.getTime();
         setZeroYear(instance);
         Date LastYearBeginDate = instance.getTime();
@@ -560,7 +607,13 @@ public class IndexServiceImpl implements IndexService {
         instance.setTime(new Date());
         setZeroMonth(instance);
         Date currentMothBginDate = instance.getTime();
-        instance.add(Calendar.MONTH, 1);
+//        instance.add(Calendar.MONTH, 1);
+        instance.setTime(new Date());
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        instance.set(Calendar.HOUR_OF_DAY, 0);
+        instance.set(Calendar.MINUTE, 0);
+        instance.set(Calendar.SECOND, 0);
+        instance.set(Calendar.MILLISECOND, 0);
         Date currentMothEndDate = instance.getTime();
 
         CompletableFuture<BigDecimal> currentMonthTotalFuture = CompletableFuture.supplyAsync(() -> {
@@ -583,6 +636,13 @@ public class IndexServiceImpl implements IndexService {
         //上月同期已收款,例:>= 2023-11-01 00:00:00   < 2023-12-01 00:00:00
         instance.setTime(new Date());
         setZeroMonth(instance);
+        instance.setTime(new Date());
+        instance.add(Calendar.MONTH, -1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        instance.set(Calendar.HOUR_OF_DAY, 0);
+        instance.set(Calendar.MINUTE, 0);
+        instance.set(Calendar.SECOND, 0);
+        instance.set(Calendar.MILLISECOND, 0);
         Date LastMothTqEndDate = instance.getTime();
         setZeroMonth(instance);
         Date LastMothTqBeginDate = instance.getTime();
@@ -609,7 +669,14 @@ public class IndexServiceImpl implements IndexService {
         instance.setTime(new Date());
         instance.add(Calendar.YEAR, -1);
         setZeroMonth(instance);
-        instance.add(Calendar.MONTH, 1);
+//        instance.add(Calendar.MONTH, 1);
+        instance.setTime(new Date());
+        instance.add(Calendar.YEAR, -1);
+        instance.add(Calendar.DAY_OF_MONTH,1);
+        instance.set(Calendar.HOUR_OF_DAY, 0);
+        instance.set(Calendar.MINUTE, 0);
+        instance.set(Calendar.SECOND, 0);
+        instance.set(Calendar.MILLISECOND, 0);
         Date lastYearMonthTqEndDate = instance.getTime();
         setZeroMonth(instance);
         Date lastYearMonthTqBeginDate = instance.getTime();
@@ -655,7 +722,7 @@ public class IndexServiceImpl implements IndexService {
             return incomeYearTb;
         });
 
-            //环比
+        //环比
         CompletableFuture<BigDecimal> mothHbFuture = CompletableFuture.supplyAsync(() -> {
             BigDecimal MothDifference = currentMonthTotal.subtract(lastMothTqTotal);
             BigDecimal incomeMothHb = BigDecimal.valueOf(1);
@@ -663,7 +730,7 @@ public class IndexServiceImpl implements IndexService {
                 incomeMothHb = MothDifference.divide(lastMothTqTotal, 2, RoundingMode.HALF_UP);
             return incomeMothHb;
         });
-            //同期
+        //同期
         CompletableFuture<BigDecimal> yearMothTbFuture = CompletableFuture.supplyAsync(() -> {
             BigDecimal yearMothDifference = currentMonthTotal.subtract(lastYearMonthTqTotal);
             BigDecimal incomeYearMothTb = BigDecimal.valueOf(1);
@@ -874,27 +941,85 @@ public class IndexServiceImpl implements IndexService {
         List<ContractAmount> contractAmountList;
         if (YEAR.equals(Time)) {
             if (AuthMark.DEPT_LEADER.equals(role)) {
-                /** 采集的合同信息表 */
-                //contractAmountList = exchangeMapper.getContractAmountandNumByYear(tasknoList, beginDate, endDate);
-                /** 导入的合同信息表 */
-                contractAmountList = exchangeNewMapper.getContractAmountandNumByYear(tasknoList, beginDate, endDate);
+                int curronYear = DateUtils.getYear();
+                // 如果查询的结束日期包含了当前年 那么截止日期为 当前日期
+                if (String.valueOf(curronYear).equals(indexInfoParamDto.getEndDate())){
+                    Calendar instance = Calendar.getInstance();
+                    instance.setTime(new Date());
+                    instance.add(Calendar.DAY_OF_MONTH,1);
+                    instance.set(Calendar.HOUR_OF_DAY, 0);
+                    instance.set(Calendar.MINUTE, 0);
+                    instance.set(Calendar.SECOND, 0);
+                    instance.set(Calendar.MILLISECOND, 0);
+                    Date currentEndDate = instance.getTime();
+                    contractAmountList = exchangeNewMapper.getContractAmountandNumByYear1(tasknoList, beginDate, currentEndDate);
+                }else {
+                    /** 采集的合同信息表 */
+                    //contractAmountList = exchangeMapper.getContractAmountandNumByYear(tasknoList, beginDate, endDate);
+                    /** 导入的合同信息表 */
+                    contractAmountList = exchangeNewMapper.getContractAmountandNumByYear(tasknoList, beginDate, endDate);
+                }
+
             } else {
-                /** 采集的合同信息表 */
-                //contractAmountList = exchangeMapper.getContractAmountandNumByYearIfBoss(tasknoList, beginDate, endDate);
-                /** 导入的合同信息表 */
-                contractAmountList = exchangeNewMapper.getContractAmountandNumByYearIfBoss(tasknoList, beginDate, endDate);
+                int curronYear = DateUtils.getYear();
+                // 如果查询的结束日期包含了当前年 那么截止日期为 当前日期
+                if (String.valueOf(curronYear).equals(indexInfoParamDto.getEndDate())){
+                    Calendar instance = Calendar.getInstance();
+                    instance.setTime(new Date());
+                    instance.add(Calendar.DAY_OF_MONTH,1);
+                    instance.set(Calendar.HOUR_OF_DAY, 0);
+                    instance.set(Calendar.MINUTE, 0);
+                    instance.set(Calendar.SECOND, 0);
+                    instance.set(Calendar.MILLISECOND, 0);
+                    Date currentEndDate = instance.getTime();
+                    contractAmountList = exchangeNewMapper.getContractAmountandNumByYearIfBoss1(tasknoList, beginDate, currentEndDate);
+                }else {
+                    /** 采集的合同信息表 */
+                    //contractAmountList = exchangeMapper.getContractAmountandNumByYearIfBoss(tasknoList, beginDate, endDate);
+                    /** 导入的合同信息表 */
+                    contractAmountList = exchangeNewMapper.getContractAmountandNumByYearIfBoss(tasknoList, beginDate, endDate);
+                }
             }
         } else {
             if (AuthMark.DEPT_LEADER.equals(role)) {
-                /** 采集的合同信息表 */
-                //contractAmountList = exchangeMapper.getContractAmountandNumByMonth(tasknoList, beginDate, endDate);
-                /** 导入的合同信息表 */
-                contractAmountList = exchangeNewMapper.getContractAmountandNumByMonth(tasknoList, beginDate, endDate);
+                String selectMonth = DateUtils.formatDate(endDate).split("-")[1];
+                String currontMonth = DateUtils.formatDate(DateUtils.getDate()).split("-")[1];
+                if (currontMonth.equals(selectMonth)){
+                    Calendar instance = Calendar.getInstance();
+                    instance.setTime(new Date());
+                    instance.add(Calendar.DAY_OF_MONTH,1);
+                    instance.set(Calendar.HOUR_OF_DAY, 0);
+                    instance.set(Calendar.MINUTE, 0);
+                    instance.set(Calendar.SECOND, 0);
+                    instance.set(Calendar.MILLISECOND, 0);
+                    Date currentEndDate = instance.getTime();
+                    contractAmountList = exchangeNewMapper.getContractAmountandNumByMonth1(tasknoList, beginDate, currentEndDate);
+                }else {
+                    /** 采集的合同信息表 */
+                    //contractAmountList = exchangeMapper.getContractAmountandNumByMonth(tasknoList, beginDate, endDate);
+                    /** 导入的合同信息表 */
+                    contractAmountList = exchangeNewMapper.getContractAmountandNumByMonth(tasknoList, beginDate, endDate);
+                }
+
             } else {
-                /** 采集的合同信息表 */
-                //contractAmountList = exchangeMapper.getContractAmountandNumByMonthIfBoss(tasknoList, beginDate, endDate);
-                /** 导入的合同信息表 */
-                contractAmountList = exchangeNewMapper.getContractAmountandNumByMonthIfBoss(tasknoList, beginDate, endDate);
+                String selectMonth = DateUtils.formatDate(endDate).split("-")[1];
+                String currontMonth = DateUtils.formatDate(DateUtils.getDate()).split("-")[1];
+                if (currontMonth.equals(selectMonth)){
+                    Calendar instance = Calendar.getInstance();
+                    instance.setTime(new Date());
+                    instance.add(Calendar.DAY_OF_MONTH,1);
+                    instance.set(Calendar.HOUR_OF_DAY, 0);
+                    instance.set(Calendar.MINUTE, 0);
+                    instance.set(Calendar.SECOND, 0);
+                    instance.set(Calendar.MILLISECOND, 0);
+                    Date currentEndDate = instance.getTime();
+                    contractAmountList = exchangeNewMapper.getContractAmountandNumByMonthIfBoss1(tasknoList, beginDate, currentEndDate);
+                }else {
+                    /** 采集的合同信息表 */
+                    //contractAmountList = exchangeMapper.getContractAmountandNumByMonthIfBoss(tasknoList, beginDate, endDate);
+                    /** 导入的合同信息表 */
+                    contractAmountList = exchangeNewMapper.getContractAmountandNumByMonthIfBoss(tasknoList, beginDate, endDate);
+                }
             }
         }
         ContractChartInfoVo newResVo = new ContractChartInfoVo();
@@ -2378,42 +2503,49 @@ public class IndexServiceImpl implements IndexService {
         indexChartInfoVo.setXAxisData(timeRangeList);
         //添加纵坐标列表
         indexChartInfoVo.setSeriesData(seriesDataList);
-//        //添加横坐标列表
-//        indexChartInfoVo.setXAxisData(timeRangeList);
-//        //添加纵坐标列表
-//        indexChartInfoVo.setSeriesData(seriesDataList);
-
-//        List<String> tasknoList = projectCostMapper.queryTasknoListAll();
-//        System.out.println("查到的所有部门对应的任务号列表:");
-//        System.out.println(tasknoList);
-//        if (tasknoList.isEmpty()) return indexChartInfoVo;
-//        System.out.println(indexChartInfoVo);
 
         //4.计算该时间列表中某年或某月对应的总收款
         List<ReceivedByDate> receivedByDates = new ArrayList<>();
         if (timeType.equals("year")) {
-            /** 采集的合同信息表 */
-            //receivedByDates = exchangeMapper.getReceivedAllByYear(startString, endString);
-            /** 导入的合同信息表 */
-            receivedByDates = exchangeNewMapper.getReceivedAllByYear(startString, endString);
-//            System.out.println("已收款二层按年查询结果:");
-//            for(ReceivedByDate receivedByDate:receivedByDates){
-//                System.out.println(receivedByDate.getDate());
-//                System.out.println(receivedByDate.getReceived());
-//            }
-//            System.out.println(receivedByDates);
-
+            int curronYear = DateUtils.getYear();
+            // 如果查询的结束日期包含了当前年 那么截止日期为 当前日期
+            if (String.valueOf(curronYear).equals(endString)){
+                Calendar instance = Calendar.getInstance();
+                instance.setTime(new Date());
+                instance.add(Calendar.DAY_OF_MONTH,1);
+                instance.set(Calendar.HOUR_OF_DAY, 0);
+                instance.set(Calendar.MINUTE, 0);
+                instance.set(Calendar.SECOND, 0);
+                instance.set(Calendar.MILLISECOND, 0);
+                Date currentYearEndDate = instance.getTime();
+                String formatDate = DateUtils.formatDate(currentYearEndDate);
+                receivedByDates = exchangeNewMapper.getReceivedAllByYear2(startString, formatDate);
+            }else {
+                /** 采集的合同信息表 */
+                //receivedByDates = exchangeMapper.getReceivedAllByYear(startString, endString);
+                /** 导入的合同信息表 */
+                receivedByDates = exchangeNewMapper.getReceivedAllByYear(startString, endString);
+            }
         } else if (timeType.equals("month")) {
-            /** 采集的合同信息表 */
-            //receivedByDates = exchangeMapper.getReceivedAllByYMonth(startString, endString);
-            /** 导入的合同信息表 */
-            receivedByDates = exchangeNewMapper.getReceivedAllByYMonth(startString, endString);
-//            System.out.println("已收款二层按月查询结果:");
-//            for(ReceivedByDate receivedByDate:receivedByDates){
-//                System.out.println(receivedByDate.getDate());
-//                System.out.println(receivedByDate.getReceived());
-//            }
-//            System.out.println(receivedByDates);
+            String selectMonth = endString.split("-")[1];
+            String currontMonth = DateUtils.formatDate(DateUtils.getDate()).split("-")[1];
+            if (currontMonth.equals(selectMonth)){
+                Calendar instance = Calendar.getInstance();
+                instance.setTime(new Date());
+                instance.add(Calendar.DAY_OF_MONTH,1);
+                instance.set(Calendar.HOUR_OF_DAY, 0);
+                instance.set(Calendar.MINUTE, 0);
+                instance.set(Calendar.SECOND, 0);
+                instance.set(Calendar.MILLISECOND, 0);
+                Date currentYearEndDate = instance.getTime();
+                String formatDate = DateUtils.formatDate(currentYearEndDate);
+                receivedByDates = exchangeNewMapper.getReceivedAllByYMonth1(startString, formatDate);
+            }else {
+                /** 采集的合同信息表 */
+                //receivedByDates = exchangeMapper.getReceivedAllByYMonth(startString, endString);
+                /** 导入的合同信息表 */
+                receivedByDates = exchangeNewMapper.getReceivedAllByYMonth(startString, endString);
+            }
         }
         if (receivedByDates.isEmpty()) return indexChartInfoVo;
 
@@ -2427,58 +2559,6 @@ public class IndexServiceImpl implements IndexService {
         indexChartInfoVo.setXAxisData(timeRangeList);
         //添加纵坐标列表
         indexChartInfoVo.setSeriesData(seriesDataList);
-
-        /*
-
-        //4.计算该时间列表中某年或某月对应的总收款
-        //创建CompletableFuture集合,因为allOf()方法参数可变参数
-        List<CompletableFuture<BigDecimal>> futures = new ArrayList<>();
-        for (String timeRange2 : timeRangeList) {
-            CompletableFuture<BigDecimal> future = CompletableFuture.supplyAsync(() -> {
-                // 子线程处理任务
-                BigDecimal yearTotal = initValue;
-
-                if (timeType.equals("year")) {
-                    //1.根据实际时间查询任务列表
-                    yearTotal = exchangeMapper.getReceivedAllByYear(timeRange2);
-                    if (yearTotal == null) {
-                        yearTotal = initValue;
-                    }
-                } else if (timeType.equals("month")) {
-                    yearTotal = exchangeMapper.getReceivedAllByYMonth(timeRange2);
-                    if (yearTotal == null) {
-                        yearTotal = initValue;
-                    }
-                }
-//                System.out.println(timeRange2 + "的总收款为:");
-//                System.out.println(yearTotal);
-                if (ObjectUtils.isEmpty(yearTotal)) return initValue;
-                return yearTotal;
-            });
-            futures.add(future);
-        }
-        //allOf() 方法可以用于等待所有 CompletableFuture 对象的计算结果
-        CompletableFuture<Void> futureAll = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
-        futureAll.join();
-        List<BigDecimal> seriesDataList2 = new ArrayList<>();
-        futures.forEach(i -> {
-            try {
-                seriesDataList2.add(i.get());
-            } catch (InterruptedException | ExecutionException e) {
-                seriesDataList2.add(initValue);//出现异常当前利润额赋为0
-                e.printStackTrace();
-            }
-        });
-        System.out.println("获取的已收款列表为:");
-        System.out.println(seriesDataList2);
-
-        //添加横纵坐标列表
-        indexChartInfoVo.setXAxisData(timeRangeList);
-        indexChartInfoVo.setSeriesData(seriesDataList2);
-
-        */
-
-
         return indexChartInfoVo;
     }
 
@@ -2555,10 +2635,26 @@ public class IndexServiceImpl implements IndexService {
         //4.计算该时间列表中某年或某月对应的总收款
         List<ReceivedByDate> receivedByDates = new ArrayList<>();
         if (timeType.equals("year")) {
-            /** 采集的合同信息表 */
-            //receivedByDates = exchangeMapper.getReceivedByYear2(sysDepartNames, startString, endString);
-            /** 导入的合同信息表 */
-            receivedByDates = exchangeNewMapper.getReceivedByYear2(sysDepartNames, startString, endString);
+            int curronYear = DateUtils.getYear();
+            // 如果查询的结束日期包含了当前年 那么截止日期为 当前日期
+            if (String.valueOf(curronYear).equals(endString)){
+                Calendar instance = Calendar.getInstance();
+                instance.setTime(new Date());
+                instance.add(Calendar.DAY_OF_MONTH,1);
+                instance.set(Calendar.HOUR_OF_DAY, 0);
+                instance.set(Calendar.MINUTE, 0);
+                instance.set(Calendar.SECOND, 0);
+                instance.set(Calendar.MILLISECOND, 0);
+                Date currentYearEndDate = instance.getTime();
+                String formatDate = DateUtils.formatDate(currentYearEndDate);
+                receivedByDates = exchangeNewMapper.getReceivedByYear21(sysDepartNames,startString, formatDate);
+            }else {
+                /** 采集的合同信息表 */
+                //receivedByDates = exchangeMapper.getReceivedByYear2(sysDepartNames, startString, endString);
+                /** 导入的合同信息表 */
+                receivedByDates = exchangeNewMapper.getReceivedByYear2(sysDepartNames, startString, endString);
+            }
+
             System.out.println("部门领导已收款二层按年查询结果:");
             for (ReceivedByDate receivedByDate : receivedByDates) {
                 System.out.println(receivedByDate.getDate());
@@ -2567,10 +2663,25 @@ public class IndexServiceImpl implements IndexService {
             System.out.println(receivedByDates);
 
         } else if (timeType.equals("month")) {
-            /** 采集的合同信息表 */
-            //receivedByDates = exchangeMapper.getReceivedByYMonth2(sysDepartNames, startString, endString);
-            /** 导入的合同信息表 */
-            receivedByDates = exchangeNewMapper.getReceivedByYMonth2(sysDepartNames, startString, endString);
+            String selectMonth = endString.split("-")[1];
+            String currontMonth = DateUtils.formatDate(DateUtils.getDate()).split("-")[1];
+            if (currontMonth.equals(selectMonth)){
+                Calendar instance = Calendar.getInstance();
+                instance.setTime(new Date());
+                instance.add(Calendar.DAY_OF_MONTH,1);
+                instance.set(Calendar.HOUR_OF_DAY, 0);
+                instance.set(Calendar.MINUTE, 0);
+                instance.set(Calendar.SECOND, 0);
+                instance.set(Calendar.MILLISECOND, 0);
+                Date currentYearEndDate = instance.getTime();
+                String formatDate = DateUtils.formatDate(currentYearEndDate);
+                receivedByDates = exchangeNewMapper.getReceivedByYMonth21(sysDepartNames,startString, formatDate);
+            }else {
+                /** 采集的合同信息表 */
+                //receivedByDates = exchangeMapper.getReceivedByYMonth2(sysDepartNames, startString, endString);
+                /** 导入的合同信息表 */
+                receivedByDates = exchangeNewMapper.getReceivedByYMonth2(sysDepartNames, startString, endString);
+            }
             System.out.println("部门领导已收款二层按月查询结果:");
             for (ReceivedByDate receivedByDate : receivedByDates) {
                 System.out.println(receivedByDate.getDate());
@@ -2871,9 +2982,9 @@ public class IndexServiceImpl implements IndexService {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String role = commonMethod.getRole(sysUser.getUsername());
         if (AuthMark.BOSS.equals(role) && departNameList != null && !departNameList.isEmpty()) role = AuthMark.DEPT_LEADER;
-            if (role == null) {
-                return indexChartInfoVo;
-            }
+        if (role == null) {
+            return indexChartInfoVo;
+        }
         //如果是所长,查看所有 部门领导查看本部门  员工后期增加
         if (role.equals(AuthMark.BOSS)) {
             System.out.println("当前账户权限:所长");

+ 37 - 36
module_kzks/src/main/java/org/jeecg/modules/comContractInfoExchangeNew/entity/ComContractInfoExchangeNew.java

@@ -7,6 +7,7 @@ import java.math.BigDecimal;
 
 import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.converters.bigdecimal.BigDecimalNumberConverter;
 import com.alibaba.excel.converters.date.DateStringConverter;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -104,45 +105,45 @@ public class ComContractInfoExchangeNew implements Serializable {
     @ApiModelProperty(value = "甲方简称")
     private java.lang.String jfjc;
     /**合同金额*/
-//	@Excel(name = "合同金额", width = 15)    //单元格常规格式用这个
+    @Excel(name = "合同金额", width = 15)    //单元格常规格式用这个
 //    @ExcelProperty(converter = BigDecimalStringConverter.class)   //单元格文本格式用这个
-//    @ExcelProperty(converter = BigDecimalNumberConverter.class)  //单元格数值格式用这个
-    @ExcelProperty(value = "合同金额")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)  //单元格数值格式用这个
+//    @ExcelProperty(value = "合同金额")
     @ApiModelProperty(value = "合同金额")
     private java.math.BigDecimal htje;
     /**自筹*/
-//	@Excel(name = "自筹", width = 15)
+    @Excel(name = "自筹", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class)
-//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "自筹")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "自筹")
     @ApiModelProperty(value = "自筹")
     private java.math.BigDecimal zc;
     /**合同到款*/
-//	@Excel(name = "合同到款", width = 15)
+    @Excel(name = "合同到款", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class)
-//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "合同到款")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "合同到款")
     @ApiModelProperty(value = "合同到款")
     private java.math.BigDecimal htdk;
     /**合同待收款*/
-//	@Excel(name = "合同待收款", width = 15)
+    @Excel(name = "合同待收款", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class)
-//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "合同待收款")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "合同待收款")
     @ApiModelProperty(value = "合同待收款")
     private java.math.BigDecimal htdsk;
     /**合同已开票*/
-//	@Excel(name = "合同已开票", width = 15)
+    @Excel(name = "合同已开票", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class)
-//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "合同已开票")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "合同已开票")
     @ApiModelProperty(value = "合同已开票")
     private java.math.BigDecimal htykp;
     /**合同待开票*/
-//	@Excel(name = "合同待开票", width = 15)
+    @Excel(name = "合同待开票", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class)
-//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "合同待开票")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "合同待开票")
     @ApiModelProperty(value = "合同待开票")
     private java.math.BigDecimal htdkp;
     /**任务编号*/
@@ -190,17 +191,17 @@ public class ComContractInfoExchangeNew implements Serializable {
     @ApiModelProperty(value = "发票类型1")
     private java.lang.String fptypeone;
     /**发票1金额*/
-//	@Excel(name = "发票1金额", width = 15)
+    @Excel(name = "发票1金额", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class)
-//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "发票1金额")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "发票1金额")
     @ApiModelProperty(value = "发票1金额")
     private java.math.BigDecimal fpjeone;
     /**1已开票额*/
-//	@Excel(name = "1已开票额", width = 15)
+    @Excel(name = "1已开票额", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class)
-//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "1已开票额")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "1已开票额")
     @ApiModelProperty(value = "1已开票额")
     private java.math.BigDecimal ykpeone;
     /**发票类型2*/
@@ -209,17 +210,17 @@ public class ComContractInfoExchangeNew implements Serializable {
     @ApiModelProperty(value = "发票类型2")
     private java.lang.String fptypetwo;
     /**发票2金额*/
-//	@Excel(name = "发票2金额", width = 15)
+    @Excel(name = "发票2金额", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class)
-//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "发票2金额")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "发票2金额")
     @ApiModelProperty(value = "发票2金额")
     private java.math.BigDecimal fpjetwo;
     /**2已开票额*/
-//	@Excel(name = "2已开票额", width = 15)
+    @Excel(name = "2已开票额", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class)
-//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "2已开票额")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "2已开票额")
     @ApiModelProperty(value = "2已开票额")
     private java.math.BigDecimal ykpetwo;
     /**合同主管部门*/
@@ -283,17 +284,17 @@ public class ComContractInfoExchangeNew implements Serializable {
     @ApiModelProperty(value = "部门")
     private java.lang.String bm;
     /**收款总金额*/
-//	@Excel(name = "收款总金额", width = 15)
+    @Excel(name = "收款总金额", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class, index = 14)
-//    @ExcelProperty(value = "收款总金额", converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "收款总金额")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "收款总金额")
     @ApiModelProperty(value = "收款总金额")
     private java.math.BigDecimal skzje;
     /** 任务收款金额 */
-//	@Excel(name = " 任务收款金额 ", width = 15)
+    @Excel(name = " 任务收款金额 ", width = 15)
 //    @ExcelProperty(converter = BigDecimalStringConverter.class, index = 15)
-//    @ExcelProperty(value = "任务收款金额", converter = BigDecimalNumberConverter.class)
-    @ExcelProperty(value = "任务收款金额")
+    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+//    @ExcelProperty(value = "任务收款金额")
     @ApiModelProperty(value = " 任务收款金额 ")
     private java.math.BigDecimal rwskje;
     /**到款日期/汇票到期日期*/

+ 25 - 0
module_kzks/src/main/java/org/jeecg/modules/comContractInfoExchangeNew/mapper/ComContractInfoExchangeNewMapper.java

@@ -7,6 +7,7 @@ import java.util.List;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate;
 import org.jeecg.modules.Index.entity.pojo.ContractAmount;
 import org.jeecg.modules.Index.entity.pojo.ReceivedByDate;
 import org.jeecg.modules.comContractInfoExchangeNew.entity.ComContractInfoExchangeNew;
@@ -79,5 +80,29 @@ public interface ComContractInfoExchangeNewMapper extends BaseMapper<ComContract
      */
     List<ComContractInfoExchangeNewYSKVO> getCrmYskDetail(@Param("taskno") String taskno);
 
+    List<IndexKpiCompletByDate> getXdbmHte(@Param("date") String date, @Param("departList") List<String> departList);
 
+    List<IndexKpiCompletByDate> getXdbmYsk(@Param("date") String date,@Param("departList") List<String> departList);
+
+    List<ReceivedByDate> getReceivedAllByYear2(@Param("startString") String startString,@Param("endString") String endString);
+
+    List<ReceivedByDate> getReceivedByYear21(@Param("departNames") List<String> departNames, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+
+    List<ReceivedByDate> getReceivedAllByYMonth1(@Param("startString") String startString,@Param("endString") String endString);
+
+    List<ReceivedByDate> getReceivedByYMonth21(@Param("departNames") List<String> departNames, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+
+    List<ContractAmount> getContractAmountandNumByYearIfBoss1(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+
+    List<ContractAmount> getContractAmountandNumByYear1(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+
+    List<ContractAmount> getContractAmountandNumByMonthIfBoss1(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+    List<ContractAmount> getContractAmountandNumByMonth1(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+    BigDecimal getHteByTaskno(String taskno);
+
+    BigDecimal getYskByTaskno(String taskno);
 }

+ 164 - 0
module_kzks/src/main/java/org/jeecg/modules/comContractInfoExchangeNew/mapper/xml/ComContractInfoExchangeNewMapper.xml

@@ -204,4 +204,168 @@
         from com_contract_info_exchange_new
         where sjly = 40 and DATE_FORMAT(`dkhpdqrq`,'%Y') > '2015' and rwbh = #{taskno}
     </select>
+
+    <!-- 下达部门 合同额 -->
+    <select id="getXdbmHte" resultType="org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate">
+        SELECT
+        k.jycs as depart,
+        SUM( c.rwyingsk ) as contractAmount
+        FROM
+        com_contract_info_exchange_new c
+        INNER JOIN
+        (
+        SELECT taskno, jycs FROM ky_task_info_new WHERE jycs IN
+        <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        ) k ON c.rwbh = k.taskno
+        WHERE
+        c.sjly = '20'
+        AND qsrq LIKE CONCAT(#{date},'%')
+        GROUP BY
+        k.jycs
+    </select>
+
+    <!-- 下达部门 已收款 -->
+    <select id="getXdbmYsk" resultType="org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate">
+        SELECT
+        k.jycs as depart,
+        SUM( c.rwskje ) as received
+        FROM
+        com_contract_info_exchange_new c
+        INNER JOIN
+        (
+        SELECT taskno, jycs FROM ky_task_info_new WHERE jycs IN
+        <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        ) k ON c.rwbh = k.taskno
+        WHERE
+        c.sjly = '40'
+        AND dkhpdqrq LIKE  CONCAT(#{date},'%')
+        GROUP BY
+        k.jycs
+    </select>
+
+    <select id="getReceivedAllByYear2" resultType="org.jeecg.modules.Index.entity.pojo.ReceivedByDate">
+        SELECT
+            year(a.dkhpdqrq) as date,
+            sum( a.rwskje ) AS received
+        FROM
+            ( SELECT dkhpdqrq, rwskje FROM com_contract_info_exchange_new WHERE sjly = 40 ) a
+        WHERE
+            a.dkhpdqrq >= concat(#{startString},'-01-01 00:00:00') and a.dkhpdqrq &lt; #{endString}
+        group by year(a.dkhpdqrq)
+    </select>
+
+    <select id="getReceivedAllByYMonth1" resultType="org.jeecg.modules.Index.entity.pojo.ReceivedByDate">
+        SELECT
+            CONCAT(year(a.dkhpdqrq), '-', LPAD(month(a.dkhpdqrq), 2, '0')) as date,
+        sum( a.rwskje ) AS received
+        FROM
+            ( SELECT dkhpdqrq, rwskje FROM com_contract_info_exchange_new WHERE sjly = 40 ) a
+        WHERE
+            a.dkhpdqrq >= concat(#{startString},'-01 00:00:00') and a.dkhpdqrq &lt; #{endString}
+        group by year(a.dkhpdqrq), month(a.dkhpdqrq)
+    </select>
+
+    <select id="getReceivedByYear21" resultType="org.jeecg.modules.Index.entity.pojo.ReceivedByDate">
+        select year(a.dkhpdqrq) as date,sum(a.rwskje) as received from com_contract_info_exchange_new a
+        where a.dkhpdqrq >= concat(#{beginDate},'-01-01 00:00:00') and a.dkhpdqrq &lt; #{endDate}
+        and (a.rwbh in(select taskno from ky_task_info_new where zrbm in (
+        <foreach item='item' index='index' collection='departNames' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        ) or jycs in (
+        <foreach item='item' index='index' collection='departNames' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        )))
+        and sjly = 40
+        group by year(a.dkhpdqrq)
+    </select>
+
+    <select id="getReceivedByYMonth21" resultType="org.jeecg.modules.Index.entity.pojo.ReceivedByDate">
+        select CONCAT(year(a.dkhpdqrq), "-", LPAD(month(a.dkhpdqrq), 2, "0")) as date,sum(a.rwskje) as received
+        from com_contract_info_exchange_new a
+        where a.dkhpdqrq >= concat(#{beginDate},'-01 00:00:00') and a.dkhpdqrq &lt; #{endDate}
+        and (a.rwbh in(select taskno from ky_task_info_new where zrbm in (
+        <foreach item='item' index='index' collection='departNames' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        ) or jycs in (
+        <foreach item='item' index='index' collection='departNames' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        )))
+        and sjly = 40
+        group by year(a.dkhpdqrq), month(a.dkhpdqrq)
+    </select>
+
+    <select id="getContractAmountandNumByYearIfBoss1" resultType="org.jeecg.modules.Index.entity.pojo.ContractAmount">
+        SELECT
+            sum(htfpe) AS contractAmount,
+            count(DISTINCT (htbh)) AS contractTotal,
+            YEAR (qsrq) AS Date
+        from (select rwbh,rwyingsk as htfpe,qsrq,htbh from com_contract_info_exchange_new where sjly = 20) a
+        where a.qsrq <![CDATA[ >= ]]> #{beginDate}
+          and a.qsrq &lt; #{endDate}
+        GROUP BY YEAR(qsrq)
+    </select>
+
+    <select id="getContractAmountandNumByYear1" resultType="org.jeecg.modules.Index.entity.pojo.ContractAmount">
+        SELECT
+        sum(htfpe) AS contractAmount,
+        count(
+        DISTINCT (htbh)) AS contractTotal,
+        YEAR (qsrq) AS Date
+        from (select rwbh,rwyingsk as htfpe,qsrq,htbh from com_contract_info_exchange_new where sjly = 20) a
+        where a.qsrq <![CDATA[ >= ]]> #{beginDate}
+        and a.qsrq &lt; #{endDate}
+        and a.rwbh in
+        <foreach item='item' index='index' collection='tasknoList' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        GROUP BY YEAR(qsrq)
+    </select>
+
+    <select id="getContractAmountandNumByMonthIfBoss1" resultType="org.jeecg.modules.Index.entity.pojo.ContractAmount">
+        SELECT
+            sum(htfpe) AS contractAmount,
+            count(DISTINCT (htbh)) AS contractTotal,
+            CONCAT(YEAR (qsrq),"-",LPAD( MONTH (qsrq), 2, "0" )) AS date
+        from (select rwbh,rwyingsk as htfpe,qsrq,htbh from com_contract_info_exchange_new where sjly = 20) a
+        where a.qsrq <![CDATA[ >= ]]> #{beginDate}
+          and a.qsrq &lt; #{endDate}
+        GROUP BY YEAR(qsrq),MONTH (qsrq)
+    </select>
+
+    <select id="getContractAmountandNumByMonth1" resultType="org.jeecg.modules.Index.entity.pojo.ContractAmount">
+        SELECT
+        sum(htfpe) AS contractAmount,
+        count(
+        DISTINCT (htbh)) AS contractTotal,
+        CONCAT(YEAR (qsrq),"-",LPAD( MONTH (qsrq), 2, "0" )) AS date
+        from (select rwbh,rwyingsk as htfpe,qsrq,htbh from com_contract_info_exchange_new where sjly = 20) a
+        where a.qsrq <![CDATA[ >= ]]> #{beginDate}
+        and a.qsrq &lt; #{endDate}
+        and a.rwbh in
+        <foreach item='item' index='index' collection='tasknoList' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        GROUP BY YEAR(qsrq),MONTH (qsrq)
+    </select>
+
+    <select id="getHteByTaskno" resultType="java.math.BigDecimal">
+        select IFNULL(sum(rwyingsk),0)
+        from com_contract_info_exchange_new
+        where sjly = 20 and rwbh = #{taskno}
+    </select>
+
+    <select id="getYskByTaskno" resultType="java.math.BigDecimal">
+        select IFNULL(sum(rwskje),0)
+        from com_contract_info_exchange_new
+        where  sjly = 40 and  rwbh = #{taskno}
+    </select>
+
 </mapper>

+ 4 - 0
module_kzks/src/main/java/org/jeecg/modules/comContractInfoExchangeNew/service/IComContractInfoExchangeNewService.java

@@ -9,6 +9,7 @@ import org.jeecg.modules.xmcbDetail.vo.ComContractInfoExchangeHTEVO;
 import org.jeecg.modules.xmcbDetail.vo.ComContractInfoExchangeYSKVO;
 import org.springframework.web.servlet.ModelAndView;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 
@@ -55,4 +56,7 @@ public interface IComContractInfoExchangeNewService extends IService<ComContract
     */
     public ModelAndView exportYskDetail(List<ComContractInfoExchangeNewYSKVO>  exportList, Class<ComContractInfoExchangeNewYSKVO> clazz, String title);
 
+    BigDecimal getHteByTaskno(String taskno);
+
+    BigDecimal getYskByTaskno(String taskno);
 }

+ 18 - 0
module_kzks/src/main/java/org/jeecg/modules/comContractInfoExchangeNew/service/impl/ComContractInfoExchangeNewServiceImpl.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.comContractInfoExchangeNew.service.impl;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.ExcelReader;
 import com.alibaba.excel.read.metadata.ReadSheet;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
@@ -25,6 +26,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.web.servlet.ModelAndView;
 
 import java.io.File;
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -46,6 +48,12 @@ public class ComContractInfoExchangeNewServiceImpl extends ServiceImpl<ComContra
     /* sjly:数据来源:20合同导入 40收款导入 */
     @Override
     public Result<?> importExcel1(String strUrl, Class<ComContractInfoExchangeNew> clazz, Integer sjly){
+
+        // 清除合同/收款数据
+        QueryWrapper<ComContractInfoExchangeNew> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("sjly",sjly);
+        this.remove(queryWrapper);
+
         long startTime = System.currentTimeMillis();
 //        Object data = new Object();
         ExcelReader excelReader = EasyExcel.read(new File(strUrl), clazz, new ComContractInfoExchangeNewListener(this, sjly)).build();
@@ -102,4 +110,14 @@ public class ComContractInfoExchangeNewServiceImpl extends ServiceImpl<ComContra
         mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
         return mv;
     }
+
+    @Override
+    public BigDecimal getHteByTaskno(String taskno) {
+        return exchangeNewMapper.getHteByTaskno(taskno);
+    }
+
+    @Override
+    public BigDecimal getYskByTaskno(String taskno) {
+        return exchangeNewMapper.getYskByTaskno(taskno);
+    }
 }

+ 30 - 15
module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/entity/KpiProjectMonth.java

@@ -4,6 +4,10 @@ import java.io.Serializable;
 import java.io.UnsupportedEncodingException;
 import java.util.Date;
 import java.math.BigDecimal;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.converters.bigdecimal.BigDecimalNumberConverter;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -26,7 +30,7 @@ import lombok.experimental.Accessors;
  */
 @Data
 @TableName("kzks_kpi_project_month")
-@Accessors(chain = true)
+@Accessors(chain = false)
 @EqualsAndHashCode(callSuper = false)
 @ApiModel(value="kzks_kpi_project_month对象", description="每月月底考核项目进度表")
 public class KpiProjectMonth implements Serializable {
@@ -34,61 +38,72 @@ public class KpiProjectMonth implements Serializable {
 
 	/**主键*/
 	@TableId(type = IdType.ASSIGN_ID)
+    @ExcelIgnore
     @ApiModelProperty(value = "主键")
     private java.lang.String id;
 	/**创建人*/
+    @ExcelIgnore
     @ApiModelProperty(value = "创建人")
     private java.lang.String createBy;
 	/**创建日期*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @ExcelIgnore
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "创建日期")
     private java.util.Date createTime;
 	/**更新人*/
+    @ExcelIgnore
     @ApiModelProperty(value = "更新人")
     private java.lang.String updateBy;
 	/**更新日期*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @ExcelIgnore
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "更新日期")
     private java.util.Date updateTime;
 	/**所属部门*/
+    @ExcelIgnore
     @ApiModelProperty(value = "所属部门")
     private java.lang.String sysOrgCode;
 	/**任务号/来自科研任务*/
-	@Excel(name = "任务号/来自科研任务", width = 15)
+    @Excel(name = "任务编号", width = 15)
     @ApiModelProperty(value = "任务号/来自科研任务")
     private java.lang.String taskno;
-	/**项目进度/来自科研任务*/
-	@Excel(name = "项目进度/来自科研任务", width = 15)
-    @ApiModelProperty(value = "项目进度/来自科研任务")
-    private java.math.BigDecimal processpercent;
 	/**责任部门/来自科研任务*/
-	@Excel(name = "责任部门/来自科研任务", width = 15)
+    @Excel(name = "责任部门", width = 15)
     @ApiModelProperty(value = "责任部门/来自科研任务")
     private java.lang.String zrbm;
 	/**下达部门/来自科研任务*/
-	@Excel(name = "下达部门/来自科研任务", width = 15)
+    @Excel(name = "下达部门", width = 15)
     @ApiModelProperty(value = "下达部门/来自科研任务")
     private java.lang.String jycs;
+    /**项目进度/来自科研任务*/
+    @Excel(name = "项目进度", width = 15)
+    //@ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ApiModelProperty(value = "项目进度/来自科研任务")
+    private java.math.BigDecimal processpercent;
 	/**合同额/来自收款合同的合同分配额 */
-	@Excel(name = "合同额/来自收款合同的合同分配额 ", width = 15)
+    @ExcelIgnore
     @ApiModelProperty(value = "合同额/来自收款合同的合同分配额 ")
     private java.math.BigDecimal contractfpe;
+    /**预估价/来自科研任务*/
+    @Excel(name = "任务下达步骤填写的预估价",width = 15)
+    @ApiModelProperty(value = "预估价/来自科研任务 ")
+    private java.math.BigDecimal estimationcoat;
 	/**已收款/ 来自合同收款详细的任务收款额*/
-	@Excel(name = "已收款/ 来自合同收款详细的任务收款额", width = 15)
+    @ExcelIgnore
     @ApiModelProperty(value = "已收款/ 来自合同收款详细的任务收款额")
     private java.math.BigDecimal taskmoney;
 	/**当前任务进度的年份*/
-	@Excel(name = "当前任务进度的年份", width = 15)
+    @ExcelIgnore
     @ApiModelProperty(value = "当前任务进度的年份")
     private java.lang.Integer year;
 	/**当前任务进度的月份*/
-	@Excel(name = "当前任务进度的月份", width = 15)
+    @ExcelIgnore
     @ApiModelProperty(value = "当前任务进度的月份")
     private java.lang.Integer month;
 	/**当前任务进度的年月*/
-	@Excel(name = "当前任务进度的年月", width = 15)
+    @ExcelIgnore
     @ApiModelProperty(value = "当前任务进度的年月")
     private java.lang.String ym;
 }

+ 140 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/listener/KpiProjectMonthListener.java

@@ -0,0 +1,140 @@
+package org.jeecg.modules.kpiProjectMonth.listener;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.modules.comContractInfoExchangeNew.service.IComContractInfoExchangeNewService;
+import org.jeecg.modules.kpiProjectMonth.entity.KpiProjectMonth;
+import org.jeecg.modules.kpiProjectMonth.service.IKpiProjectMonthService;
+import org.jeecg.modules.wzOutboundOrderBNew.entity.WzOutboundOrderBNew;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author dzc
+ * @date 2024/5/11 8:56
+ * @package org.jeecg.modules.kpiProjectMonth.listener
+ * @project yecai_server
+ * @des
+ */
+@Slf4j
+public class KpiProjectMonthListener extends AnalysisEventListener<KpiProjectMonth> {
+
+    private static final List<KpiProjectMonth> kpiMonthList = new CopyOnWriteArrayList<>();
+
+    private final IKpiProjectMonthService kpiProjectMonthService;
+    private final IComContractInfoExchangeNewService exchangeNewService;
+    private Integer jdYear;      // 当前导入的任务进度的年份
+    private Integer jdMonth;     // 当前导入的任务进度的月份
+    private String jdYearMonth;  // 当前导入的任务进度的年月
+
+    private static final int BIG_SIZE = 3000;  // 批量添加最大数量
+
+
+    public KpiProjectMonthListener(IKpiProjectMonthService kpiProjectMonthService, IComContractInfoExchangeNewService exchangeNewService, Integer jdYear, Integer jdMonth, String jdYearMonth) {
+        this.kpiProjectMonthService = kpiProjectMonthService;
+        this.exchangeNewService = exchangeNewService;
+        this.jdYear = jdYear;
+        this.jdMonth = jdMonth;
+        this.jdYearMonth = jdYearMonth;
+    }
+
+    @Override
+    public void invoke(KpiProjectMonth kpiProjectMonth, AnalysisContext analysisContext) {
+        kpiProjectMonth.setYear(jdYear);
+        kpiProjectMonth.setMonth(jdMonth);
+        kpiProjectMonth.setYm(jdYearMonth);
+        kpiProjectMonth.setEstimationcoat(kpiProjectMonth.getEstimationcoat().multiply(BigDecimal.valueOf(10000)));
+        kpiProjectMonth.setContractfpe(exchangeNewService.getHteByTaskno(kpiProjectMonth.getTaskno()));
+        kpiProjectMonth.setTaskmoney(exchangeNewService.getYskByTaskno(kpiProjectMonth.getTaskno()));
+        kpiMonthList.add(kpiProjectMonth);
+        if (kpiMonthList.size() == BIG_SIZE){
+            batchSaveInfo(kpiMonthList);
+        }
+    }
+
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+        batchSaveInfo(kpiMonthList);
+    }
+
+    private void batchSaveInfo(List<KpiProjectMonth> kpiMonthList) {
+        ExecutorService threadPoolExecutors = Executors.newFixedThreadPool(8);
+        try {
+            log.info("{}条数据,开始存储数据库!", kpiMonthList.size());
+            int sonListSize = kpiMonthList.size() / 8;  // 计算将wzList分成8份之后每个子集合的大小
+
+            List<List<KpiProjectMonth>> sonList = new ArrayList<>(); // 用于存放 子集合 的list
+            for (int i = 0; i < 8; i++) {
+                int startIndex = i * sonListSize;
+                int endIndex = (i + 1) * sonListSize;
+                if (i == 7){  // 避免遗漏数据,最后一个集合取全部数据
+                    endIndex = kpiMonthList.size();
+                }
+                // 根据起始索引、终止索引进行截取
+                List<KpiProjectMonth> list = kpiMonthList.subList(startIndex, endIndex);
+                sonList.add(list);
+            }
+            // 八个线程同步保存数据
+            if (!sonList.isEmpty()){
+                if (!sonList.get(0).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        kpiProjectMonthService.saveBatch(sonList.get(0));
+                    });
+                }
+                if (!sonList.get(1).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        kpiProjectMonthService.saveBatch(sonList.get(1));
+                    });
+                }
+                if (!sonList.get(2).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        kpiProjectMonthService.saveBatch(sonList.get(2));
+                    });
+                }
+                if (!sonList.get(3).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        kpiProjectMonthService.saveBatch(sonList.get(3));
+                    });
+                }
+                if (!sonList.get(4).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        kpiProjectMonthService.saveBatch(sonList.get(4));
+                    });
+                }
+                if (!sonList.get(5).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        kpiProjectMonthService.saveBatch(sonList.get(5));
+                    });
+                }
+                if (!sonList.get(6).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        kpiProjectMonthService.saveBatch(sonList.get(6));
+                    });
+                }
+                if (!sonList.get(7).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        kpiProjectMonthService.saveBatch(sonList.get(7));
+                    });
+                }
+            }
+            threadPoolExecutors.shutdown();
+            boolean b = threadPoolExecutors.awaitTermination(5, TimeUnit.HOURS);
+            log.info("数据成功入库");
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        } finally {
+            threadPoolExecutors.shutdown();
+            kpiMonthList.clear();
+        }
+    }
+
+}

+ 3 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/service/IKpiProjectMonthService.java

@@ -1,7 +1,9 @@
 package org.jeecg.modules.kpiProjectMonth.service;
 
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.kpiProjectMonth.entity.KpiProjectMonth;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.kyTaskInfoNew.entity.KyTaskInfoNew;
 
 /**
  * @Description: 每月月底考核项目进度表
@@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IKpiProjectMonthService extends IService<KpiProjectMonth> {
 
+    Result<?> importExcel1(String strUrl, Class<KpiProjectMonth> clazz);
 }

+ 50 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/service/impl/KpiProjectMonthServiceImpl.java

@@ -1,13 +1,27 @@
 package org.jeecg.modules.kpiProjectMonth.service.impl;
 
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelReader;
+import com.alibaba.excel.read.metadata.ReadSheet;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.comContractInfoExchangeNew.service.IComContractInfoExchangeNewService;
 import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
 import org.jeecg.modules.kpiProjectMonth.entity.KpiProjectMonth;
+import org.jeecg.modules.kpiProjectMonth.listener.KpiProjectMonthListener;
 import org.jeecg.modules.kpiProjectMonth.mapper.KpiProjectMonthMapper;
 import org.jeecg.modules.kpiProjectMonth.service.IKpiProjectMonthService;
+import org.jeecg.modules.kyTaskInfoNew.entity.KyTaskInfoNew;
+import org.jeecg.modules.kyTaskInfoNew.listener.KyTaskInfoNewListener;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.io.File;
+import java.time.LocalDate;
+
 /**
  * @Description: 每月月底考核项目进度表
  * @Author: jeecg-boot
@@ -15,6 +29,42 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @Version: V1.0
  */
 @Service
+@Slf4j
 public class KpiProjectMonthServiceImpl extends ServiceImpl<KpiProjectMonthMapper, KpiProjectMonth> implements IKpiProjectMonthService {
 
+    @Autowired
+    @SuppressWarnings("all")
+    private IComContractInfoExchangeNewService exchangeNewService;
+
+    @Override
+    public Result<?> importExcel1(String strUrl, Class<KpiProjectMonth> clazz) {
+        int jdYear = 0;      // 当前导入的任务进度的年份
+        int jdMonth = 0;     // 当前导入的任务进度的月份
+        // 获取当前时间
+        LocalDate curronDate = LocalDate.now();
+        // 如果当前导入的时间为 每年的1月 则记录的进度为上一年的12月
+        if (curronDate.getMonthValue() == 1) {
+            jdYear = curronDate.getYear()-1;
+            jdMonth = 12;
+        }else {
+            jdYear = curronDate.getYear();
+            jdMonth = curronDate.getMonthValue()-1;
+        }
+
+        // 删除数据库中该年月的进度
+        QueryWrapper<KpiProjectMonth> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("ym",String.format("%d-%d",jdYear,jdMonth));
+        this.remove(queryWrapper);
+
+        long startTime = System.currentTimeMillis();
+        ExcelReader excelReader = EasyExcel.read(new File(strUrl), clazz, new KpiProjectMonthListener(this,exchangeNewService,jdYear,jdMonth,String.format("%d-%d", jdYear,jdMonth))).build();
+        ReadSheet readSheet = EasyExcel.readSheet(0).build();
+        excelReader.read(readSheet);
+        //这里千万别忘记关闭,读的时候会创建临时文件,到时磁盘会崩的
+        excelReader.finish();
+        long endTime = System.currentTimeMillis();
+        log.info("导入每月进度数据花费时间:{}毫秒 | {}分钟", (endTime - startTime), ((endTime - startTime) / 1000 / 60));
+
+        return Result.ok();
+    }
 }

+ 164 - 167
module_kzks/src/main/java/org/jeecg/modules/kyTaskInfoNew/entity/KyTaskInfoNew.java

@@ -37,321 +37,321 @@ import lombok.experimental.Accessors;
 public class KyTaskInfoNew implements Serializable {
     private static final long serialVersionUID = 1L;
 
-	/**key*/
-	@TableId(type = IdType.AUTO)
-	@ExcelIgnore
+    /**key*/
+    @TableId(type = IdType.AUTO)
+    @ExcelIgnore
     @ApiModelProperty(value = "key")
     private Integer key;
-	/**ID*/
-	@Excel(name = "ID", width = 15)
+    /**ID*/
+    @Excel(name = "ID", width = 15)
     @ApiModelProperty(value = "ID")
     private String taskid;
-	/**主任务号*/
-	@Excel(name = "主任务号", width = 15)
+    /**主任务号*/
+    @Excel(name = "主任务号", width = 15)
     @ApiModelProperty(value = "主任务号")
     private String ztaskno;
-	/**任务号*/
-	@Excel(name = "任务号", width = 15)
+    /**任务号*/
+    @Excel(name = "任务号", width = 15)
     @ApiModelProperty(value = "任务号")
     private String taskno;
-	/**产品规格*/
-	@Excel(name = "产品规格", width = 15)
+    /**产品规格*/
+    @Excel(name = "产品规格", width = 15)
     @ApiModelProperty(value = "产品规格")
     private String cpgg;
-	/**任务名称*/
-	@Excel(name = "任务名称", width = 15)
+    /**任务名称*/
+    @Excel(name = "任务名称", width = 15)
     @ApiModelProperty(value = "任务名称")
     private String taskname;
-	/**任务类型*/
-	@Excel(name = "任务类型", width = 15)
+    /**任务类型*/
+    @Excel(name = "任务类型", width = 15)
     @ApiModelProperty(value = "任务类型")
     private String tasktype;
-	/**任务细分*/
-	@Excel(name = "任务细分", width = 15)
+    /**任务细分*/
+    @Excel(name = "任务细分", width = 15)
     @ApiModelProperty(value = "任务细分")
     private String taskxf;
-	/**产品类别*/
-	@Excel(name = "产品类别", width = 15)
+    /**产品类别*/
+    @Excel(name = "产品类别", width = 15)
     @ApiModelProperty(value = "产品类别")
     private String cplb;
-	/**型号分类*/
-	@Excel(name = "型号分类", width = 15)
+    /**型号分类*/
+    @Excel(name = "型号分类", width = 15)
     @ApiModelProperty(value = "型号分类")
     private String xhfl;
-	/**分系统*/
-	@Excel(name = "分系统", width = 15)
+    /**分系统*/
+    @Excel(name = "分系统", width = 15)
     @ApiModelProperty(value = "分系统")
     private String fxt;
-	/**研制数量*/
-	@ExcelProperty(value = "数量")
+    /**研制数量*/
+    @ExcelProperty(value = "数量")
     @ApiModelProperty(value = "研制数量")
     private Integer yzsl;
-	/**研制阶段*/
-	@Excel(name = "研制阶段", width = 15)
+    /**研制阶段*/
+    @Excel(name = "研制阶段", width = 15)
     @ApiModelProperty(value = "研制阶段")
     private String yzjdname;
-	/**责任部门*/
-	@Excel(name = "责任部门", width = 15)
+    /**责任部门*/
+    @Excel(name = "责任部门", width = 15)
     @ApiModelProperty(value = "责任部门")
     private String zrbm;
-	/**任务下达时间*/
-	//@Excel(name = "任务下达时间", width = 15, format = "yyyy-MM-dd")
-	@ExcelProperty(value = "任务下达时间", converter = DateStringConverter.class)
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    /**任务下达时间*/
+    //@Excel(name = "任务下达时间", width = 15, format = "yyyy-MM-dd")
+    @ExcelProperty(value = "任务下达时间")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "任务下达时间")
     private Date lrsj;
-	/**进度要求*/
-	@Excel(name = "进度要求", width = 15)
+    /**进度要求*/
+    @Excel(name = "进度要求", width = 15)
     @ApiModelProperty(value = "进度要求")
     private String jdyq;
-	/**提出单位*/
-	@Excel(name = "提出单位", width = 15)
+    /**提出单位*/
+    @Excel(name = "提出单位", width = 15)
     @ApiModelProperty(value = "提出单位")
     private String tcdw;
-	/**提出单位简称*/
-	@Excel(name = "提出单位简称", width = 15)
+    /**提出单位简称*/
+    @Excel(name = "提出单位简称", width = 15)
     @ApiModelProperty(value = "提出单位简称")
     private String tcdwjc;
-	/**科研任务负责人*/
-	@Excel(name = "科研任务负责人", width = 15)
+    /**科研任务负责人*/
+    @Excel(name = "科研任务负责人", width = 15)
     @ApiModelProperty(value = "科研任务负责人")
     private String xhzzrname;
-	/**产能调度*/
-	@Excel(name = "产能调度", width = 15)
+    /**产能调度*/
+    @Excel(name = "产能调度", width = 15)
     @ApiModelProperty(value = "产能调度")
     private String cndd;
-	/**产保助理*/
-	@Excel(name = "产保助理", width = 15)
+    /**产保助理*/
+    @Excel(name = "产保助理", width = 15)
     @ApiModelProperty(value = "产保助理")
     private String cbzl;
-	/**物资计划*/
-	@Excel(name = "物资计划", width = 15)
+    /**物资计划*/
+    @Excel(name = "物资计划", width = 15)
     @ApiModelProperty(value = "物资计划")
     private String wzjh;
-	/**物资按此任务号的元器件出库单采购*/
-	@Excel(name = "物资按此任务号的元器件出库单采购", width = 15)
+    /**物资按此任务号的元器件出库单采购*/
+    @Excel(name = "物资按此任务号的元器件出库单采购", width = 15)
     @ApiModelProperty(value = "物资按此任务号的元器件出库单采购")
     private String wzyqjckdcg;
-	/**主管设计师*/
-	@Excel(name = "主管设计师", width = 15)
+    /**主管设计师*/
+    @Excel(name = "主管设计师", width = 15)
     @ApiModelProperty(value = "主管设计师")
     private String ywfzrname;
-	/**发票类型*/
-	@Excel(name = "发票类型", width = 15)
+    /**发票类型*/
+    @Excel(name = "发票类型", width = 15)
     @ApiModelProperty(value = "发票类型")
     private String fplx;
-	/**是否决算*/
-	@Excel(name = "是否决算", width = 15)
+    /**是否决算*/
+    @Excel(name = "是否决算", width = 15)
     @ApiModelProperty(value = "是否决算")
     private String sfjs;
-	/**是否报销*/
-	@Excel(name = "是否报销", width = 15)
+    /**是否报销*/
+    @Excel(name = "是否报销", width = 15)
     @ApiModelProperty(value = "是否报销")
     private String sfbx;
-	/**报销任务号*/
-	@Excel(name = "报销任务号", width = 15)
+    /**报销任务号*/
+    @Excel(name = "报销任务号", width = 15)
     @ApiModelProperty(value = "报销任务号")
     private String bxtaskno;
-	/**合同状态*/
-	@Excel(name = "合同状态", width = 15)
+    /**合同状态*/
+    @Excel(name = "合同状态", width = 15)
     @ApiModelProperty(value = "合同状态")
     private String htzt;
-	/**成本预分(万)*/
-	@Excel(name = "成本预分(万)", width = 15)
+    /**成本预分(万)*/
+    @Excel(name = "成本预分(万)", width = 15)
     @ApiModelProperty(value = "成本预分(万)")
     private String cbyf;
-	/**成本归集(万)+工时统计*/
-	@Excel(name = "成本归集(万)+工时统计", width = 15)
+    /**成本归集(万)+工时统计*/
+    @Excel(name = "成本归集(万)+工时统计", width = 15)
     @ApiModelProperty(value = "成本归集(万)+工时统计")
     private String cbgjgstj;
-	/**业务员*/
-	@Excel(name = "业务员", width = 15)
+    /**业务员*/
+    @Excel(name = "业务员", width = 15)
     @ApiModelProperty(value = "业务员")
     private String businessmanname;
-	/**审计审价*/
-	@Excel(name = "审计审价", width = 15)
+    /**审计审价*/
+    @Excel(name = "审计审价", width = 15)
     @ApiModelProperty(value = "审计审价")
     private String auditprice;
-	/**备注*/
-	@Excel(name = "备注", width = 15)
+    /**备注*/
+    @Excel(name = "备注", width = 15)
     @ApiModelProperty(value = "备注")
     private String bz;
-	/**状态*/
-	@Excel(name = "状态", width = 15)
+    /**状态*/
+    @Excel(name = "状态", width = 15)
     @ApiModelProperty(value = "状态")
     private String status;
-	/**任务分类*/
-	@Excel(name = "任务分类", width = 15)
+    /**任务分类*/
+    @Excel(name = "任务分类", width = 15)
     @ApiModelProperty(value = "任务分类")
     private String taskfl;
-	/**当前进行的任务*/
-	@Excel(name = "当前进行的任务", width = 15)
+    /**当前进行的任务*/
+    @Excel(name = "当前进行的任务", width = 15)
     @ApiModelProperty(value = "当前进行的任务")
     private String dqjxtaskno;
-	/**密级*/
-	@Excel(name = "密级", width = 15)
+    /**密级*/
+    @Excel(name = "密级", width = 15)
     @ApiModelProperty(value = "密级")
     private String mj;
-	/**完成形式*/
-	@Excel(name = "完成形式", width = 15)
+    /**完成形式*/
+    @Excel(name = "完成形式", width = 15)
     @ApiModelProperty(value = "完成形式")
     private String wcxs;
-	/**业务板块*/
-	@Excel(name = "业务板块", width = 15)
+    /**业务板块*/
+    @Excel(name = "业务板块", width = 15)
     @ApiModelProperty(value = "业务板块")
     private String ywbk;
-	/**下达部门*/
-	@Excel(name = "下达部门", width = 15)
+    /**下达部门*/
+    @Excel(name = "下达部门", width = 15)
     @ApiModelProperty(value = "下达部门")
     private String jycs;
-	/**经费来源*/
-	@Excel(name = "经费来源", width = 15)
+    /**经费来源*/
+    @Excel(name = "经费来源", width = 15)
     @ApiModelProperty(value = "经费来源")
     private String jfly;
-	/**任务领域*/
-	@Excel(name = "任务领域", width = 15)
+    /**任务领域*/
+    @Excel(name = "任务领域", width = 15)
     @ApiModelProperty(value = "任务领域")
     private String rwly;
-	/**是否参与联试*/
-	@Excel(name = "是否参与联试", width = 15)
+    /**是否参与联试*/
+    @Excel(name = "是否参与联试", width = 15)
     @ApiModelProperty(value = "是否参与联试")
     private String ifcyls;
-	/**联试抓总部门*/
-	@Excel(name = "联试抓总部门", width = 15)
+    /**联试抓总部门*/
+    @Excel(name = "联试抓总部门", width = 15)
     @ApiModelProperty(value = "联试抓总部门")
     private String lszzbm;
-	/**横向纵向*/
-	@Excel(name = "横向纵向", width = 15)
+    /**横向纵向*/
+    @Excel(name = "横向纵向", width = 15)
     @ApiModelProperty(value = "横向纵向")
     private String hxzxname;
-	/**军检*/
-	@Excel(name = "军检", width = 15)
+    /**军检*/
+    @Excel(name = "军检", width = 15)
     @ApiModelProperty(value = "军检")
     private String jjname;
-	/**出所编号*/
-	@Excel(name = "出所编号", width = 15)
+    /**出所编号*/
+    @Excel(name = "出所编号", width = 15)
     @ApiModelProperty(value = "出所编号")
     private String csbh;
-	/**核算项目编号*/
-	@Excel(name = "核算项目编号", width = 15)
+    /**核算项目编号*/
+    @Excel(name = "核算项目编号", width = 15)
     @ApiModelProperty(value = "核算项目编号")
     private String hsxmbh;
-	/**收款项目编号*/
-	@Excel(name = "收款项目编号", width = 15)
+    /**收款项目编号*/
+    @Excel(name = "收款项目编号", width = 15)
     @ApiModelProperty(value = "收款项目编号")
     private String skxmbh;
-	/**确认完成时间*/
-	//@Excel(name = "确认完成时间", width = 15, format = "yyyy-MM-dd")
-	@ExcelProperty(value = "确认完成时间", converter = DateStringConverter.class)
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    /**确认完成时间*/
+    //@Excel(name = "确认完成时间", width = 15, format = "yyyy-MM-dd")
+    @ExcelProperty(value = "确认完成时间")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "确认完成时间")
     private Date sjwcsj;
-	/**完成说明*/
-	@Excel(name = "完成说明", width = 15)
+    /**完成说明*/
+    @Excel(name = "完成说明", width = 15)
     @ApiModelProperty(value = "完成说明")
     private String wcsm;
-	/**项目进度*/
-	@Excel(name = "项目进度", width = 15)
+    /**项目进度*/
+    @Excel(name = "项目进度", width = 15)
     @ApiModelProperty(value = "项目进度")
     private String processpercent;
-	/**进度节点*/
-	@Excel(name = "进度节点", width = 15)
+    /**进度节点*/
+    @Excel(name = "进度节点", width = 15)
     @ApiModelProperty(value = "进度节点")
     private String jdjd;
-	/**是否含例试件*/
-	@Excel(name = "是否含例试件", width = 15)
+    /**是否含例试件*/
+    @Excel(name = "是否含例试件", width = 15)
     @ApiModelProperty(value = "是否含例试件")
     private String ishlsj;
-	/**是否外贸项目*/
-	@Excel(name = "是否外贸项目", width = 15)
+    /**是否外贸项目*/
+    @Excel(name = "是否外贸项目", width = 15)
     @ApiModelProperty(value = "是否外贸项目")
     private String iswmxm;
-	/**有无软件*/
-	@Excel(name = "有无软件", width = 15)
+    /**有无软件*/
+    @Excel(name = "有无软件", width = 15)
     @ApiModelProperty(value = "有无软件")
     private String ishavesoftware;
-	/**软件类型*/
-	@Excel(name = "软件类型", width = 15)
+    /**软件类型*/
+    @Excel(name = "软件类型", width = 15)
     @ApiModelProperty(value = "软件类型")
     private String softwaretype;
-	/**需要第三方评测*/
-	@Excel(name = "需要第三方评测", width = 15)
+    /**需要第三方评测*/
+    @Excel(name = "需要第三方评测", width = 15)
     @ApiModelProperty(value = "需要第三方评测")
     private String xydsfcp;
-	/**评测方*/
-	@Excel(name = "评测方", width = 15)
+    /**评测方*/
+    @Excel(name = "评测方", width = 15)
     @ApiModelProperty(value = "评测方")
     private String reviewer;
-	/**合同签署*/
-	@Excel(name = "合同签署", width = 15)
+    /**合同签署*/
+    @Excel(name = "合同签署", width = 15)
     @ApiModelProperty(value = "合同签署")
     private String htqs;
-	/**付费*/
-	@Excel(name = "付费", width = 15)
+    /**付费*/
+    @Excel(name = "付费", width = 15)
     @ApiModelProperty(value = "付费")
     private String ff;
-	/**管控等级*/
-	@Excel(name = "管控等级", width = 15)
+    /**管控等级*/
+    @Excel(name = "管控等级", width = 15)
     @ApiModelProperty(value = "管控等级")
     private String gkdj;
-	/**需要质保*/
-	@Excel(name = "需要质保", width = 15)
+    /**需要质保*/
+    @Excel(name = "需要质保", width = 15)
     @ApiModelProperty(value = "需要质保")
     private String warranty;
-	/**质保依据*/
-	@Excel(name = "质保依据", width = 15)
+    /**质保依据*/
+    @Excel(name = "质保依据", width = 15)
     @ApiModelProperty(value = "质保依据")
     private String zbyj;
-	/**质保单位*/
-	@Excel(name = "质保单位", width = 15)
+    /**质保单位*/
+    @Excel(name = "质保单位", width = 15)
     @ApiModelProperty(value = "质保单位")
     private String warrantyunit;
-	/**应用部位*/
-	@Excel(name = "应用部位", width = 15)
+    /**应用部位*/
+    @Excel(name = "应用部位", width = 15)
     @ApiModelProperty(value = "应用部位")
     private String application;
-	/**成本限价*/
-	@Excel(name = "成本限价", width = 15)
+    /**成本限价*/
+    @Excel(name = "成本限价", width = 15)
     @ApiModelProperty(value = "成本限价")
     private String cbxj;
-	/**是否为已转入工程中心任务*/
-	@Excel(name = "是否为已转入工程中心任务", width = 15)
+    /**是否为已转入工程中心任务*/
+    @Excel(name = "是否为已转入工程中心任务", width = 15)
     @ApiModelProperty(value = "是否为已转入工程中心任务")
     private String iszrgczxrw;
-	/**基线编号*/
-	@Excel(name = "基线编号", width = 15)
+    /**基线编号*/
+    @Excel(name = "基线编号", width = 15)
     @ApiModelProperty(value = "基线编号")
     private String jxbh;
-	/**继承哪个任务有哪些更改*/
-	@Excel(name = "继承哪个任务有哪些更改", width = 15)
+    /**继承哪个任务有哪些更改*/
+    @Excel(name = "继承哪个任务有哪些更改", width = 15)
     @ApiModelProperty(value = "继承哪个任务有哪些更改")
     private String jcrwgg;
-	/**任务来源*/
-	@Excel(name = "任务来源", width = 15)
+    /**任务来源*/
+    @Excel(name = "任务来源", width = 15)
     @ApiModelProperty(value = "任务来源")
     private String tasknoly;
-	/**批产任务号*/
-	@Excel(name = "批产任务号", width = 15)
+    /**批产任务号*/
+    @Excel(name = "批产任务号", width = 15)
     @ApiModelProperty(value = "批产任务号")
     private String pccode;
-	/**备产任务号*/
-	@Excel(name = "备产任务号", width = 15)
+    /**备产任务号*/
+    @Excel(name = "备产任务号", width = 15)
     @ApiModelProperty(value = "备产任务号")
     private String bccode;
-	/**备料任务号*/
-	@Excel(name = "备料任务号", width = 15)
+    /**备料任务号*/
+    @Excel(name = "备料任务号", width = 15)
     @ApiModelProperty(value = "备料任务号")
     private String blcode;
-	/**软件开发状态*/
-	@Excel(name = "软件开发状态", width = 15)
+    /**软件开发状态*/
+    @Excel(name = "软件开发状态", width = 15)
     @ApiModelProperty(value = "软件开发状态")
     private String rjkfstatus;
-	/**提交完成审核时间*/
-	//@Excel(name = "提交完成审核时间", width = 15, format = "yyyy-MM-dd")
-	@ExcelProperty(value = "提交完成审核时间", converter = DateStringConverter.class)
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    /**提交完成审核时间*/
+    //@Excel(name = "提交完成审核时间", width = 15, format = "yyyy-MM-dd")
+    @ExcelProperty(value = "提交完成审核时间")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "提交完成审核时间")
     private Date processdate;
@@ -371,16 +371,13 @@ public class KyTaskInfoNew implements Serializable {
 	@Excel(name = "父级任务号", width = 15)
     @ApiModelProperty(value = "父级任务号")
     private String reftaskno;
-	/**年*/
-	@Excel(name = "年", width = 15)
+    /**年*/
     @ApiModelProperty(value = "年")
     private Integer year;
-	/**月*/
-	@Excel(name = "月", width = 15)
+    /**月*/
     @ApiModelProperty(value = "月")
     private Integer month;
-	/**年月*/
-	@Excel(name = "年月", width = 15)
+    /**年月*/
     @ApiModelProperty(value = "年月")
     private String yearmonth;
 }

+ 1 - 1
module_kzks/src/main/java/org/jeecg/modules/kyTaskInfoNew/listener/KyTaskInfoNewListener.java

@@ -36,7 +36,7 @@ public class KyTaskInfoNewListener extends AnalysisEventListener<KyTaskInfoNew>
     @Override
     public void invoke(KyTaskInfoNew kyTaskInfoNew, AnalysisContext analysisContext) {
         kyList.add(kyTaskInfoNew);
-        if (kyList.size() > BIG_SIZE){
+        if (kyList.size() == BIG_SIZE){
             batchSaveKyInfo(kyList);
         }
     }

+ 9 - 1
module_kzks/src/main/java/org/jeecg/modules/projectImportList/controller/ProjectImportListController.java

@@ -17,6 +17,8 @@ import org.jeecg.modules.costModelWxPrice.entity.CostModelWxPrice;
 import org.jeecg.modules.costModelWxPrice.service.ICostModelWxPriceService;
 import org.jeecg.modules.kpiImportList.entity.KpiImportList;
 import org.jeecg.modules.kpiImportList.service.IKpiImportListService;
+import org.jeecg.modules.kpiProjectMonth.entity.KpiProjectMonth;
+import org.jeecg.modules.kpiProjectMonth.service.IKpiProjectMonthService;
 import org.jeecg.modules.kyTaskInfoNew.entity.KyTaskInfoNew;
 import org.jeecg.modules.kyTaskInfoNew.service.IKyTaskInfoNewService;
 import org.jeecg.modules.kyTaskTemp.entity.KyTaskTemp;
@@ -90,6 +92,10 @@ public class ProjectImportListController extends JeecgController<ProjectImportLi
     @SuppressWarnings("all")
     private IComContractInfoExchangeNewService comContractInfoExchangeNewService;
 
+    @Autowired
+    @SuppressWarnings("all")
+    private IKpiProjectMonthService kpiProjectMonthService;
+
 
     /**
      * 通过excel导入其他表的数据
@@ -138,8 +144,10 @@ public class ProjectImportListController extends JeecgController<ProjectImportLi
         } else if (projectImportList.getFileType().equals("17")){//收款导入
             return comContractInfoExchangeNewService.importExcel1(url, ComContractInfoExchangeNew.class, 40);
 //            return wzOutboundOrderBNewService.importExcelNew(url, WzOutboundOrderBNew.class);
-        } else if (projectImportList.getFileType().equals("15")){
+        } else if (projectImportList.getFileType().equals("15")){//科研任务导入
             return kyTaskInfoNewService.importExcel1(url, KyTaskInfoNew.class);
+        } else if (projectImportList.getFileType().equals("18")){//每月进度导入
+            return kpiProjectMonthService.importExcel1(url, KpiProjectMonth.class);
         } else {
             result.setCode(500);
             result.setMessage("请选择正确的导入类型!");