Prechádzať zdrojové kódy

消防执法动态-监督检查举报投诉信息统计相关接口开发

jichaobo 2 rokov pred
rodič
commit
84e2dc7836

+ 5 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BscLawTrend.java

@@ -47,6 +47,11 @@ public class BscLawTrend implements Serializable {
      */
     private String complaintHandle;
 
+    /**
+     * 监督检查举报投诉信息
+     */
+    private String enforceReportComplaint;
+
     /**
      * 创建时间
      */

+ 6 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemEnforceReportAttachMapper.java

@@ -1,7 +1,9 @@
 package com.usky.fire.mapper;
 
-import com.usky.fire.domain.DemEnforceReportAttach;
 import com.usky.common.mybatis.core.CrudMapper;
+import com.usky.fire.domain.DemEnforceReportAttach;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
 
 /**
  * <p>
@@ -11,6 +13,9 @@ import com.usky.common.mybatis.core.CrudMapper;
  * @author JCB
  * @since 2022-09-23
  */
+@Repository
 public interface DemEnforceReportAttachMapper extends CrudMapper<DemEnforceReportAttach> {
 
+    Integer selectCount1(@Param("workOrderStatusName") String workOrderStatusName,
+                        @Param("satisfiedType") String satisfiedType);
 }

+ 9 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BscLawTrendService.java

@@ -5,6 +5,7 @@ import com.usky.fire.domain.BscLawTrend;
 import com.usky.fire.domain.DemEnforceReportComplaint;
 import com.usky.fire.service.vo.AlFsdAllVO;
 import com.usky.fire.service.vo.ReportComplaintVO;
+import com.usky.fire.service.vo.ReportStatisticsVO;
 import com.usky.fire.service.vo.SiAeAllVO;
 
 import java.util.List;
@@ -83,4 +84,12 @@ public interface BscLawTrendService extends CrudService<BscLawTrend> {
      * @return
      */
     List<DemEnforceReportComplaint> enforceReportComplaint();
+
+
+    /**
+     * 消防执法动态-监督检查举报投诉信息(定时)
+     *
+     * @return
+     */
+    ReportStatisticsVO enforceReportComplaintOne();
 }

+ 11 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemEnforceReportAttachService.java

@@ -1,7 +1,8 @@
 package com.usky.fire.service;
 
-import com.usky.fire.domain.DemEnforceReportAttach;
 import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.domain.DemEnforceReportAttach;
+import com.usky.fire.service.vo.ReportStatisticsVO;
 
 /**
  * <p>
@@ -13,4 +14,13 @@ import com.usky.common.mybatis.core.CrudService;
  */
 public interface DemEnforceReportAttachService extends CrudService<DemEnforceReportAttach> {
 
+    /**
+     * 监督检查举报投诉信息统计
+     *
+     * @param workOrderStatusName 工单状态名称
+     * @param satisfiedType       是否满意
+     * @return
+     */
+    int enforceReportAttachCount(String workOrderStatusName, String satisfiedType);
+
 }

+ 31 - 5
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BscLawTrendServiceImpl.java

@@ -19,6 +19,7 @@ import com.usky.fire.service.enums.BsSaOneCode;
 import com.usky.fire.service.enums.BsSaTwoCode;
 import com.usky.fire.service.vo.AlFsdAllVO;
 import com.usky.fire.service.vo.ReportComplaintVO;
+import com.usky.fire.service.vo.ReportStatisticsVO;
 import com.usky.fire.service.vo.SiAeAllVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -85,6 +86,9 @@ public class BscLawTrendServiceImpl extends AbstractCrudService<BscLawTrendMappe
             case "complaintHandle":
                 queryWrapper.select(BscLawTrend::getComplaintHandle);
                 break;
+            case "enforceReportComplaint":
+                queryWrapper.select(BscLawTrend::getEnforceReportComplaint);
+                break;
             default:
                 throw new BusinessException("参数错误");
         }
@@ -111,6 +115,10 @@ public class BscLawTrendServiceImpl extends AbstractCrudService<BscLawTrendMappe
                 data = list.get(0).getComplaintHandle();
                 jsonArray = JSONObject.parseArray(data);
                 break;
