Kaynağa Gözat

内蒙山洪运维系统-应急系统功能模块开发,宏图数据共享接口开发

dylan 2 yıl önce
ebeveyn
işleme
0810791182
22 değiştirilmiş dosya ile 1297 ekleme ve 164 silme
  1. 12 0
      src/main/java/org/springblade/modules/baseinfo/org/dto/OrgInfoDTO.java
  2. 70 0
      src/main/java/org/springblade/modules/baseinfo/org/entity/DeptInfoEntity.java
  3. 22 0
      src/main/java/org/springblade/modules/baseinfo/org/mapper/DeptInfoMapper.java
  4. 16 0
      src/main/java/org/springblade/modules/baseinfo/org/mapper/DeptInfoMapper.xml
  5. 22 0
      src/main/java/org/springblade/modules/baseinfo/org/service/IDeptInfoService.java
  6. 26 0
      src/main/java/org/springblade/modules/baseinfo/org/service/impl/DeptInfoServiceImpl.java
  7. 30 0
      src/main/java/org/springblade/modules/baseinfo/org/vo/DeptInfoVO.java
  8. 35 37
      src/main/java/org/springblade/modules/baseinfo/org/wrapper/OrgInfoWrapper.java
  9. 18 5
      src/main/java/org/springblade/modules/baseinfo/servicePerson/qi/controller/QiServicePersonController.java
  10. 4 1
      src/main/java/org/springblade/modules/business/equipment/inspection/base/mapper/EquipmentInspectionMapper.xml
  11. 28 0
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/dto/EquipmentInspectionPlanDTO.java
  12. 3 1
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/mapper/EquipmentInspectionPlanMapper.java
  13. 15 1
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/mapper/EquipmentInspectionPlanMapper.xml
  14. 2 1
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/service/IEquipmentInspectionPlanService.java
  15. 7 6
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/service/impl/EquipmentInspectionPlanServiceImpl.java
  16. 39 49
      src/main/java/org/springblade/modules/business/warning/service/impl/RtuWarningServiceImpl.java
  17. 9 0
      src/main/java/org/springblade/modules/yjxt/base/map/controller/MapDangerAreaController.java
  18. 3 7
      src/main/java/org/springblade/modules/yjxt/base/servicePerson/controller/YjxtServicePersonController.java
  19. 2 11
      src/main/java/org/springblade/modules/yjxt/business/check/controller/DangerAreaCheckController.java
  20. 33 34
      src/main/java/org/springblade/modules/yjxt/business/rain/controller/YjRainDataController.java
  21. 900 11
      src/main/java/org/springblade/share/DataShareController.java
  22. 1 0
      src/main/resources/application.yml

+ 12 - 0
src/main/java/org/springblade/modules/baseinfo/org/dto/OrgInfoDTO.java

@@ -27,4 +27,16 @@ public class OrgInfoDTO extends Dept {
 	 */
 	@ApiModelProperty(value = "区划")
 	private String adcd;
+
+	/**
+	 * 区划
+	 */
+	@ApiModelProperty(value = "区划")
+	private String adCode;
+
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty(value = "机构ID")
+	private Long deptId;
 }

+ 70 - 0
src/main/java/org/springblade/modules/baseinfo/org/entity/DeptInfoEntity.java

@@ -0,0 +1,70 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:运维系统
+ * 创建日期:2022/3/9
+ */
+package org.springblade.modules.baseinfo.org.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("blade_dept")
+public class DeptInfoEntity extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 租户ID
+     */
+    @ApiModelProperty("租户ID")
+    private String tenantId;
+
+    /**
+     * 父机构ID
+     */
+    @ApiModelProperty(value = "父机构ID")
+    private Long parentId;
+
+    /**
+     * 祖级列表
+     */
+    @ApiModelProperty(value = "祖级列表")
+    private String ancestors;
+
+    /**
+     * 部门类型
+     */
+    @ApiModelProperty(value = "部门类型")
+    private Integer deptCategory;
+
+    /**
+     * 部门名称
+     */
+    @ApiModelProperty(value = "部门名称")
+    private String deptName;
+
+    /**
+     * 部门全称
+     */
+    @ApiModelProperty(value = "部门全称")
+    private String fullName;
+
+    /**
+     * 排序
+     */
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String remark;
+}

+ 22 - 0
src/main/java/org/springblade/modules/baseinfo/org/mapper/DeptInfoMapper.java

@@ -0,0 +1,22 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/2/23
+ */
+package org.springblade.modules.baseinfo.org.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.modules.baseinfo.org.entity.DeptInfoEntity;
+
+/***
+ * Date:2023/2/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface DeptInfoMapper extends BaseMapper<DeptInfoEntity> {
+
+}

+ 16 - 0
src/main/java/org/springblade/modules/baseinfo/org/mapper/DeptInfoMapper.xml

@@ -0,0 +1,16 @@
+<?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="org.springblade.modules.baseinfo.org.mapper.DeptInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="deptInfoResultMap" type="org.springblade.modules.baseinfo.org.entity.DeptInfoEntity">
+        <result column="parent_id" property="parentId"/>
+        <result column="ancestors" property="ancestors"/>
+        <result column="dept_category" property="deptCategory"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="full_name" property="fullName"/>
+        <result column="sort" property="sort"/>
+        <result column="remark" property="remark"/>
+    </resultMap>
+
+</mapper>

+ 22 - 0
src/main/java/org/springblade/modules/baseinfo/org/service/IDeptInfoService.java

@@ -0,0 +1,22 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/2/23
+ */
+package org.springblade.modules.baseinfo.org.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.baseinfo.org.entity.DeptInfoEntity;
+
+/***
+ * Date:2023/2/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IDeptInfoService extends BaseService<DeptInfoEntity> {
+
+}

+ 26 - 0
src/main/java/org/springblade/modules/baseinfo/org/service/impl/DeptInfoServiceImpl.java

@@ -0,0 +1,26 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/2/23
+ */
+package org.springblade.modules.baseinfo.org.service.impl;
+
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.baseinfo.org.entity.DeptInfoEntity;
+import org.springblade.modules.baseinfo.org.mapper.DeptInfoMapper;
+import org.springblade.modules.baseinfo.org.service.IDeptInfoService;
+import org.springframework.stereotype.Service;
+
+/***
+ * Date:2023/2/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class DeptInfoServiceImpl extends BaseServiceImpl<DeptInfoMapper, DeptInfoEntity> implements IDeptInfoService {
+
+}

+ 30 - 0
src/main/java/org/springblade/modules/baseinfo/org/vo/DeptInfoVO.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2024/5/24
+ */
+package org.springblade.modules.baseinfo.org.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.baseinfo.org.entity.DeptInfoEntity;
+
+/***
+ * Date:2024/5/24
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DeptInfoVO extends DeptInfoEntity {
+    /**
+     * 上级部门名称
+     */
+    @ApiModelProperty(value = "上级部门名称")
+    private String manageDeptName;
+}

+ 35 - 37
src/main/java/org/springblade/modules/baseinfo/org/wrapper/OrgInfoWrapper.java

@@ -31,48 +31,46 @@ import java.util.Objects;
  */
 public class OrgInfoWrapper extends BaseEntityWrapper<Dept, OrgInfoVO> {
 
-	public static OrgInfoWrapper build() {
-		return new OrgInfoWrapper();
-	}
+    public static OrgInfoWrapper build() {
+        return new OrgInfoWrapper();
+    }
 
-	private static IRegionInfoService baseInfoRegionService;
+    private static IRegionInfoService baseInfoRegionService;
 
-	private static IRegionInfoService getBaseInfoRegionService() {
-		if (baseInfoRegionService == null) {
-			baseInfoRegionService = SpringUtil.getBean(IRegionInfoService.class);
-		}
-		return baseInfoRegionService;
-	}
+    private static IRegionInfoService getBaseInfoRegionService() {
+        if (baseInfoRegionService == null) {
+            baseInfoRegionService = SpringUtil.getBean(IRegionInfoService.class);
+        }
+        return baseInfoRegionService;
+    }
 
-	private static IDeptRegionService deptRegionService;
+    private static IDeptRegionService deptRegionService;
 
-	private static IDeptRegionService getDeptRegionService() {
-		if (deptRegionService == null) {
-			deptRegionService = SpringUtil.getBean(IDeptRegionService.class);
-		}
-		return deptRegionService;
-	}
+    private static IDeptRegionService getDeptRegionService() {
+        if (deptRegionService == null) {
+            deptRegionService = SpringUtil.getBean(IDeptRegionService.class);
+        }
+        return deptRegionService;
+    }
 
 
-	@Override
-	public OrgInfoVO entityVO(Dept entity) {
-		OrgInfoVO orgInfoVO = Objects.requireNonNull(BeanUtil.copy(entity, OrgInfoVO.class));
-		orgInfoVO.setDictValue(entity.getDeptName());
-		LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
-		deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
-		deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, entity.getId());
-		DeptRegionEntity deptRegionEntity = getDeptRegionService().getOne(deptRegionEntityLambdaQueryWrapper);
-		if (deptRegionEntity != null) {
-			LambdaQueryWrapper<RegionInfoEntity> regionInfoEntityLambdaQueryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
-			regionInfoEntityLambdaQueryWrapper.eq(RegionInfoEntity::getIsDeleted, 0);
-			regionInfoEntityLambdaQueryWrapper.eq(RegionInfoEntity::getAdcd, deptRegionEntity.getAdcd());
-			RegionInfoEntity regionInfoEntity = getBaseInfoRegionService().getOne(regionInfoEntityLambdaQueryWrapper);
-			if (null != regionInfoEntity) {
-				orgInfoVO.setAdcd(regionInfoEntity.getAdcd());
-				orgInfoVO.setAdnm(regionInfoEntity.getAdnm());
-			}
-		}
-		return orgInfoVO;
-	}
+    @Override
+    public OrgInfoVO entityVO(Dept entity) {
+        OrgInfoVO orgInfoVO = Objects.requireNonNull(BeanUtil.copy(entity, OrgInfoVO.class));
+        orgInfoVO.setDictValue(entity.getDeptName());
+        LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+        deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, entity.getId());
+        DeptRegionEntity deptRegionEntity = getDeptRegionService().getOne(deptRegionEntityLambdaQueryWrapper);
+        if (deptRegionEntity != null) {
+            LambdaQueryWrapper<RegionInfoEntity> regionInfoEntityLambdaQueryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+            regionInfoEntityLambdaQueryWrapper.eq(RegionInfoEntity::getAdcd, deptRegionEntity.getAdcd());
+            RegionInfoEntity regionInfoEntity = getBaseInfoRegionService().getOne(regionInfoEntityLambdaQueryWrapper);
+            if (null != regionInfoEntity) {
+                orgInfoVO.setAdcd(regionInfoEntity.getAdcd());
+                orgInfoVO.setAdnm(regionInfoEntity.getAdnm());
+            }
+        }
+        return orgInfoVO;
+    }
 
 }

