Browse Source

质量监控分析报表

wangliang 9 months ago
parent
commit
07d52eb337

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

@@ -29,9 +29,9 @@ public class FlowMsgReferReportController {
 
 
     public static final String UN_READ_TOTAL = "unReadTotal";
     public static final String UN_READ_TOTAL = "unReadTotal";
 
 
-    public static final String READ_RATE = "readRate";
+    public static final String READ_RATE_TOTAL = "readRateTotal";
 
 
-    public static final String UN_READ_RATE = "unReadRate";
+    public static final String UN_READ_RATE_TOTAL = "unReadRateTotal";
 
 
     @Resource
     @Resource
     FlowMsgReferReportService flowMsgReferReportService;
     FlowMsgReferReportService flowMsgReferReportService;
@@ -62,17 +62,17 @@ public class FlowMsgReferReportController {
         Integer total = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getSum()).sum();
         Integer total = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getSum()).sum();
         Integer readMsgTotal = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getReadMsg()).sum();
         Integer readMsgTotal = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getReadMsg()).sum();
         Integer unReadMsgTotal = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getUnReadMsg()).sum();
         Integer unReadMsgTotal = flowMsgReferReportBeanList.stream().mapToInt(s -> s.getUnReadMsg()).sum();
-        BigDecimal readRate = new BigDecimal(readMsgTotal);
-        BigDecimal unReadRate = new BigDecimal(unReadMsgTotal);
+        BigDecimal readRateTotal = new BigDecimal(readMsgTotal);
+        BigDecimal unReadRateTotal = new BigDecimal(unReadMsgTotal);
         if (Objects.nonNull(total) && total.intValue() > 0) {
         if (Objects.nonNull(total) && total.intValue() > 0) {
-            readRate = readRate.divide(new BigDecimal(total), 2, BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.RATE)
+            readRateTotal = readRateTotal.divide(new BigDecimal(total), 2, BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.RATE)
                     .setScale(2, BigDecimal.ROUND_HALF_UP);
                     .setScale(2, BigDecimal.ROUND_HALF_UP);
-            unReadRate = unReadRate.divide(new BigDecimal(total), 2, BigDecimal.ROUND_HALF_UP)
+            unReadRateTotal = unReadRateTotal.divide(new BigDecimal(total), 2, BigDecimal.ROUND_HALF_UP)
                     .multiply(SystemConstant.RATE).setScale(2, BigDecimal.ROUND_HALF_UP);
                     .multiply(SystemConstant.RATE).setScale(2, BigDecimal.ROUND_HALF_UP);
         }
         }
         return new ImmutableMap.Builder<String, Object>().put(ResourceSecurityReportController.TOTAL, total)
         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)
+                .put(READ_TOTAL, readMsgTotal).put(UN_READ_TOTAL, unReadMsgTotal).put(READ_RATE_TOTAL, readRateTotal)
+                .put(UN_READ_RATE_TOTAL, unReadRateTotal).put(ResourceSecurityReportController.RECORDS, flowMsgReferReportBeanList)
                 .build();
                 .build();
     }
     }
 }
 }

+ 57 - 1
sop-api/src/main/java/com/qmth/sop/server/api/QualityAnalyseReportController.java

@@ -1,5 +1,6 @@
 package com.qmth.sop.server.api;
 package com.qmth.sop.server.api;
 
 
+import com.google.common.collect.ImmutableMap;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.sop.business.bean.report.QualityAnalyseReportBean;
 import com.qmth.sop.business.bean.report.QualityAnalyseReportBean;
 import com.qmth.sop.business.service.QualityAnalyseReportService;
 import com.qmth.sop.business.service.QualityAnalyseReportService;
