Browse Source

Merge remote-tracking branch 'origin/prod'

zhongwei
yang_shj 1 year ago
parent
commit
8b8ee7bc5a
  1. 16
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AccessAssociationVo.java
  2. 23
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/BusinessQueryVo.java
  3. 22
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenanceAssociationVo.java
  4. 25
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/MaintenancePhenomenonVo.java
  5. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealDeviceVo.java
  6. 5
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
  7. 35
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/controller/ScheduledController.java
  8. 12
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  9. 28
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  10. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AbnormalAlarmService.java
  11. 18
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java
  12. 25
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java
  13. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java
  14. 125
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
  15. 32
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java
  16. 9
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java
  17. 6
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java
  18. 7
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketInfoMapper.xml
  19. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java
  20. 29
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  21. 31
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/OperateVo.java
  22. 11
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java
  23. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java
  24. 8
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml
  25. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java
  26. 24
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java
  27. 31
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/vo/WorkVO.java

16
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;
}

23
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;
}

22
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;
}

25
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 faultName;
@ApiModelProperty("是否为缺陷")
private Integer isDefect;
@ApiModelProperty("发现开始时间")
private String findStartTime;
@ApiModelProperty("发现结束时间")
private String findEndTime;
}

3
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 @Data
public class RealDeviceVo implements Serializable { public class RealDeviceVo implements Serializable {
@ApiModelProperty("站点编码")
private String stationId;
@ApiModelProperty("设备编号") @ApiModelProperty("设备编号")
private String deviceCode; private String deviceCode;

5
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 com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.*; import lombok.*;
import org.springblade.core.mp.support.QueryField; import org.springblade.core.mp.support.QueryField;
import org.springblade.core.mp.support.SqlCondition; import org.springblade.core.mp.support.SqlCondition;
@ -486,4 +487,8 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable {
@ApiModelProperty("每日开工和收工时间附页") @ApiModelProperty("每日开工和收工时间附页")
private Boolean isStart; private Boolean isStart;
@ApiModelProperty("是否合格 : 1-合格")
@TableField(exist=false)
private Integer isQualified;
} }

35
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);
}
}

12
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 * @return
*/ */
public List<ActivePowerVo> getActivePowerVoList(EminfoAndEmParamVo device) { public List<ActivePowerVo> getActivePowerVoList(EminfoAndEmParamVo device) {
String startTime = DateUtil.format(new Date(), "yyyy-MM-dd 00:00:00"); String startTime = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00";
String endTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); String endTime = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
List<AnalyseDataTaosVO> datas = dataService.periodTargetData(startTime,endTime,2,6,device.getEmCode(),HomePageConstant.ACTIVE_POWER); List<AnalyseDataTaosVO> datas = dataService.periodTargetData(startTime,endTime,6,2,device.getEmCode(),HomePageConstant.ACTIVE_POWER);
if(CollectionUtil.isEmpty(datas)){ if(CollectionUtil.isEmpty(datas)){
return new ArrayList<>(); return new ArrayList<>();
} }
@ -697,10 +697,10 @@ public class RealTargetServiceImpl implements RealTargetService {
* @return * @return
*/ */
private List<UsrPowerVo> getUsrPowerVoList(EminfoAndEmParamVo device) { private List<UsrPowerVo> 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 calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-29); calendar.add(Calendar.DATE,-29);
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
List<AnalyseDataTaosVO> records = dataService.periodTargetData(start,end,5,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),device.getEmCode(),HomePageConstant.ELECTRICITY_CONSUMPTION); List<AnalyseDataTaosVO> records = dataService.periodTargetData(start,end,5,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),device.getEmCode(),HomePageConstant.ELECTRICITY_CONSUMPTION);
if(CollectionUtil.isEmpty(records)){ if(CollectionUtil.isEmpty(records)){
return new ArrayList<>(); return new ArrayList<>();

28
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(); RealStationVo station = new RealStationVo();
// 站点编码 // 站点编码
station.setStationCode(key); station.setStationCode(key);
// 设置站点状态
this.setStationStatus(alarmList,station,key);
// 名称、限制水位、服务类型、机构、排序 // 名称、限制水位、服务类型、机构、排序
this.stationParam(stationEntityList,station,deptAll.getData()); this.stationParam(stationEntityList,station,deptAll.getData());
// 根据设备名称分组 // 根据设备名称分组
Map<String, List<StationAttributeEntity>> deviceAttbtMap = value.stream().filter(o -> !hideList.contains(o.getEmName())).collect(Collectors.groupingBy(StationAttributeEntity::getEmName)); Map<String, List<StationAttributeEntity>> deviceAttbtMap = value.stream().filter(o -> !StringUtil.isEmpty(o.getEmName()) && !hideList.contains(o.getEmName())).collect(Collectors.groupingBy(StationAttributeEntity::getEmName));
List<RealDeviceVo> deviceList = new ArrayList<>(); List<RealDeviceVo> deviceList = new ArrayList<>();
// device - 设备,arrbt - 设备重点属性 // device - 设备,arrbt - 设备重点属性
deviceAttbtMap.forEach((device, attbt) -> { deviceAttbtMap.forEach((device, attbt) -> {
@ -330,6 +328,8 @@ public class MonitorServiceImpl implements MonitorService {
this.getDeviceParam(devices, deviceClassifyMap, deviceList); this.getDeviceParam(devices, deviceClassifyMap, deviceList);
// 运行设备状态设置 // 运行设备状态设置
this.deviceState(deviceList); this.deviceState(deviceList);
// 设置站点状态
this.setStationStatus(alarmList,station,key,deviceList);
station.setDeviceList(deviceList.stream().sorted(Comparator.comparing((RealDeviceVo::getDeviceName))).collect(Collectors.toList())); station.setDeviceList(deviceList.stream().sorted(Comparator.comparing((RealDeviceVo::getDeviceName))).collect(Collectors.toList()));
stationList.add(station); stationList.add(station);
}); });
@ -394,14 +394,17 @@ public class MonitorServiceImpl implements MonitorService {
// 设备属性列表 // 设备属性列表
List<RealAttributeVo> attbts = device.getAttbtList(); List<RealAttributeVo> attbts = device.getAttbtList();
if(CollectionUtil.isEmpty(attbts)){ if(CollectionUtil.isEmpty(attbts)){
device.setState(-1);
return; return;
} }
// 功率属性记录 // 功率属性记录
List<RealAttributeVo> powers = attbts.stream().filter(att-> HomePageConstant.powerList.contains(att.getName())).collect(Collectors.toList()); List<RealAttributeVo> powers = attbts.stream().filter(att-> HomePageConstant.powerList.contains(att.getName())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(powers)){ if(CollectionUtil.isEmpty(powers)){
device.setState(-1);
return; return;
} }
if("0.000000".equals(powers.get(0).getValue()) || "-".equals(powers.get(0).getValue()) || HomePageConstant.ON.equals(powers.get(0).getValue())){ if("0.000000".equals(powers.get(0).getValue()) || "-".equals(powers.get(0).getValue()) || HomePageConstant.ON.equals(powers.get(0).getValue())){
device.setState(-1);
return; return;
} }
device.setState(1); device.setState(1);
@ -675,8 +678,23 @@ public class MonitorServiceImpl implements MonitorService {
* @param station * @param station
* @param key * @param key
*/ */
private void setStationStatus(List<String> alarmList, RealStationVo station, String key) { private void setStationStatus(List<String> alarmList, RealStationVo station, String key,List<RealDeviceVo> deviceList) {
station.setStatus(0); // 站点功率大于0为正常上送数据
for(RealDeviceVo item : deviceList){
if(!CollectionUtil.isEmpty(item.getAttbtList())){
List<RealAttributeVo> 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)){ if(alarmList.contains(key)){
station.setStatus(1); station.setStatus(1);
} }

1
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<AbnormalAlarmEntity> { public interface AbnormalAlarmService extends BaseService<AbnormalAlarmEntity> {

18
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java

@ -92,6 +92,9 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
if(CollectionUtil.isNotEmpty(history)){ 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()); soes = result.getData().getRecords().stream().filter(soe-> !history.stream().map(HistoryAbnormalAlarmEntity::getAlarmId).collect(Collectors.toList()).contains(soe.getId())).collect(Collectors.toList());
} }
if(CollectionUtil.isEmpty(soes)){
return;
}
// 遍历告警信息 // 遍历告警信息
soes.forEach(item -> { soes.forEach(item -> {
@ -102,9 +105,10 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
}); });
// 历史数据处理 // 历史数据处理
this.saveHistoryAlarm(stations,result.getData().getRecords()); this.saveHistoryAlarm(stations,soes);
} }
/** /**
* 中断异常数据处理 * 中断异常数据处理
* @param stations * @param stations
@ -171,13 +175,9 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
entity.setStationId(item.getStation()); entity.setStationId(item.getStation());
entity.setStationName(stationName); entity.setStationName(stationName);
entity.setRealId(item.getRealId()); entity.setRealId(item.getRealId());
if(AbnormalAlarmConstant.INTERRUPT_LIST.contains(entity.getType())){
entity.setSoeExplain(stationName+ ":" + item.getSoeExplain());
}else{
entity.setSoeExplain(item.getSoeExplain());
}
entity.setType(item.getSoeType()); entity.setType(item.getSoeType());
entity.setStartTime(item.getTs()); entity.setStartTime(item.getTs());
entity.setSoeExplain(item.getSoeExplain());
if(AbnormalAlarmConstant.ABNORMAL_STATUS.equals(item.getSoeAlarmType())){ if(AbnormalAlarmConstant.ABNORMAL_STATUS.equals(item.getSoeAlarmType())){
entity.setStatus(1); entity.setStatus(1);
}else{ }else{
@ -191,7 +191,7 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
explains.add(item.getSoeExplain()); explains.add(item.getSoeExplain());
} }
// 发送消息 // 发送消息
this.sendAlarmMessage(entity,stations); this.sendAlarmMessage(entity,stations,stationName);
// 推送短信: 只推送拥有项目经理角色用户 // 推送短信: 只推送拥有项目经理角色用户
}; };
} }
@ -200,7 +200,7 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
* 告警消息推送 * 告警消息推送
* @param entity * @param entity
*/ */
private void sendAlarmMessage(HistoryAbnormalAlarmEntity entity,List<StationEntity> stations) { private void sendAlarmMessage(HistoryAbnormalAlarmEntity entity,List<StationEntity> stations,String stationName) {
if(StringUtil.isEmpty(entity.getStationId())){ if(StringUtil.isEmpty(entity.getStationId())){
return; return;
} }
@ -218,7 +218,7 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
message.setBusinessClassify("warning"); message.setBusinessClassify("warning");
message.setUserIds(users.stream().map(o->String.valueOf(o.getId())).distinct().collect(Collectors.joining(","))); message.setUserIds(users.stream().map(o->String.valueOf(o.getId())).distinct().collect(Collectors.joining(",")));
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.WARNING.getKey()); message.setBusinessKey(MessageConstants.BusinessClassifyEnum.WARNING.getKey());
message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription()); message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription() + "-[" + stationName + "]");
message.setTaskId(entity.getId()); message.setTaskId(entity.getId());
message.setTenantId("200000"); message.setTenantId("200000");
message.setContent(entity.getSoeExplain()); message.setContent(entity.getSoeExplain());

25
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.access.vo.OperAccessTaskVO;
import com.hnac.hzims.operational.census.service.TargetService; import com.hnac.hzims.operational.census.service.TargetService;
import com.hnac.hzims.operational.census.vo.*; 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.dto.OperMaintenanceTaskDTO;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
@ -179,4 +182,26 @@ public class TargetController {
@RequestParam(value = "type") Long type) { @RequestParam(value = "type") Long type) {
return R.data(service.dutyGroup(Condition.getPage(query),areaName,type)); return R.data(service.dutyGroup(Condition.getPage(query),areaName,type));
} }
@ApiOperation("日常维护-数据关联")
@GetMapping("/maintenance")
@ApiOperationSupport(order = 15)
public R<IPage<MaintenanceTaskVo>> maintenance(MaintenanceAssociationVo business,Query query) {
return R.data(service.maintenance(Condition.getPage(query),business));
}
@ApiOperation("缺陷-数据关联")
@GetMapping("/phenomenon")
@ApiOperationSupport(order = 16)
public R<IPage<OperPhenomenonVO>> phenomenon(MaintenancePhenomenonVo business, Query query) {
return R.data(service.phenomenon(Condition.getPage(query),business));
}
@ApiOperation("检修任务-数据关联")
@GetMapping("/access")
@ApiOperationSupport(order = 17)
public R<IPage<OperAccessTaskVO>> access(AccessAssociationVo business,Query query) {
return R.data(service.access(Condition.getPage(query),business));
}
} }

12
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.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO; 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.access.vo.OperAccessTaskVO;
import com.hnac.hzims.operational.census.vo.*; 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.dto.OperMaintenanceTaskDTO;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; 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.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -59,4 +65,10 @@ public interface TargetService {
// 集团工作牌/操作票 // 集团工作牌/操作票
IPage<DutyGroupVo> dutyGroup(IPage<DutyGroupVo> page,String areaName, Long type); IPage<DutyGroupVo> dutyGroup(IPage<DutyGroupVo> page,String areaName, Long type);
IPage<MaintenanceTaskVo> maintenance(IPage<OperMaintenanceTaskEntity> page, MaintenanceAssociationVo business);
IPage<OperPhenomenonVO> phenomenon(IPage<OperPhenomenonEntity> page, MaintenancePhenomenonVo business);
IPage<OperAccessTaskVO> access(IPage<OperAccessTaskEntity> page, AccessAssociationVo business);
} }

125
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; 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.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -10,13 +11,18 @@ import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.equipment.feign.IPlanGenertionClient; import com.hnac.hzims.equipment.feign.IPlanGenertionClient;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO; 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.service.IOperAccessTaskService;
import com.hnac.hzims.operational.access.vo.OperAccessTaskVO; 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.constants.CensusConstant;
import com.hnac.hzims.operational.census.service.TargetService; import com.hnac.hzims.operational.census.service.TargetService;
import com.hnac.hzims.operational.census.vo.WaterTargetVo; import com.hnac.hzims.operational.census.vo.WaterTargetVo;
import com.hnac.hzims.operational.census.vo.*; 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.IOperPhenomenonService;
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.entity.*;
import com.hnac.hzims.operational.fill.service.*; import com.hnac.hzims.operational.fill.service.*;
import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
@ -24,22 +30,22 @@ import com.hnac.hzims.operational.main.service.AreaService;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; 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.service.IOperMaintenanceTaskService;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; 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.report.vo.DutyDefectVO;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.ticket.allTicket.dto.TicketStatisticDTO; import com.hnac.hzims.ticket.allTicket.dto.TicketStatisticDTO;
import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient; import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO; import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.*;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Dept; import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient; import org.springblade.system.feign.ISysClient;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -800,7 +806,7 @@ public class TargetServiceImpl implements TargetService {
return page; return page;
} }
// 获取设备集合 // 获取设备集合
List<DeviceClassifyVo> deviceClassifys = devices.stream().filter(device->detpIds.contains(device.getCreateDept())).sorted(Comparator.comparing(EmInfoEntity::getCreateDept)).map(device -> { List<DeviceClassifyVo> deviceClassifys = devices.stream().filter(device->detpIds.contains(device.getCreateDept()) && "1".equals(device.getHomePageDisplay())).sorted(Comparator.comparing(EmInfoEntity::getCreateDept)).map(device -> {
DeviceClassifyVo deviceClassify = new DeviceClassifyVo(); DeviceClassifyVo deviceClassify = new DeviceClassifyVo();
deviceClassify.setStationName(stations.stream().filter(o-> o.getRefDept().equals(device.getCreateDept())).collect(Collectors.toList()).get(0).getName()); deviceClassify.setStationName(stations.stream().filter(o-> o.getRefDept().equals(device.getCreateDept())).collect(Collectors.toList()).get(0).getName());
deviceClassify.setDeviceName(device.getName()); deviceClassify.setDeviceName(device.getName());
@ -1090,4 +1096,113 @@ public class TargetServiceImpl implements TargetService {
calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND)); calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND));
return DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); return DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
} }
/**
* 日常维护-数据关联
* @param page
* @param business
* @return
*/
@Override
public IPage<MaintenanceTaskVo> maintenance(IPage<OperMaintenanceTaskEntity> page, MaintenanceAssociationVo business) {
Wrapper<OperMaintenanceTaskEntity> queryWrapper = new LambdaQueryWrapper<OperMaintenanceTaskEntity>() {{
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());
}
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<OperPhenomenonVO> phenomenon(IPage<OperPhenomenonEntity> page, MaintenancePhenomenonVo business) {
Wrapper<OperPhenomenonEntity> queryWrapper = new LambdaQueryWrapper<OperPhenomenonEntity>() {{
orderByDesc(OperPhenomenonEntity::getCreateTime);
if (!StringUtil.isEmpty(business.getFaultName())) {
like(OperPhenomenonEntity::getFaultName,business.getFaultName());
}
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());
}
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<OperAccessTaskVO> access(IPage<OperAccessTaskEntity> page, AccessAssociationVo business) {
Wrapper<OperAccessTaskEntity> queryWrapper = new LambdaQueryWrapper<OperAccessTaskEntity>() {{
orderByDesc(OperAccessTaskEntity::getPlanStartTime);
if (!StringUtil.isEmpty(business.getName())) {
like(OperAccessTaskEntity::getName,business.getName());
}
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;
}
} }

32
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.constant.HomePageConstant;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
import com.hnac.hzims.operational.main.service.IWeatherService; import com.hnac.hzims.operational.main.service.IWeatherService;
import com.hnac.hzims.operational.main.vo.JointRelayVo; import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.main.vo.WaterLevelVo;
import com.hnac.hzims.operational.station.entity.StationAttributeEntity; import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IRealMonitorService; import com.hnac.hzims.operational.station.service.IRealMonitorService;
import com.hnac.hzims.operational.station.service.IStationAttrConfigService; import com.hnac.hzims.operational.station.service.IStationAttrConfigService;
import com.hnac.hzims.operational.station.service.IStationAttributeService; import com.hnac.hzims.operational.station.service.IStationAttributeService;
import com.hnac.hzims.operational.station.service.IStationService; 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 com.hnac.hzinfo.sdk.v5.redis.RedisClient;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -50,6 +45,7 @@ import org.springframework.web.socket.TextMessage;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -433,8 +429,6 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
RealStationVo station = new RealStationVo(); RealStationVo station = new RealStationVo();
// 站点编码 // 站点编码
station.setStationCode(key); station.setStationCode(key);
// 设置站点状态
this.setStationStatus(alarmList,station,key);
// 名称、限制水位、服务类型、机构、排序 // 名称、限制水位、服务类型、机构、排序
this.stationParam(stationEntityList,station,deptAll.getData()); this.stationParam(stationEntityList,station,deptAll.getData());
// 根据设备名称分组 // 根据设备名称分组
@ -454,6 +448,8 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
this.getDeviceParam(emList, deviceClassifyMap, deviceList); this.getDeviceParam(emList, deviceClassifyMap, deviceList);
// 运行设备状态设置 // 运行设备状态设置
this.deviceState(deviceList); this.deviceState(deviceList);
// 设置站点状态
this.setStationStatus(alarmList,station,key,deviceList);
station.setDeviceList(deviceList.stream().sorted(Comparator.comparing((RealDeviceVo::getDeviceName))).collect(Collectors.toList())); station.setDeviceList(deviceList.stream().sorted(Comparator.comparing((RealDeviceVo::getDeviceName))).collect(Collectors.toList()));
stationList.add(station); stationList.add(station);
}); });
@ -503,8 +499,24 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
* @param station * @param station
* @param key * @param key
*/ */
private void setStationStatus(List<String> alarmList, RealStationVo station, String key) { private void setStationStatus(List<String> alarmList, RealStationVo station, String key,List<RealDeviceVo> deviceList) {
station.setStatus(0); station.setStatus(0);
// 站点功率大于0为正常上送数据
double powerSum = deviceList.stream().mapToDouble(o->{
List<RealAttributeVo> attbts = o.getAttbtList();
if(CollectionUtil.isEmpty(attbts)){
return 0;
}
// 功率属性记录
List<RealAttributeVo> 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)){ if(alarmList.contains(key)){
station.setStatus(1); station.setStatus(1);
} }
@ -975,7 +987,7 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
return; return;
} }
// 获取设备中属性为P/p的value值总和 // 获取设备中属性为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); station.setPowerSum(powerSum);
} }

