wangliang 9 місяців тому
батько
коміт
06e1e0a5ec

+ 14 - 16
sop-api/src/main/java/com/qmth/sop/server/api/FlowMsgReferReportController.java

@@ -25,8 +25,6 @@ import java.util.Objects;
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_FLOW_MSG_REFER)
 public class FlowMsgReferReportController {
 
-    public static final String TOTAL = "total";
-
     public static final String READ_TOTAL = "readTotal";
 
     public static final String UN_READ_TOTAL = "unReadTotal";
@@ -41,7 +39,7 @@ public class FlowMsgReferReportController {
     @ApiOperation(value = "大区经理查阅统计")
     @RequestMapping(value = "/area_manager/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "流程查阅提醒报表", response = FlowMsgReferReportBean.class) })
-    public Result areaManagerCountReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+    public Result areaManagerReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
         return ResultUtil.ok(
                 this.calculateRate(flowMsgReferReportService.FlowMsgReport(serviceId, MessageTypeEnum.OFFICE_SOP)));
     }
@@ -49,8 +47,7 @@ public class FlowMsgReferReportController {
     @ApiOperation(value = "区域协调人查阅统计")
     @RequestMapping(value = "/regional_coordinator/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "流程查阅提醒报表", response = FlowMsgReferReportBean.class) })
-    public Result regionalCoordinatorCountReport(
-            @ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+    public Result regionalCoordinatorReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
         return ResultUtil.ok(
                 this.calculateRate(flowMsgReferReportService.FlowMsgReport(serviceId, MessageTypeEnum.CLOUD_MARK_SOP)));
     }
@@ -62,19 +59,20 @@ public class FlowMsgReferReportController {
      * @return
      */
     protected Map<String, Object> calculateRate(List<FlowMsgReferReportBean> flowMsgReferReportBeanList) {
-        Integer sum = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getSum()).sum();
-        Integer readMsgSum = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getReadMsg()).sum();
-        Integer unReadMsgSum = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getUnReadMsg()).sum();
-        BigDecimal readRate = new BigDecimal(readMsgSum);
-        BigDecimal unReadRate = new BigDecimal(unReadMsgSum);
-        if (Objects.nonNull(sum) && sum.intValue() > 0) {
-            readRate = readRate.divide(new BigDecimal(sum), 2, BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.RATE)
+        Integer total = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getSum()).sum();
+        Integer readMsgTotal = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getReadMsg()).sum();
+        Integer unReadMsgTotal = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getUnReadMsg()).sum();
+        BigDecimal readRate = new BigDecimal(readMsgTotal);
+        BigDecimal unReadRate = new BigDecimal(unReadMsgTotal);
+        if (Objects.nonNull(total) && total.intValue() > 0) {
+            readRate = readRate.divide(new BigDecimal(total), 2, BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.RATE)
                     .setScale(2, BigDecimal.ROUND_HALF_UP);
-            unReadRate = unReadRate.divide(new BigDecimal(sum), 2, BigDecimal.ROUND_HALF_UP)
+            unReadRate = unReadRate.divide(new BigDecimal(total), 2, BigDecimal.ROUND_HALF_UP)
                     .multiply(SystemConstant.RATE).setScale(2, BigDecimal.ROUND_HALF_UP);
         }
-        return new ImmutableMap.Builder<String, Object>().put(TOTAL, sum).put(READ_TOTAL, readMsgSum)
-                .put(UN_READ_TOTAL, unReadMsgSum).put(READ_RATE, readRate).put(UN_READ_RATE, unReadRate)
-                .put(ResourceSecurityReportController.RECORDS, flowMsgReferReportBeanList).build();
+        return new ImmutableMap.Builder<String, Object>().put(ResourceSecurityReportController.TOTAL, total)
+                .put(READ_TOTAL, readMsgTotal).put(UN_READ_TOTAL, unReadMsgTotal).put(READ_RATE, readRate)
+                .put(UN_READ_RATE, unReadRate).put(ResourceSecurityReportController.RECORDS, flowMsgReferReportBeanList)
+                .build();
     }
 }

+ 45 - 0
sop-api/src/main/java/com/qmth/sop/server/api/QualityAnalyseReportController.java

@@ -0,0 +1,45 @@
+package com.qmth.sop.server.api;
+
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.sop.business.bean.report.FlowMsgReferReportBean;
+import com.qmth.sop.business.service.FlowMsgReferReportService;
+import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.util.Result;
+import com.qmth.sop.common.util.ResultUtil;
+import io.swagger.annotations.*;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@Api(tags = "质量监控分析Controller")
+@RestController
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_QUALITY_ANALYSE)
+public class QualityAnalyseReportController {
+
+    @Resource
+    FlowMsgReferReportService flowMsgReferReportService;
+
+    @ApiOperation(value = "大区质量问题统计")
+    @RequestMapping(value = "/area_manager/report", method = RequestMethod.POST)
+    @ApiResponses({ @ApiResponse(code = 200, message = "质量监控分析报表", response = FlowMsgReferReportBean.class) })
+    public Result areaManagerReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+        return ResultUtil.ok();
+    }
+
+    @ApiOperation(value = "人力商质量问题统计")
+    @RequestMapping(value = "/human_supplier/report", method = RequestMethod.POST)
+    @ApiResponses({ @ApiResponse(code = 200, message = "质量监控分析报表", response = FlowMsgReferReportBean.class) })
+    public Result humanSupplierReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+        return ResultUtil.ok();
+    }
+
+    @ApiOperation(value = "质量问题原因分类")
+    @RequestMapping(value = "/type/report", method = RequestMethod.POST)
+    @ApiResponses({ @ApiResponse(code = 200, message = "质量监控分析报表", response = FlowMsgReferReportBean.class) })
+    public Result typeReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+        return ResultUtil.ok();
+    }
+}