@@ -13,12 +14,31 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Objects;
 
 
 @Api(tags = "质量监控分析Controller")
 @Api(tags = "质量监控分析Controller")
 @RestController
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_QUALITY_ANALYSE)
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_QUALITY_ANALYSE)
 public class QualityAnalyseReportController {
 public class QualityAnalyseReportController {
 
 
+    public static final String IN_FLUENCE_DEGREE_A_TOTAL = "influenceDegreeATotal";
+
+    public static final String IN_FLUENCE_DEGREE_B_TOTAL = "influenceDegreeBTotal";
+
+    public static final String IN_FLUENCE_DEGREE_C_TOTAL = "influenceDegreeCTotal";
+
+    public static final String IN_FLUENCE_DEGREE_D_TOTAL = "influenceDegreeDTotal";
+
+    public static final String IN_FLUENCE_DEGREE_A_RATE_TOTAL = "influenceDegreeARateTotal";
+
+    public static final String IN_FLUENCE_DEGREE_B_RATE_TOTAL = "influenceDegreeBRateTotal";
+
+    public static final String IN_FLUENCE_DEGREE_C_RATE_TOTAL = "influenceDegreeCRateTotal";
+
+    public static final String IN_FLUENCE_DEGREE_D_RATE_TOTAL = "influenceDegreeDRateTotal";
+
     @Resource
     @Resource
     QualityAnalyseReportService qualityAnalyseReportService;
     QualityAnalyseReportService qualityAnalyseReportService;
 
 
@@ -26,7 +46,43 @@ public class QualityAnalyseReportController {
     @RequestMapping(value = "/area_manager/report", method = RequestMethod.POST)
     @RequestMapping(value = "/area_manager/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "质量监控分析报表", response = QualityAnalyseReportBean.class) })
     @ApiResponses({ @ApiResponse(code = 200, message = "质量监控分析报表", response = QualityAnalyseReportBean.class) })
     public Result areaManagerReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
     public Result areaManagerReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
-        return ResultUtil.ok();
+        List<QualityAnalyseReportBean> qualityAnalyseReportBeanList = qualityAnalyseReportService.areaQualityReport(
+                serviceId);
+        Integer total = qualityAnalyseReportBeanList.stream().mapToInt(s -> s.getSum()).sum();
+        Integer influenceDegreeATotal = qualityAnalyseReportBeanList.stream().mapToInt(s -> s.getInfluenceDegreeA())
+                .sum();
+        Integer influenceDegreeBTotal = qualityAnalyseReportBeanList.stream().mapToInt(s -> s.getInfluenceDegreeB())
+                .sum();
+        Integer influenceDegreeCTotal = qualityAnalyseReportBeanList.stream().mapToInt(s -> s.getInfluenceDegreeC())
+                .sum();
+        Integer influenceDegreeDTotal = qualityAnalyseReportBeanList.stream().mapToInt(s -> s.getInfluenceDegreeD())
+                .sum();
+        BigDecimal influenceDegreeARateTotal = new BigDecimal(influenceDegreeATotal);
+        BigDecimal influenceDegreeBRateTotal = new BigDecimal(influenceDegreeBTotal);
+        BigDecimal influenceDegreeCRateTotal = new BigDecimal(influenceDegreeCTotal);
+        BigDecimal influenceDegreeDRateTotal = new BigDecimal(influenceDegreeDTotal);
+
+        if (Objects.nonNull(total) && total.intValue() > 0) {
+            influenceDegreeARateTotal = influenceDegreeARateTotal.divide(new BigDecimal(total), 2,
+                    BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.RATE).setScale(2, BigDecimal.ROUND_HALF_UP);
+            influenceDegreeBRateTotal = influenceDegreeBRateTotal.divide(new BigDecimal(total), 2,
+                    BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.RATE).setScale(2, BigDecimal.ROUND_HALF_UP);
+            influenceDegreeCRateTotal = influenceDegreeCRateTotal.divide(new BigDecimal(total), 2,
+                    BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.RATE).setScale(2, BigDecimal.ROUND_HALF_UP);
+            influenceDegreeDRateTotal = influenceDegreeDRateTotal.divide(new BigDecimal(total), 2,
+                    BigDecimal.ROUND_HALF_UP).multiply(SystemConstant.RATE).setScale(2, BigDecimal.ROUND_HALF_UP);
+        }
+        return ResultUtil.ok(
+                new ImmutableMap.Builder<String, Object>().put(ResourceSecurityReportController.TOTAL, total)
+                        .put(IN_FLUENCE_DEGREE_A_TOTAL, influenceDegreeATotal)
+                        .put(IN_FLUENCE_DEGREE_B_TOTAL, influenceDegreeBTotal)
+                        .put(IN_FLUENCE_DEGREE_C_TOTAL, influenceDegreeCTotal)
+                        .put(IN_FLUENCE_DEGREE_D_TOTAL, influenceDegreeDTotal)
+                        .put(IN_FLUENCE_DEGREE_A_RATE_TOTAL, influenceDegreeARateTotal)
+                        .put(IN_FLUENCE_DEGREE_B_RATE_TOTAL, influenceDegreeBRateTotal)
+                        .put(IN_FLUENCE_DEGREE_C_RATE_TOTAL, influenceDegreeCRateTotal)
+                        .put(IN_FLUENCE_DEGREE_D_RATE_TOTAL, influenceDegreeDRateTotal)
+                        .put(ResourceSecurityReportController.RECORDS, qualityAnalyseReportBeanList).build());
     }
     }
 
 
     @ApiOperation(value = "人力商质量问题统计")
     @ApiOperation(value = "人力商质量问题统计")

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

@@ -33,7 +33,7 @@ public class ResourceSecurityReportController {
     @RequestMapping(value = "/device_supplier/report", method = RequestMethod.POST)
     @RequestMapping(value = "/device_supplier/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "供应商供货数量分布报表", response = SupplierCountReportBean.class) })
     @ApiResponses({ @ApiResponse(code = 200, message = "供应商供货数量分布报表", response = SupplierCountReportBean.class) })
     public Result deviceSupplierReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
     public Result deviceSupplierReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
-        List<SupplierCountReportBean> supplierCountReportBeanList = resourceSecurityReportService.deviceSupplierCountReport(
+        List<SupplierCountReportBean> supplierCountReportBeanList = resourceSecurityReportService.deviceSupplierReport(
                 serviceId);
                 serviceId);
         Integer total = supplierCountReportBeanList.stream().mapToInt(s -> s.getCount()).sum();
         Integer total = supplierCountReportBeanList.stream().mapToInt(s -> s.getCount()).sum();
         return ResultUtil.ok(ImmutableMap.of(TOTAL, total, RECORDS, supplierCountReportBeanList));
         return ResultUtil.ok(ImmutableMap.of(TOTAL, total, RECORDS, supplierCountReportBeanList));
@@ -43,7 +43,7 @@ public class ResourceSecurityReportController {
     @RequestMapping(value = "/human_supplier/report", method = RequestMethod.POST)
     @RequestMapping(value = "/human_supplier/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "供应商供货数量分布报表", response = SupplierCountReportBean.class) })
     @ApiResponses({ @ApiResponse(code = 200, message = "供应商供货数量分布报表", response = SupplierCountReportBean.class) })
     public Result humanSupplierReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
     public Result humanSupplierReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
-        List<SupplierCountReportBean> supplierCountReportBeanList = resourceSecurityReportService.humanSupplierCountReport(
+        List<SupplierCountReportBean> supplierCountReportBeanList = resourceSecurityReportService.humanSupplierReport(
                 serviceId);
                 serviceId);
         Integer total = supplierCountReportBeanList.stream().mapToInt(s -> s.getCount()).sum();
         Integer total = supplierCountReportBeanList.stream().mapToInt(s -> s.getCount()).sum();
         return ResultUtil.ok(ImmutableMap.of(TOTAL, total, RECORDS, supplierCountReportBeanList));
         return ResultUtil.ok(ImmutableMap.of(TOTAL, total, RECORDS, supplierCountReportBeanList));
@@ -53,13 +53,13 @@ public class ResourceSecurityReportController {
     @RequestMapping(value = "/area_ding_exception/report", method = RequestMethod.POST)
     @RequestMapping(value = "/area_ding_exception/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "考勤异常报表", response = DingExceptionCountReportBean.class) })
     @ApiResponses({ @ApiResponse(code = 200, message = "考勤异常报表", response = DingExceptionCountReportBean.class) })
     public Result areaDingExceptionReport(@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));
+        return ResultUtil.ok(resourceSecurityReportService.areaDingExceptionReport(serviceId));
     }
     }
 
 
     @ApiOperation(value = "人力供应商考勤异常数统计")
     @ApiOperation(value = "人力供应商考勤异常数统计")
     @RequestMapping(value = "/human_ding_exception/report", method = RequestMethod.POST)
     @RequestMapping(value = "/human_ding_exception/report", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "考勤异常报表", response = DingExceptionCountReportBean.class) })
     @ApiResponses({ @ApiResponse(code = 200, message = "考勤异常报表", response = DingExceptionCountReportBean.class) })
     public Result humanDingExceptionReport(@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));
+        return ResultUtil.ok(resourceSecurityReportService.humanDingExceptionReport(serviceId));
     }
     }
 }
 }

