Эх сурвалжийг харах

泰山运维系统云服务项目-工单系统开发

dylan 2 жил өмнө
parent
commit
ef41974681
32 өөрчлөгдсөн 2031 нэмэгдсэн , 1177 устгасан
  1. 108 0
      src/main/java/org/springblade/enums/InspectionStatusEnum.java
  2. 1 1
      src/main/java/org/springblade/enums/OrderConfirmEnum.java
  3. 32 0
      src/main/java/org/springblade/modules/baseinfo/servicePerson/controller/ServicePersonController.java
  4. 4 1
      src/main/java/org/springblade/modules/baseinfo/servicePerson/mapper/ServicePersonMapper.xml
  5. 72 11
      src/main/java/org/springblade/modules/business/check/order/controller/RtuCheckOrderController.java
  6. 13 0
      src/main/java/org/springblade/modules/business/check/order/dto/CheckOrderInfoDTO.java
  7. 21 0
      src/main/java/org/springblade/modules/business/check/order/entity/CheckOrderInfoEntity.java
  8. 8 2
      src/main/java/org/springblade/modules/business/check/order/mapper/RtuCheckOrderMapper.xml
  9. 10 1
      src/main/java/org/springblade/modules/business/check/order/vo/CheckOrderInfoVO.java
  10. 5 0
      src/main/java/org/springblade/modules/business/check/order/wrapper/RtuCheckOrderWrapper.java
  11. 28 0
      src/main/java/org/springblade/modules/business/check/process/controller/RtuOrderProcessController.java
  12. 887 830
      src/main/java/org/springblade/modules/business/equipment/inspection/base/controller/EquipmentInspectionController.java
  13. 27 2
      src/main/java/org/springblade/modules/business/equipment/inspection/base/entity/EquipmentInspectionInfoEntity.java
  14. 1 0
      src/main/java/org/springblade/modules/business/equipment/inspection/base/mapper/EquipmentInspectionMapper.java
  15. 32 1
      src/main/java/org/springblade/modules/business/equipment/inspection/base/mapper/EquipmentInspectionMapper.xml
  16. 3 0
      src/main/java/org/springblade/modules/business/equipment/inspection/base/service/IEquipmentInspectionService.java
  17. 5 0
      src/main/java/org/springblade/modules/business/equipment/inspection/base/service/impl/EquipmentInspectionServiceImpl.java
  18. 48 0
      src/main/java/org/springblade/modules/business/equipment/inspection/base/vo/EquipmentInspectionInfoVO.java
  19. 31 28
      src/main/java/org/springblade/modules/business/equipment/inspection/base/wrapper/EquipmentInspectionWrapper.java
  20. 104 87
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/controller/EquipmentInspectionPlanController.java
  21. 71 10
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/entity/EquipmentInspectionPlanEntity.java
  22. 10 1
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/mapper/EquipmentInspectionPlanMapper.xml
  23. 210 199
      src/main/java/org/springblade/modules/business/equipment/inspection/report/controller/EquipmentInspectionReportController.java
  24. 13 0
      src/main/java/org/springblade/modules/business/equipment/inspection/report/entity/EquipmentInspectionReportEntity.java
  25. 8 0
      src/main/java/org/springblade/modules/business/equipment/inspection/report/mapper/EquipmentInspectionReportMapper.xml
  26. 14 2
      src/main/java/org/springblade/modules/business/equipment/inspection/report/vo/EquipmentInspectionReportVO.java
  27. 1 1
      src/main/java/org/springblade/mq/kafka/constant/KafkaConstant.java
  28. 120 0
      src/main/java/org/springblade/task/InspectionPlanCheckTask.java
  29. 20 0
      src/main/java/org/springblade/task/TaskManager.java
  30. 32 0
      src/main/java/org/springblade/test/DataPack.java
  31. 39 0
      src/main/java/org/springblade/test/DataPackHeader.java
  32. 53 0
      src/main/java/org/springblade/test/DataPoint.java

+ 108 - 0
src/main/java/org/springblade/enums/InspectionStatusEnum.java