9
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.dto.StandardTicketInfoDto;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; 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 com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; 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.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.BladePage; 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.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
@ -127,4 +129,11 @@ public class StandardTicketInfoController extends BladeController {
standardTicketInfoService.areaMonthlyWithOperation(areaMonthlyVo, searchPage); standardTicketInfoService.areaMonthlyWithOperation(areaMonthlyVo, searchPage);
return R.data(standardTicketInfoEntity); return R.data(standardTicketInfoEntity);
} }
@GetMapping("/operate")
@ApiOperationSupport(order = 90)
@ApiOperation(value = "操作票-关联数据")
public R<IPage<StandardTicketInfoVO>> operate(OperateVo operate, Query query) {
return R.data(standardTicketInfoService.operate(Condition.getPage(query),operate));
}
} }

6
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; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO; 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.ticket.workTicket.entity.WorkTicketInfoEntity;
import com.hnac.hzims.vo.SafeCheckStatisticVO; import com.hnac.hzims.vo.SafeCheckStatisticVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -58,4 +62,6 @@ public interface StandardTicketInfoMapper extends UserDataScopeBaseMapper<Standa
@Param(Constants.WRAPPER) QueryWrapper<StandardTicketInfoEntity> queryWrapper); @Param(Constants.WRAPPER) QueryWrapper<StandardTicketInfoEntity> queryWrapper);
List<Map> selectTicketList(@Param(Constants.WRAPPER) QueryWrapper<StandardTicketInfoEntity> queryWrapper); List<Map> selectTicketList(@Param(Constants.WRAPPER) QueryWrapper<StandardTicketInfoEntity> queryWrapper);
IPage<StandardTicketInfoEntity> pageCondition(IPage<StandardTicketInfoEntity> page, @Param(Constants.WRAPPER) QueryWrapper<StandardTicketInfoEntity> queryWrapper);
} }

