瀏覽代碼

消防执法动态相关接口开发

jichaobo 2 年之前
父節點
當前提交
90e3df6d1a
共有 18 個文件被更改,包括 1258 次插入3 次删除
  1. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java
  2. 45 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BscLawTrendController.java
  3. 21 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemLawStatisticsController.java
  4. 56 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BscLawTrend.java
  5. 461 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemLawStatistics.java
  6. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/BscLawTrendMapper.java
  7. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemLawStatisticsMapper.java
  8. 64 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BscLawTrendService.java
  9. 27 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemLawStatisticsService.java
  10. 70 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/enums/BsSaOneCode.java
  11. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BscEnterpriseAutonomyServiceImpl.java
  12. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BscEnterpriseStreetTownServiceImpl.java
  13. 248 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BscLawTrendServiceImpl.java
  14. 55 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemLawStatisticsServiceImpl.java
  15. 23 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/ReportComplaintVO.java
  16. 42 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/SiAeAllVO.java
  17. 15 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/BscLawTrendMapper.xml
  18. 96 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/DemLawStatisticsMapper.xml

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java

@@ -71,7 +71,7 @@ public class MybatisGeneratorUtils {
         // strategy.setTablePrefix("t_"); // 表名前缀
         strategy.setEntityLombokModel(true); //使用lombok
         //修改自己想要生成的表
-        strategy.setInclude("dem_case");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        strategy.setInclude("dem_law_statistics");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
         mpg.setStrategy(strategy);
 
         // 关闭默认 xml 生成,调整生成 至 根目录

+ 45 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BscLawTrendController.java

@@ -0,0 +1,45 @@
+package com.usky.fire.controller.web;
+
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.fire.service.BscLawTrendService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 消防执法动态大屏统计 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-10-13
+ */
+@RestController
+@RequestMapping("/bscLawTrend")
+public class BscLawTrendController {
+
+    @Autowired
+    private BscLawTrendService bscLawTrendService;
+
+    /**
+     * 消防执法动态-数据查询
+     *
+     * @param moduleType 模块类型(monthLaw:当月执法情况 adstraLicense:行政许可情况 reportComplaint:消防隐患举报投诉 complaintHandle:投诉处理情况)
+     * @return
+     */
+    @GetMapping("lawTrendList")
+    public ApiResult<Object> lawTrendList(@RequestParam(value = "moduleType") String moduleType) {
+        return ApiResult.success(bscLawTrendService.lawTrendList(moduleType));
+    }
+
+
+    @GetMapping("monthLaw")
+    public ApiResult<Object> monthLaw() {
+        return ApiResult.success(bscLawTrendService.reportComplaint());
+    }
+
+}
+

+ 21 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemLawStatisticsController.java

@@ -0,0 +1,21 @@
+package com.usky.fire.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 行政执法统计总表 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-10-13
+ */
+@Controller
+@RequestMapping("/demLawStatistics")
+public class DemLawStatisticsController {
+
+}
+

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

@@ -0,0 +1,56 @@
+package com.usky.fire.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 消防执法动态大屏统计
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-10-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class BscLawTrend implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 当月执法情况
+     */
+    private String monthLaw;
+
+    /**
+     * 行政许可情况
+     */
+    private String adstraLicense;
+
+    /**
+     * 消防隐患举报投诉
+     */
+    private String reportComplaint;
+
+    /**
+     * 投诉处理情况
+     */
+    private String complaintHandle;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+
+}

+ 461 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemLawStatistics.java