@@ -0,0 +1,108 @@
+package org.springblade.enums;
+
+public enum InspectionStatusEnum {
+	/**
+	 * 待巡检
+	 */
+	STATUS_TODO(0, "待巡检"),
+
+	/**
+	 * 已巡检
+	 */
+	STATUS_REPORT(1, "已巡检"),
+
+	/**
+	 * 待完结审批
+	 */
+	STATUS_CLOSE_APPROVE(2, "待完结审批"),
+
+	/**
+	 * 完结已审批
+	 */
+	STATUS_APPROVED(3, "完结已审批"),
+
+	/**
+	 * 退回
+	 */
+	STATUS_BACK(4, "退回");
+
+
+
+	private int code;
+
+	private String name;
+
+	private InspectionStatusEnum(int code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(int code) {
+		for (InspectionStatusEnum type : InspectionStatusEnum.values()) {
+			if (type.code == code) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static InspectionStatusEnum getEnumByCode(int code) {
+		for (InspectionStatusEnum type : InspectionStatusEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static InspectionStatusEnum getEnumByName(String name) {
+		for (InspectionStatusEnum type : InspectionStatusEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 1 - 1
src/main/java/org/springblade/enums/OrderConfirmEnum.java

@@ -4,7 +4,7 @@ public enum OrderConfirmEnum {
 	/**
 	 * 正常
 	 */
-	ACTIVE_CREATE(0, "正常"),
+	ACTIVE_CREATE(0, "未确认"),
 
 	/**
 	 * 确认

+ 32 - 0
src/main/java/org/springblade/modules/baseinfo/servicePerson/controller/ServicePersonController.java

@@ -73,6 +73,38 @@ public class ServicePersonController extends BladeController {
     private final IUserDeptService userDeptService;
     private final IPostService postService;
 
+    /**
+     * 巡检保养工单系统
+     * @param dto
+     * @param query
+     * @return
+     */
+    @GetMapping("/xjgd/org/user/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "personName", value = "人员名称", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "contactPhone", value = "联系电话", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "deptId", value = "机构部门ID", paramType = "query", dataType = "long"),
+    })
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "分页")
+    public R<IPage<ServicePersonVO>> xjgdServciePersonPage(@ApiIgnore ServicePersonDTO dto, Query query) {
+        BladeUser user = AuthUtil.getUser();
+        if (Func.isNull(dto.getTenantId())) {
+            dto.setTenantId(user.getTenantId());
+        }
+        if (Func.isNull(dto.getDeptId())) {
+            dto.setDeptId(Func.toLong(user.getDeptId()));
+        }
+        IPage<ServicePersonVO> pages = servicePersonService.selectServicePersonPage(Condition.getPage(query), dto);
+        List<ServicePersonVO> list = pages.getRecords();
+        for (ServicePersonVO vo : list) {
+            ServicePersonWrapper.build().entityVO(vo);
+        }
+        return R.data(pages);
+    }
+
+
+
     @GetMapping("/org/user/page")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "personName", value = "人员名称", paramType = "query", dataType = "string"),

+ 4 - 1
src/main/java/org/springblade/modules/baseinfo/servicePerson/mapper/ServicePersonMapper.xml

@@ -67,7 +67,10 @@
         LEFT JOIN blade_post p ON u.post_id = p.id and p.is_deleted = 0
         LEFT JOIN blade_dict dict ON dict.code ='post_category' and dict.dict_key=p.category and dict.is_deleted = 0
         WHERE
-        u.tenant_id = #{dto.tenantId} and u.is_deleted = 0 and u.id != #{dto.id}
+        u.tenant_id = #{dto.tenantId} and u.is_deleted = 0
+        <if test="dto.id!=null">
+            and u.id != #{dto.id}
+        </if>
         <if test="dto.personName!=null">
             and u.real_name like concat(concat('%', #{dto.personName}), '%')
         </if>

+ 72 - 11
src/main/java/org/springblade/modules/business/check/order/controller/RtuCheckOrderController.java

@@ -155,6 +155,19 @@ public class RtuCheckOrderController extends BladeController {
         return R.data(pages);
     }
 
+    @GetMapping("/todo/confirm/list")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页", notes = "传入实体类CheckOrderInfoDTO")
+    public R<List<CheckOrderInfoVO>> todoConfirmList(@ApiIgnore CheckOrderInfoDTO checkOrderInfoDTO) {
+        DictInfoEntity dictInfoEntity = baseInfoDictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_CREATE.getCode());
+        checkOrderInfoDTO.setOrderStatusKey(dictInfoEntity.getId());
+        List<CheckOrderInfoVO> list = rtuCheckOrderService.selectTodoList(checkOrderInfoDTO);
+        for (CheckOrderInfoVO v : list) {
+            RtuCheckOrderWrapper.build().entityVO(v);
+        }
+        return R.data(list);
+    }
+
     /**
      * 新的工单
      *
@@ -361,6 +374,45 @@ public class RtuCheckOrderController extends BladeController {
         return R.status(true);
     }
 
+
+    @PostMapping("/xjgd/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增", notes = "传入实体类CheckOrderInfoEntity")
+    public R xjgdSave(@RequestBody CheckOrderInfoDTO checkOrderInfoEntity) {
+        if (Func.isNull(checkOrderInfoEntity.getBatchId())) {
+            return R.fail("参数错误");
+        }
+        LambdaQueryWrapper<CheckOrderInfoEntity> wrapper = Wrappers.<CheckOrderInfoEntity>query().lambda();
+        wrapper.eq(CheckOrderInfoEntity::getBatchId, checkOrderInfoEntity.getBatchId());
+        wrapper.last("limit 1");
+        long count = rtuCheckOrderService.count(wrapper);
+        if (count == 0) {
+            if (Func.notNull(checkOrderInfoEntity.getTaskOwnerId())){
+                DictInfoEntity dictInfoEntity = baseInfoDictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_CONFIRM.getCode());
+                checkOrderInfoEntity.setOrderStatusKey(dictInfoEntity.getId());
+                checkOrderInfoEntity.setOrderConfirmUser(checkOrderInfoEntity.getTaskOwnerId());
+                checkOrderInfoEntity.setOrderConfirm(1);
+                checkOrderInfoEntity.setOrderConfirmTime(new Date());
+                checkOrderInfoEntity.setContactUser(checkOrderInfoEntity.getTaskOwnerId());
+            }else{
+                DictInfoEntity dictInfoEntity = baseInfoDictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_CREATE.getCode());
+                checkOrderInfoEntity.setOrderStatusKey(dictInfoEntity.getId());
+            }
+            checkOrderInfoEntity.setOrderType(1);
+            rtuCheckOrderService.save(checkOrderInfoEntity);
+            OrderProcessInfoEntity processInfoEntity = new OrderProcessInfoEntity();
+            processInfoEntity.setOrderId(checkOrderInfoEntity.getId());
+            processInfoEntity.setOrderStatusKey(checkOrderInfoEntity.getOrderStatusKey());
+            processInfoEntity.setProcessDesc(checkOrderInfoEntity.getOrderDesc());
+            processInfoEntity.setFailureProcessPhotos(checkOrderInfoEntity.getOrderPhotos());
+            processInfoEntity.setFailureProcessVideos(checkOrderInfoEntity.getOrderVideos());
+            rtuOrderProcessService.save(processInfoEntity);
+            checkOrderInfoEntity.setOrderProcessId(processInfoEntity.getId());
+            rtuCheckOrderService.updateById(checkOrderInfoEntity);
+        }
+        return R.status(true);
+    }
+
     /**
      * 修改
      */
@@ -572,26 +624,35 @@ public class RtuCheckOrderController extends BladeController {
     @ApiOperation(value = "工单确认", notes = "传入实体类CheckOrderInfoEntity")
     public R orderConfirm(@RequestBody CheckOrderInfoEntity checkOrderInfoEntity) {
         DictInfoEntity dictInfoEntity = baseInfoDictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_CONFIRM.getCode());
+
+        OrderProcessInfoEntity processInfoEntity = new OrderProcessInfoEntity();
+        processInfoEntity.setOrderId(checkOrderInfoEntity.getId());
+        processInfoEntity.setOrderStatusKey(dictInfoEntity.getId());
+        //processInfoEntity.setProcessDesc("维修任务由[" + userInfo.getRealName() + "]确认");
+        rtuOrderProcessService.save(processInfoEntity);
+
         checkOrderInfoEntity.setOrderStatusKey(dictInfoEntity.getId());
         BladeUser user = AuthUtil.getUser();
-        User userInfo = userService.getById(user.getUserId());
+        //User userInfo = userService.getById(user.getUserId());
         CheckOrderInfoEntity detail = this.rtuCheckOrderService.getById(checkOrderInfoEntity.getId());
-        if (null == detail || null != detail.getOrderConfirmUser()) {
+        if (Func.isNull(detail)) {
             return R.status(false);
         }
         detail.setOrderConfirm(OrderConfirmEnum.ACTIVE_CONFIRM.getCode());
-        detail.setOrderStatusKey(checkOrderInfoEntity.getOrderStatusKey());
+        detail.setOrderStatusKey(dictInfoEntity.getId());
         detail.setOrderConfirmUser(user.getUserId());
         detail.setOrderConfirmTime(new Date());
-        detail.setUpdateTime(new Date());
-        detail.setContactUser(userInfo.getId());
-        detail.setContactPhone(userInfo.getPhone());
+        detail.setOrderProcessId(processInfoEntity.getId());
+//        detail.setUpdateTime(new Date());
+//        detail.setContactUser(userInfo.getId());
+//        detail.setContactPhone(userInfo.getPhone());
         rtuCheckOrderService.updateById(detail);
-        OrderProcessInfoEntity processInfoEntity = new OrderProcessInfoEntity();
-        processInfoEntity.setOrderId(checkOrderInfoEntity.getId());
-        processInfoEntity.setOrderStatusKey(checkOrderInfoEntity.getOrderStatusKey());
-        processInfoEntity.setProcessDesc("维修任务由[" + userInfo.getRealName() + "]确认");
-        return R.status(rtuOrderProcessService.save(processInfoEntity));
+
+//        OrderProcessInfoEntity processInfoEntity = new OrderProcessInfoEntity();
+//        processInfoEntity.setOrderId(checkOrderInfoEntity.getId());
+//        processInfoEntity.setOrderStatusKey(checkOrderInfoEntity.getOrderStatusKey());
+//        processInfoEntity.setProcessDesc("维修任务由[" + userInfo.getRealName() + "]确认");
+        return R.status(true);
     }
 
     @PostMapping("/manually")

+ 13 - 0
src/main/java/org/springblade/modules/business/check/order/dto/CheckOrderInfoDTO.java

@@ -78,4 +78,17 @@ public class CheckOrderInfoDTO extends CheckOrderInfoEntity {
 	 */
 	@ApiModelProperty(value = "工单状态")
 	private Integer orderStatusOption;
+
+	/**
+	 * 指定任务负责人ID
+	 */
+	@ApiModelProperty(value = "指定任务负责人ID")
+	private Long taskOwnerId;
+
+	/**
+	 * 指定任务负责人名称
+	 */
+	@ApiModelProperty(value = "指定任务负责人名称")
+	private String taskOwnerName;
+
 }

+ 21 - 0
src/main/java/org/springblade/modules/business/check/order/entity/CheckOrderInfoEntity.java

@@ -143,4 +143,25 @@ public class CheckOrderInfoEntity extends BaseEntity {
 	 */
 	@ApiModelProperty("工单评分")
 	private Integer orderRate;
+
+	@ApiModelProperty(value = "工单完成时限时间")
+	@DateTimeFormat(
+			pattern = "yyyy-MM-dd"
+	)
+	@JsonFormat(
+			pattern = "yyyy-MM-dd",
+			timezone = "GMT+8"
+	)
+	private Date orderCompleteTime;
+
+
+	@ApiModelProperty(value = "经度")
+	private String longitude;
+
+	@ApiModelProperty(value = "纬度")
+	private String latitude;
+
+	@ApiModelProperty(value = "地址")
+	private String address;
+
 }

+ 8 - 2
src/main/java/org/springblade/modules/business/check/order/mapper/RtuCheckOrderMapper.xml

@@ -22,8 +22,10 @@
         <result column="order_videos" property="orderVideos"/>
         <result column="batch_id" property="batchId"/>
         <result column="order_rate" property="orderRate"/>
-
-
+        <result column="order_complete_time" property="orderCompleteTime"/>
+        <result column="longitude" property="longitude"/>
+        <result column="latitude" property="latitude"/>
+        <result column="address" property="address"/>
     </resultMap>
 
     <!-- 通用查询映射结果 -->
@@ -61,6 +63,10 @@
         <result column="order_videos" property="orderVideos"/>
         <result column="batch_id" property="batchId"/>
         <result column="order_rate" property="orderRate"/>
+        <result column="order_complete_time" property="orderCompleteTime"/>
+        <result column="longitude" property="longitude"/>
+        <result column="latitude" property="latitude"/>
+        <result column="address" property="address"/>
     </resultMap>
 
     <resultMap id="checkOrderCountVOResultMap" type="org.springblade.modules.business.check.order.vo.CheckOrderCountVO">

+ 10 - 1
src/main/java/org/springblade/modules/business/check/order/vo/CheckOrderInfoVO.java

@@ -84,13 +84,22 @@ public class CheckOrderInfoVO extends CheckOrderInfoEntity {
 	@ApiModelProperty(value = "工单发起人名称")
 	private String createOrderPersonName;
 
+	/**
+	 * 工单确认人名称
+	 */
+	@ApiModelProperty(value = "工单确认人名称")
+	private String orderConfirmName;
+
 	/**
 	 * 处理人名称
 	 */
 	@ApiModelProperty(value = "处理人")
 	private String processorName;
 
-	@ApiModelProperty(value = "工单确认时间")
+	/**
+	 * 工单处理时间
+	 */
+	@ApiModelProperty(value = "工单处理时间")
 	@DateTimeFormat(
 			pattern = "yyyy-MM-dd HH:mm:ss"
 	)

+ 5 - 0
src/main/java/org/springblade/modules/business/check/order/wrapper/RtuCheckOrderWrapper.java

@@ -161,6 +161,11 @@ public class RtuCheckOrderWrapper extends BaseEntityWrapper<CheckOrderInfoEntity
             vo.setOrderVideoList(videoList);
         }
 
+        if (Func.notNull(vo.getOrderConfirmUser())){
+            User user = getUserService().getById(vo.getOrderConfirmUser());
+            vo.setOrderConfirmName(user.getRealName());
+        }
+
         return vo;
     }
 

+ 28 - 0
src/main/java/org/springblade/modules/business/check/process/controller/RtuOrderProcessController.java

@@ -247,6 +247,34 @@ public class RtuOrderProcessController extends BladeController {
         return R.status(true);
     }
 
+    /**
+     * 巡查保养工单系统
+     *
+     * @param orderProcessInfoEntity
+     * @return
+     */
+    @PostMapping("/xjgd/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增", notes = "传入orderProcessInfoEntity")
+    public R xjgdSave(@RequestBody OrderProcessInfoEntity orderProcessInfoEntity) {
+
+        DictInfoEntity dictInfoEntity = dictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_PROCESS.getCode());
+        orderProcessInfoEntity.setOrderStatusKey(dictInfoEntity.getId());
+        rtuOrderProcessService.save(orderProcessInfoEntity);
+
+        CheckOrderInfoEntity checkOrderInfoEntity = checkOrderService.getById(orderProcessInfoEntity.getOrderId());
+        checkOrderInfoEntity.setOrderProcessId(orderProcessInfoEntity.getId());
+        // if (orderProcessInfoEntity.getCostsReport() == 1) {
+        dictInfoEntity = dictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_CLOSE_PENDING_APPROVE.getCode());
+        checkOrderInfoEntity.setOrderStatusKey(dictInfoEntity.getId());
+//        } else {
+//            dictInfoEntity = dictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_COSTS_PENDING_APPROVE.getCode());
+//            checkOrderInfoEntity.setOrderStatusKey(dictInfoEntity.getId());
+//        }
+        checkOrderService.updateById(checkOrderInfoEntity);
+        return R.status(true);
+    }
+
     /**
      * 修改
      */

+ 887 - 830
src/main/java/org/springblade/modules/business/equipment/inspection/base/controller/EquipmentInspectionController.java

@@ -26,6 +26,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.enums.InspectionStatusEnum;
 import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
 import org.springblade.modules.baseinfo.org.service.IDeptRegionService;
 import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
@@ -51,6 +52,7 @@ import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
 import javax.annotation.Resource;
+import javax.jnlp.UnavailableServiceException;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -69,834 +71,889 @@ import java.util.*;
 @RequiredArgsConstructor
 @Api(value = "设备巡检管理模块", tags = "设备巡检管理模块")
 public class EquipmentInspectionController extends BladeController {
-	private final IEquipmentInspectionService equipmentInspectionService;
-	private final IEquipmentInspectionPlanService planService;
-	private final IDeptService deptService;
-	private final IRtuBaseInfoService rtuBaseInfoService;
-	private final IDeptRegionService deptRegionService;
-	private final IEquipmentInspectionReportService inspectionReportService;
-	private final IUserService userService;
-
-	@Resource
-	private OssBuilder ossBuilder;
-
-	@Value("${export-config.workdir}")
-	private String workDir;
-
-	@Value("${export-config.inspection-unfinished-template}")
-	private String inspectionUnfinishedTemplate;
-
-	/**
-	 * 全部列表
-	 */
-	@GetMapping("/list")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "全部列表,不分页")
-	public R<List<EquipmentInspectionInfoVO>> list() {
-		List<EquipmentInspectionInfoEntity> pages = equipmentInspectionService.list();
-		return R.data(EquipmentInspectionWrapper.build().listVO(pages));
-	}
-
-
-	@GetMapping("/page")
-	@ApiImplicitParams({
-		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
-	})
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "分页", notes = "传入 EquipmentInspectionInfoDTO 实体类")
-	public R<IPage<EquipmentInspectionInfoVO>> page(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO, Query query) {
-		BladeUser user = AuthUtil.getUser();
-		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
-			if (inspectionInfoDTO.getAdCode() == null) {
-				inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
-			}
-		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
-			if (inspectionInfoDTO.getAdCode() == null) {
-				LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
-				deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
-				deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
-				DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
-				inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
-			}
-		}
-		IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectPage(Condition.getPage(query), inspectionInfoDTO);
-		return R.data(pages);
-	}
-
-
-	@GetMapping("/rain/page")
-	@ApiImplicitParams({
-		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "rainSeasonKind", value = "汛期类型", paramType = "query", dataType = "int"),
-		@ApiImplicitParam(name = "servicePersonId", value = "运维人员", paramType = "query", dataType = "long"),
-		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long")
-	})
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "分页", notes = "传入 EquipmentInspectionInfoDTO 实体类")
-	public R<IPage<EquipmentInspectionInfoVO>> rainpage(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO, Query query) {
-		BladeUser user = AuthUtil.getUser();
-		if (inspectionInfoDTO.getDeptId() != null) {
-			LambdaQueryWrapper<DeptRegionEntity> deptLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
-			deptLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
-			deptLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, inspectionInfoDTO.getDeptId());
-			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptLambdaQueryWrapper);
-			inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
-		} else {
-			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
-				if (inspectionInfoDTO.getAdCode() == null) {
-					inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
-				}
-			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
-				if (inspectionInfoDTO.getAdCode() == null) {
-					LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
-					deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
-					deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
-					DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
-					inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
-				}
-			}
-		}
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(new Date());
-		calendar.set(Calendar.MONTH, 0);
-		calendar.set(Calendar.DAY_OF_MONTH, 1);
-		calendar.set(Calendar.HOUR_OF_DAY, 0);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
-		calendar.add(Calendar.YEAR, 1);
-		inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
-
-		if (inspectionInfoDTO.getRainSeasonKind() != null) {
-			if (inspectionInfoDTO.getRainSeasonKind() == 1) {
-				inspectionInfoDTO.setBeforeRainSeasonStatus(1);
-				inspectionInfoDTO.setBeforeRainSeasonReportUser(inspectionInfoDTO.getServicePersonId());
-			} else if (inspectionInfoDTO.getRainSeasonKind() == 2) {
-				inspectionInfoDTO.setRainSeasonFirstStatus(1);
-				inspectionInfoDTO.setRainSeasonFirstReportUser(inspectionInfoDTO.getServicePersonId());
-			} else if (inspectionInfoDTO.getRainSeasonKind() == 3) {
-				inspectionInfoDTO.setRainSeasonSecondStatus(1);
-				inspectionInfoDTO.setRainSeasonSecondReportUser(inspectionInfoDTO.getServicePersonId());
-			}
-		}
-
-		IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectPage(Condition.getPage(query), inspectionInfoDTO);
-		return R.data(pages);
-	}
-
-	@GetMapping("/rtu/page")
-	@ApiImplicitParams({
-		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
-	})
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "当前汛期待巡检设备", notes = "传入 EquipmentInspectionInfoDTO 实体类")
-	public R<IPage<EquipmentInspectionInfoVO>> rtuPage(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO, Query query) {
-		BladeUser user = AuthUtil.getUser();
-		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
-			if (inspectionInfoDTO.getAdCode() == null) {
-				inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
-			}
-		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
-			if (inspectionInfoDTO.getAdCode() == null) {
-				LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
-				deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
-				deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
-				DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
-				inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
-			}
-		}
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(new Date());
-		calendar.set(Calendar.MONTH, 0);
-		calendar.set(Calendar.DAY_OF_MONTH, 1);
-		calendar.set(Calendar.HOUR_OF_DAY, 0);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
-		calendar.add(Calendar.YEAR, 1);
-		inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
-		EquipmentInspectionPlanEntity planEntity = planService.getPlanInfo();
-		calendar.setTime(new Date());
-		Date dt = calendar.getTime();
-		if ((dt.getTime() / 1000 == planEntity.getBeforeRainSeasonEndTime().getTime() / 1000 || dt.after(planEntity.getBeforeRainSeasonStartTime())) && dt.before(planEntity.getBeforeRainSeasonEndTime())) {
-			inspectionInfoDTO.setBeforeRainSeasonStatus(1);
-		} else if ((dt.getTime() / 1000 == planEntity.getBeforeRainSeasonEndTime().getTime() / 1000 || dt.after(planEntity.getRainSeasonFirstStartTime())) && dt.before(planEntity.getRainSeasonFirstEndTime())) {
-			inspectionInfoDTO.setRainSeasonFirstStatus(1);
-		} else if ((dt.getTime() / 1000 == planEntity.getBeforeRainSeasonEndTime().getTime() / 1000 || dt.after(planEntity.getRainSeasonSecondStartTime())) && dt.before(planEntity.getRainSeasonSecondEndTime())) {
-			inspectionInfoDTO.setRainSeasonSecondStatus(1);
-		}
-		IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectRtuPage(Condition.getPage(query), inspectionInfoDTO);
-		List<EquipmentInspectionInfoVO> list = pages.getRecords();
-		for (EquipmentInspectionInfoVO vo : list) {
-			LambdaQueryWrapper<EquipmentInspectionInfoEntity> wrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
-			wrapper.eq(EquipmentInspectionInfoEntity::getIsDeleted, 0);
-			wrapper.ge(EquipmentInspectionInfoEntity::getInspectionDate, inspectionInfoDTO.getInspectionYearStartDate());
-			wrapper.lt(EquipmentInspectionInfoEntity::getInspectionDate, inspectionInfoDTO.getInspectionYearStartDate());
-
-		}
-		return R.data(pages);
-	}
-
-	/**
-	 * 统计本年度巡检设备数量、各汛期巡检设备数量
-	 *
-	 * @param inspectionInfoDTO
-	 * @return
-	 */
-	@GetMapping("/count")
-	@ApiImplicitParams({
-		@ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
-	})
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "已巡检上报设备数量")
-	public R<Map<String, Object>> inspectionReportCount(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO) {
-		BladeUser user = AuthUtil.getUser();
-		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
-			if (inspectionInfoDTO.getAdCode() == null) {
-				inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
-			}
-		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
-			if (inspectionInfoDTO.getAdCode() == null) {
-				LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
-				deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
-				deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
-				DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
-				inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
-			}
-		}
-
-		Map<String, Object> data = new HashMap<>();
-
-		long count = rtuBaseInfoService.rtuCount(inspectionInfoDTO.getAdCode());
-		data.put("rtus", count);
-		long rtus = count;
-		int rainKind = 0;
-		long remaininspectionrtus = 0;
-		EquipmentInspectionPlanEntity planEntity = planService.getPlanInfo();
-
-		Date dt = new Date();
-		if (dt.after(planEntity.getBeforeRainSeasonStartTime()) && dt.before(planEntity.getBeforeRainSeasonEndTime())) {
-			rainKind = 1;
-		} else if (dt.after(planEntity.getRainSeasonFirstStartTime()) && dt.before(planEntity.getRainSeasonFirstEndTime())) {
-			rainKind = 2;
-		} else if (dt.after(planEntity.getRainSeasonSecondStartTime()) && dt.before(planEntity.getRainSeasonSecondEndTime())) {
-			rainKind = 3;
-		}
-		data.put("rainKind", rainKind);
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(new Date());
-		calendar.set(Calendar.MONTH, 0);
-		calendar.set(Calendar.DAY_OF_MONTH, 1);
-		calendar.set(Calendar.HOUR_OF_DAY, 0);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
-		calendar.add(Calendar.YEAR, 1);
-		inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
-
-		count = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
-		data.put("inspectionCount", count);
-
-		EquipmentInspectionReportDTO inspectionReportDTO = new EquipmentInspectionReportDTO();
-		calendar.setTime(new Date());
-		calendar.set(Calendar.MONTH, 0);
-		calendar.set(Calendar.DAY_OF_MONTH, 1);
-		calendar.set(Calendar.HOUR_OF_DAY, 0);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		inspectionReportDTO.setInspectionYearStartDate(calendar.getTime());
-		calendar.add(Calendar.YEAR, 1);
-		inspectionReportDTO.setInspectionYearEndDate(calendar.getTime());
-
-
-		inspectionReportDTO.setRainSeasonKind(1);
-		count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
-		data.put("beforeRainInspectionCount", count);
-		if (rainKind == 1) {
-			remaininspectionrtus = rtus - count;
-		}
-
-		inspectionReportDTO.setRainSeasonKind(2);
-		count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
-		data.put("firstRainInspectionCount", count);
-		if (rainKind == 2) {
-			remaininspectionrtus = rtus - count;
-		}
-		inspectionReportDTO.setRainSeasonKind(3);
-		count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
-		data.put("sencodRainInspectionCount", count);
-		if (rainKind == 3) {
-			remaininspectionrtus = rtus - count;
-		}
-		data.put("remaininspectionrtus", remaininspectionrtus);
-
-		return R.data(data);
-	}
-
-	/**
-	 * 填报状态
-	 */
-	@GetMapping("/reportStatus")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入实体类EquipmentInspectionInfoEntity")
-	public R<EquipmentInspectionInfoVO> getReportStatus(EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
-		if (null == equipmentInspectionInfoEntity.getId()) {
-			return R.fail("参数错误");
-		}
-		EquipmentInspectionInfoEntity detail = equipmentInspectionService.getById(equipmentInspectionInfoEntity.getId());
-		return R.data(EquipmentInspectionWrapper.build().entityVO(detail));
-	}
-
-	/**
-	 * 填报状态
-	 */
-	@GetMapping("/rtu/reportStatus")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入实体类EquipmentInspectionInfoEntity")
-	public R<EquipmentInspectionInfoVO> getRtuReportStatus(EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
-		if (null == equipmentInspectionInfoEntity.getRtuCode()) {
-			return R.fail("参数错误");
-		}
-		LambdaQueryWrapper<EquipmentInspectionInfoEntity> wrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
-		wrapper.eq(EquipmentInspectionInfoEntity::getIsDeleted, 0);
-		wrapper.eq(EquipmentInspectionInfoEntity::getRtuCode, equipmentInspectionInfoEntity.getRtuCode());
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(new Date());
-		calendar.set(Calendar.MONTH, 0);
-		calendar.set(Calendar.DAY_OF_MONTH, 1);
-		calendar.set(Calendar.HOUR_OF_DAY, 0);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		calendar.set(Calendar.MILLISECOND, 0);
-		wrapper.ge(EquipmentInspectionInfoEntity::getInspectionDate, calendar.getTime());
-		calendar.add(Calendar.YEAR, 1);
-		wrapper.lt(EquipmentInspectionInfoEntity::getInspectionDate, calendar.getTime());
-		EquipmentInspectionInfoEntity detail = equipmentInspectionService.getOne(wrapper);
-		if (null == detail) {
-			detail = new EquipmentInspectionInfoEntity();
-			detail.setBeforeRainSeasonStatus(0);
-			detail.setRainSeasonFirstStatus(0);
-			detail.setRainSeasonSecondStatus(0);
-		}
-		return R.data(EquipmentInspectionWrapper.build().entityVO(detail));
-	}
-
-	/**
-	 * 详情
-	 */
-	@GetMapping("/detail")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入实体类EquipmentInspectionInfoEntity")
-	public R<EquipmentInspectionInfoVO> detail(EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
-		if (null == equipmentInspectionInfoEntity.getId()) {
-			return R.fail("参数错误");
-		}
-		EquipmentInspectionInfoEntity detail = equipmentInspectionService.getOne(Condition.getQueryWrapper(equipmentInspectionInfoEntity));
-		return R.data(EquipmentInspectionWrapper.build().entityVO(detail));
-	}
-
-	/**
-	 * 新增
-	 */
-	@PostMapping("/save")
-	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "新增", notes = "传入orderProcessInfoEntity")
-	public R save(@RequestBody EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
-		return R.status(equipmentInspectionService.save(equipmentInspectionInfoEntity));
-	}
-
-	/**
-	 * 修改
-	 */
-	@PostMapping("/update")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "修改", notes = "传入orderProcessInfoEntity")
-	public R update(@RequestBody EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
-		return R.status(equipmentInspectionService.updateById(equipmentInspectionInfoEntity));
-	}
-
-	/**
-	 * 新增或修改
-	 */
-	@PostMapping("/submit")
-	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "新增或修改", notes = "传入orderProcessInfoEntity")
-	public R submit(@RequestBody EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
-		return R.status(equipmentInspectionService.saveOrUpdate(equipmentInspectionInfoEntity));
-	}
-
-	/**
-	 * 删除
-	 */
-	@PostMapping("/remove")
-	@ApiOperationSupport(order = 7)
-	@ApiOperation(value = "逻辑删除", notes = "传入projectInfoEntity")
-	public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
-		boolean temp = equipmentInspectionService.deleteLogic(Func.toLongList(ids));
-		return R.status(temp);
-	}
-
-	/**
-	 * 巡检统计
-	 *
-	 * @return
-	 */
-	@GetMapping("/person/statistics")
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "统计表格")
-	public R<List<EquipmentInspectionStatisticsVO>> inspectionStatistics() {
-		BladeUser user = AuthUtil.getUser();
-		LambdaQueryWrapper<User> userQueryWrapper = Wrappers.<User>query().lambda();
-		userQueryWrapper.eq(User::getIsDeleted, 0);
-		userQueryWrapper.eq(User::getDeptId, Func.toLong(user.getDeptId()));
-		List<User> list = userService.list(userQueryWrapper);
-		List<EquipmentInspectionStatisticsVO> countList = new LinkedList<>();
-		for (User u : list) {
-			EquipmentInspectionStatisticsVO vo = new EquipmentInspectionStatisticsVO();
-			vo.setUserId(u.getId());
-			vo.setServicePersonName(u.getRealName());
-			EquipmentInspectionInfoDTO inspectionInfoDTO = new EquipmentInspectionInfoDTO();
-			Calendar calendar = Calendar.getInstance();
-			calendar.setTime(new Date());
-			calendar.setTime(new Date());
-			calendar.set(Calendar.MONTH, 0);
-			calendar.set(Calendar.DAY_OF_MONTH, 1);
-			calendar.set(Calendar.HOUR_OF_DAY, 0);
-			calendar.set(Calendar.MINUTE, 0);
-			calendar.set(Calendar.SECOND, 0);
-			inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
-			calendar.add(Calendar.YEAR, 1);
-			inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
-			inspectionInfoDTO.setBeforeRainSeasonReportUser(u.getId());
-			long count = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
-			vo.setBeforeRainInspectionCount(count);
-			inspectionInfoDTO.setBeforeRainSeasonReportUser(null);
-			inspectionInfoDTO.setRainSeasonFirstReportUser(u.getId());
-			count = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
-			vo.setFirstRainInspectionCount(count);
-			inspectionInfoDTO.setRainSeasonFirstReportUser(null);
-			inspectionInfoDTO.setRainSeasonSecondReportUser(u.getId());
-			count = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
-			vo.setSencodRainInspectionCount(count);
-			countList.add(vo);
-		}
-		return R.data(countList);
-	}
-
-	/**
-	 * 巡检统计
-	 *
-	 * @return
-	 */
-	@GetMapping("/org/statistics")
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "统计表格")
-	public R<List<OrgEquipmentInspectionStatisticsVO>> orgInspectionStatistics() {
-		BladeUser user = AuthUtil.getUser();
-		List<Dept> root = new LinkedList<>();
-		List<OrgEquipmentInspectionStatisticsVO> list = new LinkedList<>();
-		if (BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
-			Dept dept = deptService.getById(Func.toLong(user.getDeptId()));
-			root.add(dept);
-		} else {
-			LambdaQueryWrapper<Dept> wrapper = Wrappers.<Dept>query().lambda();
-			wrapper.eq(Dept::getIsDeleted, 0);
-			wrapper.eq(Dept::getParentId, Func.toLong(user.getDeptId()));
-			root = this.deptService.list(wrapper);
-		}
-
-		for (Dept dept : root) {
-			OrgEquipmentInspectionStatisticsVO orgEquipmentInspectionStatisticsVO = new OrgEquipmentInspectionStatisticsVO();
-			orgEquipmentInspectionStatisticsVO.setDeptId(dept.getId());
-			orgEquipmentInspectionStatisticsVO.setOrgName(dept.getDeptName());
-			LambdaQueryWrapper<DeptRegionEntity> deptLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
-			deptLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
-			deptLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, dept.getId());
-			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptLambdaQueryWrapper);
-			Long count = rtuBaseInfoService.rtuCount(deptRegionEntity.getAdcd());
-			orgEquipmentInspectionStatisticsVO.setRtuCount(count);
-			EquipmentInspectionInfoDTO inspectionInfoDTO = new EquipmentInspectionInfoDTO();
-			inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
-			Calendar calendar = Calendar.getInstance();
-			calendar.setTime(new Date());
-			calendar.set(Calendar.MONTH, 0);
-			calendar.set(Calendar.DAY_OF_MONTH, 1);
-			calendar.set(Calendar.HOUR_OF_DAY, 0);
-			calendar.set(Calendar.MINUTE, 0);
-			calendar.set(Calendar.SECOND, 0);
-			inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
-			calendar.add(Calendar.YEAR, 1);
-			inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
-			count = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
-			orgEquipmentInspectionStatisticsVO.setInspectionCount(count);
-			EquipmentInspectionReportDTO inspectionReportDTO = new EquipmentInspectionReportDTO();
-			inspectionReportDTO.setAdCode(deptRegionEntity.getAdcd());
-			calendar.setTime(new Date());
-			calendar.set(Calendar.MONTH, 0);
-			calendar.set(Calendar.DAY_OF_MONTH, 1);
-			calendar.set(Calendar.HOUR_OF_DAY, 0);
-			calendar.set(Calendar.MINUTE, 0);
-			calendar.set(Calendar.SECOND, 0);
-			inspectionReportDTO.setInspectionYearStartDate(calendar.getTime());
-			calendar.add(Calendar.YEAR, 1);
-			inspectionReportDTO.setInspectionYearEndDate(calendar.getTime());
-			inspectionReportDTO.setRainSeasonKind(1);
-			count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
-			orgEquipmentInspectionStatisticsVO.setBeforeRainInspectionCount(count);
-			inspectionReportDTO.setRainSeasonKind(2);
-			count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
-			orgEquipmentInspectionStatisticsVO.setFirstRainInspectionCount(count);
-			inspectionReportDTO.setRainSeasonKind(3);
-			count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
-			orgEquipmentInspectionStatisticsVO.setSencodRainInspectionCount(count);
-			list.add(orgEquipmentInspectionStatisticsVO);
-		}
-		return R.data(list);
-	}
-
-	/**
-	 * 未完成巡检设备清单信息列表,分页
-	 */
-	@GetMapping("/unfinished/page")
-	@ApiImplicitParams({
-		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "inspectionYear", value = "巡检年度", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "rainSeasonKind", value = "汛期类型", paramType = "query", dataType = "int"),
-	})
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "未完成巡检设备清单信息列表")
-	public R<IPage<EquipmentInspectionInfoVO>> unfinishedInspectionEquipmentPage(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO, Query query) {
-		BladeUser user = AuthUtil.getUser();
-		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
-			inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
-		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
-			LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
-			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
-			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
-			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
-			inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
-		}
-		Date now = new Date();
-		if (inspectionInfoDTO.getInspectionYear() != null) {
-			Date year = Func.parseDate(inspectionInfoDTO.getInspectionYear(), "yyyy-MM-dd");
-			Calendar calendar = Calendar.getInstance();
-			calendar.setTime(year);
-			calendar.set(Calendar.MONTH, 0);
-			calendar.set(Calendar.DAY_OF_MONTH, 1);
-			calendar.set(Calendar.HOUR_OF_DAY, 0);
-			calendar.set(Calendar.MINUTE, 0);
-			calendar.set(Calendar.SECOND, 0);
-			inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
-			calendar.add(Calendar.YEAR, 1);
-			inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
-		} else {
-			Calendar calendar = Calendar.getInstance();
-			calendar.setTime(new Date());
-			calendar.set(Calendar.MONTH, 0);
-			calendar.set(Calendar.DAY_OF_MONTH, 1);
-			calendar.set(Calendar.HOUR_OF_DAY, 0);
-			calendar.set(Calendar.MINUTE, 0);
-			calendar.set(Calendar.SECOND, 0);
-			inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
-			calendar.add(Calendar.YEAR, 1);
-			inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
-			if (inspectionInfoDTO.getRainSeasonKind() == null) {
-				//处理汛期类别
-				LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
-				wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted, 0);
-				wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
-				List<EquipmentInspectionPlanEntity> list = planService.list(wrapper);
-				if (null != list && list.size() > 0) {
-					EquipmentInspectionPlanEntity entity = list.get(0);
-
-					Calendar dt = Calendar.getInstance();
-					Calendar calendarStart = Calendar.getInstance();
-					Calendar calendarEnd = Calendar.getInstance();
-					dt.setTime(now);
-					//汛前上报
-					calendarStart.setTime(entity.getBeforeRainSeasonStartTime());
-					calendarEnd.setTime(entity.getBeforeRainSeasonEndTime());
-					if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-						inspectionInfoDTO.setRainSeasonKind(1);
-					}
-					//汛中第一次上报
-					calendarStart.setTime(entity.getRainSeasonFirstStartTime());
-					calendarEnd.setTime(entity.getRainSeasonFirstEndTime());
-					if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-						inspectionInfoDTO.setRainSeasonKind(2);
-					}
-					//汛中第二次上报
-					calendarStart.setTime(entity.getRainSeasonSecondStartTime());
-					calendarEnd.setTime(entity.getRainSeasonSecondEndTime());
-					if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-						inspectionInfoDTO.setRainSeasonKind(3);
-					}
-				}
-				//没在当年任意一个汛期,直接返回
-				if (inspectionInfoDTO.getRainSeasonKind() == null) {
-					return R.data(null);
-				}
-			}
-		}
-		IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectUnfinishedInspectionEquipmentPage(Condition.getPage(query), inspectionInfoDTO);
-		List<EquipmentInspectionInfoVO> volist = pages.getRecords();
-		for (EquipmentInspectionInfoVO vo : volist) {
-			EquipmentInspectionWrapper.build().entityVO(vo);
-		}
-		return R.data(pages);
-	}
-
-	/**
-	 * 未完成巡检设备清单信息导出
-	 *
-	 * @return
-	 */
-	@GetMapping("/unfinished/export")
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "未完成巡检设备清单导出", notes = "")
-	public R<Map<String, Object>> unfinishedInspectionEquipmentExport(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO) {
-		BladeUser user = AuthUtil.getUser();
-		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
-			inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
-		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
-			LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
-			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
-			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
-			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
-			inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
-		}
-		//文件标题
-		String title = "";
-		//当前时间
-		Date now = new Date();
-		if (inspectionInfoDTO.getInspectionYear() != null) {
-			Date year = Func.parseDate(inspectionInfoDTO.getInspectionYear(), "yyyy-MM-dd");
-			Calendar calendar = Calendar.getInstance();
-			calendar.setTime(year);
-			calendar.set(Calendar.MONTH, 0);
-			calendar.set(Calendar.DAY_OF_MONTH, 1);
-			calendar.set(Calendar.HOUR_OF_DAY, 0);
-			calendar.set(Calendar.MINUTE, 0);
-			calendar.set(Calendar.SECOND, 0);
-			inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
-			calendar.add(Calendar.YEAR, 1);
-			inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
-			title += Func.formatDate(year) + "年";
-
-		} else {
-			Calendar calendar = Calendar.getInstance();
-			calendar.setTime(now);
-			calendar.set(Calendar.MONTH, 0);
-			calendar.set(Calendar.DAY_OF_MONTH, 1);
-			calendar.set(Calendar.HOUR_OF_DAY, 0);
-			calendar.set(Calendar.MINUTE, 0);
-			calendar.set(Calendar.SECOND, 0);
-			inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
-
-			calendar.add(Calendar.YEAR, 1);
-			inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
-
-			title += Func.formatDate(now) + "年";
-
-			if (inspectionInfoDTO.getRainSeasonKind() == null) {
-				//处理汛期类别
-				LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
-				wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted, 0);
-				wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
-				List<EquipmentInspectionPlanEntity> list = planService.list(wrapper);
-				if (null != list && list.size() > 0) {
-					EquipmentInspectionPlanEntity entity = list.get(0);
-
-					Calendar dt = Calendar.getInstance();
-					Calendar calendarStart = Calendar.getInstance();
-					Calendar calendarEnd = Calendar.getInstance();
-					dt.setTime(now);
-					//汛前上报
-					calendarStart.setTime(entity.getBeforeRainSeasonStartTime());
-					calendarEnd.setTime(entity.getBeforeRainSeasonEndTime());
-					if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-						inspectionInfoDTO.setRainSeasonKind(1);
-						title += "汛前";
-					}
-					//汛中第一次上报
-					calendarStart.setTime(entity.getRainSeasonFirstStartTime());
-					calendarEnd.setTime(entity.getRainSeasonFirstEndTime());
-					if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-						inspectionInfoDTO.setRainSeasonKind(2);
-						title += "汛中第一次";
-					}
-					//汛中第二次上报
-					calendarStart.setTime(entity.getRainSeasonSecondStartTime());
-					calendarEnd.setTime(entity.getRainSeasonSecondEndTime());
-					if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-						inspectionInfoDTO.setRainSeasonKind(3);
-						title += "汛中第二次";
-					}
-				}
-				//没在当年任意一个汛期,直接返回
-				if (inspectionInfoDTO.getRainSeasonKind() == null) {
-					List<UnfinishedInspectionEquipmentExportEntity> unfinishedInspectionEquipmentExportEntities = new LinkedList<>();
-					Map<String, Object> data = this.exportUnfinishedInspectionEquipmentExcel(title, unfinishedInspectionEquipmentExportEntities);
-					return R.data(data);
-				}
-			}
-		}
-		if (inspectionInfoDTO.getRainSeasonKind() != null) {
-			if (inspectionInfoDTO.getRainSeasonKind() == 1) {
-				title += "汛前";
-			} else if (inspectionInfoDTO.getRainSeasonKind() == 2) {
-				title += "汛中第一次";
-			} else if (inspectionInfoDTO.getRainSeasonKind() == 3) {
-				title += "汛中第二次";
-			}
-		}
-		List<EquipmentInspectionInfoVO> equipmentInspectionInfoVOList = equipmentInspectionService.selectUnfinishedInspectionEquipmentList(inspectionInfoDTO);
-		//生成数据
-		List<UnfinishedInspectionEquipmentExportEntity> unfinishedInspectionEquipmentExportEntities = new LinkedList<>();
-		if (null != equipmentInspectionInfoVOList && equipmentInspectionInfoVOList.size() > 0) {
-			int index = 1;
-			for (EquipmentInspectionInfoVO entity : equipmentInspectionInfoVOList) {
-				UnfinishedInspectionEquipmentExportEntity exportEntity = new UnfinishedInspectionEquipmentExportEntity();
-				exportEntity.setIndex(index);
-				if (entity.getAdCity() != null) {
-					exportEntity.setAdCity(entity.getAdCity());
-				} else {
-					exportEntity.setAdCity("");
-				}
-				if (entity.getAdDist() != null) {
-					exportEntity.setAdDist(entity.getAdDist());
-				} else {
-					exportEntity.setAdDist("");
-				}
-				if (entity.getRtuName() != null) {
-					exportEntity.setRtuName(entity.getRtuName());
-				} else {
-					exportEntity.setRtuName("");
-				}
-				exportEntity.setRtuCode(entity.getRtuCode());
-				String rtuKindDesc = "";
-				if (entity.getIsRain() != null && entity.getIsRain() == 1) {
-					rtuKindDesc += "雨量站";
-				}
-				if ((entity.getIsRiver() != null && entity.getIsRiver() == 1) || (entity.getIsRes() != null && entity.getIsRes() == 1)) {
-					if (rtuKindDesc.length() > 0) {
-						rtuKindDesc += "/";
-					}
-					rtuKindDesc += "水位站";
-				}
-				if (entity.getIsGround() != null && entity.getIsGround() == 1) {
-					if (rtuKindDesc.length() > 0) {
-						rtuKindDesc += "/";
-					}
-					rtuKindDesc += "墒情站";
-				}
-				if (entity.getIsVideo() != null && entity.getIsVideo() == 1) {
-					if (rtuKindDesc.length() > 0) {
-						rtuKindDesc += "/";
-					}
-					rtuKindDesc += "视频站";
-				}
-				exportEntity.setRtuKindDesc(rtuKindDesc);
-
-				if (entity.getLng() != null) {
-					exportEntity.setLng(entity.getLng());
-				} else {
-					exportEntity.setLng("");
-				}
-				if (entity.getLat() != null) {
-					exportEntity.setLat(entity.getLat());
-				} else {
-					exportEntity.setLat("");
-				}
-				if (entity.getLocationDesc() != null) {
-					exportEntity.setLocationDesc(entity.getLocationDesc());
-				} else {
-					exportEntity.setLocationDesc("");
-				}
-
-				if (entity.getBeforeRainSeasonStatus() != null) {
-					if (entity.getBeforeRainSeasonStatus() == 0) {
-						exportEntity.setBeforeRainSeasonStatus("");
-					} else if (entity.getBeforeRainSeasonStatus() == 1) {
-						exportEntity.setBeforeRainSeasonStatus("已填报");
-					} else {
-						exportEntity.setBeforeRainSeasonStatus("");
-					}
-				} else {
-					exportEntity.setBeforeRainSeasonStatus("");
-				}
-				if (entity.getRainSeasonFirstStatus() != null) {
-					if (entity.getRainSeasonFirstStatus() == 0) {
-						exportEntity.setRainSeasonFirstStatus("");
-					} else if (entity.getRainSeasonFirstStatus() == 1) {
-						exportEntity.setRainSeasonFirstStatus("已填报");
-					} else {
-						exportEntity.setRainSeasonFirstStatus("");
-					}
-				} else {
-					exportEntity.setRainSeasonFirstStatus("");
-				}
-				if (entity.getRainSeasonSecondStatus() != null) {
-					if (entity.getRainSeasonSecondStatus() == 0) {
-						exportEntity.setRainSeasonSecondStatus("");
-					} else if (entity.getRainSeasonSecondStatus() == 1) {
-						exportEntity.setRainSeasonSecondStatus("已填报");
-					} else {
-						exportEntity.setRainSeasonSecondStatus("");
-					}
-				} else {
-					exportEntity.setRainSeasonSecondStatus("");
-				}
-				unfinishedInspectionEquipmentExportEntities.add(exportEntity);
-				index += 1;
-			}
-		}
-		Map<String, Object> data = this.exportUnfinishedInspectionEquipmentExcel(title, unfinishedInspectionEquipmentExportEntities);
-		return R.data(data);
-	}
-
-	private Map<String, Object> exportUnfinishedInspectionEquipmentExcel(String title, List<UnfinishedInspectionEquipmentExportEntity> list) {
-		//当前时间
-		//Calendar dt = Calendar.getInstance();
-		//dt.setTime(new Date());
-		Map<String, Object> data = new HashMap<>();
-		data.put("status", 0);
-		String templateFilePath = this.workDir + File.separator + this.inspectionUnfinishedTemplate;
-		String outpath = this.workDir + File.separator + Func.formatDate(new Date());
-		File dir = new File(outpath);
-		if (!dir.exists()) {
-			if (!dir.mkdir()) {
-				data.put("error", "目录创建失败");
-				return data;
-			}
-		}
-		String outFileName = Func.randomUUID() + ".xlsx";
-		outpath += File.separator + outFileName;
-		ExcelWriter excelWriter = EasyExcel.write(outpath).withTemplate(templateFilePath).excelType(ExcelTypeEnum.XLSX).build();
-		WriteSheet writeSheet = EasyExcel.writerSheet("信息统计表").build();
-		excelWriter.write(list, writeSheet);
-		excelWriter.finish();
-		try {
-			FileInputStream fileInputStream = new FileInputStream(new File(outpath));
-			BladeFile bladeFile = ossBuilder.template().putFile(outFileName, fileInputStream);
-			String ossPath = bladeFile.getName();
-			//String p = bladeFile.getDomain();
-			data.put("name", ossPath);
-			data.put("url", ossPath);
-			data.put("filename", "未完成巡检设备(" + title + ")统计清单表");
-			data.put("status", 1);
-
-		} catch (FileNotFoundException e) {
-			e.printStackTrace();
-			data.put("error", "导出失败!");
-		}
-		return data;
-	}
+    private final IEquipmentInspectionService equipmentInspectionService;
+    private final IEquipmentInspectionPlanService planService;
+    private final IDeptService deptService;
+    private final IRtuBaseInfoService rtuBaseInfoService;
+    private final IDeptRegionService deptRegionService;
+    private final IEquipmentInspectionReportService inspectionReportService;
+    private final IUserService userService;
+
+    @Resource
+    private OssBuilder ossBuilder;
+
+    @Value("${export-config.workdir}")
+    private String workDir;
+
+    @Value("${export-config.inspection-unfinished-template}")
+    private String inspectionUnfinishedTemplate;
+
+    /**
+     * 全部列表
+     */
+    @GetMapping("/list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "全部列表,不分页")
+    public R<List<EquipmentInspectionInfoVO>> list() {
+        List<EquipmentInspectionInfoEntity> pages = equipmentInspectionService.list();
+        return R.data(EquipmentInspectionWrapper.build().listVO(pages));
+    }
+
+
+    @GetMapping("/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页", notes = "传入 EquipmentInspectionInfoDTO 实体类")
+    public R<IPage<EquipmentInspectionInfoVO>> page(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO, Query query) {
+        BladeUser user = AuthUtil.getUser();
+        if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+            if (inspectionInfoDTO.getAdCode() == null) {
+                inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+            }
+        } else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+            if (inspectionInfoDTO.getAdCode() == null) {
+                LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+                deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+                deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+                DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+                inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+            }
+        }
+        IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectPage(Condition.getPage(query), inspectionInfoDTO);
+        return R.data(pages);
+    }
+
+    /**
+     * 待巡检任务
+     *
+     * @return
+     */
+    @GetMapping("/todo/list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "全部列表,不分页")
+    public R<List<EquipmentInspectionInfoVO>> todoList() {
+        BladeUser user = AuthUtil.getUser();
+        EquipmentInspectionInfoDTO dto = new EquipmentInspectionInfoDTO();
+        dto.setInspectionStatus(InspectionStatusEnum.STATUS_TODO.getCode());
+        dto.setOrgId(Func.toLong(user.getDeptId()));
+//		LambdaQueryWrapper<EquipmentInspectionInfoEntity> wrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
+//		wrapper.eq(EquipmentInspectionInfoEntity::getInspectionStatus, InspectionStatusEnum.STATUS_TODO.getCode());
+//		wrapper.eq(EquipmentInspectionInfoEntity::getOrgId, Func.toLong(user.getDeptId()));
+        List<EquipmentInspectionInfoVO> list = equipmentInspectionService.todoInspectionList(dto);
+        for (EquipmentInspectionInfoVO vo : list) {
+            EquipmentInspectionWrapper.build().entityVO(vo);
+        }
+        return R.data(list);
+    }
+
+    @GetMapping("/close-approve/list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "全部列表,不分页")
+    public R<List<EquipmentInspectionInfoVO>> closeApproveList() {
+        BladeUser user = AuthUtil.getUser();
+        EquipmentInspectionInfoDTO dto = new EquipmentInspectionInfoDTO();
+        dto.setInspectionStatus(InspectionStatusEnum.STATUS_CLOSE_APPROVE.getCode());
+        dto.setOrgId(Func.toLong(user.getDeptId()));
+        List<EquipmentInspectionInfoVO> list = equipmentInspectionService.todoInspectionList(dto);
+        for (EquipmentInspectionInfoVO vo : list) {
+            EquipmentInspectionWrapper.build().entityVO(vo);
+        }
+        return R.data(list);
+    }
+
+    @GetMapping("/approved/list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "全部列表,不分页")
+    public R<List<EquipmentInspectionInfoVO>> approvedList() {
+        BladeUser user = AuthUtil.getUser();
+        EquipmentInspectionInfoDTO dto = new EquipmentInspectionInfoDTO();
+        dto.setInspectionStatus(InspectionStatusEnum.STATUS_APPROVED.getCode());
+        dto.setOrgId(Func.toLong(user.getDeptId()));
+//		LambdaQueryWrapper<EquipmentInspectionInfoEntity> wrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
+//		wrapper.eq(EquipmentInspectionInfoEntity::getInspectionStatus, InspectionStatusEnum.STATUS_TODO.getCode());
+//		wrapper.eq(EquipmentInspectionInfoEntity::getOrgId, Func.toLong(user.getDeptId()));
+        List<EquipmentInspectionInfoVO> list = equipmentInspectionService.todoInspectionList(dto);
+        for (EquipmentInspectionInfoVO vo : list) {
+            EquipmentInspectionWrapper.build().entityVO(vo);
+        }
+        return R.data(list);
+    }
+
+    @GetMapping("/rain/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rainSeasonKind", value = "汛期类型", paramType = "query", dataType = "int"),
+            @ApiImplicitParam(name = "servicePersonId", value = "运维人员", paramType = "query", dataType = "long"),
+            @ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long")
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页", notes = "传入 EquipmentInspectionInfoDTO 实体类")
+    public R<IPage<EquipmentInspectionInfoVO>> rainpage(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO, Query query) {
+        BladeUser user = AuthUtil.getUser();
+        if (inspectionInfoDTO.getDeptId() != null) {
+            LambdaQueryWrapper<DeptRegionEntity> deptLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+            deptLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+            deptLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, inspectionInfoDTO.getDeptId());
+            DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptLambdaQueryWrapper);
+            inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+        } else {
+            if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+                if (inspectionInfoDTO.getAdCode() == null) {
+                    inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+                }
+            } else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+                if (inspectionInfoDTO.getAdCode() == null) {
+                    LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+                    deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+                    deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+                    DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+                    inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+                }
+            }
+        }
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        calendar.set(Calendar.MONTH, 0);
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
+        calendar.add(Calendar.YEAR, 1);
+        inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
+
+        if (inspectionInfoDTO.getRainSeasonKind() != null) {
+            if (inspectionInfoDTO.getRainSeasonKind() == 1) {
+                inspectionInfoDTO.setBeforeRainSeasonStatus(1);
+                inspectionInfoDTO.setBeforeRainSeasonReportUser(inspectionInfoDTO.getServicePersonId());
+            } else if (inspectionInfoDTO.getRainSeasonKind() == 2) {
+                inspectionInfoDTO.setRainSeasonFirstStatus(1);
+                inspectionInfoDTO.setRainSeasonFirstReportUser(inspectionInfoDTO.getServicePersonId());
+            } else if (inspectionInfoDTO.getRainSeasonKind() == 3) {
+                inspectionInfoDTO.setRainSeasonSecondStatus(1);
+                inspectionInfoDTO.setRainSeasonSecondReportUser(inspectionInfoDTO.getServicePersonId());
+            }
+        }
+
+        IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectPage(Condition.getPage(query), inspectionInfoDTO);
+        return R.data(pages);
+    }
+
+    @GetMapping("/rtu/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "当前汛期待巡检设备", notes = "传入 EquipmentInspectionInfoDTO 实体类")
+    public R<IPage<EquipmentInspectionInfoVO>> rtuPage(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO, Query query) {
+        BladeUser user = AuthUtil.getUser();
+        if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+            if (inspectionInfoDTO.getAdCode() == null) {
+                inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+            }
+        } else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+            if (inspectionInfoDTO.getAdCode() == null) {
+                LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+                deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+                deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+                DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+                inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+            }
+        }
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        calendar.set(Calendar.MONTH, 0);
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
+        calendar.add(Calendar.YEAR, 1);
+        inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
+        EquipmentInspectionPlanEntity planEntity = planService.getPlanInfo();
+        calendar.setTime(new Date());
+        Date dt = calendar.getTime();
+        if ((dt.getTime() / 1000 == planEntity.getBeforeRainSeasonEndTime().getTime() / 1000 || dt.after(planEntity.getBeforeRainSeasonStartTime())) && dt.before(planEntity.getBeforeRainSeasonEndTime())) {
+            inspectionInfoDTO.setBeforeRainSeasonStatus(1);
+        } else if ((dt.getTime() / 1000 == planEntity.getBeforeRainSeasonEndTime().getTime() / 1000 || dt.after(planEntity.getRainSeasonFirstStartTime())) && dt.before(planEntity.getRainSeasonFirstEndTime())) {
+            inspectionInfoDTO.setRainSeasonFirstStatus(1);
+        } else if ((dt.getTime() / 1000 == planEntity.getBeforeRainSeasonEndTime().getTime() / 1000 || dt.after(planEntity.getRainSeasonSecondStartTime())) && dt.before(planEntity.getRainSeasonSecondEndTime())) {
+            inspectionInfoDTO.setRainSeasonSecondStatus(1);
+        }
+        IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectRtuPage(Condition.getPage(query), inspectionInfoDTO);
+        List<EquipmentInspectionInfoVO> list = pages.getRecords();
+        for (EquipmentInspectionInfoVO vo : list) {
+            LambdaQueryWrapper<EquipmentInspectionInfoEntity> wrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
+            wrapper.eq(EquipmentInspectionInfoEntity::getIsDeleted, 0);
+            wrapper.ge(EquipmentInspectionInfoEntity::getInspectionDate, inspectionInfoDTO.getInspectionYearStartDate());
+            wrapper.lt(EquipmentInspectionInfoEntity::getInspectionDate, inspectionInfoDTO.getInspectionYearStartDate());
+
+        }
+        return R.data(pages);
+    }
+
+    /**
+     * 统计本年度巡检设备数量、各汛期巡检设备数量
+     *
+     * @param inspectionInfoDTO
+     * @return
+     */
+    @GetMapping("/count")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "已巡检上报设备数量")
+    public R<Map<String, Object>> inspectionReportCount(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO) {
+        BladeUser user = AuthUtil.getUser();
+        if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+            if (inspectionInfoDTO.getAdCode() == null) {
+                inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+            }
+        } else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+            if (inspectionInfoDTO.getAdCode() == null) {
+                LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+                deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+                deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+                DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+                inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+            }
+        }
+
+        Map<String, Object> data = new HashMap<>();
+
+        long count = rtuBaseInfoService.rtuCount(inspectionInfoDTO.getAdCode());
+        data.put("rtus", count);
+        long rtus = count;
+        int rainKind = 0;
+        long remaininspectionrtus = 0;
+        EquipmentInspectionPlanEntity planEntity = planService.getPlanInfo();
+
+        Date dt = new Date();
+        if (dt.after(planEntity.getBeforeRainSeasonStartTime()) && dt.before(planEntity.getBeforeRainSeasonEndTime())) {
+            rainKind = 1;
+        } else if (dt.after(planEntity.getRainSeasonFirstStartTime()) && dt.before(planEntity.getRainSeasonFirstEndTime())) {
+            rainKind = 2;
+        } else if (dt.after(planEntity.getRainSeasonSecondStartTime()) && dt.before(planEntity.getRainSeasonSecondEndTime())) {
+            rainKind = 3;
+        }
+        data.put("rainKind", rainKind);
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        calendar.set(Calendar.MONTH, 0);
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
+        calendar.add(Calendar.YEAR, 1);
+        inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
+
+        count = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
+        data.put("inspectionCount", count);
+
+        EquipmentInspectionReportDTO inspectionReportDTO = new EquipmentInspectionReportDTO();
+        calendar.setTime(new Date());
+        calendar.set(Calendar.MONTH, 0);
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        inspectionReportDTO.setInspectionYearStartDate(calendar.getTime());
+        calendar.add(Calendar.YEAR, 1);
+        inspectionReportDTO.setInspectionYearEndDate(calendar.getTime());
+
+
+        inspectionReportDTO.setRainSeasonKind(1);
+        count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
+        data.put("beforeRainInspectionCount", count);
+        if (rainKind == 1) {
+            remaininspectionrtus = rtus - count;
+        }
+
+        inspectionReportDTO.setRainSeasonKind(2);
+        count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
+        data.put("firstRainInspectionCount", count);
+        if (rainKind == 2) {
+            remaininspectionrtus = rtus - count;
+        }
+        inspectionReportDTO.setRainSeasonKind(3);
+        count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
+        data.put("sencodRainInspectionCount", count);
+        if (rainKind == 3) {
+            remaininspectionrtus = rtus - count;
+        }
+        data.put("remaininspectionrtus", remaininspectionrtus);
+
+        return R.data(data);
+    }
+
+    /**
+     * 填报状态
+     */
+    @GetMapping("/reportStatus")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "传入实体类EquipmentInspectionInfoEntity")
+    public R<EquipmentInspectionInfoVO> getReportStatus(EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
+        if (null == equipmentInspectionInfoEntity.getId()) {
+            return R.fail("参数错误");
+        }
+        EquipmentInspectionInfoEntity detail = equipmentInspectionService.getById(equipmentInspectionInfoEntity.getId());
+        return R.data(EquipmentInspectionWrapper.build().entityVO(detail));
+    }
+
+    /**
+     * 填报状态
+     */
+    @GetMapping("/rtu/reportStatus")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "传入实体类EquipmentInspectionInfoEntity")
+    public R<EquipmentInspectionInfoVO> getRtuReportStatus(EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
+        if (null == equipmentInspectionInfoEntity.getRtuCode()) {
+            return R.fail("参数错误");
+        }
+        LambdaQueryWrapper<EquipmentInspectionInfoEntity> wrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
+        wrapper.eq(EquipmentInspectionInfoEntity::getIsDeleted, 0);
+        wrapper.eq(EquipmentInspectionInfoEntity::getRtuCode, equipmentInspectionInfoEntity.getRtuCode());
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        calendar.set(Calendar.MONTH, 0);
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        wrapper.ge(EquipmentInspectionInfoEntity::getInspectionDate, calendar.getTime());
+        calendar.add(Calendar.YEAR, 1);
+        wrapper.lt(EquipmentInspectionInfoEntity::getInspectionDate, calendar.getTime());
+        EquipmentInspectionInfoEntity detail = equipmentInspectionService.getOne(wrapper);
+        if (null == detail) {
+            detail = new EquipmentInspectionInfoEntity();
+            detail.setBeforeRainSeasonStatus(0);
+            detail.setRainSeasonFirstStatus(0);
+            detail.setRainSeasonSecondStatus(0);
+        }
+        return R.data(EquipmentInspectionWrapper.build().entityVO(detail));
+    }
+
+    /**
+     * 详情
+     */
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "传入实体类EquipmentInspectionInfoEntity")
+    public R<EquipmentInspectionInfoVO> detail(EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
+        if (null == equipmentInspectionInfoEntity.getId()) {
+            return R.fail("参数错误");
+        }
+        EquipmentInspectionInfoEntity detail = equipmentInspectionService.getOne(Condition.getQueryWrapper(equipmentInspectionInfoEntity));
+        return R.data(EquipmentInspectionWrapper.build().entityVO(detail));
+    }
+
+    /**
+     * 新增
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增", notes = "传入orderProcessInfoEntity")
+    public R save(@RequestBody EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
+        return R.status(equipmentInspectionService.save(equipmentInspectionInfoEntity));
+    }
+
+    /**
+     * 修改
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改", notes = "传入orderProcessInfoEntity")
+    public R update(@RequestBody EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
+        return R.status(equipmentInspectionService.updateById(equipmentInspectionInfoEntity));
+    }
+
+    /**
+     * 新增或修改
+     */
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "新增或修改", notes = "传入orderProcessInfoEntity")
+    public R submit(@RequestBody EquipmentInspectionInfoEntity equipmentInspectionInfoEntity) {
+        return R.status(equipmentInspectionService.saveOrUpdate(equipmentInspectionInfoEntity));
+    }
+
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "传入projectInfoEntity")
+    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+        boolean temp = equipmentInspectionService.deleteLogic(Func.toLongList(ids));
+        return R.status(temp);
+    }
+
+    /**
+     * 巡检统计
+     *
+     * @return
+     */
+    @GetMapping("/person/statistics")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "统计表格")
+    public R<List<EquipmentInspectionStatisticsVO>> inspectionStatistics() {
+        BladeUser user = AuthUtil.getUser();
+        LambdaQueryWrapper<User> userQueryWrapper = Wrappers.<User>query().lambda();
+        userQueryWrapper.eq(User::getIsDeleted, 0);
+        userQueryWrapper.eq(User::getDeptId, Func.toLong(user.getDeptId()));
+        List<User> list = userService.list(userQueryWrapper);
+        List<EquipmentInspectionStatisticsVO> countList = new LinkedList<>();
+        for (User u : list) {
+            EquipmentInspectionStatisticsVO vo = new EquipmentInspectionStatisticsVO();
+            vo.setUserId(u.getId());
+            vo.setServicePersonName(u.getRealName());
+            EquipmentInspectionInfoDTO inspectionInfoDTO = new EquipmentInspectionInfoDTO();
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(new Date());
+            calendar.setTime(new Date());
+            calendar.set(Calendar.MONTH, 0);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
+            inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
+            calendar.add(Calendar.YEAR, 1);
+            inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
+            inspectionInfoDTO.setBeforeRainSeasonReportUser(u.getId());
+            long count = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
+            vo.setBeforeRainInspectionCount(count);
+            inspectionInfoDTO.setBeforeRainSeasonReportUser(null);
+            inspectionInfoDTO.setRainSeasonFirstReportUser(u.getId());
+            count = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
+            vo.setFirstRainInspectionCount(count);
+            inspectionInfoDTO.setRainSeasonFirstReportUser(null);
+            inspectionInfoDTO.setRainSeasonSecondReportUser(u.getId());
+            count = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
+            vo.setSencodRainInspectionCount(count);
+            countList.add(vo);
+        }
+        return R.data(countList);
+    }
+
+    /**
+     * 巡检统计
+     *
+     * @return
+     */
+    @GetMapping("/org/statistics")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "统计表格")
+    public R<List<OrgEquipmentInspectionStatisticsVO>> orgInspectionStatistics() {
+        BladeUser user = AuthUtil.getUser();
+        List<Dept> root = new LinkedList<>();
+        List<OrgEquipmentInspectionStatisticsVO> list = new LinkedList<>();
+        if (BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+            Dept dept = deptService.getById(Func.toLong(user.getDeptId()));
+            root.add(dept);
+        } else {
+            LambdaQueryWrapper<Dept> wrapper = Wrappers.<Dept>query().lambda();
+            wrapper.eq(Dept::getIsDeleted, 0);
+            wrapper.eq(Dept::getParentId, Func.toLong(user.getDeptId()));
+            root = this.deptService.list(wrapper);
+        }
+
+        for (Dept dept : root) {
+            OrgEquipmentInspectionStatisticsVO orgEquipmentInspectionStatisticsVO = new OrgEquipmentInspectionStatisticsVO();
+            orgEquipmentInspectionStatisticsVO.setDeptId(dept.getId());
+            orgEquipmentInspectionStatisticsVO.setOrgName(dept.getDeptName());
+            LambdaQueryWrapper<DeptRegionEntity> deptLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+            deptLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+            deptLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, dept.getId());
+            DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptLambdaQueryWrapper);
+            Long count = rtuBaseInfoService.rtuCount(deptRegionEntity.getAdcd());
+            orgEquipmentInspectionStatisticsVO.setRtuCount(count);
+            EquipmentInspectionInfoDTO inspectionInfoDTO = new EquipmentInspectionInfoDTO();
+            inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(new Date());
+            calendar.set(Calendar.MONTH, 0);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
+            inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
+            calendar.add(Calendar.YEAR, 1);
+            inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
+            count = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
+            orgEquipmentInspectionStatisticsVO.setInspectionCount(count);
+            EquipmentInspectionReportDTO inspectionReportDTO = new EquipmentInspectionReportDTO();
+            inspectionReportDTO.setAdCode(deptRegionEntity.getAdcd());
+            calendar.setTime(new Date());
+            calendar.set(Calendar.MONTH, 0);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
+            inspectionReportDTO.setInspectionYearStartDate(calendar.getTime());
+            calendar.add(Calendar.YEAR, 1);
+            inspectionReportDTO.setInspectionYearEndDate(calendar.getTime());
+            inspectionReportDTO.setRainSeasonKind(1);
+            count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
+            orgEquipmentInspectionStatisticsVO.setBeforeRainInspectionCount(count);
+            inspectionReportDTO.setRainSeasonKind(2);
+            count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
+            orgEquipmentInspectionStatisticsVO.setFirstRainInspectionCount(count);
+            inspectionReportDTO.setRainSeasonKind(3);
+            count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
+            orgEquipmentInspectionStatisticsVO.setSencodRainInspectionCount(count);
+            list.add(orgEquipmentInspectionStatisticsVO);
+        }
+        return R.data(list);
+    }
+
+    /**
+     * 未完成巡检设备清单信息列表,分页
+     */
+    @GetMapping("/unfinished/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "inspectionYear", value = "巡检年度", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "rainSeasonKind", value = "汛期类型", paramType = "query", dataType = "int"),
+    })
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "未完成巡检设备清单信息列表")
+    public R<IPage<EquipmentInspectionInfoVO>> unfinishedInspectionEquipmentPage(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO, Query query) {
+        BladeUser user = AuthUtil.getUser();
+        if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+            inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+        } else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+            LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+            deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+            deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+            DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+            inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+        }
+        Date now = new Date();
+        if (inspectionInfoDTO.getInspectionYear() != null) {
+            Date year = Func.parseDate(inspectionInfoDTO.getInspectionYear(), "yyyy-MM-dd");
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(year);
+            calendar.set(Calendar.MONTH, 0);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
+            inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
+            calendar.add(Calendar.YEAR, 1);
+            inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
+        } else {
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(new Date());
+            calendar.set(Calendar.MONTH, 0);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
+            inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
+            calendar.add(Calendar.YEAR, 1);
+            inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
+            if (inspectionInfoDTO.getRainSeasonKind() == null) {
+                //处理汛期类别
+                LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
+                wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted, 0);
+                wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
+                List<EquipmentInspectionPlanEntity> list = planService.list(wrapper);
+                if (null != list && list.size() > 0) {
+                    EquipmentInspectionPlanEntity entity = list.get(0);
+
+                    Calendar dt = Calendar.getInstance();
+                    Calendar calendarStart = Calendar.getInstance();
+                    Calendar calendarEnd = Calendar.getInstance();
+                    dt.setTime(now);
+                    //汛前上报
+                    calendarStart.setTime(entity.getBeforeRainSeasonStartTime());
+                    calendarEnd.setTime(entity.getBeforeRainSeasonEndTime());
+                    if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+                        inspectionInfoDTO.setRainSeasonKind(1);
+                    }
+                    //汛中第一次上报
+                    calendarStart.setTime(entity.getRainSeasonFirstStartTime());
+                    calendarEnd.setTime(entity.getRainSeasonFirstEndTime());
+                    if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+                        inspectionInfoDTO.setRainSeasonKind(2);
+                    }
+                    //汛中第二次上报
+                    calendarStart.setTime(entity.getRainSeasonSecondStartTime());
+                    calendarEnd.setTime(entity.getRainSeasonSecondEndTime());
+                    if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+                        inspectionInfoDTO.setRainSeasonKind(3);
+                    }
+                }
+                //没在当年任意一个汛期,直接返回
+                if (inspectionInfoDTO.getRainSeasonKind() == null) {
+                    return R.data(null);
+                }
+            }
+        }
+        IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectUnfinishedInspectionEquipmentPage(Condition.getPage(query), inspectionInfoDTO);
+        List<EquipmentInspectionInfoVO> volist = pages.getRecords();
+        for (EquipmentInspectionInfoVO vo : volist) {
+            EquipmentInspectionWrapper.build().entityVO(vo);
+        }
+        return R.data(pages);
+    }
+
+    /**
+     * 未完成巡检设备清单信息导出
+     *
+     * @return
+     */
+    @GetMapping("/unfinished/export")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "未完成巡检设备清单导出", notes = "")
+    public R<Map<String, Object>> unfinishedInspectionEquipmentExport(@ApiIgnore EquipmentInspectionInfoDTO inspectionInfoDTO) {
+        BladeUser user = AuthUtil.getUser();
+        if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+            inspectionInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+        } else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+            LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+            deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+            deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+            DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+            inspectionInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+        }
+        //文件标题
+        String title = "";
+        //当前时间
+        Date now = new Date();
+        if (inspectionInfoDTO.getInspectionYear() != null) {
+            Date year = Func.parseDate(inspectionInfoDTO.getInspectionYear(), "yyyy-MM-dd");
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(year);
+            calendar.set(Calendar.MONTH, 0);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
+            inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
+            calendar.add(Calendar.YEAR, 1);
+            inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
+            title += Func.formatDate(year) + "年";
+
+        } else {
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(now);
+            calendar.set(Calendar.MONTH, 0);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
+            inspectionInfoDTO.setInspectionYearStartDate(calendar.getTime());
+
+            calendar.add(Calendar.YEAR, 1);
+            inspectionInfoDTO.setInspectionYearEndDate(calendar.getTime());
+
+            title += Func.formatDate(now) + "年";
+
+            if (inspectionInfoDTO.getRainSeasonKind() == null) {
+                //处理汛期类别
+                LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
+                wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted, 0);
+                wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
+                List<EquipmentInspectionPlanEntity> list = planService.list(wrapper);
+                if (null != list && list.size() > 0) {
+                    EquipmentInspectionPlanEntity entity = list.get(0);
+
+                    Calendar dt = Calendar.getInstance();
+                    Calendar calendarStart = Calendar.getInstance();
+                    Calendar calendarEnd = Calendar.getInstance();
+                    dt.setTime(now);
+                    //汛前上报
+                    calendarStart.setTime(entity.getBeforeRainSeasonStartTime());
+                    calendarEnd.setTime(entity.getBeforeRainSeasonEndTime());
+                    if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+                        inspectionInfoDTO.setRainSeasonKind(1);
+                        title += "汛前";
+                    }
+                    //汛中第一次上报
+                    calendarStart.setTime(entity.getRainSeasonFirstStartTime());
+                    calendarEnd.setTime(entity.getRainSeasonFirstEndTime());
+                    if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+                        inspectionInfoDTO.setRainSeasonKind(2);
+                        title += "汛中第一次";
+                    }
+                    //汛中第二次上报
+                    calendarStart.setTime(entity.getRainSeasonSecondStartTime());
+                    calendarEnd.setTime(entity.getRainSeasonSecondEndTime());
+                    if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+                        inspectionInfoDTO.setRainSeasonKind(3);
+                        title += "汛中第二次";
+                    }
+                }
+                //没在当年任意一个汛期,直接返回
+                if (inspectionInfoDTO.getRainSeasonKind() == null) {
+                    List<UnfinishedInspectionEquipmentExportEntity> unfinishedInspectionEquipmentExportEntities = new LinkedList<>();
+                    Map<String, Object> data = this.exportUnfinishedInspectionEquipmentExcel(title, unfinishedInspectionEquipmentExportEntities);
+                    return R.data(data);
+                }
+            }
+        }
+        if (inspectionInfoDTO.getRainSeasonKind() != null) {
+            if (inspectionInfoDTO.getRainSeasonKind() == 1) {
+                title += "汛前";
+            } else if (inspectionInfoDTO.getRainSeasonKind() == 2) {
+                title += "汛中第一次";
+            } else if (inspectionInfoDTO.getRainSeasonKind() == 3) {
+                title += "汛中第二次";
+            }
+        }
+        List<EquipmentInspectionInfoVO> equipmentInspectionInfoVOList = equipmentInspectionService.selectUnfinishedInspectionEquipmentList(inspectionInfoDTO);
+        //生成数据
+        List<UnfinishedInspectionEquipmentExportEntity> unfinishedInspectionEquipmentExportEntities = new LinkedList<>();
+        if (null != equipmentInspectionInfoVOList && equipmentInspectionInfoVOList.size() > 0) {
+            int index = 1;
+            for (EquipmentInspectionInfoVO entity : equipmentInspectionInfoVOList) {
+                UnfinishedInspectionEquipmentExportEntity exportEntity = new UnfinishedInspectionEquipmentExportEntity();
+                exportEntity.setIndex(index);
+                if (entity.getAdCity() != null) {
+                    exportEntity.setAdCity(entity.getAdCity());
+                } else {
+                    exportEntity.setAdCity("");
+                }
+                if (entity.getAdDist() != null) {
+                    exportEntity.setAdDist(entity.getAdDist());
+                } else {
+                    exportEntity.setAdDist("");
+                }
+                if (entity.getRtuName() != null) {
+                    exportEntity.setRtuName(entity.getRtuName());
+                } else {
+                    exportEntity.setRtuName("");
+                }
+                exportEntity.setRtuCode(entity.getRtuCode());
+                String rtuKindDesc = "";
+                if (entity.getIsRain() != null && entity.getIsRain() == 1) {
+                    rtuKindDesc += "雨量站";
+                }
+                if ((entity.getIsRiver() != null && entity.getIsRiver() == 1) || (entity.getIsRes() != null && entity.getIsRes() == 1)) {
+                    if (rtuKindDesc.length() > 0) {
+                        rtuKindDesc += "/";
+                    }
+                    rtuKindDesc += "水位站";
+                }
+                if (entity.getIsGround() != null && entity.getIsGround() == 1) {
+                    if (rtuKindDesc.length() > 0) {
+                        rtuKindDesc += "/";
+                    }
+                    rtuKindDesc += "墒情站";
+                }
+                if (entity.getIsVideo() != null && entity.getIsVideo() == 1) {
+                    if (rtuKindDesc.length() > 0) {
+                        rtuKindDesc += "/";
+                    }
+                    rtuKindDesc += "视频站";
+                }
+                exportEntity.setRtuKindDesc(rtuKindDesc);
+
+                if (entity.getLng() != null) {
+                    exportEntity.setLng(entity.getLng());
+                } else {
+                    exportEntity.setLng("");
+                }
+                if (entity.getLat() != null) {
+                    exportEntity.setLat(entity.getLat());
+                } else {
+                    exportEntity.setLat("");
+                }
+                if (entity.getLocationDesc() != null) {
+                    exportEntity.setLocationDesc(entity.getLocationDesc());
+                } else {
+                    exportEntity.setLocationDesc("");
+                }
+
+                if (entity.getBeforeRainSeasonStatus() != null) {
+                    if (entity.getBeforeRainSeasonStatus() == 0) {
+                        exportEntity.setBeforeRainSeasonStatus("");
+                    } else if (entity.getBeforeRainSeasonStatus() == 1) {
+                        exportEntity.setBeforeRainSeasonStatus("已填报");
+                    } else {
+                        exportEntity.setBeforeRainSeasonStatus("");
+                    }
+                } else {
+                    exportEntity.setBeforeRainSeasonStatus("");
+                }
+                if (entity.getRainSeasonFirstStatus() != null) {
+                    if (entity.getRainSeasonFirstStatus() == 0) {
+                        exportEntity.setRainSeasonFirstStatus("");
+                    } else if (entity.getRainSeasonFirstStatus() == 1) {
+                        exportEntity.setRainSeasonFirstStatus("已填报");
+                    } else {
+                        exportEntity.setRainSeasonFirstStatus("");
+                    }
+                } else {
+                    exportEntity.setRainSeasonFirstStatus("");
+                }
+                if (entity.getRainSeasonSecondStatus() != null) {
+                    if (entity.getRainSeasonSecondStatus() == 0) {
+                        exportEntity.setRainSeasonSecondStatus("");
+                    } else if (entity.getRainSeasonSecondStatus() == 1) {
+                        exportEntity.setRainSeasonSecondStatus("已填报");
+                    } else {
+                        exportEntity.setRainSeasonSecondStatus("");
+                    }
+                } else {
+                    exportEntity.setRainSeasonSecondStatus("");
+                }
+                unfinishedInspectionEquipmentExportEntities.add(exportEntity);
+                index += 1;
+            }
+        }
+        Map<String, Object> data = this.exportUnfinishedInspectionEquipmentExcel(title, unfinishedInspectionEquipmentExportEntities);
+        return R.data(data);
+    }
+
+    private Map<String, Object> exportUnfinishedInspectionEquipmentExcel(String title, List<UnfinishedInspectionEquipmentExportEntity> list) {
+        //当前时间
+        //Calendar dt = Calendar.getInstance();
+        //dt.setTime(new Date());
+        Map<String, Object> data = new HashMap<>();
+        data.put("status", 0);
+        String templateFilePath = this.workDir + File.separator + this.inspectionUnfinishedTemplate;
+        String outpath = this.workDir + File.separator + Func.formatDate(new Date());
+        File dir = new File(outpath);
+        if (!dir.exists()) {
+            if (!dir.mkdir()) {
+                data.put("error", "目录创建失败");
+                return data;
+            }
+        }
+        String outFileName = Func.randomUUID() + ".xlsx";
+        outpath += File.separator + outFileName;
+        ExcelWriter excelWriter = EasyExcel.write(outpath).withTemplate(templateFilePath).excelType(ExcelTypeEnum.XLSX).build();
+        WriteSheet writeSheet = EasyExcel.writerSheet("信息统计表").build();
+        excelWriter.write(list, writeSheet);
+        excelWriter.finish();
+        try {
+            FileInputStream fileInputStream = new FileInputStream(new File(outpath));
+            BladeFile bladeFile = ossBuilder.template().putFile(outFileName, fileInputStream);
+            String ossPath = bladeFile.getName();
+            //String p = bladeFile.getDomain();
+            data.put("name", ossPath);
+            data.put("url", ossPath);
+            data.put("filename", "未完成巡检设备(" + title + ")统计清单表");
+            data.put("status", 1);
+
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+            data.put("error", "导出失败!");
+        }
+        return data;
+    }
 }

