From b839c6b725336b61648ce679485dfada8356b6df Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 18 Oct 2023 08:42:29 +0800 Subject: [PATCH 1/6] =?UTF-8?q?#=E6=B0=B4=E7=94=B5=E7=AB=99bug=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/controller/AlarmConfigDetailController.java | 6 +++--- .../config/service/impl/AlarmConfigDetailServiceImpl.java | 4 ++-- .../alert/service/impl/AbnormalAlarmServiceImpl.java | 14 ++++++++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/controller/AlarmConfigDetailController.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/controller/AlarmConfigDetailController.java index f7dffa0..0af8bd8 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/controller/AlarmConfigDetailController.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/controller/AlarmConfigDetailController.java @@ -34,10 +34,10 @@ public class AlarmConfigDetailController extends BladeController { return R.data(detailService.details(configId)); } - @PostMapping("/updateBatch") + @PostMapping("/saveUpdateBatch") @ApiOperationSupport(order = 6) @ApiOperation(value = "批量新增或修改", notes = "传入list") - public R updateBatch(@Valid @RequestBody List entitys) { - return R.status(detailService.updateBatch(entitys)); + public R updateBatch(@Valid @RequestBody AlarmConfigDetailEntity entitys) { + return R.status(detailService.saveOrUpdate(entitys)); } } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java index 1760be1..732edc8 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java @@ -41,10 +41,10 @@ public class AlarmConfigDetailServiceImpl extends BaseServiceImpl{ // HZ3000告警 if(AlarmConstants.HZ3000_ALARM.equals(source)){ - AlarmConstants.HZ3000_ALARAM_LIST.forEach(type-> batchs.add(this.superposition(entity,Integer.valueOf(source),type))); + AlarmConstants.HZ3000_ALARAM_LIST.forEach(type-> batchs.add(this.superposition(entity, source,type))); // 等级告警 }else if(AlarmConstants.LEVEL_ALARM.equals(source)){ - AlarmConstants.LEVEL_ALARAM.forEach(type-> batchs.add(this.superposition(entity,Integer.valueOf(source),type))); + AlarmConstants.LEVEL_ALARAM.forEach(type-> batchs.add(this.superposition(entity, source,type))); // 条件告警 }else if(AlarmConstants.CONDITION_ALARM.equals(source)){ batchs.add(this.superposition(entity, source,AlarmConstants.CONDITION)); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java index dd0c672..ab7f643 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java @@ -73,7 +73,7 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl soes = result.getData().getRecords(); + // 过滤已经当天存储得告警数据 + List history = historyAbnormalAlarmService.list(Wrappers.lambdaQuery() + .in(HistoryAbnormalAlarmEntity::getAlarmId,soes.stream().map(SoeData::getId).collect(Collectors.toList())) + .ge(HistoryAbnormalAlarmEntity::getStartTime,DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00") + ); + if(CollectionUtil.isNotEmpty(history)){ + soes = result.getData().getRecords().stream().filter(soe-> !history.stream().map(HistoryAbnormalAlarmEntity::getAlarmId).collect(Collectors.toList()).contains(soe.getId())).collect(Collectors.toList()); + } + // 遍历告警信息 - result.getData().getRecords().forEach(item -> { + soes.forEach(item -> { if(!AbnormalAlarmConstant.INTERRUPT_LIST.contains(item.getSoeType())){ return; } From b821e12d775aa9c616963877a9d9cee1b9b58be9 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 19 Oct 2023 10:22:51 +0800 Subject: [PATCH 2/6] =?UTF-8?q?#=E9=9B=86=E4=B8=AD=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E6=B6=88=E6=81=AFbug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/main/vo/RealDeviceVo.java | 3 ++ .../alert/service/AbnormalAlarmService.java | 1 + .../service/impl/AbnormalAlarmServiceImpl.java | 17 ++++++------ .../service/impl/RealMonitorServiceImpl.java | 32 +++++++++++++++------- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealDeviceVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealDeviceVo.java index 0522108..0107d84 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealDeviceVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealDeviceVo.java @@ -9,6 +9,9 @@ import java.util.List; @Data public class RealDeviceVo implements Serializable { + @ApiModelProperty("站点编码") + private String stationId; + @ApiModelProperty("设备编号") private String deviceCode; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AbnormalAlarmService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AbnormalAlarmService.java index f91b7a7..b75d835 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AbnormalAlarmService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AbnormalAlarmService.java @@ -7,6 +7,7 @@ import java.util.List; /** * 告警处理接口 + * @author ysj */ public interface AbnormalAlarmService extends BaseService { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java index ab7f643..62dff4b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java @@ -95,6 +95,8 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl { + // 告警内容站点名称包含处理 + List soeStation = stations.stream().filter(o->o.getCode().equals(item.getStation())).collect(Collectors.toList()); if(!AbnormalAlarmConstant.INTERRUPT_LIST.contains(item.getSoeType())){ return; } @@ -102,9 +104,10 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl stations) { + private void sendAlarmMessage(HistoryAbnormalAlarmEntity entity,List stations,String stationName) { if(StringUtil.isEmpty(entity.getStationId())){ return; } @@ -218,7 +217,7 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImplString.valueOf(o.getId())).distinct().collect(Collectors.joining(","))); message.setBusinessKey(MessageConstants.BusinessClassifyEnum.WARNING.getKey()); - message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription()); + message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription() + "-[" + stationName + "]"); message.setTaskId(entity.getId()); message.setTenantId("200000"); message.setContent(entity.getSoeExplain()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java index ecd45f6..411588c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java @@ -19,18 +19,13 @@ import com.hnac.hzims.operational.config.vo.StationRealVo; import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IWeatherService; -import com.hnac.hzims.operational.main.vo.JointRelayVo; -import com.hnac.hzims.operational.main.vo.WaterLevelVo; +import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.station.entity.StationAttributeEntity; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.service.IRealMonitorService; import com.hnac.hzims.operational.station.service.IStationAttrConfigService; import com.hnac.hzims.operational.station.service.IStationAttributeService; import com.hnac.hzims.operational.station.service.IStationService; -import com.hnac.hzims.operational.main.vo.RealAttributeVo; -import com.hnac.hzims.operational.main.vo.RealDeviceVo; -import com.hnac.hzims.operational.main.vo.RealStationVo; -import com.hnac.hzims.operational.main.vo.WeatherVo; import com.hnac.hzinfo.sdk.v5.redis.RedisClient; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -50,6 +45,7 @@ import org.springframework.web.socket.TextMessage; import javax.validation.constraints.NotNull; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.*; import java.util.concurrent.*; import java.util.stream.Collectors; @@ -433,8 +429,6 @@ public class RealMonitorServiceImpl implements IRealMonitorService { RealStationVo station = new RealStationVo(); // 站点编码 station.setStationCode(key); - // 设置站点状态 - this.setStationStatus(alarmList,station,key); // 名称、限制水位、服务类型、机构、排序 this.stationParam(stationEntityList,station,deptAll.getData()); // 根据设备名称分组 @@ -454,6 +448,8 @@ public class RealMonitorServiceImpl implements IRealMonitorService { this.getDeviceParam(emList, deviceClassifyMap, deviceList); // 运行设备状态设置 this.deviceState(deviceList); + // 设置站点状态 + this.setStationStatus(alarmList,station,key,deviceList); station.setDeviceList(deviceList.stream().sorted(Comparator.comparing((RealDeviceVo::getDeviceName))).collect(Collectors.toList())); stationList.add(station); }); @@ -503,8 +499,24 @@ public class RealMonitorServiceImpl implements IRealMonitorService { * @param station * @param key */ - private void setStationStatus(List alarmList, RealStationVo station, String key) { + private void setStationStatus(List alarmList, RealStationVo station, String key,List deviceList) { station.setStatus(0); + // 站点功率大于0为正常上送数据 + double powerSum = deviceList.stream().mapToDouble(o->{ + List attbts = o.getAttbtList(); + if(CollectionUtil.isEmpty(attbts)){ + return 0; + } + // 功率属性记录 + List powers = attbts.stream().filter(att-> HomePageConstant.powerList.contains(att.getName())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(powers)){ + return 0; + } + return powers.stream().filter(power-> !"0.000000".equals(power.getValue()) && !"-".equals(power.getValue()) && !HomePageConstant.ON.equals(power.getValue())).mapToDouble(value->Double.parseDouble(value.getValue())).sum(); + }).sum(); + if(powerSum > 0){ + return; + } if(alarmList.contains(key)){ station.setStatus(1); } @@ -975,7 +987,7 @@ public class RealMonitorServiceImpl implements IRealMonitorService { return; } // 获取设备中属性为P/p的value值总和 - powerSum += BigDecimal.valueOf(powerList.stream().mapToDouble(m -> Double.parseDouble(m.getValue())).sum()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + powerSum += BigDecimal.valueOf(powerList.stream().mapToDouble(m -> Double.parseDouble(m.getValue())).sum()).setScale(2, RoundingMode.HALF_UP).doubleValue(); } station.setPowerSum(powerSum); } From 610c68605c1e6a211b8a99430ce381ceabad81dc Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 19 Oct 2023 20:28:53 +0800 Subject: [PATCH 3/6] =?UTF-8?q?#=E9=9B=86=E4=B8=AD=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E6=B6=88=E6=81=AFbug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/census/vo/BusinessQueryVo.java | 23 +++++ .../scheduled/controller/ScheduledController.java | 35 +++++++ .../operation/home/impl/RealTargetServiceImpl.java | 12 +-- .../operation/monitor/impl/MonitorServiceImpl.java | 28 +++++- .../service/impl/AbnormalAlarmServiceImpl.java | 5 +- .../census/controller/TargetController.java | 25 +++++ .../operational/census/service/TargetService.java | 12 +++ .../census/service/impl/TargetServiceImpl.java | 101 ++++++++++++++++++++- 8 files changed, 223 insertions(+), 18 deletions(-) create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/BusinessQueryVo.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/controller/ScheduledController.java diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/BusinessQueryVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/BusinessQueryVo.java new file mode 100644 index 0000000..eb457ea --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/BusinessQueryVo.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.operational.census.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class BusinessQueryVo { + + @ApiModelProperty("开始时间") + private String startTime; + + @ApiModelProperty("结束时间") + private String endTime; + + @ApiModelProperty("查询机构") + private String deptIds; + + @ApiModelProperty("类型: 0-全部 1-完成") + private String type; +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/controller/ScheduledController.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/controller/ScheduledController.java new file mode 100644 index 0000000..aa3acaf --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/controller/ScheduledController.java @@ -0,0 +1,35 @@ +package com.hnac.hzims.scheduled.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.scheduled.service.operation.monitor.MonitorService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.log.annotation.ApiLog; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author ysj + */ +@RestController +@AllArgsConstructor +@RequestMapping("/scheduled") +@Api(value = "定时任务", tags = "定时任务") +public class ScheduledController { + + private final MonitorService service; + + @ApiLog + @ApiOperation("集中监控数据加载") + @GetMapping("/loadMonitoring") + @ApiOperationSupport(order = 1) + public R duty(@ApiParam(value = "机构Id", required = true) @RequestParam Long deptId) { + service.loadMonitoring("2023-10-19"); + return R.status(true); + } +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java index c026bb5..e9e9d73 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java @@ -672,9 +672,9 @@ public class RealTargetServiceImpl implements RealTargetService { * @return */ public List getActivePowerVoList(EminfoAndEmParamVo device) { - String startTime = DateUtil.format(new Date(), "yyyy-MM-dd 00:00:00"); - String endTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); - List datas = dataService.periodTargetData(startTime,endTime,2,6,device.getEmCode(),HomePageConstant.ACTIVE_POWER); + String startTime = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00"; + String endTime = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME); + List datas = dataService.periodTargetData(startTime,endTime,6,2,device.getEmCode(),HomePageConstant.ACTIVE_POWER); if(CollectionUtil.isEmpty(datas)){ return new ArrayList<>(); } @@ -697,10 +697,10 @@ public class RealTargetServiceImpl implements RealTargetService { * @return */ private List getUsrPowerVoList(EminfoAndEmParamVo device) { - String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00"; + String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME); Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.DAY_OF_MONTH,-29); - String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + calendar.add(Calendar.DATE,-29); + String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; List records = dataService.periodTargetData(start,end,5,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),device.getEmCode(),HomePageConstant.ELECTRICITY_CONSUMPTION); if(CollectionUtil.isEmpty(records)){ return new ArrayList<>(); diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java index bef56af..831dade 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java @@ -309,12 +309,10 @@ public class MonitorServiceImpl implements MonitorService { RealStationVo station = new RealStationVo(); // 站点编码 station.setStationCode(key); - // 设置站点状态 - this.setStationStatus(alarmList,station,key); // 名称、限制水位、服务类型、机构、排序 this.stationParam(stationEntityList,station,deptAll.getData()); // 根据设备名称分组 - Map> deviceAttbtMap = value.stream().filter(o -> !hideList.contains(o.getEmName())).collect(Collectors.groupingBy(StationAttributeEntity::getEmName)); + Map> deviceAttbtMap = value.stream().filter(o -> !StringUtil.isEmpty(o.getEmName()) && !hideList.contains(o.getEmName())).collect(Collectors.groupingBy(StationAttributeEntity::getEmName)); List deviceList = new ArrayList<>(); // device - 设备,arrbt - 设备重点属性 deviceAttbtMap.forEach((device, attbt) -> { @@ -330,6 +328,8 @@ public class MonitorServiceImpl implements MonitorService { this.getDeviceParam(devices, deviceClassifyMap, deviceList); // 运行设备状态设置 this.deviceState(deviceList); + // 设置站点状态 + this.setStationStatus(alarmList,station,key,deviceList); station.setDeviceList(deviceList.stream().sorted(Comparator.comparing((RealDeviceVo::getDeviceName))).collect(Collectors.toList())); stationList.add(station); }); @@ -394,14 +394,17 @@ public class MonitorServiceImpl implements MonitorService { // 设备属性列表 List attbts = device.getAttbtList(); if(CollectionUtil.isEmpty(attbts)){ + device.setState(-1); return; } // 功率属性记录 List powers = attbts.stream().filter(att-> HomePageConstant.powerList.contains(att.getName())).collect(Collectors.toList()); if(CollectionUtil.isEmpty(powers)){ + device.setState(-1); return; } if("0.000000".equals(powers.get(0).getValue()) || "-".equals(powers.get(0).getValue()) || HomePageConstant.ON.equals(powers.get(0).getValue())){ + device.setState(-1); return; } device.setState(1); @@ -675,8 +678,23 @@ public class MonitorServiceImpl implements MonitorService { * @param station * @param key */ - private void setStationStatus(List alarmList, RealStationVo station, String key) { - station.setStatus(0); + private void setStationStatus(List alarmList, RealStationVo station, String key,List deviceList) { + // 站点功率大于0为正常上送数据 + for(RealDeviceVo item : deviceList){ + if(!CollectionUtil.isEmpty(item.getAttbtList())){ + List powers = item.getAttbtList().stream().filter(att-> HomePageConstant.powerList.contains(att.getName())).collect(Collectors.toList()); + if(!CollectionUtil.isEmpty(powers)){ + for(RealAttributeVo attr : powers){ + if(!"-".equals(attr.getValue())){ + if(Double.parseDouble(attr.getValue()) > 0){ + station.setStatus(0); + return; + } + } + } + } + } + } if(alarmList.contains(key)){ station.setStatus(1); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java index 62dff4b..c4067ea 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java @@ -92,11 +92,12 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl !history.stream().map(HistoryAbnormalAlarmEntity::getAlarmId).collect(Collectors.toList()).contains(soe.getId())).collect(Collectors.toList()); } + if(CollectionUtil.isEmpty(soes)){ + return; + } // 遍历告警信息 soes.forEach(item -> { - // 告警内容站点名称包含处理 - List soeStation = stations.stream().filter(o->o.getCode().equals(item.getStation())).collect(Collectors.toList()); if(!AbnormalAlarmConstant.INTERRUPT_LIST.contains(item.getSoeType())){ return; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java index ce0d3c6..387f162 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java @@ -6,8 +6,11 @@ import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO; import com.hnac.hzims.operational.access.vo.OperAccessTaskVO; import com.hnac.hzims.operational.census.service.TargetService; import com.hnac.hzims.operational.census.vo.*; +import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity; +import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; +import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.models.auth.In; @@ -179,4 +182,26 @@ public class TargetController { @RequestParam(value = "type") Long type) { return R.data(service.dutyGroup(Condition.getPage(query),areaName,type)); } + + @ApiOperation("日常维护-数据关联") + @PostMapping("/maintenance") + @ApiOperationSupport(order = 15) + public R> maintenance(BusinessQueryVo business,Query query) { + return R.data(service.maintenance(Condition.getPage(query),business)); + } + + @ApiOperation("缺陷-数据关联") + @PostMapping("/phenomenon") + @ApiOperationSupport(order = 17) + public R> phenomenon(BusinessQueryVo business, Query query) { + return R.data(service.phenomenon(Condition.getPage(query),business)); + } + + @ApiOperation("检修任务-数据关联") + @PostMapping("/access") + @ApiOperationSupport(order = 17) + public R> access(BusinessQueryVo business,Query query) { + return R.data(service.access(Condition.getPage(query),business)); + } + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java index 9e1f889..7db6c60 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java @@ -2,10 +2,16 @@ package com.hnac.hzims.operational.census.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO; +import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.operational.access.vo.OperAccessTaskVO; import com.hnac.hzims.operational.census.vo.*; +import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity; +import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; +import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; +import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; +import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; @@ -59,4 +65,10 @@ public interface TargetService { // 集团工作牌/操作票 IPage dutyGroup(IPage page,String areaName, Long type); + + IPage maintenance(IPage page, BusinessQueryVo business); + + IPage phenomenon(IPage page, BusinessQueryVo business); + + IPage access(IPage page, BusinessQueryVo business); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java index ce44876..d79a891 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.operational.census.service.impl; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -10,13 +11,19 @@ import com.hnac.hzims.equipment.feign.IEmInfoClient; import com.hnac.hzims.equipment.feign.IPlanGenertionClient; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO; +import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.operational.access.service.IOperAccessTaskService; import com.hnac.hzims.operational.access.vo.OperAccessTaskVO; +import com.hnac.hzims.operational.access.wrapper.OperAccessTaskWrapper; import com.hnac.hzims.operational.census.constants.CensusConstant; import com.hnac.hzims.operational.census.service.TargetService; import com.hnac.hzims.operational.census.vo.WaterTargetVo; import com.hnac.hzims.operational.census.vo.*; +import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.service.IOperPhenomenonService; +import com.hnac.hzims.operational.defect.service.impl.OperPhenomenonServiceImpl; +import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; +import com.hnac.hzims.operational.defect.wrapper.OperPhenomenonWrapper; import com.hnac.hzims.operational.fill.entity.*; import com.hnac.hzims.operational.fill.service.*; import com.hnac.hzims.operational.main.constant.HomePageConstant; @@ -24,22 +31,22 @@ import com.hnac.hzims.operational.main.service.AreaService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; +import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; +import com.hnac.hzims.operational.maintenance.wrapper.OperMaintenanceTaskWrapper; import com.hnac.hzims.operational.report.vo.DutyDefectVO; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.ticket.allTicket.dto.TicketStatisticDTO; import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient; import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO; +import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo; import lombok.RequiredArgsConstructor; import org.apache.commons.collections4.MapUtils; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.core.tool.utils.DateUtil; -import org.springblade.core.tool.utils.ObjectUtil; -import org.springblade.core.tool.utils.StringUtil; +import org.springblade.core.tool.utils.*; import org.springblade.system.entity.Dept; import org.springblade.system.feign.ISysClient; import org.springframework.beans.factory.annotation.Value; @@ -800,7 +807,7 @@ public class TargetServiceImpl implements TargetService { return page; } // 获取设备集合 - List deviceClassifys = devices.stream().filter(device->detpIds.contains(device.getCreateDept())).sorted(Comparator.comparing(EmInfoEntity::getCreateDept)).map(device -> { + List deviceClassifys = devices.stream().filter(device->detpIds.contains(device.getCreateDept()) && "1".equals(device.getHomePageDisplay())).sorted(Comparator.comparing(EmInfoEntity::getCreateDept)).map(device -> { DeviceClassifyVo deviceClassify = new DeviceClassifyVo(); deviceClassify.setStationName(stations.stream().filter(o-> o.getRefDept().equals(device.getCreateDept())).collect(Collectors.toList()).get(0).getName()); deviceClassify.setDeviceName(device.getName()); @@ -1090,4 +1097,88 @@ public class TargetServiceImpl implements TargetService { calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND)); return DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); } + + /** + * 日常维护-数据关联 + * @param page + * @param business + * @return + */ + @Override + public IPage maintenance(IPage page, BusinessQueryVo business) { + Wrapper queryWrapper = new LambdaQueryWrapper() {{ + orderByDesc(OperMaintenanceTaskEntity::getDisposeTime); + if (!StringUtil.isEmpty(business.getStartTime())) { + ge(OperMaintenanceTaskEntity::getDisposeTime,business.getStartTime()); + } + if (!StringUtil.isEmpty(business.getEndTime())) { + le(OperMaintenanceTaskEntity::getDisposeTime,business.getEndTime()); + } + if(!StringUtil.isEmpty(business.getType()) && "1".equals(business.getType())){ + eq(OperMaintenanceTaskEntity::getFlowTaskName,"结束"); + } + if(!StringUtil.isEmpty(business.getDeptIds())){ + in(OperMaintenanceTaskEntity::getCreateDept, Func.toLongList(business.getDeptIds(),",")); + } + }}; + IPage pages = maintenanceTaskService.page(page,queryWrapper); + pages.setRecords(OperMaintenanceTaskWrapper.build().listVO(pages.getRecords())); + return pages; + } + + /** + * 现象任务-数据关联 + * @param page + * @param business + * @return + */ + @Override + public IPage phenomenon(IPage page, BusinessQueryVo business) { + Wrapper queryWrapper = new LambdaQueryWrapper() {{ + orderByDesc(OperPhenomenonEntity::getCreateTime); + if (!StringUtil.isEmpty(business.getStartTime())) { + ge(OperPhenomenonEntity::getCreateTime,business.getStartTime()); + } + if (!StringUtil.isEmpty(business.getEndTime())) { + le(OperPhenomenonEntity::getCreateTime,business.getEndTime()); + } + if(!StringUtil.isEmpty(business.getType()) && "1".equals(business.getType())){ + isNotNull(OperPhenomenonEntity::getHandleTaskId); + } + if(!StringUtil.isEmpty(business.getDeptIds())){ + in(OperPhenomenonEntity::getCreateDept, Func.toLongList(business.getDeptIds(),",")); + } + }}; + IPage pages = phenomenonService.page(page, queryWrapper); + pages.setRecords(OperPhenomenonWrapper.build().listVO(pages.getRecords())); + return pages; + } + + /** + * 检修任务-数据关联 + * @param page + * @param business + * @return + */ + @Override + public IPage access(IPage page, BusinessQueryVo business) { + Wrapper queryWrapper = new LambdaQueryWrapper() {{ + orderByDesc(OperAccessTaskEntity::getPlanStartTime); + if (!StringUtil.isEmpty(business.getStartTime())) { + ge(OperAccessTaskEntity::getPlanStartTime,business.getStartTime()); + } + if (!StringUtil.isEmpty(business.getEndTime())) { + le(OperAccessTaskEntity::getPlanStartTime,business.getEndTime()); + } + if(!StringUtil.isEmpty(business.getType()) && "1".equals(business.getType())){ + eq(OperAccessTaskEntity::getStatus,4); + } + if(!StringUtil.isEmpty(business.getDeptIds())){ + in(OperAccessTaskEntity::getCreateDept, Func.toLongList(business.getDeptIds(),",")); + } + }}; + IPage pages = accessTaskService.page(page, queryWrapper); + pages.setRecords(OperAccessTaskWrapper.build().listVOExtras(pages.getRecords())); + return pages; + } } From 97c2a3595f9e41307e577db9e4cd735c299f6101 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 19 Oct 2023 21:24:06 +0800 Subject: [PATCH 4/6] =?UTF-8?q?#=E9=9B=86=E4=B8=AD=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E6=B6=88=E6=81=AFbug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/census/vo/AccessAssociationVo.java | 16 +++++++++ .../census/vo/MaintenanceAssociationVo.java | 22 +++++++++++++ .../census/vo/MaintenancePhenomenonVo.java | 25 ++++++++++++++ .../census/controller/TargetController.java | 14 ++++---- .../operational/census/service/TargetService.java | 6 ++-- .../census/service/impl/TargetServiceImpl.java | 38 ++++++++++++++++++---- 6 files changed, 104 insertions(+), 17 deletions(-) create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AccessAssociationVo.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenanceAssociationVo.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenancePhenomenonVo.java diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AccessAssociationVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AccessAssociationVo.java new file mode 100644 index 0000000..26ee184 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AccessAssociationVo.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.operational.census.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author ysj + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class AccessAssociationVo extends BusinessQueryVo { + + @ApiModelProperty("任务名称") + private String name; +} \ No newline at end of file diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenanceAssociationVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenanceAssociationVo.java new file mode 100644 index 0000000..127e4e5 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenanceAssociationVo.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.operational.census.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author ysj + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class MaintenanceAssociationVo extends BusinessQueryVo { + + @ApiModelProperty("项目名称") + private String title; + + @ApiModelProperty("内容") + private String content; + + @ApiModelProperty("任务类型") + private String taskType; +} \ No newline at end of file diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenancePhenomenonVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenancePhenomenonVo.java new file mode 100644 index 0000000..ef0cdf5 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenancePhenomenonVo.java @@ -0,0 +1,25 @@ +package com.hnac.hzims.operational.census.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author ysj + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class MaintenancePhenomenonVo extends BusinessQueryVo { + + @ApiModelProperty("缺陷名称") + private String name; + + @ApiModelProperty("是否为缺陷") + private Integer isDefect; + + @ApiModelProperty("发现开始时间") + private String findStartTime; + + @ApiModelProperty("发现结束时间") + private String findEndTime; +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java index 387f162..e35dc15 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java @@ -184,23 +184,23 @@ public class TargetController { } @ApiOperation("日常维护-数据关联") - @PostMapping("/maintenance") + @GetMapping("/maintenance") @ApiOperationSupport(order = 15) - public R> maintenance(BusinessQueryVo business,Query query) { + public R> maintenance(MaintenanceAssociationVo business,Query query) { return R.data(service.maintenance(Condition.getPage(query),business)); } @ApiOperation("缺陷-数据关联") - @PostMapping("/phenomenon") - @ApiOperationSupport(order = 17) - public R> phenomenon(BusinessQueryVo business, Query query) { + @GetMapping("/phenomenon") + @ApiOperationSupport(order = 16) + public R> phenomenon(MaintenancePhenomenonVo business, Query query) { return R.data(service.phenomenon(Condition.getPage(query),business)); } @ApiOperation("检修任务-数据关联") - @PostMapping("/access") + @GetMapping("/access") @ApiOperationSupport(order = 17) - public R> access(BusinessQueryVo business,Query query) { + public R> access(AccessAssociationVo business,Query query) { return R.data(service.access(Condition.getPage(query),business)); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java index 7db6c60..ffe50ba 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java @@ -66,9 +66,9 @@ public interface TargetService { // 集团工作牌/操作票 IPage dutyGroup(IPage page,String areaName, Long type); - IPage maintenance(IPage page, BusinessQueryVo business); + IPage maintenance(IPage page, MaintenanceAssociationVo business); - IPage phenomenon(IPage page, BusinessQueryVo business); + IPage phenomenon(IPage page, MaintenancePhenomenonVo business); - IPage access(IPage page, BusinessQueryVo business); + IPage access(IPage page, AccessAssociationVo business); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java index d79a891..f4358c9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java @@ -21,7 +21,6 @@ import com.hnac.hzims.operational.census.vo.WaterTargetVo; import com.hnac.hzims.operational.census.vo.*; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.service.IOperPhenomenonService; -import com.hnac.hzims.operational.defect.service.impl.OperPhenomenonServiceImpl; import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; import com.hnac.hzims.operational.defect.wrapper.OperPhenomenonWrapper; import com.hnac.hzims.operational.fill.entity.*; @@ -1105,9 +1104,18 @@ public class TargetServiceImpl implements TargetService { * @return */ @Override - public IPage maintenance(IPage page, BusinessQueryVo business) { + public IPage maintenance(IPage page, MaintenanceAssociationVo business) { Wrapper queryWrapper = new LambdaQueryWrapper() {{ orderByDesc(OperMaintenanceTaskEntity::getDisposeTime); + if (!StringUtil.isEmpty(business.getTitle())) { + like(OperMaintenanceTaskEntity::getTitle, business.getTitle()); + } + if (!StringUtil.isEmpty(business.getTaskType())) { + eq(OperMaintenanceTaskEntity::getTaskType, business.getTaskType()); + } + if (!StringUtil.isEmpty(business.getContent())) { + like(OperMaintenanceTaskEntity::getContent, business.getContent()); + } if (!StringUtil.isEmpty(business.getStartTime())) { ge(OperMaintenanceTaskEntity::getDisposeTime,business.getStartTime()); } @@ -1118,7 +1126,7 @@ public class TargetServiceImpl implements TargetService { eq(OperMaintenanceTaskEntity::getFlowTaskName,"结束"); } if(!StringUtil.isEmpty(business.getDeptIds())){ - in(OperMaintenanceTaskEntity::getCreateDept, Func.toLongList(business.getDeptIds(),",")); + in(OperMaintenanceTaskEntity::getCreateDept, Func.toLongList(",",business.getDeptIds())); } }}; IPage pages = maintenanceTaskService.page(page,queryWrapper); @@ -1133,9 +1141,22 @@ public class TargetServiceImpl implements TargetService { * @return */ @Override - public IPage phenomenon(IPage page, BusinessQueryVo business) { + public IPage phenomenon(IPage page, MaintenancePhenomenonVo business) { Wrapper queryWrapper = new LambdaQueryWrapper() {{ orderByDesc(OperPhenomenonEntity::getCreateTime); + if (!StringUtil.isEmpty(business.getName())) { + like(OperPhenomenonEntity::getName,business.getName()); + } + if (!ObjectUtil.isEmpty(business.getIsDefect())) { + eq(OperPhenomenonEntity::getIsDefect,business.getIsDefect()); + } + + if (!StringUtil.isEmpty(business.getFindStartTime())) { + ge(OperPhenomenonEntity::getFindTime,business.getFindStartTime()); + } + if (!StringUtil.isEmpty(business.getFindEndTime())) { + le(OperPhenomenonEntity::getFindTime,business.getFindEndTime()); + } if (!StringUtil.isEmpty(business.getStartTime())) { ge(OperPhenomenonEntity::getCreateTime,business.getStartTime()); } @@ -1146,7 +1167,7 @@ public class TargetServiceImpl implements TargetService { isNotNull(OperPhenomenonEntity::getHandleTaskId); } if(!StringUtil.isEmpty(business.getDeptIds())){ - in(OperPhenomenonEntity::getCreateDept, Func.toLongList(business.getDeptIds(),",")); + in(OperPhenomenonEntity::getCreateDept, Func.toLongList(",",business.getDeptIds())); } }}; IPage pages = phenomenonService.page(page, queryWrapper); @@ -1161,9 +1182,12 @@ public class TargetServiceImpl implements TargetService { * @return */ @Override - public IPage access(IPage page, BusinessQueryVo business) { + public IPage access(IPage page, AccessAssociationVo business) { Wrapper queryWrapper = new LambdaQueryWrapper() {{ orderByDesc(OperAccessTaskEntity::getPlanStartTime); + if (!StringUtil.isEmpty(business.getName())) { + like(OperAccessTaskEntity::getName,business.getName()); + } if (!StringUtil.isEmpty(business.getStartTime())) { ge(OperAccessTaskEntity::getPlanStartTime,business.getStartTime()); } @@ -1174,7 +1198,7 @@ public class TargetServiceImpl implements TargetService { eq(OperAccessTaskEntity::getStatus,4); } if(!StringUtil.isEmpty(business.getDeptIds())){ - in(OperAccessTaskEntity::getCreateDept, Func.toLongList(business.getDeptIds(),",")); + in(OperAccessTaskEntity::getCreateDept, Func.toLongList(",",business.getDeptIds())); } }}; IPage pages = accessTaskService.page(page, queryWrapper); From be89067b6fbb57db2b00890a12fa2a30de0a2a48 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 20 Oct 2023 10:49:44 +0800 Subject: [PATCH 5/6] =?UTF-8?q?#=E6=93=8D=E4=BD=9C=E7=A5=A8=E3=80=81?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=A5=A8=E5=85=B3=E8=81=94=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../census/vo/MaintenancePhenomenonVo.java | 2 +- .../workTicket/entity/WorkTicketInfoEntity.java | 5 ++++ .../census/service/impl/TargetServiceImpl.java | 4 +-- .../controller/StandardTicketInfoController.java | 9 +++++++ .../mapper/StandardTicketInfoMapper.java | 6 +++++ .../mapper/xml/StandardTicketInfoMapper.xml | 7 +++++ .../service/IStandardTicketInfoService.java | 3 +++ .../impl/StandardTicketInfoServiceImpl.java | 29 +++++++++++++++++--- .../hzims/ticket/standardTicket/vo/OperateVo.java | 31 ++++++++++++++++++++++ .../controller/WorkTicketInfoController.java | 11 ++++++++ .../workTicket/mapper/WorkTicketInfoMapper.java | 3 +++ .../workTicket/mapper/xml/WorkTicketInfoMapper.xml | 8 ++++-- .../workTicket/service/IWorkTicketInfoService.java | 2 ++ .../service/impl/WorkTicketInfoServiceImpl.java | 24 +++++++++++++++-- .../hnac/hzims/ticket/workTicket/vo/WorkVO.java | 31 ++++++++++++++++++++++ 15 files changed, 164 insertions(+), 11 deletions(-) create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/OperateVo.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/vo/WorkVO.java diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenancePhenomenonVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenancePhenomenonVo.java index ef0cdf5..f352701 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenancePhenomenonVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenancePhenomenonVo.java @@ -12,7 +12,7 @@ import lombok.EqualsAndHashCode; public class MaintenancePhenomenonVo extends BusinessQueryVo { @ApiModelProperty("缺陷名称") - private String name; + private String faultName; @ApiModelProperty("是否为缺陷") private Integer isDefect; diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java index 5cba624..e669474 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.NullSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import io.swagger.models.auth.In; import lombok.*; import org.springblade.core.mp.support.QueryField; import org.springblade.core.mp.support.SqlCondition; @@ -486,4 +487,8 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable { @ApiModelProperty("每日开工和收工时间附页") private Boolean isStart; + @ApiModelProperty("是否合格 : 1-合格") + @TableField(exist=false) + private Integer isQualified; + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java index f4358c9..3213b3c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java @@ -1144,8 +1144,8 @@ public class TargetServiceImpl implements TargetService { public IPage phenomenon(IPage page, MaintenancePhenomenonVo business) { Wrapper queryWrapper = new LambdaQueryWrapper() {{ orderByDesc(OperPhenomenonEntity::getCreateTime); - if (!StringUtil.isEmpty(business.getName())) { - like(OperPhenomenonEntity::getName,business.getName()); + if (!StringUtil.isEmpty(business.getFaultName())) { + like(OperPhenomenonEntity::getFaultName,business.getFaultName()); } if (!ObjectUtil.isEmpty(business.getIsDefect())) { eq(OperPhenomenonEntity::getIsDefect,business.getIsDefect()); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java index 9303763..ee74cae 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java @@ -13,6 +13,7 @@ import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; +import com.hnac.hzims.ticket.standardTicket.vo.OperateVo; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -21,6 +22,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.mp.support.BladePage; +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.CollectionUtil; @@ -127,4 +129,11 @@ public class StandardTicketInfoController extends BladeController { standardTicketInfoService.areaMonthlyWithOperation(areaMonthlyVo, searchPage); return R.data(standardTicketInfoEntity); } + + @GetMapping("/operate") + @ApiOperationSupport(order = 90) + @ApiOperation(value = "操作票-关联数据") + public R> operate(OperateVo operate, Query query) { + return R.data(standardTicketInfoService.operate(Condition.getPage(query),operate)); + } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java index cf61c9f..48cd76e 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java @@ -1,11 +1,15 @@ package com.hnac.hzims.ticket.standardTicket.mapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO; +import com.hnac.hzims.ticket.standardTicket.vo.OperateVo; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.vo.SafeCheckStatisticVO; import org.apache.ibatis.annotations.Mapper; @@ -58,4 +62,6 @@ public interface StandardTicketInfoMapper extends UserDataScopeBaseMapper queryWrapper); List selectTicketList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + IPage pageCondition(IPage page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketInfoMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketInfoMapper.xml index 8b7359a..e4071b5 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketInfoMapper.xml +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketInfoMapper.xml @@ -87,4 +87,11 @@ left join hzims_ticket_info_evaluate tie on ti.id = tie.ticket_id and tie.is_deleted = 0 ${ew.customSqlSegment} + + diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java index ae6938e..39a9da9 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java @@ -8,6 +8,7 @@ import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; +import com.hnac.hzims.ticket.standardTicket.vo.OperateVo; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; import com.hnac.hzims.ticket.twoTicket.vo.ticket.StandardTicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountQueryVo; @@ -138,4 +139,6 @@ public interface IStandardTicketInfoService extends BaseService listByOperationTicketWithKeyword(Page entityPage, StandardTicketCountQueryVo ticketCountQueryVo); + + IPage operate(IPage page,OperateVo operate); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java index f67d3ea..0abc4f7 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java @@ -1,6 +1,7 @@ package com.hnac.hzims.ticket.standardTicket.service.impl; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity; import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService; import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO; @@ -25,6 +27,7 @@ import com.hnac.hzims.ticket.standardTicket.mapper.StandardTicketInfoMapper; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketMeasureService; import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO; +import com.hnac.hzims.ticket.standardTicket.vo.OperateVo; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketMeasureVO; import com.hnac.hzims.ticket.standardTicket.wrapper.StandardTicketInfoWrapper; @@ -49,10 +52,7 @@ import org.springblade.core.mp.support.Query; 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.CollectionUtil; -import org.springblade.core.tool.utils.DateUtil; -import org.springblade.core.tool.utils.Func; -import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.*; import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.vo.ComleteTask; import org.springblade.system.cache.DictCache; @@ -775,4 +775,25 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl operate(IPage page,OperateVo business) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.ge(Func.isNotEmpty(business.getStartTime()), "oper.create_time", business.getStartTime()); + queryWrapper.le(Func.isNotEmpty(business.getEndTime()), "oper.create_time", business.getEndTime()); + queryWrapper.in(Func.isNotEmpty(business.getDeptIds()), "oper.create_dept",Func.toLongList(",",business.getDeptIds())); + queryWrapper.like(Func.isNotEmpty(business.getCode()), "oper.code", business.getCode()); + queryWrapper.eq(Func.isNotEmpty(business.getTicketType()), "oper.ticket_type", business.getTicketType()); + queryWrapper.eq(Func.isNotEmpty(business.getStatus()), "eva.status", business.getStatus()); + IPage pages = this.baseMapper.pageCondition(page, queryWrapper); + pages.setRecords(StandardTicketInfoWrapper.build().listVO(pages.getRecords())); + return pages; + } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/OperateVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/OperateVo.java new file mode 100644 index 0000000..2f3daa7 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/OperateVo.java @@ -0,0 +1,31 @@ +package com.hnac.hzims.ticket.standardTicket.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author ysj + */ +@Data +@EqualsAndHashCode +public class OperateVo { + + @ApiModelProperty("开始时间") + private String startTime; + + @ApiModelProperty("结束时间") + private String endTime; + + @ApiModelProperty("机构Id") + private String deptIds; + + @ApiModelProperty("开票种类") + private String ticketType; + + @ApiModelProperty("操作票编码") + private String code; + + @ApiModelProperty("是否合格:0-合格 1-不合格") + private Integer status; +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java index 13feb97..ac39c3d 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java @@ -13,6 +13,8 @@ import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo; import com.hnac.hzims.ticket.constants.DictConstants; +import com.hnac.hzims.ticket.standardTicket.vo.OperateVo; +import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; import com.hnac.hzims.ticket.workTicket.dto.TicketAccessTaskDto; import com.hnac.hzims.ticket.workTicket.dto.WorkInfoFlowDto; import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto; @@ -20,10 +22,12 @@ import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketBillVO; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO; +import com.hnac.hzims.ticket.workTicket.vo.WorkVO; import io.swagger.annotations.*; import lombok.AllArgsConstructor; import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.mp.support.BladePage; +import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; @@ -207,5 +211,12 @@ public class WorkTicketInfoController { return R.data(workTicketInfoService.getWorkTicketBill(emCode, startTime, endTime)); } + @GetMapping("/work") + @ApiOperationSupport(order = 90) + @ApiOperation(value = "工作票-关联数据") + public R> work(WorkVO work, Query query) { + return R.data(workTicketInfoService.work(Condition.getPage(query),work)); + } + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java index 1133d28..5ba0278 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java @@ -1,6 +1,7 @@ package com.hnac.hzims.ticket.workTicket.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; @@ -70,4 +71,6 @@ public interface WorkTicketInfoMapper extends UserDataScopeBaseMapper selectTicketList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + IPage pageCondition(IPage page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml index dc78866..2f686d7 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml @@ -111,6 +111,10 @@ left join hzims_ticket_info_evaluate tie on ti.id = tie.ticket_id and tie.is_deleted = 0 ${ew.customSqlSegment} - - + diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java index d8c63a5..a1c924b 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java @@ -11,6 +11,7 @@ import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketBillVO; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO; +import com.hnac.hzims.ticket.workTicket.vo.WorkVO; import com.hnac.hzims.vo.SafeCheckStatisticVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.BladePage; @@ -180,4 +181,5 @@ public interface IWorkTicketInfoService extends BaseService listByTicketWithKeyword(Page entityPage, TicketCountQueryVo ticketCountQueryVo); + IPage work(IPage page, WorkVO work); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java index 5a34661..cbf588a 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java @@ -30,15 +30,15 @@ import com.hnac.hzims.ticket.twoTicket.entity.TicketInfoDanger; import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; import com.hnac.hzims.ticket.twoTicket.service.TicketInfoDangerService; import com.hnac.hzims.ticket.twoTicket.service.impl.WorkTicketFinishServiceImpl; -import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; +import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountQueryVo; import com.hnac.hzims.ticket.utils.ExcelUtil; +import com.hnac.hzims.ticket.utils.PdfUtils; import com.hnac.hzims.ticket.workTicket.dto.*; import com.hnac.hzims.ticket.workTicket.entity.*; import com.hnac.hzims.ticket.workTicket.mapper.WorkDelayNoScopeMapper; import com.hnac.hzims.ticket.workTicket.mapper.WorkTicketInfoMapper; import com.hnac.hzims.ticket.workTicket.service.*; -import com.hnac.hzims.ticket.utils.PdfUtils; import com.hnac.hzims.ticket.workTicket.vo.*; import com.hnac.hzims.ticket.workTicket.wrapper.WorkTicketDelayWrapper; import com.hnac.hzims.ticket.workTicket.wrapper.WorkTicketInfoWrapper; @@ -1205,4 +1205,24 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl work(IPage page, WorkVO business) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.ge(Func.isNotEmpty(business.getStartTime()), "works.create_time", business.getStartTime()); + queryWrapper.le(Func.isNotEmpty(business.getEndTime()), "works.create_time", business.getEndTime()); + queryWrapper.in(Func.isNotEmpty(business.getDeptIds()), "works.create_dept",Func.toLongList(",",business.getDeptIds())); + queryWrapper.like(Func.isNotEmpty(business.getCode()), "works.code", business.getCode()); + queryWrapper.eq(Func.isNotEmpty(business.getType()), "works.type", business.getType()); + queryWrapper.eq(Func.isNotEmpty(business.getStatus()), "eva.status", business.getStatus()); + IPage pages = this.baseMapper.pageCondition(page,queryWrapper); + pages.setRecords(WorkTicketInfoWrapper.build().listVO(pages.getRecords())); + return pages; + } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/vo/WorkVO.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/vo/WorkVO.java new file mode 100644 index 0000000..10ee16d --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/vo/WorkVO.java @@ -0,0 +1,31 @@ +package com.hnac.hzims.ticket.workTicket.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; + +/** + * @author ysj + */ +@Data +public class WorkVO { + + @ApiModelProperty("开始时间") + private String startTime; + + @ApiModelProperty("结束时间") + private String endTime; + + @ApiModelProperty("机构Id") + private String deptIds; + + @ApiModelProperty("工作票类型") + private String type; + + @ApiModelProperty("工作票编码") + private String code; + + @ApiModelProperty("状态") + private Integer status; +} From 646fdb9d0d7d70d503ff0e95e5f8dacc690cc546 Mon Sep 17 00:00:00 2001 From: tyty Date: Fri, 27 Oct 2023 18:37:16 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=8E=92=E7=8F=AD=E8=AE=A1=E5=88=92bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D-=E7=8F=AD=E7=BB=84=E9=95=BF=E5=8F=8A?= =?UTF-8?q?=E5=85=B6=E4=BA=BA=E5=91=98=E4=B8=BA=E7=A9=BA=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/duty/service/impl/ImsDutyMainServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java index 9e5f8b4..d55b882 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java @@ -304,6 +304,14 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl> rosters = imsSchedulingVo.getRosters(); + for (String s : rosters.keySet()) { + if (StringUtils.isBlank(s)){ + return R.fail("人员排班:无班组长信息,请稍后重试!"); + } + if (CollectionUtil.isEmpty(rosters.get(s))){ + return R.fail("人员排班:无人员信息,请稍后重试!"); + } + } groupIdsSplit = rosters.keySet().toArray(new String[0]); dutyNum = groupIdsSplit.length; } else {