@@ -0,0 +1,461 @@
+package com.usky.fire.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 行政执法统计总表
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-10-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class DemLawStatistics implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * ID
+     */
+    private String lawId;
+
+    /**
+     * 单位编号
+     */
+    private String companyCode;
+
+    /**
+     * 是否包含下属;默认1 是
+     */
+    private Integer includeBranch;
+
+    /**
+     * 是否包含派出所;默认0 否
+     */
+    private Integer includePoliceStation;
+
+    /**
+     * 是否派出所汇总;0否 1是
+     */
+    private Integer policeStationSummary;
+
+    /**
+     * 是否合计
+     */
+    private Integer amountTo;
+
+    /**
+     * 是否混合部署;0否 1是
+     */
+    private Integer mixedDeploy;
+
+    /**
+     * 数据日期
+     */
+    private LocalDateTime dataTime;
+
+    /**
+     * 目标数据交换的单位
+     */
+    private String dataExchangeUnit;
+
+    /**
+     * 监督检查出动人数(人、次)
+     */
+    private String inspectPersonNumber;
+
+    /**
+     * 检查单位(家、次)
+     */
+    private String inspectCompany;
+
+    /**
+     * 发现火灾隐患或违法行为(处)
+     */
+    private String fireHazard;
+
+    /**
+     * 发临时查封决定书(份)
+     */
+    private String temporarySeizure;
+
+    /**
+     * 发责令改正通知书
+     */
+    private String correctionNotice;
+
+    /**
+     * 发同意/不同意解除临时查封决定书
+     */
+    private Integer relieveTemporarySeizure;
+
+    /**
+     * 发消防安全检查合格证
+     */
+    private String inspectCertificate;
+
+    /**
+     * 发举办前消防安全检查意见书
+     */
+    private String inspectOpinions;
+
+    /**
+     * 发撤销批准决定书
+     */
+    private String revokeApproval;
+
+    /**
+     * 督促整改火灾隐患或违法行为
+     */
+    private String rectificateFireHazard;
+
+    /**
+     * 监督抽查
+     */
+    private String spotCheck;
+
+    /**
+     * 投入使用营业安全检查(起)
+     */
+    private String jobInspect;
+
+    /**
+     * 举报投诉检查
+     */
+    private String enforceInspect;
+
+    /**
+     * 其它检查
+     */
+    private String otherInspect;
+
+    /**
+     * 复查
+     */
+    private String review;
+
+    /**
+     * 举办前安全检查(个 次)
+     */
+    private String holdInspect;
+
+    /**
+     * 监督抽查01
+     */
+    private String spotCheck1;
+
+    /**
+     * 投入使用营业前安全检查
+     */
+    private String jobBeforeInspect;
+
+    /**
+     * 举办前安全检查
+     */
+    private String holdBeforeInspect;
+
+    /**
+     * 举报投诉检查01
+     */
+    private String enforceInspect1;
+
+    /**
+     * 其他检查
+     */
+    private String otherInspect2;
+
+    /**
+     * 复查01
+     */
+    private String review1;
+
+    /**
+     * 举办消防培训班
+     */
+    private String fireTrainClass;
+
+    /**
+     * 培训教育
+     */
+    private String trainEducation;
+
+    /**
+     * 受理审核项目
+     */
+    private String acceptReviewItems;
+
+    /**
+     * 发审核意见书
+     */
+    private String reviewOpinions;
+
+    /**
+     * 受理验收项目
+     */
+    private String acceptItems;
+
+    /**
+     * 发验收意见书
+     */
+    private String acceptOpinions;
+
+    /**
+     * 消防设计备案抽查
+     */
+    private String designFiling;
+
+    /**
+     * 发消防设计/竣工验收消防违法通知书
+     */
+    private String designIllegalNotice;
+
+    /**
+     * 竣工验收消防备案抽查
+     */
+    private String completeProtectionRecord;
+
+    /**
+     * 发消防设计/竣工验收消防复查意见书
+     */
+    private String designReviewOpinions;
+
+    /**
+     * 审核建筑面积
+     */
+    private String reviewBuildArea;
+
+    /**
+     * 实施产品消防监督的在建工程
+     */
+    private String progressConstruction;
+
+    /**
+     * 不符合市场准入制度的批次
+     */
+    private String inconformityAccessSystem;
+
+    /**
+     * 现场检查判定合格批次
+     */
+    private String siteInspectQualified;
+
+    /**
+     * 现场检查判定不合格批次
+     */
+    private String siteInspectUnqualified;
+
+    /**
+     * 抽封样检测合格批次
+     */
+    private String samplingInspectQualified;
+
+    /**
+     * 抽封样检测不合格批次
+     */
+    private String samplingInspectUnqualified;
+
+    /**
+     * 撤除更换产品批次
+     */
+    private String removalReplace;
+
+    /**
+     * 办理产品行政案件
+     */
+    private String productCases;
+
+    /**
+     * 组织火灾事故调查
+     */
+    private String fireAccidentCheck;
+
+    /**
+     * 受理火灾事故认定复核申请
+     */
+    private String acceptReviewApplication;
+
+    /**
+     * 出具火灾事故认定书
+     */
+    private String fireVerificate;
+
+    /**
+     * 出具火灾事故认定复核结论书
+     */
+    private String fireReviewConclusion;
+
+    /**
+     * 出具火灾事故简易调查认定书
+     */
+    private String fireSimpleVerificate;
+
+    /**
+     * 出具案件移送通知书
+     */
+    private String caseTransferNotice;
+
+    /**
+     * 出具封闭火灾现场公告
+     */
+    private String fireSiteAnnounce;
+
+    /**
+     * 起数
+     */
+    private String occurrencesNumber;
+
+    /**
+     * 警告
+     */
+    private String warnNumber;
+
+    /**
+     * 罚款个人
+     */
+    private String finePerson;
+
+    /**
+     * 罚款单位
+     */
+    private String fineCompany;
+
+    /**
+     * 罚款金额
+     */
+    private String fineAmount;
+
+    /**
+     * 责令“三停”
+     */
+    private String orderThreeStops;
+
+    /**
+     * 拘留
+     */
+    private String detention;
+
+    /**
+     * 发同意、不同意恢复施工、使用、生产、均经营决定书
+     */
+    private String operationDecision;
+
+    /**
+     * 没收财物
+     */
+    private String confiscateProperty;
+
+    /**
+     * 没收财物折合人民币
+     */
+    private String confiscatePropertyRmb;
+
+    /**
+     * 没收违法所得
+     */
+    private String illegalIncome;
+
+    /**
+     * 发处罚决定书(份)
+     */
+    private String punishmentDecision;
+
+    /**
+     * 当场收缴罚款
+     */
+    private String collecteFines;
+
+    /**
+     * 当场处罚起数
+     */
+    private String penaltyNumber;
+
+    /**
+     * 当场处罚警告
+     */
+    private String penaltyWarn;
+
+    /**
+     * 当场处罚罚款个人
+     */
+    private String penaltyIndividual;
+
+    /**
+     * 当场处罚罚款单位
+     */
+    private String penaltyCompany;
+
+    /**
+     * 当场处罚罚款金额
+     */
+    private String penaltyAmount;
+
+    /**
+     * InTime
+     */
+    private LocalDateTime inTime;
+
+    /**
+     * 删除标识
+     */
+    private String deleteFlag;
+
+    /**
+     * 记录状态
+     */
+    private String recordStatus;
+
+    /**
+     * 数据提交时间
+     */
+    private LocalDateTime dataSubmitTime;
+
+    /**
+     * 数据接收时间
+     */
+    private LocalDateTime dataReceiveTime;
+
+    /**
+     * 操作描述
+     */
+    private String operateDescribe;
+
+    /**
+     * Row_Version
+     */
+    private String rowVersion;
+
+    /**
+     * BDP_AUDIT
+     */
+    private LocalDateTime bdpAudit;
+
+    /**
+     * 机构简称
+     */
+    private String organizeAbbreviat;
+
+    /**
+     * unionKey
+     */
+    private String unionKey;
+
+    /**
+     * ChgTime
+     */
+    private LocalDateTime chgTime;
+
+
+}

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/BscLawTrendMapper.java