+ 18 - 5
src/main/java/org/springblade/modules/baseinfo/servicePerson/qi/controller/QiServicePersonController.java

@@ -182,11 +182,24 @@ public class QiServicePersonController extends BladeController {
         if (Func.isNull(qiAdmindRegion)) {
             deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
             deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getAdcd, dto.getCityAdcd());
-            DeptRegionEntity orgAdmindRegion = this.deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
-            if (Func.isNull(orgAdmindRegion)) {
+            List<DeptRegionEntity> regionEntities = this.deptRegionService.list(deptRegionEntityLambdaQueryWrapper);
+            if (Func.isNull(regionEntities)) {
                 return R.fail("盟市机构不存在");
             }
-            Dept orgDept = this.deptService.getById(orgAdmindRegion.getDeptId());
+            String orgDeptId=null;
+            for (DeptRegionEntity entity:regionEntities){
+                Dept orgDept = this.deptService.getById(entity.getDeptId());
+                if (Func.notNull(orgDept)){
+                    if (orgDept.getDeptCategory()==2){
+                        orgDeptId = Func.toStr(orgDept.getId());
+                        break;
+                    }
+                }
+            }
+            if (Func.isNull(orgDeptId)){
+                return R.fail("盟市机构不存在");
+            }
+            Dept orgDeptDetail = this.deptService.getById(Func.toLong(orgDeptId));
 
             LambdaQueryWrapper<BaseRegionInfoEntity> queryWrapper = Wrappers.<BaseRegionInfoEntity>query().lambda();
             queryWrapper.eq(BaseRegionInfoEntity::getAdcd, dto.getDistrictAdcd());
@@ -195,8 +208,8 @@ public class QiServicePersonController extends BladeController {
             OrgInfoDTO dept = new OrgInfoDTO();
             dept.setFullName(regionInfoEntity.getAdnm());
             dept.setDeptName(regionInfoEntity.getAdnm());
-            dept.setParentId(orgDept.getId());
-            dept.setAncestors(orgDept.getAncestors() + "," + orgDept.getId());
+            dept.setParentId(orgDeptDetail.getId());
+            dept.setAncestors(orgDeptDetail.getAncestors() + "," + orgDeptDetail.getId());
             dept.setDeptCategory(3);
             this.deptService.save(dept);
             dto.setDeptId(Func.toStr(dept.getId()));

+ 4 - 1
src/main/java/org/springblade/modules/business/equipment/inspection/base/mapper/EquipmentInspectionMapper.xml

@@ -85,6 +85,9 @@
         <if test="inspectionInfoDTO.rtuName!=null">
             and r.rtu_name like concat(concat('%', #{inspectionInfoDTO.rtuName}), '%')
         </if>
+        <if test="inspectionInfoDTO.inspectionYear!=null">
+            and DATE_FORMAT(n.inspection_date,'%Y') = #{inspectionInfoDTO.inspectionYear}
+        </if>
         <if test="inspectionInfoDTO.inspectionYearStartDate!=null">
             and DATE_FORMAT(n.inspection_date,'%Y-%m-%d') &gt;=
             DATE_FORMAT(#{inspectionInfoDTO.inspectionYearStartDate},'%Y-%m-%d')
@@ -246,7 +249,7 @@
         SELECT r1.rtu_code,r1.rtu_name,r1.ad_city,r1.ad_dist,r1.is_rain,r1.is_river,r1.is_res,r1.is_ground,r1.is_video,r1.location_desc,r1.lng,r1.lat,i1.before_rain_season_status,i1.rain_season_first_status ,i1.rain_season_second_status FROM rtu_info r1
         INNER JOIN ( SELECT r.rtu_code
         FROM rtu_info r
-        LEFT JOIN equipment_inspection i on i.rtu_code = r.rtu_code   and i.is_deleted =0
+        LEFT JOIN equipment_inspection i on i.rtu_code = r.rtu_code and i.is_deleted =0
         <if test="inspectionInfoDTO.inspectionYearStartDate!=null">
             and i.create_time &gt;= #{inspectionInfoDTO.inspectionYearStartDate}
         </if>

+ 28 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/plan/dto/EquipmentInspectionPlanDTO.java

@@ -0,0 +1,28 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2024/5/14
+ */
+package org.springblade.modules.business.equipment.inspection.plan.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
+import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
+
+/***
+ * Date:2024/5/14
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class EquipmentInspectionPlanDTO extends EquipmentInspectionPlanEntity {
+    @ApiModelProperty("巡检年度")
+    private String inspectionYear;
+}

+ 3 - 1
src/main/java/org/springblade/modules/business/equipment/inspection/plan/mapper/EquipmentInspectionPlanMapper.java

@@ -7,6 +7,8 @@
 package org.springblade.modules.business.equipment.inspection.plan.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.business.equipment.inspection.plan.dto.EquipmentInspectionPlanDTO;
 import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
 
 
@@ -21,5 +23,5 @@ import java.util.List;
  * Remark:认为有必要的其他信息
  */
 public interface EquipmentInspectionPlanMapper extends BaseMapper<EquipmentInspectionPlanEntity> {
-
+    EquipmentInspectionPlanEntity yearPlan(@Param("dto") EquipmentInspectionPlanDTO dto);
 }

+ 15 - 1
src/main/java/org/springblade/modules/business/equipment/inspection/plan/mapper/EquipmentInspectionPlanMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="org.springblade.modules.business.equipment.inspection.plan.mapper.EquipmentInspectionPlanMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="orderProcessInfoResultMap"
+    <resultMap id="equipmentInspectionPlanEntityResultMap"
                type="org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity">
         <result column="inspection_id" property="inspectionId"/>
         <result column="org_id" property="orgId"/>
@@ -17,4 +17,18 @@
         <result column="remark" property="remark"/>
     </resultMap>
 
+    <select id="yearPlan" resultMap="equipmentInspectionPlanEntityResultMap">
+        SELECT
+        n.*
+        FROM
+        equipment_inspection_plan n
+        WHERE
+        n.is_deleted = 0
+        <if test="dto.inspectionYear!=null ">
+            and DATE_FORMAT(n.before_rain_season_start_time,'%Y') = #{dto.inspectionYear}
+        </if>
+        order by n.create_time desc
+        limit 1
+    </select>
+
 </mapper>

+ 2 - 1
src/main/java/org/springblade/modules/business/equipment/inspection/plan/service/IEquipmentInspectionPlanService.java

@@ -8,6 +8,7 @@ package org.springblade.modules.business.equipment.inspection.plan.service;
 
 
 import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.business.equipment.inspection.plan.dto.EquipmentInspectionPlanDTO;
 import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
 
 
@@ -20,6 +21,6 @@ import org.springblade.modules.business.equipment.inspection.plan.entity.Equipme
  * Remark:认为有必要的其他信息
  */
 public interface IEquipmentInspectionPlanService extends BaseService<EquipmentInspectionPlanEntity> {
-	EquipmentInspectionPlanEntity yearPlan();
+	EquipmentInspectionPlanEntity yearPlan(EquipmentInspectionPlanDTO dto);
 	EquipmentInspectionPlanEntity getPlanInfo();
 }

+ 7 - 6
src/main/java/org/springblade/modules/business/equipment/inspection/plan/service/impl/EquipmentInspectionPlanServiceImpl.java

@@ -13,6 +13,7 @@ import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.business.equipment.inspection.plan.dto.EquipmentInspectionPlanDTO;
 import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
 import org.springblade.modules.business.equipment.inspection.plan.mapper.EquipmentInspectionPlanMapper;
 import org.springblade.modules.business.equipment.inspection.plan.service.IEquipmentInspectionPlanService;
@@ -35,12 +36,12 @@ public class EquipmentInspectionPlanServiceImpl extends BaseServiceImpl<Equipmen
 
 
 	@Override
-	public EquipmentInspectionPlanEntity yearPlan() {
-		LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
-		wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted,0);
-		wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
-		wrapper.last("limit 1");
-		return baseMapper.selectOne(wrapper);
+	public EquipmentInspectionPlanEntity yearPlan(EquipmentInspectionPlanDTO dto) {
+//		LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
+//		wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted,0);
+//		wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
+//		wrapper.last("limit 1");
+		return baseMapper.yearPlan(dto);
 	}
 
 	@Override

+ 39 - 49
src/main/java/org/springblade/modules/business/warning/service/impl/RtuWarningServiceImpl.java

@@ -1085,9 +1085,9 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
      */
     @Override
     public boolean checkRtuOfflineStatus(RtuInfoEntity rtuInfoEntity, RtuWarnSettingEntity warnSettingEntity, LocalDateTime checkTime) {
-//        if (rtuInfoEntity.getRtuCode().equals("40517371")) {
-//            log.info("40517371");
-//        }
+//		if (rtuInfoEntity.getRtuCode().equals("01718525")) {
+//			log.info("01718525");
+//		}
         boolean isOffline = false;
         int checkCount = 0;
         int warnCount = 0;
@@ -1097,16 +1097,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
         HashOperations<String, String, String> hashops = redisTemplate.opsForHash();
         String key = RedisBusinessConstant.KEY_RTU_RUN_INFO + rtuInfoEntity.getRtuCode();
         String lastDatetimeText = hashops.get(key, RedisBusinessConstant.KEY_RTU_RUN_INFO_LAST_TIME);
-        if (Func.isNull(lastDatetimeText)) {
-            LambdaQueryWrapper<RtuStatusEntity> querywrapper = Wrappers.<RtuStatusEntity>query().lambda();
-            querywrapper.eq(RtuStatusEntity::getRtuCode, rtuInfoEntity.getRtuCode());
-            RtuStatusEntity entity = rtuManageService.getOne(querywrapper);
-            if (Func.notNull(entity)) {
-                if (Func.notNull(entity.getLastUpTime())) {
-                    lastDatetimeText = Func.formatDateTime(entity.getLastUpTime());
-                }
-            }
-        }
         if (null != lastDatetimeText && lastDatetimeText.length() > 0) {
             hasUp = true;
             LocalDateTime lastDateTime = LocalDateTime.parse(lastDatetimeText, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
@@ -1254,43 +1244,43 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
                 isOffline = true;
             } else {
                 if (hasUp) {
-                    //  boolean isCloseWarn = false;
-//					if (null != warnStatus) {
-//						if (WarningStatusEnum.STATUS_HAPPEN.getCode() == Func.toInt(warnStatus)) {
-//							isCloseWarn = true;
-//						}
-//					} else {
-//                    LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
-//                    warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, rtuInfoEntity.getRtuCode());
-//                    warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
-//                    warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_OFFLINE.getCode());
-//                    RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
-//                    if (null != warningInfoEntity) {
-//                        isCloseWarn = true;
-//                    }
-                    //}
-                    // if (isCloseWarn) {
-                    //恢复
-                    LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
-                    warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, rtuInfoEntity.getRtuCode());
-                    warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
-                    warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_OFFLINE.getCode());
-                    RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
-                    if (null != warningInfoEntity) {
-                        String warningRecoveryDesc = "";
-                        LocalDateTime lastDateTime = LocalDateTime.parse(lastDatetimeText, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
-                        warningRecoveryDesc = "测站离线异常恢复,检测时间:" + Func.formatDateTime(Date.from(checkTime.atZone(ZoneId.systemDefault()).toInstant())) + ",测站恢复上线时间:" + Func.formatDateTime(Date.from(lastDateTime.atZone(ZoneId.systemDefault()).toInstant())) + ",离线设定参数:" + offlineDurationSettingText + ",测站离线时长:" + offlineDurationText;
-                        warningInfoEntity.setWarningRecoveryDesc(warningRecoveryDesc);
-                        warningInfoEntity.setWarningRecoveryTime(Date.from(checkTime.atZone(ZoneId.systemDefault()).toInstant()));
-                        warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
-                        this.updateById(warningInfoEntity);
-                        //更新预警状态
-                        hashops.put(key, warnKindKey, Func.toStr(WarningStatusEnum.STATUS_CLOSE.getCode()));
-                        //预警通知
-                        kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
-                        log.info("测站离线异常恢复 {} {} {}", rtuInfoEntity.getRtuCode(), rtuInfoEntity.getRtuName(), warningRecoveryDesc);
+                    boolean isCloseWarn = false;
+                    if (null != warnStatus) {
+                        if (WarningStatusEnum.STATUS_HAPPEN.getCode() == Func.toInt(warnStatus)) {
+                            isCloseWarn = true;
+                        }
+                    } else {
+                        LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
+                        warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, rtuInfoEntity.getRtuCode());
+                        warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
+                        warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_OFFLINE.getCode());
+                        RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
+                        if (null != warningInfoEntity) {
+                            isCloseWarn = true;
+                        }
+                    }
+                    if (isCloseWarn) {
+                        //恢复
+                        LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
+                        warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, rtuInfoEntity.getRtuCode());
+                        warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
+                        warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_OFFLINE.getCode());
+                        RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
+                        if (null != warningInfoEntity) {
+                            String warningRecoveryDesc = "";
+                            LocalDateTime lastDateTime = LocalDateTime.parse(lastDatetimeText, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+                            warningRecoveryDesc = "测站离线异常恢复,检测时间:" + Func.formatDateTime(Date.from(checkTime.atZone(ZoneId.systemDefault()).toInstant())) + ",测站恢复上线时间:" + Func.formatDateTime(Date.from(lastDateTime.atZone(ZoneId.systemDefault()).toInstant())) + ",离线设定参数:" + offlineDurationSettingText + ",测站离线时长:" + offlineDurationText;
+                            warningInfoEntity.setWarningRecoveryDesc(warningRecoveryDesc);
+                            warningInfoEntity.setWarningRecoveryTime(Date.from(checkTime.atZone(ZoneId.systemDefault()).toInstant()));
+                            warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
+                            this.updateById(warningInfoEntity);
+                            //更新预警状态
+                            hashops.put(key, warnKindKey, Func.toStr(WarningStatusEnum.STATUS_CLOSE.getCode()));
+                            //预警通知
+                            kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
+                            log.info("测站离线异常恢复 {} {} {}", rtuInfoEntity.getRtuCode(), rtuInfoEntity.getRtuName(), warningRecoveryDesc);
+                        }
                     }
-                    // }
                 }
                 if (null == warnStatus) {
                     //更新预警状态

+ 9 - 0
src/main/java/org/springblade/modules/yjxt/base/map/controller/MapDangerAreaController.java

@@ -105,6 +105,15 @@ public class MapDangerAreaController extends BladeController {
                     return R.fail("查询失败");
                 }
                 dto.setAdcd(deptRegionEntity.getAdcd());
+            } else if (BusinessConstant.ROLE_QI_ADMIN.equals(user.getRoleName())) {
+                LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
+                wrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+                wrapper.last("limit 1");
+                DeptRegionEntity deptRegionEntity = deptRegionService.getOne(wrapper);
+                if (Func.isNull(deptRegionEntity)) {
+                    return R.fail("查询失败");
+                }
+                dto.setAdcd(deptRegionEntity.getAdcd());
             } else if (BusinessConstant.ROLE_YJ_SERVICE_PERSON.equals(user.getRoleName())) {
                 LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
                 wrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));

+ 3 - 7
src/main/java/org/springblade/modules/yjxt/base/servicePerson/controller/YjxtServicePersonController.java

@@ -71,7 +71,7 @@ public class YjxtServicePersonController extends BladeController {
     @ApiOperation(value = "分页")
     public R<IPage<YjxtServicePersonVO>> page(@ApiIgnore YjxtServicePersonDTO dto, Query query) {
         BladeUser user = AuthUtil.getUser();
-       if (Func.isNull(dto.getAdCode())) {
+        if (Func.isNull(dto.getAdCode())) {
             if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
                 dto.setAdCode(BusinessConstant.REGION_NM_ADCODE);
             } else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName())) {
@@ -83,7 +83,7 @@ public class YjxtServicePersonController extends BladeController {
                     return R.fail("查询失败");
                 }
                 dto.setAdCode(deptRegionEntity.getAdcd());
-            } else if (BusinessConstant.ROLE_YJ_SERVICE_PERSON.equals(user.getRoleName())) {
+            } else if (BusinessConstant.ROLE_QI_ADMIN.equals(user.getRoleName())) {
                 LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
                 wrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
                 wrapper.last("limit 1");
@@ -92,7 +92,7 @@ public class YjxtServicePersonController extends BladeController {
                     return R.fail("查询失败");
                 }
                 dto.setAdCode(deptRegionEntity.getAdcd());
-            } else if (BusinessConstant.ROLE_QI_ADMIN.equals(user.getRoleName())) {
+            } else if (BusinessConstant.ROLE_YJ_SERVICE_PERSON.equals(user.getRoleName())) {
                 LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
                 wrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
                 wrapper.last("limit 1");
@@ -105,10 +105,6 @@ public class YjxtServicePersonController extends BladeController {
                 return R.fail("查询失败");
             }
         }
-
-//        if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName())) {
-//            dto.setDeptId(user.getDeptId());
-//        }
         IPage<YjxtServicePersonVO> pages = yjxtServicePersonServcie.selectPage(Condition.getPage(query), dto);
         return R.data(pages);
     }

+ 2 - 11
src/main/java/org/springblade/modules/yjxt/business/check/controller/DangerAreaCheckController.java

@@ -76,7 +76,7 @@ public class DangerAreaCheckController extends BladeController {
                     return R.fail("查询失败");
                 }
                 dto.setAdcd(deptRegionEntity.getAdcd());
-            } else if (BusinessConstant.ROLE_YJ_SERVICE_PERSON.equals(user.getRoleName())) {
+            }else if (BusinessConstant.ROLE_QI_ADMIN.equals(user.getRoleName())) {
                 LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
                 wrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
                 wrapper.last("limit 1");
@@ -85,7 +85,7 @@ public class DangerAreaCheckController extends BladeController {
                     return R.fail("查询失败");
                 }
                 dto.setAdcd(deptRegionEntity.getAdcd());
-            } else if (BusinessConstant.ROLE_QI_ADMIN.equals(user.getRoleName())) {
+            }  else if (BusinessConstant.ROLE_YJ_SERVICE_PERSON.equals(user.getRoleName())) {
                 LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
                 wrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
                 wrapper.last("limit 1");
@@ -125,15 +125,6 @@ public class DangerAreaCheckController extends BladeController {
                 return R.fail("参数错误");
             }
         }
-//        if (Func.notNull(entity.getWarnId())) {
-//            LambdaQueryWrapper<OriginalWarningInfoEntity> wrapper = Wrappers.<OriginalWarningInfoEntity>query().lambda();
-//            wrapper.eq(OriginalWarningInfoEntity::getWarnId, entity.getWarnId());
-//            wrapper.last("limit 1");
-//            OriginalWarningInfoEntity warningInfoEntity = originalWarningService.getOne(wrapper);
-//            if (Func.notNull(warningInfoEntity)) {
-//                entity.setAdcd(warningInfoEntity.getWarnAdcd());
-//            }
-//        }
         danagerAreaCheckService.save(entity);
         return R.status(true);
     }

+ 33 - 34
src/main/java/org/springblade/modules/yjxt/business/rain/controller/YjRainDataController.java

@@ -82,7 +82,11 @@ public class YjRainDataController extends BladeController {
             if (Func.isNull(rtuDataRainDTO.getAdCode())) {
                 rtuDataRainDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
             }
-        } else {
+            RegionTreeNodeEntity node = this.regionService.getRegionNode(user.getRoleName(), user.getDeptId(), rtuDataRainDTO.getAdCode());
+            if (Func.notNull(node)) {
+                rtuDataRainDTO.setExcludeCode(node.getExclude());
+            }
+        } else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName())) {
             if (Func.isNull(rtuDataRainDTO.getAdCode())) {
                 LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
                 wrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
@@ -93,13 +97,36 @@ public class YjRainDataController extends BladeController {
                 }
                 rtuDataRainDTO.setAdCode(deptRegionEntity.getAdcd());
             }
-        }
-        if (Func.notNull(rtuDataRainDTO.getAdCode())) {
             RegionTreeNodeEntity node = this.regionService.getRegionNode(user.getRoleName(), user.getDeptId(), rtuDataRainDTO.getAdCode());
             if (Func.notNull(node)) {
                 rtuDataRainDTO.setExcludeCode(node.getExclude());
             }
+        } else if (BusinessConstant.ROLE_QI_ADMIN.equals(user.getRoleName())) {
+            if (Func.isNull(rtuDataRainDTO.getAdCode())) {
+                LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
+                wrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+                wrapper.last("limit 1");
+                DeptRegionEntity deptRegionEntity = deptRegionService.getOne(wrapper);
+                if (Func.isNull(deptRegionEntity)) {
+                    return R.fail("查询失败");
+                }
+                rtuDataRainDTO.setAdCode(deptRegionEntity.getAdcd());
+            }
+        } else if (BusinessConstant.ROLE_YJ_SERVICE_PERSON.equals(user.getRoleName())) {
+            if (Func.isNull(rtuDataRainDTO.getAdCode())) {
+                LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
+                wrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+                wrapper.last("limit 1");
+                DeptRegionEntity deptRegionEntity = deptRegionService.getOne(wrapper);
+                if (Func.isNull(deptRegionEntity)) {
+                    return R.fail("查询失败");
+                }
+                rtuDataRainDTO.setAdCode(deptRegionEntity.getAdcd());
+            }
+        } else {
+            return R.fail("查询失败");
         }
+
         IPage<YjRainDataVO> pages = rainDataService.selectYjPage(Condition.getPage(query), rtuDataRainDTO);
         List<YjRainDataVO> list = pages.getRecords();
         for (YjRainDataVO vo : list) {
@@ -149,53 +176,25 @@ public class YjRainDataController extends BladeController {
                 LambdaQueryWrapper<OriginalWarningInfoEntity> warnwrapper = Wrappers.<OriginalWarningInfoEntity>query().lambda();
                 warnwrapper.eq(OriginalWarningInfoEntity::getStcd, rtuInfoEntity.getStCode());
                 warnwrapper.last("limit 1");
-                OriginalWarningInfoEntity warningInfoEntity= originalWarningService.getOne(warnwrapper);
-                if (Func.notNull(warningInfoEntity)){
+                OriginalWarningInfoEntity warningInfoEntity = originalWarningService.getOne(warnwrapper);
+                if (Func.notNull(warningInfoEntity)) {
                     vo.setIsWarn(1);
                     vo.setWarnId(warningInfoEntity.getWarnId());
                     vo.setWarnName(warningInfoEntity.getWarnName());
-                }else{
+                } else {
                     vo.setIsWarn(0);
                 }
                 //查询危险区、转移路线等信息
                 LambdaQueryWrapper<DangerAreaEntity> dangerareawrapper = Wrappers.<DangerAreaEntity>query().lambda();
                 dangerareawrapper.eq(DangerAreaEntity::getStCode, rtuInfoEntity.getStCode());
-              //  dangerareawrapper.last("limit 1");
                 List<DangerAreaEntity> dangerAreaEntityList = dangerAreaService.list(dangerareawrapper);
                 if (Func.notNull(dangerAreaEntityList)) {
                     vo.setIsLinkDanger(1);
                     vo.setDangerAreaList(dangerAreaEntityList);
-                   // vo.setDangerAreaPid(dangerAreaEntity.getDangerAreaPid());
-                   // vo.setDangerAreaName(dangerAreaEntity.getDangerAreaName());
-//                    if (Func.notNull(dangerAreaEntity.getAdcd())) {
-//                        //转移路线
-//                        DangerAreaLeaveLineDTO lineDTO = new DangerAreaLeaveLineDTO();
-//                        lineDTO.setAdcd(dangerAreaEntity.getAdcd());
-//                        List<DangerAreaLeaveLineVO> lineVOList = dangerAreaLeaveLineService.selectAdDangerArea(lineDTO);
-//                        if (Func.notNull(lineVOList)) {
-//                            vo.setLeaveLines(lineVOList);
-//                        } else {
-//                            vo.setLeaveLines(new ArrayList<>(0));
-//                        }
-//                    } else {
-//                        vo.setLeaveLines(new ArrayList<>(0));
-//                    }
-//                    //群众注册
-//                    DangerAreaResidentInfoDTO dangerAreaResidentInfoDTO = new DangerAreaResidentInfoDTO();
-//                    dangerAreaResidentInfoDTO.setIsHouseholder(1);
-//                    dangerAreaResidentInfoDTO.setDangerAreaPid(vo.getDangerAreaPid());
-//                    List<DangerAreaResidentInfoEntity> familyList = residentService.getFamilyPoints(dangerAreaResidentInfoDTO);
-//                    if (Func.notNull(familyList) && familyList.size() > 0) {
-//                        vo.setFamilyPoints(familyList);
-//                        vo.setFamilyCount((long) familyList.size());
-//                    } else {
-//                        vo.setFamilyCount(0L);
-//                    }
                 } else {
                     vo.setIsLinkDanger(0);
                 }
             }
-
         }
         return R.data(pages);
     }

+ 900 - 11
src/main/java/org/springblade/share/DataShareController.java

@@ -9,6 +9,7 @@ package org.springblade.share;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
@@ -18,12 +19,43 @@ import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springblade.constant.BusinessConstant;
 import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.baseinfo.org.dto.OrgInfoDTO;
+import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
+import org.springblade.modules.baseinfo.org.service.IDeptRegionService;
+import org.springblade.modules.baseinfo.org.vo.OrgInfoVO;
+import org.springblade.modules.baseinfo.org.wrapper.OrgInfoWrapper;
+import org.springblade.modules.baseinfo.region.yw.entity.RegionInfoEntity;
+import org.springblade.modules.baseinfo.region.yw.service.IRegionInfoService;
+import org.springblade.modules.baseinfo.rtu.dto.RtuInfoDTO;
+import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
+import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
+import org.springblade.modules.baseinfo.rtu.vo.RtuInfoVO;
+import org.springblade.modules.baseinfo.rtu.wrapper.RtuInfoWrapper;
+import org.springblade.modules.baseinfo.servicePerson.wrapper.ServicePersonWrapper;
+import org.springblade.modules.business.equipment.inspection.base.dto.EquipmentInspectionInfoDTO;
+import org.springblade.modules.business.equipment.inspection.base.service.IEquipmentInspectionService;
+import org.springblade.modules.business.equipment.inspection.base.vo.EquipmentInspectionInfoVO;
+import org.springblade.modules.business.equipment.inspection.plan.dto.EquipmentInspectionPlanDTO;
+import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
+import org.springblade.modules.business.equipment.inspection.plan.service.IEquipmentInspectionPlanService;
+import org.springblade.modules.business.equipment.inspection.report.dto.EquipmentInspectionReportDTO;
+import org.springblade.modules.business.equipment.inspection.report.entity.EquipmentInspectionReportEntity;
+import org.springblade.modules.business.equipment.inspection.report.service.IEquipmentInspectionReportService;
+import org.springblade.modules.business.equipment.inspection.report.vo.EquipmentInspectionReportVO;
+import org.springblade.modules.business.equipment.inspection.report.wrapper.EquipmentInspectionReportWrapper;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.entity.DictBiz;
+import org.springblade.modules.system.entity.Post;
 import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.service.IDictBizService;
+import org.springblade.modules.system.service.IPostService;
 import org.springblade.modules.system.service.IUserService;
-import org.springblade.modules.yjxt.base.map.entity.DangerAreaEntity;
-import org.springblade.modules.yjxt.base.map.service.IDangerAreaService;
+import org.springblade.modules.system.vo.UserVO;
 import org.springblade.modules.yjxt.business.check.dto.DangerAreaCheckInfoDTO;
 import org.springblade.modules.yjxt.business.check.entity.DangerAreaCheckInfoEntity;
 import org.springblade.modules.yjxt.business.check.service.IDangerAreaCheckService;
@@ -38,6 +70,7 @@ import org.springblade.modules.yjxt.business.warn.service.IOriginalWarningServic
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
 
 import java.time.LocalDateTime;
 import java.time.ZoneId;
@@ -63,8 +96,16 @@ public class DataShareController extends BladeController {
     private final IDamageTransferPersonService damageTransferPersonService;
     private final IDangerAreaResidentService dangerAreaResidentService;
     private final IOriginalWarningService warningService;
-    private final IDangerAreaService dangerAreaService;
     private final IOriginalWarningService originalWarningService;
+    private final IRtuBaseInfoService rtuBaseInfoService;
+    private final IEquipmentInspectionPlanService planService;
+    private final IEquipmentInspectionService equipmentInspectionService;
+    private final IEquipmentInspectionReportService reportService;
+    private final IDeptRegionService deptRegionService;
+    private final IDeptService deptService;
+    private final IRegionInfoService regionInfoService;
+    private final IDictBizService dictBizService;
+    private final IPostService postService;
 
     /**
      * 巡查巡检列表查询,不分页
@@ -112,7 +153,7 @@ public class DataShareController extends BladeController {
                 d.put("remark", entity.getRemark());
             }
             JSONArray photos = new JSONArray();
-            if (!Func.isNull(entity.getCheckPhotos())) {
+            if (Func.notNull(entity.getCheckPhotos())) {
                 String photo = entity.getCheckPhotos();
                 String[] photoArr = photo.trim().split(",");
                 for (String url : photoArr) {
@@ -144,12 +185,6 @@ public class DataShareController extends BladeController {
         if (Func.isNull(dto.getDangerAreaPid())) {
             return R.fail("危险区ID参数错误");
         }
-//        if (Func.isNull(dto.getStartTime()) || Func.isNull(dto.getEndTime())) {
-//            return R.fail("查询时间参数错误");
-//        }
-//        if (Func.isNull(dto.getWarnLevelCode())) {
-//            return R.fail("预警等级参数错误");
-//        }
         List<JSONObject> datas = new ArrayList<>();
         OriginalWarningInfoDTO originalWarningInfoDTO = new OriginalWarningInfoDTO();
         originalWarningInfoDTO.setDangerAreaPid(dto.getDangerAreaPid());
@@ -171,7 +206,7 @@ public class DataShareController extends BladeController {
                 JSONObject vo = new JSONObject();
                 vo.put("warnId", entity.getWarnId());
                 vo.put("warnTime", entity.getWarnTime().getTime());
-                vo.put("warnLevelCode",entity.getWarnLevelCode());
+                vo.put("warnLevelCode", entity.getWarnLevelCode());
                 DangerAreaResidentInfoDTO residentInfoDTO = new DangerAreaResidentInfoDTO();
                 residentInfoDTO.setDangerAreaCode(entity.getWarnAdcd());
                 long totalTransferPerson = dangerAreaResidentService.residentCount(residentInfoDTO);
@@ -249,4 +284,858 @@ public class DataShareController extends BladeController {
         datas.add(vo);
         return R.data(datas);
     }
+
+    /**
+     * 按页查询测站基础信息
+     *
+     * @param dto
+     * @param query
+     * @return
+     */
+    @GetMapping("/yw/site/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuKind", value = "测站类型", paramType = "query", dataType = "string")
+    })
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "分页", notes = "")
+    public R<IPage<JSONObject>> sitePage(@ApiIgnore RtuInfoDTO dto, Query query) {
+        if (Func.notNull(dto.getRtuKind())) {
+            if ("1".equals(dto.getRtuKind())) {
+                dto.setIsRain(1);
+            } else if ("2".equals(dto.getRtuKind())) {
+                dto.setIsRiver(1);
+            } else if ("3".equals(dto.getRtuKind())) {
+                dto.setIsGround(1);
+            } else if ("4".equals(dto.getRtuKind())) {
+                dto.setIsVideo(1);
+            }
+        }
+        IPage<RtuInfoVO> pages = rtuBaseInfoService.selectPage(Condition.getPage(query), dto);
+        IPage<JSONObject> sitePages = Condition.getPage(query);
+        sitePages.setTotal(pages.getTotal());
+        sitePages.setCurrent(pages.getCurrent());
+        sitePages.setSize(pages.getSize());
+        sitePages.setPages(pages.getPages());
+        List<RtuInfoVO> list = pages.getRecords();
+        List<JSONObject> siteList = new ArrayList<>(list.size());
+        for (RtuInfoVO vo : list) {
+            RtuInfoWrapper.build().entityVO(vo);
+            JSONObject site = new JSONObject();
+            site.put("rtuCode", vo.getRtuCode());
+            site.put("rtuName", vo.getRtuName());
+            site.put("adCode", vo.getAdCode());
+            site.put("adName", vo.getAdName());
+            site.put("adCity", vo.getAdCity());
+            site.put("adDist", vo.getAdDist());
+            if (Func.notNull(vo.getLng())) {
+                site.put("lng", vo.getLng());
+            }
+            if (Func.notNull(vo.getLat())) {
+                site.put("lat", vo.getLat());
+            }
+            if (Func.notNull(vo.getManageCompany())) {
+                site.put("manageCompany", vo.getManageCompany());
+            }
+            if (Func.notNull(vo.getLocationDesc())) {
+                site.put("locationDesc", vo.getLocationDesc());
+            }
+            site.put("isRain", vo.getIsRain());
+            site.put("isRiver", vo.getIsRiver());
+            site.put("isRes", vo.getIsRes());
+            site.put("isGround", vo.getIsGround());
+            site.put("isVideo", vo.getIsVideo());
+            site.put("isSatellite", vo.getIsSatellite());
+            if (Func.notNull(vo.getRtuBrand())) {
+                site.put("rtuBrand", vo.getRtuBrand());
+            }
+            if (Func.notNull(vo.getRtuModel())) {
+                site.put("rtuModel", vo.getRtuModel());
+            }
+            if (Func.notNull(vo.getRtuReplaceDate())) {
+                String date = Func.formatDate(vo.getRtuReplaceDate());
+                site.put("rtuReplaceDate", date);
+            }
+            if (Func.notNull(vo.getRainSensorBrand())) {
+                site.put("rainSensorBrand", vo.getRainSensorBrand());
+            }
+            if (Func.notNull(vo.getRainSensorModel())) {
+                site.put("rainSensorModel", vo.getRainSensorModel());
+            }
+            if (Func.notNull(vo.getRainSensorReplaceDate())) {
+                String date = Func.formatDate(vo.getRainSensorReplaceDate());
+                site.put("rainSensorReplaceDate", date);
+            }
+            if (Func.notNull(vo.getWaterSensorBrand())) {
+                site.put("waterSensorBrand", vo.getWaterSensorBrand());
+            }
+            if (Func.notNull(vo.getWaterSensorModel())) {
+                site.put("waterSensorModel", vo.getWaterSensorModel());
+            }
+            if (Func.notNull(vo.getWaterSensorReplaceDate())) {
+                String date = Func.formatDate(vo.getWaterSensorReplaceDate());
+                site.put("waterSensorReplaceDate", date);
+            }
+            if (Func.notNull(vo.getWaterSensorTypeText())) {
+                site.put("waterSensorType", vo.getWaterSensorTypeText());
+            }
+            if (Func.notNull(vo.getGroundSensorBrand())) {
+                site.put("groundSensorBrand", vo.getGroundSensorBrand());
+            }
+            if (Func.notNull(vo.getGroundSensorModel())) {
+                site.put("groundSensorModel", vo.getGroundSensorModel());
+            }
+            if (Func.notNull(vo.getGroundSensorReplaceDate())) {
+                String date = Func.formatDate(vo.getGroundSensorReplaceDate());
+                site.put("groundSensorReplaceDate", date);
+            }
+            if (Func.notNull(vo.getGroundSensorTypeText())) {
+                site.put("groundSensorType", vo.getGroundSensorTypeText());
+            }
+            if (Func.notNull(vo.getBatteryModel())) {
+                site.put("batteryModel", vo.getBatteryModel());
+            }
+            if (Func.notNull(vo.getBatteryReplaceDate())) {
+                String date = Func.formatDate(vo.getBatteryReplaceDate());
+                site.put("batteryReplaceDate", date);
+            }
+            if (Func.notNull(vo.getSunPowerModel())) {
+                site.put("sunPowerModel", vo.getSunPowerModel());
+            }
+            if (Func.notNull(vo.getSunPowerControllerModel())) {
+                site.put("sunPowerControllerModel", vo.getSunPowerControllerModel());
+            }
+            if (Func.notNull(vo.getSunPowerControllerBrand())) {
+                site.put("sunPowerControllerBrand", vo.getSunPowerControllerBrand());
+            }
+            if (Func.notNull(vo.getNetworkSimId())) {
+                site.put("networkSimId", vo.getNetworkSimId());
+            }
+            if (Func.notNull(vo.getNetworkPayer())) {
+                site.put("networkPayer", vo.getNetworkPayer());
+            }
+            if (Func.notNull(vo.getNetworkPayEndDate())) {
+                String date = Func.formatDate(vo.getNetworkPayEndDate());
+                site.put("networkPayEndDate", date);
+            }
+            if (Func.notNull(vo.getSatelliteModelText())) {
+                site.put("satelliteModel", vo.getSatelliteModelText());
+            }
+            if (Func.notNull(vo.getRemark())) {
+                site.put("remark", vo.getRemark());
+            }
+            siteList.add(site);
+        }
+        sitePages.setRecords(siteList);
+        return R.data(sitePages);
+    }
+
+    /**
+     * 巡检汛期配置信息
+     *
+     * @param dto
+     * @return
+     */
+    @GetMapping("/yw/inspection/plan")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "inspectionYear", value = "巡检年度", paramType = "query", dataType = "string")
+    })
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "巡检汛期配置信息", notes = "")
+    public R<JSONObject> inspectionPlanInfo(@ApiIgnore EquipmentInspectionPlanDTO dto) {
+        if (Func.isNull(dto.getInspectionYear())) {
+            return R.fail("参数错误");
+        }
+
+        JSONObject plan = new JSONObject();
+        plan.put("inspectionYear", dto.getInspectionYear());
+        EquipmentInspectionPlanEntity detail = planService.yearPlan(dto);
+        if (Func.notNull(detail)) {
+            plan.put("beforeRainSeasonStartTime", Func.formatDate(detail.getBeforeRainSeasonStartTime()));
+            plan.put("beforeRainSeasonEndTime", Func.formatDate(detail.getBeforeRainSeasonEndTime()));
+            plan.put("rainSeasonFirstStartTime", Func.formatDate(detail.getRainSeasonFirstStartTime()));
+            plan.put("rainSeasonFirstEndTime", Func.formatDate(detail.getRainSeasonFirstEndTime()));
+            plan.put("rainSeasonSecondStartTime", Func.formatDate(detail.getRainSeasonSecondStartTime()));
+            plan.put("rainSeasonSecondEndTime", Func.formatDate(detail.getRainSeasonSecondEndTime()));
+        }
+        return R.data(plan);
+    }
+
+
+    /**
+     * 巡检信息,按页查询
+     *
+     * @param dto
+     * @param query
+     * @return
+     */
+    @GetMapping("/yw/inspection/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "inspectionYear", value = "巡检年度", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页查询巡检数据", notes = "")
+    public R<IPage<JSONObject>> inspectionPage(@ApiIgnore EquipmentInspectionInfoDTO dto, Query query) {
+        if (Func.isNull(dto.getInspectionYear())) {
+            return R.fail("参数错误");
+        }
+        IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectPage(Condition.getPage(query), dto);
+        IPage<JSONObject> dataPages = Condition.getPage(query);
+        dataPages.setTotal(pages.getTotal());
+        dataPages.setCurrent(pages.getCurrent());
+        dataPages.setSize(pages.getSize());
+        dataPages.setPages(pages.getPages());
+        List<EquipmentInspectionInfoVO> list = pages.getRecords();
+        List<JSONObject> dataList = new ArrayList<>(list.size());
+        for (EquipmentInspectionInfoVO vo : list) {
+            JSONObject detail = new JSONObject();
+            detail.put("id", vo.getId());
+            detail.put("rtuCode", vo.getRtuCode());
+            detail.put("rtuName", vo.getRtuName());
+
+            detail.put("beforeRainSeasonStatus", vo.getBeforeRainSeasonStatus());
+            if (vo.getBeforeRainSeasonStatus() == 1) {
+                detail.put("beforeRainSeasonReportId", vo.getBeforeRainSeasonReportId());
+                String date = Func.formatDateTime(vo.getBeforeRainSeasonReportTime());
+                detail.put("beforeRainSeasonReportTime", date);
+                detail.put("beforeRainSeasonReportUser", vo.getBeforeRainSeasonReportUserName());
+            }
+
+            detail.put("rainSeasonFirstStatus", vo.getRainSeasonFirstStatus());
+            if (vo.getRainSeasonFirstStatus() == 1) {
+                detail.put("rainSeasonFirstReportId", vo.getRainSeasonFirstReportId());
+                String date = Func.formatDateTime(vo.getRainSeasonFirstReportTime());
+                detail.put("rainSeasonFirstReportTime", date);
+                detail.put("rainSeasonFirstReportUser", vo.getRainSeasonFirstReportUserName());
+            }
+
+            detail.put("rainSeasonSecondStatus", vo.getRainSeasonSecondStatus());
+            if (vo.getRainSeasonSecondStatus() == 1) {
+                detail.put("rainSeasonSecondReportId", vo.getRainSeasonSecondReportId());
+                String date = Func.formatDateTime(vo.getRainSeasonSecondReportTime());
+                detail.put("rainSeasonSecondReportTime", date);
+                detail.put("rainSeasonSecondReportUser", vo.getRainSeasonSecondReportUserName());
+            }
+
+
+            dataList.add(detail);
+        }
+        dataPages.setRecords(dataList);
+        return R.data(dataPages);
+    }
+
+    /**
+     * 巡检填报详情
+     *
+     * @param dto
+     * @return
+     */
+    @GetMapping("/yw/inspection/detail")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", paramType = "query", dataType = "long")
+    })
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "巡检填报详情查询", notes = "")
+    public R<JSONObject> inspectionDetail(@ApiIgnore EquipmentInspectionReportDTO dto) {
+        if (Func.isNull(dto.getId())) {
+            return R.fail("参数错误");
+        }
+        EquipmentInspectionReportEntity entity = reportService.getById(dto.getId());
+        EquipmentInspectionReportVO vo = EquipmentInspectionReportWrapper.build().entityVO(entity);
+        JSONObject detail = new JSONObject();
+        detail.put("id", dto.getId());
+        detail.put("rtuCode", vo.getRtuCode());
+        detail.put("rtuName", vo.getRtuName());
+        if (Func.notNull(vo.getLng())) {
+            detail.put("lng", vo.getLng());
+        }
+        if (Func.notNull(vo.getLat())) {
+            detail.put("lat", vo.getLat());
+        }
+        if (Func.notNull(vo.getLocationDesc())) {
+            detail.put("locationDesc", vo.getLocationDesc());
+        }
+        detail.put("siteCheckItem", vo.getSiteCheckItem());
+        if (Func.notNull(vo.getSiteCheckPhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getSiteCheckPhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("siteCheckPhotos", photos);
+        }
+        if (Func.notNull(vo.getSiteCheckRemark())) {
+            detail.put("siteCheckRemark", vo.getSiteCheckRemark());
+        }
+        if (Func.notNull(vo.getRainSiteCheckItem())) {
+            detail.put("rainSiteCheckItem", vo.getRainSiteCheckItem());
+        }
+        if (Func.notNull(vo.getRainSiteCheckRemark())) {
+            detail.put("rainSiteCheckRemark", vo.getRainSiteCheckRemark());
+        }
+        if (Func.notNull(vo.getRainSiteCheckPhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getRainSiteCheckPhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("rainSiteCheckPhotos", photos);
+        }
+        if (Func.notNull(vo.getRainSiteCheckResult())) {
+            detail.put("rainSiteCheckResult", vo.getRainSiteCheckResult());
+        }
+        if (Func.notNull(vo.getWaterSiteCheckItem())) {
+            detail.put("waterSiteCheckItem", vo.getWaterSiteCheckItem());
+        }
+        if (Func.notNull(vo.getWaterSiteCheckRemark())) {
+            detail.put("waterSiteCheckRemark", vo.getWaterSiteCheckRemark());
+        }
+        if (Func.notNull(vo.getWaterSiteCheckPhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getWaterSiteCheckPhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("waterSiteCheckPhotos", photos);
+        }
+        if (Func.notNull(vo.getWaterSiteCheckResult())) {
+            detail.put("waterSiteCheckResult", vo.getWaterSiteCheckResult());
+        }
+        if (Func.notNull(vo.getGroundSiteCheckItem())) {
+            detail.put("groundSiteCheckItem", vo.getGroundSiteCheckItem());
+        }
+        if (Func.notNull(vo.getGroundSiteCheckRemark())) {
+            detail.put("groundSiteCheckRemark", vo.getGroundSiteCheckRemark());
+        }
+        if (Func.notNull(vo.getGroundSiteCheckPhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getGroundSiteCheckPhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("groundSiteCheckPhotos", photos);
+        }
+        if (Func.notNull(vo.getGroundSiteCheckResult())) {
+            detail.put("groundSiteCheckResult", vo.getGroundSiteCheckResult());
+        }
+        if (Func.notNull(vo.getOtherEquipmentCheckItem())) {
+            detail.put("otherEquipmentCheckItem", vo.getOtherEquipmentCheckItem());
+        }
+        if (Func.notNull(vo.getOtherEquipmentCheckRemark())) {
+            detail.put("otherEquipmentCheckRemark", vo.getOtherEquipmentCheckRemark());
+        }
+        if (Func.notNull(vo.getOtherEquipmentCheckPhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getOtherEquipmentCheckPhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("otherEquipmentCheckPhotos", photos);
+        }
+        if (Func.notNull(vo.getOtherEquipmentCheckResult())) {
+            detail.put("otherEquipmentCheckResult", vo.getOtherEquipmentCheckResult());
+        }
+        if (Func.notNull(vo.getRtuReplace())) {
+            detail.put("rtuReplace", vo.getRtuReplace());
+        }
+        if (Func.notNull(vo.getRtuModelRemark())) {
+            detail.put("rtuModelRemark", vo.getRtuModelRemark());
+        }
+        if (Func.notNull(vo.getRtuReplacePhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getRtuReplacePhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("rtuReplacePhotos", photos);
+        }
+        if (Func.notNull(vo.getRainSensorReplace())) {
+            detail.put("rainSensorReplace", vo.getRainSensorReplace());
+        }
+        if (Func.notNull(vo.getRainSensorModelRemark())) {
+            detail.put("rainSensorModelRemark", vo.getRainSensorModelRemark());
+        }
+        if (Func.notNull(vo.getRainSensorReplacePhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getRainSensorReplacePhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("rainSensorReplacePhotos", photos);
+        }
+        if (Func.notNull(vo.getWaterSensorReplace())) {
+            detail.put("waterSensorReplace", vo.getWaterSensorReplace());
+        }
+        if (Func.notNull(vo.getWaterSensorModelRemark())) {
+            detail.put("waterSensorModelRemark", vo.getWaterSensorModelRemark());
+        }
+        if (Func.notNull(vo.getWaterSensorReplacePhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getWaterSensorReplacePhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("waterSensorReplacePhotos", photos);
+        }
+        if (Func.notNull(vo.getGroundSensorReplace())) {
+            detail.put("groundSensorReplace", vo.getGroundSensorReplace());
+        }
+        if (Func.notNull(vo.getGroundSensorModelRemark())) {
+            detail.put("groundSensorModelRemark", vo.getGroundSensorModelRemark());
+        }
+        if (Func.notNull(vo.getGroundSensorReplacePhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getGroundSensorReplacePhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("groundSensorReplacePhotos", photos);
+        }
+        if (Func.notNull(vo.getBatteryReplace())) {
+            detail.put("batteryReplace", vo.getBatteryReplace());
+        }
+        if (Func.notNull(vo.getBatteryModelRemark())) {
+            detail.put("batteryModelRemark", vo.getBatteryModelRemark());
+        }
+        if (Func.notNull(vo.getBatteryReplacePhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getBatteryReplacePhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("batteryReplacePhotos", photos);
+        }
+        if (Func.notNull(vo.getSunPowerReplace())) {
+            detail.put("sunPowerReplace", vo.getSunPowerReplace());
+        }
+        if (Func.notNull(vo.getSunPowerModelRemark())) {
+            detail.put("sunPowerModelRemark", vo.getSunPowerModelRemark());
+        }
+        if (Func.notNull(vo.getSunPowerReplacePhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getSunPowerReplacePhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("sunPowerReplacePhotos", photos);
+        }
+        if (Func.notNull(vo.getBatteryControllerReplace())) {
+            detail.put("batteryControllerReplace", vo.getBatteryControllerReplace());
+        }
+        if (Func.notNull(vo.getBatteryControllerModelRemark())) {
+            detail.put("batteryControllerModelRemark", vo.getBatteryControllerModelRemark());
+        }
+        if (Func.notNull(vo.getBatteryControllerReplacePhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getBatteryControllerReplacePhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("batteryControllerReplacePhotos", photos);
+        }
+        if (Func.notNull(vo.getOtherEquipmentReplace())) {
+            detail.put("otherEquipmentReplace", vo.getOtherEquipmentReplace());
+        }
+        if (Func.notNull(vo.getOtherEquipmentModelRemark())) {
+            detail.put("otherEquipmentModelRemark", vo.getOtherEquipmentModelRemark());
+        }
+        if (Func.notNull(vo.getOtherEquipmentReplacePhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getOtherEquipmentReplacePhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("otherEquipmentReplacePhotos", photos);
+        }
+        if (Func.notNull(vo.getRemainQuestion())) {
+            detail.put("remainQuestion", vo.getRemainQuestion());
+        }
+        if (Func.notNull(vo.getInspectionWorkPhotos())) {
+            JSONArray photos = new JSONArray();
+            String photoUrl = vo.getInspectionWorkPhotos();
+            String[] urlArr = photoUrl.trim().split(",");
+            for (String url : urlArr) {
+                JSONObject p = new JSONObject();
+                p.put("url", BusinessConstant.OSS_BASE_PATH + url);
+                photos.add(p);
+            }
+            detail.put("inspectionWorkPhotos", photos);
+        }
+        if (Func.notNull(vo.getNetworkSignalStatus())) {
+            detail.put("networkSignalStatus", vo.getNetworkSignalStatus());
+        }
+        if (Func.notNull(vo.getNetworkSimId())) {
+            detail.put("networkSimId", vo.getNetworkSimId());
+        }
+        if (Func.notNull(vo.getNetworkPayer())) {
+            detail.put("networkPayer", vo.getNetworkPayer());
+        }
+        if (Func.notNull(vo.getIsRain())) {
+            detail.put("isRain", vo.getIsRain());
+        }
+        if (Func.notNull(vo.getIsRiver())) {
+            detail.put("isRiver", vo.getIsRiver());
+        }
+        if (Func.notNull(vo.getIsGround())) {
+            detail.put("isRes", vo.getIsGround());
+        }
+        if (Func.notNull(vo.getIsGround())) {
+            detail.put("isGround", vo.getIsGround());
+        }
+        return R.data(detail);
+    }
+
+
+    /**
+     * 遗留问题信息列表分页查询
+     *
+     * @param dto
+     * @param query
+     * @return
+     */
+    @GetMapping("/yw/inspection/remainingproblems/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "inspectionYear", value = "巡检年度", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rainSeasonKind", value = "汛期类别", paramType = "query", dataType = "int"),
+            @ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页查询", notes = "遗留问题信息列表")
+    public R<IPage<JSONObject>> inspectionRemainingproblemsPage(@ApiIgnore EquipmentInspectionReportDTO dto, Query query) {
+        if (Func.isNull(dto.getInspectionYear())) {
+            return R.fail("参数错误");
+        }
+        LocalDateTime startDate = LocalDateTime.of(Integer.valueOf(dto.getInspectionYear()), 1, 1, 0, 0, 0);
+        LocalDateTime endDate = startDate.plusYears(1);
+        dto.setInspectionYearStartDate(Date.from(startDate.atZone(ZoneId.systemDefault()).toInstant()));
+        dto.setInspectionYearEndDate(Date.from(endDate.atZone(ZoneId.systemDefault()).toInstant()));
+        IPage<EquipmentInspectionReportVO> pages = reportService.selectRemainingproblemsPage(Condition.getPage(query), dto);
+        IPage<JSONObject> dataPages = Condition.getPage(query);
+        dataPages.setTotal(pages.getTotal());
+        dataPages.setCurrent(pages.getCurrent());
+        dataPages.setSize(pages.getSize());
+        dataPages.setPages(pages.getPages());
+        List<EquipmentInspectionReportVO> list = pages.getRecords();
+        List<JSONObject> dataList = new ArrayList<>(list.size());
+        for (EquipmentInspectionReportVO vo : list) {
+            JSONObject detail = new JSONObject();
+            detail.put("id", vo.getId());
+            detail.put("rtuCode", vo.getRtuCode());
+            detail.put("rtuName", vo.getRtuName());
+            detail.put("adName", vo.getAdCity());
+            detail.put("inspectionYear", dto.getInspectionYear());
+            detail.put("rainSeasonKind", vo.getRainSeasonKind());
+            detail.put("createTime", Func.formatDateTime(vo.getCreateTime()));
+            User user = userService.getById(vo.getCreateUser());
+            if (!Func.isNull(user)) {
+                detail.put("createUser", user.getRealName());
+            }
+            detail.put("remainQuestion", vo.getRemainQuestion());
+            detail.put("remainQuestionState", vo.getRemainQuestionState());
+            detail.put("remainQuestionResolution", vo.getRemainQuestionResolution());
+            RtuInfoEntity rtuInfoEntity = rtuBaseInfoService.rtuInfoByCode(vo.getRtuCode());
+            if (!Func.isNull(rtuInfoEntity)) {
+                detail.put("isRain", rtuInfoEntity.getIsRain());
+                detail.put("isRiver", rtuInfoEntity.getIsRiver());
+                detail.put("isRes", rtuInfoEntity.getIsRes());
+                detail.put("isGround", rtuInfoEntity.getIsGround());
+            }
+            dataList.add(detail);
+        }
+        dataPages.setRecords(dataList);
+        return R.data(dataPages);
+    }
+
+    /**
+     * 设备巡检无网络信号填报
+     *
+     * @param dto
+     * @param query
+     * @return
+     */
+    @GetMapping("/yw/inspection/networknosignal/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "inspectionYear", value = "巡检年度", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rainSeasonKind", value = "汛期类别", paramType = "query", dataType = "int"),
+            @ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页查询", notes = "设备巡检无网络信号填报信息列表")
+    public R<IPage<JSONObject>> inspectionNetworknosignalPage(@ApiIgnore EquipmentInspectionReportDTO dto, Query query) {
+        if (Func.isNull(dto.getInspectionYear())) {
+            return R.fail("参数错误");
+        }
+        LocalDateTime startDate = LocalDateTime.of(Integer.valueOf(dto.getInspectionYear()), 1, 1, 0, 0, 0);
+        LocalDateTime endDate = startDate.plusYears(1);
+        dto.setInspectionYearStartDate(Date.from(startDate.atZone(ZoneId.systemDefault()).toInstant()));
+        dto.setInspectionYearEndDate(Date.from(endDate.atZone(ZoneId.systemDefault()).toInstant()));
+        IPage<EquipmentInspectionReportVO> pages = reportService.selectNoNetworkSignalPage(Condition.getPage(query), dto);
+        IPage<JSONObject> dataPages = Condition.getPage(query);
+        dataPages.setTotal(pages.getTotal());
+        dataPages.setCurrent(pages.getCurrent());
+        dataPages.setSize(pages.getSize());
+        dataPages.setPages(pages.getPages());
+        List<EquipmentInspectionReportVO> list = pages.getRecords();
+        List<JSONObject> dataList = new ArrayList<>(list.size());
+        for (EquipmentInspectionReportVO vo : list) {
+            JSONObject detail = new JSONObject();
+            detail.put("id", vo.getId());
+            detail.put("rtuCode", vo.getRtuCode());
+            detail.put("rtuName", vo.getRtuName());
+            detail.put("adName", vo.getAdCity());
+            detail.put("inspectionYear", dto.getInspectionYear());
+            detail.put("rainSeasonKind", vo.getRainSeasonKind());
+            detail.put("createTime", Func.formatDateTime(vo.getCreateTime()));
+            User user = userService.getById(vo.getCreateUser());
+            if (!Func.isNull(user)) {
+                detail.put("createUser", user.getRealName());
+            }
+            detail.put("photoSupplementSubmitStatus", vo.getPhotoSupplementSubmitStatus());
+            RtuInfoEntity rtuInfoEntity = rtuBaseInfoService.rtuInfoByCode(vo.getRtuCode());
+            if (!Func.isNull(rtuInfoEntity)) {
+                detail.put("isRain", rtuInfoEntity.getIsRain());
+                detail.put("isRiver", rtuInfoEntity.getIsRiver());
+                detail.put("isRes", rtuInfoEntity.getIsRes());
+                detail.put("isGround", rtuInfoEntity.getIsGround());
+            }
+            dataList.add(detail);
+        }
+        dataPages.setRecords(dataList);
+        return R.data(dataPages);
+    }
+
+    /**
+     * 未完成巡检设备数据分页查询
+     *
+     * @param dto
+     * @param query
+     * @return
+     */
+    @GetMapping("/yw/inspection/unfinished/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "inspectionYear", value = "巡检年度", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rainSeasonKind", value = "汛期类别", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页查询", notes = "未完成巡检设备数据信息列表")
+    public R<IPage<JSONObject>> inspectionUnfinishedPage(@ApiIgnore EquipmentInspectionInfoDTO dto, Query query) {
+        if (Func.isNull(dto.getInspectionYear())) {
+            return R.fail("参数错误");
+        }
+        LocalDateTime startDate = LocalDateTime.of(Integer.valueOf(dto.getInspectionYear()), 1, 1, 0, 0, 0);
+        LocalDateTime endDate = startDate.plusYears(1);
+        dto.setInspectionYearStartDate(Date.from(startDate.atZone(ZoneId.systemDefault()).toInstant()));
+        dto.setInspectionYearEndDate(Date.from(endDate.atZone(ZoneId.systemDefault()).toInstant()));
+        IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectUnfinishedInspectionEquipmentPage(Condition.getPage(query), dto);
+        IPage<JSONObject> dataPages = Condition.getPage(query);
+        dataPages.setTotal(pages.getTotal());
+        dataPages.setCurrent(pages.getCurrent());
+        dataPages.setSize(pages.getSize());
+        dataPages.setPages(pages.getPages());
+        List<EquipmentInspectionInfoVO> list = pages.getRecords();
+        List<JSONObject> dataList = new ArrayList<>(list.size());
+        for (EquipmentInspectionInfoVO vo : list) {
+            JSONObject detail = new JSONObject();
+            detail.put("rtuCode", vo.getRtuCode());
+            detail.put("rtuName", vo.getRtuName());
+            detail.put("adCity", vo.getAdCity());
+            detail.put("adDist", vo.getAdDist());
+            detail.put("lng", vo.getLng());
+            detail.put("lat", vo.getLat());
+            detail.put("locationDesc", vo.getLocationDesc());
+            if (Func.notNull(vo.getBeforeRainSeasonStatus())) {
+                detail.put("beforeRainSeasonStatus", vo.getBeforeRainSeasonStatus());
+            } else {
+                detail.put("beforeRainSeasonStatus", 0);
+            }
+            if (Func.notNull(vo.getBeforeRainSeasonStatus())) {
+                detail.put("rainSeasonFirstStatus", vo.getRainSeasonFirstStatus());
+            } else {
+                detail.put("rainSeasonFirstStatus", 0);
+            }
+            if (Func.notNull(vo.getBeforeRainSeasonStatus())) {
+                detail.put("rainSeasonSecondStatus", vo.getRainSeasonSecondStatus());
+            } else {
+                detail.put("rainSeasonSecondStatus", 0);
+            }
+            RtuInfoEntity rtuInfoEntity = rtuBaseInfoService.rtuInfoByCode(vo.getRtuCode());
+            if (!Func.isNull(rtuInfoEntity)) {
+                detail.put("isRain", rtuInfoEntity.getIsRain());
+                detail.put("isRiver", rtuInfoEntity.getIsRiver());
+                detail.put("isRes", rtuInfoEntity.getIsRes());
+                detail.put("isGround", rtuInfoEntity.getIsGround());
+            }
+            dataList.add(detail);
+        }
+        dataPages.setRecords(dataList);
+        return R.data(dataPages);
+    }
+
+    /**
+     * 运维公司分页查询
+     *
+     * @param dto
+     * @param query
+     * @return
+     */
+    @GetMapping("/yw/company/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "deptName", value = "机构名称", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页查询", notes = "运维公司信息查询")
+    public R<IPage<JSONObject>> ywCompanyPage(@ApiIgnore OrgInfoDTO dto, Query query) {
+        LambdaQueryWrapper<Dept> wrapper = Wrappers.<Dept>query().lambda();
+        wrapper.eq(Dept::getDeptCategory, 1);
+        if (Func.notNull(dto.getDeptName())) {
+            wrapper.like(Dept::getDeptName, dto.getDeptName());
+        }
+        IPage<Dept> pages = deptService.page(Condition.getPage(query), wrapper);
+        IPage<OrgInfoVO> voPages = OrgInfoWrapper.build().pageVO(pages);
+        IPage<JSONObject> dataPages = Condition.getPage(query);
+        dataPages.setTotal(pages.getTotal());
+        List<OrgInfoVO> list = voPages.getRecords();
+        List<JSONObject> dataList = new ArrayList<>(list.size());
+        for (OrgInfoVO dept : list) {
+            JSONObject detail = new JSONObject();
+            detail.put("id", dept.getId());
+            detail.put("deptName", dept.getDeptName());
+            detail.put("adnm", dept.getAdnm());
+            dataList.add(detail);
+        }
+        dataPages.setRecords(dataList);
+        return R.data(dataPages);
+    }
+
+    /**
+     * 运维公司工作人员分页查询
+     *
+     * @param dto
+     * @param query
+     * @return
+     */
+    @GetMapping("/yw/company/personnel/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "deptId", value = "机构ID", paramType = "query", dataType = "long"),
+            @ApiImplicitParam(name = "realName", value = "用户名称", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "phone", value = "手机号", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页查询", notes = "运维公司工作人员信息查询")
+    public R<IPage<JSONObject>> ywCompanyPersonnalPage(@ApiIgnore User dto, Query query) {
+        ArrayList<Long> deptIds = new ArrayList<>();
+        if (Func.notNull(dto.getDeptId())) {
+            deptIds.add(Func.toLong(dto.getDeptId()));
+        } else {
+            LambdaQueryWrapper<Dept> wrapper = Wrappers.<Dept>query().lambda();
+            wrapper.eq(Dept::getDeptCategory, 1);
+            List<Dept> list = deptService.list(wrapper);
+            for (Dept dept : list) {
+                deptIds.add(dept.getId());
+            }
+        }
+        LambdaQueryWrapper<User> wrapper = Wrappers.<User>query().lambda();
+        wrapper.in(User::getDeptId, deptIds);
+        if (Func.notNull(dto.getRealName())) {
+            wrapper.like(User::getRealName, dto.getRealName());
+        }
+        if (Func.notNull(dto.getPhone())) {
+            wrapper.like(User::getPhone, dto.getPhone());
+        }
+        wrapper.orderByAsc(User::getDeptId);
+        wrapper.orderByAsc(User::getPostId);
+        IPage<User> pages = userService.page(Condition.getPage(query), wrapper);
+        IPage<UserVO> voPages = ServicePersonWrapper.build().pageVO(pages);
+        IPage<JSONObject> dataPages = Condition.getPage(query);
+        dataPages.setTotal(pages.getTotal());
+        List<UserVO> list = voPages.getRecords();
+        List<JSONObject> dataList = new ArrayList<>(list.size());
+        for (UserVO userVO : list) {
+            JSONObject detail = new JSONObject();
+            detail.put("id", userVO.getId());
+            detail.put("account", userVO.getAccount());
+            detail.put("name", userVO.getRealName());
+            detail.put("phone", userVO.getPhone());
+            detail.put("email", userVO.getEmail());
+            detail.put("deptName", userVO.getDeptName());
+            Post post = postService.getById(Func.toLong(userVO.getPostId()));
+            if (Func.notNull(post)) {
+                detail.put("postName", post.getPostName());
+            } else {
+                detail.put("postName", "");
+            }
+            LambdaQueryWrapper<DeptRegionEntity> deptRegionQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+            deptRegionQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(userVO.getDeptId()));
+            deptRegionQueryWrapper.last("limit 1");
+            DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionQueryWrapper);
+            if (Func.notNull(deptRegionEntity)) {
+                LambdaQueryWrapper<RegionInfoEntity> regionQueryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+                regionQueryWrapper.eq(RegionInfoEntity::getAdcd, deptRegionEntity.getAdcd());
+                regionQueryWrapper.last("limit 1");
+                RegionInfoEntity regionInfoEntity = regionInfoService.getOne(regionQueryWrapper);
+                if (Func.notNull(regionInfoEntity)) {
+                    detail.put("adnm", regionInfoEntity.getAdnm());
+                } else {
+                    detail.put("adnm", "");
+                }
+            } else {
+                detail.put("adnm", "");
+            }
+            dataList.add(detail);
+        }
+        dataPages.setRecords(dataList);
+        return R.data(dataPages);
+    }
+
 }

+ 1 - 0
src/main/resources/application.yml

@@ -209,6 +209,7 @@ blade:
       - /yjxt-business/public/rest/transfer/resident/register
       - /yjxt-business/public/rest/dangerarea/resident/register
       - /yjxt-business/public/rest/resident/family/list
+      - /ywxt-business/public/data/share/yw/**
       - /galaxy-test/test/**
     #授权认证配置
     auth: