shudonghui hai 1 ano
pai
achega
7fa61f7f3f
Modificáronse 20 ficheiros con 209 adicións e 132 borrados
  1. 57 40
      sop-api/src/main/java/com/qmth/sop/server/api/CrmAnalyseController.java
  2. 10 9
      sop-api/src/main/java/com/qmth/sop/server/api/QualityAnalyseController.java
  3. 3 3
      sop-api/src/main/java/com/qmth/sop/server/api/ServiceAnalyseController.java
  4. 3 3
      sop-api/src/main/java/com/qmth/sop/server/api/SopAnalyseController.java
  5. 15 15
      sop-business/src/main/java/com/qmth/sop/business/mapper/CrmAnalyseMapper.java
  6. 1 1
      sop-business/src/main/java/com/qmth/sop/business/mapper/QualityAnalyseMapper.java
  7. 1 1
      sop-business/src/main/java/com/qmth/sop/business/mapper/ServiceAnalyseMapper.java
  8. 1 1
      sop-business/src/main/java/com/qmth/sop/business/mapper/SopAnalyseMapper.java
  9. 10 9
      sop-business/src/main/java/com/qmth/sop/business/service/CrmAnalyseService.java
  10. 1 1
      sop-business/src/main/java/com/qmth/sop/business/service/QualityAnalyseService.java
  11. 1 1
      sop-business/src/main/java/com/qmth/sop/business/service/ServiceAnalyseService.java
  12. 1 2
      sop-business/src/main/java/com/qmth/sop/business/service/SopAnalyseService.java
  13. 20 20
      sop-business/src/main/java/com/qmth/sop/business/service/impl/CrmAnalyseServiceImpl.java
  14. 2 2
      sop-business/src/main/java/com/qmth/sop/business/service/impl/QualityAnalyseServiceImpl.java
  15. 2 3
      sop-business/src/main/java/com/qmth/sop/business/service/impl/ServiceAnalyseServiceImpl.java
  16. 2 2
      sop-business/src/main/java/com/qmth/sop/business/service/impl/SopAnalyseServiceImpl.java
  17. 55 13
      sop-business/src/main/resources/mapper/CrmAnalyseMapper.xml
  18. 8 2
      sop-business/src/main/resources/mapper/QualityAnalyseMapper.xml
  19. 8 2
      sop-business/src/main/resources/mapper/ServiceAnalyseMapper.xml
  20. 8 2
      sop-business/src/main/resources/mapper/SopAnalyseMapper.xml

+ 57 - 40
sop-api/src/main/java/com/qmth/sop/server/api/CrmAnalyseController.java

@@ -2,6 +2,7 @@ package com.qmth.sop.server.api;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.sop.business.bean.result.CrmAnalyseResult;
 import com.qmth.sop.business.bean.result.TBCrmResult;
@@ -40,42 +41,47 @@ public class CrmAnalyseController {
     @Resource
     CrmAnalyseService crmAnalyseService;
 
-   
+
+    @Aac(auth = false)
     @ApiOperation(value = "客户类型分布接口")
     @RequestMapping(value = "/custom/type", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "客户类型分布", response = Map.class)})