+ 27 - 2
src/main/java/org/springblade/modules/business/equipment/inspection/base/entity/EquipmentInspectionInfoEntity.java

@@ -45,9 +45,21 @@ public class EquipmentInspectionInfoEntity extends BaseEntity {
 	private String inspectionTitle;
 
 	/**
-	 * 巡检年度
+	 * 巡检计划ID
 	 */
-	@ApiModelProperty("巡检年度")
+	@ApiModelProperty("巡检计划ID")
+	private Long inspectionPlanId;
+
+	/**
+	 * 巡检状态: 0 待巡检 ,1 已巡检 ,2 待完结审批 ,3 完结已审批,4 退回
+	 */
+	@ApiModelProperty("巡检状态")
+	private Integer inspectionStatus;
+
+	/**
+	 * 巡检日期
+	 */
+	@ApiModelProperty("巡检日期")
 	@DateTimeFormat(
 		pattern = "yyyy-MM-dd"
 	)
@@ -56,6 +68,19 @@ public class EquipmentInspectionInfoEntity extends BaseEntity {
 	)
 	private Date inspectionDate;
 
+	/**
+	 * 巡检填报ID
+	 */
+	@ApiModelProperty("巡检填报ID")
+	private Long inspectionReportId;
+
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty("机构ID")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long orgId;
+
 	/**
 	 * 测站编码
 	 */

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

@@ -33,4 +33,5 @@ public interface EquipmentInspectionMapper  extends BaseMapper<EquipmentInspecti
 	List<EquipmentInspectionInfoVO> selectRtuPage(IPage page, @Param("inspectionInfoDTO") EquipmentInspectionInfoDTO inspectionInfoDTO);
 	List<EquipmentInspectionInfoVO> selectUnfinishedInspectionEquipmentPage(IPage page, @Param("inspectionInfoDTO") EquipmentInspectionInfoDTO inspectionInfoDTO);
 	List<EquipmentInspectionInfoVO> selectUnfinishedInspectionEquipmentList(@Param("inspectionInfoDTO") EquipmentInspectionInfoDTO inspectionInfoDTO);
+	List<EquipmentInspectionInfoVO> todoInspectionList(@Param("inspectionInfoDTO") EquipmentInspectionInfoDTO inspectionInfoDTO);
 }

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