+            case "enforceReportComplaint":
+                data = list.get(0).getEnforceReportComplaint();
+                jsonArray = JSONObject.parseArray(data);
+                break;
             default:
                 throw new BusinessException("参数错误");
         }
@@ -218,11 +226,13 @@ public class BscLawTrendServiceImpl extends AbstractCrudService<BscLawTrendMappe
         List<SiAeAllVO> siAeAllVOS = this.monthLaw();
         AlFsdAllVO alFsdAllVO = this.adstraLicense();
         List<ReportComplaintVO> reportComplaintVOS = this.reportComplaint();
+        ReportStatisticsVO reportStatisticsVO = this.enforceReportComplaintOne();
         BscLawTrend bscLawTrend = new BscLawTrend();
         bscLawTrend.setMonthLaw(JSON.toJSONString(siAeAllVOS));
         bscLawTrend.setAdstraLicense(JSON.toJSONString(alFsdAllVO));
         bscLawTrend.setReportComplaint(JSON.toJSONString(reportComplaintVOS));
         bscLawTrend.setComplaintHandle(JSON.toJSONString(reportComplaintVOS));
+        bscLawTrend.setEnforceReportComplaint(JSON.toJSONString(reportStatisticsVO));
         bscLawTrend.setCreateTime(LocalDateTime.now());
         this.save(bscLawTrend);
     }
@@ -338,11 +348,11 @@ public class BscLawTrendServiceImpl extends AbstractCrudService<BscLawTrendMappe
             for (int i = 0; i < list1.size(); i++) {
                 reportIdList.add(list1.get(i).getReportId());
             }
-            QueryWrapper<DemEnforceReportAttach> query = Wrappers.query();
-            query.in("report_id", reportIdList)
-                    .ne("work_order_status_name", "已撤销")
-                    .eq(StringUtils.isNotBlank(hazardSiteName), "hazard_site_name", hazardSiteName);
-            count = demEnforceReportAttachService.count(query);
+            LambdaQueryWrapper<DemEnforceReportAttach> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.in(DemEnforceReportAttach::getReportId, reportIdList)
+                    .ne(DemEnforceReportAttach::getWorkOrderStatusName, "已撤销")
+                    .eq(StringUtils.isNotBlank(hazardSiteName), DemEnforceReportAttach::getHazardSiteName, hazardSiteName);
+            count = demEnforceReportAttachService.count(queryWrapper);
         }
         return count;
     }
@@ -379,4 +389,20 @@ public class BscLawTrendServiceImpl extends AbstractCrudService<BscLawTrendMappe
         return list1;
     }
 
+    @Override
+    public ReportStatisticsVO enforceReportComplaintOne() {
+        //办结数 = 已处理+已归档 处理数 = 总-办结数
+        ReportStatisticsVO reportStatisticsVo = new ReportStatisticsVO();
+        //总数
+        Integer count = demEnforceReportAttachService.enforceReportAttachCount(null, null);
+        reportStatisticsVo.setComplaintNumber(count);
+        Integer fireCount = demEnforceReportAttachService.enforceReportAttachCount("已归档", null);
+        Integer concludeCount = demEnforceReportAttachService.enforceReportAttachCount("已办结", null);
+        reportStatisticsVo.setConcludeNumber(fireCount + concludeCount);
+        reportStatisticsVo.setCheckNumber(count - fireCount - concludeCount);
+        Integer satisfactionRateNumber = demEnforceReportAttachService.enforceReportAttachCount(null, "3");
+        reportStatisticsVo.setSatisfactionRate(Arith.div(satisfactionRateNumber, count,2));
+        return reportStatisticsVo;
+    }
+
 }

+ 8 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemEnforceReportAttachServiceImpl.java

@@ -1,9 +1,11 @@
 package com.usky.fire.service.impl;
 