@@ -0,0 +1,16 @@
+package com.usky.fire.mapper;
+
+import com.usky.fire.domain.BscLawTrend;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 消防执法动态大屏统计 Mapper 接口
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-10-13
+ */
+public interface BscLawTrendMapper extends CrudMapper<BscLawTrend> {
+
+}

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemLawStatisticsMapper.java

@@ -0,0 +1,16 @@
+package com.usky.fire.mapper;
+
+import com.usky.fire.domain.DemLawStatistics;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 行政执法统计总表 Mapper 接口
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-10-13
+ */
+public interface DemLawStatisticsMapper extends CrudMapper<DemLawStatistics> {
+
+}

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

@@ -0,0 +1,64 @@
+package com.usky.fire.service;
+
+import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.domain.BscLawTrend;
+import com.usky.fire.domain.DemEnforceReportComplaint;
+import com.usky.fire.service.vo.ReportComplaintVO;
+import com.usky.fire.service.vo.SiAeAllVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 消防执法动态大屏统计 服务类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-10-13
+ */
+public interface BscLawTrendService extends CrudService<BscLawTrend> {
+
+    /**
+     * 消防执法动态-数据查询
+     *
+     * @param moduleType 模块类型
+     * @return
+     */
+    Object lawTrendList(String moduleType);
+
+    /**
+     * 消防执法动态-当月执法情况(定时)
+     *
+     * @return
+     */
+    List<SiAeAllVO> monthLaw();
+
+    /**
+     * 消防执法动态-消防隐患举报投诉/投诉处理情况(定时)
+     *
+     * @return
+     */
+    List<ReportComplaintVO> reportComplaint();
+
+    /**
+     * 根据火患场所名称查询总数
+     *
+     * @param hazardSiteName 火患场所名称
+     * @return
+     */
+    int enforceReportCount(String hazardSiteName);
+
+    /**
+     * 火患场所名称查询
+     *
+     * @return
+     */
+    List<String> enforceReportList();
+
+    /**
+     * 监督检查举报投诉信息查询
+     *
+     * @return
+     */
+    List<DemEnforceReportComplaint> enforceReportComplaint();
+}