+ 80 - 37
sop-business/src/main/java/com/qmth/sop/business/bean/report/QualityAnalyseReportBean.java

@@ -1,7 +1,6 @@
 package com.qmth.sop.business.bean.report;
 package com.qmth.sop.business.bean.report;
 
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude;
-import com.qmth.sop.common.enums.InfluenceDegreeEnum;
 import com.qmth.sop.common.enums.QualityProblemReasonEnum;
 import com.qmth.sop.common.enums.QualityProblemReasonEnum;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
@@ -24,26 +23,38 @@ public class QualityAnalyseReportBean implements Serializable {
     @ApiModelProperty(value = "质量问题总数")
     @ApiModelProperty(value = "质量问题总数")
     Integer sum;
     Integer sum;
 
 
+    @ApiModelProperty(value = "影响度A标题")
+    String influenceDegreeATitle = "A类";
+
     @ApiModelProperty(value = "影响度A")
     @ApiModelProperty(value = "影响度A")
-    InfluenceDegreeEnum influenceDegreeA;
+    Integer influenceDegreeA;
 
 
     @ApiModelProperty(value = "影响度A比率")
     @ApiModelProperty(value = "影响度A比率")
     BigDecimal influenceDegreeARate;
     BigDecimal influenceDegreeARate;
 
 
+    @ApiModelProperty(value = "影响度B标题")
+    String influenceDegreeBTitle = "B类";
+
     @ApiModelProperty(value = "影响度B")
     @ApiModelProperty(value = "影响度B")
-    InfluenceDegreeEnum influenceDegreeB;
+    Integer influenceDegreeB;
 
 
     @ApiModelProperty(value = "影响度B比率")
     @ApiModelProperty(value = "影响度B比率")
     BigDecimal influenceDegreeBRate;
     BigDecimal influenceDegreeBRate;
 
 
+    @ApiModelProperty(value = "影响度C标题")
+    String influenceDegreeCTitle = "C类";
+
     @ApiModelProperty(value = "影响度C")
     @ApiModelProperty(value = "影响度C")
-    InfluenceDegreeEnum influenceDegreeC;
+    Integer influenceDegreeC;
 
 
     @ApiModelProperty(value = "影响度C比率")
     @ApiModelProperty(value = "影响度C比率")
     BigDecimal influenceDegreeCRate;
     BigDecimal influenceDegreeCRate;
 
 
+    @ApiModelProperty(value = "影响度D标题")
+    String influenceDegreeDTitle = "D类";
+
     @ApiModelProperty(value = "影响度D")
     @ApiModelProperty(value = "影响度D")
-    InfluenceDegreeEnum influenceDegreeD;
+    Integer influenceDegreeD;
 
 
     @ApiModelProperty(value = "影响度D比率")
     @ApiModelProperty(value = "影响度D比率")
     BigDecimal influenceDegreeDRate;
     BigDecimal influenceDegreeDRate;
@@ -57,6 +68,38 @@ public class QualityAnalyseReportBean implements Serializable {
     @ApiModelProperty(value = "问题原因比率")
     @ApiModelProperty(value = "问题原因比率")
     BigDecimal reasonRate;
     BigDecimal reasonRate;
 
 
+    public String getInfluenceDegreeATitle() {
+        return influenceDegreeATitle;
+    }
+
+    public void setInfluenceDegreeATitle(String influenceDegreeATitle) {
+        this.influenceDegreeATitle = influenceDegreeATitle;
+    }
+
+    public String getInfluenceDegreeBTitle() {
+        return influenceDegreeBTitle;
+    }
+
+    public void setInfluenceDegreeBTitle(String influenceDegreeBTitle) {
+        this.influenceDegreeBTitle = influenceDegreeBTitle;
+    }
+
+    public String getInfluenceDegreeCTitle() {
+        return influenceDegreeCTitle;
+    }
+
+    public void setInfluenceDegreeCTitle(String influenceDegreeCTitle) {
+        this.influenceDegreeCTitle = influenceDegreeCTitle;
+    }
+
+    public String getInfluenceDegreeDTitle() {
+        return influenceDegreeDTitle;
+    }
+
+    public void setInfluenceDegreeDTitle(String influenceDegreeDTitle) {
+        this.influenceDegreeDTitle = influenceDegreeDTitle;
+    }
+
     public String getName() {
     public String getName() {
         return name;
         return name;
     }
     }
@@ -73,14 +116,6 @@ public class QualityAnalyseReportBean implements Serializable {
         this.sum = sum;
         this.sum = sum;
     }
     }
 
 
-    public InfluenceDegreeEnum getInfluenceDegreeA() {
-        return influenceDegreeA;
-    }
-
-    public void setInfluenceDegreeA(InfluenceDegreeEnum influenceDegreeA) {
-        this.influenceDegreeA = influenceDegreeA;
-    }
-
     public BigDecimal getInfluenceDegreeARate() {
     public BigDecimal getInfluenceDegreeARate() {
         return influenceDegreeARate;
         return influenceDegreeARate;
     }
     }
@@ -89,14 +124,6 @@ public class QualityAnalyseReportBean implements Serializable {
         this.influenceDegreeARate = influenceDegreeARate;
         this.influenceDegreeARate = influenceDegreeARate;
     }
     }
 
 