+import com.usky.common.core.util.Arith;
 import com.usky.fire.domain.DemEnforceReportAttach;
 import com.usky.fire.mapper.DemEnforceReportAttachMapper;
 import com.usky.fire.service.DemEnforceReportAttachService;
 import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.fire.service.vo.ReportStatisticsVO;
 import org.springframework.stereotype.Service;
 
 /**
@@ -17,4 +19,10 @@ import org.springframework.stereotype.Service;
 @Service
 public class DemEnforceReportAttachServiceImpl extends AbstractCrudService<DemEnforceReportAttachMapper, DemEnforceReportAttach> implements DemEnforceReportAttachService {
 
+    @Override
+    public int enforceReportAttachCount(String workOrderStatusName, String satisfiedType){
+        Integer integer = baseMapper.selectCount1(workOrderStatusName, satisfiedType);
+        return integer;
+    }
+
 }

+ 34 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/ReportStatisticsVO.java

@@ -0,0 +1,34 @@
+package com.usky.fire.service.vo;
+
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/5/28 17:23
+ * 举报投诉统计
+ */
+@Data
+public class ReportStatisticsVO {
+
+    /**
+     * 投诉数
+     */
+    private Integer complaintNumber;
+
+    /**
+     * 办结数
+     */
+    private Integer concludeNumber;
+
+    /**
+     * 检查数
+     */
+    private Integer checkNumber;
+
+    /**
+     * 满意率
+     */
+    private Double satisfactionRate;
+
+
+}

+ 1 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/BscLawTrendMapper.xml

@@ -9,6 +9,7 @@
         <result column="adstra_license" property="adstraLicense" />
         <result column="report_complaint" property="reportComplaint" />
         <result column="complaint_handle" property="complaintHandle" />
+        <result column="enforce_report_complaint" property="enforceReportComplaint" />
         <result column="create_time" property="createTime" />
     </resultMap>
 

+ 66 - 50
service-fire/service-fire-biz/src/main/resources/mapper/fire/DemEnforceReportAttachMapper.xml