+ 27 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemLawStatisticsService.java

@@ -0,0 +1,27 @@
+package com.usky.fire.service;
+
+import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.domain.DemLawStatistics;
+
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * <p>
+ * 行政执法统计总表 服务类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-10-13
+ */
+public interface DemLawStatisticsService extends CrudService<DemLawStatistics> {
+
+    /**
+     * 根据时间查询当月执法情况
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return
+     */
+    Map<String, Object> lawStatistics(Date startTime, Date endTime);
+}

+ 70 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/enums/BsSaOneCode.java

@@ -0,0 +1,70 @@
+package com.usky.fire.service.enums;
+
+/**
+ * @author yq
+ * @date 2021/6/2 10:44
+ * 基本总表-监督管理项目-第一项目类型
+ */
+public enum BsSaOneCode {
+
+
+    /**
+     * 刑事案件
+     */
+    CRIMINAL("刑事案件","X"),
+
+    /**
+     * 备案抽查
+     */
+    PUT_ONE_RECORDS("备案抽查类","B"),
+
+    /**
+     * 安全检查类
+     */
+    SAFETY_CHECK("安全检查类","Q"),
+
+
+    /**
+     * 案件办理
+     */
+    CASE_MANAGE("案件办理类","C"),
+
+    /**
+     * 火灾事故调查
+     */
+    FIRE_ACCIDENT_SURVEY("火灾事故调查类","H"),
+
+    /**
+     * 火灾从新认定
+     */
+    FIRE_NEW("火灾重新认定","R"),
+
+    /**
+     * 监督检查
+     */
+    SUPERVISE_EXAMINE("监督检查类","J"),
+
+    /**
+     * 行政许可类
+     */
+    A_P("行政许可类","A");
+
+    private String value;
+
+    private String letter;
+
+    BsSaOneCode(String value, String letter){
+        this.value = value;
+        this.letter = letter;
+    }
+
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getLetter(){
+        return letter;
+    }
+
+}

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BscEnterpriseAutonomyServiceImpl.java

@@ -631,7 +631,7 @@ public class BscEnterpriseAutonomyServiceImpl extends AbstractCrudService<BscEnt
         List<Integer> planSonIdList = new ArrayList<>();
         LambdaQueryWrapper<PatrolInspectionPlan> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.select(PatrolInspectionPlan::getId)
-                .eq(PatrolInspectionPlan::getTenantId, SecurityUtils.getTenantId())
+//                .eq(PatrolInspectionPlan::getTenantId, SecurityUtils.getTenantId())
                 .eq(PatrolInspectionPlan::getEnable, 1)
                 .between(PatrolInspectionPlan::getEndDate, startDate, endDate)
                 .between(PatrolInspectionPlan::getStartDate, startDate, endDate);

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BscEnterpriseStreetTownServiceImpl.java