-    public InfluenceDegreeEnum getInfluenceDegreeB() {
-        return influenceDegreeB;
-    }
-
-    public void setInfluenceDegreeB(InfluenceDegreeEnum influenceDegreeB) {
-        this.influenceDegreeB = influenceDegreeB;
-    }
-
     public BigDecimal getInfluenceDegreeBRate() {
     public BigDecimal getInfluenceDegreeBRate() {
         return influenceDegreeBRate;
         return influenceDegreeBRate;
     }
     }
@@ -105,14 +132,6 @@ public class QualityAnalyseReportBean implements Serializable {
         this.influenceDegreeBRate = influenceDegreeBRate;
         this.influenceDegreeBRate = influenceDegreeBRate;
     }
     }
 
 
-    public InfluenceDegreeEnum getInfluenceDegreeC() {
-        return influenceDegreeC;
-    }
-
-    public void setInfluenceDegreeC(InfluenceDegreeEnum influenceDegreeC) {
-        this.influenceDegreeC = influenceDegreeC;
-    }
-
     public BigDecimal getInfluenceDegreeCRate() {
     public BigDecimal getInfluenceDegreeCRate() {
         return influenceDegreeCRate;
         return influenceDegreeCRate;
     }
     }
@@ -121,14 +140,6 @@ public class QualityAnalyseReportBean implements Serializable {
         this.influenceDegreeCRate = influenceDegreeCRate;
         this.influenceDegreeCRate = influenceDegreeCRate;
     }
     }
 
 
