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