+ 13 - 15
sop-api/src/main/java/com/qmth/sop/server/api/ResourceSecurityReportController.java

@@ -22,7 +22,7 @@ import java.util.List;
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_RESOURCE_SECURITY)
 public class ResourceSecurityReportController {
 
-    public static final String SUM = "sum";
+    public static final String TOTAL = "total";
 
     public static final String RECORDS = "records";
 
@@ -30,38 +30,36 @@ public class ResourceSecurityReportController {
     ResourceSecurityReportService resourceSecurityReportService;
 
     @ApiOperation(value = "设备商供货数量分布")
-    @RequestMapping(value = "/device_supplier_count/report", method = RequestMethod.POST)
+    @RequestMapping(value = "/device_supplier/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "供应商供货数量分布报表", response = SupplierCountReportBean.class) })
-    public Result deviceSupplierCountReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+    public Result deviceSupplierReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
         List<SupplierCountReportBean> supplierCountReportBeanList = resourceSecurityReportService.deviceSupplierCountReport(
                 serviceId);
-        Integer sum = supplierCountReportBeanList.stream().mapToInt(s -> s.getCount()).sum();
-        return ResultUtil.ok(ImmutableMap.of(SUM, sum, RECORDS, supplierCountReportBeanList));
+        Integer total = supplierCountReportBeanList.stream().mapToInt(s -> s.getCount()).sum();
+        return ResultUtil.ok(ImmutableMap.of(TOTAL, total, RECORDS, supplierCountReportBeanList));
     }
 
     @ApiOperation(value = "人力数量分布")
-    @RequestMapping(value = "/human_supplier_count/report", method = RequestMethod.POST)
+    @RequestMapping(value = "/human_supplier/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "供应商供货数量分布报表", response = SupplierCountReportBean.class) })
-    public Result humanSupplierCountReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+    public Result humanSupplierReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
         List<SupplierCountReportBean> supplierCountReportBeanList = resourceSecurityReportService.humanSupplierCountReport(
                 serviceId);
-        Integer sum = supplierCountReportBeanList.stream().mapToInt(s -> s.getCount()).sum();
-        return ResultUtil.ok(ImmutableMap.of(SUM, sum, RECORDS, supplierCountReportBeanList));
+        Integer total = supplierCountReportBeanList.stream().mapToInt(s -> s.getCount()).sum();
+        return ResultUtil.ok(ImmutableMap.of(TOTAL, total, RECORDS, supplierCountReportBeanList));
     }
 
     @ApiOperation(value = "大区考勤异常数统计")
-    @RequestMapping(value = "/area_ding_exception_count/report", method = RequestMethod.POST)
+    @RequestMapping(value = "/area_ding_exception/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "考勤异常报表", response = DingExceptionCountReportBean.class) })
-    public Result areaDingExceptionCountReport(
-            @ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+    public Result areaDingExceptionReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
         return ResultUtil.ok(resourceSecurityReportService.areaDingExceptionCountReport(serviceId));
     }
 
     @ApiOperation(value = "人力供应商考勤异常数统计")
-    @RequestMapping(value = "/human_ding_exception_count/report", method = RequestMethod.POST)
+    @RequestMapping(value = "/human_ding_exception/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "考勤异常报表", response = DingExceptionCountReportBean.class) })
-    public Result humanDingExceptionCountReport(
-            @ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+    public Result humanDingExceptionReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
         return ResultUtil.ok(resourceSecurityReportService.humanDingExceptionCountReport(serviceId));
     }
 }

+ 14 - 1
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -408,4 +408,17 @@ INSERT INTO sys_privilege
 VALUES(1112, '区域协调人查阅统计', '/api/admin/flow/msg/refer/regional_coordinator/report', 'URL', 1101, 1, 'AUTH', NULL, 1, 1, 1);
 UPDATE sys_privilege
 SET name='流程检查统计', url='FlowCheck', `type`='MENU', parent_id=1100, `sequence`=3, property=NULL, related='1111,1112', enable=1, default_auth=0, front_display=1
-WHERE id=1101;
+WHERE id=1101;
+
+UPDATE sys_privilege
+SET name='设备商供货数量分布接口', url='/api/admin/resource/security/device_supplier/report', `type`='URL', parent_id=1105, `sequence`=1, property='AUTH', related=NULL, enable=1, default_auth=1, front_display=1
+WHERE id=1107;
+UPDATE sys_privilege
+SET name='人力数量分布接口', url='/api/admin/resource/security/human_supplier/report', `type`='URL', parent_id=1105, `sequence`=1, property='AUTH', related=NULL, enable=1, default_auth=1, front_display=1
+WHERE id=1108;
+UPDATE sys_privilege
+SET name='大区考勤异常数统计接口', url='/api/admin/resource/security/area_ding_exception/report', `type`='URL', parent_id=1105, `sequence`=1, property='AUTH', related=NULL, enable=1, default_auth=1, front_display=1
+WHERE id=1109;
+UPDATE sys_privilege
+SET name='人力供应商考勤异常数统计', url='/api/admin/resource/security/human_ding_exception/report', `type`='URL', parent_id=1105, `sequence`=1, property='AUTH', related=NULL, enable=1, default_auth=1, front_display=1
+WHERE id=1110;

+ 2 - 0
sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java

@@ -453,6 +453,8 @@ public class SystemConstant {
 
     public static final String PREFIX_URL_FLOW_MSG_REFER = "/admin/flow/msg/refer";
 
+    public static final String PREFIX_URL_QUALITY_ANALYSE = "/admin/quality/analyse";
+
     public static final String PREFIX_URL_SOP_WARN_MONITOR = "/admin/sop/warn/monitor";
 
     /**