-    public InfluenceDegreeEnum getInfluenceDegreeD() {
-        return influenceDegreeD;
-    }
-
-    public void setInfluenceDegreeD(InfluenceDegreeEnum influenceDegreeD) {
-        this.influenceDegreeD = influenceDegreeD;
-    }
-
     public BigDecimal getInfluenceDegreeDRate() {
     public BigDecimal getInfluenceDegreeDRate() {
         return influenceDegreeDRate;
         return influenceDegreeDRate;
     }
     }
@@ -160,4 +171,36 @@ public class QualityAnalyseReportBean implements Serializable {
     public void setReasonRate(BigDecimal reasonRate) {
     public void setReasonRate(BigDecimal reasonRate) {
         this.reasonRate = reasonRate;
         this.reasonRate = reasonRate;
     }
     }
+
+    public Integer getInfluenceDegreeA() {
+        return influenceDegreeA;
+    }
+
+    public void setInfluenceDegreeA(Integer influenceDegreeA) {
+        this.influenceDegreeA = influenceDegreeA;
+    }
+
+    public Integer getInfluenceDegreeB() {
+        return influenceDegreeB;
+    }
+
+    public void setInfluenceDegreeB(Integer influenceDegreeB) {
+        this.influenceDegreeB = influenceDegreeB;
+    }
+
+    public Integer getInfluenceDegreeC() {
+        return influenceDegreeC;
+    }
+
+    public void setInfluenceDegreeC(Integer influenceDegreeC) {
+        this.influenceDegreeC = influenceDegreeC;
+    }
+
+    public Integer getInfluenceDegreeD() {
+        return influenceDegreeD;
+    }
+
+    public void setInfluenceDegreeD(Integer influenceDegreeD) {
+        this.influenceDegreeD = influenceDegreeD;
+    }
 }
 }

+ 11 - 0
sop-business/src/main/java/com/qmth/sop/business/mapper/QualityAnalyseReportMapper.java

@@ -1,7 +1,11 @@
 package com.qmth.sop.business.mapper;
 package com.qmth.sop.business.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.qmth.sop.business.bean.report.QualityAnalyseReportBean;
 import com.qmth.sop.business.entity.TBService;
 import com.qmth.sop.business.entity.TBService;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 /**
 /**
  * @Description: 质量监控分析报表mapper
  * @Description: 质量监控分析报表mapper
@@ -12,4 +16,11 @@ import com.qmth.sop.business.entity.TBService;
  */
  */
 public interface QualityAnalyseReportMapper extends BaseMapper<TBService> {
 public interface QualityAnalyseReportMapper extends BaseMapper<TBService> {
 
 
+    /**
+     * 大区质量问题统计
+     *
+     * @param serviceId
+     * @return
+     */
+    List<QualityAnalyseReportBean> areaQualityReport(@Param("serviceId") Long serviceId);
 }
 }

+ 4 - 4
sop-business/src/main/java/com/qmth/sop/business/mapper/ResourceSecurityReportMapper.java