7
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 left join hzims_ticket_info_evaluate tie on ti.id = tie.ticket_id and tie.is_deleted = 0
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>
<select id="pageCondition" resultType="com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity">
SELECT oper.*,eva.`status` isQualified FROM hzims_standard_ticket_info oper
LEFT JOIN hzims_ticket_info_evaluate eva
ON oper.id = eva.ticket_id
${ew.customSqlSegment}
</select>
</mapper> </mapper>

3
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.areamonthly.vo.StandardTicketWithAreaVo;
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; 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.standardTicket.vo.StandardTicketInfoVO;
import com.hnac.hzims.ticket.twoTicket.vo.ticket.StandardTicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.ticket.StandardTicketCountQueryVo;
import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountQueryVo;
@ -138,4 +139,6 @@ public interface IStandardTicketInfoService extends BaseService<StandardTicketIn
* @return * @return
*/ */
IPage<StandardTicketInfoVO> listByOperationTicketWithKeyword(Page<StandardTicketInfoEntity> entityPage, StandardTicketCountQueryVo ticketCountQueryVo); IPage<StandardTicketInfoVO> listByOperationTicketWithKeyword(Page<StandardTicketInfoEntity> entityPage, StandardTicketCountQueryVo ticketCountQueryVo);
IPage<StandardTicketInfoVO> operate(IPage<StandardTicketInfoEntity> page,OperateVo operate);
} }