@@ -6,7 +6,10 @@
     <resultMap id="equipmentInspectionInfoResultMap"
                type="org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity">
         <result column="inspection_title" property="inspectionTitle"/>
+        <result column="inspection_plan_id" property="inspectionPlanId"/>
+        <result column="inspection_status" property="inspectionStatus"/>
         <result column="inspection_date" property="inspectionDate"/>
+        <result column="org_id" property="orgId"/>
         <result column="rtu_code" property="rtuCode"/>
         <result column="before_rain_season_status" property="beforeRainSeasonStatus"/>
         <result column="before_rain_season_report_time" property="beforeRainSeasonReportTime"/>
@@ -20,13 +23,18 @@
         <result column="rain_season_second_report_time" property="rainSeasonSecondReportTime"/>
         <result column="rain_season_second_report_user" property="rainSeasonSecondReportUser"/>
         <result column="rain_season_second_report_id" property="rainSeasonSecondReportId"/>
+
+        <result column="inspection_report_id" property="inspectionReportId"/>
     </resultMap>
 
     <resultMap id="equipmentInspectionInfoVOResultMap"
                type="org.springblade.modules.business.equipment.inspection.base.vo.EquipmentInspectionInfoVO">
-        <result column="rtu_code" property="rtuCode"/>
         <result column="inspection_title" property="inspectionTitle"/>