@@ -23,7 +23,7 @@ public interface ResourceSecurityReportMapper extends BaseMapper<TBService> {
      * @param serviceId
      * @param serviceId
      * @return
      * @return
      */
      */
-    List<SupplierCountReportBean> deviceSupplierCountReport(@Param("serviceId") Long serviceId);
+    List<SupplierCountReportBean> deviceSupplierReport(@Param("serviceId") Long serviceId);
 
 
     /**
     /**
      * 人力商供货数量分布
      * 人力商供货数量分布
@@ -31,7 +31,7 @@ public interface ResourceSecurityReportMapper extends BaseMapper<TBService> {
      * @param serviceId
      * @param serviceId
      * @return
      * @return
      */
      */
-    List<SupplierCountReportBean> humanSupplierCountReport(@Param("serviceId") Long serviceId);
+    List<SupplierCountReportBean> humanSupplierReport(@Param("serviceId") Long serviceId);
 
 
     /**
     /**
      * 大区考勤异常数统计
      * 大区考勤异常数统计
@@ -39,7 +39,7 @@ public interface ResourceSecurityReportMapper extends BaseMapper<TBService> {
      * @param serviceId
      * @param serviceId
      * @return
      * @return
      */
      */
-    List<DingExceptionCountReportBean> areaDingExceptionCountReport(@Param("serviceId") Long serviceId);
+    List<DingExceptionCountReportBean> areaDingExceptionReport(@Param("serviceId") Long serviceId);
 
 
     /**
     /**
      * 人力供应商考勤异常数统计
      * 人力供应商考勤异常数统计
@@ -47,5 +47,5 @@ public interface ResourceSecurityReportMapper extends BaseMapper<TBService> {
      * @param serviceId
      * @param serviceId
      * @return
      * @return
      */
      */
-    List<DingExceptionCountReportBean> humanDingExceptionCountReport(@Param("serviceId") Long serviceId);
+    List<DingExceptionCountReportBean> humanDingExceptionReport(@Param("serviceId") Long serviceId);
 }
 }

+ 10 - 0
sop-business/src/main/java/com/qmth/sop/business/service/QualityAnalyseReportService.java

@@ -1,8 +1,11 @@
 package com.qmth.sop.business.service;
 package com.qmth.sop.business.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.sop.business.bean.report.QualityAnalyseReportBean;
 import com.qmth.sop.business.entity.TBService;
 import com.qmth.sop.business.entity.TBService;
 
 
+import java.util.List;
+
 /**
 /**
  * @Description: 质量监控分析报表service
  * @Description: 质量监控分析报表service
  * @Param:
  * @Param:
@@ -12,4 +15,11 @@ import com.qmth.sop.business.entity.TBService;
  */
  */
 public interface QualityAnalyseReportService extends IService<TBService> {
 public interface QualityAnalyseReportService extends IService<TBService> {
 
 
+    /**
+     * 大区质量问题统计
+     *
+     * @param serviceId
+     * @return
+     */
+    List<QualityAnalyseReportBean> areaQualityReport(Long serviceId);
 }
 }

+ 4 - 4
sop-business/src/main/java/com/qmth/sop/business/service/ResourceSecurityReportService.java

@@ -22,7 +22,7 @@ public interface ResourceSecurityReportService extends IService<TBService> {
      * @param serviceId
      * @param serviceId
      * @return
      * @return
      */
      */
-    List<SupplierCountReportBean> deviceSupplierCountReport(Long serviceId);
+    List<SupplierCountReportBean> deviceSupplierReport(Long serviceId);
 
 
     /**
     /**
      * 人力商供货数量分布
      * 人力商供货数量分布
@@ -30,7 +30,7 @@ public interface ResourceSecurityReportService extends IService<TBService> {
      * @param serviceId
      * @param serviceId
      * @return
      * @return
      */
      */
-    List<SupplierCountReportBean> humanSupplierCountReport(Long serviceId);
+    List<SupplierCountReportBean> humanSupplierReport(Long serviceId);
 
 
     /**
     /**
      * 大区考勤异常数统计
      * 大区考勤异常数统计
@@ -38,7 +38,7 @@ public interface ResourceSecurityReportService extends IService<TBService> {
      * @param serviceId
      * @param serviceId
      * @return
      * @return
      */
      */
-    List<DingExceptionCountReportBean> areaDingExceptionCountReport(Long serviceId);
+    List<DingExceptionCountReportBean> areaDingExceptionReport(Long serviceId);
 
 
     /**
     /**
      * 人力供应商考勤异常数统计
      * 人力供应商考勤异常数统计
@@ -46,5 +46,5 @@ public interface ResourceSecurityReportService extends IService<TBService> {
      * @param serviceId
      * @param serviceId
      * @return
      * @return
      */
      */
-    List<DingExceptionCountReportBean> humanDingExceptionCountReport(Long serviceId);
+    List<DingExceptionCountReportBean> humanDingExceptionReport(Long serviceId);
 }
 }

+ 13 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/QualityAnalyseReportServiceImpl.java

