diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java index c61c6cc..bbcd030 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java @@ -287,25 +287,4 @@ public class OperPhenomenonEntity extends TenantEntity { @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "核算工时") private Integer checkHours; - - - @ApiModelProperty(value = "年月") - @TableField(exist = false) - private YearMonth yearMonth; - - - @ApiModelProperty(value = "年月") - @TableField(exist = false) - private String areaId; - - - @ApiModelProperty(value = "是否为缺陷 直接传0") - @TableField(exist = false) - private Integer defect; - - - @ApiModelProperty(value = "已定论1") - @TableField(exist = false) - private Integer conclusionStatusNum; - } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowDataEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowDataEntity.java new file mode 100644 index 0000000..3524b4f --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowDataEntity.java @@ -0,0 +1,43 @@ +package com.hnac.hzims.operational.ecology.entity; + +import com.baomidou.mybatisplus.annotation.SqlCondition; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.math.BigDecimal; + +/** + * @author ysj + */ +@Data +@TableName("ecology_flow_data") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "生态流量数据表", description = "生态流量数据表") +public class EcologyFlowDataEntity extends TenantEntity { + + @ApiModelProperty(value = "站点编号") + private Long stationId; + + @ApiModelProperty(value = "月份") + private String mon; + + @ApiModelProperty(value = "站点名称") + private String stationName; + + @ApiModelProperty(value = "在线率") + private BigDecimal onLine; + + @ApiModelProperty(value = "达标率") + private BigDecimal demonstrate; + + @ApiModelProperty(value = "及时率") + private BigDecimal timely; + + @ApiModelProperty(value = "完整率") + private BigDecimal complete; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowStationEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowStationEntity.java new file mode 100644 index 0000000..ce4d7e8 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowStationEntity.java @@ -0,0 +1,29 @@ +package com.hnac.hzims.operational.ecology.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * @author ysj + */ +@Data +@TableName("ecology_flow_station") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "生态流量站点表", description = "生态流量站点表") +public class EcologyFlowStationEntity extends TenantEntity { + + private Long stationId; + + private String stationName; + + private Long isOnLine; + + private Long isDemonstrate; + + private Long isTimely; + + private Long isComplete; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/DemonstrateTopVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/DemonstrateTopVo.java new file mode 100644 index 0000000..4172270 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/DemonstrateTopVo.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.operational.ecology.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + + +/** + * @author ysj + */ +@Data +public class DemonstrateTopVo { + + @ApiModelProperty(value = "站点编号") + private Long stationId; + + @ApiModelProperty(value = "站点名称") + private String stationName; + + @ApiModelProperty(value = "达标率") + private BigDecimal demonstrate; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/EcologFlowStationVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/EcologFlowStationVo.java new file mode 100644 index 0000000..6207709 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/EcologFlowStationVo.java @@ -0,0 +1,32 @@ +package com.hnac.hzims.operational.ecology.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + + +/** + * @author ysj + */ +@Data +public class EcologFlowStationVo { + + @ApiModelProperty("达标率") + private Double demonstrate; + + @ApiModelProperty("及时率") + private Double timely; + + @ApiModelProperty("完整率") + private Double complete; + + @ApiModelProperty("在线率") + private Double onLine; + + @ApiModelProperty("接入站点数量") + private Integer count; + + @ApiModelProperty("达标率排行榜") + List tops; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/TrendChartVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/TrendChartVo.java new file mode 100644 index 0000000..a3cfdfe --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/TrendChartVo.java @@ -0,0 +1,29 @@ +package com.hnac.hzims.operational.ecology.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + + +/** + * @author ysj + */ +@Data +public class TrendChartVo { + + @ApiModelProperty("时间") + private Integer ts; + + @ApiModelProperty("及时率") + private Double timely; + + @ApiModelProperty("完整率") + private Double complete; + + @ApiModelProperty("在线率") + private Double onLine; + + @ApiModelProperty("达标率") + private Double demonstrate; +} 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 ff89923..5cba624 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 @@ -480,6 +480,10 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable { */ @ApiModelProperty("有限空间监测记录单 (true,展示附件,false,不展示附件)") private Boolean isLimited; - + /** + *每日开工和收工时间附页 + */ + @ApiModelProperty("每日开工和收工时间附页") + private Boolean isStart; } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java index e267ba3..0b0c69a 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java @@ -454,11 +454,10 @@ public class EmInfoServiceImpl extends BaseServiceImpl signages = analys.stream().filter(o-> item.getEmCode().equals(o.getDeviceCode()) && !StringUtil.isEmpty(o.getSignage()) && !StringUtil.isEmpty(o.getRealId())).collect(Collectors.toList()); - if(CollectionUtil.isEmpty(signages)){ - return; + if(CollectionUtil.isNotEmpty(signages)){ + // list -> map + item.setPoint(signages.stream().collect(Collectors.toMap(AnalyzeCodeBySignagesVO::getSignage,AnalyzeCodeBySignagesVO::getRealId))); } - // list -> map - item.setPoint(signages.stream().collect(Collectors.toMap(AnalyzeCodeBySignagesVO::getSignage,AnalyzeCodeBySignagesVO::getRealId))); // 寻找设备配置参数 List itemParamList = paramList.stream().filter(o->item.getId().equals(o.getInfoId())).collect(Collectors.toList()); if(CollectionUtil.isNotEmpty(itemParamList)){ diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java index 4532604..83fcb29 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java @@ -27,91 +27,93 @@ import java.util.List; @RestController @RequestMapping("/message/record") -@Api(value = "消息推送记录",tags = "消息推送记录") +@Api(value = "消息推送记录", tags = "消息推送记录") @AllArgsConstructor public class MessagePushRecordController extends BladeController { - private final IMessagePushRecordService messagePushRecordService; + private final IMessagePushRecordService messagePushRecordService; - @PostMapping("/save") - @ApiOperation("保存消息推送") - @ApiOperationSupport(order = 1) - public R save(@RequestBody MessagePushRecordEntity request) { - return R.status(messagePushRecordService.save(request)); - } + @PostMapping("/save") + @ApiOperation("保存消息推送") + @ApiOperationSupport(order = 1) + public R save(@RequestBody MessagePushRecordEntity request) { + return R.status(messagePushRecordService.save(request)); + } - @PostMapping("/update") - @ApiOperation("更新消息推送记录") - @ApiOperationSupport(order = 2) - public R update(@RequestBody MessagePushRecordEntity request) { - return R.status(messagePushRecordService.updateById(request)); - } + @PostMapping("/update") + @ApiOperation("更新消息推送记录") + @ApiOperationSupport(order = 2) + public R update(@RequestBody MessagePushRecordEntity request) { + return R.status(messagePushRecordService.updateById(request)); + } - @GetMapping("/list") - @ApiOperation("查询消息推送记录列表") - @ApiOperationSupport(order = 3) - public R> list(MessagePushRecordEntity request) { - return R.data(messagePushRecordService.list(request)); - } + @GetMapping("/list") + @ApiOperation("查询消息推送记录列表") + @ApiOperationSupport(order = 3) + public R> list(MessagePushRecordEntity request) { + return R.data(messagePushRecordService.list(request)); + } - @GetMapping("/listPage") - @ApiOperation("分页查询消息推送记录列表") - @ApiOperationSupport(order = 4) - @OperationAnnotation( - moduleName = "消息管理", - title = "消息管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页查询消息推送记录列表") - public R> listPage(MessagePushRecordEntity request, Query query) { - return R.data(messagePushRecordService.listPage(request,query)); - } + @GetMapping("/listPage") + @ApiOperation("分页查询消息推送记录列表") + @ApiOperationSupport(order = 4) + @OperationAnnotation( + moduleName = "消息管理", + title = "消息管理", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, + action = "分页查询消息推送记录列表") + public R> listPage(MessagePushRecordEntity request, Query query) { + return R.data(messagePushRecordService.listPage(request, query)); + } - @GetMapping("/send/{id}") - @ApiOperation("推送消息记录") - @ApiOperationSupport(order = 5) - public R send(@PathVariable @ApiParam("消息记录ID") Long id) { - return R.data(messagePushRecordService.send(id)); - } + @GetMapping("/send/{id}") + @ApiOperation("推送消息记录") + @ApiOperationSupport(order = 5) + public R send(@PathVariable @ApiParam("消息记录ID") Long id) { + return R.data(messagePushRecordService.send(id)); + } - @GetMapping("/readMessage/{id}") - @ApiOperation("读取消息") - @ApiOperationSupport(order = 6) - public R readMessage(@PathVariable @ApiParam("消息记录ID") String id) { - MessagePushRecordEntity record = messagePushRecordService.getById(id); - if(!(Long.parseLong(record.getPusher()) == AuthUtil.getUserId())) { - return R.fail("当前登录人不是消息推送人,修改状态失败"); - } - LambdaUpdateWrapper eq = Wrappers.lambdaUpdate() - .set(MessagePushRecordEntity::getStatus, MessageConstants.CONFIRM) - .set(MessagePushRecordEntity::getRespondTime, LocalDateTime.now()) - .in(MessagePushRecordEntity::getId, Func.toLongList(",",id)); - return R.status(messagePushRecordService.update(eq)); - } + @GetMapping("/readMessage/{id}") + @ApiOperation("读取消息") + @ApiOperationSupport(order = 6) + public R readMessage(@PathVariable @ApiParam("消息记录ID") String id) { + MessagePushRecordEntity record = messagePushRecordService.getById(id); + if (!(Long.parseLong(record.getPusher()) == AuthUtil.getUserId())) { + return R.fail("当前登录人不是消息推送人,修改状态失败"); + } + LambdaUpdateWrapper eq = Wrappers.lambdaUpdate() + .set(MessagePushRecordEntity::getStatus, MessageConstants.CONFIRM) + .set(MessagePushRecordEntity::getRespondTime, LocalDateTime.now()) + .in(MessagePushRecordEntity::getId, Func.toLongList(",", id)); + return R.status(messagePushRecordService.update(eq)); + } - @GetMapping("/readMessageBatch") - @ApiOperation("批量处理消息") - @ApiOperationSupport(order = 7) - public R readMessageBatch() { - LambdaUpdateWrapper eq = Wrappers.lambdaUpdate() - .set(MessagePushRecordEntity::getStatus, MessageConstants.CONFIRM) - .set(MessagePushRecordEntity::getRespondTime, LocalDateTime.now()) - .eq(MessagePushRecordEntity::getPusher, AuthUtil.getUserId()) - .eq(MessagePushRecordEntity::getStatus, MessageConstants.PUSH_SUCCESS); - return R.status(messagePushRecordService.update(eq)); - } + @GetMapping("/readMessageBatch") + @ApiOperation("批量处理消息") + @ApiOperationSupport(order = 7) + public R readMessageBatch() { + LambdaUpdateWrapper eq = Wrappers.lambdaUpdate() + .set(MessagePushRecordEntity::getStatus, MessageConstants.CONFIRM) + .set(MessagePushRecordEntity::getRespondTime, LocalDateTime.now()) + .eq(MessagePushRecordEntity::getPusher, AuthUtil.getUserId()) + .eq(MessagePushRecordEntity::getStatus, MessageConstants.PUSH_SUCCESS); + return R.status(messagePushRecordService.update(eq)); + } - @GetMapping("/getPersonalUnreadMessage") - @ApiOperation("获取当前登录人待办消息") - @ApiOperationSupport(order = 8) - public R> getPersonalUnreadMessage() { - List personalUnreadMessage = messagePushRecordService.getPersonalUnreadMessage(); - return R.data(personalUnreadMessage); - } + @GetMapping("/getPersonalUnreadMessage") + @ApiOperation("获取当前登录人待办消息") + @ApiOperationSupport(order = 8) + @OperationAnnotation(moduleName = "视频集中监控", title = "视频集中监控", action = "获取当前登录人待办消息", + operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE) + public R> getPersonalUnreadMessage() { + List personalUnreadMessage = messagePushRecordService.getPersonalUnreadMessage(); + return R.data(personalUnreadMessage); + } - @GetMapping("/getPersonalAppUnreadMessage") - @ApiOperation("获取当前登录人APP待办消息") - @ApiOperationSupport(order = 9) - public R> getPersonalAppUnreadMessage() { - List personalUnreadMessage = messagePushRecordService.getPersonalAppUnreadMessage(); - return R.data(personalUnreadMessage); - } + @GetMapping("/getPersonalAppUnreadMessage") + @ApiOperation("获取当前登录人APP待办消息") + @ApiOperationSupport(order = 9) + public R> getPersonalAppUnreadMessage() { + List personalUnreadMessage = messagePushRecordService.getPersonalAppUnreadMessage(); + return R.data(personalUnreadMessage); + } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java index 9602b7e..4e8804c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java @@ -3,6 +3,9 @@ package com.hnac.hzims.operational.alert.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.common.logs.annotation.OperationAnnotation; +import com.hnac.hzims.common.logs.enums.BusinessType; +import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity; import com.hnac.hzims.operational.alert.service.HistoryAbnormalAlarmService; import com.hnac.hzims.operational.alert.vo.AlarmParamVo; @@ -44,6 +47,8 @@ public class AbnormalAlarmController extends BladeController { @RequestMapping(value = "/statisticsTime", method = {RequestMethod.GET, RequestMethod.POST}) @ApiOperationSupport(order = 1) @ApiOperation(value = "统计通讯中断时间", notes = "传入imsDutyMainEntity") + @OperationAnnotation(moduleName = "通讯告警统计",title = "通讯告警统计", operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE,action = "统计通讯中断时间") public R> statisticsTime(HistoryAlarmVo entity, Query query) { IPage pages = service.getAlarmTime(query,entity); return R.data(pages); 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 a5a3966..c80cfdf 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 @@ -218,12 +218,12 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl deptName = sysClient.getDeptName(depts.get(0)); if (deptName.isSuccess()) { message.setDeptName(deptName.getData()); } User admin = userClient.userByAccount("200000", "admin").getData(); - message.setCreateDept(admin.getCreateDept()); message.setCreateUser(admin.getId()); result.getData().forEach(user->{ message.setPusher(String.valueOf(user.getId())); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/LevelAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/LevelAlarmServiceImpl.java index 25c78ad..24bc744 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/LevelAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/LevelAlarmServiceImpl.java @@ -184,6 +184,7 @@ public class LevelAlarmServiceImpl implements LevelAlarmService { message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH)); message.setPushType(MessageConstants.IMMEDIATELY); message.setDeptId(dept); + message.setCreateDept(dept); R deptName = sysClient.getDeptName(dept); if (deptName.isSuccess()) { message.setDeptName(deptName.getData()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java index 6792ec4..cbafd76 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java @@ -77,7 +77,7 @@ public class StAlamRecordController { @GetMapping("/listPage") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入vo") - @OperationAnnotation(title = "系统预警处理", operatorType = OperatorType.MOBILE, + @OperationAnnotation(moduleName = "数据查询",title = "系统预警处理", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE,action = "分页查询") public R> list(StAlarmRecordVo vo, Query query) { return R.data(stAlamRecordService.doPageList(Condition.getPage(query), vo)); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/scheduled/StAlamRecordTask.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/scheduled/StAlamRecordTask.java index 823dcb0..06a5712 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/scheduled/StAlamRecordTask.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/scheduled/StAlamRecordTask.java @@ -10,6 +10,7 @@ import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Date; @@ -52,9 +53,10 @@ public class StAlamRecordTask { * realId获取 * @return ReturnT */ - @XxlJob(REAL_ID_DATA) - //@Scheduled(cron = "0/40 * * * * ? ") - public ReturnT realIdData(String param) throws Exception { + //@XxlJob(REAL_ID_DATA) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT realIdData() throws Exception { + String param = ""; if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } @@ -66,9 +68,10 @@ public class StAlamRecordTask { * 站点实时数据 * @return ReturnT */ - @XxlJob(REAL_TIME_DATA) - //@Scheduled(cron = "0/40 * * * * ? ") - public ReturnT realTimeData(String param) throws Exception { + //@XxlJob(REAL_TIME_DATA) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT realTimeData() throws Exception { + String param = ""; if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StFocusPropertiesServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StFocusPropertiesServiceImpl.java index 6fb73bf..4c75b43 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StFocusPropertiesServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StFocusPropertiesServiceImpl.java @@ -22,6 +22,7 @@ import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO; import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO; import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.MapUtils; import org.springblade.core.log.logger.BladeLogger; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.tool.api.R; @@ -137,6 +138,9 @@ public class StFocusPropertiesServiceImpl extends BaseServiceImpl result = new ArrayList<>(); for(EminfoAndEmParamVo device : filters){ + if(MapUtils.isEmpty(device.getPoint())){ + continue; + } result.addAll(device.getPoint().values()); } return result; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/controller/EcologyController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/controller/EcologyController.java new file mode 100644 index 0000000..d22ac36 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/controller/EcologyController.java @@ -0,0 +1,185 @@ +package com.hnac.hzims.operational.ecology.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.ecology.entity.EcologyFlowDataEntity; +import com.hnac.hzims.operational.ecology.entity.EcologyFlowStationEntity; +import com.hnac.hzims.operational.ecology.service.EcologyFlowDataService; +import com.hnac.hzims.operational.ecology.service.EcologyFlowStationService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.log.annotation.ApiLog; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author ysj + */ +@Api(tags = {"生态流量监测中心"}) +@RestController +@AllArgsConstructor +@RequestMapping("/ecology") +public class EcologyController extends BladeController { + + private final EcologyFlowStationService stationService; + + private final EcologyFlowDataService dataService; + + + /** + * 数据初始化 + * @return + */ + @PostMapping("/generate") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "数据生成", notes = "数据生成") + public R generate(@RequestParam Long mon,@RequestParam String year) { + return R.status(stationService.generate(mon,year)); + } + + + /** + * 站点数据排行 + * @return + */ + @PostMapping("/station_top") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "站点数据及达标率排行", notes = "站点数据及达标率排行") + public R station_top() { + return R.data(stationService.station_top()); + } + + /** + * 站点数据排行 + * @return + */ + @PostMapping("/trend_chart") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "指标趋势图", notes = "指标趋势图") + public R trend_chart(@RequestParam String type) { + return R.data(stationService.trend_chart(type)); + } + + + /** + * 生态流量站点新增或修改 + * @param entity + * @return + */ + @PostMapping("/station/submit") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增或修改", notes = "EcologyFlowStationEntity") + public R station_submit(@Valid @RequestBody EcologyFlowStationEntity entity) { + return R.status(stationService.saveOrUpdate(entity)); + } + + + /** + * 生态流量站点删除 + * @param ids + * @return + */ + @PostMapping("/station/remove") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R station_remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(stationService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 生态流量站点列表查询 + * @param entity + * @param query + * @return + */ + @ApiLog + @GetMapping("/station/list") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "EcologyFlowStationEntity") + public R> station_list(EcologyFlowStationEntity entity, Query query) { + IPage pages = stationService.page(Condition.getPage(query), Condition.getQueryWrapper(entity)); + return R.data(pages); + } + + /** + * 生态流量站点详情 + * @param entity + * @return + */ + @ApiLog + @RequestMapping(value = "/station/detail", method = {RequestMethod.GET, RequestMethod.POST}) + @ApiOperationSupport(order = 4) + @ApiOperation(value = "详情", notes = "EcologyFlowStationEntity") + public R station_detail(EcologyFlowStationEntity entity) { + EcologyFlowStationEntity detail = stationService.getOne(Condition.getQueryWrapper(entity)); + return R.data(detail); + } + + + + + /** + * 生态流量站点新增或修改 + * @param entity + * @return + */ + @PostMapping("/data/submit") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增或修改", notes = "EcologyFlowDataEntity") + public R data_submit(@Valid @RequestBody EcologyFlowDataEntity entity) { + return R.status(dataService.saveOrUpdate(entity)); + } + + + /** + * 生态流量站点删除 + * @param ids + * @return + */ + @PostMapping("/data/remove") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R data_remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(dataService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 生态流量站点列表查询 + * @param entity + * @param query + * @return + */ + @ApiLog + @GetMapping("/data/list") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "EcologyFlowdataEntity") + public R> data_list(EcologyFlowDataEntity entity, Query query) { + IPage pages = dataService.page(Condition.getPage(query), Condition.getQueryWrapper(entity)); + return R.data(pages); + } + + /** + * 生态流量站点详情 + * @param entity + * @return + */ + @ApiLog + @RequestMapping(value = "/data/detail", method = {RequestMethod.GET, RequestMethod.POST}) + @ApiOperationSupport(order = 4) + @ApiOperation(value = "详情", notes = "EcologyFlowdataEntity") + public R data_detail(EcologyFlowDataEntity entity) { + EcologyFlowDataEntity detail = dataService.getOne(Condition.getQueryWrapper(entity)); + return R.data(detail); + } +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowDataMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowDataMapper.java new file mode 100644 index 0000000..d12f8c3 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowDataMapper.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.operational.ecology.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.operational.ecology.entity.EcologyFlowDataEntity; + +/** + * @author YSJ + */ +public interface EcologyFlowDataMapper extends BaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowDataMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowDataMapper.xml new file mode 100644 index 0000000..f7f8653 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowDataMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowStationMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowStationMapper.java new file mode 100644 index 0000000..69b6e46 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowStationMapper.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.operational.ecology.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.operational.ecology.entity.EcologyFlowStationEntity; + +/** + * @author YSJ + */ +public interface EcologyFlowStationMapper extends BaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowStationMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowStationMapper.xml new file mode 100644 index 0000000..a2ab497 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowStationMapper.xml @@ -0,0 +1,4 @@ + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowDataService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowDataService.java new file mode 100644 index 0000000..3e2c7e6 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowDataService.java @@ -0,0 +1,14 @@ +package com.hnac.hzims.operational.ecology.service; + +import com.hnac.hzims.operational.ecology.entity.EcologyFlowDataEntity; +import com.hnac.hzims.operational.ecology.vo.TrendChartVo; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; + +/** + * 告警处理接口 + * @author ysj + */ +public interface EcologyFlowDataService extends BaseService { +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowStationService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowStationService.java new file mode 100644 index 0000000..801576b --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowStationService.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.operational.ecology.service; + +import com.hnac.hzims.operational.ecology.entity.EcologyFlowStationEntity; +import com.hnac.hzims.operational.ecology.vo.EcologFlowStationVo; +import com.hnac.hzims.operational.ecology.vo.TrendChartVo; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; + +/** + * 告警处理接口 + * @author ysj + */ +public interface EcologyFlowStationService extends BaseService { + + EcologFlowStationVo station_top(); + + + Boolean generate(Long mon,String year); + + List trend_chart(String type); +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowDataServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowDataServiceImpl.java new file mode 100644 index 0000000..77c7365 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowDataServiceImpl.java @@ -0,0 +1,30 @@ +package com.hnac.hzims.operational.ecology.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.hnac.hzims.operational.ecology.entity.EcologyFlowDataEntity; +import com.hnac.hzims.operational.ecology.entity.EcologyFlowStationEntity; +import com.hnac.hzims.operational.ecology.mapper.EcologyFlowDataMapper; +import com.hnac.hzims.operational.ecology.service.EcologyFlowDataService; +import com.hnac.hzims.operational.ecology.service.EcologyFlowStationService; +import com.hnac.hzims.operational.ecology.vo.TrendChartVo; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 历史告警实现类 + * @author ysj + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class EcologyFlowDataServiceImpl extends BaseServiceImpl implements EcologyFlowDataService { + +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java new file mode 100644 index 0000000..8cad9ba --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java @@ -0,0 +1,145 @@ +package com.hnac.hzims.operational.ecology.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.operational.ecology.entity.EcologyFlowDataEntity; +import com.hnac.hzims.operational.ecology.entity.EcologyFlowStationEntity; +import com.hnac.hzims.operational.ecology.mapper.EcologyFlowStationMapper; +import com.hnac.hzims.operational.ecology.service.EcologyFlowDataService; +import com.hnac.hzims.operational.ecology.service.EcologyFlowStationService; +import com.hnac.hzims.operational.ecology.vo.DemonstrateTopVo; +import com.hnac.hzims.operational.ecology.vo.EcologFlowStationVo; +import com.hnac.hzims.operational.ecology.vo.TrendChartVo; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 历史告警实现类 + * @author ysj + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class EcologyFlowStationServiceImpl extends BaseServiceImpl implements EcologyFlowStationService { + + private final EcologyFlowDataService dataService; + + /** + * 数据初始化 + * @return + */ + @Override + public Boolean generate(Long mon,String year) { + // 步骤1.查询站点列表 + List ecologys = this.list(); + if(CollectionUtil.isEmpty(ecologys)){ + return false; + } + Random random=new Random(); + List datas = new ArrayList<>(); + for(EcologyFlowStationEntity ecology : ecologys){ + int iter = Math.toIntExact(mon); + while (Math.abs(iter) > 0){ + EcologyFlowDataEntity entity = new EcologyFlowDataEntity(); + entity.setMon(year + "-" + ((iter > 10) ? iter : "0" + iter)); + entity.setStationId(ecology.getStationId()); + entity.setStationName(ecology.getStationName()); + entity.setOnLine(BigDecimal.valueOf(random.nextDouble() * 100)); + entity.setComplete(BigDecimal.valueOf(random.nextDouble() * 100)); + entity.setTimely(BigDecimal.valueOf(random.nextDouble() * 100)); + entity.setDemonstrate(BigDecimal.valueOf(random.nextDouble() * 100)); + datas.add(entity); + iter--; + } + } + return this.dataService.saveBatch(datas); + } + + + /** + * 站点数据,达标率排行榜 + * @return + */ + @Override + public EcologFlowStationVo station_top() { + List stations = this.list(); + if(CollectionUtil.isEmpty(stations)){ + return new EcologFlowStationVo(); + } + EcologFlowStationVo station = new EcologFlowStationVo(); + station.setComplete(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsComplete().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + station.setOnLine(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsOnLine().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + station.setDemonstrate(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsDemonstrate().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + station.setTimely(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsTimely().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + station.setCount(stations.size()); + + List datas = dataService.list(Wrappers.lambdaQuery(). + like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM"))); + if(CollectionUtil.isEmpty(datas)){ + return station; + } + station.setTops(datas.stream().map(data->{ + DemonstrateTopVo top = new DemonstrateTopVo(); + top.setStationId(data.getStationId()); + top.setStationName(data.getStationName()); + top.setDemonstrate(data.getDemonstrate()); + return top; + }).sorted(Comparator.comparing(DemonstrateTopVo::getDemonstrate).reversed()).collect(Collectors.toList())); + return station; + } + + + /** + * 指标趋势图 + * @param type + * @return + */ + @Override + public List trend_chart(String type) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if("0".equals(type)){ + wrapper.like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy")); + } + List datas = this.dataService.list(wrapper); + if(CollectionUtil.isEmpty(datas)){ + return new ArrayList<>(); + } + List charts; + if("0".equals(type)){ + Map> map = datas.stream().collect(Collectors.groupingBy(EcologyFlowDataEntity::getMon)); + charts = map.entrySet().stream().map(entry->{ + TrendChartVo chart = new TrendChartVo(); + Date date = DateUtil.parse(entry.getKey() + "-01 00:00:00",DateUtil.PATTERN_DATETIME); + chart.setTs(date.getMonth() + 1); + chart.setTimely(entry.getValue().stream().mapToDouble(o->o.getTimely().doubleValue()).average().getAsDouble()); + chart.setDemonstrate(entry.getValue().stream().mapToDouble(o->o.getDemonstrate().doubleValue()).average().getAsDouble()); + chart.setOnLine(entry.getValue().stream().mapToDouble(o->o.getOnLine().doubleValue()).average().getAsDouble()); + chart.setComplete(entry.getValue().stream().mapToDouble(o->o.getComplete().doubleValue()).average().getAsDouble()); + return chart; + }).collect(Collectors.toList()); + }else{ + Map> map = datas.stream().peek(o->{ + Date date = DateUtil.parse(o.getMon() + "-01 00:00:00",DateUtil.PATTERN_DATETIME); + o.setMon(DateUtil.format(date,"yyyy")); + }).collect(Collectors.groupingBy(EcologyFlowDataEntity::getMon)); + charts = map.entrySet().stream().map(entry->{ + TrendChartVo chart = new TrendChartVo(); + chart.setTs(Integer.valueOf(entry.getKey())); + chart.setTimely(entry.getValue().stream().mapToDouble(o->o.getTimely().doubleValue()).average().getAsDouble()); + chart.setDemonstrate(entry.getValue().stream().mapToDouble(o->o.getDemonstrate().doubleValue()).average().getAsDouble()); + chart.setOnLine(entry.getValue().stream().mapToDouble(o->o.getOnLine().doubleValue()).average().getAsDouble()); + chart.setComplete(entry.getValue().stream().mapToDouble(o->o.getComplete().doubleValue()).average().getAsDouble()); + return chart; + }).collect(Collectors.toList()); + } + return charts.stream().sorted(Comparator.comparing(TrendChartVo::getTs)).collect(Collectors.toList()); + } +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java index 9f85d7d..7e3d4b7 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java @@ -2,6 +2,7 @@ package com.hnac.hzims.operational.main.controller.web; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.google.common.collect.Lists; @@ -17,6 +18,7 @@ import com.hnac.hzims.operational.defect.vo.OperDefectVO; import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; import com.hnac.hzims.operational.defect.wrapper.OperPhenomenonWrapper; import com.hnac.hzims.operational.main.service.AreaMonthlyDetailsService; +import com.hnac.hzims.operational.main.vo.OperPhenomenonVo; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.safeproduct.areamonthly.vo.CheckCompanyVo; @@ -37,6 +39,9 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; import org.springblade.core.tool.api.R; @@ -206,9 +211,32 @@ public class AreaMonthlyDetailsController { public R> queryDefectPageList( @ApiParam(name = "page", value = "当前页", required = true) @PathVariable("page") Long page, @ApiParam(name = "size", value = "每页记录数", required = true) @PathVariable("size") Long size, - OperPhenomenonEntity entity, String taskIds, Date findTimeEnd) { + OperPhenomenonVo entity, String taskIds, Date findTimeEnd) { Page operDefectEntityPage = new Page<>(page, size); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + //部门 + if (CollectionUtils.isNotEmpty(entity.getCreateDept())) { + queryWrapper.in(BaseEntity::getCreateDept, entity.getCreateDept()); + } + + if (StringUtils.isNotEmpty(entity.getDefectCode())) { + queryWrapper.eq(OperPhenomenonEntity::getDefectCode, entity.getDefectCode()); + } + + + if (StringUtils.isNotEmpty(entity.getSourceCode())) { + queryWrapper.eq(OperPhenomenonEntity::getSourceCode, entity.getSourceCode()); + } + + + if (StringUtils.isNotEmpty(entity.getFaultName())) { + queryWrapper.eq(OperPhenomenonEntity::getFaultName, entity.getFaultName()); + } + + if (ObjectUtils.isNotEmpty(entity.getDefectLevel())){ + queryWrapper.eq(OperPhenomenonEntity::getDefectLevel, entity.getDefectLevel()); + } + if (StringUtil.isNotBlank(taskIds)) { queryWrapper.in(OperPhenomenonEntity::getId, Lists.newArrayList(taskIds.split(","))); } @@ -239,14 +267,14 @@ public class AreaMonthlyDetailsController { queryWrapper.orderByDesc(OperPhenomenonEntity::getUpdateTime); IPage pages = phenomenonService.page(operDefectEntityPage, queryWrapper); - Integer defect = entity.getDefect() == null ? 0 : entity.getDefect(); + Integer defect = entity.getDefect() == null ? 0 : entity.getDefect(); Integer conclusionStatusNum = entity.getConclusionStatusNum() == null ? 1 : entity.getConclusionStatusNum(); //过滤 List collect = pages.getRecords().stream().filter(item -> (defect.equals(item.getIsDefect()) || conclusionStatusNum.equals(item.getDiscriminateStatus() != null ? - Integer.parseInt(item.getDiscriminateStatus()) : null))) - .collect(Collectors.toList()); + Integer.parseInt(item.getDiscriminateStatus()) : null))) + .collect(Collectors.toList()); pages.setRecords(collect); pages.setTotal(collect.size()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java index f1f74b4..876c9e4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java @@ -989,7 +989,7 @@ public class HydropowerServiceImpl implements HydropowerService { return hydropower; }).collect(Collectors.toList()); } - + /** * 水电站区域指标 * @param deptId diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperPhenomenonVo.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperPhenomenonVo.java new file mode 100644 index 0000000..70fefb6 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperPhenomenonVo.java @@ -0,0 +1,97 @@ +package com.hnac.hzims.operational.main.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.YearMonth; +import java.util.Date; +import java.util.List; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/12 15:59 + */ +@Data +public class OperPhenomenonVo { + + /** + * 缺陷等级 + */ + private String defectLevel; + + /** + * 故障 + */ + private String faultName; + + /** + * 缺陷来源 + */ + private String sourceCode; + + + /** + * 所属机构 + */ + private List createDept; + + + /** + * 缺陷编码 + */ + private String defectCode; + + + /** + * 发现时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "发现时间") + private Date findTime; + + /** + * 甄别状态:已甄别 1 和未甄别 0 ,默认0 + */ + @ApiModelProperty(value = "甄别状态:已甄别 1 和未甄别 0 ,默认0") + private String discriminateStatus; + + /** + * 计划开始时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "计划开始时间") + private Date planStartTime; + /** + * 计划结束时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "计划结束时间") + private Date planEndTime; + + + @ApiModelProperty(value = "年月") + @TableField(exist = false) + private YearMonth yearMonth; + + + @ApiModelProperty(value = "年月") + private String areaId; + + + @ApiModelProperty(value = "是否为缺陷 直接传0") + @TableField(exist = false) + private Integer defect; + + + @ApiModelProperty(value = "已定论1") + private Integer conclusionStatusNum; + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/TicketApplication.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/TicketApplication.java index 6a636a8..f4f7b31 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/TicketApplication.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/TicketApplication.java @@ -4,6 +4,8 @@ import com.hnac.hzims.ticket.constants.TicketConstants; import org.mybatis.spring.annotation.MapperScan; import org.springblade.core.cloud.feign.EnableBladeFeign; import org.springblade.core.launch.BladeApplication; +import org.springblade.core.mp.plugins.SqlLogInterceptor; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.cloud.client.SpringCloudApplication; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java index 1ad02a8..5a2ee63 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java @@ -20,4 +20,9 @@ public class TicketProcessConstant { * 操作票 */ public static final String OPERATION_TICKET_KEY = "moreActionBankDirect"; + + /** + * 水力机械工作票 + */ + public static final String MACHINERY_TICKET_KEY = "machinery"; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java new file mode 100644 index 0000000..bbc5cdf --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java @@ -0,0 +1,69 @@ +package com.hnac.hzims.ticket.processflow.strategy.serviceimpl; + +import com.hnac.hzims.ticket.processflow.service.ProcessDictService; +import com.hnac.hzims.ticket.processflow.strategy.abstracts.ProcessAbstractService; +import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.FIRST_TICKET_KEY; +import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.MACHINERY_TICKET_KEY; + +/** + * 水力机械工作票实现类 + * + * @Author dfy + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/3/28 8:47 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class MachineryTicketProcessServiceImpl extends ProcessAbstractService { + + + + private final TicketProcessService ticketProcessService; + + + + private final ProcessDictService processDictService; + + + + + + + + /** + * 设置执行那种实现类 + * + * @param flowQueue + * @return + */ + @Override + public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { + log.info("是否执行水力机械工作票流程环节操作~~~~,流程ticket: {}", flowQueue); + String dictValue = processDictService.selectDictValueByKey(MACHINERY_TICKET_KEY); + if (dictValue.equals(flowQueue.getProcessDefinitionKey())) { + log.info("已执行水力机械工作票流程环节操作~~~~"); + return true; + } + log.error("未是否执行水力机械工作票流程环节操作,请联系管理员~~~~"); + return false; + } + + /** + * 两票管理业务方法 + * + * @param response + */ + @Override + public void calculate(ProcessWorkFlowResponse response) { + ticketProcessService.findPending(response); + } +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/constant/TicketConstant.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/constant/TicketConstant.java index f74288f..3985daa 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/constant/TicketConstant.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/constant/TicketConstant.java @@ -55,4 +55,9 @@ public class TicketConstant { */ public static final String SPACE_PAGE = "/secondary/有限空间监测记录单.docx"; + /** + * 每日开工和收工时间附页 + */ + public static final String START_PAGE = "/secondary/每日开工和收工时间附页.docx"; + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java index 4b9fe05..cf88996 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java @@ -74,6 +74,7 @@ import java.util.*; import java.util.stream.Collectors; import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.FIRST_TICKET_KEY; +import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.MACHINERY_TICKET_KEY; /** @@ -191,7 +192,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { } signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2); - workTicketVo.getWorkTicket().setSignage(signage); + workTicketVo.getWorkTicket().setSignage(station.getSignage()); workTicketVo.getWorkTicket().setSignageCode(station.getCode()); //2. 获取编码 String code = processIdWorker.getTicketByCode(workTicketVo.getWorkTicket().getSignage(), this.getTicketWichCode(workTicketVo.getWorkTicket().getType()), @@ -204,7 +205,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { //5. 保存工作任务 this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket()); //6. 查询第一种工作票值 - String dictValue = processDictService.selectDictValueByKey(FIRST_TICKET_KEY); + String dictValue = getDictValue(workTicketVo); //7. 开启动作流 this.dealProcess(dictValue, workTicketVo); //8. 处理任务 @@ -213,6 +214,23 @@ public class TicketProcessServiceImpl implements TicketProcessService { } /** + * 验证是走那种工作票流程,默认走第一种工作票 + * + * @param workTicketVo + * @return + */ + private String getDictValue(WorkTicketVo workTicketVo) { + String key = FIRST_TICKET_KEY; + if ("6".equals(workTicketVo.getWorkTicket().getType()) || "7".equals(workTicketVo.getWorkTicket().getType())) { + key = FIRST_TICKET_KEY; + } else if ("8".equals(workTicketVo.getWorkTicket().getType())) { + key = MACHINERY_TICKET_KEY; + } + String dictValue = processDictService.selectDictValueByKey(key); + return dictValue; + } + + /** * 待处理 * * @param response @@ -339,7 +357,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { e.printStackTrace(); } - //工作开始时间和结束时间 + // 工作开始时间和结束时间 // List workTicketOperateTimeEntities = workTicketVo.getWorkTicketOperateTimeEntities(); // if (CollectionUtils.isNotEmpty(workTicketOperateTimeEntities)) { // log.info("工作开始时间和结束时间:{}", workTicketFinish); @@ -438,7 +456,6 @@ public class TicketProcessServiceImpl implements TicketProcessService { message.setPusherName(user.getName()); } message.setAccount(userId); - message.setCreateUser(NumberUtils.toLong(userId)); messageClient.sendMessage(message); log.info("推送消息成功,用户名称{},消息{}", user.getName(), message); @@ -476,18 +493,6 @@ public class TicketProcessServiceImpl implements TicketProcessService { } //如果response.getHandleType() 是1使角色 if ("1".equals(response.getHandleType())) { - //根据角色别名获取用户信息 - // try { - // R> roleAlias = userClient.relationUserListByRoleAlias(workTicket.getTenantId(), workTicket.getCreateDept(), response.getNextStepOperator()); - // String collect = roleAlias.getData().stream().map(item -> item.getName()).collect(Collectors.joining(",")); - // flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(collect).concat("审批"); - // workTicket.setNextStepOperator(collect); - // } catch (Exception e) { - // e.printStackTrace(); - // log.error("R> roleAlias = userClient.userListByRoleAlias(workTicket.getTenantId(), response.getNextStepOperator())"); - // log.error("获取用户信息失败"); - // workTicket.setNextStepOperator(null); - // } workTicket.setFlowUserId(response.getUserId()); workTicket.setNextStepOperator(response.getNextStepOperator()); flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批"); @@ -497,7 +502,6 @@ public class TicketProcessServiceImpl implements TicketProcessService { String taskId = response.getTaskId(); if (StringUtils.isEmpty(taskId)) { workTicket.setFlowDescription("结束"); - // workTicket.setFlowTaskId(" "); workTicket.setFlowTaskName("结束"); workTicket.setNextStepOperator(" "); workTicket.setStepOperator(" "); @@ -507,6 +511,27 @@ public class TicketProcessServiceImpl implements TicketProcessService { workTicket.setFlowTaskName(response.getTaskName()); workTicket.setFlowDescription(flowDescription); } + + //如果签发人为false + if (workTicket.getSignFlag() != null) { + if (!workTicket.getSignFlag()) { + workTicket.setFlowDescription("作废"); + workTicket.setFlowTaskName("作废"); + workTicket.setNextStepOperator(" "); + workTicket.setStepOperator(" "); + } + + } + + //运行人员false + if (workTicket.getRecieveFlag() != null) { + if (!workTicket.getRecieveFlag()) { + workTicket.setFlowDescription("作废"); + workTicket.setFlowTaskName("作废"); + workTicket.setNextStepOperator(" "); + workTicket.setStepOperator(" "); + } + } } @@ -606,6 +631,9 @@ public class TicketProcessServiceImpl implements TicketProcessService { // } Map params = new HashMap<>(4); params.put("workTicketVo", workTicketVo); + if ("8".equals(workTicketVo.getWorkTicket().getType())) { + params.put("principal", "taskUser_" + workTicketVo.getWorkTicket().getPrincipal()); + } //已开启流程 R processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(newFirstWorkTicketFlowKey, String.valueOf(workTicketVo.getWorkTicket().getId()), workTicketVo.getWorkTicket().getWorkContent(), params); log.info("processInstanceContainNameByKey.isSuccess() : {}", processInstanceContainNameByKey.isSuccess()); @@ -771,14 +799,14 @@ public class TicketProcessServiceImpl implements TicketProcessService { } WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); - if ((workTicket.getIsSafety() == null && workTicket.getIsHazard() == null && workTicket.getIsLimited() == null && workTicket.getIsRailway() == null) - || (workTicket.getIsSafety() == null || workTicket.getIsHazard() == null || workTicket.getIsLimited() == null || workTicket.getIsRailway() == null)) { + if (workTicket.getIsSafety() == null && workTicket.getIsHazard() == null && workTicket.getIsLimited() == null && workTicket.getIsRailway() == null + && workTicket.getIsStart() == null) { extractedWithWord(response, resultMap, status); return; } //如果4个多为false 或为空 附件不展示附件 - if (!workTicket.getIsSafety() && !workTicket.getIsHazard() && !workTicket.getIsLimited() && !workTicket.getIsRailway()) { + if (!workTicket.getIsSafety() && !workTicket.getIsHazard() && !workTicket.getIsLimited() && !workTicket.getIsRailway() && !workTicket.getIsStart()) { extractedWithWord(response, resultMap, status); return; } @@ -801,22 +829,22 @@ public class TicketProcessServiceImpl implements TicketProcessService { //安全隔离措施附页 (true,展示附件,false,不展示附件) if (workTicket.getIsSafety()) { addFile(prefix, TicketConstant.SECURE_PAGE, docFileList); - // setWorkTicketPrincipalChange(docFileList); } //危险点分析与预控措施票 (true,展示附件,false,不展示附件) if (workTicket.getIsSafety()) { addFile(prefix, TicketConstant.SAFETY_PAGE, docFileList); - // setWorkTicketHazardPointChange(docFileList); } //动火工作票 (true,展示附件,false,不展示附件) if (workTicket.getIsRailway()) { addFile(prefix, TicketConstant.FLIGHT_PAGE, docFileList); - // setWorkTicketRailwayChange(docFileList); } //有限空间监测记录单(true,展示附件,false,不展示附件) if (workTicket.getIsLimited()) { addFile(prefix, TicketConstant.SPACE_PAGE, docFileList); - // setWorkTicketLimitedChange(docFileList); + } + //每日开工和收工时间附页 + if (workTicket.getIsStart()) { + addFile(prefix, TicketConstant.START_PAGE, docFileList); } String name = LocalDate.now() + "-" + UUID.randomUUID().toString().replaceAll("-", ""); @@ -832,11 +860,11 @@ public class TicketProcessServiceImpl implements TicketProcessService { log.info("输出word路径:{}", docPath); //第一种工作票 - resultMap.put("one", status == 1 ? "☑":"□"); + resultMap.put("one", status == 1 ? "☑" : "□"); //第二种工作票 - resultMap.put("two", status == 2 ? "☑":"□"); + resultMap.put("two", status == 2 ? "☑" : "□"); //水力机器工作票 - resultMap.put("three", status == 3 ? "☑":"□"); + resultMap.put("three", status == 3 ? "☑" : "□"); //导入文档 File file = new File(docPath); MergeDocUtils.mergeDoc(docFileList, file); diff --git a/hzims-service/ticket/src/main/resources/template/secondary/每日开工和收工时间附页.docx b/hzims-service/ticket/src/main/resources/template/secondary/每日开工和收工时间附页.docx new file mode 100644 index 0000000..43cab96 Binary files /dev/null and b/hzims-service/ticket/src/main/resources/template/secondary/每日开工和收工时间附页.docx differ diff --git a/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx b/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx index e43e2d5..abdde27 100644 Binary files a/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx and b/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx differ