+        <result column="inspection_plan_id" property="inspectionPlanId"/>
+        <result column="inspection_status" property="inspectionStatus"/>
         <result column="inspection_date" property="inspectionDate"/>
+        <result column="org_id" property="orgId"/>
+        <result column="rtu_code" property="rtuCode"/>
         <result column="before_rain_season_status" property="beforeRainSeasonStatus"/>
         <result column="before_rain_season_report_time" property="beforeRainSeasonReportTime"/>
         <result column="before_rain_season_report_user" property="beforeRainSeasonReportUser"/>
@@ -55,6 +63,12 @@
         <result column="location_desc" property="locationDesc"/>
         <result column="lng" property="lng"/>
         <result column="lat" property="lat"/>
+
+        <result column="plan_scheduled_type" property="planScheduledType"/>
+        <result column="time_type" property="timeType"/>
+        <result column="inspection_complete_time" property="inspectionCompleteTime"/>
+
+        <result column="inspection_report_id" property="inspectionReportId"/>
     </resultMap>
 
 
@@ -285,4 +299,21 @@
         </if>
         order by  r1.ad_code, r1.rtu_code
     </select>
+
+
+    <select id="todoInspectionList" resultMap="equipmentInspectionInfoVOResultMap">
+        SELECT
+        n.*,p.plan_scheduled_type,p.time_type,p.inspection_complete_time
+        FROM
+        equipment_inspection n
+        LEFT JOIN equipment_inspection_plan p ON p.id = n.inspection_plan_id
+        WHERE
+        n.is_deleted = 0
+        <if test="inspectionInfoDTO.inspectionStatus!=null">
+            and n.inspection_status = #{inspectionInfoDTO.inspectionStatus}
+        </if>
+        <if test="inspectionInfoDTO.orgId!=null">
+            and n.org_id = #{inspectionInfoDTO.orgId}
+        </if>
+    </select>
 </mapper>

+ 3 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/base/service/IEquipmentInspectionService.java