@@ -1,11 +1,14 @@
 package com.qmth.sop.business.service.impl;
 package com.qmth.sop.business.service.impl;
 
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.sop.business.bean.report.QualityAnalyseReportBean;
 import com.qmth.sop.business.entity.TBService;
 import com.qmth.sop.business.entity.TBService;
 import com.qmth.sop.business.mapper.QualityAnalyseReportMapper;
 import com.qmth.sop.business.mapper.QualityAnalyseReportMapper;
 import com.qmth.sop.business.service.QualityAnalyseReportService;
 import com.qmth.sop.business.service.QualityAnalyseReportService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.util.List;
+
 /**
 /**
  * @Description: 质量监控分析报表service impl
  * @Description: 质量监控分析报表service impl
  * @Param:
  * @Param:
@@ -17,4 +20,14 @@ import org.springframework.stereotype.Service;
 public class QualityAnalyseReportServiceImpl extends ServiceImpl<QualityAnalyseReportMapper, TBService>
 public class QualityAnalyseReportServiceImpl extends ServiceImpl<QualityAnalyseReportMapper, TBService>
         implements QualityAnalyseReportService {
         implements QualityAnalyseReportService {
 
 
+    /**
+     * 大区质量问题统计
+     *
+     * @param serviceId
+     * @return
+     */
+    @Override
+    public List<QualityAnalyseReportBean> areaQualityReport(Long serviceId) {
+        return this.baseMapper.areaQualityReport(serviceId);
+    }
 }
 }

+ 8 - 8
sop-business/src/main/java/com/qmth/sop/business/service/impl/ResourceSecurityReportServiceImpl.java

