diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/AlarmParam.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/AlarmParam.java index 47985d353..767cce69f 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/AlarmParam.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/AlarmParam.java @@ -16,7 +16,7 @@ import javax.validation.constraints.NotBlank; */ @Data @ApiModel -public class AlarmParam { +public class AlarmParam extends BaseParam{ @NotBlank(message = "起始时间不可为空") @DateTimeStrValid @@ -45,12 +45,4 @@ public class AlarmParam { @ApiModelProperty(name = "processTime",value = "处理时间") private String processTime; - - - - @ApiModelProperty("页码") - private Integer pageNum; - - @ApiModelProperty("页面尺寸") - private Integer pageSize; } diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/TerminalAlarmVO.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/TerminalAlarmVO.java index 996784b91..0abc8840d 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/TerminalAlarmVO.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/TerminalAlarmVO.java @@ -20,6 +20,7 @@ import java.time.LocalDateTime; public class TerminalAlarmVO implements Serializable { + // 变电站 private String subName; private String lineGrade; diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/LargeScreenController.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/LargeScreenController.java index 76a284514..69bf53884 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/LargeScreenController.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/LargeScreenController.java @@ -1,12 +1,10 @@ package com.njcn.device.pq.controller; -import cn.hutool.core.collection.CollectionUtil; import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; -import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO; import com.njcn.device.pq.pojo.param.LargeScreenParam; import com.njcn.device.pq.pojo.vo.MonitoringPointScaleVO; import com.njcn.device.pq.service.LargeScreenService; @@ -22,9 +20,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.List; -import java.util.Objects; - /** * @version 1.0.0 * @author: zbj @@ -44,11 +39,24 @@ public class LargeScreenController extends BaseController { */ @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("/getMonitoringPointScale") - @ApiOperation("监测点规模") - @ApiImplicitParam(name = "largeScreenParam", value = "查询终端条件", required = true) + @ApiOperation("监测点规模(区域)") + @ApiImplicitParam(name = "largeScreenParam", value = "监测点规模(区域)", required = true) public HttpResult getMonitoringPointScale(@RequestBody @Validated LargeScreenParam largeScreenParam) { String methodDescribe = getMethodDescribe("getMonitoringPointScale"); MonitoringPointScaleVO result = largeScreenService.getMonitoringPointScale(largeScreenParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); } + + /** + * 监测点规模 + */ + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/getLoadType") + @ApiOperation("监测点规模(负荷类型)") + @ApiImplicitParam(name = "getLoadType", value = "监测点规模(负荷类型)", required = true) + public HttpResult getLoadType(@RequestBody @Validated LargeScreenParam largeScreenParam) { + String methodDescribe = getMethodDescribe("getLoadType"); + MonitoringPointScaleVO result = largeScreenService.getLoadType(largeScreenParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); + } } \ No newline at end of file diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/AlarmMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/AlarmMapper.xml index 3e9678f21..1c499dbe6 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/AlarmMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/AlarmMapper.xml @@ -64,7 +64,7 @@ FROM f.NAME type, f.id typeId, f.`Level`, - max( a.Occurred_Time ) occurredTime, + max(a.Occurred_Time) occurredTime, e.NAME subName, b.NAME devLineName, b.id devLineId, diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LargeScreenService.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LargeScreenService.java index 8eac82b6c..16d3b7935 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LargeScreenService.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LargeScreenService.java @@ -1,10 +1,8 @@ package com.njcn.device.pq.service; -import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO; import com.njcn.device.pq.pojo.param.LargeScreenParam; import com.njcn.device.pq.pojo.vo.MonitoringPointScaleVO; -import java.util.List; /** * @version 1.0.0 @@ -15,4 +13,5 @@ public interface LargeScreenService { MonitoringPointScaleVO getMonitoringPointScale(LargeScreenParam largeScreenParam); + MonitoringPointScaleVO getLoadType(LargeScreenParam largeScreenParam); } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LargeScreenServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LargeScreenServiceImpl.java index 7e9fa9068..6d26219a5 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LargeScreenServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LargeScreenServiceImpl.java @@ -2,7 +2,6 @@ package com.njcn.device.pq.service.impl; import com.njcn.common.pojo.dto.SimpleDTO; import com.njcn.device.pq.mapper.LargeScreenMapper; -import com.njcn.device.pq.mapper.LineIntegrityDataMapper; import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO; import com.njcn.device.pq.pojo.param.DeviceInfoParam; import com.njcn.device.pq.pojo.param.LargeScreenParam; @@ -37,7 +36,7 @@ public class LargeScreenServiceImpl implements LargeScreenService { private final LargeScreenMapper largeScreenMapper; /** - * 监测点规模 + * 监测点规模(区域) */ @Override public MonitoringPointScaleVO getMonitoringPointScale(LargeScreenParam largeScreenParam) { @@ -49,7 +48,7 @@ public class LargeScreenServiceImpl implements LargeScreenService { deviceInfoParam.setDeptIndex(largeScreenParam.getDeptIndex()); //统计类型 SimpleDTO simpleDTO = new SimpleDTO(); - simpleDTO.setName(String.valueOf(StatisticsEnum.POWER_NETWORK)); + simpleDTO.setCode(String.valueOf(StatisticsEnum.POWER_NETWORK)); deviceInfoParam.setStatisticalType(simpleDTO); //添加时间 deviceInfoParam.setSearchBeginTime(largeScreenParam.getSearchBeginTime()); @@ -72,4 +71,37 @@ public class LargeScreenServiceImpl implements LargeScreenService { result.setMonitorAddCount(count.get("count").toString()); return result; } + + /** + * 监测点规模(负荷类型) + */ + @Override + public MonitoringPointScaleVO getLoadType(LargeScreenParam largeScreenParam) { + //创建返回VO + MonitoringPointScaleVO result = new MonitoringPointScaleVO(); + ArrayList list = new ArrayList<>(); + DeviceInfoParam.BusinessParam deviceInfoParam = new DeviceInfoParam.BusinessParam(); + //部门索引 + deviceInfoParam.setDeptIndex(largeScreenParam.getDeptIndex()); + //统计类型 + SimpleDTO simpleDTO = new SimpleDTO(); + simpleDTO.setCode(String.valueOf(StatisticsEnum.LOAD_TYPE)); + deviceInfoParam.setStatisticalType(simpleDTO); + //添加时间 + deviceInfoParam.setSearchBeginTime(largeScreenParam.getSearchBeginTime()); + deviceInfoParam.setSearchEndTime(largeScreenParam.getSearchEndTime()); + // 获取所有数据 + List generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList())); + + for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) { + MonitoringPointScaleParam param = new MonitoringPointScaleParam(); + param.setIndex(generalDeviceDTO.getIndex()); + param.setName(generalDeviceDTO.getName()); + param.setCount(generalDeviceDTO.getLineIndexes().size()); + list.add(param); + } + result.setParam(list); + return result; + } + } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java index ce6587d11..cacba3110 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java @@ -401,12 +401,6 @@ public class LineServiceImpl extends ServiceImpl implements Li if (CollectionUtils.isEmpty(deviceIndexes)) { continue; } - // 监测点流量统计 -// deviceList = lineMapper.getNewDeviceRunStatistics(lineIndexes, -// DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())), -// DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())), -// (deviceInfoParam.getPageNum()-1)*deviceInfoParam.getPageSize(), -// deviceInfoParam.getPageSize()); page = lineMapper.getNewDeviceRunStatistics( new Page(deviceInfoParam.getPageNum(), deviceInfoParam.getPageSize()), diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalAlarmServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalAlarmServiceImpl.java index 30aa20c4e..b41843f97 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalAlarmServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalAlarmServiceImpl.java @@ -29,19 +29,9 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService { @Override public Page alarmList(AlarmParam alarmParam) { - String sql = "SELECT last(dev_line_type) as dev_line_type,line_id ,type FROM pqs_alarm group by type,line_id,dev_line_type"; - - - - - - - - - - //Page page = new Page<>(PageFactory.getPageNum(alarmParam),PageFactory.getPageSize(alarmParam)); - //return alarmMapper.getAlarmInfo(page,PubUtils.beginTimeToLocalDateTime(alarmParam.getStartTime()),PubUtils.endTimeToLocalDateTime(alarmParam.getEndTime()),alarmParam.getFlag(),alarmParam.getType(),alarmParam.getAlarmLevel(),alarmParam.getLineGrade()); - return null; + // String sql = "SELECT last(dev_line_type) as dev_line_type,line_id ,type FROM pqs_alarm group by type,line_id,dev_line_type"; + Page page = new Page<>(PageFactory.getPageNum(alarmParam),PageFactory.getPageSize(alarmParam)); + return alarmMapper.getAlarmInfo(page,PubUtils.beginTimeToLocalDateTime(alarmParam.getStartTime()),PubUtils.endTimeToLocalDateTime(alarmParam.getEndTime()),alarmParam.getFlag(),alarmParam.getType(),alarmParam.getAlarmLevel(),alarmParam.getLineGrade()); } @Override diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java index 67f5f441c..e45562175 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java @@ -128,4 +128,7 @@ public class RGeneralSurveyPlanPO { @TableField(value = "upload_time") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date uploadTime; + @TableField(value = "create_person") + private String createPerson; + } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java index 7d8363c41..7969385fa 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java @@ -158,7 +158,7 @@ public class RGeneralSurveyPlanController extends BaseController { public HttpResult> queryPlan(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){ String methodDescribe = getMethodDescribe("queryPlan"); - IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("0","1","2","3").collect (Collectors.toList ())); + IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("0","1","2","3").collect (Collectors.toList ()),"1"); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe); } @@ -169,7 +169,7 @@ public class RGeneralSurveyPlanController extends BaseController { public HttpResult> queryPlanAudit(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){ String methodDescribe = getMethodDescribe("queryPlanAudit"); - IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("1","2").collect (Collectors.toList ())); + IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("1","2").collect (Collectors.toList ()),"2"); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe); } @@ -191,7 +191,7 @@ public class RGeneralSurveyPlanController extends BaseController { public HttpResult> queryPlanResult(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){ String methodDescribe = getMethodDescribe("queryPlanResult"); - IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("3","4").collect (Collectors.toList ())); + IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("3","4").collect (Collectors.toList ()),"3"); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe); } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java index 029abf2d2..df33a17b9 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java @@ -37,7 +37,7 @@ public interface RGeneralSurveyPlanPOService extends IMppService query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm,List statusList); + IPage query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm,List statusList,String type); /** * @Description: surveyResultUpload * @Param: [surveyResultUploadParam] diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java index f0fb43cd8..23467dc85 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java @@ -34,7 +34,9 @@ import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.pojo.po.DictData; import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.po.Dept; import com.njcn.user.pojo.vo.PvTerminalTreeVO; +import com.njcn.web.utils.RequestUtil; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -113,7 +115,11 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl queryWrapper = new QueryWrapper ( ); queryWrapper.lambda ( ).eq (RGeneralSurveyPlanDetail::getPlanNo, rGeneralSurveyPlanAddParm.getPlanNo ( )); @@ -149,11 +155,18 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm, List statusList) { + public IPage query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm, List statusList,String type) { IPage page = new Page<> (rGeneralSurveyPlanQueryParm.getCurrentPage ( ), rGeneralSurveyPlanQueryParm.getPageSize ( )); IPage returnpage = new Page<> (rGeneralSurveyPlanQueryParm.getCurrentPage ( ), rGeneralSurveyPlanQueryParm.getPageSize ( )); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<> ( ); + /*type=1:新建页面:查看自己负责的计划;type=2:审核页面:审核者==当前用户;结果页面:查看自己负责的计划*/ + if(type=="1"||type=="3"){ + queryWrapper.eq (RGeneralSurveyPlanPO::getCreatePerson,RequestUtil.getUserIndex ()); + } + if(type=="2"){ + queryWrapper.eq (RGeneralSurveyPlanPO::getCheckPerson,RequestUtil.getDeptIndex ()); + } if (!StringUtils.isEmpty (rGeneralSurveyPlanQueryParm.getOrgNo ( ))) { List data = deptFeignClient.getDepSonIdtByDeptId (rGeneralSurveyPlanQueryParm.getOrgNo ( )).getData ( ); @@ -382,7 +395,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl updateWrapper = new UpdateWrapper ( ); updateWrapper.eq ("plan_no", rGeneralSurveyPlanChcekParm.getPlanNo ( )); updateWrapper.set ("check_comment", rGeneralSurveyPlanChcekParm.getCheckComment ( )); - updateWrapper.set ("check_person", rGeneralSurveyPlanChcekParm.getCheckPerson ( )); +// updateWrapper.set ("check_person", rGeneralSurveyPlanChcekParm.getCheckPerson ( )); updateWrapper.set ("status", Objects.equals ("1", rGeneralSurveyPlanChcekParm.getCheckResult ( )) ? 3 : 2); result = this.update (updateWrapper); return result;