-    public Result customType(@ApiParam(value = "年度", required = true) @RequestParam String year) {
-        Map<String, Object> map = crmAnalyseService.countCustomType(year);
+    public Result customType(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                             @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime) {
+        Map<String, Object> map = crmAnalyseService.countCustomType(startTime, endTime);
 
         return ResultUtil.ok(map);
     }
 
-   
+
+    @Aac(auth = false)
     @ApiOperation(value = "客户类型分布下钻接口")
     @RequestMapping(value = "/custom/type/detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "客户类型分布下钻", response = TBCrmResult.class)})
-    public Result customTypeDetail(@ApiParam(value = "年度", required = true) @RequestParam String year,
+    public Result customTypeDetail(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                                   @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime,
                                    @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type,
                                    @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                    @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<TBCrmResult> resultIPage = crmAnalyseService.customTypeDetail(new Page<>(pageNumber, pageSize), year, type);
+        IPage<TBCrmResult> resultIPage = crmAnalyseService.customTypeDetail(new Page<>(pageNumber, pageSize), startTime, endTime, type);
 
         return ResultUtil.ok(resultIPage);
     }
 
 
-   
+    @Aac(auth = false)
     @ApiOperation(value = "月度派单分布及对比接口")
     @RequestMapping(value = "/monthly", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "月度派单分布及对比接口", response = Map.class)})
-    public Result monthly(@ApiParam(value = "年度", required = true) @RequestParam String year,
+    public Result monthly(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                          @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime,
                           @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type) {
-        Map<String, List<Map<String,String>>> map = crmAnalyseService.monthly(year, type);
+        Map<String, List<Map<String, String>>> map = crmAnalyseService.monthly(startTime, endTime, type);
         return ResultUtil.ok(map);
     }
 
 
-   
+    @Aac(auth = false)
     @ApiOperation(value = "月度派单分布下钻接口")
     @RequestMapping(value = "/monthly/detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "月度派单分布下钻", response = TBCrmResult.class)})
@@ -84,85 +90,96 @@ public class CrmAnalyseController {
                                 @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type,
                                 @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                 @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<TBCrmResult> resultIPage = crmAnalyseService.monthlyDetail(new Page<>(pageNumber, pageSize), year,month, type);
+        IPage<TBCrmResult> resultIPage = crmAnalyseService.monthlyDetail(new Page<>(pageNumber, pageSize), year, month, type);
 
         return ResultUtil.ok(resultIPage);
     }
 
     //供应商派单分布
-   
+
+    @Aac(auth = false)
     @ApiOperation(value = "供应商派单分布接口")
     @RequestMapping(value = "/supplier", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "供应商派单分布", response = CrmAnalyseResult.class)})
-    public Result supplier(@ApiParam(value = "年度", required = true) @RequestParam String year) {
-        List<CrmAnalyseResult> list = crmAnalyseService.supplier(year);
+    public Result supplier(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                           @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime) {
+        List<CrmAnalyseResult> list = crmAnalyseService.supplier(startTime, endTime);
         return ResultUtil.ok(list);
     }
 
-   
+
+    @Aac(auth = false)
     @ApiOperation(value = "供应商派单分布下钻接口")
     @RequestMapping(value = "/supplier/detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "供应商派单分布下钻", response = TBCrmResult.class)})
-    public Result supplierDetail(@ApiParam(value = "年度", required = true) @RequestParam String year,
-                                @ApiParam(value = "供应商", required = true) @RequestParam Long supplierId,
-                                @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
-                                @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<TBCrmResult> resultIPage = crmAnalyseService.supplierDetail(new Page<>(pageNumber, pageSize), year,supplierId);
+    public Result supplierDetail(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                                 @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime,
+                                 @ApiParam(value = "供应商", required = true) @RequestParam Long supplierId,
+                                 @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+                                 @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        IPage<TBCrmResult> resultIPage = crmAnalyseService.supplierDetail(new Page<>(pageNumber, pageSize), startTime, endTime, supplierId);
 
         return ResultUtil.ok(resultIPage);
     }
     //大区在执行派单排名
-   
+
+    @Aac(auth = false)
     @ApiOperation(value = "大区在执行派单排名接口")
     @RequestMapping(value = "/region", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "大区在执行派单排名", response = CrmAnalyseResult.class)})
-    public Result region(@ApiParam(value = "年度", required = true) @RequestParam String year,
+    public Result region(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                         @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime,
                          @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type) {
-        Map<String, List<CrmAnalyseResult>> map = crmAnalyseService.region(year,type);
+        Map<String, List<CrmAnalyseResult>> map = crmAnalyseService.region(startTime, endTime, type);
         return ResultUtil.ok(map);
     }
 
 
     //大区在执行派单排名
-   
+
+    @Aac(auth = false)
     @ApiOperation(value = "大区在执行派单排名下钻接口")
     @RequestMapping(value = "/region/detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "大区在执行派单排名下钻", response = CrmAnalyseResult.class)})
-    public Result regionDetail(@ApiParam(value = "年度", required = true) @RequestParam String year,
-                         @ApiParam(value = "大区", required = true) @RequestParam Long regionId,
-                         @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type,
-                         @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
-                         @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<TBCrmResult> resultIPage = crmAnalyseService.regionDetail(new Page<>(pageNumber, pageSize), year,regionId,type);
+    public Result regionDetail(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                               @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime,
+                               @ApiParam(value = "大区", required = true) @RequestParam Long regionId,
+                               @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type,
+                               @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+                               @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        IPage<TBCrmResult> resultIPage = crmAnalyseService.regionDetail(new Page<>(pageNumber, pageSize), startTime, endTime, regionId, type);
 
         return ResultUtil.ok(resultIPage);
     }
 
 
     //项目派单完成率
-   
+
+    @Aac(auth = false)
     @ApiOperation(value = "项目派单完成率接口")
     @RequestMapping(value = "/project", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "项目派单完成率", response = CrmAnalyseResult.class)})
-    public Result project(@ApiParam(value = "年度", required = true) @RequestParam String year) {
-        List<CrmAnalyseResult> list = crmAnalyseService.project(year);
+    public Result project(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                          @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime) {
+        List<CrmAnalyseResult> list = crmAnalyseService.project(startTime, endTime);
         return ResultUtil.ok(list);
     }
 
     //项目派单完成率详细
-   
+
+    @Aac(auth = false)
     @ApiOperation(value = "项目派单完成率详细接口")
     @RequestMapping(value = "/project/detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "项目派单完成率详细", response = CrmAnalyseResult.class)})
-    public Result projectDetail(@ApiParam(value = "年度", required = true) @RequestParam String year,
-                          @ApiParam(value = "服务单元", required = true) @RequestParam Long serviceId,
-                          @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
-                          @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<TBCrmResult> resultIPage = crmAnalyseService.projectDetail(new Page<>(pageNumber, pageSize), year,serviceId);
+    public Result projectDetail(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                                @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime,
+                                @ApiParam(value = "服务单元", required = true) @RequestParam Long serviceId,
+                                @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+                                @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        IPage<TBCrmResult> resultIPage = crmAnalyseService.projectDetail(new Page<>(pageNumber, pageSize), startTime, endTime, serviceId);
 
         return ResultUtil.ok(resultIPage);
     }
 
 
-
 }

+ 10 - 9
sop-api/src/main/java/com/qmth/sop/server/api/QualityAnalyseController.java

@@ -2,6 +2,7 @@ package com.qmth.sop.server.api;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.sop.business.bean.result.TBQualityProblemApplyResult;
 import com.qmth.sop.business.entity.TBService;
@@ -43,12 +44,12 @@ public class QualityAnalyseController {
     QualityAnalyseService qualityAnalyseService;
 
 
-   
     @ApiOperation(value = "服务单元列表接口")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "服务单元列表", response = TBService.class)})
-    public Result list(@ApiParam(value = "年度", required = true) @RequestParam String year) {
-        List<TBService> list = qualityAnalyseService.list(year);
+    public Result list(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                       @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime) {
+        List<TBService> list = qualityAnalyseService.list(startTime,endTime);
         return ResultUtil.ok(list);
     }
 
@@ -60,7 +61,7 @@ public class QualityAnalyseController {
      * ③归因雷达图:按找质量问题归因维度展示雷达图,以及全部及各供应商的雷达图。不提供【数据下钻】;
      */
     //质量问题总体盘点饼图
-   
+
     @ApiOperation(value = "质量问题总体盘点饼图")
     @RequestMapping(value = "/pie", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "质量问题总体盘点饼图", response = Map.class)})
@@ -71,7 +72,7 @@ public class QualityAnalyseController {
     }
 
     //质量问题总体盘点归因雷达图
-   
+
     @ApiOperation(value = "质量问题总体盘点归因雷达图")
     @RequestMapping(value = "/radar", method = RequestMethod.POST)
     public Result radar(@ApiParam(value = "服务单元", required = true) @RequestParam Long serviceUnitId,
@@ -84,7 +85,7 @@ public class QualityAnalyseController {
     /**
      * 5.质量问题审核进度=(已完成审核的质量问题总数÷总数)×100%;不提供【数据下钻】;
      */
-   
+
     @ApiOperation(value = "质量问题审核进度")
     @RequestMapping(value = "/progress", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "质量问题审核进度", response = Double.class)})
@@ -98,7 +99,7 @@ public class QualityAnalyseController {
      * * 可视化展示如图,供应商/大区的归属,仅针对审核完成且定责为供应商的人员,或大区管辖的项目;
      * * 【数据下钻】点击行数据,可查看质量问题数据明细。
      */
-   
+
     @ApiOperation(value = "影响度/归因")
     @RequestMapping(value = "/influence", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "影响度/归因", response = Map.class)})
@@ -110,7 +111,7 @@ public class QualityAnalyseController {
 
     //* ②【数据下钻】点击影响度行数据,可显示影响度下质量问题查询明细,筛选条件为:年度+服务单元+非“不是问题”+影响度;
     //质量问题查询明细
-   
+
     @ApiOperation(value = "质量问题饼图明细")
     @RequestMapping(value = "/supplier/detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "质量问题饼图明细", response = TBQualityProblemApplyResult.class)})
@@ -125,7 +126,7 @@ public class QualityAnalyseController {
 
     //* ②【数据下钻】点击影响度行数据,可显示影响度下质量问题查询明细,筛选条件为:年度+服务单元+非“不是问题”+影响度;
     //质量问题查询明细
-   
+
     @ApiOperation(value = "影响度/归因明细")
     @RequestMapping(value = "/influence/detail", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "影响度/归因明细", response = TBQualityProblemApplyResult.class)})

+ 3 - 3
sop-api/src/main/java/com/qmth/sop/server/api/ServiceAnalyseController.java

@@ -46,12 +46,12 @@ public class ServiceAnalyseController {
 
 
     //服务单元列表
-    
     @ApiOperation(value = "服务单元列表接口")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "服务单元列表", response = TBService.class)})
-    public Result list(@ApiParam(value = "年度", required = true) @RequestParam String year) {
-        List<TBService> list = serviceAnalyseService.list(year);
+    public Result list(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                       @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime) {
+        List<TBService> list = serviceAnalyseService.list(startTime,endTime);
         return ResultUtil.ok(list);
     }
 

+ 3 - 3
sop-api/src/main/java/com/qmth/sop/server/api/SopAnalyseController.java

@@ -37,12 +37,12 @@ public class SopAnalyseController {
     SopAnalyseService sopAnalyseService;
 
 
-
     @ApiOperation(value = "服务单元列表接口")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "服务单元列表", response = TBService.class)})