@@ -4,56 +4,72 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.usky.fire.domain.DemEnforceReportAttach">
-        <id column="id" property="id" />
-        <result column="report_id" property="reportId" />
-        <result column="serial_number" property="serialNumber" />
-        <result column="operator" property="operator" />
-        <result column="operator_phone" property="operatorPhone" />
-        <result column="complete_time" property="completeTime" />
-        <result column="complete_submit_time" property="completeSubmitTime" />
-        <result column="data_entry_time" property="dataEntryTime" />
-        <result column="annex_id" property="annexId" />
-        <result column="report_status" property="reportStatus" />
-        <result column="follow_up_status" property="followUpStatus" />
-        <result column="order_receive_time" property="orderReceiveTime" />
-        <result column="detachment_receive_time" property="detachmentReceiveTime" />
-        <result column="brigade_receive_time" property="brigadeReceiveTime" />
-        <result column="command_center_receiver" property="commandCenterReceiver" />
-        <result column="detachment_receiver" property="detachmentReceiver" />
-        <result column="brigade_receiver" property="brigadeReceiver" />
-        <result column="fire_control_id" property="fireControlId" />
-        <result column="switchboard_phone_id" property="switchboardPhoneId" />
-        <result column="process_table_id" property="processTableId" />
-        <result column="process_instance_id" property="processInstanceId" />
-        <result column="filing_time" property="filingTime" />
-        <result column="filing_person" property="filingPerson" />
-        <result column="report_area" property="reportArea" />
-        <result column="supervision_times" property="supervisionTimes" />
-        <result column="bonus_payment_status" property="bonusPaymentStatus" />
-        <result column="detachment_rollback_reason" property="detachmentRollbackReason" />
-        <result column="detachment_rollback_time" property="detachmentRollbackTime" />
-        <result column="report_attachment" property="reportAttachment" />
-        <result column="no_contact_other" property="noContactOther" />
-        <result column="hazard_site_other" property="hazardSiteOther" />
-        <result column="hazard_type_other" property="hazardTypeOther" />
-        <result column="complete_attachment" property="completeAttachment" />
-        <result column="cancelled_time" property="cancelledTime" />
-        <result column="cancelled_person" property="cancelledPerson" />
-        <result column="bonus_application_id" property="bonusApplicationId" />
-        <result column="detachment_receiver_name" property="detachmentReceiverName" />
-        <result column="brigade_filed_return" property="brigadeFiledReturn" />
-        <result column="need_feedback" property="needFeedback" />
-        <result column="feedback_time" property="feedbackTime" />
-        <result column="feedback_deadline" property="feedbackDeadline" />
-        <result column="feedback_content" property="feedbackContent" />
-        <result column="bdp_audit" property="bdpAudit" />
-        <result column="work_order_status_name" property="workOrderStatusName" />
-        <result column="report_method_name" property="reportMethodName" />
-        <result column="govern_area_name" property="governAreaName" />
-        <result column="hazard_site_name" property="hazardSiteName" />
-        <result column="hazard_type_name" property="hazardTypeName" />
-        <result column="work_order_type_name" property="workOrderTypeName" />
-        <result column="union_key" property="unionKey" />
+        <id column="id" property="id"/>
+        <result column="report_id" property="reportId"/>
+        <result column="serial_number" property="serialNumber"/>
+        <result column="operator" property="operator"/>
+        <result column="operator_phone" property="operatorPhone"/>
+        <result column="complete_time" property="completeTime"/>
+        <result column="complete_submit_time" property="completeSubmitTime"/>
+        <result column="data_entry_time" property="dataEntryTime"/>
+        <result column="annex_id" property="annexId"/>
+        <result column="report_status" property="reportStatus"/>
+        <result column="follow_up_status" property="followUpStatus"/>
+        <result column="order_receive_time" property="orderReceiveTime"/>
+        <result column="detachment_receive_time" property="detachmentReceiveTime"/>
+        <result column="brigade_receive_time" property="brigadeReceiveTime"/>
+        <result column="command_center_receiver" property="commandCenterReceiver"/>
+        <result column="detachment_receiver" property="detachmentReceiver"/>
+        <result column="brigade_receiver" property="brigadeReceiver"/>
+        <result column="fire_control_id" property="fireControlId"/>
+        <result column="switchboard_phone_id" property="switchboardPhoneId"/>
+        <result column="process_table_id" property="processTableId"/>
+        <result column="process_instance_id" property="processInstanceId"/>
+        <result column="filing_time" property="filingTime"/>
+        <result column="filing_person" property="filingPerson"/>
+        <result column="report_area" property="reportArea"/>
+        <result column="supervision_times" property="supervisionTimes"/>
+        <result column="bonus_payment_status" property="bonusPaymentStatus"/>
+        <result column="detachment_rollback_reason" property="detachmentRollbackReason"/>
+        <result column="detachment_rollback_time" property="detachmentRollbackTime"/>
+        <result column="report_attachment" property="reportAttachment"/>
+        <result column="no_contact_other" property="noContactOther"/>
+        <result column="hazard_site_other" property="hazardSiteOther"/>
+        <result column="hazard_type_other" property="hazardTypeOther"/>
+        <result column="complete_attachment" property="completeAttachment"/>
+        <result column="cancelled_time" property="cancelledTime"/>
+        <result column="cancelled_person" property="cancelledPerson"/>
+        <result column="bonus_application_id" property="bonusApplicationId"/>
+        <result column="detachment_receiver_name" property="detachmentReceiverName"/>
+        <result column="brigade_filed_return" property="brigadeFiledReturn"/>
+        <result column="need_feedback" property="needFeedback"/>
+        <result column="feedback_time" property="feedbackTime"/>
+        <result column="feedback_deadline" property="feedbackDeadline"/>
+        <result column="feedback_content" property="feedbackContent"/>
+        <result column="bdp_audit" property="bdpAudit"/>
+        <result column="work_order_status_name" property="workOrderStatusName"/>
+        <result column="report_method_name" property="reportMethodName"/>
+        <result column="govern_area_name" property="governAreaName"/>
+        <result column="hazard_site_name" property="hazardSiteName"/>
+        <result column="hazard_type_name" property="hazardTypeName"/>
+        <result column="work_order_type_name" property="workOrderTypeName"/>
+        <result column="union_key" property="unionKey"/>
     </resultMap>
 
+    <select id="selectCount1" resultType="java.lang.Integer">
+        select count(*) from
+        dem_enforce_report_complaint as a
+        JOIN dem_enforce_report_attach as b ON a.report_id = b.report_id
+        <where>
+            a.`enable` = 0
+            AND b.work_order_status_name != '已撤销'
+            <if test="workOrderStatusName !=null and workOrderStatusName != ''">
+                and b.work_order_status_name = #{workOrderStatusName}
+            </if>
+            <if test="satisfiedType !=null and satisfiedType != ''">
+                and a.satisfied_type = #{satisfiedType}
+            </if>
+        </where>
+    </select>
+
 </mapper>