@@ -26,6 +26,9 @@ import java.util.List;
  * Remark:认为有必要的其他信息
  */
 public interface IEquipmentInspectionService extends BaseService<EquipmentInspectionInfoEntity> {
+
+	List<EquipmentInspectionInfoVO> todoInspectionList(EquipmentInspectionInfoDTO inspectionInfoDTO);
+
 	List<EquipmentInspectionStatisticsVO> inspectionReportCount(EquipmentInspectionInfoDTO inspectionInfoDTO);
 
 	/**

+ 5 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/base/service/impl/EquipmentInspectionServiceImpl.java

@@ -31,6 +31,11 @@ import java.util.List;
 public class EquipmentInspectionServiceImpl extends BaseServiceImpl<EquipmentInspectionMapper, EquipmentInspectionInfoEntity> implements IEquipmentInspectionService {
 
 
+	@Override
+	public List<EquipmentInspectionInfoVO> todoInspectionList(EquipmentInspectionInfoDTO inspectionInfoDTO) {
+		return baseMapper.todoInspectionList(inspectionInfoDTO);
+	}
+
 	@Override
 	public List<EquipmentInspectionStatisticsVO> inspectionReportCount(EquipmentInspectionInfoDTO inspectionInfoDTO) {
 		return baseMapper.inspectionReportCount(inspectionInfoDTO);

+ 48 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/base/vo/EquipmentInspectionInfoVO.java

@@ -6,12 +6,16 @@
  */
 package org.springblade.modules.business.equipment.inspection.base.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.NullSerializer;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
 
 /***
  * Date:2022/8/23
@@ -117,4 +121,48 @@ public class EquipmentInspectionInfoVO extends EquipmentInspectionInfoEntity {
 	 */
 	@ApiModelProperty(value = "测站类型概要")
 	private String rtuKindDesc;
+
+	/**
+	 * 计划执行周期 1 仅一次 1 周期性
+	 */
+	@ApiModelProperty("计划执行周期")
+	private Integer planScheduledType;
+
+	/**
+	 * 时间周期类型 1 按天 2 按周 2 按月
+	 */
+	@ApiModelProperty("时间周期类型")
+	private Integer timeType;
+
+	/**
+	 * 巡检完成时限
+	 */
+	@ApiModelProperty("巡检完成时限")
+	@DateTimeFormat(
+			pattern = "yyyy-MM-dd"
+	)
+	@JsonFormat(
+			pattern = "yyyy-MM-dd",timezone = "GMT+8"
+	)
+	private Date inspectionCompleteTime;
+
+
+	/**
+	 * 处理人
+	 */
+	@ApiModelProperty("处理人")
+	private String servicePersonName;
+
+	/**
+	 * 处理时间
+	 */
+	@ApiModelProperty("处理时间")
+	@DateTimeFormat(
+			pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+			pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+	)
+	private Date inspectionReportTime;
+
 }

+ 31 - 28
src/main/java/org/springblade/modules/business/equipment/inspection/base/wrapper/EquipmentInspectionWrapper.java

@@ -35,34 +35,37 @@ public class EquipmentInspectionWrapper extends BaseEntityWrapper<EquipmentInspe
 	}
 
 	public EquipmentInspectionInfoVO entityVO(EquipmentInspectionInfoVO entity) {
-		String rtuKindDesc = "";
-		if (entity.getIsRain() != null && entity.getIsRain() == 1) {
-			rtuKindDesc = "雨量站";
-		}
-		if (entity.getIsRes() != null && entity.getIsRes() == 1) {
-			if (rtuKindDesc.length() > 0) {
-				rtuKindDesc += "/";
-			}
-			rtuKindDesc += "水位站";
-		} else if (entity.getIsRiver() != null && entity.getIsRiver() == 1) {
-			if (rtuKindDesc.length() > 0) {
-				rtuKindDesc += "/";
-			}
-			rtuKindDesc += "水位站";
-		}
-		if (entity.getIsGround() != null && entity.getIsGround() == 1) {
-			if (rtuKindDesc.length() > 0) {
-				rtuKindDesc += "/";
-			}
-			rtuKindDesc += "墒情站";
-		}
-		if (entity.getIsVideo() != null && entity.getIsVideo() == 1) {
-			if (rtuKindDesc.length() > 0) {
-				rtuKindDesc += "/";
-			}
-			rtuKindDesc += "视频站";
-		}
-		entity.setRtuKindDesc(rtuKindDesc);
+//		String rtuKindDesc = "";
+//		if (entity.getIsRain() != null && entity.getIsRain() == 1) {
+//			rtuKindDesc = "雨量站";
+//		}
+//		if (entity.getIsRes() != null && entity.getIsRes() == 1) {
+//			if (rtuKindDesc.length() > 0) {
+//				rtuKindDesc += "/";
+//			}
+//			rtuKindDesc += "水位站";
+//		} else if (entity.getIsRiver() != null && entity.getIsRiver() == 1) {
+//			if (rtuKindDesc.length() > 0) {
+//				rtuKindDesc += "/";
+//			}
+//			rtuKindDesc += "水位站";
+//		}
+//		if (entity.getIsGround() != null && entity.getIsGround() == 1) {
+//			if (rtuKindDesc.length() > 0) {
+//				rtuKindDesc += "/";
+//			}
+//			rtuKindDesc += "墒情站";
+//		}
+//		if (entity.getIsVideo() != null && entity.getIsVideo() == 1) {
+//			if (rtuKindDesc.length() > 0) {
+//				rtuKindDesc += "/";
+//			}
+//			rtuKindDesc += "视频站";
+//		}
+//		entity.setRtuKindDesc(rtuKindDesc);
+
+
+
 		return entity;
 	}
 }

+ 104 - 87
src/main/java/org/springblade/modules/business/equipment/inspection/plan/controller/EquipmentInspectionPlanController.java

@@ -16,6 +16,9 @@ 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.enums.InspectionStatusEnum;
+import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
+import org.springblade.modules.business.equipment.inspection.base.service.IEquipmentInspectionService;
 import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
 import org.springblade.modules.business.equipment.inspection.plan.service.IEquipmentInspectionPlanService;
 import org.springframework.web.bind.annotation.*;
@@ -35,96 +38,110 @@ import java.util.*;
 @AllArgsConstructor
 @Api(value = "设备巡检汛期管理模块", tags = "设备巡检汛期管理模块")
 public class EquipmentInspectionPlanController extends BladeController {
-	private final IEquipmentInspectionPlanService planService;
+    private final IEquipmentInspectionPlanService planService;
+    private final IEquipmentInspectionService inspectionService;
 
-	/**
-	 * 详情
-	 */
-	@GetMapping("/detail")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "")
-	public R<EquipmentInspectionPlanEntity> detail() {
-		BladeUser user = AuthUtil.getUser();
-		LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
-		wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted,0);
-		wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
-		List<EquipmentInspectionPlanEntity> list = planService.list(wrapper);
-		if (null != list && list.size()>0){
-			EquipmentInspectionPlanEntity entity=list.get(0);
-			return R.data(entity);
-		}else {
-			EquipmentInspectionPlanEntity entity=new EquipmentInspectionPlanEntity();
-			entity.setId(0L);
-			entity.setCreateDept(Func.toLong(user.getDeptId()));
-			entity.setCreateUser(user.getUserId());
-			entity.setCreateTime(new Date());
-			entity.setStatus(1);
-			entity.setIsDeleted(0);
-			Calendar calendar= Calendar.getInstance();
-			calendar.setTime(new Date());
-			calendar.set(Calendar.MONTH,4-1);
-			calendar.set(Calendar.DAY_OF_MONTH,1);
-			entity.setBeforeRainSeasonStartTime(calendar.getTime());
-			calendar.set(Calendar.MONTH,6-1);
-			calendar.set(Calendar.DAY_OF_MONTH,1);
-			entity.setBeforeRainSeasonEndTime(calendar.getTime());
-			calendar.set(Calendar.MONTH,6-1);
-			calendar.set(Calendar.DAY_OF_MONTH,1);
-			entity.setRainSeasonFirstStartTime(calendar.getTime());
-			calendar.set(Calendar.MONTH,8-1);
-			calendar.set(Calendar.DAY_OF_MONTH,15);
-			entity.setRainSeasonFirstEndTime(calendar.getTime());
-			calendar.set(Calendar.MONTH,8-1);
-			calendar.set(Calendar.DAY_OF_MONTH,15);
-			entity.setRainSeasonSecondStartTime(calendar.getTime());
-			calendar.set(Calendar.MONTH,10-1);
-			calendar.set(Calendar.DAY_OF_MONTH,1);
-			entity.setRainSeasonSecondEndTime(calendar.getTime());
-			return R.data(entity);
-		}
-	}
+    /**
+     * 详情
+     */
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "")
+    public R<EquipmentInspectionPlanEntity> detail() {
+        BladeUser user = AuthUtil.getUser();
+        LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
+        wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted, 0);
+        wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
+        List<EquipmentInspectionPlanEntity> list = planService.list(wrapper);
+        if (null != list && list.size() > 0) {
+            EquipmentInspectionPlanEntity entity = list.get(0);
+            return R.data(entity);
+        } else {
+            EquipmentInspectionPlanEntity entity = new EquipmentInspectionPlanEntity();
+            entity.setId(0L);
+            entity.setCreateDept(Func.toLong(user.getDeptId()));
+            entity.setCreateUser(user.getUserId());
+            entity.setCreateTime(new Date());
+            entity.setStatus(1);
+            entity.setIsDeleted(0);
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(new Date());
+            calendar.set(Calendar.MONTH, 4 - 1);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            entity.setBeforeRainSeasonStartTime(calendar.getTime());
+            calendar.set(Calendar.MONTH, 6 - 1);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            entity.setBeforeRainSeasonEndTime(calendar.getTime());
+            calendar.set(Calendar.MONTH, 6 - 1);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            entity.setRainSeasonFirstStartTime(calendar.getTime());
+            calendar.set(Calendar.MONTH, 8 - 1);
+            calendar.set(Calendar.DAY_OF_MONTH, 15);
+            entity.setRainSeasonFirstEndTime(calendar.getTime());
+            calendar.set(Calendar.MONTH, 8 - 1);
+            calendar.set(Calendar.DAY_OF_MONTH, 15);
+            entity.setRainSeasonSecondStartTime(calendar.getTime());
+            calendar.set(Calendar.MONTH, 10 - 1);
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            entity.setRainSeasonSecondEndTime(calendar.getTime());
+            return R.data(entity);
+        }
+    }
 
-	/**
-	 * 新增
-	 */
-	@PostMapping("/save")
-	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "新增", notes = "传入planEntity")
-	public R save(@RequestBody EquipmentInspectionPlanEntity planEntity) {
-		return R.status(planService.save(planEntity));
-	}
+    /**
+     * 新增
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增", notes = "")
+    public R save(@RequestBody EquipmentInspectionPlanEntity planEntity) {
+        BladeUser user = AuthUtil.getUser();
+        planEntity.setPlanStatus(1);
+        planEntity.setOrgId(Func.toLong(user.getDeptId()));
+        planService.save(planEntity);
+        if (planEntity.getPlanScheduledType() == 1) {
+            //执行周期为仅一次时,立即生成巡检任务
+            EquipmentInspectionInfoEntity inspectionInfoEntity = new EquipmentInspectionInfoEntity();
+            inspectionInfoEntity.setInspectionPlanId(planEntity.getId());
+            inspectionInfoEntity.setInspectionTitle(planEntity.getPlanTitle());
+            inspectionInfoEntity.setInspectionStatus(InspectionStatusEnum.STATUS_TODO.getCode());
+            inspectionInfoEntity.setOrgId(Func.toLong(user.getDeptId()));
+            inspectionService.save(inspectionInfoEntity);
+        }
+        return R.status(true);
+    }
 
-	/**
-	 * 修改
-	 */
-	@PostMapping("/update")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "修改", notes = "传入planEntity")
-	public R update(@RequestBody EquipmentInspectionPlanEntity planEntity) {
-		return R.status(planService.updateById(planEntity));
-	}
+    /**
+     * 修改
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改", notes = "传入planEntity")
+    public R update(@RequestBody EquipmentInspectionPlanEntity planEntity) {
+        return R.status(planService.updateById(planEntity));
+    }
 
-	/**
-	 * 新增或修改
-	 */
-	@PostMapping("/submit")
-	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "新增或修改", notes = "传入planEntity")
-	public R submit(@RequestBody EquipmentInspectionPlanEntity planEntity) {
-		if (planEntity.getId() <=0L){
-			planEntity.setId(null);
-		}
-		return R.status(planService.saveOrUpdate(planEntity));
-	}
+    /**
+     * 新增或修改
+     */
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "新增或修改", notes = "传入planEntity")
+    public R submit(@RequestBody EquipmentInspectionPlanEntity planEntity) {
+        if (planEntity.getId() <= 0L) {
+            planEntity.setId(null);
+        }
+        return R.status(planService.saveOrUpdate(planEntity));
+    }
 
-	/**
-	 * 删除
-	 */
-	@PostMapping("/remove")
-	@ApiOperationSupport(order = 7)
-	@ApiOperation(value = "逻辑删除", notes = "传入projectInfoEntity")
-	public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
-		boolean temp = planService.deleteLogic(Func.toLongList(ids));
-		return R.status(temp);
-	}
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "传入projectInfoEntity")
+    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+        boolean temp = planService.deleteLogic(Func.toLongList(ids));
+        return R.status(temp);
+    }
 }

+ 71 - 10
src/main/java/org/springblade/modules/business/equipment/inspection/plan/entity/EquipmentInspectionPlanEntity.java