29
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; package com.hnac.hzims.ticket.standardTicket.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams; 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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.entity.TicketInfoEvaluateEntity;
import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService; import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO; 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.IStandardTicketInfoService;
import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketMeasureService; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketMeasureService;
import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO; 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.StandardTicketInfoVO;
import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketMeasureVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketMeasureVO;
import com.hnac.hzims.ticket.standardTicket.wrapper.StandardTicketInfoWrapper; 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.BladeUser;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.*;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.vo.ComleteTask; import org.springblade.flow.core.vo.ComleteTask;
import org.springblade.system.cache.DictCache; import org.springblade.system.cache.DictCache;
@ -775,4 +775,25 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
page.setRecords(StandardTicketInfoWrapper.build().listVO(entityPage1.getRecords())); page.setRecords(StandardTicketInfoWrapper.build().listVO(entityPage1.getRecords()));
return page; return page;
} }
/**
* 操作票-关联数据
* @param page
* @param business
* @return
*/
@Override
public IPage<StandardTicketInfoVO> operate(IPage<StandardTicketInfoEntity> page,OperateVo business) {
QueryWrapper<StandardTicketInfoEntity> 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;
}
} }

31
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;
}

11
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.StandardTicketWithAreaVo;
import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo;
import com.hnac.hzims.ticket.constants.DictConstants; 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.TicketAccessTaskDto;
import com.hnac.hzims.ticket.workTicket.dto.WorkInfoFlowDto; import com.hnac.hzims.ticket.workTicket.dto.WorkInfoFlowDto;
import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto; 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.service.IWorkTicketInfoService;
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketBillVO; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketBillVO;
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO;
import com.hnac.hzims.ticket.workTicket.vo.WorkVO;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.BladePage; 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.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -207,5 +211,12 @@ public class WorkTicketInfoController {
return R.data(workTicketInfoService.getWorkTicketBill(emCode, startTime, endTime)); return R.data(workTicketInfoService.getWorkTicketBill(emCode, startTime, endTime));
} }
@GetMapping("/work")
@ApiOperationSupport(order = 90)
@ApiOperation(value = "工作票-关联数据")
public R<IPage<WorkTicketInfoVO>> work(WorkVO work, Query query) {
return R.data(workTicketInfoService.work(Condition.getPage(query),work));
}
} }

