Przeglądaj źródła

首页三层,所长查看所有部门某年或某月的指标完成度排行

sl 1 rok temu
rodzic
commit
df6282d8a8
34 zmienionych plików z 1759 dodań i 42 usunięć
  1. 19 5
      module_kzks/src/main/java/org/jeecg/modules/Index/controller/IndexController.java
  2. 48 0
      module_kzks/src/main/java/org/jeecg/modules/Index/entity/kpi/IndexKpiCompletByDate.java
  3. 23 0
      module_kzks/src/main/java/org/jeecg/modules/Index/entity/kpi/IndexKpiDataDepart.java
  4. 24 0
      module_kzks/src/main/java/org/jeecg/modules/Index/entity/kpi/IndexKpiParamDto.java
  5. 23 0
      module_kzks/src/main/java/org/jeecg/modules/Index/entity/pojo/LreInfoByDate.java
  6. 23 0
      module_kzks/src/main/java/org/jeecg/modules/Index/entity/pojo/ReceivedByDate.java
  7. 8 1
      module_kzks/src/main/java/org/jeecg/modules/Index/entity/vo/IndexTotalVo.java
  8. 63 0
      module_kzks/src/main/java/org/jeecg/modules/Index/mapper/IndexKpiMapper.java
  9. 10 0
      module_kzks/src/main/java/org/jeecg/modules/Index/mapper/IndexMapper.java
  10. 8 0
      module_kzks/src/main/java/org/jeecg/modules/Index/mapper/xml/IndexKpiMapper.xml
  11. 15 4
      module_kzks/src/main/java/org/jeecg/modules/Index/mapper/xml/IndexMapper.xml
  12. 27 0
      module_kzks/src/main/java/org/jeecg/modules/Index/service/IndexKpiService.java
  13. 3 3
      module_kzks/src/main/java/org/jeecg/modules/Index/service/IndexService.java
  14. 334 0
      module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexKpiServiceImpl.java
  15. 225 15
      module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexServiceImpl.java
  16. 3 0
      module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexZcbServiceImpl.java
  17. 1 1
      module_kzks/src/main/java/org/jeecg/modules/kpiImportList/controller/KpiImportListController.java
  18. 8 6
      module_kzks/src/main/java/org/jeecg/modules/kpiImportList/entity/KpiImportList.java
  19. 1 1
      module_kzks/src/main/java/org/jeecg/modules/kpiImportList/mapper/KpiImportListMapper.java
  20. 1 1
      module_kzks/src/main/java/org/jeecg/modules/kpiImportList/service/IKpiImportListService.java
  21. 1 1
      module_kzks/src/main/java/org/jeecg/modules/kpiImportList/service/impl/KpiImportListServiceImpl.java
  22. 215 0
      module_kzks/src/main/java/org/jeecg/modules/kpiImportList/vue/KpiImportListList.vue
  23. 26 0
      module_kzks/src/main/java/org/jeecg/modules/kpiImportList/vue/KpiImportList_menu_insert.sql
  24. 134 0
      module_kzks/src/main/java/org/jeecg/modules/kpiImportList/vue/modules/KpiImportListForm.vue
  25. 84 0
      module_kzks/src/main/java/org/jeecg/modules/kpiImportList/vue/modules/KpiImportListModal.Style#Drawer.vue
  26. 60 0
      module_kzks/src/main/java/org/jeecg/modules/kpiImportList/vue/modules/KpiImportListModal.vue
  27. 177 0
      module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/controller/KpiProjectMonthController.java
  28. 94 0
      module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/entity/KpiProjectMonth.java
  29. 17 0
      module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/mapper/KpiProjectMonthMapper.java
  30. 5 0
      module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/mapper/xml/KpiProjectMonthMapper.xml
  31. 14 0
      module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/service/IKpiProjectMonthService.java
  32. 19 0
      module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/service/impl/KpiProjectMonthServiceImpl.java
  33. 11 4
      module_kzks/src/main/java/org/jeecg/modules/xmcbDetail/mapper/ComContractInfoExchangeMapper.java
  34. 35 0
      module_kzks/src/main/java/org/jeecg/modules/xmcbDetail/mapper/xml/ComContractInfoExchangeMapper.xml

+ 19 - 5
module_kzks/src/main/java/org/jeecg/modules/Index/controller/IndexController.java

@@ -9,8 +9,12 @@ import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.util.JwtUtil;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.Index.entity.dto.IndexInfoParamDto;
+import org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate;
+import org.jeecg.modules.Index.entity.kpi.IndexKpiDataDepart;
+import org.jeecg.modules.Index.entity.kpi.IndexKpiParamDto;
 import org.jeecg.modules.Index.entity.vo.IndexChartInfoVo;
 import org.jeecg.modules.Index.entity.vo.*;
+import org.jeecg.modules.Index.service.IndexKpiService;
 import org.jeecg.modules.Index.service.IndexService;
 import org.jeecg.modules.Index.service.IndexZcbService;
 import org.jeecg.modules.Index.util.AuthMark;