@@ -606,7 +606,7 @@ public class BscEnterpriseStreetTownServiceImpl extends AbstractCrudService<BscE
             if (CollectionUtils.isNotEmpty(areaIdList)) {
                 LambdaQueryWrapper<PatrolInspectionPlan> queryWrapper = Wrappers.lambdaQuery();
                 queryWrapper.select(PatrolInspectionPlan::getId)
-                        .eq(PatrolInspectionPlan::getTenantId, SecurityUtils.getTenantId())
+//                        .eq(PatrolInspectionPlan::getTenantId, SecurityUtils.getTenantId())
                         .eq(PatrolInspectionPlan::getEnable, 1)
                         .in(PatrolInspectionPlan::getAreaId, areaIdList)
                         .between(PatrolInspectionPlan::getEndDate, startDate, endDate)

+ 248 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BscLawTrendServiceImpl.java

@@ -0,0 +1,248 @@
+package com.usky.fire.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.common.core.exception.BusinessException;
+import com.usky.common.core.util.Arith;
+import com.usky.common.core.util.DateUtils;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.fire.domain.BscLawTrend;
+import com.usky.fire.domain.DemEnforceReportAttach;
+import com.usky.fire.domain.DemEnforceReportComplaint;
+import com.usky.fire.mapper.BscLawTrendMapper;
+import com.usky.fire.service.BscLawTrendService;
+import com.usky.fire.service.DemEnforceReportAttachService;
+import com.usky.fire.service.DemEnforceReportComplaintService;
+import com.usky.fire.service.DemLawStatisticsService;
+import com.usky.fire.service.vo.ReportComplaintVO;
+import com.usky.fire.service.vo.SiAeAllVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * <p>
+ * 消防执法动态大屏统计 服务实现类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-10-13
+ */
+@Service
+public class BscLawTrendServiceImpl extends AbstractCrudService<BscLawTrendMapper, BscLawTrend> implements BscLawTrendService {
+
+    @Autowired
+    private DemLawStatisticsService demLawStatisticsService;
+
+    @Autowired
+    private DemEnforceReportComplaintService demEnforceReportComplaintService;
+
+    @Autowired
+    private DemEnforceReportAttachService demEnforceReportAttachService;
+
+    @Override
+    public Object lawTrendList(String moduleType) {
+        LambdaQueryWrapper<BscLawTrend> queryWrapper = Wrappers.lambdaQuery();
+        switch (moduleType) {
+            case "monthLaw":
+                queryWrapper.select(BscLawTrend::getMonthLaw);
+                break;
+            case "adstraLicense":
+                queryWrapper.select(BscLawTrend::getAdstraLicense);
+                break;
+            case "reportComplaint":
+                queryWrapper.select(BscLawTrend::getReportComplaint);
+                break;
+            case "complaintHandle":
+                queryWrapper.select(BscLawTrend::getComplaintHandle);
+                break;
+            default:
+                throw new BusinessException("参数错误");
+        }
+        queryWrapper.orderByDesc(BscLawTrend::getId)
+                .last(" limit 1");
+        List<BscLawTrend> list = this.list(queryWrapper);
+        String data = null;
+        JSONArray jsonArray = new JSONArray();
+        JSONObject jsonObject = new JSONObject();
+        switch (moduleType) {
+            case "monthLaw":
+                data = list.get(0).getMonthLaw();
+                jsonArray = JSONObject.parseArray(data);
+                break;
+            case "adstraLicense":
+                data = list.get(0).getAdstraLicense();
+                jsonObject = JSONObject.parseObject(data);
+                break;
+            case "reportComplaint":
+                data = list.get(0).getReportComplaint();
+                jsonArray = JSONObject.parseArray(data);
+                break;
+            case "complaintHandle":
+                data = list.get(0).getComplaintHandle();
+                jsonArray = JSONObject.parseArray(data);
+                break;
+            default:
+                throw new BusinessException("参数错误");
+        }
+        if (CollectionUtils.isNotEmpty(jsonArray)) {
+            return jsonArray;
+        } else if (CollectionUtils.isNotEmpty(jsonObject)) {
+            return jsonObject;
+        } else {
+            return jsonArray;
+        }
+    }
+
+
+    @Override
+    public List<SiAeAllVO> monthLaw() {
+        Date startTime = null;
+        Date endTime = null;
+        List<SiAeAllVO> allVoS = new ArrayList<>();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = new Date();
+        Calendar calendar = new GregorianCalendar();
+        calendar.setTime(date);
+        //获得本月第一天
+        calendar.add(Calendar.MONTH, 0);
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        String firstDay = sdf.format(calendar.getTime());
+        //获得本月最后一天
+        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
+        String lastDay = sdf.format(calendar.getTime());
+        try {
+            startTime = simpleDateFormat.parse(firstDay + " 00:00:00");
+            endTime = simpleDateFormat.parse(lastDay + " 23:59:59");
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        Optional.ofNullable(startTime).orElseThrow(() -> new BusinessException("开始时间不能为空"));
+        Optional.ofNullable(endTime).orElseThrow(() -> new BusinessException("结束时间不能为空"));
+        Map<String, Object> aeAllCollect = demLawStatisticsService.lawStatistics(startTime, endTime);
+        //获取同比
+        Date upStartTime = DateUtils.addYears(startTime, -1);
+        Date upEndTime = DateUtils.addYears(endTime, -1);
+        Map<String, Object> upAllCollect = demLawStatisticsService.lawStatistics(upStartTime, upEndTime);
+        //获取环比
+        //获取两个时间天数之差
+        int distanceOfTwoDate = DateUtils.getDistanceOfTwoDateNew(startTime, endTime);
+        Date linkEndTime = DateUtils.addDays(startTime, -1);
+        Date linkStartTime = DateUtils.addDays(linkEndTime, -distanceOfTwoDate);
+        Map<String, Object> linkAllCollect = demLawStatisticsService.lawStatistics(linkStartTime, linkEndTime);
+
+        Optional.ofNullable(aeAllCollect).ifPresent(aeAll -> {
+            for (String type : aeAll.keySet()) {
+                SiAeAllVO siAeAllVO = new SiAeAllVO();
+                siAeAllVO.setCheckType(type);
+                Double radio = Double.parseDouble(aeAll.get(type).toString());
+                siAeAllVO.setNumber(radio);
+                Double upRadio = 0.00;
+                Double linkRadio = 0.00;
+                if (0 != radio) {
+                    upRadio = Optional.ofNullable(upAllCollect).map(up -> Double.parseDouble(up.get(type).toString())).orElse(0.0);
+                    siAeAllVO.setSameRatio(Arith.div(upRadio, radio));
+                    linkRadio = Optional.ofNullable(linkAllCollect).map(link -> Double.parseDouble(link.get(type).toString())).orElse(0.0);
+                    siAeAllVO.setLinkRelativeRatio(Arith.div(linkRadio, radio));
+                } else {
+                    siAeAllVO.setSameRatio(0.00);
+                    siAeAllVO.setLinkRelativeRatio(0.00);
+                }
+                if (radio.equals(upRadio)) {
+                    siAeAllVO.setSameStatus(0);
+                } else if (radio > upRadio) {
+                    siAeAllVO.setSameStatus(1);
+                } else {
+                    siAeAllVO.setSameStatus(2);
+                }
+                if (radio.equals(linkRadio)) {
+                    siAeAllVO.setLinkRelativeStatus(0);
+                } else if (radio > linkRadio) {
+                    siAeAllVO.setLinkRelativeStatus(1);
+                } else {
+                    siAeAllVO.setLinkRelativeStatus(2);
+                }
+                allVoS.add(siAeAllVO);
+            }
+        });
+        return allVoS;
+    }
+
+    public void adstraLicense() {
+
+    }
+
+    @Override
+    public List<ReportComplaintVO> reportComplaint() {
+        List<ReportComplaintVO> list = new ArrayList<>();
+        List<String> strings = this.enforceReportList();
+        strings.stream().filter(StringUtils::isNotBlank)
+                .forEach(type -> {
+                    ReportComplaintVO reportComplaintVo = new ReportComplaintVO();
+                    reportComplaintVo.setType(type);
+                    reportComplaintVo.setNumber(this.enforceReportCount(type));
+                    list.add(reportComplaintVo);
+                });
+        return list;
+    }
+
+    @Override
+    public int enforceReportCount(String hazardSiteName) {
+        int count = 0;
+        List<DemEnforceReportComplaint> list1 = this.enforceReportComplaint();
+        if (CollectionUtils.isNotEmpty(list1)) {
+            List<String> reportIdList = new ArrayList<>();
+            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);
+        }
+        return count;
+    }
+
+    @Override
+    public List<String> enforceReportList() {
+        List<String> HazardSiteNameList = new ArrayList<>();
+        List<DemEnforceReportComplaint> list1 = this.enforceReportComplaint();
+        if (CollectionUtils.isNotEmpty(list1)) {
+            List<String> reportIdList = new ArrayList<>();
+            for (int i = 0; i < list1.size(); i++) {
+                reportIdList.add(list1.get(i).getReportId());
+            }
+            LambdaQueryWrapper<DemEnforceReportAttach> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.select(DemEnforceReportAttach::getHazardSiteName)
+                    .in(DemEnforceReportAttach::getReportId, reportIdList)
+                    .ne(DemEnforceReportAttach::getHazardSiteName, "")
+                    .groupBy(DemEnforceReportAttach::getHazardSiteName);
+            List<DemEnforceReportAttach> list = demEnforceReportAttachService.list(queryWrapper);
+            if (CollectionUtils.isNotEmpty(list)) {
+                for (int i = 0; i < list.size(); i++) {
+                    HazardSiteNameList.add(list.get(i).getHazardSiteName());
+                }
+            }
+        }
+        return HazardSiteNameList;
+    }
+
+    @Override
+    public List<DemEnforceReportComplaint> enforceReportComplaint() {
+        LambdaQueryWrapper<DemEnforceReportComplaint> queryWrapper1 = Wrappers.lambdaQuery();
+        queryWrapper1.select(DemEnforceReportComplaint::getReportId).eq(DemEnforceReportComplaint::getEnable, 0);
+        List<DemEnforceReportComplaint> list1 = demEnforceReportComplaintService.list(queryWrapper1);
+        return list1;
+    }
+
+}

+ 55 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemLawStatisticsServiceImpl.java

@@ -0,0 +1,55 @@
+package com.usky.fire.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.fire.domain.DemLawStatistics;
+import com.usky.fire.mapper.DemLawStatisticsMapper;
+import com.usky.fire.service.DemLawStatisticsService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * <p>
+ * 行政执法统计总表 服务实现类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-10-13
+ */
+@Service
+public class DemLawStatisticsServiceImpl extends AbstractCrudService<DemLawStatisticsMapper, DemLawStatistics> implements DemLawStatisticsService {
+
+    @Override
+    public Map<String, Object> lawStatistics(Date startTime, Date endTime) {
+        QueryWrapper<DemLawStatistics> query = Wrappers.query();
+        query.select("COALESCE(sum(inspect_company)) as `检查家次(家)`", "COALESCE(sum( fire_hazard)) as `发现隐患(起)`",
+                "COALESCE(sum(rectificate_fire_hazard)) as `整改隐患(起)`", "COALESCE(sum(penalty_amount)) as `处罚金额(万元)`",
+                "COALESCE(sum(correction_notice)) as `责令整改(份)`", "COALESCE(sum(punishment_decision)) as `处罚决定书(份)`",
+                "COALESCE(sum(order_three_stops)) as `责令三停(家)`", "COALESCE(sum(temporary_seizure)) as `临时查封(份)`")
+                .eq("delete_flag", 0)
+                .between("chg_time", startTime, endTime);
+        List<Map<String, Object>> list = this.listMaps(query);
+        Map<String, Object> map = new HashMap<>();
+        map.put("检查家次(家)",0);
+        map.put("发现隐患(起)",0);
+        map.put("整改隐患(起)",0);
+        map.put("处罚金额(万元)",0);
+        map.put("责令整改(份)",0);
+        map.put("处罚决定书(份)",0);
+        map.put("责令三停(家)",0);
+        map.put("临时查封(份)",0);
+        if (CollectionUtils.isNotEmpty(list)){
+            if (CollectionUtils.isNotEmpty(list.get(0))){
+                return list.get(0);
+            }else {
+                return map;
+            }
+        }else {
+            return map;
+        }
+    }
+
+}

+ 23 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/ReportComplaintVO.java

@@ -0,0 +1,23 @@
+package com.usky.fire.service.vo;
+
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/5/28 17:22
+ * 举报投诉情况
+ */
+@Data
+public class ReportComplaintVO {
+
+    /**
+     * 类型
+      */
+    private String type;
+
+
+    /**
+     * 数量
+     */
+    private Integer number;
+}

+ 42 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/SiAeAllVO.java

@@ -0,0 +1,42 @@
+package com.usky.fire.service.vo;
+
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/5/25 15:02
+ * 监督检查-行政执法总表
+ */
+@Data
+public class SiAeAllVO {
+
+    /**
+     * 检查类型
+     */
+    private String checkType;
+
+    /**
+     * 数量
+     */
+    private Double number;
+
+    /**
+     * 环比
+     */
+    private Double linkRelativeRatio ;
+
+    /**
+     * 同比
+     */
+    private Double sameRatio;
+
+    /**
+     * 环比上升還是下降
+     */
+    private Integer linkRelativeStatus;
+
+    /**
+     * 同比上升還是下降
+     */
+    private Integer sameStatus;
+}

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

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.fire.mapper.BscLawTrendMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.fire.domain.BscLawTrend">
+        <id column="id" property="id" />
+        <result column="month_law" property="monthLaw" />
+        <result column="adstra_license" property="adstraLicense" />
+        <result column="report_complaint" property="reportComplaint" />
+        <result column="complaint_handle" property="complaintHandle" />
+        <result column="create_time" property="createTime" />
+    </resultMap>
+
+</mapper>

+ 96 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/DemLawStatisticsMapper.xml

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.fire.mapper.DemLawStatisticsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.fire.domain.DemLawStatistics">
+        <id column="id" property="id" />
+        <result column="law_id" property="lawId" />
+        <result column="company_code" property="companyCode" />
+        <result column="include_branch" property="includeBranch" />
+        <result column="include_police_station" property="includePoliceStation" />
+        <result column="police_station_summary" property="policeStationSummary" />
+        <result column="amount_to" property="amountTo" />
+        <result column="mixed_deploy" property="mixedDeploy" />
+        <result column="data_time" property="dataTime" />
+        <result column="data_exchange_unit" property="dataExchangeUnit" />
+        <result column="inspect_person_number" property="inspectPersonNumber" />
+        <result column="inspect_company" property="inspectCompany" />
+        <result column="fire_hazard" property="fireHazard" />
+        <result column="temporary_seizure" property="temporarySeizure" />
+        <result column="correction_notice" property="correctionNotice" />
+        <result column="relieve_temporary_seizure" property="relieveTemporarySeizure" />
+        <result column="inspect_certificate" property="inspectCertificate" />
+        <result column="inspect_opinions" property="inspectOpinions" />
+        <result column="revoke_approval" property="revokeApproval" />
+        <result column="rectificate_fire_hazard" property="rectificateFireHazard" />
+        <result column="spot_check" property="spotCheck" />
+        <result column="job_inspect" property="jobInspect" />
+        <result column="enforce_inspect" property="enforceInspect" />
+        <result column="other_inspect" property="otherInspect" />
+        <result column="review" property="review" />
+        <result column="hold_inspect" property="holdInspect" />
+        <result column="spot_check1" property="spotCheck1" />
+        <result column="job_before_inspect" property="jobBeforeInspect" />
+        <result column="hold_before_inspect" property="holdBeforeInspect" />
+        <result column="enforce_inspect1" property="enforceInspect1" />
+        <result column="other_inspect2" property="otherInspect2" />
+        <result column="review1" property="review1" />
+        <result column="fire_train_class" property="fireTrainClass" />
+        <result column="train_education" property="trainEducation" />
+        <result column="accept_review_items" property="acceptReviewItems" />
+        <result column="review_opinions" property="reviewOpinions" />
+        <result column="accept_items" property="acceptItems" />
+        <result column="accept_opinions" property="acceptOpinions" />
+        <result column="design_filing" property="designFiling" />
+        <result column="design_illegal_notice" property="designIllegalNotice" />
+        <result column="complete_protection_record" property="completeProtectionRecord" />
+        <result column="design_review_opinions" property="designReviewOpinions" />
+        <result column="review_build_area" property="reviewBuildArea" />
+        <result column="progress_construction" property="progressConstruction" />
+        <result column="inconformity_access_system" property="inconformityAccessSystem" />
+        <result column="site_inspect_qualified" property="siteInspectQualified" />
+        <result column="site_inspect_unqualified" property="siteInspectUnqualified" />
+        <result column="sampling_inspect_qualified" property="samplingInspectQualified" />
+        <result column="sampling_inspect_unqualified" property="samplingInspectUnqualified" />
+        <result column="removal_replace" property="removalReplace" />
+        <result column="product_cases" property="productCases" />
+        <result column="fire_accident_check" property="fireAccidentCheck" />
+        <result column="accept_review_application" property="acceptReviewApplication" />
+        <result column="fire_verificate" property="fireVerificate" />
+        <result column="fire_review_conclusion" property="fireReviewConclusion" />
+        <result column="fire_simple_verificate" property="fireSimpleVerificate" />
+        <result column="case_transfer_notice" property="caseTransferNotice" />
+        <result column="fire_site_announce" property="fireSiteAnnounce" />
+        <result column="occurrences_number" property="occurrencesNumber" />
+        <result column="warn_number" property="warnNumber" />
+        <result column="fine_person" property="finePerson" />
+        <result column="fine_company" property="fineCompany" />
+        <result column="fine_amount" property="fineAmount" />
+        <result column="order_three_stops" property="orderThreeStops" />
+        <result column="detention" property="detention" />
+        <result column="operation_decision" property="operationDecision" />
+        <result column="confiscate_property" property="confiscateProperty" />
+        <result column="confiscate_property_rmb" property="confiscatePropertyRmb" />
+        <result column="illegal_income" property="illegalIncome" />
+        <result column="punishment_decision" property="punishmentDecision" />
+        <result column="collecte_fines" property="collecteFines" />
+        <result column="penalty_number" property="penaltyNumber" />
+        <result column="penalty_warn" property="penaltyWarn" />
+        <result column="penalty_individual" property="penaltyIndividual" />
+        <result column="penalty_company" property="penaltyCompany" />
+        <result column="penalty_amount" property="penaltyAmount" />
+        <result column="in_time" property="inTime" />
+        <result column="delete_flag" property="deleteFlag" />
+        <result column="record_status" property="recordStatus" />
+        <result column="data_submit_time" property="dataSubmitTime" />
+        <result column="data_receive_time" property="dataReceiveTime" />
+        <result column="operate_describe" property="operateDescribe" />
+        <result column="row_version" property="rowVersion" />
+        <result column="bdp_audit" property="bdpAudit" />
+        <result column="organize_abbreviat" property="organizeAbbreviat" />
+        <result column="union_key" property="unionKey" />
+        <result column="chg_time" property="chgTime" />
+    </resultMap>
+
+</mapper>