@@ -28,8 +28,8 @@ public class ResourceSecurityReportServiceImpl extends ServiceImpl<ResourceSecur
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<SupplierCountReportBean> deviceSupplierCountReport(Long serviceId) {
-        return this.baseMapper.deviceSupplierCountReport(serviceId);
+    public List<SupplierCountReportBean> deviceSupplierReport(Long serviceId) {
+        return this.baseMapper.deviceSupplierReport(serviceId);
     }
     }
 
 
     /**
     /**
@@ -39,8 +39,8 @@ public class ResourceSecurityReportServiceImpl extends ServiceImpl<ResourceSecur
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<SupplierCountReportBean> humanSupplierCountReport(Long serviceId) {
-        return this.baseMapper.humanSupplierCountReport(serviceId);
+    public List<SupplierCountReportBean> humanSupplierReport(Long serviceId) {
+        return this.baseMapper.humanSupplierReport(serviceId);
     }
     }
 
 
     /**
     /**
@@ -50,8 +50,8 @@ public class ResourceSecurityReportServiceImpl extends ServiceImpl<ResourceSecur
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<DingExceptionCountReportBean> areaDingExceptionCountReport(Long serviceId) {
-        return this.baseMapper.areaDingExceptionCountReport(serviceId);
+    public List<DingExceptionCountReportBean> areaDingExceptionReport(Long serviceId) {
+        return this.baseMapper.areaDingExceptionReport(serviceId);
     }
     }
 
 
     /**
     /**
@@ -61,7 +61,7 @@ public class ResourceSecurityReportServiceImpl extends ServiceImpl<ResourceSecur
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<DingExceptionCountReportBean> humanDingExceptionCountReport(Long serviceId) {
-        return this.baseMapper.humanDingExceptionCountReport(serviceId);
+    public List<DingExceptionCountReportBean> humanDingExceptionReport(Long serviceId) {
+        return this.baseMapper.humanDingExceptionReport(serviceId);
     }
     }
 }
 }

+ 28 - 0
sop-business/src/main/resources/mapper/QualityAnalyseReportMapper.xml

@@ -2,4 +2,32 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qmth.sop.business.mapper.QualityAnalyseReportMapper">
 <mapper namespace="com.qmth.sop.business.mapper.QualityAnalyseReportMapper">
 
 
+    <select id="areaQualityReport" resultType="com.qmth.sop.business.bean.report.QualityAnalyseReportBean">
+        select t.*,
+        ROUND(t.influenceDegreeA / sum,2) * 100 as influenceDegreeARate,
+        ROUND(t.influenceDegreeB / sum,2) * 100 as influenceDegreeBRate,
+        ROUND(t.influenceDegreeC / sum,2) * 100 as influenceDegreeCRate,
+        ROUND(t.influenceDegreeD / sum,2) * 100 as influenceDegreeDRate
+        from(select
+        distinct su.real_name as name,
+        count(distinct tbqpa.id) as sum,
+        SUM( CASE WHEN tbqpa.Influence_degree = 'A' THEN 1 ELSE 0 END) as influenceDegreeA,
+        SUM( CASE WHEN tbqpa.Influence_degree = 'B' THEN 1 ELSE 0 END) as influenceDegreeB,
+        SUM( CASE WHEN tbqpa.Influence_degree = 'C' THEN 1 ELSE 0 END) as influenceDegreeC,
+        SUM( CASE WHEN tbqpa.Influence_degree = 'D' THEN 1 ELSE 0 END) as influenceDegreeD
+        from
+        t_b_quality_problem_apply tbqpa
+        join t_b_service tbs on tbs.id = tbqpa.service_id
+        join t_b_crm tbc on tbc.crm_no = tbqpa.crm_no
+        join sys_user su on su.id = tbc.lead_id
+        join t_f_custom_flow_entity tfcfe on tfcfe.code = tbqpa.problem_no
+        join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
+        where
+        tbqpa.service_id = 1834506773894774786
+        and tbs.status <![CDATA[ <> ]]> 'CANCEL'
+        and tffa.status <![CDATA[ <> ]]> 'END'
+        and tbqpa.Influence_degree is not null
+        group by su.real_name) t
+        order by t.name
+    </select>
 </mapper>
 </mapper>

+ 4 - 4
sop-business/src/main/resources/mapper/ResourceSecurityReportMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qmth.sop.business.mapper.ResourceSecurityReportMapper">
 <mapper namespace="com.qmth.sop.business.mapper.ResourceSecurityReportMapper">
 
 
-    <select id="deviceSupplierCountReport" resultType="com.qmth.sop.business.bean.report.SupplierCountReportBean">
+    <select id="deviceSupplierReport" resultType="com.qmth.sop.business.bean.report.SupplierCountReportBean">
         select ss.name as deviceSupplierName,count(distinct tbdd.id) as count from t_b_service tbs
         select ss.name as deviceSupplierName,count(distinct tbdd.id) as count from t_b_service tbs
         join t_b_sop_info tbsi on tbsi.service_id = tbs.id
         join t_b_sop_info tbsi on tbsi.service_id = tbs.id
         join t_b_device_delivery tbdd on tbdd.crm_no = tbsi.crm_no
         join t_b_device_delivery tbdd on tbdd.crm_no = tbsi.crm_no
@@ -15,7 +15,7 @@
         order by ss.name
         order by ss.name
     </select>
     </select>
 
 
-    <select id="humanSupplierCountReport" resultType="com.qmth.sop.business.bean.report.SupplierCountReportBean">
+    <select id="humanSupplierReport" resultType="com.qmth.sop.business.bean.report.SupplierCountReportBean">
         select ss.name as humanSupplierName,count(distinct tbuas.user_archives_id) as count from t_b_service tbs
         select ss.name as humanSupplierName,count(distinct tbuas.user_archives_id) as count from t_b_service tbs
         join t_b_sop_info tbsi on tbsi.service_id = tbs.id
         join t_b_sop_info tbsi on tbsi.service_id = tbs.id
         join t_b_crm_detail tbcd on tbcd.sop_no = tbsi.sop_no
         join t_b_crm_detail tbcd on tbcd.sop_no = tbsi.sop_no
@@ -32,7 +32,7 @@
         order by ss.name
         order by ss.name
     </select>
     </select>
 
 
-    <select id="areaDingExceptionCountReport" resultType="com.qmth.sop.business.bean.report.DingExceptionCountReportBean">
+    <select id="areaDingExceptionReport" resultType="com.qmth.sop.business.bean.report.DingExceptionCountReportBean">
         select * from(select distinct su.real_name as areaManagerName,sum(case when tbd.sign_in_time is null or tbd.sign_out_time is null then 1 else 0 end) as count
         select * from(select distinct su.real_name as areaManagerName,sum(case when tbd.sign_in_time is null or tbd.sign_out_time is null then 1 else 0 end) as count
         from t_b_service tbs
         from t_b_service tbs
         join t_b_crm tbc on tbc.service_id = tbs.id
         join t_b_crm tbc on tbc.service_id = tbs.id
@@ -48,7 +48,7 @@
         order by t.areaManagerName
         order by t.areaManagerName
     </select>
     </select>
 
 
-    <select id="humanDingExceptionCountReport" resultType="com.qmth.sop.business.bean.report.DingExceptionCountReportBean">
+    <select id="humanDingExceptionReport" resultType="com.qmth.sop.business.bean.report.DingExceptionCountReportBean">
         select * from(select distinct ss.name as humanSupplierName,sum(case when tbd.sign_in_time is null or tbd.sign_out_time is null then 1 else 0 end) as count
         select * from(select distinct ss.name as humanSupplierName,sum(case when tbd.sign_in_time is null or tbd.sign_out_time is null then 1 else 0 end) as count
           from t_b_service tbs
           from t_b_service tbs
                    join t_b_crm tbc on tbc.service_id = tbs.id
                    join t_b_crm tbc on tbc.service_id = tbs.id