@@ -32,6 +32,12 @@ import java.util.Date;
 public class EquipmentInspectionPlanEntity extends BaseEntity {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 批处理ID,防止重复上传
+	 */
+	@ApiModelProperty(value = "批处理ID")
+	private String batchId;
+
 	/**
 	 * 租户ID
 	 */
@@ -51,6 +57,30 @@ public class EquipmentInspectionPlanEntity extends BaseEntity {
 	@ApiModelProperty("计划标题")
 	private String planTitle;
 
+	/**
+	 * 计划内容
+	 */
+	@ApiModelProperty("计划内容")
+	private String planDesc;
+
+	/**
+	 * 巡检计划状态:1 有效  0 无效
+	 */
+	@ApiModelProperty("巡检计划状态")
+	private Integer planStatus;
+
+	/**
+	 * 计划执行周期 1 仅一次 1 周期性
+	 */
+	@ApiModelProperty("计划执行周期")
+	private Integer planScheduledType;
+
+	/**
+	 * 时间周期类型 1 按天 2 按周 2 按月
+	 */
+	@ApiModelProperty("时间周期类型")
+	private Integer timeType;
+
 	/**
 	 * 机构ID
 	 */
@@ -66,27 +96,63 @@ public class EquipmentInspectionPlanEntity extends BaseEntity {
 	private Long projectId;
 
 	/**
-	 * 汛前巡检开始时间
+	 * 巡检完成时间
+	 */
+	@ApiModelProperty("巡检完成时间")
+	@DateTimeFormat(
+			pattern = "yyyy-MM-dd"
+	)
+	@JsonFormat(
+			pattern = "yyyy-MM-dd",timezone = "GMT+8"
+	)
+	private Date inspectionCompleteTime;
+
+	/**
+	 * 巡检开始时间
 	 */
-	@ApiModelProperty("汛前巡检开始时间")
+	@ApiModelProperty("巡检开始时间")
 	@DateTimeFormat(
 		pattern = "yyyy-MM-dd"
 	)
 	@JsonFormat(
 		pattern = "yyyy-MM-dd",timezone = "GMT+8"
 	)
-	private Date beforeRainSeasonStartTime;
+	private Date inspectionStartTime;
 
 	/**
-	 * 汛前巡检结束时间
+	 * 巡检结束时间
 	 */
-	@ApiModelProperty("汛前巡检结束时间")
+	@ApiModelProperty("巡检结束时间")
 	@DateTimeFormat(
 		pattern = "yyyy-MM-dd"
 	)
 	@JsonFormat(
 		pattern = "yyyy-MM-dd",timezone = "GMT+8"
 	)
+	private Date inspectionEndTime;
+
+	/**
+	 * 巡检开始时间
+	 */
+	@ApiModelProperty("巡检开始时间")
+	@DateTimeFormat(
+			pattern = "yyyy-MM-dd"
+	)
+	@JsonFormat(
+			pattern = "yyyy-MM-dd",timezone = "GMT+8"
+	)
+	private Date beforeRainSeasonStartTime;
+
+	/**
+	 * 巡检结束时间
+	 */
+	@ApiModelProperty("巡检结束时间")
+	@DateTimeFormat(
+			pattern = "yyyy-MM-dd"
+	)
+	@JsonFormat(
+			pattern = "yyyy-MM-dd",timezone = "GMT+8"
+	)
 	private Date beforeRainSeasonEndTime;
 
 
@@ -139,9 +205,4 @@ public class EquipmentInspectionPlanEntity extends BaseEntity {
 	)
 	private Date rainSeasonSecondEndTime;
 
-	/**
-	 * 备注说明
-	 */
-	@ApiModelProperty("备注说明")
-	private String remark;
 }

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

@@ -6,15 +6,24 @@
     <resultMap id="orderProcessInfoResultMap"
                type="org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity">
         <result column="inspection_id" property="inspectionId"/>
+        <result column="plan_title" property="planTitle"/>
+        <result column="plan_scheduled_type" property="planScheduledType"/>
+        <result column="time_type" property="timeType"/>
+        <result column="plan_status" property="planStatus"/>
         <result column="org_id" property="orgId"/>
         <result column="project_id" property="projectId"/>
+        <result column="inspection_complete_time" property="inspectionCompleteTime"/>
+        <result column="inspection_start_time" property="beforeRainSeasonStartTime"/>
+        <result column="inspection_end_time" property="beforeRainSeasonEndTime"/>
         <result column="before_rain_season_start_time" property="beforeRainSeasonStartTime"/>
         <result column="before_rain_season_end_time" property="beforeRainSeasonEndTime"/>
         <result column="rain_season_first_start_time" property="rainSeasonFirstStartTime"/>
         <result column="rain_season_first_end_time" property="rainSeasonFirstEndTime"/>
         <result column="rain_season_second_start_time" property="rainSeasonSecondStartTime"/>
         <result column="rain_season_second_end_time" property="rainSeasonSecondEndTime"/>
-        <result column="remark" property="remark"/>
+        <result column="plan_desc" property="planDesc"/>
+        <result column="batch_id" property="batchId"/>
+
     </resultMap>
 
 </mapper>

+ 210 - 199
src/main/java/org/springblade/modules/business/equipment/inspection/report/controller/EquipmentInspectionReportController.java

@@ -29,10 +29,12 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.ConcurrentDateFormat;
 import org.springblade.core.tool.utils.Func;
 
+import org.springblade.enums.InspectionStatusEnum;
 import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
 import org.springblade.modules.baseinfo.org.service.IDeptRegionService;
 import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
 import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
+import org.springblade.modules.business.equipment.inspection.base.dto.EquipmentInspectionInfoDTO;
 import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
 import org.springblade.modules.business.equipment.inspection.base.service.IEquipmentInspectionService;
 import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
@@ -232,208 +234,217 @@ public class EquipmentInspectionReportController extends BladeController {
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增", notes = "传入实体类EquipmentInspectionReportEntity ")
 	public R save(@RequestBody EquipmentInspectionReportEntity inspectionReportEntity) {
-		BladeUser user = AuthUtil.getUser();
-		Calendar dt = Calendar.getInstance();
-		dt.setTime(new Date());
-		Calendar calendarStart = Calendar.getInstance();
-		Calendar calendarEnd = Calendar.getInstance();
-		inspectionReportEntity.setRainSeasonKind(0);
-		String rainSeasonText = "";
-		//处理汛期类别
-		LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
-		wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted, 0);
-		wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
-		List<EquipmentInspectionPlanEntity> list = planService.list(wrapper);
-		if (null != list && list.size() > 0) {
-			EquipmentInspectionPlanEntity entity = list.get(0);
-			//汛前上报
-			calendarStart.setTime(entity.getBeforeRainSeasonStartTime());
-			calendarEnd.setTime(entity.getBeforeRainSeasonEndTime());
-			rainSeasonText += "汛前巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
-			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-				inspectionReportEntity.setRainSeasonKind(1);
-			}
-			//汛中第一次上报
-			calendarStart.setTime(entity.getRainSeasonFirstStartTime());
-			calendarEnd.setTime(entity.getRainSeasonFirstEndTime());
-			rainSeasonText += ",汛中(一)巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
-			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-				inspectionReportEntity.setRainSeasonKind(2);
-			}
-			//汛中第二次上报
-			calendarStart.setTime(entity.getRainSeasonSecondStartTime());
-			calendarEnd.setTime(entity.getRainSeasonSecondEndTime());
-			rainSeasonText += ",汛中(二)巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
-			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-				inspectionReportEntity.setRainSeasonKind(3);
-			}
-		} else {
-			//汛前上报
-			calendarStart.setTime(dt.getTime());
-			calendarStart.set(Calendar.MONTH, 4 - 1);
-			calendarStart.set(Calendar.DAY_OF_MONTH, 1);
-			calendarStart.set(Calendar.HOUR_OF_DAY, 0);
-			calendarStart.set(Calendar.MINUTE, 0);
-			calendarStart.set(Calendar.SECOND, 0);
-			calendarEnd.setTime(dt.getTime());
-			calendarEnd.set(Calendar.MONTH, 6 - 1);
-			calendarEnd.set(Calendar.DAY_OF_MONTH, 1);
-			calendarEnd.set(Calendar.HOUR_OF_DAY, 0);
-			calendarEnd.set(Calendar.MINUTE, 0);
-			calendarEnd.set(Calendar.SECOND, 0);
-			rainSeasonText += "汛前巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
-			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-				inspectionReportEntity.setRainSeasonKind(1);
-			}
-			//汛中第一次上报
-			calendarStart.setTime(dt.getTime());
-			calendarStart.set(Calendar.MONTH, 6 - 1);
-			calendarStart.set(Calendar.DAY_OF_MONTH, 1);
-			calendarStart.set(Calendar.HOUR_OF_DAY, 0);
-			calendarStart.set(Calendar.MINUTE, 0);
-			calendarStart.set(Calendar.SECOND, 0);
-			calendarEnd.setTime(dt.getTime());
-			calendarEnd.set(Calendar.MONTH, 8 - 1);
-			calendarEnd.set(Calendar.DAY_OF_MONTH, 15);
-			calendarEnd.set(Calendar.HOUR_OF_DAY, 0);
-			calendarEnd.set(Calendar.MINUTE, 0);
-			calendarEnd.set(Calendar.SECOND, 0);
-			rainSeasonText += ",汛中(一)巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
-			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-				inspectionReportEntity.setRainSeasonKind(2);
-			}
-			//汛中第二次上报
-			calendarStart.setTime(dt.getTime());
-			calendarStart.set(Calendar.MONTH, 8 - 1);
-			calendarStart.set(Calendar.DAY_OF_MONTH, 15);
-			calendarStart.set(Calendar.HOUR_OF_DAY, 0);
-			calendarStart.set(Calendar.MINUTE, 0);
-			calendarStart.set(Calendar.SECOND, 0);
-			calendarEnd.setTime(dt.getTime());
-			calendarEnd.set(Calendar.MONTH, 10 - 1);
-			calendarEnd.set(Calendar.DAY_OF_MONTH, 1);
-			calendarEnd.set(Calendar.HOUR_OF_DAY, 0);
-			calendarEnd.set(Calendar.MINUTE, 0);
-			calendarEnd.set(Calendar.SECOND, 0);
-			rainSeasonText += ",汛中(二)巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
-			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
-				inspectionReportEntity.setRainSeasonKind(3);
-			}
-		}
-		if (inspectionReportEntity.getRainSeasonKind() == 0) {
-			Map<String, Object> d = new HashMap<>();
-			d.put("code", 1);
-			d.put("msg", "当前不在汛期填报期(" + rainSeasonText + "),请确认!");
-			return R.data(d);
-		}
-		//处理遗留问题
-		String remainQuestion = inspectionReportEntity.getRemainQuestion();
-		if (remainQuestion != null && remainQuestion.length() > 0) {
-			inspectionReportEntity.setRemainQuestionState(1);
-		}
-		EquipmentInspectionInfoEntity infoEntity = new EquipmentInspectionInfoEntity();
-		infoEntity.setInspectionDate(new Date());
-		//查找是否有主表记录
-		calendarStart = Calendar.getInstance();
-		calendarStart.setTime(dt.getTime());
-		calendarEnd = Calendar.getInstance();
-		calendarEnd.setTime(dt.getTime());
-		calendarStart.set(Calendar.MONTH, 0);
-		calendarStart.set(Calendar.DAY_OF_MONTH, 1);
-		calendarEnd.add(Calendar.YEAR, 1);
-		calendarEnd.set(Calendar.MONTH, 0);
-		calendarEnd.set(Calendar.DAY_OF_MONTH, 1);
-		LambdaQueryWrapper<EquipmentInspectionInfoEntity> infowrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
-		infowrapper.eq(EquipmentInspectionInfoEntity::getIsDeleted, 0);
-		infowrapper.eq(EquipmentInspectionInfoEntity::getRtuCode, inspectionReportEntity.getRtuCode());
-		infowrapper.ge(EquipmentInspectionInfoEntity::getInspectionDate, Func.formatDate(calendarStart.getTime()));
-		infowrapper.lt(EquipmentInspectionInfoEntity::getInspectionDate, Func.formatDate(calendarEnd.getTime()));
-		List<EquipmentInspectionInfoEntity> infoEntityList = inspectionService.list(infowrapper);
-		if (null != infoEntityList && infoEntityList.size() == 1) {
-			infoEntity = infoEntityList.get(0);
-		} else {
-			infoEntity.setRtuCode(inspectionReportEntity.getRtuCode());
-		}
-		infoEntity.setInspectionDate(dt.getTime());
-		//写入填报子表,判断当前汛期是否已经填报
-		if (1 == inspectionReportEntity.getRainSeasonKind()) {
-			if (infoEntity.getBeforeRainSeasonStatus() != null && infoEntity.getBeforeRainSeasonStatus() == 1) {
-				Map<String, Object> d = new HashMap<>();
-				d.put("code", 1);
-				d.put("msg", "汛前巡检已填报,请勿重复上报!");
-				return R.data(d);
-			}
-		} else if (2 == inspectionReportEntity.getRainSeasonKind()) {
-			if (infoEntity.getRainSeasonFirstStatus() != null && infoEntity.getRainSeasonFirstStatus() == 1) {
-				Map<String, Object> d = new HashMap<>();
-				d.put("code", 1);
-				d.put("msg", "汛中(一)巡检已填报,请勿重复上报!");
-				return R.data(d);
-			}
-		} else if (3 == inspectionReportEntity.getRainSeasonKind()) {
-			if (infoEntity.getRainSeasonSecondStatus() != null && infoEntity.getRainSeasonSecondStatus() == 1) {
-				Map<String, Object> d = new HashMap<>();
-				d.put("code", 1);
-				d.put("msg", "汛中(二)巡检已填报,请勿重复上报!");
-				return R.data(d);
-			}
-		}
-		reportService.save(inspectionReportEntity);
-		if (1 == inspectionReportEntity.getRainSeasonKind()) {
-			infoEntity.setBeforeRainSeasonReportId(inspectionReportEntity.getId());
-			infoEntity.setBeforeRainSeasonStatus(1);
-			infoEntity.setBeforeRainSeasonReportTime(infoEntity.getInspectionDate());
-			infoEntity.setBeforeRainSeasonReportUser(user.getUserId());
-		} else if (2 == inspectionReportEntity.getRainSeasonKind()) {
-			infoEntity.setRainSeasonFirstReportId(inspectionReportEntity.getId());
-			infoEntity.setRainSeasonFirstStatus(1);
-			infoEntity.setRainSeasonFirstReportTime(infoEntity.getInspectionDate());
-			infoEntity.setRainSeasonFirstReportUser(user.getUserId());
-		} else if (3 == inspectionReportEntity.getRainSeasonKind()) {
-			infoEntity.setRainSeasonSecondReportId(inspectionReportEntity.getId());
-			infoEntity.setRainSeasonSecondStatus(1);
-			infoEntity.setRainSeasonSecondReportTime(infoEntity.getInspectionDate());
-			infoEntity.setRainSeasonSecondReportUser(user.getUserId());
-		}
-		inspectionService.saveOrUpdate(infoEntity);
-
-		EquipmentInspectionReportEntity reportEntity = reportService.getById(inspectionReportEntity.getId());
-		reportEntity.setInspectionId(infoEntity.getId());
-		reportService.updateById(reportEntity);
-
-		//更新更换信息
-		LambdaQueryWrapper<RtuInfoEntity> rtuWrapper = Wrappers.<RtuInfoEntity>query().lambda();
-		rtuWrapper.eq(RtuInfoEntity::getIsDeleted, 0);
-		rtuWrapper.eq(RtuInfoEntity::getRtuCode, infoEntity.getRtuCode());
-		RtuInfoEntity rtuInfoEntity = rtuBaseInfoService.getOne(rtuWrapper);
-		if (inspectionReportEntity.getRtuReplace() != null && inspectionReportEntity.getRtuReplace() == 1) {
-			rtuInfoEntity.setRtuReplaceDate(inspectionReportEntity.getCreateTime());
-			rtuInfoEntity.setRtuModel(inspectionReportEntity.getRtuModelRemark());
-		}
-		if (inspectionReportEntity.getRainSensorReplace() != null && inspectionReportEntity.getRainSensorReplace() == 1) {
-			rtuInfoEntity.setRainSensorReplaceDate(inspectionReportEntity.getCreateTime());
-			rtuInfoEntity.setRainSensorModel(inspectionReportEntity.getRainSensorModelRemark());
-		}
-		if (inspectionReportEntity.getWaterSensorReplace() != null && inspectionReportEntity.getWaterSensorReplace() == 1) {
-			rtuInfoEntity.setWaterSensorReplaceDate(inspectionReportEntity.getCreateTime());
-			rtuInfoEntity.setWaterSensorModel(inspectionReportEntity.getWaterSensorModelRemark());
-		}
-		if (inspectionReportEntity.getGroundSensorReplace() != null && inspectionReportEntity.getGroundSensorReplace() == 1) {
-			rtuInfoEntity.setGroundSensorReplaceDate(inspectionReportEntity.getCreateTime());
-			rtuInfoEntity.setGroundSensorModel(inspectionReportEntity.getGroundSensorModelRemark());
-		}
-		if (inspectionReportEntity.getBatteryReplace() != null && inspectionReportEntity.getBatteryReplace() == 1) {
-			rtuInfoEntity.setBatteryReplaceDate(inspectionReportEntity.getCreateTime());
-			rtuInfoEntity.setBatteryModel(inspectionReportEntity.getBatteryModelRemark());
+		if (Func.isNull(inspectionReportEntity.getInspectionId())){
+			return R.fail("参数错误");
 		}
+		BladeUser user = AuthUtil.getUser();
 
-		rtuInfoEntity.setNetworkSimId(inspectionReportEntity.getNetworkSimId());
-		rtuInfoEntity.setNetworkPayer(inspectionReportEntity.getNetworkPayer());
+		reportService.save(inspectionReportEntity);
 
-		rtuBaseInfoService.updateById(rtuInfoEntity);
-		Map<String, Object> d = new HashMap<>();
-		d.put("code", 0);
-		return R.data(d);
+		EquipmentInspectionInfoEntity inspectionInfoEntity = inspectionService.getById(inspectionReportEntity.getInspectionId());
+		inspectionInfoEntity.setInspectionStatus(InspectionStatusEnum.STATUS_CLOSE_APPROVE.getCode());
+		inspectionService.updateById(inspectionInfoEntity);
+//		Calendar dt = Calendar.getInstance();
+//		dt.setTime(new Date());
+//		Calendar calendarStart = Calendar.getInstance();
+//		Calendar calendarEnd = Calendar.getInstance();
+//		inspectionReportEntity.setRainSeasonKind(0);
+//		String rainSeasonText = "";
+//		//处理汛期类别
+//		LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
+//		wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted, 0);
+//		wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
+//		List<EquipmentInspectionPlanEntity> list = planService.list(wrapper);
+//		if (null != list && list.size() > 0) {
+//			EquipmentInspectionPlanEntity entity = list.get(0);
+//			//汛前上报
+//			calendarStart.setTime(entity.getBeforeRainSeasonStartTime());
+//			calendarEnd.setTime(entity.getBeforeRainSeasonEndTime());
+//			rainSeasonText += "汛前巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
+//			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+//				inspectionReportEntity.setRainSeasonKind(1);
+//			}
+//			//汛中第一次上报
+//			calendarStart.setTime(entity.getRainSeasonFirstStartTime());
+//			calendarEnd.setTime(entity.getRainSeasonFirstEndTime());
+//			rainSeasonText += ",汛中(一)巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
+//			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+//				inspectionReportEntity.setRainSeasonKind(2);
+//			}
+//			//汛中第二次上报
+//			calendarStart.setTime(entity.getRainSeasonSecondStartTime());
+//			calendarEnd.setTime(entity.getRainSeasonSecondEndTime());
+//			rainSeasonText += ",汛中(二)巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
+//			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+//				inspectionReportEntity.setRainSeasonKind(3);
+//			}
+//		} else {
+//			//汛前上报
+//			calendarStart.setTime(dt.getTime());
+//			calendarStart.set(Calendar.MONTH, 4 - 1);
+//			calendarStart.set(Calendar.DAY_OF_MONTH, 1);
+//			calendarStart.set(Calendar.HOUR_OF_DAY, 0);
+//			calendarStart.set(Calendar.MINUTE, 0);
+//			calendarStart.set(Calendar.SECOND, 0);
+//			calendarEnd.setTime(dt.getTime());
+//			calendarEnd.set(Calendar.MONTH, 6 - 1);
+//			calendarEnd.set(Calendar.DAY_OF_MONTH, 1);
+//			calendarEnd.set(Calendar.HOUR_OF_DAY, 0);
+//			calendarEnd.set(Calendar.MINUTE, 0);
+//			calendarEnd.set(Calendar.SECOND, 0);
+//			rainSeasonText += "汛前巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
+//			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+//				inspectionReportEntity.setRainSeasonKind(1);
+//			}
+//			//汛中第一次上报
+//			calendarStart.setTime(dt.getTime());
+//			calendarStart.set(Calendar.MONTH, 6 - 1);
+//			calendarStart.set(Calendar.DAY_OF_MONTH, 1);
+//			calendarStart.set(Calendar.HOUR_OF_DAY, 0);
+//			calendarStart.set(Calendar.MINUTE, 0);
+//			calendarStart.set(Calendar.SECOND, 0);
+//			calendarEnd.setTime(dt.getTime());
+//			calendarEnd.set(Calendar.MONTH, 8 - 1);
+//			calendarEnd.set(Calendar.DAY_OF_MONTH, 15);
+//			calendarEnd.set(Calendar.HOUR_OF_DAY, 0);
+//			calendarEnd.set(Calendar.MINUTE, 0);
+//			calendarEnd.set(Calendar.SECOND, 0);
+//			rainSeasonText += ",汛中(一)巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
+//			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+//				inspectionReportEntity.setRainSeasonKind(2);
+//			}
+//			//汛中第二次上报
+//			calendarStart.setTime(dt.getTime());
+//			calendarStart.set(Calendar.MONTH, 8 - 1);
+//			calendarStart.set(Calendar.DAY_OF_MONTH, 15);
+//			calendarStart.set(Calendar.HOUR_OF_DAY, 0);
+//			calendarStart.set(Calendar.MINUTE, 0);
+//			calendarStart.set(Calendar.SECOND, 0);
+//			calendarEnd.setTime(dt.getTime());
+//			calendarEnd.set(Calendar.MONTH, 10 - 1);
+//			calendarEnd.set(Calendar.DAY_OF_MONTH, 1);
+//			calendarEnd.set(Calendar.HOUR_OF_DAY, 0);
+//			calendarEnd.set(Calendar.MINUTE, 0);
+//			calendarEnd.set(Calendar.SECOND, 0);
+//			rainSeasonText += ",汛中(二)巡检日期:" + Func.formatDate(calendarStart.getTime()) + "-" + Func.formatDate(calendarEnd.getTime());
+//			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+//				inspectionReportEntity.setRainSeasonKind(3);
+//			}
+//		}
+//		if (inspectionReportEntity.getRainSeasonKind() == 0) {
+//			Map<String, Object> d = new HashMap<>();
+//			d.put("code", 1);
+//			d.put("msg", "当前不在汛期填报期(" + rainSeasonText + "),请确认!");
+//			return R.data(d);
+//		}
+//		//处理遗留问题
+//		String remainQuestion = inspectionReportEntity.getRemainQuestion();
+//		if (remainQuestion != null && remainQuestion.length() > 0) {
+//			inspectionReportEntity.setRemainQuestionState(1);
+//		}
+//		EquipmentInspectionInfoEntity infoEntity = new EquipmentInspectionInfoEntity();
+//		infoEntity.setInspectionDate(new Date());
+//		//查找是否有主表记录
+//		calendarStart = Calendar.getInstance();
+//		calendarStart.setTime(dt.getTime());
+//		calendarEnd = Calendar.getInstance();
+//		calendarEnd.setTime(dt.getTime());
+//		calendarStart.set(Calendar.MONTH, 0);
+//		calendarStart.set(Calendar.DAY_OF_MONTH, 1);
+//		calendarEnd.add(Calendar.YEAR, 1);
+//		calendarEnd.set(Calendar.MONTH, 0);
+//		calendarEnd.set(Calendar.DAY_OF_MONTH, 1);
+//		LambdaQueryWrapper<EquipmentInspectionInfoEntity> infowrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
+//		infowrapper.eq(EquipmentInspectionInfoEntity::getIsDeleted, 0);
+//		infowrapper.eq(EquipmentInspectionInfoEntity::getRtuCode, inspectionReportEntity.getRtuCode());
+//		infowrapper.ge(EquipmentInspectionInfoEntity::getInspectionDate, Func.formatDate(calendarStart.getTime()));
+//		infowrapper.lt(EquipmentInspectionInfoEntity::getInspectionDate, Func.formatDate(calendarEnd.getTime()));
+//		List<EquipmentInspectionInfoEntity> infoEntityList = inspectionService.list(infowrapper);
+//		if (null != infoEntityList && infoEntityList.size() == 1) {
+//			infoEntity = infoEntityList.get(0);
+//		} else {
+//			infoEntity.setRtuCode(inspectionReportEntity.getRtuCode());
+//		}
+//		infoEntity.setInspectionDate(dt.getTime());
+//		//写入填报子表,判断当前汛期是否已经填报
+//		if (1 == inspectionReportEntity.getRainSeasonKind()) {
+//			if (infoEntity.getBeforeRainSeasonStatus() != null && infoEntity.getBeforeRainSeasonStatus() == 1) {
+//				Map<String, Object> d = new HashMap<>();
+//				d.put("code", 1);
+//				d.put("msg", "汛前巡检已填报,请勿重复上报!");
+//				return R.data(d);
+//			}
+//		} else if (2 == inspectionReportEntity.getRainSeasonKind()) {
+//			if (infoEntity.getRainSeasonFirstStatus() != null && infoEntity.getRainSeasonFirstStatus() == 1) {
+//				Map<String, Object> d = new HashMap<>();
+//				d.put("code", 1);
+//				d.put("msg", "汛中(一)巡检已填报,请勿重复上报!");
+//				return R.data(d);
+//			}
+//		} else if (3 == inspectionReportEntity.getRainSeasonKind()) {
+//			if (infoEntity.getRainSeasonSecondStatus() != null && infoEntity.getRainSeasonSecondStatus() == 1) {
+//				Map<String, Object> d = new HashMap<>();
+//				d.put("code", 1);
+//				d.put("msg", "汛中(二)巡检已填报,请勿重复上报!");
+//				return R.data(d);
+//			}
+//		}
+//		reportService.save(inspectionReportEntity);
+//		if (1 == inspectionReportEntity.getRainSeasonKind()) {
+//			infoEntity.setBeforeRainSeasonReportId(inspectionReportEntity.getId());
+//			infoEntity.setBeforeRainSeasonStatus(1);
+//			infoEntity.setBeforeRainSeasonReportTime(infoEntity.getInspectionDate());
+//			infoEntity.setBeforeRainSeasonReportUser(user.getUserId());
+//		} else if (2 == inspectionReportEntity.getRainSeasonKind()) {
+//			infoEntity.setRainSeasonFirstReportId(inspectionReportEntity.getId());
+//			infoEntity.setRainSeasonFirstStatus(1);
+//			infoEntity.setRainSeasonFirstReportTime(infoEntity.getInspectionDate());
+//			infoEntity.setRainSeasonFirstReportUser(user.getUserId());
+//		} else if (3 == inspectionReportEntity.getRainSeasonKind()) {
+//			infoEntity.setRainSeasonSecondReportId(inspectionReportEntity.getId());
+//			infoEntity.setRainSeasonSecondStatus(1);
+//			infoEntity.setRainSeasonSecondReportTime(infoEntity.getInspectionDate());
+//			infoEntity.setRainSeasonSecondReportUser(user.getUserId());
+//		}
+//		inspectionService.saveOrUpdate(infoEntity);
+//
+//		EquipmentInspectionReportEntity reportEntity = reportService.getById(inspectionReportEntity.getId());
+//		reportEntity.setInspectionId(infoEntity.getId());
+//		reportService.updateById(reportEntity);
+//
+//		//更新更换信息
+//		LambdaQueryWrapper<RtuInfoEntity> rtuWrapper = Wrappers.<RtuInfoEntity>query().lambda();
+//		rtuWrapper.eq(RtuInfoEntity::getIsDeleted, 0);
+//		rtuWrapper.eq(RtuInfoEntity::getRtuCode, infoEntity.getRtuCode());
+//		RtuInfoEntity rtuInfoEntity = rtuBaseInfoService.getOne(rtuWrapper);
+//		if (inspectionReportEntity.getRtuReplace() != null && inspectionReportEntity.getRtuReplace() == 1) {
+//			rtuInfoEntity.setRtuReplaceDate(inspectionReportEntity.getCreateTime());
+//			rtuInfoEntity.setRtuModel(inspectionReportEntity.getRtuModelRemark());
+//		}
+//		if (inspectionReportEntity.getRainSensorReplace() != null && inspectionReportEntity.getRainSensorReplace() == 1) {
+//			rtuInfoEntity.setRainSensorReplaceDate(inspectionReportEntity.getCreateTime());
+//			rtuInfoEntity.setRainSensorModel(inspectionReportEntity.getRainSensorModelRemark());
+//		}
+//		if (inspectionReportEntity.getWaterSensorReplace() != null && inspectionReportEntity.getWaterSensorReplace() == 1) {
+//			rtuInfoEntity.setWaterSensorReplaceDate(inspectionReportEntity.getCreateTime());
+//			rtuInfoEntity.setWaterSensorModel(inspectionReportEntity.getWaterSensorModelRemark());
+//		}
+//		if (inspectionReportEntity.getGroundSensorReplace() != null && inspectionReportEntity.getGroundSensorReplace() == 1) {
+//			rtuInfoEntity.setGroundSensorReplaceDate(inspectionReportEntity.getCreateTime());
+//			rtuInfoEntity.setGroundSensorModel(inspectionReportEntity.getGroundSensorModelRemark());
+//		}
+//		if (inspectionReportEntity.getBatteryReplace() != null && inspectionReportEntity.getBatteryReplace() == 1) {
+//			rtuInfoEntity.setBatteryReplaceDate(inspectionReportEntity.getCreateTime());
+//			rtuInfoEntity.setBatteryModel(inspectionReportEntity.getBatteryModelRemark());
+//		}
+//
+//		rtuInfoEntity.setNetworkSimId(inspectionReportEntity.getNetworkSimId());
+//		rtuInfoEntity.setNetworkPayer(inspectionReportEntity.getNetworkPayer());
+//
+//		rtuBaseInfoService.updateById(rtuInfoEntity);
+//		Map<String, Object> d = new HashMap<>();
+//		d.put("code", 0);
+		return R.status(true);
 
 	}
 