-    public Result list(@ApiParam(value = "年度", required = true) @RequestParam String year) {
-        List<TBService> list = sopAnalyseService.list(year);
+    public Result list(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
+                       @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime) {
+        List<TBService> list = sopAnalyseService.list(startTime,endTime);
         return ResultUtil.ok(list);
     }
 

+ 15 - 15
sop-business/src/main/java/com/qmth/sop/business/mapper/CrmAnalyseMapper.java

@@ -21,35 +21,35 @@ import java.util.Map;
 public interface CrmAnalyseMapper extends BaseMapper<TBCrm> {
 
 
-    Map<String,Object> countCustomType(@Param("year") String year);
+    Map<String,Object> countCustomType(@Param("startTime") Long startTime,@Param("endTime") Long endTime);
 
-    IPage<TBCrmResult> crmDetail(Page<Object> iPage, @Param("year") String year, @Param("month") String month, @Param("crmYear") String crmYear, @Param("type") String type,@Param("supplierId") Long supplierId,@Param("regionId") Long regionId,@Param("serviceId") Long serviceId);
+    IPage<TBCrmResult> crmDetail(Page<Object> iPage, @Param("startTime") Long startTime,@Param("endTime") Long endTime, @Param("month") String month, @Param("crmYear") String crmYear, @Param("type") String type,@Param("supplierId") Long supplierId,@Param("regionId") Long regionId,@Param("serviceId") Long serviceId);
 
-    default IPage<TBCrmResult> crmDetail(Page<Object> iPage,String year, String type) {
-        return crmDetail(iPage,year,null,null,type,null,null,null);
+    default IPage<TBCrmResult> crmDetail(Page<Object> iPage,Long startTime, Long endTime, String type) {
+        return crmDetail(iPage,startTime,endTime,null,null,type,null,null,null);
     }
 
-    List<Map<String,String>> monthly(@Param("year") String year,@Param("type") String type);
+    List<Map<String,String>> monthly(@Param("startTime") Long startTime,@Param("endTime") Long endTime,@Param("type") String type);
 
     default IPage<TBCrmResult> crmDetail(Page<Object> iPage, String year, String month, String type) {
-        return crmDetail(iPage,year,month,null,type,null,null,null);
+        return crmDetail(iPage,null,null,month,year,type,null,null,null);
     }
 
-    List<CrmAnalyseResult> supplier(@Param("year") String year);
+    List<CrmAnalyseResult> supplier(@Param("startTime") Long startTime,@Param("endTime") Long endTime);
 
-    default IPage<TBCrmResult> crmDetail(Page<Object> iPage, String year,  Long supplierId) {
-        return crmDetail(iPage,null,null,year,null,supplierId,null,null);
+    default IPage<TBCrmResult> crmDetailSupplier(Page<Object> iPage, Long startTime, Long endTime,  Long supplierId) {
+        return crmDetail(iPage,startTime,endTime,null,null,null,supplierId,null,null);
     }
 
-    List<CrmAnalyseResult> region(@Param("year") String year, @Param("type") String type);
+    List<CrmAnalyseResult> region(@Param("startTime") Long startTime,@Param("endTime") Long endTime, @Param("type") String type);
 
-    default IPage<TBCrmResult> crmDetail(Page<Object> iPage,  String year, Long regionId, String type) {
-        return crmDetail(iPage,year,null,null,type,null,regionId,null);
+    default IPage<TBCrmResult> crmDetail(Page<Object> iPage,  Long startTime, Long endTime, Long regionId, String type) {
+        return crmDetail(iPage,startTime,endTime,null,null,type,null,regionId,null);
     }
 
-    default IPage<TBCrmResult> crmDetail(Page<Object> iPage, Long serviceId, String year) {
-        return crmDetail(iPage,year,null,null,null,null,null,serviceId);
+    default IPage<TBCrmResult> crmDetail(Page<Object> iPage, Long serviceId, Long startTime, Long endTime) {
+        return crmDetail(iPage,startTime,endTime,null,null,null,null,null,serviceId);
     }
 
-    List<CrmAnalyseResult> project(@Param("year") String year);
+    List<CrmAnalyseResult> project(@Param("startTime") Long startTime,@Param("endTime") Long endTime);
 }

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/mapper/QualityAnalyseMapper.java

@@ -27,7 +27,7 @@ public interface QualityAnalyseMapper extends BaseMapper<TBQualityProblemApply>
 
     Map<String, Object> radar(@Param("serviceUnitId")Long serviceUnitId,@Param("supplierId") Long supplierId);
 
-    List<TBService> list( @Param("year")String year);
+    List<TBService> list( @Param("startTime")Long startTime, @Param("endTime")Long endTime);
 
     Double progress( @Param("serviceUnitId")Long serviceUnitId);
 

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/mapper/ServiceAnalyseMapper.java

@@ -21,7 +21,7 @@ import java.util.Map;
 public interface ServiceAnalyseMapper extends BaseMapper<TBService> {
 
 
-    List<TBService> list(@Param("year") String year);
+    List<TBService> list( @Param("startTime")Long startTime, @Param("endTime")Long endTime);
 
     Long projectProgress(@Param("serviceUnitId") Long serviceUnitId);
 

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/mapper/SopAnalyseMapper.java

@@ -18,7 +18,7 @@ import java.util.Map;
 public interface SopAnalyseMapper extends BaseMapper<TBSopInfo> {
 
 
-    List<TBService> list(@Param("year") String year);
+    List<TBService> list(@Param("startTime") Long startTime,@Param("endTime") Long endTime);
 
     List<Map<String, Object>> overview(@Param("serviceId") Long serviceId);
 

+ 10 - 9
sop-business/src/main/java/com/qmth/sop/business/service/CrmAnalyseService.java

@@ -17,23 +17,24 @@ import java.util.Map;
  * @date:
  */
 public interface CrmAnalyseService extends IService<TBCrm> {
-    Map<String,Object> countCustomType(String year);
+    Map<String,Object> countCustomType(Long startTime, Long endTime);
 
-    IPage<TBCrmResult> customTypeDetail(Page<Object> objectPage, String year, ProductTypeEnum type);
+    IPage<TBCrmResult> customTypeDetail(Page<Object> objectPage, Long startTime, Long endTime, ProductTypeEnum type);
 
-    Map<String, List<Map<String,String>>> monthly(String year, ProductTypeEnum type);
+    Map<String, List<Map<String,String>>> monthly(Long startTime, Long endTime, ProductTypeEnum type);
 
     IPage<TBCrmResult> monthlyDetail(Page<Object> objectPage, String year, String month, ProductTypeEnum type);
 
-    List<CrmAnalyseResult> supplier(String year);
+    List<CrmAnalyseResult> supplier(Long startTime, Long endTime);
 
-    IPage<TBCrmResult> supplierDetail(Page<Object> objectPage, String year, Long supplierId);
+    IPage<TBCrmResult> supplierDetail(Page<Object> objectPage, Long startTime, Long endTime, Long supplierId);
 
-    Map<String, List<CrmAnalyseResult>> region(String year, ProductTypeEnum type);
+    Map<String, List<CrmAnalyseResult>> region(Long startTime, Long endTime, ProductTypeEnum type);
 
-    IPage<TBCrmResult> regionDetail(Page<Object> objectPage, String year, Long regionId, ProductTypeEnum type);
+    IPage<TBCrmResult> regionDetail(Page<Object> objectPage, Long startTime, Long endTime, Long regionId, ProductTypeEnum type);
 
-    List<CrmAnalyseResult> project(String year);
+    List<CrmAnalyseResult> project(Long startTime, Long endTime);
+
+    IPage<TBCrmResult> projectDetail(Page<Object> objectPage, Long startTime, Long endTime, Long serviceId);
 
-    IPage<TBCrmResult> projectDetail(Page<Object> objectPage, String year, Long serviceId);
 }

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/service/QualityAnalyseService.java

@@ -15,7 +15,7 @@ import java.util.Map;
 
 public interface QualityAnalyseService extends IService<TBQualityProblemApply> {
 
-    List<TBService> list(String year);
+    List<TBService> list(Long startTime,Long endTime);
 
     Double progress(Long serviceUnitId);
 

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/service/ServiceAnalyseService.java

@@ -12,7 +12,7 @@ import java.util.List;
 import java.util.Map;
 
 public interface ServiceAnalyseService extends IService<TBService> {
-    List<TBService> list(String year);
+    List<TBService> list(Long startTime,Long endTime);
 
     Map<String, Object> overview(Long serviceUnitId);
 

+ 1 - 2
sop-business/src/main/java/com/qmth/sop/business/service/SopAnalyseService.java

@@ -10,8 +10,7 @@ import java.util.List;
 import java.util.Map;
 
 public interface SopAnalyseService extends IService<TBSopInfo> {
-    List<TBService> list(String year);
-
+    List<TBService> list(Long startTime,Long endTime);
 
     List<Map<String, Object>> overview(Long serviceId, SopAnalyseGroupEnum group);
 

+ 20 - 20
sop-business/src/main/java/com/qmth/sop/business/service/impl/CrmAnalyseServiceImpl.java

@@ -26,20 +26,20 @@ import java.util.Objects;
 public class CrmAnalyseServiceImpl extends ServiceImpl<CrmAnalyseMapper, TBCrm> implements CrmAnalyseService {
 
     @Override
-    public Map<String,Object> countCustomType(String year) {
-        return this.baseMapper.countCustomType(year);
+    public Map<String,Object> countCustomType(Long startTime, Long endTime) {
+        return this.baseMapper.countCustomType(startTime,endTime);
     }
 
     @Override
-    public IPage<TBCrmResult> customTypeDetail(Page<Object> iPage, String year, ProductTypeEnum type) {
-        return this.baseMapper.crmDetail(iPage,year, Objects.nonNull(type) ? type.name() : null);
+    public IPage<TBCrmResult> customTypeDetail(Page<Object> iPage, Long startTime, Long endTime, ProductTypeEnum type) {
+        return this.baseMapper.crmDetail(iPage,startTime,endTime, Objects.nonNull(type) ? type.name() : null);
     }
 
     @Override
-    public  Map<String, List<Map<String,String>>> monthly(String year, ProductTypeEnum type) {
+    public  Map<String, List<Map<String,String>>> monthly(Long startTime, Long endTime, ProductTypeEnum type) {
         Map<String, List<Map<String,String>>> map=new HashMap<>();
-        map.put("year",this.baseMapper.monthly(year, Objects.nonNull(type) ? type.name() : null));
-        map.put("lastYear",this.baseMapper.monthly(String.valueOf(Integer.parseInt(year)-1), Objects.nonNull(type) ? type.name() : null));
+        map.put("year",this.baseMapper.monthly(startTime,endTime, Objects.nonNull(type) ? type.name() : null));
+        map.put("lastYear",this.baseMapper.monthly(startTime-365*24*60*60* 1000L,endTime-365*24*60*60* 1000L, Objects.nonNull(type) ? type.name() : null));
         return map;
     }
 
@@ -49,35 +49,35 @@ public class CrmAnalyseServiceImpl extends ServiceImpl<CrmAnalyseMapper, TBCrm>
     }
 
     @Override
-    public List<CrmAnalyseResult> supplier(String year) {
-        return this.baseMapper.supplier(year);
+    public List<CrmAnalyseResult> supplier(Long startTime, Long endTime) {
+        return this.baseMapper.supplier(startTime,endTime);
     }
 
     @Override
-    public IPage<TBCrmResult> supplierDetail(Page<Object> iPage, String year, Long supplierId) {
-        return this.baseMapper.crmDetail(iPage,year, supplierId);
+    public IPage<TBCrmResult> supplierDetail(Page<Object> iPage, Long startTime, Long endTime, Long supplierId) {
+        return this.baseMapper.crmDetailSupplier(iPage,startTime,endTime, supplierId);
     }
 
     @Override
-    public Map<String,  List<CrmAnalyseResult>> region(String year, ProductTypeEnum type) {
+    public Map<String,  List<CrmAnalyseResult>> region(Long startTime, Long endTime, ProductTypeEnum type) {
         Map<String,  List<CrmAnalyseResult>> map=new HashMap<>();
-        map.put("day",this.baseMapper.region(year,Objects.nonNull(type) ? type.name() : null));
-        map.put("lastDay",this.baseMapper.region(String.valueOf(Integer.parseInt(year)-1),Objects.nonNull(type) ? type.name() : null));
+        map.put("day",this.baseMapper.region(startTime,endTime,Objects.nonNull(type) ? type.name() : null));
+        map.put("lastDay",this.baseMapper.region(startTime-365*24*60*60* 1000L,endTime-365*24*60*60* 1000L,Objects.nonNull(type) ? type.name() : null));
         return map;
     }
 
     @Override
-    public IPage<TBCrmResult> regionDetail(Page<Object> iPage, String year, Long regionId, ProductTypeEnum type) {
-        return this.baseMapper.crmDetail(iPage,year,regionId,Objects.nonNull(type) ? type.name() : null);
+    public IPage<TBCrmResult> regionDetail(Page<Object> iPage, Long startTime, Long endTime, Long regionId, ProductTypeEnum type) {
+        return this.baseMapper.crmDetail(iPage,startTime,endTime,regionId,Objects.nonNull(type) ? type.name() : null);
     }
 
     @Override
-    public List<CrmAnalyseResult> project(String year) {
-        return this.baseMapper.project(year);
+    public List<CrmAnalyseResult> project(Long startTime, Long endTime) {
+        return this.baseMapper.project(startTime,endTime);
     }
 
     @Override
-    public IPage<TBCrmResult> projectDetail(Page<Object> iPage, String year, Long serviceId) {
-        return this.baseMapper.crmDetail(iPage,serviceId,year);
+    public IPage<TBCrmResult> projectDetail(Page<Object> iPage, Long startTime, Long endTime, Long serviceId) {
+        return this.baseMapper.crmDetail(iPage,serviceId,startTime,endTime);
     }
 }

+ 2 - 2
sop-business/src/main/java/com/qmth/sop/business/service/impl/QualityAnalyseServiceImpl.java

@@ -23,8 +23,8 @@ public class QualityAnalyseServiceImpl extends ServiceImpl<QualityAnalyseMapper,
 
 
     @Override
-    public List<TBService> list(String year) {
-        return this.baseMapper.list(year);
+    public List<TBService> list(Long startTime,Long endTime) {
+        return this.baseMapper.list(startTime,endTime);
     }
 
 

+ 2 - 3
sop-business/src/main/java/com/qmth/sop/business/service/impl/ServiceAnalyseServiceImpl.java

@@ -34,10 +34,9 @@ public class ServiceAnalyseServiceImpl extends ServiceImpl<ServiceAnalyseMapper,
     TBUserArchivesSupplierService tbUserArchivesSupplierService;
 
     @Override
-    public List<TBService> list(String year) {
-        return this.baseMapper.list(year);
+    public List<TBService> list(Long startTime,Long endTime) {
+        return this.baseMapper.list(startTime,endTime);
     }
-
     /**
      * 4.服务单元概览
      * ①项目执行进度=服务单元下已完成的派单(研究生派单下SOP已完结;教务处派单下已有完成的SOP,无在执行的SOP。可能存在教务处多个SOP之间空窗期导致数据的误差,这个指标允许少量误差存在);

+ 2 - 2
sop-business/src/main/java/com/qmth/sop/business/service/impl/SopAnalyseServiceImpl.java

@@ -17,8 +17,8 @@ public class SopAnalyseServiceImpl extends ServiceImpl<SopAnalyseMapper, TBSopIn
 
 
     @Override
-    public List<TBService> list(String year) {
-        return this.baseMapper.list(year);
+    public List<TBService> list(Long startTime,Long endTime) {
+        return this.baseMapper.list(startTime,endTime);
     }
 
 

+ 55 - 13
sop-business/src/main/resources/mapper/CrmAnalyseMapper.xml

@@ -17,8 +17,14 @@
             <if test="type != null and type != ''">
                 and cu.type = #{type}
             </if>
-            <if test="year != null and year != ''">
-                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}
+<!--            <if test="year != null and year != ''">-->
+<!--                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}-->
+<!--            </if>-->
+            <if test="startTime != null">
+                AND s.start_time >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                AND #{endTime} >= s.start_time
             </if>
         </where>
         GROUP BY
@@ -37,8 +43,14 @@
         LEFT JOIN t_b_service s ON c.service_id = s.id
         <where>
             s.`status` IN ( 'PUBLISH', 'FINISH' )
-            <if test="year != null and year != ''">
-                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}
+            <!--            <if test="year != null and year != ''">-->
+            <!--                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}-->
+            <!--            </if>-->
+            <if test="startTime != null">
+                AND s.start_time >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                AND #{endTime} >= s.start_time
             </if>
         </where>
         GROUP BY
@@ -60,8 +72,14 @@
         LEFT JOIN sys_supplier su ON su.id = us.supplier_id
         <where>
             and c.region_coordinator_id IS NOT NULL
-            <if test="year != null and year != ''">
-                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}
+            <!--            <if test="year != null and year != ''">-->
+            <!--                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}-->
+            <!--            </if>-->
+            <if test="startTime != null">
+                AND s.start_time >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                AND #{endTime} >= s.start_time
             </if>
         </where>
         GROUP BY
@@ -82,8 +100,14 @@
                 and cu.type = #{type}
             </if>
 
-            <if test="year != null and year != ''">
-                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}
+            <!--            <if test="year != null and year != ''">-->
+            <!--                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}-->
+            <!--            </if>-->
+            <if test="startTime != null">
+                AND s.start_time >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                AND #{endTime} >= s.start_time
             </if>
 
         </where>
@@ -100,8 +124,20 @@
         t_b_crm c
         LEFT JOIN t_b_service s ON c.service_id = s.id
         LEFT join sys_custom cu on cu.id=c.custom_id
-        WHERE
-        YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}
+<!--        WHERE-->
+<!--        YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}-->
+        <where>
+            <!--            <if test="year != null and year != ''">-->
+            <!--                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}-->
+            <!--            </if>-->
+            <if test="startTime != null">
+                AND s.start_time >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                AND #{endTime} >= s.start_time
+            </if>
+
+        </where>
     </select>
 
 
@@ -145,14 +181,20 @@
             <if test="supplierId != null and supplierId != ''">
                 and su.id = #{supplierId}
             </if>
-            <if test="year != null and year != ''">
-                and YEAR ( FROM_UNIXTIME( tbs.start_time / 1000 ))=  #{year}
+            <!--            <if test="year != null and year != ''">-->
+            <!--                and YEAR ( FROM_UNIXTIME( tbs.start_time / 1000 ))=  #{year}-->
+            <!--            </if>-->
+            <if test="startTime != null">
+                AND tbs.start_time >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                AND #{endTime} >= tbs.start_time
             </if>
             <if test="crmYear != null and crmYear != ''">
                 and YEAR ( FROM_UNIXTIME( a.begin_time / 1000 ))=  #{crmYear}
             </if>
             <if test="month != null and month != ''">
-                and MONTH ( FROM_UNIXTIME( tbs.start_time / 1000 ))=  #{month}
+                and MONTH ( FROM_UNIXTIME( a.begin_time / 1000 ))=  #{month}
             </if>
         </where>
 

+ 8 - 2
sop-business/src/main/resources/mapper/QualityAnalyseMapper.xml

@@ -6,8 +6,14 @@
         <where>
             and s.status in ('PUBLISH','FINISH')
 
-            <if test="year != null and year != ''">
-                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))= #{year}
+            <!--            <if test="year != null and year != ''">-->
+            <!--                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}-->
+            <!--            </if>-->
+            <if test="startTime != null">
+                AND s.start_time >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                AND #{endTime} >= s.start_time
             </if>
 
         </where>

+ 8 - 2
sop-business/src/main/resources/mapper/ServiceAnalyseMapper.xml

@@ -6,8 +6,14 @@
         <where>
             and s.status in ('PUBLISH','FINISH')
 
-            <if test="year != null and year != ''">
-                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))= #{year}
+            <!--            <if test="year != null and year != ''">-->
+            <!--                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}-->
+            <!--            </if>-->
+            <if test="startTime != null">
+                AND s.start_time >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                AND #{endTime} >= s.start_time
             </if>
 
         </where>

+ 8 - 2
sop-business/src/main/resources/mapper/SopAnalyseMapper.xml

@@ -6,8 +6,14 @@
         <where>
             and s.status = 'PUBLISH'
 
-            <if test="year != null and year != ''">
-                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))= #{year}
+            <!--            <if test="year != null and year != ''">-->
+            <!--                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}-->
+            <!--            </if>-->
+            <if test="startTime != null">
+                AND s.start_time >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                AND #{endTime} >= s.start_time
             </if>
 
         </where>