@@ -36,6 +40,9 @@ public class IndexController {
     private IndexZcbService indexZcbService;
 
     @Autowired
+    private IndexKpiService indexKpiService;
+
+    @Autowired
     private ISysBaseAPI sysBaseApi;
 
     @Autowired
@@ -62,7 +69,7 @@ public class IndexController {
             });
             CompletableFuture<IndexTotalVo> lreFuture = CompletableFuture.supplyAsync(() -> {
                 // 利润额
-                return indexService.getLreByRole();
+                return indexService.getLreByRole(request);
             });
             CompletableFuture<IndexTotalVo> zceFuture = CompletableFuture.supplyAsync(() -> {
                 // 支出额
@@ -161,8 +168,8 @@ public class IndexController {
      */
     @ApiOperation(value = "首页二层利润额显示", notes = "首页二层利润额显示")
     @GetMapping(value = "/countLreByDate")
-    public Result<IndexChartInfoVo<BigDecimal>> countLreByDate(IndexInfoParamDto indexInfoParamDto) {
-        return Result.OK(indexService.getLreDetailByRole(indexInfoParamDto));//加入角色,判断查看权限
+    public Result<IndexChartInfoVo<BigDecimal>> countLreByDate(HttpServletRequest request, IndexInfoParamDto indexInfoParamDto) {
+        return Result.OK(indexService.getLreDetailByRole(request, indexInfoParamDto));//加入角色,判断查看权限
 //        return Result.OK(indexService.countLreByDate(indexInfoParamDto));
     }
 
@@ -181,6 +188,13 @@ public class IndexController {
     }
 
 
+    @ApiOperation("部门指标排行---首页三层接口")
+    @GetMapping("/getCompletRateByDate")
+    public Result<IndexKpiDataDepart> getCompletRateByDate(IndexKpiParamDto indexKpiParamDto){
+        return Result.ok(indexKpiService.getCompletRateByDate(indexKpiParamDto));
+    }
+
+
     /**
      * 测试sl
      *
@@ -188,8 +202,8 @@ public class IndexController {
      */
     @ApiOperation(value = "测试sl", notes = "测试sl")
     @GetMapping(value = "/testSl")
-    public Result<List<String>> testSl() {
-        return Result.ok(indexService.testSl());
+    public Result<List<IndexKpiCompletByDate>> testSl() {
+        return Result.ok(indexKpiService.testSort());
     }
 
 

+ 48 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/entity/kpi/IndexKpiCompletByDate.java

@@ -0,0 +1,48 @@
+package org.jeecg.modules.Index.entity.kpi;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * ClassName: IndexKpiCompletByDate
+ * Package: org.jeecg.modules.Index.entity.kpi
+ * Description: 用来存储返回部门指标排行需要的数据
+ *
+ * @Author sl
+ * @Create 2023/10/13 9:03
+ * @Version 1.0
+ */
+@Data
+public class IndexKpiCompletByDate {
+//    /*部门*/
+//    private List<String> depart;
+//
+//    /*部门指标*/
+//    private List<BigDecimal> departKpi;
+//
+//    /*合同额*/
+//    private List<BigDecimal> contractAmount;
+//
+//    /*已收款*/
+//    private List<BigDecimal> received;
+//
+//    /*完成度*/
+//    private List<BigDecimal> kpiCompletRate;
+
+    /*部门*/
+    private String depart;
+
+    /*部门指标*/
+    private BigDecimal departKpi;
+
+    /*合同额*/
+    private BigDecimal contractAmount;
+
+    /*已收款*/
+    private BigDecimal received;
+
+    /*完成度*/
+    private BigDecimal kpiCompletRate;
+}

+ 23 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/entity/kpi/IndexKpiDataDepart.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.Index.entity.kpi;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * ClassName: IndexKpiDataDepart
+ * Package: org.jeecg.modules.Index.entity.kpi
+ * Description: 最终返还前端的部门排行
+ *
+ * @Author sl
+ * @Create 2023/10/13 16:03
+ * @Version 1.0
+ */
+@Data
+public class IndexKpiDataDepart {
+    /** 责任部门排行 */
+    private List<IndexKpiCompletByDate> zrbmCharts;
+
+    /** 下达部门排行 */
+    private List<IndexKpiCompletByDate> jycsCharts;
+}

+ 24 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/entity/kpi/IndexKpiParamDto.java

@@ -0,0 +1,24 @@
+package org.jeecg.modules.Index.entity.kpi;
+
+import lombok.Data;
+
+/**
+ * ClassName: IndexKpiParamDto
+ * Package: org.jeecg.modules.Index.entity.kpi
+ * Description:  首页部门指标排行前端传送的参数
+ *
+ * @Author sl
+ * @Create 2023/10/13 15:40
+ * @Version 1.0
+ */
+@Data
+public class IndexKpiParamDto {
+    /*年/月*/
+    private String time;
+
+    /*起始时间*/
+    private String beginDate;
+
+    /*截止时间*/
+    //private String endDate;
+}

+ 23 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/entity/pojo/LreInfoByDate.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.Index.entity.pojo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * ClassName: lreInfoByDate
+ * Package: org.jeecg.modules.Index.entity.pojo
+ * Description:
+ *
+ * @Author sl
+ * @Create 2023/10/7 16:34
+ * @Version 1.0
+ */
+@Data
+public class LreInfoByDate {
+    /*利润额*/
+    private BigDecimal lre;
+
+    /*年份或者月份*/
+    private String date;
+}

+ 23 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/entity/pojo/ReceivedByDate.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.Index.entity.pojo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * ClassName: ReceivedByDate
+ * Package: org.jeecg.modules.Index.entity.pojo
+ * Description:
+ *
+ * @Author sl
+ * @Create 2023/10/9 11:27
+ * @Version 1.0
+ */
+@Data
+public class ReceivedByDate {
+    /*已收款*/
+    private BigDecimal received;
+
+    /*年份或者月份*/
+    private String date;
+}

+ 8 - 1
module_kzks/src/main/java/org/jeecg/modules/Index/entity/vo/IndexTotalVo.java

@@ -11,7 +11,6 @@ public class IndexTotalVo {
     /*年总*/
     private BigDecimal yearTotal;
     /*上年同期总*/
-
     private BigDecimal yearTq;
     /*同比增长率*/
     private BigDecimal yearTb;
@@ -22,6 +21,14 @@ public class IndexTotalVo {
     /*当月环比*/
     private BigDecimal monthHb;
 
+    /*sl添加,计算利润额使用*/
+    /*去年同期月总*/
     @JsonIgnoreProperties(ignoreUnknown = true)
     private BigDecimal monthTq;
+    /*上月同期总*/
+    @JsonIgnoreProperties(ignoreUnknown = true)
+    private BigDecimal monthLast;
+
+
+
 }

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

@@ -0,0 +1,63 @@
+package org.jeecg.modules.Index.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate;
+
+import java.util.List;
+
+/**
+ * ClassName: IndexKpiMapper
+ * Package: org.jeecg.modules.Index.mapper
+ * Description: 部门指标排行
+ *
+ * @Author sl
+ * @Create 2023/10/13 9:29
+ * @Version 1.0
+ */
+@Mapper
+public interface IndexKpiMapper {
+    /** 部门表    查询到所有部门 */
+    @Select("select depart_name from sys_depart where depart_name!=''")
+    List<String> getDepartName();
+
+    /** 部门指标表   查询部门和年指标 */
+    @Select("select department as depart, kpi as departKpi from kzks_kpi_import_list where year=#{date} and (department is not null) and department!=''")
+    List<IndexKpiCompletByDate> getKpiYear(@Param("date") Integer date);
+    /** 部门指标表   查询部门和月指标 */
+    @Select("select department as depart, kpi_month as departKpi from kzks_kpi_import_list where ym=#{date} and (department is not null) and department!=''")
+    List<IndexKpiCompletByDate> getKpiMonth(@Param("date") String date);
+
+
+//    /** 部门每月月底项目进度考核表    根据责任部门分组找出指定年份中的合同额总和和已收款总和 */
+//    @Select("select zrbm as depart, sum(contractfpe * processPercent / 100.0) as contractAmount, sum(TaskMoney) as received from kzks_kpi_project_month where year=#{date} group by zrbm")
+//    List<IndexKpiCompletByDate> getHteReceivedZrbmYear(@Param("date") String date);
+//    /** 部门每月月底项目进度考核表    根据责任部门分组找出指定月份中的合同额总和和已收款总和 */
+//    @Select("select zrbm as depart, sum(contractfpe * processPercent / 100.0) as contractAmount, sum(TaskMoney) as received from kzks_kpi_project_month where ym=#{date} group by zrbm")
+//    List<IndexKpiCompletByDate> getHteReceivedZrbmMonth(@Param("date") String date);
+//    /** 部门每月月底项目进度考核表    根据下达部门分组找出指定年份中的合同额总和和已收款总和 */
+//    @Select("select jycs as depart, sum(contractfpe * processPercent / 100.0) as contractAmount, sum(TaskMoney) as received from kzks_kpi_project_month where year=#{date} group by jycs")
+//    List<IndexKpiCompletByDate> getHteReceivedJycsYear(@Param("date") String date);
+//    /** 部门每月月底项目进度考核表    根据下达部门分组找出指定月份中的合同额总和和已收款总和 */
+//    @Select("select jycs as depart, sum(contractfpe * processPercent / 100.0) as contractAmount, sum(TaskMoney) as received from kzks_kpi_project_month where ym=#{date} group by jycs")
+//    List<IndexKpiCompletByDate> getHteReceivedJycsMonth(@Param("date") String date);
+
+    /** 部门每月月底项目进度考核表    根据责任部门分组找出指定年月的合同额总和和已收款总和 */
+    @Select("select zrbm as depart, sum(contractfpe * processPercent / 100.0) as contractAmount, sum(TaskMoney) as received from kzks_kpi_project_month where ym=#{date} and (zrbm is not null) and zrbm!='' group by zrbm")
+    List<IndexKpiCompletByDate> getHteReceivedZrbmYm(@Param("date") String date);
+    /** 部门每月月底项目进度考核表    根据下达部门分组找出指定年月的合同额总和和已收款总和 */
+    @Select("select jycs as depart, sum(contractfpe * processPercent / 100.0) as contractAmount, sum(TaskMoney) as received from kzks_kpi_project_month where ym=#{date} and (jycs is not null) and jycs!='' group by jycs")
+    List<IndexKpiCompletByDate> getHteReceivedJycsYm(@Param("date") String date);
+
+
+    /** 项目成本表    根据责任部门分组找出当年当月的合同额总和和已收款总和 */
+    @Select("select zrbm as depart, sum(contractfpe * processPercent / 100.0) as contractAmount, sum(TaskMoney) as received from kzks_project_cost where status='0' and (zrbm is not null) and zrbm!='' group by zrbm")
+    List<IndexKpiCompletByDate> getHteReceivedZrbmCost();
+    /** 项目成本表    根据下达部门分组找出当年当月的合同额总和和已收款总和 */
+    @Select("select jycs as depart, sum(contractfpe * processPercent / 100.0) as contractAmount, sum(TaskMoney) as received from kzks_project_cost where status='0' and (jycs is not null) and jycs!='' group by jycs")
+    List<IndexKpiCompletByDate> getHteReceivedJycsCost();
+
+
+
+}

+ 10 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/mapper/IndexMapper.java

@@ -3,8 +3,11 @@ package org.jeecg.modules.Index.mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.jeecg.modules.Index.entity.pojo.LreInfoByDate;
 
 import java.math.BigDecimal;
+import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 
 @Mapper
@@ -50,9 +53,16 @@ public interface IndexMapper {
     /**部门领导根据部门名称和实际完成时间查询任务号  某月*/
     List<String> getKyTaskNoAllByDepMonth(@Param("departNames") List<String> departNames, @Param("ym") String ym);
 
+    /** 所长按年分组查询某年的利润额 */
+    List<LreInfoByDate> getTasknoByGroupYear(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+    /** 所长按月分组查询某月的利润额 */
+    List<LreInfoByDate> getTasknoByGroupMonth(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+
 
 
     /**根据任务号和解组批任务状态(组批状态为1的排除不计)计算利润额 */
     BigDecimal getLreByTaskNoStatus(@Param("tasknoList") List<String> tasknoList);
 
+
 }

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

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.Index.mapper.IndexKpiMapper">
+
+
+
+
+</mapper>

+ 15 - 4
module_kzks/src/main/java/org/jeecg/modules/Index/mapper/xml/IndexMapper.xml

@@ -95,10 +95,6 @@
     </select>
 
 
-
-
-
-
     <!--根据任务号和解组批任务状态(组批状态为1的排除不计)计算利润额 -->
     <select id="getLreByTaskNoStatus" resultType="java.math.BigDecimal">
         select sum(lre) from kzks_project_cost where status="0"
@@ -108,4 +104,19 @@
         </foreach>
     </select>
 
+
+    <!-- 所长按年分组查询某年的利润额 -->
+    <select id="getTasknoByGroupYear" resultType="org.jeecg.modules.Index.entity.pojo.LreInfoByDate">
+        select year(a.sjwcsj) as date,sum(c.lre) as lre from ky_task_info a,kzks_project_cost c
+        where YEAR(a.sjwcsj) BETWEEN #{beginDate} and #{endDate} and a.taskno=c.taskno and c.status='0' group by year(a.sjwcsj)
+    </select>
+    <!-- 所长按月分组查询某月的利润额 -->
+    <select id="getTasknoByGroupMonth" resultType="org.jeecg.modules.Index.entity.pojo.LreInfoByDate">
+        select CONCAT(year(a.sjwcsj), "-", LPAD(month(a.sjwcsj), 2, "0" )) as date,sum(c.lre) as lre from ky_task_info a,kzks_project_cost c
+        where CONCAT(YEAR (a.sjwcsj), "-", LPAD( MONTH (a.sjwcsj), 2, "0" )) <![CDATA[ <= ]]> #{endDate}
+        and CONCAT(YEAR (a.sjwcsj), "-", LPAD( MONTH (a.sjwcsj), 2, "0" )) <![CDATA[ >= ]]> #{beginDate}
+        and a.taskno=c.taskno and c.status='0' group by year(a.sjwcsj), month(a.sjwcsj)
+    </select>
+
+
 </mapper>

+ 27 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/service/IndexKpiService.java

@@ -0,0 +1,27 @@
+package org.jeecg.modules.Index.service;
+
+import org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate;
+import org.jeecg.modules.Index.entity.kpi.IndexKpiDataDepart;
+import org.jeecg.modules.Index.entity.kpi.IndexKpiParamDto;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * ClassName: IndexKpiService
+ * Package: org.jeecg.modules.Index.service
+ * Description: 部门指标排行
+ *
+ * @Author sl
+ * @Create 2023/10/13 9:25
+ * @Version 1.0
+ */
+public interface IndexKpiService {
+    /**部门指标排行*/
+    public IndexKpiDataDepart getCompletRateByDate(IndexKpiParamDto indexKpiParamDto);
+
+    public List<IndexKpiCompletByDate> testSort();
+
+
+}

+ 3 - 3
module_kzks/src/main/java/org/jeecg/modules/Index/service/IndexService.java

@@ -82,14 +82,14 @@ public interface IndexService {
      *
      * @return
      */
-    public IndexTotalVo getLreByRole();
+    public IndexTotalVo getLreByRole(HttpServletRequest request);
     /**
      * 首页二层 利润额
      * 通过登录的用户找到角色,根据角色来判断部门,根据部门和实际完成时间选择任务列表,根据任务列表计算利润额
      *
      * @return
      */
-    public IndexChartInfoVo<BigDecimal> getLreDetailByRole(IndexInfoParamDto indexInfoParamDto);
+    public IndexChartInfoVo<BigDecimal> getLreDetailByRole(HttpServletRequest request, IndexInfoParamDto indexInfoParamDto);
 
     /**
      * 首页二层: 已收款
@@ -107,6 +107,6 @@ public interface IndexService {
      *
      * @return
      */
-    public List<String> testSl();
+    public List<String> testSl(IndexInfoParamDto indexInfoParamDto);
 
 }

+ 334 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexKpiServiceImpl.java

@@ -0,0 +1,334 @@
+package org.jeecg.modules.Index.service.impl;
+
+import javassist.expr.NewArray;
+import org.apache.commons.collections4.comparators.NullComparator;
+import org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate;
+import org.jeecg.modules.Index.entity.kpi.IndexKpiDataDepart;
+import org.jeecg.modules.Index.entity.kpi.IndexKpiParamDto;
+import org.jeecg.modules.Index.mapper.IndexKpiMapper;
+import org.jeecg.modules.Index.service.IndexKpiService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * ClassName: IndexKpiServiceImpl
+ * Package: org.jeecg.modules.Index.service.impl
+ * Description:  部门指标排行实现类
+ *
+ * @Author sl
+ * @Create 2023/10/13 9:24
+ * @Version 1.0
+ */
+@Service
+public class IndexKpiServiceImpl implements IndexKpiService {
+    @Autowired
+    @SuppressWarnings("all")
+    private IndexKpiMapper indexKpiMapper;
+
+    /**
+     * 工具类
+     * 根据日期字符串求上一个月的字符串
+     *
+     * @return String
+     */
+    public String getLastMonthString(String dateString) throws ParseException {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(simpleDateFormat.parse(dateString));
+        calendar.add(Calendar.MONTH,-1);
+        return simpleDateFormat.format(calendar.getTime());
+    }
+
+    /**
+     * 接口调用的类  用来获取所有部门的指标、合同额、已收款、完成度,并按完成度排行
+     *
+     * @return IndexKpiDataDepart
+     */
+    public IndexKpiDataDepart getCompletRateByDate(IndexKpiParamDto indexKpiParamDto){
+        //初始化
+        IndexKpiDataDepart indexKpiDataDepart = new IndexKpiDataDepart();
+        List<IndexKpiCompletByDate> kpiDataZrbmList = new ArrayList<>();//责任部门排行
+        List<IndexKpiCompletByDate> kpiDataJycsList = new ArrayList<>();//下达部门排行
+        indexKpiDataDepart.setZrbmCharts(kpiDataZrbmList);//初始化放入空列表
+        indexKpiDataDepart.setJycsCharts(kpiDataJycsList);
+        //查询所有部门 将所有部门的指标和完成度赋为空,合同额和已收款赋为0
+        List<String> departList = indexKpiMapper.getDepartName();
+        System.out.println(departList);
+        //此处是否需要去重???
+        if(departList.isEmpty()) return indexKpiDataDepart;
+        for(String depart:departList){
+            IndexKpiCompletByDate indexKpiCompletByDate = new IndexKpiCompletByDate();
+            indexKpiCompletByDate.setDepart(depart);
+            indexKpiCompletByDate.setDepartKpi(null);
+            indexKpiCompletByDate.setContractAmount(new BigDecimal(0));
+            indexKpiCompletByDate.setReceived(new BigDecimal(0));
+            indexKpiCompletByDate.setKpiCompletRate(null);
+            IndexKpiCompletByDate indexKpiCompletByDate2 = new IndexKpiCompletByDate();
+            indexKpiCompletByDate2.setDepart(depart);
+            indexKpiCompletByDate2.setDepartKpi(null);
+            indexKpiCompletByDate2.setContractAmount(new BigDecimal(0));
+            indexKpiCompletByDate2.setReceived(new BigDecimal(0));
+            indexKpiCompletByDate2.setKpiCompletRate(null);
+            kpiDataZrbmList.add(indexKpiCompletByDate);
+            kpiDataJycsList.add(indexKpiCompletByDate2);
+        }
+//        System.out.println(kpiDataZrbmList);
+//        System.out.println(kpiDataJycsList);
+        // TODO:  初始化结束
+
+        //目前是算某个月的指标,不涉及范围
+        //年/月
+        String timeType = indexKpiParamDto.getTime();
+        //日期
+        String dateString = indexKpiParamDto.getBeginDate();
+        /*
+        //起始时间
+        String startString = indexKpiParamDto.getBeginDate();
+        //结束时间
+        String endString = indexKpiParamDto.getEndDate();
+        */
+        //获取当前时间的年月
+        LocalDate currentDate = LocalDate.now();
+        // 获取当前年份
+        int currentDateYear = currentDate.getYear();
+        // 获取当前年月
+        String currentYm = String.format("%d-%d", currentDateYear, currentDate.getMonthValue());
+        //用来存放要看的年末或月末的年月日期  上一年末或上一月末的日期
+        String dateYm = "";
+        String dateLastYm = "";
+        boolean isCurrentDate = true;//是否是当年或当月,当年或当月要从项目成本表中获取数据
+
+        List<IndexKpiCompletByDate> kpiList = new ArrayList<>(); //用来保存部门指标表中的部门和指标
+        List<IndexKpiCompletByDate> htereceivedZrbmList = new ArrayList<>();//用来保存部门该月合计的合同额、已收款以及责任部门
+        List<IndexKpiCompletByDate> htereceivedJycsList = new ArrayList<>();//用来保存部门该月合计的合同额、已收款以及下达部门
+        List<IndexKpiCompletByDate> htereceivedZrbmLastList = new ArrayList<>();//用来保存部门上月合计的合同额、已收款以及责任部门
+        List<IndexKpiCompletByDate> htereceivedJycsLastList = new ArrayList<>();//用来保存部门上月合计的合同额、已收款以及下达部门
+        try{
+            if(timeType.equals("year")){
+                isCurrentDate = dateString.equals(String.valueOf(currentDateYear));
+                dateYm = String.format("%s-%d", currentDateYear, 12);
+                dateLastYm = String.format("%d-%d", Integer.parseInt(dateString)-1, 12);
+            }else if(timeType.equals("month")){
+                isCurrentDate = dateString.equals(currentYm);
+                dateYm = dateString;
+                dateLastYm = getLastMonthString(currentYm);
+            }
+        }catch (ParseException e){
+            System.out.println("部门指标排行传送的日期字符串错误!!!");
+            return indexKpiDataDepart;
+        }
+
+        //获取部门指标数据  kpi
+        boolean finalIsCurrentDate = isCurrentDate;
+        String finalDateYm = dateYm;
+        String finalDateLastYm = dateLastYm;
+        CompletableFuture<List<IndexKpiCompletByDate>> getKpiListFuture = CompletableFuture.supplyAsync(() -> {
+            if(timeType.equals("year")){
+                return indexKpiMapper.getKpiYear(Integer.parseInt(dateString));
+            }else{
+                return indexKpiMapper.getKpiMonth(dateString);
+            }
+
+        });
+        //获取选择年月的数据  合同额、已收款
+        CompletableFuture<List<IndexKpiCompletByDate>> getHtereceivedZrbmListFuture = CompletableFuture.supplyAsync(() -> {
+            //如果选择的日期是当年当月,则从项目成本表里取数据,否则从每月月底项目进度考核表中取
+            if(finalIsCurrentDate){
+                return indexKpiMapper.getHteReceivedZrbmCost();
+            }else{
+                return indexKpiMapper.getHteReceivedZrbmYm(finalDateYm);
+            }
+
+        });
+        CompletableFuture<List<IndexKpiCompletByDate>> getHtereceivedJycsListFuture = CompletableFuture.supplyAsync(() -> {
+            //如果选择的日期是当年当月,则从项目成本表里取数据,否则从每月月底项目进度考核表中取
+            if(finalIsCurrentDate){
+                return indexKpiMapper.getHteReceivedJycsCost();
+            }else{
+                return indexKpiMapper.getHteReceivedJycsYm(finalDateYm);
+            }
+
+        });
+        //获取选择年月上月的数据  合同额、已收款
+        CompletableFuture<List<IndexKpiCompletByDate>> getHtereceivedZrbmLastListFuture = CompletableFuture.supplyAsync(() -> {
+            return indexKpiMapper.getHteReceivedZrbmYm(finalDateLastYm);
+        });
+        CompletableFuture<List<IndexKpiCompletByDate>> getHtereceivedJycsLastListFuture = CompletableFuture.supplyAsync(() -> {
+            return indexKpiMapper.getHteReceivedJycsYm(finalDateLastYm);
+        });
+        CompletableFuture<Void> future1 = CompletableFuture.allOf(getKpiListFuture, getHtereceivedZrbmListFuture, getHtereceivedJycsListFuture, getHtereceivedZrbmLastListFuture, getHtereceivedJycsLastListFuture);
+        future1.join();
+        kpiList = getKpiListFuture.join();
+        htereceivedZrbmList = getHtereceivedZrbmListFuture.join();
+        htereceivedJycsList = getHtereceivedJycsListFuture.join();
+        htereceivedZrbmLastList = getHtereceivedZrbmLastListFuture.join();
+        htereceivedJycsLastList = getHtereceivedJycsLastListFuture.join();
+
+        System.out.println(kpiList);
+        System.out.println(htereceivedZrbmList);
+        System.out.println(htereceivedJycsList);
+        System.out.println(htereceivedZrbmLastList);
+        System.out.println(htereceivedJycsLastList);
+
+
+        List<IndexKpiCompletByDate> finalHtereceivedZrbmList = htereceivedZrbmList;
+        List<IndexKpiCompletByDate> finalHtereceivedZrbmLastList = htereceivedZrbmLastList;
+        List<IndexKpiCompletByDate> finalKpiList = kpiList;
+        List<IndexKpiCompletByDate> finalHtereceivedJycsList = htereceivedJycsList;
+        List<IndexKpiCompletByDate> finalHtereceivedJycsLastList = htereceivedJycsLastList;
+        CompletableFuture<Void> setKpiDataZrbmList = CompletableFuture.runAsync(() -> {
+            //责任部门列表计算合同额和已收款差额得到选择月份的合同额和已收款
+            for(IndexKpiCompletByDate htereceivedZrbm: finalHtereceivedZrbmList){
+                BigDecimal hteLast = new BigDecimal(0);
+                BigDecimal receivedLast = new BigDecimal(0);
+                for(IndexKpiCompletByDate htereceivedZrbmLast: finalHtereceivedZrbmLastList){
+                    if(htereceivedZrbm.getDepart().equals(htereceivedZrbmLast.getDepart())){
+                        hteLast = htereceivedZrbmLast.getContractAmount();
+                        receivedLast = htereceivedZrbmLast.getReceived();
+                        break;
+                    }
+                }
+                htereceivedZrbm.setContractAmount(htereceivedZrbm.getContractAmount().subtract(hteLast));
+                htereceivedZrbm.setReceived(htereceivedZrbm.getReceived().subtract(receivedLast));
+            }
+//            System.out.println(finalHtereceivedZrbmList);
+            //责任部门列表填充kpi
+            for(IndexKpiCompletByDate kpiDataZrbm:kpiDataZrbmList){
+                //根据部门输入部门指标
+                for(IndexKpiCompletByDate kpiDepart: finalKpiList){
+                    if(kpiDataZrbm.getDepart().equals(kpiDepart.getDepart())){
+                        kpiDataZrbm.setDepartKpi(kpiDepart.getDepartKpi());
+                        break;
+                    }
+                }
+            }
+            //责任部门列表填充合同额、已收款、完成度
+            for(IndexKpiCompletByDate kpiDataZrbm2:kpiDataZrbmList){
+                for(IndexKpiCompletByDate htereceivedZrbm: finalHtereceivedZrbmList){
+                    if(kpiDataZrbm2.getDepart().equals(htereceivedZrbm.getDepart())){
+                        kpiDataZrbm2.setContractAmount(htereceivedZrbm.getContractAmount());//合同额
+                        kpiDataZrbm2.setReceived(htereceivedZrbm.getReceived());//已收款
+                        break;
+                    }
+                }
+                //计算完成度  合同额(是计算的某个月或某个年的合同额 增量)/ 指标
+                if(kpiDataZrbm2.getDepartKpi() != null){
+                    if(kpiDataZrbm2.getDepartKpi().equals(BigDecimal.valueOf(0))){
+                        kpiDataZrbm2.setKpiCompletRate(BigDecimal.valueOf(1));
+                    }else{
+                        kpiDataZrbm2.setKpiCompletRate(kpiDataZrbm2.getContractAmount().divide(kpiDataZrbm2.getDepartKpi(), 2, RoundingMode.HALF_UP));
+                    }
+                }
+            }
+
+//            System.out.println("kpiDataZrbmList");
+            //责任部门指标完成度排序
+            kpiDataZrbmList.sort(Comparator.comparing(IndexKpiCompletByDate::getKpiCompletRate, Comparator.nullsFirst(BigDecimal::compareTo)).reversed());
+//            System.out.println(kpiDataZrbmList);
+        });
+        CompletableFuture<Void> setKpiDataJycsList = CompletableFuture.runAsync(() -> {
+            //下达部门列表计算合同额和已收款差额得到选择月份的合同额和已收款
+            for(IndexKpiCompletByDate htereceivedJycs: finalHtereceivedJycsList){
+                BigDecimal hteLast = new BigDecimal(0);
+                BigDecimal receivedLast = new BigDecimal(0);
+                for(IndexKpiCompletByDate htereceivedJycsLast: finalHtereceivedJycsLastList){
+                    if(htereceivedJycs.getDepart().equals(htereceivedJycsLast.getDepart())){
+                        hteLast = htereceivedJycsLast.getContractAmount();
+                        receivedLast = htereceivedJycsLast.getReceived();
+                        break;
+                    }
+                }
+                htereceivedJycs.setContractAmount(htereceivedJycs.getContractAmount().subtract(hteLast));
+                htereceivedJycs.setReceived(htereceivedJycs.getReceived().subtract(receivedLast));
+            }
+//            System.out.println(finalHtereceivedJycsList);
+            //下达部门列表填充kpi
+            for(IndexKpiCompletByDate kpiDataJycs:kpiDataJycsList){
+                //根据部门输入部门指标
+                for(IndexKpiCompletByDate kpiDepart: finalKpiList){
+                    if(kpiDataJycs.getDepart().equals(kpiDepart.getDepart())){
+                        kpiDataJycs.setDepartKpi(kpiDepart.getDepartKpi());
+                        break;
+                    }
+                }
+            }
+            //下达部门列表填充合同额、已收款、完成度
+            for(IndexKpiCompletByDate kpiDataJycs2:kpiDataJycsList){
+                for(IndexKpiCompletByDate htereceivedJycs: finalHtereceivedJycsList){
+                    if(kpiDataJycs2.getDepart().equals(htereceivedJycs.getDepart())){
+                        kpiDataJycs2.setContractAmount(htereceivedJycs.getContractAmount());//合同额
+                        kpiDataJycs2.setReceived(htereceivedJycs.getReceived());//已收款
+                        break;
+                    }
+                }
+                //计算完成度  合同额(是计算的某个月或某个年的合同额 增量)/ 指标
+                if(kpiDataJycs2.getDepartKpi() != null){
+                    if(kpiDataJycs2.getDepartKpi().equals(BigDecimal.valueOf(0))){
+                        kpiDataJycs2.setKpiCompletRate(BigDecimal.valueOf(1));
+                    }else{
+                        kpiDataJycs2.setKpiCompletRate(kpiDataJycs2.getContractAmount().divide(kpiDataJycs2.getDepartKpi(), 2, RoundingMode.HALF_UP));
+                    }
+                }
+            }
+//        System.out.println(kpiDataJycsList);
+            //下达部门指标完成度排序
+            kpiDataJycsList.sort(Comparator.comparing(IndexKpiCompletByDate::getKpiCompletRate, Comparator.nullsFirst(BigDecimal::compareTo)).reversed());
+//            System.out.println(kpiDataJycsList);
+        });
+        CompletableFuture<Void> future2 = CompletableFuture.allOf(setKpiDataZrbmList, setKpiDataJycsList);
+        future2.join();
+//        System.out.println(kpiDataZrbmList);
+//        System.out.println(kpiDataJycsList);
+        indexKpiDataDepart.setZrbmCharts(kpiDataZrbmList);
+        indexKpiDataDepart.setJycsCharts(kpiDataJycsList);
+
+        return indexKpiDataDepart;
+    }
+
+
+
+    public List<IndexKpiCompletByDate> testSort(){
+        List<IndexKpiCompletByDate> indexKpiCompletByDateList = new ArrayList<>();
+        BigDecimal bigDecInit = new BigDecimal(0);
+        IndexKpiCompletByDate indexKpiCompletByDate = new IndexKpiCompletByDate();
+        indexKpiCompletByDate.setKpiCompletRate(null);
+        IndexKpiCompletByDate indexKpiCompletByDate2 = new IndexKpiCompletByDate();
+        indexKpiCompletByDate2.setKpiCompletRate(bigDecInit);
+        IndexKpiCompletByDate indexKpiCompletByDate3 = new IndexKpiCompletByDate();
+        indexKpiCompletByDate3.setKpiCompletRate(new BigDecimal(1));
+        IndexKpiCompletByDate indexKpiCompletByDate4 = new IndexKpiCompletByDate();
+        indexKpiCompletByDate4.setKpiCompletRate(new BigDecimal(11));
+        IndexKpiCompletByDate indexKpiCompletByDate5 = new IndexKpiCompletByDate();
+        indexKpiCompletByDate5.setKpiCompletRate(new BigDecimal(0));
+        IndexKpiCompletByDate indexKpiCompletByDate6 = new IndexKpiCompletByDate();
+        indexKpiCompletByDate6.setKpiCompletRate(null);
+        indexKpiCompletByDateList.add(indexKpiCompletByDate);
+        indexKpiCompletByDateList.add(indexKpiCompletByDate2);
+        indexKpiCompletByDateList.add(indexKpiCompletByDate3);
+        indexKpiCompletByDateList.add(indexKpiCompletByDate4);
+        indexKpiCompletByDateList.add(indexKpiCompletByDate5);
+        indexKpiCompletByDateList.add(indexKpiCompletByDate6);
+
+        indexKpiCompletByDateList.sort(Comparator.comparing(IndexKpiCompletByDate::getKpiCompletRate, Comparator.nullsFirst(BigDecimal::compareTo)));
+        System.out.println(indexKpiCompletByDateList);
+        indexKpiCompletByDateList.sort(Comparator.comparing(IndexKpiCompletByDate::getKpiCompletRate, Comparator.nullsFirst(BigDecimal::compareTo)).reversed());
+        System.out.println(indexKpiCompletByDateList);
+
+
+
+
+
+
+        return indexKpiCompletByDateList;
+    }
+
+}

+ 225 - 15
module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexServiceImpl.java

@@ -8,7 +8,10 @@ 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.RedisUtil;
+import org.jeecg.modules.Index.entity.pojo.LreInfoByDate;
+import org.jeecg.modules.Index.entity.pojo.ReceivedByDate;
 import org.jeecg.modules.Index.mapper.IndexMapper;
+import org.jeecg.modules.Index.service.IndexZcbService;
 import org.jeecg.modules.Index.util.AuthMark;
 import org.jeecg.modules.Index.util.CacheKey;
 import org.jeecg.modules.Index.entity.dto.IndexInfoParamDto;
@@ -80,6 +83,15 @@ public class IndexServiceImpl implements IndexService {
     private IndexMapper indexMapper;
 
     /**
+     * indexZcbMapper
+     */
+    @Autowired
+    @SuppressWarnings("all")
+    private IndexZcbService indexZcbService;
+
+
+
+    /**
      * 科研任务信息表
      */
     @Autowired
@@ -114,6 +126,10 @@ public class IndexServiceImpl implements IndexService {
         incomeDataInfoVO.setMonthTotal(initValue);
         incomeDataInfoVO.setMonthHb(initValue);
         incomeDataInfoVO.setMonthTb(initValue);
+        //sl添加,计算利润额使用
+        incomeDataInfoVO.setMonthTq(initValue);
+        incomeDataInfoVO.setMonthLast(initValue);
+
 
         String depart = null;
         ArrayList<String> tasknoList = new ArrayList<>();
@@ -250,6 +266,9 @@ public class IndexServiceImpl implements IndexService {
         incomeDataInfoVO.setYearTotal(currentYearTotal.setScale(2, RoundingMode.HALF_UP));
         incomeDataInfoVO.setYearTq(lastYearTqTotal.setScale(2, RoundingMode.HALF_UP));
         incomeDataInfoVO.setMonthTotal(currentMonthTotal.setScale(2, RoundingMode.HALF_UP));
+        //sl添加,计算利润额使用
+        incomeDataInfoVO.setMonthTq(lastYearMonthTqTotal);
+        incomeDataInfoVO.setMonthLast(lastMothTqTotal);
 
 
         CompletableFuture<BigDecimal> incomeYearTbFuture = CompletableFuture.supplyAsync(() -> {
@@ -1720,14 +1739,35 @@ public class IndexServiceImpl implements IndexService {
      *
      * @return
      */
-    public List<String> testSl() {
+    public List<String> testSl(IndexInfoParamDto indexInfoParamDto) {
         List<String> tasknoList = new ArrayList<>();
-        System.out.println(tasknoList);
+//        System.out.println(tasknoList);
+        //得到日期列表
+        //年/月
+        String timeType = indexInfoParamDto.getTime();
+        //起始时间
+        String startString = indexInfoParamDto.getBeginDate();
+        //结束时间
+        String endString = indexInfoParamDto.getEndDate();
+
+        if(timeType.equals("year")){
+            List<LreInfoByDate> lreDetail = indexMapper.getTasknoByGroupYear(startString, endString);
+            System.out.println(lreDetail);
+        }else if(timeType.equals("month")){
+            List<LreInfoByDate> lreDetail = indexMapper.getTasknoByGroupMonth(startString, endString);
+            System.out.println(lreDetail);
+        }
+
+
 
         return tasknoList;
     }
 
 
+
+
+
+
     /**
      * 首页一层利润额参数类 IndexTotalVo 初始化
      */
@@ -1740,6 +1780,8 @@ public class IndexServiceImpl implements IndexService {
         indexTotalVo.setMonthTotal(initValue);
         indexTotalVo.setMonthTb(initValue);
         indexTotalVo.setMonthHb(initValue);
+        indexTotalVo.setMonthTq(initValue);
+        indexTotalVo.setMonthLast(initValue);
         return indexTotalVo;
     }
 
@@ -2241,6 +2283,10 @@ 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("查到的所有部门对应的任务号列表:");
@@ -2249,12 +2295,48 @@ public class IndexServiceImpl implements IndexService {
 //        System.out.println(indexChartInfoVo);
 
         //4.计算该时间列表中某年或某月对应的总收款
+        List<ReceivedByDate> receivedByDates = new ArrayList<>();
+        if(timeType.equals("year")){
+            receivedByDates = exchangeMapper.getReceivedAllByYear(startString, endString);
+//            System.out.println("已收款二层按年查询结果:");
+//            for(ReceivedByDate receivedByDate:receivedByDates){
+//                System.out.println(receivedByDate.getDate());
+//                System.out.println(receivedByDate.getReceived());
+//            }
+//            System.out.println(receivedByDates);
+
+        }else if(timeType.equals("month")){
+            receivedByDates = exchangeMapper.getReceivedAllByYMonth(startString, endString);
+//            System.out.println("已收款二层按月查询结果:");
+//            for(ReceivedByDate receivedByDate:receivedByDates){
+//                System.out.println(receivedByDate.getDate());
+//                System.out.println(receivedByDate.getReceived());
+//            }
+//            System.out.println(receivedByDates);
+        }
+        if(receivedByDates.isEmpty()) return indexChartInfoVo;
+
+        for(ReceivedByDate receivedByDate:receivedByDates){
+            String date = receivedByDate.getDate();
+            if(timeRangeList.contains(date)){
+                seriesDataList.set(timeRangeList.indexOf(date), receivedByDate.getReceived());
+            }
+        }
+        //添加横坐标列表
+        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);
@@ -2292,6 +2374,10 @@ public class IndexServiceImpl implements IndexService {
         //添加横纵坐标列表
         indexChartInfoVo.setXAxisData(timeRangeList);
         indexChartInfoVo.setSeriesData(seriesDataList2);
+
+        */
+
+
         return indexChartInfoVo;
     }
 
@@ -2341,19 +2427,58 @@ public class IndexServiceImpl implements IndexService {
         //3.通过登录的用户找到相应的部门,可能一个或两个
         //获取部门名称列表
         List<String> sysDepartNames = sysDepartMapper.getSysUserOfDepartNameList(userId);
-        if (sysDepartNames.isEmpty()) return indexChartInfoVo;
-
-        ArrayList<String> tasknoList = new ArrayList<>();
-        List<String> ZrbmTasknoList = projectCostMapper.queryZrbmTasknoListbydepartNames(sysDepartNames);
-        List<String> XdbmTasknoList = projectCostMapper.queryXdbmTasknoListbydepartNames(sysDepartNames);
-        tasknoList.addAll(ZrbmTasknoList);
-        tasknoList.addAll(XdbmTasknoList);
-        System.out.println("查到的所有部门对应的任务号列表:");
-        System.out.println(tasknoList);
-        if (tasknoList.isEmpty()) return indexChartInfoVo;
+        System.out.println("查出的部门列表:");
+        System.out.println(sysDepartNames);
+        if(sysDepartNames.isEmpty()) return indexChartInfoVo;
+
+//        ArrayList<String> tasknoList = new ArrayList<>();
+//        List<String> ZrbmTasknoList = projectCostMapper.queryZrbmTasknoListbydepartNames(sysDepartNames);
+//        List<String> XdbmTasknoList = projectCostMapper.queryXdbmTasknoListbydepartNames(sysDepartNames);
+//        System.out.println(ZrbmTasknoList);
+//        System.out.println(XdbmTasknoList);
+//        tasknoList.addAll(ZrbmTasknoList);
+//        tasknoList.addAll(XdbmTasknoList);
+//        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.getReceivedByYear2(sysDepartNames, startString, endString);
+            System.out.println("部门领导已收款二层按年查询结果:");
+            for(ReceivedByDate receivedByDate:receivedByDates){
+                System.out.println(receivedByDate.getDate());
+                System.out.println(receivedByDate.getReceived());
+            }
+            System.out.println(receivedByDates);
+
+        }else if(timeType.equals("month")){
+            receivedByDates = exchangeMapper.getReceivedByYMonth2(sysDepartNames, startString, endString);
+            System.out.println("部门领导已收款二层按月查询结果:");
+            for(ReceivedByDate receivedByDate:receivedByDates){
+                System.out.println(receivedByDate.getDate());
+                System.out.println(receivedByDate.getReceived());
+            }
+            System.out.println(receivedByDates);
+        }
+        if(receivedByDates.isEmpty()) return indexChartInfoVo;
+
+        for(ReceivedByDate receivedByDate:receivedByDates){
+            String date = receivedByDate.getDate();
+            if(timeRangeList.contains(date)){
+                seriesDataList.set(timeRangeList.indexOf(date), receivedByDate.getReceived());
+            }
+        }
+        //添加横坐标列表
+        indexChartInfoVo.setXAxisData(timeRangeList);
+        //添加纵坐标列表
+        indexChartInfoVo.setSeriesData(seriesDataList);
+
+
+
+        /*
         //创建CompletableFuture集合,因为allOf()方法参数可变参数
         List<CompletableFuture<BigDecimal>> futures = new ArrayList<>();
         for (String timeRange2 : timeRangeList) {
@@ -2398,6 +2523,8 @@ public class IndexServiceImpl implements IndexService {
         indexChartInfoVo.setXAxisData(timeRangeList);
         indexChartInfoVo.setSeriesData(seriesDataList2);
 
+        */
+
         return indexChartInfoVo;
     }
 
@@ -2408,7 +2535,72 @@ public class IndexServiceImpl implements IndexService {
      *
      * @return
      */
-    public IndexTotalVo getLreByRole() {
+    public IndexTotalVo getLreByRole(HttpServletRequest request) {
+        //初始化
+        IndexTotalVo lrIndexTotalVo = indexTotalVoInit();
+
+        //获取一层合同额
+        IndexTotalVo hteindexTotalVo = getTotalIncome(request);
+        //获取一层支出成本额
+        IndexTotalVo zceindexTotalVo = indexZcbService.getZhiChuTotalList().get(0);
+        System.out.println(hteindexTotalVo);
+        System.out.println(zceindexTotalVo);
+
+        //当年利润额 合同额-成本额
+        if(hteindexTotalVo.getYearTotal() == null) hteindexTotalVo.setYearTotal(BigDecimal.valueOf(0));
+        if(zceindexTotalVo.getYearTotal() == null) zceindexTotalVo.setYearTotal(BigDecimal.valueOf(0));
+        BigDecimal lreYearTotal = hteindexTotalVo.getYearTotal().subtract(zceindexTotalVo.getYearTotal());
+        //去年同期利润额 去年同期合同额-去年同期成本额
+        if(hteindexTotalVo.getYearTq() == null) hteindexTotalVo.setYearTq(BigDecimal.valueOf(0));
+        if(zceindexTotalVo.getYearTq() == null) zceindexTotalVo.setYearTq(BigDecimal.valueOf(0));
+        BigDecimal lreLastYearTotal = hteindexTotalVo.getYearTq().subtract(zceindexTotalVo.getYearTq());
+        //当月利润额 当月合同额-当月成本额
+        if(hteindexTotalVo.getMonthTotal() == null) hteindexTotalVo.setMonthTotal(BigDecimal.valueOf(0));
+        if(zceindexTotalVo.getMonthTotal() == null) zceindexTotalVo.setMonthTotal(BigDecimal.valueOf(0));
+        BigDecimal lreMonthTotal = hteindexTotalVo.getMonthTotal().subtract(zceindexTotalVo.getMonthTotal());
+        //去年同期月份利润额 去年同期月份合同额-去年同期月份成本额
+        if(hteindexTotalVo.getMonthTq() == null) hteindexTotalVo.setMonthTq(BigDecimal.valueOf(0));
+        if(zceindexTotalVo.getMonthTq() == null) zceindexTotalVo.setMonthTq(BigDecimal.valueOf(0));
+        BigDecimal lreTqMonthTotal = hteindexTotalVo.getMonthTq().subtract(zceindexTotalVo.getMonthTq());
+        //上个月利润额 上个月合同额-上个月成本额
+        if(hteindexTotalVo.getMonthLast() == null) hteindexTotalVo.setMonthLast(BigDecimal.valueOf(0));
+        if(zceindexTotalVo.getMonthLast() == null) zceindexTotalVo.setMonthLast(BigDecimal.valueOf(0));
+        BigDecimal lreLastMonthTotal = hteindexTotalVo.getMonthLast().subtract(zceindexTotalVo.getMonthLast());
+
+        //年同比   (当年利润-去年利润)/去年利润
+        BigDecimal lrYearTb = BigDecimal.valueOf(0);
+        if(lreLastYearTotal.compareTo(BigDecimal.valueOf(0)) == 0){
+            lrYearTb = BigDecimal.valueOf(1);
+        }else {
+            lrYearTb = (lreYearTotal.subtract(lreLastYearTotal)).divide(lreLastYearTotal, 2, BigDecimal.ROUND_HALF_UP);
+        }
+        //月同比   (当月利润-去年同期月份利润)/去年同期月份利润
+        BigDecimal lrMonthTb = BigDecimal.valueOf(0);
+        if(lreTqMonthTotal.compareTo(BigDecimal.valueOf(0)) == 0){
+            lrMonthTb = BigDecimal.valueOf(1);
+        }else {
+            lrMonthTb = (lreMonthTotal.subtract(lreTqMonthTotal)).divide(lreTqMonthTotal, 2, BigDecimal.ROUND_HALF_UP);
+        }
+        //月环比   (当月利润-上个月利润)/上个月利润
+        BigDecimal lrMonthHb = BigDecimal.valueOf(0);
+        if(lreLastMonthTotal.compareTo(BigDecimal.valueOf(0)) == 0){
+            lrMonthHb = BigDecimal.valueOf(1);
+        }else {
+            lrMonthHb = (lreMonthTotal.subtract(lreLastMonthTotal)).divide(lreLastMonthTotal, 2, BigDecimal.ROUND_HALF_UP);
+        }
+
+        lrIndexTotalVo.setYearTotal(lreYearTotal);//当年利润
+        lrIndexTotalVo.setYearTq(lreLastYearTotal);//去年同期利润
+        lrIndexTotalVo.setYearTb(lrYearTb);//年同比
+        lrIndexTotalVo.setMonthTotal(lreMonthTotal);//当月利润
+        lrIndexTotalVo.setMonthTq(lreTqMonthTotal);//去年同期月份利润
+        lrIndexTotalVo.setMonthLast(lreLastMonthTotal);//上个月利润
+        lrIndexTotalVo.setMonthTb(lrMonthTb);//月同比
+        lrIndexTotalVo.setMonthHb(lrMonthHb);//月环比
+
+        return lrIndexTotalVo;
+
+        /*
         //初始化
         IndexTotalVo indexTotalVo = indexTotalVoInit();
         //获取角色
@@ -2431,15 +2623,30 @@ public class IndexServiceImpl implements IndexService {
             indexTotalVo = getLreOne(departNames);
         }
         return indexTotalVo;
+        */
+
     }
 
     /**
-     * 首页二层  利润额
+     * 首页二层  利润额     根据合同额和支出成本来进行计算
      * 通过登录的用户找到角色,根据角色来判断部门,根据部门和实际完成时间选择任务列表,根据任务列表计算利润额
      *
      * @return
      */
-    public IndexChartInfoVo<BigDecimal> getLreDetailByRole(IndexInfoParamDto indexInfoParamDto) {
+    public IndexChartInfoVo<BigDecimal> getLreDetailByRole(HttpServletRequest request, IndexInfoParamDto indexInfoParamDto) {
+        //初始化
+        IndexChartInfoVo<BigDecimal> indexChartInfoVo = indexChartInfoVoInit();
+
+        //获取二层合同额
+        ContractChartInfoVo contractChartInfoVo = getContractAmountInfo(request, indexInfoParamDto);
+        System.out.println(contractChartInfoVo);
+        //获取二层支出成本额 八项成本
+        List<IndexChartInfoVo> resultList = indexZcbService.getEightCostsList(indexInfoParamDto);
+        System.out.println(resultList);
+
+        return indexChartInfoVo;
+
+        /*
         //初始化
         IndexChartInfoVo<BigDecimal> indexChartInfoVo = indexChartInfoVoInit();
 
@@ -2461,6 +2668,9 @@ public class IndexServiceImpl implements IndexService {
         }
 
         return indexChartInfoVo;
+        */
+
+
     }
 
     /**

+ 3 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexZcbServiceImpl.java

@@ -192,6 +192,9 @@ public class IndexZcbServiceImpl implements IndexZcbService {
             projectZhiChu.setMonthTb(zcbMonthTb); //当月同比
             projectZhiChu.setMonthHb(zcbMonthHb); //当月环比
             projectZhiChu.setYearTb(zcbYearTb); //同比增长率
+            //sl添加,计算利润额使用
+            projectZhiChu.setMonthTq(upYearTq);//去年同期月份支出
+            projectZhiChu.setMonthLast(sgyMonthHb);//上个月支出
             projectZhiChusList.add(projectZhiChu);
 
         }

+ 1 - 1
module_kzks/src/main/java/org/jeecg/modules/kpiImportList/controller/KpiImportListController.java

@@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
  /**
  * @Description: 年指标导入
  * @Author: jeecg-boot
- * @Date:   2023-10-12
+ * @Date:   2023-10-16
  * @Version: V1.0
  */
 @Api(tags="年指标导入")

+ 8 - 6
module_kzks/src/main/java/org/jeecg/modules/kpiImportList/entity/KpiImportList.java

@@ -21,7 +21,7 @@ import lombok.experimental.Accessors;
 /**
  * @Description: 年指标导入
  * @Author: jeecg-boot
- * @Date:   2023-10-12
+ * @Date:   2023-10-16
  * @Version: V1.0
  */
 @Data
@@ -56,15 +56,13 @@ public class KpiImportList implements Serializable {
     @ApiModelProperty(value = "所属部门")
     private java.lang.String sysOrgCode;
 	/**指标年份*/
-	@Excel(name = "指标年份", width = 15, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern="yyyy-MM-dd")
+	@Excel(name = "指标年份", width = 15)
     @ApiModelProperty(value = "指标年份")
-    private java.util.Date year;
+    private java.lang.Integer year;
 	/**指标金额*/
 	@Excel(name = "指标金额", width = 15)
     @ApiModelProperty(value = "指标金额")
-    private java.lang.String kpi;
+    private java.math.BigDecimal kpi;
 	/**平均每月*/
 	@Excel(name = "平均每月", width = 15)
     @ApiModelProperty(value = "平均每月")
@@ -73,4 +71,8 @@ public class KpiImportList implements Serializable {
 	@Excel(name = "指标部门", width = 15)
     @ApiModelProperty(value = "指标部门")
     private java.lang.String department;
+	/**指标年月*/
+	@Excel(name = "指标年月", width = 15)
+    @ApiModelProperty(value = "指标年月")
+    private java.lang.String ym;
 }

+ 1 - 1
module_kzks/src/main/java/org/jeecg/modules/kpiImportList/mapper/KpiImportListMapper.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 /**
  * @Description: 年指标导入
  * @Author: jeecg-boot
- * @Date:   2023-10-12
+ * @Date:   2023-10-16
  * @Version: V1.0
  */
 public interface KpiImportListMapper extends BaseMapper<KpiImportList> {

+ 1 - 1
module_kzks/src/main/java/org/jeecg/modules/kpiImportList/service/IKpiImportListService.java

@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 /**
  * @Description: 年指标导入
  * @Author: jeecg-boot
- * @Date:   2023-10-12
+ * @Date:   2023-10-16
  * @Version: V1.0
  */
 public interface IKpiImportListService extends IService<KpiImportList> {

+ 1 - 1
module_kzks/src/main/java/org/jeecg/modules/kpiImportList/service/impl/KpiImportListServiceImpl.java

@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 /**
  * @Description: 年指标导入
  * @Author: jeecg-boot
- * @Date:   2023-10-12
+ * @Date:   2023-10-16
  * @Version: V1.0
  */
 @Service

+ 215 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiImportList/vue/KpiImportListList.vue

@@ -0,0 +1,215 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="指标年份">
+              <a-input placeholder="请输入指标年份" v-model="queryParam.year"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="指标部门">
+              <a-input placeholder="请输入指标部门" v-model="queryParam.department"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('年指标导入')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <kpi-import-list-modal ref="modalForm" @ok="modalFormOk"></kpi-import-list-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import KpiImportListModal from './modules/KpiImportListModal'
+
+  export default {
+    name: 'KpiImportListList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      KpiImportListModal
+    },
+    data () {
+      return {
+        description: '年指标导入管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'指标年份',
+            align:"center",
+            dataIndex: 'year'
+          },
+          {
+            title:'指标金额',
+            align:"center",
+            dataIndex: 'kpi'
+          },
+          {
+            title:'平均每月',
+            align:"center",
+            dataIndex: 'kpiMonth'
+          },
+          {
+            title:'指标部门',
+            align:"center",
+            dataIndex: 'department'
+          },
+          {
+            title:'指标年月',
+            align:"center",
+            dataIndex: 'ym'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/kpiImportList/kpiImportList/list",
+          delete: "/kpiImportList/kpiImportList/delete",
+          deleteBatch: "/kpiImportList/kpiImportList/deleteBatch",
+          exportXlsUrl: "/kpiImportList/kpiImportList/exportXls",
+          importExcelUrl: "kpiImportList/kpiImportList/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'int',value:'year',text:'指标年份',dictCode:''})
+        fieldList.push({type:'BigDecimal',value:'kpi',text:'指标金额',dictCode:''})
+        fieldList.push({type:'string',value:'kpiMonth',text:'平均每月',dictCode:''})
+        fieldList.push({type:'string',value:'department',text:'指标部门',dictCode:''})
+        fieldList.push({type:'string',value:'ym',text:'指标年月',dictCode:''})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiImportList/vue/KpiImportList_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/kpiImportList文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) 
+VALUES ('2023101611029980560', NULL, '年指标导入', '/kpiImportList/kpiImportListList', 'kpiImportList/KpiImportListList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-10-16 11:02:56', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023101611029980561', '2023101611029980560', '添加年指标导入', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:kzks_kpi_import_list:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-10-16 11:02:56', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023101611029980562', '2023101611029980560', '编辑年指标导入', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:kzks_kpi_import_list:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-10-16 11:02:56', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023101611029980563', '2023101611029980560', '删除年指标导入', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:kzks_kpi_import_list:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-10-16 11:02:56', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023101611029980564', '2023101611029980560', '批量删除年指标导入', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:kzks_kpi_import_list:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-10-16 11:02:56', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023101611029980565', '2023101611029980560', '导出excel_年指标导入', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:kzks_kpi_import_list:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-10-16 11:02:56', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023101611029980566', '2023101611029980560', '导入excel_年指标导入', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:kzks_kpi_import_list:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-10-16 11:02:56', NULL, NULL, 0, 0, '1', 0);

+ 134 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiImportList/vue/modules/KpiImportListForm.vue

@@ -0,0 +1,134 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="指标年份" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="year">
+              <a-input-number v-model="model.year" placeholder="请输入指标年份" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="指标金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kpi">
+              <a-input-number v-model="model.kpi" placeholder="请输入指标金额" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="平均每月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kpiMonth">
+              <a-input v-model="model.kpiMonth" placeholder="请输入平均每月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="指标部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="department">
+              <a-input v-model="model.department" placeholder="请输入指标部门"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="指标年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ym">
+              <a-input v-model="model.ym" placeholder="请输入指标年月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'KpiImportListForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           year: [
+              { required: true, message: '请输入指标年份!'},
+           ],
+           kpi: [
+              { required: true, message: '请输入指标金额!'},
+              { pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'},
+           ],
+           department: [
+              { required: true, message: '请输入指标部门!'},
+           ],
+        },
+        url: {
+          add: "/kpiImportList/kpiImportList/add",
+          edit: "/kpiImportList/kpiImportList/edit",
+          queryById: "/kpiImportList/kpiImportList/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiImportList/vue/modules/KpiImportListModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <kpi-import-list-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></kpi-import-list-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import KpiImportListForm from './KpiImportListForm'
+
+  export default {
+    name: 'KpiImportListModal',
+    components: {
+      KpiImportListForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiImportList/vue/modules/KpiImportListModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <kpi-import-list-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></kpi-import-list-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import KpiImportListForm from './KpiImportListForm'
+  export default {
+    name: 'KpiImportListModal',
+    components: {
+      KpiImportListForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 177 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/controller/KpiProjectMonthController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.kpiProjectMonth.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.kpiProjectMonth.entity.KpiProjectMonth;
+import org.jeecg.modules.kpiProjectMonth.service.IKpiProjectMonthService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: 每月月底考核项目进度表
+ * @Author: jeecg-boot
+ * @Date:   2023-10-12
+ * @Version: V1.0
+ */
+@Api(tags="每月月底考核项目进度表")
+@RestController
+@RequestMapping("/kpiProjectMonth/kpiProjectMonth")
+@Slf4j
+public class KpiProjectMonthController extends JeecgController<KpiProjectMonth, IKpiProjectMonthService> {
+	@Autowired
+	private IKpiProjectMonthService kpiProjectMonthService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param kpiProjectMonth
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "每月月底考核项目进度表-分页列表查询")
+	@ApiOperation(value="每月月底考核项目进度表-分页列表查询", notes="每月月底考核项目进度表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<KpiProjectMonth>> queryPageList(KpiProjectMonth kpiProjectMonth,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<KpiProjectMonth> queryWrapper = QueryGenerator.initQueryWrapper(kpiProjectMonth, req.getParameterMap());
+		Page<KpiProjectMonth> page = new Page<KpiProjectMonth>(pageNo, pageSize);
+		IPage<KpiProjectMonth> pageList = kpiProjectMonthService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param kpiProjectMonth
+	 * @return
+	 */
+	@AutoLog(value = "每月月底考核项目进度表-添加")
+	@ApiOperation(value="每月月底考核项目进度表-添加", notes="每月月底考核项目进度表-添加")
+	//@RequiresPermissions("org.jeecg.modules:kzks_kpi_project_month:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody KpiProjectMonth kpiProjectMonth) {
+		kpiProjectMonthService.save(kpiProjectMonth);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param kpiProjectMonth
+	 * @return
+	 */
+	@AutoLog(value = "每月月底考核项目进度表-编辑")
+	@ApiOperation(value="每月月底考核项目进度表-编辑", notes="每月月底考核项目进度表-编辑")
+	//@RequiresPermissions("org.jeecg.modules:kzks_kpi_project_month:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody KpiProjectMonth kpiProjectMonth) {
+		kpiProjectMonthService.updateById(kpiProjectMonth);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "每月月底考核项目进度表-通过id删除")
+	@ApiOperation(value="每月月底考核项目进度表-通过id删除", notes="每月月底考核项目进度表-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:kzks_kpi_project_month:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		kpiProjectMonthService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "每月月底考核项目进度表-批量删除")
+	@ApiOperation(value="每月月底考核项目进度表-批量删除", notes="每月月底考核项目进度表-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:kzks_kpi_project_month:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.kpiProjectMonthService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "每月月底考核项目进度表-通过id查询")
+	@ApiOperation(value="每月月底考核项目进度表-通过id查询", notes="每月月底考核项目进度表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<KpiProjectMonth> queryById(@RequestParam(name="id",required=true) String id) {
+		KpiProjectMonth kpiProjectMonth = kpiProjectMonthService.getById(id);
+		if(kpiProjectMonth==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(kpiProjectMonth);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param kpiProjectMonth
+    */
+    //@RequiresPermissions("org.jeecg.modules:kzks_kpi_project_month:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, KpiProjectMonth kpiProjectMonth) {
+        return super.exportXls(request, kpiProjectMonth, KpiProjectMonth.class, "每月月底考核项目进度表");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("kzks_kpi_project_month:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, KpiProjectMonth.class);
+    }
+
+}

+ 94 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/entity/KpiProjectMonth.java

@@ -0,0 +1,94 @@
+package org.jeecg.modules.kpiProjectMonth.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 每月月底考核项目进度表
+ * @Author: jeecg-boot
+ * @Date:   2023-10-12
+ * @Version: V1.0
+ */
+@Data
+@TableName("kzks_kpi_project_month")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="kzks_kpi_project_month对象", description="每月月底考核项目进度表")
+public class KpiProjectMonth implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private java.lang.String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private java.lang.String createBy;
+	/**创建日期*/
+	@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;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private java.lang.String updateBy;
+	/**更新日期*/
+	@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;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private java.lang.String sysOrgCode;
+	/**任务号/来自科研任务*/
+	@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)
+    @ApiModelProperty(value = "责任部门/来自科研任务")
+    private java.lang.String zrbm;
+	/**下达部门/来自科研任务*/
+	@Excel(name = "下达部门/来自科研任务", width = 15)
+    @ApiModelProperty(value = "下达部门/来自科研任务")
+    private java.lang.String jycs;
+	/**合同额/来自收款合同的合同分配额 */
+	@Excel(name = "合同额/来自收款合同的合同分配额 ", width = 15)
+    @ApiModelProperty(value = "合同额/来自收款合同的合同分配额 ")
+    private java.math.BigDecimal contractfpe;
+	/**已收款/ 来自合同收款详细的任务收款额*/
+	@Excel(name = "已收款/ 来自合同收款详细的任务收款额", width = 15)
+    @ApiModelProperty(value = "已收款/ 来自合同收款详细的任务收款额")
+    private java.math.BigDecimal taskmoney;
+	/**当前任务进度的年份*/
+	@Excel(name = "当前任务进度的年份", width = 15)
+    @ApiModelProperty(value = "当前任务进度的年份")
+    private java.lang.Integer year;
+	/**当前任务进度的月份*/
+	@Excel(name = "当前任务进度的月份", width = 15)
+    @ApiModelProperty(value = "当前任务进度的月份")
+    private java.lang.Integer month;
+	/**当前任务进度的年月*/
+	@Excel(name = "当前任务进度的年月", width = 15)
+    @ApiModelProperty(value = "当前任务进度的年月")
+    private java.lang.String ym;
+}

+ 17 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/mapper/KpiProjectMonthMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.kpiProjectMonth.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.kpiProjectMonth.entity.KpiProjectMonth;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 每月月底考核项目进度表
+ * @Author: jeecg-boot
+ * @Date:   2023-10-12
+ * @Version: V1.0
+ */
+public interface KpiProjectMonthMapper extends BaseMapper<KpiProjectMonth> {
+
+}

+ 5 - 0
module_kzks/src/main/java/org/jeecg/modules/kpiProjectMonth/mapper/xml/KpiProjectMonthMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.kpiProjectMonth.mapper.KpiProjectMonthMapper">
+
+</mapper>

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

@@ -0,0 +1,14 @@
+package org.jeecg.modules.kpiProjectMonth.service;
+
+import org.jeecg.modules.kpiProjectMonth.entity.KpiProjectMonth;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 每月月底考核项目进度表
+ * @Author: jeecg-boot
+ * @Date:   2023-10-12
+ * @Version: V1.0
+ */
+public interface IKpiProjectMonthService extends IService<KpiProjectMonth> {
+
+}

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

@@ -0,0 +1,19 @@
+package org.jeecg.modules.kpiProjectMonth.service.impl;
+
+import org.jeecg.modules.kpiProjectMonth.entity.KpiProjectMonth;
+import org.jeecg.modules.kpiProjectMonth.mapper.KpiProjectMonthMapper;
+import org.jeecg.modules.kpiProjectMonth.service.IKpiProjectMonthService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 每月月底考核项目进度表
+ * @Author: jeecg-boot
+ * @Date:   2023-10-12
+ * @Version: V1.0
+ */
+@Service
+public class KpiProjectMonthServiceImpl extends ServiceImpl<KpiProjectMonthMapper, KpiProjectMonth> implements IKpiProjectMonthService {
+
+}

+ 11 - 4
module_kzks/src/main/java/org/jeecg/modules/xmcbDetail/mapper/ComContractInfoExchangeMapper.java

@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.jeecg.modules.Index.entity.pojo.ContractAmount;
+import org.jeecg.modules.Index.entity.pojo.ReceivedByDate;
 import org.jeecg.modules.xmcbDetail.entity.ComContractInfoExchange;
 import org.jeecg.modules.xmcbDetail.vo.ComContractInfoExchangeHTEVO;
 import org.jeecg.modules.xmcbDetail.vo.ComContractInfoExchangeYSKVO;
@@ -65,15 +66,21 @@ public interface ComContractInfoExchangeMapper extends BaseMapper<ComContractInf
     List<ContractAmount> getContractAmountandNumByMonthIfBoss(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
     /*所长按年查询已收款*/
-    @Select("select sum(a.rwskje) from (select dkhpdqrq,rwskje from com_contract_info_exchange where sjly = 40) a where YEAR(a.dkhpdqrq)=#{year}")
-    BigDecimal getReceivedAllByYear(@Param("year") String year);
+//    @Select("select sum(a.rwskje) from (select dkhpdqrq,rwskje from com_contract_info_exchange where sjly = 40) a where YEAR(a.dkhpdqrq)=#{year}")
+//    BigDecimal getReceivedAllByYear(@Param("year") String year);
+    @Select("select year(a.dkhpdqrq) as date,sum(a.rwskje) as received from (select dkhpdqrq,rwskje from com_contract_info_exchange where sjly = 40) a where YEAR(a.dkhpdqrq) BETWEEN #{beginDate} and #{endDate} group by year(a.dkhpdqrq)")
+    List<ReceivedByDate> getReceivedAllByYear(@Param("beginDate") String beginDate, @Param("endDate") String endDate);
     /*所长按年月查询已收款*/
-    @Select("select sum(a.rwskje) from (select dkhpdqrq,rwskje from com_contract_info_exchange where sjly = 40) a where DATE_FORMAT(a.dkhpdqrq,'%Y-%m')=#{ym}")
-    BigDecimal getReceivedAllByYMonth(@Param("ym") String ym);
+//    @Select("select sum(a.rwskje) from (select dkhpdqrq,rwskje from com_contract_info_exchange where sjly = 40) a where DATE_FORMAT(a.dkhpdqrq,'%Y-%m')=#{ym}")
+//    BigDecimal getReceivedAllByYMonth(@Param("ym") String ym);
+    @Select("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 where sjly = 40) a where CONCAT(year(a.dkhpdqrq), '-', LPAD(month(a.dkhpdqrq), 2, '0')) <= #{endDate} and CONCAT(year(a.dkhpdqrq), '-', LPAD(month(a.dkhpdqrq), 2, '0')) >= #{beginDate} group by year(a.dkhpdqrq), month(a.dkhpdqrq)")
+    List<ReceivedByDate> getReceivedAllByYMonth(@Param("beginDate") String beginDate, @Param("endDate") String endDate);
 
     /*部门领导按年查询已收款*/
     BigDecimal getReceivedByYear(@Param("tasknoList") List<String> tasknoList, @Param("year") String year);
+    List<ReceivedByDate> getReceivedByYear2(@Param("departNames") List<String> departNames, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
     /*部门领导按年月查询已收款*/
     BigDecimal getReceivedByYMonth(@Param("tasknoList") List<String> tasknoList, @Param("ym") String ym);
+    List<ReceivedByDate> getReceivedByYMonth2(@Param("departNames") List<String> departNames, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
 
 }

+ 35 - 0
module_kzks/src/main/java/org/jeecg/modules/xmcbDetail/mapper/xml/ComContractInfoExchangeMapper.xml

@@ -146,6 +146,41 @@
         </foreach>
     </select>
 
+    <!--部门按年查询已收款 -->
+    <select id="getReceivedByYear2" resultType="org.jeecg.modules.Index.entity.pojo.ReceivedByDate">
+        select year(a.dkhpdqrq) as date,sum(a.rwskje) as received from com_contract_info_exchange a
+        where YEAR(a.dkhpdqrq) BETWEEN #{beginDate} and #{endDate}
+        and (a.rwbh in(select taskno from ky_task_info 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="getReceivedByYMonth2" 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 a
+        where CONCAT(year(a.dkhpdqrq), "-", LPAD(month(a.dkhpdqrq), 2, "0")) <![CDATA[ <= ]]> #{endDate}
+        and CONCAT(year(a.dkhpdqrq), "-", LPAD(month(a.dkhpdqrq), 2, "0")) <![CDATA[ >= ]]> #{beginDate}
+        and (a.rwbh in(select taskno from ky_task_info 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>
+
 
 
 </mapper>