3
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; package com.hnac.hzims.ticket.workTicket.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
@ -70,4 +71,6 @@ public interface WorkTicketInfoMapper extends UserDataScopeBaseMapper<WorkTicket
@UserDataAuth @UserDataAuth
List<Map> selectTicketList(@Param(Constants.WRAPPER) QueryWrapper<WorkTicketInfoEntity> queryWrapper); List<Map> selectTicketList(@Param(Constants.WRAPPER) QueryWrapper<WorkTicketInfoEntity> queryWrapper);
IPage<WorkTicketInfoEntity> pageCondition(IPage<WorkTicketInfoEntity> page, @Param(Constants.WRAPPER) QueryWrapper<WorkTicketInfoEntity> queryWrapper);
} }

8
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 left join hzims_ticket_info_evaluate tie on ti.id = tie.ticket_id and tie.is_deleted = 0
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>
<select id="pageCondition" resultType="com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity">
SELECT works.*,eva.`status` isQualified FROM hzims_work_ticket_info works
LEFT JOIN hzims_ticket_info_evaluate eva
ON works.id = eva.ticket_id
${ew.customSqlSegment}
</select>
</mapper> </mapper>

2
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.entity.WorkTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketBillVO; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketBillVO;
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO;
import com.hnac.hzims.ticket.workTicket.vo.WorkVO;
import com.hnac.hzims.vo.SafeCheckStatisticVO; import com.hnac.hzims.vo.SafeCheckStatisticVO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.BladePage;
@ -180,4 +181,5 @@ public interface IWorkTicketInfoService extends BaseService<WorkTicketInfoEntity
IPage<WorkTicketInfoVO> listByTicketWithKeyword(Page<WorkTicketInfoEntity> entityPage, TicketCountQueryVo ticketCountQueryVo); IPage<WorkTicketInfoVO> listByTicketWithKeyword(Page<WorkTicketInfoEntity> entityPage, TicketCountQueryVo ticketCountQueryVo);
IPage<WorkTicketInfoVO> work(IPage<WorkTicketInfoEntity> page, WorkVO work);
} }

24
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.entity.WorkTicketFinish;
import com.hnac.hzims.ticket.twoTicket.service.TicketInfoDangerService; import com.hnac.hzims.ticket.twoTicket.service.TicketInfoDangerService;
import com.hnac.hzims.ticket.twoTicket.service.impl.WorkTicketFinishServiceImpl; 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.process.WorkTicketVo;
import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountQueryVo;
import com.hnac.hzims.ticket.utils.ExcelUtil; 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.dto.*;
import com.hnac.hzims.ticket.workTicket.entity.*; import com.hnac.hzims.ticket.workTicket.entity.*;
import com.hnac.hzims.ticket.workTicket.mapper.WorkDelayNoScopeMapper; import com.hnac.hzims.ticket.workTicket.mapper.WorkDelayNoScopeMapper;
import com.hnac.hzims.ticket.workTicket.mapper.WorkTicketInfoMapper; import com.hnac.hzims.ticket.workTicket.mapper.WorkTicketInfoMapper;
import com.hnac.hzims.ticket.workTicket.service.*; 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.vo.*;
import com.hnac.hzims.ticket.workTicket.wrapper.WorkTicketDelayWrapper; import com.hnac.hzims.ticket.workTicket.wrapper.WorkTicketDelayWrapper;
import com.hnac.hzims.ticket.workTicket.wrapper.WorkTicketInfoWrapper; import com.hnac.hzims.ticket.workTicket.wrapper.WorkTicketInfoWrapper;
@ -1205,4 +1205,24 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
}); });
return workTicketInfoVOIPage; return workTicketInfoVOIPage;
} }
/**
* 工作票-关联数据
* @param page
* @param business
* @return
*/
@Override
public IPage<WorkTicketInfoVO> work(IPage<WorkTicketInfoEntity> page, WorkVO business) {
QueryWrapper<WorkTicketInfoEntity> 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;
}
} }

31
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;
}
Loading…
Cancel
Save