+ 13 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/report/entity/EquipmentInspectionReportEntity.java

@@ -40,6 +40,12 @@ public class EquipmentInspectionReportEntity extends BaseEntity {
 	@ApiModelProperty("巡检主表ID")
 	private Long inspectionId;
 
+	/**
+	 * 巡检内容
+	 */
+	@ApiModelProperty("巡检内容")
+	private String inspectionDesc;
+
 	/**
 	 * 测站编码
 	 */
@@ -392,4 +398,11 @@ public class EquipmentInspectionReportEntity extends BaseEntity {
 	 */
 	@ApiModelProperty(value = "开卡单位")
 	private String networkPayer;
+
+	/**
+	 * 巡检视频
+	 */
+	@ApiModelProperty(value = "巡检视频")
+	private String inspectionVideos;
+
 }

+ 8 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/report/mapper/EquipmentInspectionReportMapper.xml

@@ -73,6 +73,10 @@
 
         <result column="network_sim_id" property="networkSimId"/>
         <result column="network_payer" property="networkPayer"/>
+
+        <result column="inspection_desc" property="inspectionDesc"/>
+
+        <result column="inspection_videos" property="inspectionVideos"/>
     </resultMap>
 
 
@@ -158,6 +162,10 @@
 
         <result column="network_sim_id" property="networkSimId"/>
         <result column="network_payer" property="networkPayer"/>
+
+        <result column="inspection_desc" property="inspectionDesc"/>
+
+        <result column="inspection_videos" property="inspectionVideos"/>
     </resultMap>
 
     <select id="selectList" resultMap="reportVOResultMap">

+ 14 - 2
src/main/java/org/springblade/modules/business/equipment/inspection/report/vo/EquipmentInspectionReportVO.java

@@ -100,11 +100,23 @@ public class EquipmentInspectionReportVO extends EquipmentInspectionReportEntity
 	private String rtuName;
 
 	/**
-	 * 填报人姓名
+	 * 处理人
 	 */
-	@ApiModelProperty("填报人姓名")
+	@ApiModelProperty("处理人")
 	private String servicePersonName;
 
+	/**
+	 * 处理时间
+	 */
+	@ApiModelProperty("处理时间")
+	@DateTimeFormat(
+			pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+			pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+	)
+	private Date inspectionReportTime;
+
 	/**
 	 * 机构名称
 	 */

+ 1 - 1
src/main/java/org/springblade/mq/kafka/constant/KafkaConstant.java

@@ -9,7 +9,7 @@ public interface KafkaConstant {
 	/**
 	 * 默认分区大小
 	 */
-	Integer DEFAULT_PARTITION_NUM = 3;
+	Integer DEFAULT_PARTITION_NUM = 1;
 
 	/**
 	 * Topic 名称

+ 120 - 0
src/main/java/org/springblade/task/InspectionPlanCheckTask.java

@@ -0,0 +1,120 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/5/22
+ */
+package org.springblade.task;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.enums.InspectionStatusEnum;
+import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
+import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
+import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
+import org.springblade.modules.business.equipment.inspection.base.service.IEquipmentInspectionService;
+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.warning.service.IRtuWarningService;
+
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+/***
+ * Date:2022/5/22
+ * Title: 巡检计划检查任务
+ * Description:
+ * @author swp
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+public class InspectionPlanCheckTask implements Callable<Integer> {
+
+    private IEquipmentInspectionPlanService planService;
+    private IEquipmentInspectionService inspectionService;
+    private LocalDateTime checkTime;
+
+    public InspectionPlanCheckTask(IEquipmentInspectionPlanService planService, IEquipmentInspectionService inspectionService, LocalDateTime checkTime) {
+        this.planService = planService;
+        this.inspectionService = inspectionService;
+        this.checkTime = checkTime;
+    }
+
+    @Override
+    public Integer call() {
+        try {
+            LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
+            wrapper.eq(EquipmentInspectionPlanEntity::getPlanStatus, 1);
+            wrapper.eq(EquipmentInspectionPlanEntity::getPlanScheduledType, 2);
+            List<EquipmentInspectionPlanEntity> planList = planService.list(wrapper);
+            if (Func.notNull(planList)) {
+                for (EquipmentInspectionPlanEntity planEntity : planList) {
+                    if (planEntity.getTimeType() == 1) {
+                        //按天
+                        LocalDate inspectionDate = checkTime.toLocalDate();
+                        LambdaQueryWrapper<EquipmentInspectionInfoEntity> inspectionWrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
+                        inspectionWrapper.eq(EquipmentInspectionInfoEntity::getInspectionPlanId, planEntity.getId());
+                        inspectionWrapper.eq(EquipmentInspectionInfoEntity::getInspectionDate, Date.from(inspectionDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
+                        inspectionWrapper.last("limit 1");
+                        EquipmentInspectionInfoEntity detail = inspectionService.getOne(inspectionWrapper);
+                        if (Func.isNull(detail)) {
+                            EquipmentInspectionInfoEntity dto = new EquipmentInspectionInfoEntity();
+                            dto.setInspectionPlanId(planEntity.getId());
+                            dto.setInspectionTitle(planEntity.getPlanTitle());
+                            dto.setInspectionStatus(InspectionStatusEnum.STATUS_TODO.getCode());
+                            dto.setInspectionDate(Date.from(inspectionDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
+                            inspectionService.save(dto);
+                        }
+                    } else if (planEntity.getTimeType() == 2) {
+                        //按周
+                        LocalDate inspectionDate = checkTime.toLocalDate();
+                        DayOfWeek dayOfWeek = inspectionDate.getDayOfWeek();
+                        int dayDifference = DayOfWeek.MONDAY.getValue() - dayOfWeek.getValue();
+                        LocalDate monday = inspectionDate.plusDays(dayDifference);
+                        LambdaQueryWrapper<EquipmentInspectionInfoEntity> inspectionWrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
+                        inspectionWrapper.eq(EquipmentInspectionInfoEntity::getInspectionPlanId, planEntity.getId());
+                        inspectionWrapper.eq(EquipmentInspectionInfoEntity::getInspectionDate, Date.from(monday.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
+                        inspectionWrapper.last("limit 1");
+                        EquipmentInspectionInfoEntity detail = inspectionService.getOne(inspectionWrapper);
+                        if (Func.isNull(detail)) {
+                            EquipmentInspectionInfoEntity dto = new EquipmentInspectionInfoEntity();
+                            dto.setInspectionPlanId(planEntity.getId());
+                            dto.setInspectionTitle(planEntity.getPlanTitle());
+                            dto.setInspectionStatus(InspectionStatusEnum.STATUS_TODO.getCode());
+                            dto.setInspectionDate(Date.from(monday.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
+                            inspectionService.save(dto);
+                        }
+                    } else if (planEntity.getTimeType() == 3) {
+                        //按月
+                        LocalDate inspectionDate = checkTime.toLocalDate().withDayOfMonth(1);
+                        LambdaQueryWrapper<EquipmentInspectionInfoEntity> inspectionWrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
+                        inspectionWrapper.eq(EquipmentInspectionInfoEntity::getInspectionPlanId, planEntity.getId());
+                        inspectionWrapper.eq(EquipmentInspectionInfoEntity::getInspectionDate, Date.from(inspectionDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
+                        inspectionWrapper.last("limit 1");
+                        EquipmentInspectionInfoEntity detail = inspectionService.getOne(inspectionWrapper);
+                        if (Func.isNull(detail)) {
+                            EquipmentInspectionInfoEntity dto = new EquipmentInspectionInfoEntity();
+                            dto.setInspectionPlanId(planEntity.getId());
+                            dto.setInspectionTitle(planEntity.getPlanTitle());
+                            dto.setInspectionStatus(InspectionStatusEnum.STATUS_TODO.getCode());
+                            dto.setInspectionDate(Date.from(inspectionDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
+                            inspectionService.save(dto);
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+
+        }
+        return 0;
+    }
+}

+ 20 - 0
src/main/java/org/springblade/task/TaskManager.java

@@ -10,12 +10,15 @@ package org.springblade.task;
 import lombok.extern.slf4j.Slf4j;
 import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder;
 import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
+import org.springblade.modules.business.equipment.inspection.base.service.IEquipmentInspectionService;
+import org.springblade.modules.business.equipment.inspection.plan.service.IEquipmentInspectionPlanService;
 import org.springblade.modules.business.warning.service.IRtuWarningService;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import java.time.LocalDateTime;
 import java.util.concurrent.*;
 
 /***
@@ -44,6 +47,12 @@ public class TaskManager {
 	@Resource
 	private IRtuWarningService rtuWarningService;
 
+	@Resource
+	private IEquipmentInspectionPlanService planService;
+
+	@Resource
+	private IEquipmentInspectionService inspectionService;
+
 	//@Scheduled(cron = "0 0/20 * * * * ")
 	public void warnTask() {
 		try {
@@ -66,6 +75,17 @@ public class TaskManager {
 		}
 	}
 
+	@Scheduled(cron = "0 0/5 * * * * ")
+	public void inspectionPlanCheckTask() {
+		try {
+			InspectionPlanCheckTask task = new InspectionPlanCheckTask(planService,inspectionService, LocalDateTime.now());
+			FutureTask<Integer> futureTask = new FutureTask<>(task);
+			publicThreadPool.execute(futureTask);
+		} catch (Exception e) {
+			log.error("{}", e.getMessage());
+		}
+	}
+
 	public void submitTask(FutureTask<Integer> futureTask) {
 		publicThreadPool.execute(futureTask);
 	}

+ 32 - 0
src/main/java/org/springblade/test/DataPack.java

@@ -0,0 +1,32 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期: 2022/4/20
+ */
+package org.springblade.test;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 创建日期: 2022/4/20
+ * Title: DCS完整数据包格式
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author DSH
+ * @mender:(文件的修改者,文件创建者之外的人)
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+public class DataPack implements Serializable {
+
+	/**  */
+	private DataPackHeader dataHeader;
+
+	/** 点数据 */
+	private List<DataPoint> dataBody;
+
+}

+ 39 - 0
src/main/java/org/springblade/test/DataPackHeader.java

@@ -0,0 +1,39 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期: 2022/4/28
+ */
+package org.springblade.test;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 创建日期: 2022/4/28
+ * Title: DCS数据包表头格式
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author DSH
+ * @mender:(文件的修改者,文件创建者之外的人)
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+public class DataPackHeader implements Serializable {
+
+	/** 当前一个完整数据包的大小,单位是字节(byte) */
+	private Long iSize;
+
+	/** 当前数据包所包含的数据点的个数 */
+	private Long iCount;
+
+	/**
+	 * 电厂标识
+	 */
+	private String power;
+
+	/** 机组标识 */
+	private String group;
+
+}

+ 53 - 0
src/main/java/org/springblade/test/DataPoint.java

@@ -0,0 +1,53 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期: 2022/4/22
+ */
+package org.springblade.test;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 创建日期: 2022/4/22
+ * Title: DCS单个数据点格式
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author DSH
+ * @mender:(文件的修改者,文件创建者之外的人)
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+//@NoArgsConstructor
+//@AllArgsConstructor
+public class DataPoint implements Serializable {
+
+	/** 点名 */
+	private String point;
+
+	/** 点类型信息,取值代表点的数据类型,1:整型 int32, 2:单精度型:float32, 3:bool 型 */
+	private Long type;
+
+	/** 值 */
+	private Double value;
+
+	/** 点值质量位 */
+	private Long quality;
+
+	/** 点值时间 */
+	private Long time;
+
+
+	public DataPoint() {
+	}
+
+	public DataPoint(String point, Long type, Double value, Long quality, Long time) {
+		this.point = point;
+		this.type = type;
+		this.value = value;
+		this.quality = quality;
+		this.time = time;
+	}
+}