From 7f4fcf7fb1598ab1a30edc097e2e444a6d2eade4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Thu, 8 Jun 2023 11:41:09 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=A5=A8=E6=B5=8F?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/StandardTicketInfoEntity.java | 310 ++++++++++----------- .../entity/StandardTicketMeasureEntity.java | 67 ++--- .../controller/OperationTicketController.java | 22 +- .../service/IStandardTicketInfoService.java | 8 + .../service/IStandardTicketMeasureService.java | 7 + .../service/OperationTicketService.java | 11 + .../service/impl/OperationTicketServiceImpl.java | 92 ++++++ .../impl/StandardTicketInfoServiceImpl.java | 61 +++- .../impl/StandardTicketMeasureServiceImpl.java | 13 + .../standardTicket/utils/OperationWordHelper.java | 121 ++++++++ .../service/impl/TicketProcessServiceImpl.java | 1 + .../hzims/ticket/twoTicket/utils/WordHelper.java | 2 +- .../vo/operation/StandardTicketInfoVo.java | 36 +++ .../vo/operation/StandardTicketMeasureVo.java | 5 + 14 files changed, 557 insertions(+), 199 deletions(-) create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java index 62c627d..db4adbc 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java @@ -20,167 +20,161 @@ import java.time.LocalDateTime; @EqualsAndHashCode @Data @TableName("hzims_standard_ticket_info") -@ApiModel(value = "标准票对象",description = "标准票对象") +@ApiModel(value = "标准票对象", description = "标准票对象") public class StandardTicketInfoEntity extends TenantEntity implements Serializable { - private static final long serialVersionUID = 8278603728783507684L; - - @ApiModelProperty("票据类型") - @QueryField(condition = SqlCondition.EQUAL) - private String ticketType; - - @ApiModelProperty("单位") - @QueryField(condition = SqlCondition.EQUAL) - private String company; - - @ApiModelProperty("工作流ID") - @QueryField(condition = SqlCondition.EQUAL) - private String processInstanceId; - - @ApiModelProperty("编号") - @QueryField(condition = SqlCondition.EQUAL) - private String code; - - @ApiModelProperty("发令人") - @QueryField(condition = SqlCondition.EQUAL) - private Long issueOrderPerson; - - @ApiModelProperty("受令人") - @QueryField(condition = SqlCondition.EQUAL) - private Long accessOrderPerson; - - @ApiModelProperty("发令时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - private LocalDateTime issueOrderTime; - - @ApiModelProperty("操作开始时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - private LocalDateTime startTime; - - @ApiModelProperty("操作结束时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - private LocalDateTime endTime; - - @ApiModelProperty("操作任务") - @QueryField(condition = SqlCondition.EQUAL) - private String title; - - @ApiModelProperty("任务类型") - @QueryField(condition = SqlCondition.EQUAL) - private String taskType; - - @ApiModelProperty("关联业务任务ID") - private Long taskId; - - @ApiModelProperty("关联业务名称") - @QueryField(condition = SqlCondition.LIKE) - private String taskName; - - @ApiModelProperty("备注") - private String remark; - - @ApiModelProperty("监护人") - private Long guardian; - - @ApiModelProperty("操作人") - private Long operator; - - @ApiModelProperty("操作时间") - private LocalDateTime operateTime; - - @ApiModelProperty("负责人确认时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - private LocalDateTime guardianshipTime; - - @ApiModelProperty("值班负责人") - private Long principal; - - @ApiModelProperty("值班负责人确认时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - private LocalDateTime principalTime; - - @ApiModelProperty("是否评价") - private Integer isEvaluate; - - - /** - * AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性 - * 站点标识-两票编码 - */ - @ApiModelProperty("站点标识-两票编码") - private String signage; - - - /** - * 编号(原站点ID) - */ - @ApiModelProperty("编号(原站点ID)") - private String signageCode; - - - /** - * 流程状态' - */ - @ApiModelProperty("流程状态") - private Integer flowStatus; - - /** - * 流程描述 - */ - @ApiModelProperty("流程描述") - private String flowDescription; - - - /** - * 下一个审批人 - */ - @ApiModelProperty("下一个审批人") - private String nextStepOperator; - - - /** - * 用户Id - */ - @ApiModelProperty("用户Id") - private String flowUserId; - - - /** - * 当前任务名 - */ - @ApiModelProperty("当前任务名") - private String flowTaskName; + private static final long serialVersionUID = 8278603728783507684L; + @ApiModelProperty("票据类型") + @QueryField(condition = SqlCondition.EQUAL) + private String ticketType; - /** - * 当前任务名 - */ - @ApiModelProperty("当前任务名") - private String flowTaskId; + @ApiModelProperty("单位") + @QueryField(condition = SqlCondition.EQUAL) + private String company; + + @ApiModelProperty("工作流ID") + @QueryField(condition = SqlCondition.EQUAL) + private String processInstanceId; + + @ApiModelProperty("编号") + @QueryField(condition = SqlCondition.EQUAL) + private String code; + + @ApiModelProperty("发令人") + @QueryField(condition = SqlCondition.EQUAL) + private Long issueOrderPerson; + + @ApiModelProperty("受令人") + @QueryField(condition = SqlCondition.EQUAL) + private Long accessOrderPerson; + + @ApiModelProperty("发令时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime issueOrderTime; + + @ApiModelProperty("操作开始时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startTime; + + @ApiModelProperty("操作结束时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + + @ApiModelProperty("操作任务") + @QueryField(condition = SqlCondition.EQUAL) + private String title; + + @ApiModelProperty("任务类型") + @QueryField(condition = SqlCondition.EQUAL) + private String taskType; + + @ApiModelProperty("关联业务任务ID") + private Long taskId; + + @ApiModelProperty("关联业务名称") + @QueryField(condition = SqlCondition.LIKE) + private String taskName; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("监护人") + private Long guardian; + + @ApiModelProperty("操作人") + private Long operator; + + @ApiModelProperty("操作时间") + private LocalDateTime operateTime; + + @ApiModelProperty("负责人确认时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime guardianshipTime; + + @ApiModelProperty("值班负责人") + private Long principal; + + @ApiModelProperty("值班负责人确认时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime principalTime; + + @ApiModelProperty("是否评价") + private Integer isEvaluate; + + + /** + * AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性 + * 站点标识-两票编码 + */ + @ApiModelProperty("站点标识-两票编码") + private String signage; + + + /** + * 编号(原站点ID) + */ + @ApiModelProperty("编号(原站点ID)") + private String signageCode; + + + /** + * 流程状态' + */ + @ApiModelProperty("流程状态") + private Integer flowStatus; + + /** + * 流程描述 + */ + @ApiModelProperty("流程描述") + private String flowDescription; + + + /** + * 下一个审批人 + */ + @ApiModelProperty("下一个审批人") + private String nextStepOperator; + + + /** + * 用户Id + */ + @ApiModelProperty("用户Id") + private String flowUserId; + + + /** + * 当前任务名 + */ + @ApiModelProperty("当前任务名") + private String flowTaskName; + + + /** + * 当前任务名 + */ + @ApiModelProperty("当前任务名") + private String flowTaskId; + + + /** + * 项目 + */ + @ApiModelProperty("项目") + private String projectName; + + + /** + * + */ + @ApiModelProperty("分组") + private String classGroupName; } diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketMeasureEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketMeasureEntity.java index d27b61a..e618a74 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketMeasureEntity.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketMeasureEntity.java @@ -22,49 +22,50 @@ import java.time.LocalDateTime; * @author hx */ @Data -@ApiModel(value = "标准票安全措施明细",description = "标准票安全措施明细") +@ApiModel(value = "标准票安全措施明细", description = "标准票安全措施明细") @EqualsAndHashCode @TableName("hzims_standard_ticket_measure") public class StandardTicketMeasureEntity extends TenantEntity implements Serializable { - private static final long serialVersionUID = 8503146008417850183L; + private static final long serialVersionUID = 8503146008417850183L; - @ApiModelProperty("标准票ID") - @QueryField(condition = SqlCondition.EQUAL) - private Long ticketId; + @ApiModelProperty("标准票ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long ticketId; - @ApiModelProperty("分组") - private Long matterGroup; + @ApiModelProperty("分组") + private Long matterGroup; - @ApiModelProperty("安全措施ID") - @QueryField(condition = SqlCondition.EQUAL) - private Long measureId; + @ApiModelProperty("安全措施ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long measureId; - @ApiModelProperty("安全措施") - @QueryField(condition = SqlCondition.LIKE) - private String measure; + @ApiModelProperty("安全措施") + @QueryField(condition = SqlCondition.LIKE) + private String measure; - @ApiModelProperty("执行人") - @TableField(updateStrategy = FieldStrategy.IGNORED) - @QueryField(condition = SqlCondition.EQUAL) - private Long executor; + @ApiModelProperty("执行人") + @TableField(updateStrategy = FieldStrategy.IGNORED) + @QueryField(condition = SqlCondition.EQUAL) + private Long executor; - @ApiModelProperty("执行时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @TableField(updateStrategy = FieldStrategy.IGNORED) - private LocalDateTime executeTime; + @ApiModelProperty("执行时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(updateStrategy = FieldStrategy.IGNORED) + private LocalDateTime executeTime; - @ApiModelProperty("执行图片") - private String executeImgUrl; + @ApiModelProperty("执行图片") + private String executeImgUrl; - @ApiModelProperty("执行备注") - private String remark; + @ApiModelProperty("执行备注") + private String remark; - @ApiModelProperty("操作事项排序") - @JsonSerialize(nullsUsing = NullSerializer.class) - private Integer sort; + @ApiModelProperty("操作事项排序") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer sort; + + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime operationTime; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java index b47e1e2..da8ccc5 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java @@ -1,16 +1,15 @@ package com.hnac.hzims.ticket.standardTicket.controller; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; -import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; /** * 操作票 @@ -44,4 +43,17 @@ public class OperationTicketController { + /** + * 新预览 + */ + @GetMapping("/newPreview") + @ApiOperation(value = "新预览") + @ApiOperationSupport(order = 11) + public void preview(@RequestParam(value = "ticketId", required = true) Long ticketId, + @RequestParam(value = "status", required = true) Integer status, + HttpServletResponse response) { + operationTicketService.newPreview(ticketId, status, response); + } + + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java index be22563..b4aaa2e 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java @@ -10,6 +10,7 @@ import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; +import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.BladePage; @@ -109,4 +110,11 @@ public interface IStandardTicketInfoService extends BaseService areaMonthlyWithOperation(StandardTicketWithAreaVo areaMonthly, Page searchPage); + + /** + * 根据Id获取操作票详细信息 + * @param ticketId + * @return + */ + StandardTicketInfoVo selectDetailsById(Long ticketId); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketMeasureService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketMeasureService.java index 4e70335..c00c67e 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketMeasureService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketMeasureService.java @@ -61,4 +61,11 @@ public interface IStandardTicketMeasureService extends BaseService listStandardByTicketId(Long ticketId); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java index f92497d..3f4dc34 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java @@ -4,6 +4,8 @@ import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; +import javax.servlet.http.HttpServletResponse; + /** * @Author WL * @Version v1.0 @@ -25,4 +27,13 @@ public interface OperationTicketService { * @param response */ void findPending(ProcessWorkFlowResponse response); + + + /** + * 新预览 + * @param ticketId 操作票id + * @param status 状态 + * @param response 扩展 ServletResponse 接口以在发送响应时提供特定于 HTTP 的功能。例如,它具有访问HTTP标头和cookie的方法。 + */ + void newPreview(Long ticketId, Integer status, HttpServletResponse response); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java index 7934a21..38811fb 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java @@ -1,7 +1,9 @@ package com.hnac.hzims.ticket.standardTicket.service.impl; +import cn.afterturn.easypoi.word.WordExportUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.message.MessageConstants; @@ -9,6 +11,7 @@ import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.feign.IStationClient; +import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.processflow.service.ProcessDictService; import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; @@ -17,15 +20,24 @@ import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketMeasureEntity; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketMeasureService; import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService; +import com.hnac.hzims.ticket.standardTicket.utils.OperationWordHelper; +import com.hnac.hzims.ticket.twoTicket.constant.TicketConstant; +import com.hnac.hzims.ticket.twoTicket.utils.WordHelper; +import com.hnac.hzims.ticket.twoTicket.utils.WordMapUtils; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketMeasureVo; +import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; +import com.hnac.hzims.ticket.utils.PdfUtils; import lombok.RequiredArgsConstructor; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.math.NumberUtils; +import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.feign.IFlowClient; import org.springblade.system.feign.ISysClient; @@ -34,10 +46,13 @@ import org.springblade.system.user.entity.User; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; import java.time.Duration; import java.time.Instant; import java.time.LocalDateTime; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.OPERATION_TICKET_KEY; @@ -221,6 +236,7 @@ public class OperationTicketServiceImpl implements OperationTicketService { } } + /** * 填充数据 * @@ -357,4 +373,80 @@ public class OperationTicketServiceImpl implements OperationTicketService { } return result; } + + + + + /** + * 新预览 + * + * @param ticketId 操作票id + * @param status 状态 + * @param response 扩展 ServletResponse 接口以在发送响应时提供特定于 HTTP 的功能。例如,它具有访问HTTP标头和cookie的方法。 + */ + @SneakyThrows + @Override + public void newPreview(Long ticketId, Integer status, HttpServletResponse response) { + String fileName = IdWorker.get32UUID() + ".docx"; + response.setHeader("Content-Disposition", "attachment; filename=" + fileName); + response.setContentType("application/vnd.ms-excel;charset=utf-8"); + + StandardTicketInfoVo standardTicketInfoVo = standardTicketInfoService.selectDetailsById(ticketId); + //将查询的数据转换为map + Map workTicketInfoMap = this.convertMap(standardTicketInfoVo); + //导入下在word + Map resultMap = OperationWordHelper.resultMap(workTicketInfoMap); + String workTicketStatus = OperationWordHelper.getWorkTicketStatus(status); + String os = TicketConstant.OS_NAME; + //Windows操作系统 + if (os != null && os.toLowerCase().startsWith("windows")) { + String url = "template/" + workTicketStatus; + XWPFDocument doc = WordExportUtil.exportWord07(url, resultMap); + log.info("当前系统版本是:{}", os); + doc.write(response.getOutputStream()); + } else { + String url = TicketConstant.TICKET_LIUNX_PATH + "/" + workTicketStatus; + XWPFDocument doc = WordExportUtil.exportWord07(url, resultMap); + //其它操作系统 + log.info("当前系统版本是:{}", os); + ServletOutputStream outputStream = response.getOutputStream(); + doc.write(outputStream); + } + } + + + /** + * 将查询的数据转换为map + * @param standardTicketInfoVo + * @return + */ + private Map convertMap(StandardTicketInfoVo standardTicketInfoVo) { + //1. 操作票装换map + Map result = new HashMap<>(); + Map stringObjectMap = PdfUtils.objectToMapResult(standardTicketInfoVo, result); + result.putAll(stringObjectMap); + //2. 安全措施转换map + List standardTicketMeasureVos = standardTicketInfoVo.getStandardTicketMeasureVos(); + AtomicInteger index = new AtomicInteger(1); + if (CollectionUtil.isNotEmpty(standardTicketMeasureVos)) { + List> measureMapLists = new ArrayList<>(); + for (StandardTicketMeasureVo measure : standardTicketMeasureVos) { + Map map = PdfUtils.objectToMap(measure); + map.put("index", index.get()); + map.put("status", TicketConstants.MATTER_FINISH_STATUS.equals(measure.getStatus()) ? "√" : ""); + map.put("operationTime", measure.getOperationTime()); + map.put("hello",""); + map.put("hello1",""); + index.getAndIncrement(); + measureMapLists.add(map); + } + result.put("measureMapList", measureMapLists); + }else { + result.put("measureMapList", new ArrayList<>()); + } + + WordMapUtils.newMapWithList("measureMapList",result,false,17,null); + return result; + } + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java index 5b528a8..1a97a48 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java @@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -21,6 +22,7 @@ import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketMeasureDto; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; +import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketMeasureEntity; import com.hnac.hzims.ticket.standardTicket.mapper.StandardTicketInfoMapper; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketMeasureService; @@ -28,6 +30,8 @@ import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketMeasureVO; import com.hnac.hzims.ticket.standardTicket.wrapper.StandardTicketInfoWrapper; +import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; +import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketMeasureVo; import com.hnac.hzims.ticket.utils.ExcelUtil; import com.hnac.hzims.ticket.utils.PdfUtils; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; @@ -109,7 +113,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl> queryList(StandardTicketInfoDto req, Query query) { LambdaQueryWrapper queryWrapper = this.getQueryWrapper(req); - queryWrapper.eq(Func.isNotEmpty(req.getCreateDept()),StandardTicketInfoEntity::getCreateDept,req.getCreateDept()); + queryWrapper.eq(Func.isNotEmpty(req.getCreateDept()), StandardTicketInfoEntity::getCreateDept, req.getCreateDept()); queryWrapper.orderByDesc(StandardTicketInfoEntity::getCreateTime); IPage pages = super.page(Condition.getPage(query), queryWrapper); return R.data(pages.setRecords(StandardTicketInfoWrapper.build().listVO(pages.getRecords()))); @@ -337,7 +341,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl standardTicketMeasure = measureService.listStandardByTicketId(ticketId); + if (CollectionUtils.isNotEmpty(standardTicketMeasure)){ + List collect = standardTicketMeasure.stream().map(standardTicketMeasureEntity -> { + StandardTicketMeasureVo standardTicketMeasureVO = new StandardTicketMeasureVo(); + BeanUtils.copyProperties(standardTicketMeasureEntity, standardTicketMeasureVO); + return standardTicketMeasureVO; + }).collect(Collectors.toList()); + standardTicketInfoVo.setStandardTicketMeasureVos(collect); + } + return standardTicketInfoVo; + } + + + /** + * 封装Vo + * @param standardTicketInfoVo + * @param standardTicketInfoEntity + */ + private static void transFrom(StandardTicketInfoVo standardTicketInfoVo, StandardTicketInfoEntity standardTicketInfoEntity) { + User creator = UserCache.getUser(standardTicketInfoEntity.getCreateUser()); + User updater = UserCache.getUser(standardTicketInfoEntity.getUpdateUser()); + /*发令人、受令人、负责人、监护人*/ + User issueOrderPerson = UserCache.getUser(standardTicketInfoEntity.getIssueOrderPerson()); + User accessOrderPerson = UserCache.getUser(standardTicketInfoEntity.getAccessOrderPerson()); + User principal = UserCache.getUser(standardTicketInfoEntity.getPrincipal()); + User guardian = UserCache.getUser(standardTicketInfoEntity.getGuardian()); + standardTicketInfoVo.setCreateUserName(Optional.ofNullable(creator).map(User::getName).orElse(null)); + standardTicketInfoVo.setUpdateUserName(Optional.ofNullable(updater).map(User::getName).orElse(null)); + standardTicketInfoVo.setIssueOrderPersonName(Optional.ofNullable(issueOrderPerson).map(User::getName).orElse(null)); + standardTicketInfoVo.setAccessOrderPersonName(Optional.ofNullable(accessOrderPerson).map(User::getName).orElse(null)); + standardTicketInfoVo.setPrincipalName(Optional.ofNullable(principal).map(User::getName).orElse(null)); + standardTicketInfoVo.setGuardianName(Optional.ofNullable(guardian).map(User::getName).orElse(null)); + } + /** * 判断是否存在合格率 如果存在返回true 否则为false + * * @param item * @return */ diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketMeasureServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketMeasureServiceImpl.java index a17be46..1efee00 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketMeasureServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketMeasureServiceImpl.java @@ -3,6 +3,7 @@ package com.hnac.hzims.ticket.standardTicket.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity; import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService; import com.hnac.hzims.ticket.constants.TicketConstants; @@ -125,6 +126,18 @@ public class StandardTicketMeasureServiceImpl extends BaseServiceImpl listStandardByTicketId(Long ticketId) { + return new LambdaQueryChainWrapper(baseMapper) + .eq(StandardTicketMeasureEntity::getTicketId,ticketId).list(); + } + + /** * 获取StandardTicketMeasureEntity - LambdaQueryWrapper * @param req * @return diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java new file mode 100644 index 0000000..52e4553 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java @@ -0,0 +1,121 @@ +package com.hnac.hzims.ticket.standardTicket.utils; + +import com.hnac.hzims.ticket.twoTicket.utils.WordHelper; +import lombok.AllArgsConstructor; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/7 17:00 + */ +public class OperationWordHelper { + + + /** + * map验证是value否为null + * + * @param workTicketInfoMap + * @return + */ + public static Map resultMap(Map workTicketInfoMap) { + Map resultMap = new HashMap<>(); + for (Map.Entry entry : workTicketInfoMap.entrySet()) { + listEntryMap(resultMap, entry.getKey(), entry.getValue()); + } + return resultMap; + } + + /** + * 根据状态获取模板 + * @param status + * @return + */ + public static String getWorkTicketStatus(Integer status) { + String result = null; + switch (status) { + case 0: + result = "电气操作票.docx"; + default: + result = "电气操作票.docx"; + } + return result; + } + + + @Data + @AllArgsConstructor + static class Entry { + /** + * key值 + */ + private String fileName; + + /** + * count + */ + private Integer count; + + } + + + /** + * 判断是否存在,如果不存在空格代替 + * @param resultMap + * @param key + * @param value + */ + private static void listEntryMap(Map resultMap, String key, Object value) { + List params = new ArrayList<>(); + paramsList(params); + for (Entry entry : params) { + isEntryMap(resultMap, entry.getFileName(), key, value, entry.getCount()); + } + } + + + /** + * 验证空格多少 + * @param resultMap + * @param fileName + * @param key + * @param value + * @param count + */ + private static void isEntryMap(Map resultMap, String fileName, String key, Object value, Integer count) { + if (fileName.equals(key)) { + Object newValue = StringUtils.isNoneBlank(WordHelper.toString(value).trim()) ? value : + "\u00A0" + WordHelper.printSpace(count); + resultMap.put(key, newValue); + } else { + Object newValue = StringUtils.isNoneBlank(WordHelper.toString(value).trim()) ? value : + "\u00A0" + WordHelper.printSpace(5); + resultMap.put(key, newValue); + } + } + + + /** + * 存储数据,要加载多少空格 + * @param params + */ + private static void paramsList(List params) { + params.add(new Entry("projectName", 10)); + params.add(new Entry("classGroupName", 10)); + params.add(new Entry("code", 10)); + params.add(new Entry("accessOrderPersonName", 10)); + params.add(new Entry("guardianName", 10)); + params.add(new Entry("startTime", 10)); + params.add(new Entry("endTime", 10)); + params.add(new Entry("principalName", 10)); + params.add(new Entry("principalTime", 10)); + } +} 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 d536b9d..47bb99b 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 @@ -440,6 +440,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { message.setCreateUser(NumberUtils.toLong(userId)); messageClient.sendMessage(message); + log.info("推送消息成功,用户名称{},消息{}", user.getName(), message); } } catch (Exception e) { e.printStackTrace(); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java index e8505ad..1b6fca6 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java @@ -152,7 +152,7 @@ public class WordHelper extends StringUtils { } /** - * + *判断是否存在,如果不存在空格代替 */ public static void listEntryMap(Map result, String key, Object value) { List params = new ArrayList<>(); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java index 70ca8e5..7f02ef8 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java @@ -107,12 +107,48 @@ public class StandardTicketInfoVo extends TenantEntity { /** + * 项目 + */ + @ApiModelProperty("项目") + private String projectName; + + + /** + * + */ + @ApiModelProperty("分组") + private String classGroupName; + + + /** * 编号(原站点ID) */ @ApiModelProperty("编号(原站点ID)") private String signageCode; + + @ApiModelProperty("创建人名称") + private String createUserName; + + @ApiModelProperty("更新人名称") + private String updateUserName; + + @ApiModelProperty("来源类型名称") + private String taskTypeName; + + @ApiModelProperty("发令人名称") + private String issueOrderPersonName; + + @ApiModelProperty("受令人名称") + private String accessOrderPersonName; + + @ApiModelProperty("负责人名称") + private String principalName; + + @ApiModelProperty("许可人名称") + private String guardianName; + /** * 安全措施 */ diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketMeasureVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketMeasureVo.java index 03702a7..10e7039 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketMeasureVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketMeasureVo.java @@ -54,4 +54,9 @@ public class StandardTicketMeasureVo extends TenantEntity { @ApiModelProperty("操作事项排序") private Integer sort; + + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime operationTime; } From 455ccee19e6757b25d7c18ae825cb3f06c469d12 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 8 Jun 2023 11:46:19 +0800 Subject: [PATCH 2/6] =?UTF-8?q?#=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=8A=BD=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/main/vo/RegularWorkVO.java | 20 + .../mapper/operation/DutyGroupMapper.java | 27 + .../scheduled/mapper/operation/DutyMapper.java | 20 + .../mapper/operation/DutyPersonMapper.java | 11 + .../scheduled/mapper/ticket/WorkDelayMapper.java | 16 + .../mapper/ticket/WorkPrincipalMapper.java | 11 + .../scheduled/scheduled/ShowScheduledTask.java | 13 + .../scheduled/service/operation/DutyService.java | 15 + .../service/operation/MaintenanceService.java | 6 +- .../service/operation/PhenomenonService.java | 3 + .../scheduled/service/operation/ShowService.java | 2 + .../service/operation/impl/DutyServiceImpl.java | 176 +++++ .../operation/impl/MaintenanceServiceImpl.java | 36 ++ .../operation/impl/PhenomenonServiceImpl.java | 39 ++ .../service/operation/impl/ShowServiceImpl.java | 719 ++++++++++++++++++++- .../scheduled/service/ticket/TicketService.java | 4 +- .../scheduled/service/ticket/WorkDelayService.java | 12 + .../service/ticket/WorkPrincipalService.java | 11 + .../service/ticket/WorkTicketService.java | 5 + .../service/ticket/impl/TicketServiceImpl.java | 20 + .../service/ticket/impl/WorkDelayServiceImpl.java | 19 + .../ticket/impl/WorkPrincipalServiceImpl.java | 20 + .../service/ticket/impl/WorkTicketServiceImpl.java | 65 ++ .../resources/mapper/operation/DutyGroupMapper.xml | 4 + .../main/resources/mapper/operation/DutyMapper.xml | 34 + .../mapper/operation/DutyPersonMapper.xml | 4 + .../resources/mapper/ticket/WorkDelayMapper.xml | 5 + .../mapper/ticket/WorkPrincipalMapper.xml | 5 + .../main/service/impl/SideHustleServiceImpl.java | 2 +- .../service/IOperMaintenanceTaskService.java | 2 +- .../impl/OperMaintenanceTaskServiceImpl.java | 10 +- .../operational/maintenance/vo/RegularWorkVO.java | 20 - 32 files changed, 1318 insertions(+), 38 deletions(-) create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RegularWorkVO.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyGroupMapper.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyMapper.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyPersonMapper.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/WorkDelayMapper.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/WorkPrincipalMapper.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/DutyService.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DutyServiceImpl.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkDelayService.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkPrincipalService.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkDelayServiceImpl.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkPrincipalServiceImpl.java create mode 100644 hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyGroupMapper.xml create mode 100644 hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyMapper.xml create mode 100644 hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyPersonMapper.xml create mode 100644 hzims-service/hzims-scheduled/src/main/resources/mapper/ticket/WorkDelayMapper.xml create mode 100644 hzims-service/hzims-scheduled/src/main/resources/mapper/ticket/WorkPrincipalMapper.xml delete mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/vo/RegularWorkVO.java diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RegularWorkVO.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RegularWorkVO.java new file mode 100644 index 0000000..aafb15a --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RegularWorkVO.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.operational.main.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 定期工作 + */ +@Data +public class RegularWorkVO{ + + @ApiModelProperty("定期工作总数") + private Integer regularWorkSum; + + @ApiModelProperty("修改人名称") + private Integer regularWork; + + @ApiModelProperty("日常维护任务Id 按逗号分隔") + private String mainTaskIds; +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyGroupMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyGroupMapper.java new file mode 100644 index 0000000..3ba69d8 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyGroupMapper.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.scheduled.mapper.operation; + +import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity; +import org.apache.ibatis.annotations.Param; +import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +import java.util.List; + +/** + * Mapper 接口 + * + * @author Chill + */ +public interface DutyGroupMapper extends UserDataScopeBaseMapper { + + /** + * 根据班组ID修改负责人为null + * @param id + * @return + */ + int updateManagerIdById(Long id); + + @UserDataAuth + List selectDutyGroupJoinDutyMain(@Param("startDate") String startDate, @Param("endDate") String endDate); + +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyMapper.java new file mode 100644 index 0000000..2811137 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyMapper.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.scheduled.mapper.operation; + +import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; +import com.hnac.hzims.operational.duty.vo.DutyInfoVo; +import com.hnac.hzims.operational.duty.vo.DutyMainInfoVo; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +import java.util.List; + +/** + * @author ysj + */ +public interface DutyMapper extends UserDataScopeBaseMapper { + + List dutyData(List collect); + + DutyMainInfoVo queryDuty(Long preDutyId); + + DutyMainInfoVo selectDuty(Long preDutyId); +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyPersonMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyPersonMapper.java new file mode 100644 index 0000000..1326c30 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/DutyPersonMapper.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.scheduled.mapper.operation; + +import com.hnac.hzims.operational.duty.entity.ImsDutyMainPersonEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + */ +public interface DutyPersonMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/WorkDelayMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/WorkDelayMapper.java new file mode 100644 index 0000000..b69757a --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/WorkDelayMapper.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.scheduled.mapper.ticket; + +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + *

+ * 工作票延期 Mapper 接口 + *

+ * + * @author hx + * @since 2021-10-22 + */ +public interface WorkDelayMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/WorkPrincipalMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/WorkPrincipalMapper.java new file mode 100644 index 0000000..4520735 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/ticket/WorkPrincipalMapper.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.scheduled.mapper.ticket; + +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketPrincipalChangeEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + */ +public interface WorkPrincipalMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java index 426502e..19c294c 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java @@ -12,6 +12,7 @@ import org.springframework.stereotype.Component; import java.util.Date; import static com.hnac.hzims.operational.main.constant.MainConstants.LOAD_HOME_TARGET; +import static com.hnac.hzims.operational.main.constant.MainConstants.REGIONAL_DUTY_INFO; /** @@ -35,4 +36,16 @@ public class ShowScheduledTask { service.loadHomeTarget(param); return new ReturnT<>("SUCCESS"); } + + /** + * 首页-区域班组数据 + */ + @XxlJob(REGIONAL_DUTY_INFO) + public ReturnT loadRegionalDuty(String param) { + if (Func.isBlank(param)) { + param = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + } + service.loadRegionalDuty(param); + return new ReturnT<>("SUCCESS"); + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/DutyService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/DutyService.java new file mode 100644 index 0000000..08efdcd --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/DutyService.java @@ -0,0 +1,15 @@ +package com.hnac.hzims.scheduled.service.operation; + +import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; +import com.hnac.hzims.operational.duty.vo.DutyInfoVo; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; + +/** + * @author ysj + */ +public interface DutyService extends BaseService { + + List dutyData(List collect); +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MaintenanceService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MaintenanceService.java index 31d2be0..b193f91 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MaintenanceService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MaintenanceService.java @@ -1,9 +1,11 @@ package com.hnac.hzims.scheduled.service.operation; import com.hnac.hzims.operational.main.vo.MaintainVo; +import com.hnac.hzims.operational.main.vo.RegularWorkVO; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import org.springblade.core.mp.base.BaseService; +import java.util.Date; import java.util.List; /** @@ -12,7 +14,9 @@ import java.util.List; public interface MaintenanceService extends BaseService { // 查询当年日常维护数量 - Integer maintenanceCount(List departList); + Integer maintenanceCount(List areas); MaintainVo maintain(String start, String end, List areas); + + RegularWorkVO regularWork(Date start, Date end, List areas); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/PhenomenonService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/PhenomenonService.java index fe294d8..362fbe9 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/PhenomenonService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/PhenomenonService.java @@ -1,6 +1,7 @@ package com.hnac.hzims.scheduled.service.operation; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; +import com.hnac.hzims.operational.main.vo.ShortagesVo; import com.hnac.hzims.operational.report.vo.DutyDefectVO; import org.springblade.core.mp.base.BaseService; @@ -12,4 +13,6 @@ import java.util.List; public interface PhenomenonService extends BaseService { DutyDefectVO defect(String start, String end, List areas); + + ShortagesVo defectMonth(String start, String end, List list); } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ShowService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ShowService.java index a86eed7..78a454b6 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ShowService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ShowService.java @@ -6,4 +6,6 @@ package com.hnac.hzims.scheduled.service.operation; public interface ShowService { void loadHomeTarget(String param); + + void loadRegionalDuty(String param); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DutyServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DutyServiceImpl.java new file mode 100644 index 0000000..cbaf723 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DutyServiceImpl.java @@ -0,0 +1,176 @@ +package com.hnac.hzims.scheduled.service.operation.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity; +import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; +import com.hnac.hzims.operational.duty.entity.ImsDutyMainPersonEntity; +import com.hnac.hzims.operational.duty.vo.DutyInfoVo; +import com.hnac.hzims.operational.duty.vo.DutyMainInfoVo; +import com.hnac.hzims.operational.duty.vo.NextDutyInfoVo; +import com.hnac.hzims.scheduled.mapper.operation.DutyGroupMapper; +import com.hnac.hzims.scheduled.mapper.operation.DutyMapper; +import com.hnac.hzims.scheduled.mapper.operation.DutyPersonMapper; +import com.hnac.hzims.scheduled.service.operation.DutyService; +import lombok.AllArgsConstructor; +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.ObjectUtil; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author ysj + */ +@Service +@AllArgsConstructor +@Slf4j +public class DutyServiceImpl extends BaseServiceImpl implements DutyService { + + private final DutyPersonMapper dutyPersonMapper; + private final DutyGroupMapper dutyGroupMapper; + + @Override + public List dutyData(List collect) { + if (CollectionUtil.isEmpty(collect)) { + return null; + } + // 查询区域当前值班 + List dutyInfoVoList = this.baseMapper.dutyData(collect); + if (CollectionUtil.isEmpty(dutyInfoVoList)) { + return null; + } + //修改数据结构后:分灵活排班和班组排班拿负责人 + dutyInfoVoList = dutyInfoVoList.stream().peek(s -> { + if (null == s.getGroupId()) { + ImsDutyMainPersonEntity imsDutyMainPersonEntity = dutyPersonMapper.selectOne(new LambdaQueryWrapper() {{ + eq(ImsDutyMainPersonEntity::getDutyMainId, s.getId()); + last(" limit 1"); + }}); + s.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString()); + } else { + ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(s.getGroupId()); + s.setGroupName(imsDutyGroupEntity.getGroupName()); + s.setManagerId(imsDutyGroupEntity.getManagerId().toString()); + } + }).collect(Collectors.toList()); + dutyInfoVoList.forEach(item -> { + // 负责人 + User user = UserCache.getUser(Long.valueOf(item.getManagerId())); + if (ObjectUtil.isNotEmpty(user)) { + item.setManagerName(user.getName()); + item.setManagerPhone(user.getPhone()); + } + // FIXME 上网 + item.setOnlineCapacity(0.0); + // 发电量 + item.setGeneratingCapacity(0); + // 上一班组 + NextDutyInfoVo upDutyInfoVo = this.getUpDutyInfo(item); + item.setUpDutyInfoVo(upDutyInfoVo); + // 下一班组 + NextDutyInfoVo nextDutyInfoVo = this.getNextDutyInfo(item); + item.setNextDutyInfoVo(nextDutyInfoVo); + }); + return dutyInfoVoList; + } + + + /** + * 获取上一班组 + * + * @param item + * @return + */ + private NextDutyInfoVo getUpDutyInfo(DutyInfoVo item) { + if(ObjectUtil.isEmpty(item.getPreDutyId())){ + return null; + } + DutyMainInfoVo dutyMainInfoVo = this.baseMapper.queryDuty(item.getPreDutyId()); + if (null == dutyMainInfoVo.getDutyGroupId()) { + ImsDutyMainPersonEntity imsDutyMainPersonEntity = dutyPersonMapper.selectOne(new LambdaQueryWrapper() {{ + eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId()); + last(" LIMIT 1"); + }}); + dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString()); + } else { + ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(dutyMainInfoVo.getDutyGroupId()); + dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName()); + dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId()); + dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString()); + } + if (ObjectUtil.isEmpty(dutyMainInfoVo)) { + return null; + } + // 赋值 + NextDutyInfoVo dutyInfoVo = new NextDutyInfoVo(); + dutyInfoVo.setGroupName(dutyMainInfoVo.getGroupName()); + dutyInfoVo.setClassName(dutyMainInfoVo.getClassName()); + dutyInfoVo.setDateTime(dutyMainInfoVo.getDateTime()); + dutyInfoVo.setStartTime(dutyMainInfoVo.getStartTime()); + dutyInfoVo.setEndTime(dutyMainInfoVo.getEndTime()); + // 负责人 + User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId())); + if (ObjectUtil.isNotEmpty(user)) { + dutyInfoVo.setManagerName(user.getName()); + dutyInfoVo.setManagerPhone(user.getPhone()); + } + // 发电量 + dutyInfoVo.setGeneratingCapacity(0); + return dutyInfoVo; + } + + /** + * 获取下一班组 + * + * @param item + * @return + */ + private NextDutyInfoVo getNextDutyInfo(DutyInfoVo item) { + DutyMainInfoVo dutyMainInfoVo = this.nextDuty(item.getId()); + if (ObjectUtil.isEmpty(dutyMainInfoVo)) { + return null; + } + // 赋值 + NextDutyInfoVo dutyInfoVo = new NextDutyInfoVo(); + dutyInfoVo.setGroupName(dutyMainInfoVo.getGroupName()); + dutyInfoVo.setClassName(dutyMainInfoVo.getClassName()); + // 负责人 + User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId())); + if (ObjectUtil.isNotEmpty(user)) { + dutyInfoVo.setManagerName(user.getName()); + dutyInfoVo.setManagerPhone(user.getPhone()); + } + dutyInfoVo.setGeneratingCapacity(0); + return dutyInfoVo; + } + + /** + * 下一班组 + * @param parentId + * @return + */ + public DutyMainInfoVo nextDuty(Long parentId) { + DutyMainInfoVo dutyMainInfoVo = this.baseMapper.selectDuty(parentId); + if(ObjectUtil.isEmpty(dutyMainInfoVo)){ + return new DutyMainInfoVo(); + } + if (null == dutyMainInfoVo.getDutyGroupId()) { + ImsDutyMainPersonEntity imsDutyMainPersonEntity = dutyPersonMapper.selectOne(new LambdaQueryWrapper() {{ + eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId()); + last("limit 1"); + }}); + dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString()); + } else { + ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(dutyMainInfoVo.getDutyGroupId()); + dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName()); + dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId()); + dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString()); + } + return dutyMainInfoVo; + } +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/MaintenanceServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/MaintenanceServiceImpl.java index 7152ace..35b4ab5 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/MaintenanceServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/MaintenanceServiceImpl.java @@ -2,6 +2,7 @@ package com.hnac.hzims.scheduled.service.operation.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.hnac.hzims.operational.main.vo.MaintainVo; +import com.hnac.hzims.operational.main.vo.RegularWorkVO; import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.scheduled.mapper.operation.MaintenanceMapper; @@ -16,6 +17,7 @@ import org.springframework.stereotype.Service; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -84,5 +86,39 @@ public class MaintenanceServiceImpl extends BaseServiceImpl areas) { + RegularWorkVO regularWorkVO = new RegularWorkVO(); + // 查询定期工作任务 + List regularWorkList = this.list(new LambdaQueryWrapper() {{ + ge(OperMaintenanceTaskEntity::getDisposeTime, start) + .le(OperMaintenanceTaskEntity::getDisposeTime, end) + .eq(OperMaintenanceTaskEntity::getTypeCode, "05") + .in(OperMaintenanceTaskEntity::getCreateDept, areas); + }}); + if (CollectionUtil.isEmpty(regularWorkList)) { + regularWorkVO.setRegularWorkSum(0); + regularWorkVO.setRegularWork(0); + return regularWorkVO; + } + regularWorkVO.setMainTaskIds(regularWorkList.stream().map(OperMaintenanceTaskEntity::getId).map(id -> id.toString()).collect(Collectors.joining(","))); + regularWorkVO.setRegularWorkSum(regularWorkList.size()); + // 定期工作任务完成数量 + List regularWorkFinishList = regularWorkList.stream().filter(o -> MaintenanceConstant.TASK_STATUS_5 == o.getStatus()).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(regularWorkFinishList)) { + regularWorkVO.setRegularWork(0); + return regularWorkVO; + } + regularWorkVO.setRegularWork(regularWorkFinishList.size()); + return regularWorkVO; + } + } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/PhenomenonServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/PhenomenonServiceImpl.java index 4afdf08..d993192 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/PhenomenonServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/PhenomenonServiceImpl.java @@ -2,6 +2,7 @@ package com.hnac.hzims.scheduled.service.operation.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; +import com.hnac.hzims.operational.main.vo.ShortagesVo; import com.hnac.hzims.operational.report.vo.DutyDefectVO; import com.hnac.hzims.scheduled.mapper.operation.PhenomenonMapper; import com.hnac.hzims.scheduled.service.operation.PhenomenonService; @@ -12,6 +13,9 @@ import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.Func; import org.springframework.stereotype.Service; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; import java.util.List; import java.util.stream.Collectors; @@ -57,4 +61,39 @@ public class PhenomenonServiceImpl extends BaseServiceImpl list) { + ShortagesVo shortagesVo = new ShortagesVo(); + LocalDate firstDay = LocalDate.now().withDayOfMonth(1); + LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN); + LocalDateTime now = LocalDateTime.now(); + // 消缺总数 + List defects = this.list(new LambdaQueryWrapper(){{ + ge(OperPhenomenonEntity::getCreateTime,firstDateTime); + le(OperPhenomenonEntity::getCreateTime,now); + in(OperPhenomenonEntity::getCreateDept,list); + }}); + if(CollectionUtil.isEmpty(defects)){ + shortagesVo.setShortagesSum(0); + shortagesVo.setShortages(0); + return shortagesVo; + } + // 消缺数 + shortagesVo.setShortagesSum(defects.size()); + List shortagesList = defects.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())). + map(OperPhenomenonEntity::getId).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(shortagesList)){ + shortagesVo.setShortages(0); + } + shortagesVo.setShortages(shortagesList.size()); + return shortagesVo; + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ShowServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ShowServiceImpl.java index 5d87218..9c64c59 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ShowServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ShowServiceImpl.java @@ -1,26 +1,39 @@ package com.hnac.hzims.scheduled.service.operation.impl; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.hnac.hzims.equipment.entity.PlanGenerationEntity; +import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; +import com.hnac.hzims.operational.duty.vo.DutyInfoVo; +import com.hnac.hzims.operational.duty.vo.DutyTaskVo; +import com.hnac.hzims.operational.duty.vo.NextDutyInfoVo; import com.hnac.hzims.operational.fill.entity.*; import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.vo.*; +import com.hnac.hzims.operational.report.vo.DutyDefectVO; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.scheduled.service.equipment.PlanService; +import com.hnac.hzims.scheduled.service.inspect.TaskService; import com.hnac.hzims.scheduled.service.operation.*; import com.hnac.hzims.scheduled.service.ticket.TicketService; +import com.hnac.hzims.scheduled.service.ticket.WorkTicketService; import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO; +import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; +import com.hnac.hzims.ticket.workTicket.vo.WorkTicketStatisticVO; +import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient; +import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO; +import com.xxl.job.core.log.XxlJobLogger; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; +import org.apache.poi.ss.formula.functions.T; import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.core.tool.utils.DateUtil; -import org.springblade.core.tool.utils.ObjectUtil; -import org.springblade.core.tool.utils.StringUtil; +import org.springblade.core.tool.utils.*; import org.springblade.system.cache.DictCache; import org.springblade.system.entity.Dept; import org.springblade.system.feign.ISysClient; @@ -36,11 +49,12 @@ import java.math.BigDecimal; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; +import java.sql.Time; +import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; -import java.util.Date; -import java.util.List; +import java.util.*; import java.util.concurrent.*; import java.util.stream.Collectors; @@ -52,6 +66,7 @@ import java.util.stream.Collectors; @Slf4j public class ShowServiceImpl implements ShowService { + private final TaskService taskService; private final OverService overService; private final PlanService planService; private final PowerService powerService; @@ -60,12 +75,16 @@ public class ShowServiceImpl implements ShowService { private final AccessService accessService; private final TicketService ticketService; private final DefectService defectService; + private final DutyService dutyService; private final StationService stationService; private final OverDetailsService detailsService; + private final WorkTicketService workTicketService; + private final PhenomenonService phenomenonService; + private final AnalyseDataService analyseDataService; private final MaintenanceService maintenanceService; private final RedisTemplate redisTemplate; private final ISysClient sysClient; - + private final IAnalyseInstanceClient deviceInstanceClient; private final static String charge = "hzims:operation:key:charge"; private final static String home_target_cache_final = "load:operation:home:target:key"; @@ -77,6 +96,12 @@ public class ShowServiceImpl implements ShowService { @Value("${hzims.operation.homePage.charge.url}") public String charge_url; + @Value("${hzims.equipment.emInfo.emInfoList}") + public String device_cache_cofig_final; + + @Value("${hzims.operation.region.areaDutyInfoKey}") + private String area_duty_cofig_final; + /** * 集团总指标-首页数据 */ @@ -112,6 +137,64 @@ public class ShowServiceImpl implements ShowService { redisTemplate.opsForValue().set(home_target_cache_final,targets.stream().filter(( target -> ObjectUtil.isNotEmpty(target.getType()))).collect(Collectors.toList())); } + + /** + * 智能生产-值班数据 + * @param param + */ + @Override + public void loadRegionalDuty(String param) { + R> R = sysClient.getDeptList(); + if (!R.isSuccess() || CollectionUtil.isEmpty(R.getData())) { + return; + } + Map> map = this.area(R.getData(),null, Collections.singletonList(HomePageConstant.HYDROPOWER),HomePageConstant.HYDROPOWER_SERVETYPE); + if (MapUtils.isEmpty(map)) { + return; + } + // 查询所有区域值班/接班数据 + List dutyInfoVoList = dutyService.dutyData(map.keySet().stream().map(Dept::getId).collect(Collectors.toList())); + if(CollectionUtil.isEmpty(dutyInfoVoList)){ + return; + } + // 所有设备 + List devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(), new TypeReference>() {}); + List areaDutyVoList = new ArrayList<>(); + map.forEach((key,value) -> { + List singlet = Collections.singletonList(key.getId()); + AreaDutyVo areaDutyVo = new AreaDutyVo(); + areaDutyVo.setDepartId(key.getId()); + areaDutyVo.setDepartName(key.getDeptName()); + areaDutyVo.setSort(key.getSort()); + // 值班情况 + this.dutySituation(dutyInfoVoList, key, areaDutyVo); + // 厂站运行情况 + this.factoryStationRun(devices, value, areaDutyVo); + // 当月任务执行情况 + this.executeTaskMonth(singlet, areaDutyVo); + // 获取区域当班时间 + List dutyList = dutyInfoVoList.stream().filter(o -> key.getId().equals(o.getCreateDept())).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(dutyList)) { + areaDutyVoList.add(areaDutyVo); + return; + } + Date startDate = this.dutyStartTime(dutyList.get(0).getDateTime(),dutyList.get(0).getStartTime()); + Date endDate = this.dutyEndTime(dutyList.get(0).getDateTime(),dutyList.get(0).getStartTime(),dutyList.get(0).getEndTime()); + areaDutyVo.setStartTimeDuty(DateUtil.format(startDate,DateUtil.PATTERN_DATETIME)); + areaDutyVo.setEndTimeDuty(DateUtil.format(endDate,DateUtil.PATTERN_DATETIME)); + // 上一班组发电量 + this.upDutyPower(dutyList,devices,key.getId(),value,areaDutyVo); + // 班组实时发电量 + this.dutyPower(startDate,endDate,devices,value,areaDutyVo,false); + // 当班双票 + this.dutyDoubleTicket(startDate,endDate,singlet,areaDutyVo); + // 当班运行数据 + this.dutyRunCondition(startDate,endDate,singlet,areaDutyVo); + areaDutyVoList.add(areaDutyVo); + }); + redisTemplate.opsForValue().set(area_duty_cofig_final, areaDutyVoList); + } + /** * 水电站指标 * @return @@ -477,4 +560,626 @@ public class ShowServiceImpl implements ShowService { } return stringBuilder.toString(); } + + /** + * 获取权限区域 + * @param list : 机构列表 + * @param deptId : 起始过滤权限机构 + * @param typeList : 查询站点类型-水电、水利、光伏.... + * @param serveType : 站点服务类型 + * @return Map> + */ + private Map> area(List list,Long deptId, List typeList, Integer serveType) { + // 未传入机构列表,使用用户权限机构过滤 + if(CollectionUtil.isEmpty(list)){ + R> R = sysClient.getDeptByCurrentUser(); + if(!R.isSuccess() || CollectionUtil.isEmpty(R.getData())){ + return null; + } + list = R.getData(); + } + // 根据参数查询有效站点 + List stationList = this.stationByParams(list,deptId,typeList,serveType); + if(CollectionUtil.isEmpty(stationList)){ + return null; + } + // 有效站点归属机构Id集合 + List refDeptList = stationList.stream().map(StationEntity::getRefDept).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(refDeptList)){ + return null; + } + // 有效站点归属机构集合 + List vaildDeptList = list.stream().filter(o->refDeptList.contains(o.getId())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(vaildDeptList)){ + return null; + } + // 根据有效站点归属机构向上区域Id + List areaIdList = vaildDeptList.stream().map(Dept::getParentId).distinct().collect(Collectors.toList()); + if(CollectionUtil.isEmpty(areaIdList)){ + return null; + } + // 根据区域Id查询区域机构 + List areaList = list.stream().filter(o->o.getDeptCategory().equals(HomePageConstant.AREA) && areaIdList.contains(o.getId())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(areaList)){ + return null; + } + // 返回结构 + Map> result = new HashMap<>(); + for(Dept area : areaList){ + List childDeptIdList = list.stream().filter(o->o.getParentId().equals(area.getId())).map(Dept::getId).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(childDeptIdList)){ + continue; + } + List resultList = stationList.stream().filter(o->childDeptIdList.contains(o.getRefDept())).collect(Collectors.toList()); + result.put(area,resultList); + } + return result; + } + + /** + * 获取站点集合 + * @param authList + * @param deptId + * @param types + * @param servrType + * @return + */ + private List stationByParams(List authList, Long deptId, List types, Integer servrType) { + Dept dept; + if (null == deptId) { + // 最小类型机构 + Optional min = authList.stream().min(Comparator.comparing(Dept::getDeptCategory)); + dept = min.orElse(null); + if (ObjectUtil.isEmpty(dept)) { + return null; + } + } else { + // 检查是否存在传入机构 + List list = authList.stream().filter(o -> deptId.equals(o.getId())).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(list)) { + return null; + } + // 传入机构为站点 + dept = list.get(0); + } + List depts; + if (dept.getDeptCategory().equals(4)) { + depts = Collections.singletonList(dept.getId()); + // 传入机构为区域、省子公司、集团 + } else { + // 递归权限机构获取站点级机构 + depts = this.stationDept(authList, dept.getId(), new ArrayList<>()); + } + // 获取水利站点(过滤其他站点类型) + return stationService.list(new LambdaQueryWrapper() {{ + eq(StationEntity::getIsDeleted, 0); + if (ObjectUtil.isNotEmpty(servrType)) { + eq(StationEntity::getServeType, servrType); + } + if (CollectionUtil.isNotEmpty(types)) { + in(StationEntity::getType, types); + } + if (CollectionUtil.isNotEmpty(depts)) { + in(StationEntity::getRefDept, depts); + } + }}); + } + + /** + * 递归权限机构获取站点级机构 + * + * @param departList + * @param deptId + * @param list + * @return + */ + private List stationDept(List departList, Long deptId, List list) { + if (null == deptId || CollectionUtil.isEmpty(departList)) { + return null; + } + departList.forEach(dept -> { + if (dept.getParentId().equals(deptId)) { + if (dept.getDeptCategory().equals(4)) { + list.add(dept.getId()); + } + stationDept(departList, dept.getId(), list); + } + }); + return list; + } + + /** + * 获取开始时间 + * @param date + * @param time + * @return + */ + private Date dutyStartTime(Date date, Time time){ + Calendar dateCal = Calendar.getInstance(); + dateCal.setTime(date); + Calendar timeCal = Calendar.getInstance(); + timeCal.setTime(time); + dateCal.set(Calendar.HOUR_OF_DAY, timeCal.get(Calendar.HOUR_OF_DAY)); + dateCal.set(Calendar.MINUTE, timeCal.get(Calendar.MINUTE)); + dateCal.set(Calendar.SECOND, timeCal.get(Calendar.SECOND)); + return dateCal.getTime(); + } + + /** + * 获取结束时间 + * @param date + * @param time + * @return + */ + private Date dutyEndTime(Date date, Time time,Time endTime){ + Calendar dateCal = Calendar.getInstance(); + dateCal.setTime(date); + Calendar timeCal = Calendar.getInstance(); + timeCal.setTime(time); + Calendar endCal = Calendar.getInstance(); + endCal.setTime(endTime); + // 结束时间 < 开始时间 + if(timeCal.after(endCal)){ + dateCal.set(Calendar.DAY_OF_MONTH, dateCal.get(Calendar.DAY_OF_MONTH) + 1 ); + } + dateCal.set(Calendar.HOUR_OF_DAY, endCal.get(Calendar.HOUR_OF_DAY)); + dateCal.set(Calendar.MINUTE, endCal.get(Calendar.MINUTE)); + dateCal.set(Calendar.SECOND, endCal.get(Calendar.SECOND)); + return dateCal.getTime(); + } + + /** + * 值班情况 + * + * @param dutyInfoVoList + * @param dept + * @param areaDutyVo + */ + private void dutySituation(List dutyInfoVoList, Dept dept, AreaDutyVo areaDutyVo) { + if (CollectionUtil.isEmpty(dutyInfoVoList) || ObjectUtil.isEmpty(dept)) { + return; + } + Long deptId = dept.getId(); + List filterList = dutyInfoVoList.stream().filter(o -> o.getCreateDept().equals(deptId)).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(filterList)) { + return; + } + DutyInfoVo dutyInfoVo = filterList.get(0); + areaDutyVo.setGeneratingCapacity(dutyInfoVo.getGeneratingCapacity()); + areaDutyVo.setOnlineCapacity(dutyInfoVo.getOnlineCapacity()); + areaDutyVo.setClassName(dutyInfoVo.getClassName()); + areaDutyVo.setGroupName(dutyInfoVo.getGroupName()); + areaDutyVo.setManagerName(dutyInfoVo.getManagerName()); + areaDutyVo.setManagerPhone(dutyInfoVo.getManagerPhone()); + areaDutyVo.setNextDutyInfoVo(dutyInfoVo.getNextDutyInfoVo()); + // 当班任务 + + String taskCount = this.taskCount(dutyInfoVo.getDateTime(),dutyInfoVo.getStartTime(),dutyInfoVo.getEndTime(),dutyInfoVo.getCreateDept()); + String[] task = taskCount.split("\\|"); + areaDutyVo.setTaskCount(Integer.valueOf(task[0])); + areaDutyVo.setFinishTaskCount(Integer.valueOf(task[1])); + NextDutyInfoVo upDutyInfoVo = dutyInfoVo.getUpDutyInfoVo(); + if(ObjectUtil.isEmpty(upDutyInfoVo)){ + return; + } + // 上一班组当班任务 + String upTaskCount = this.taskCount(upDutyInfoVo.getDateTime(),upDutyInfoVo.getStartTime(),upDutyInfoVo.getEndTime(),dutyInfoVo.getCreateDept()); + String[] upTask = upTaskCount.split("\\|"); + upDutyInfoVo.setTaskCount(Integer.valueOf(upTask[0])); + upDutyInfoVo.setFinishTaskCount(Integer.valueOf(upTask[1])); + areaDutyVo.setUpDutyInfoVo(upDutyInfoVo); + } + + + /** + * 获取当班任务 + * @param dateTime + * @param startTime + * @param endTime + * @param createDept + * @return + */ + private String taskCount(Date dateTime, Time startTime, Time endTime, Long createDept) { + DutyTaskVo task = new DutyTaskVo(); + //通过线程池异步获取月报各模块内容 主要分为五块内容 + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("duty-task-count-pool-%d").build(); + ExecutorService exe = new ThreadPoolExecutor(4, 4, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); + //监控线程执行完后返回结果 + CountDownLatch countDownLatch = new CountDownLatch(4); + List list = Collections.singletonList(createDept); + String start = DateUtil.format(this.dutyStartTime(dateTime,startTime),DateUtil.PATTERN_DATETIME); + String end = DateUtil.format(this.dutyEndTime(dateTime,startTime,endTime),DateUtil.PATTERN_DATETIME); + // 日常维护 + exe.execute(()->{ + MaintainVo maintainVo = maintenanceService.maintain(start,end,list); + int maintainSum = maintainVo.getMaintain(); + int maintainFinish = maintainVo.getMaintainFinish(); + task.setMaintainSum(maintainSum); + task.setMaintainFinish(maintainFinish); + countDownLatch.countDown(); + }); + + // 消缺 + exe.execute(()->{ + ShortagesVo shortagesVo = phenomenonService.defectMonth(start,end,list); + int shortagesSum = shortagesVo.getShortagesSum(); + int shortages = shortagesVo.getShortages(); + task.setShortagesSum(shortagesSum); + task.setShortages(shortages); + countDownLatch.countDown(); + }); + // 检修 + exe.execute(()->{ + OverhaulVo overhaulVo = accessService.overhaul(start,end,list); + int overhaul = overhaulVo.getOverhaul(); + int overhaulFinish = overhaulVo.getOverhaulFinish(); + task.setOverhaul(overhaul); + task.setOverhaulFinish(overhaulFinish); + countDownLatch.countDown(); + }); + // 巡检 + exe.execute(()->{ + // 巡检任务 + DutyInspectTaskVO inspectTask = taskService.task(start,end,list); + if(ObjectUtil.isEmpty(inspectTask)){ + task.setInspect(0); + task.setInspectFinish(0); + }else{ + int inspect = inspectTask.getInspectTaskSum(); + int inspectFinish = inspectTask.getInspectTaskFinish(); + task.setInspect(inspect); + task.setInspectFinish(inspectFinish); + } + countDownLatch.countDown(); + }); + // 等待所有线程执行完成 + try { + countDownLatch.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + Thread.currentThread().interrupt(); + } + exe.shutdown(); + return (task.getMaintainSum() + task.getShortagesSum() + task.getOverhaul() + task.getInspect()) + "|" + + (task.getMaintainFinish() + task.getShortages() + task.getOverhaulFinish() + task.getInspectFinish()); + } + + /** + * 厂站运行情况 + * + * @param list + * @param areaDutyVo + */ + private void factoryStationRun(List deviceList,List list, AreaDutyVo areaDutyVo) { + areaDutyVo.setStationSum(0); + areaDutyVo.setStationRun(0); + if (CollectionUtil.isEmpty(list) || CollectionUtil.isEmpty(deviceList)) { + return; + } + areaDutyVo.setStationSum(list.size()); + List deptList = list.stream().map(StationEntity::getRefDept).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(deptList)){ + log.info("run_station_dept_list_null : {}",areaDutyVo.getDepartName()); + return; + } + // 过滤未绑定设备 + List codes = deviceList.stream().filter(o->deptList.contains(o.getCreateDept())).map(EminfoAndEmParamVo::getEmCode).collect(Collectors.toList()); + R> R = deviceInstanceClient.getListAnalyseCode(codes); + if (!R.isSuccess() || CollectionUtil.isEmpty(R.getData())) { + log.info("run_station_valid_device_null : {}",areaDutyVo.getDepartName()); + return; + } + // 根据机构分组 + Map> map = deviceList.stream().filter(o->R.getData().contains(o.getEmCode())).collect(Collectors.groupingBy(EminfoAndEmParamVo::getCreateDept)); + if(CollectionUtil.isEmpty(map)){ + log.info("run_station_group_by_valid_null : {}",areaDutyVo.getDepartName()); + return; + } + int runCount = 0; + // 遍历分组设备 + for(Map.Entry> entry : map.entrySet()){ + // 运行设备code集合 + List runCodes = entry.getValue().stream().filter(o -> (Func.isEmpty(o.getRunStatus()) || "1".equals(o.getRunStatus()))).map(EminfoAndEmParamVo::getEmCode).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(runCodes)){ + return; + } + runCount++; + } + areaDutyVo.setStationRun(runCount); + areaDutyVo.setStationSum(list.size()); + } + + /** + * 当月任务执行情况 + * + * @param list + * @param areaDutyVo + */ + private void executeTaskMonth(List list, AreaDutyVo areaDutyVo) { + if (CollectionUtil.isEmpty(list)) { + areaDutyVo.setMaintainSumMoth(0); + areaDutyVo.setMaintainFinishSumMoth(0); + areaDutyVo.setMaintainRateMoth("0"); + areaDutyVo.setShortagesSumMoth(0); + areaDutyVo.setShortagesMoth(0); + areaDutyVo.setShortagesRateMoth("0"); + areaDutyVo.setOverhaulSumMoth(0); + areaDutyVo.setOverhaulFinishSumMoth(0); + areaDutyVo.setOverhaulRateMoth("0"); + areaDutyVo.setOperateSumMoth(0); + areaDutyVo.setOperateQualifySumMoth(0); + areaDutyVo.setOperateRateMoth("0"); + areaDutyVo.setWorkSumMoth(0); + areaDutyVo.setWorkQualifySumMoth(0); + areaDutyVo.setWorkRateMoth("0"); + return; + } + LocalDate firstDay = LocalDate.now().withDayOfMonth(1); + String start = DateUtil.format(new Date(),"yyyy-MM") + "-01 00:00:00"; + String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME); + //通过线程池异步获取月报各模块内容 主要分为五块内容 + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("month-task-pool-%d").build(); + ScheduledExecutorService exe = new ScheduledThreadPoolExecutor(4, namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); + //监控线程执行完后返回结果 + CountDownLatch countDownLatch = new CountDownLatch(4); + // 日常维护 + exe.execute(()->{ + MaintainVo maintainVo = maintenanceService.maintain(start,end,list); + int maintainSum = maintainVo.getMaintain(); + int maintainFinish = maintainVo.getMaintainFinish(); + areaDutyVo.setMaintainSumMoth(maintainSum); + areaDutyVo.setMaintainFinishSumMoth(maintainFinish); + if (maintainFinish == 0) { + areaDutyVo.setMaintainRateMoth("0"); + } else { + double maintainRate = BigDecimal.valueOf(maintainFinish / (double)maintainSum * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + areaDutyVo.setMaintainRateMoth(String.valueOf(maintainRate)); + } + countDownLatch.countDown(); + }); + + // 消缺 + exe.execute(()->{ + ShortagesVo shortagesVo = phenomenonService.defectMonth(start,end,list); + int shortagesSum = shortagesVo.getShortagesSum(); + int shortages = shortagesVo.getShortages(); + areaDutyVo.setShortagesSumMoth(shortagesSum); + areaDutyVo.setShortagesMoth(shortages); + if (Math.abs(shortagesSum) <= 0) { + areaDutyVo.setShortagesRateMoth("0"); + } else { + double shortagesRate = BigDecimal.valueOf(shortages / (double)shortagesSum * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + areaDutyVo.setShortagesRateMoth(String.valueOf(shortagesRate)); + } + countDownLatch.countDown(); + }); + // 检修 + exe.execute(()->{ + OverhaulVo overhaulVo = accessService.overhaul(start,end,list); + int overhaul = overhaulVo.getOverhaul(); + int overhaulFinish = overhaulVo.getOverhaulFinish(); + areaDutyVo.setOverhaulSumMoth(overhaul); + areaDutyVo.setOverhaulFinishSumMoth(overhaulFinish); + if (overhaulFinish == 0) { + areaDutyVo.setOverhaulRateMoth("0"); + } else { + double overhaulRate = BigDecimal.valueOf(overhaulFinish / (double)overhaul * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + areaDutyVo.setOverhaulRateMoth(String.valueOf(overhaulRate)); + } + countDownLatch.countDown(); + }); + // 操作票&工作票 + exe.execute(()->{ + TicketMonthVO ticket = ticketService.operateWork(start,end,list); + if (ObjectUtil.isEmpty(ticket)) { + areaDutyVo.setOperateSumMoth(0); + areaDutyVo.setOperateQualifySumMoth(0); + areaDutyVo.setOperateRateMoth("0"); + areaDutyVo.setWorkSumMoth(0); + areaDutyVo.setWorkQualifySumMoth(0); + areaDutyVo.setWorkRateMoth("0"); + countDownLatch.countDown(); + return; + } + int operate = ticket.getOperate(); + int operateQualify = ticket.getOperateQualify(); + areaDutyVo.setOperateSumMoth(operate); + areaDutyVo.setOperateQualifySumMoth(operateQualify); + if (operateQualify == 0) { + areaDutyVo.setOperateRateMoth("0"); + } else { + double operateRate = BigDecimal.valueOf(operateQualify / (double)operate * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + areaDutyVo.setOperateRateMoth(String.valueOf(operateRate)); + } + // 工作票 + int work = ticket.getWork(); + int workQualify = ticket.getWorkQualify(); + areaDutyVo.setWorkSumMoth(work); + areaDutyVo.setWorkQualifySumMoth(workQualify); + if (workQualify == 0) { + areaDutyVo.setWorkRateMoth("0"); + } else { + double workRate = BigDecimal.valueOf(workQualify / (double)work * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + areaDutyVo.setWorkRateMoth(String.valueOf(workRate)); + } + countDownLatch.countDown(); + }); + + // 等待所有线程执行完成 + try { + countDownLatch.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + Thread.currentThread().interrupt(); + } + exe.shutdown(); + } + + /** + * 上一班组发电量 + * @param dutyList + * @param deviceList + * @param value + * @param areaDutyVo + */ + private void upDutyPower(List dutyList, List deviceList,Long deptId, List value, AreaDutyVo areaDutyVo) { + List list = dutyList.stream().filter(o -> deptId.equals(o.getCreateDept())).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(list)) { + return; + } + NextDutyInfoVo upDutyInfoVo = dutyList.get(0).getUpDutyInfoVo(); + if(ObjectUtil.isEmpty(upDutyInfoVo)){ + return; + } + // 上一班组开始时间、结束时间 + Date startDate = this.dutyStartTime(upDutyInfoVo.getDateTime(),upDutyInfoVo.getStartTime()); + Date endDate = this.dutyEndTime(upDutyInfoVo.getDateTime(),upDutyInfoVo.getStartTime(),upDutyInfoVo.getEndTime()); + // 获取时间断内发电量 + this.dutyPower(startDate,endDate,deviceList,value,areaDutyVo,true); + } + + /** + * 班组实时发电量 + * @param startDate + * @param endDate + * @param deviceList + * @param list + * @param areaDutyVo + */ + private void dutyPower(Date startDate, Date endDate, List deviceList,List list,AreaDutyVo areaDutyVo,boolean flag) { + areaDutyVo.setGeneratingCapacity(0); + List deptList = list.stream().map(StationEntity::getRefDept).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(deptList)){ + return; + } + // 区域站点下设备 + List devices = deviceList.stream().filter(o->deptList.contains(o.getCreateDept())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(devices)){ + return; + } + // 获取当班时间内发电量 + float generatingCapacity = this.generateByDuty(devices,startDate,endDate); + // 是否为查询上一班组发电量 + if(flag){ + NextDutyInfoVo upDutyInfoVo = areaDutyVo.getUpDutyInfoVo(); + upDutyInfoVo.setGeneratingCapacity(generatingCapacity); + areaDutyVo.setUpDutyInfoVo(upDutyInfoVo); + return; + } + areaDutyVo.setGeneratingCapacity(generatingCapacity); + } + + /*** + * 根据当班时间查询发电量 + * @param devices + * @param start + * @param end + * @return + */ + private float generateByDuty(List devices, Date start, Date end) { + float generate = 0f; + if(CollectionUtil.isEmpty(devices)){ + return generate; + } + for(EminfoAndEmParamVo device : devices ){ + generate += analyseDataService.periodTargetFloat(DateUtil.format(start,DateUtil.PATTERN_DATETIME),DateUtil.format(end,DateUtil.PATTERN_DATETIME),5,3,device.getEmCode(),device.getRideCount(),HomePageConstant.HYDROPOWER_GENERATE_POWER); + } + return generate; + } + + /** + * 当班双票 + * @param startDate + * @param endDate + * @param list + * @param areaDutyVo + */ + private void dutyDoubleTicket(Date startDate,Date endDate, List list,AreaDutyVo areaDutyVo) { + String start = DateUtil.format(startDate,"yyyy-MM") + "-01 00:00:00"; + String end = DateUtil.format(endDate,DateUtil.PATTERN_DATETIME); + if (CollectionUtil.isEmpty(list)) { + areaDutyVo.setWorkTicketCount(0); + areaDutyVo.setHandoverTicketCount(0); + areaDutyVo.setVoidTicketCount(0); + areaDutyVo.setDeferredTicketCount(0); + areaDutyVo.setCloseTicketCount(0); + areaDutyVo.setOperationTicketCount(0); + return; + } + WorkTicketStatisticVO work = workTicketService.work(start,end,list); + if (ObjectUtil.isEmpty(work)) { + areaDutyVo.setWorkTicketCount(0); + areaDutyVo.setHandoverTicketCount(0); + areaDutyVo.setVoidTicketCount(0); + areaDutyVo.setDeferredTicketCount(0); + areaDutyVo.setCloseTicketCount(0); + }else{ + areaDutyVo.setWorkTicketCount(work.getTotal()); + areaDutyVo.setHandoverTicketCount(work.getTransfer()); + areaDutyVo.setVoidTicketCount(work.getInvalid()); + areaDutyVo.setDeferredTicketCount(work.getDelay()); + areaDutyVo.setCloseTicketCount(work.getComplete()); + } + // 查询操作票 + Integer operater = ticketService.operate(start,end,list); + areaDutyVo.setOperationTicketCount(operater); + } + + /** + * 当班运行数据 + * @param start + * @param end + * @param childList + * @param areaDutyVo + */ + private void dutyRunCondition(Date startTime, Date endTime, List areas,AreaDutyVo areaDutyVo) { + String start = DateUtil.format(startTime,DateUtil.PATTERN_DATETIME); + String end = DateUtil.format(endTime,DateUtil.PATTERN_DATETIME); + // 巡检任务 + DutyInspectTaskVO task = taskService.task(start,end,areas); + areaDutyVo.setInspectionSum(0); + areaDutyVo.setInspectionFinish(0); + if(ObjectUtil.isNotEmpty(task)){ + areaDutyVo.setInspectionSum(task.getInspectTaskSum()); + areaDutyVo.setInspectionFinish(task.getInspectTaskFinish()); + if(Math.abs(task.getInspectTaskSum()) <= 0){ + areaDutyVo.setInspectionFinishRate(0.0); + }else{ + double inspectionFinishRate = BigDecimal.valueOf(task.getInspectTaskFinish() / (double)task.getInspectTaskSum() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + areaDutyVo.setInspectionFinishRate(inspectionFinishRate); + } + areaDutyVo.setInspectTaskIds(task.getInspectTaskIds()); + } + + // 消缺 + DutyDefectVO defect = phenomenonService.defect(start,end,areas); + areaDutyVo.setShortagesSum(0); + areaDutyVo.setShortages(0); + if(ObjectUtil.isNotEmpty(defect)){ + areaDutyVo.setShortagesSum(defect.getDefectSum()); + areaDutyVo.setShortages(defect.getDefect()); + areaDutyVo.setPhenomenonIds(defect.getTotalIds()); + if(Math.abs(defect.getDefectSum()) <= 0){ + areaDutyVo.setShortagesRate(0.0); + }else{ + double shortagesRate = BigDecimal.valueOf(defect.getDefect() / (double)defect.getDefectSum() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + areaDutyVo.setShortagesRate(shortagesRate); + } + } + // 定期工作 + RegularWorkVO regular = maintenanceService.regularWork(startTime,endTime,areas); + areaDutyVo.setWorkRegularlySum(0); + areaDutyVo.setWorkRegularly(0); + if(ObjectUtil.isNotEmpty(regular)){ + areaDutyVo.setWorkRegularlySum(regular.getRegularWorkSum()); + areaDutyVo.setWorkRegularly(regular.getRegularWork()); + areaDutyVo.setMainTaskIds(regular.getMainTaskIds()); + if(Math.abs(areaDutyVo.getWorkRegularlySum()) <= 0){ + areaDutyVo.setWorkRegularlyRate(0.0); + }else{ + double workRegularlyRate = BigDecimal.valueOf(areaDutyVo.getWorkRegularly() / (double)areaDutyVo.getWorkRegularlySum() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + areaDutyVo.setWorkRegularlyRate(workRegularlyRate); + } + } + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/TicketService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/TicketService.java index ff5e1ad..63d5ceb 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/TicketService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/TicketService.java @@ -16,5 +16,7 @@ public interface TicketService extends BaseService { DoublePassRateVO doublePassRate(List areas, LocalDateTime firstDateTime, LocalDateTime now); - TicketMonthVO operateWork(String start, String end, List list); + TicketMonthVO operateWork(String start, String end, List areas); + + Integer operate(String start, String end, List areas); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkDelayService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkDelayService.java new file mode 100644 index 0000000..ec3ef3c --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkDelayService.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.scheduled.service.ticket; + +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; +import org.springblade.core.mp.base.BaseService; + + +/** + * @author ysj + */ +public interface WorkDelayService extends BaseService { + +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkPrincipalService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkPrincipalService.java new file mode 100644 index 0000000..b819667 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkPrincipalService.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.scheduled.service.ticket; + +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketPrincipalChangeEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * @author ysj + */ +public interface WorkPrincipalService extends BaseService { + +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkTicketService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkTicketService.java index 0117669..9b1f4ac 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkTicketService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/WorkTicketService.java @@ -1,10 +1,15 @@ package com.hnac.hzims.scheduled.service.ticket; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.vo.WorkTicketStatisticVO; import org.springblade.core.mp.base.BaseService; +import java.util.List; +import java.util.Map; + /** * @author ysj */ public interface WorkTicketService extends BaseService { + WorkTicketStatisticVO work(String start, String end, List areas); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java index 62ef9a0..a108ff0 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java @@ -147,4 +147,24 @@ public class TicketServiceImpl extends BaseServiceImpl areas) { + List operates = this.list(new LambdaQueryWrapper() {{ + ge(StandardTicketInfoEntity::getStartTime, start); + le(StandardTicketInfoEntity::getStartTime, end); + in(StandardTicketInfoEntity::getCreateDept, areas); + }}); + if (CollectionUtil.isEmpty(operates)) { + return 0; + } + return operates.size(); + } + } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkDelayServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkDelayServiceImpl.java new file mode 100644 index 0000000..97d6b02 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkDelayServiceImpl.java @@ -0,0 +1,19 @@ +package com.hnac.hzims.scheduled.service.ticket.impl; + +import com.hnac.hzims.scheduled.mapper.ticket.WorkDelayMapper; +import com.hnac.hzims.scheduled.service.ticket.WorkDelayService; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @author ysj + */ +@Service +@AllArgsConstructor +@Slf4j +public class WorkDelayServiceImpl extends BaseServiceImpl implements WorkDelayService { + +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkPrincipalServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkPrincipalServiceImpl.java new file mode 100644 index 0000000..fce60fd --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkPrincipalServiceImpl.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.scheduled.service.ticket.impl; + +import com.hnac.hzims.scheduled.mapper.ticket.WorkPrincipalMapper; +import com.hnac.hzims.scheduled.service.ticket.WorkPrincipalService; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketPrincipalChangeEntity; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + + +/** + * @author ysj + */ +@Service +@AllArgsConstructor +@Slf4j +public class WorkPrincipalServiceImpl extends BaseServiceImpl implements WorkPrincipalService { + +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java index d859eeb..e8bb066 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java @@ -1,14 +1,28 @@ package com.hnac.hzims.scheduled.service.ticket.impl; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.scheduled.mapper.ticket.WorkTicketMapper; +import com.hnac.hzims.scheduled.service.ticket.WorkDelayService; +import com.hnac.hzims.scheduled.service.ticket.WorkPrincipalService; import com.hnac.hzims.scheduled.service.ticket.WorkTicketService; +import com.hnac.hzims.ticket.constants.TicketConstants; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketPrincipalChangeEntity; +import com.hnac.hzims.ticket.workTicket.vo.WorkTicketStatisticVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.CollectionUtil; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.FutureTask; +import java.util.stream.Collectors; + /** * @author ysj @@ -18,4 +32,55 @@ import org.springframework.stereotype.Service; @RequiredArgsConstructor @DS("ticket") public class WorkTicketServiceImpl extends BaseServiceImpl implements WorkTicketService { + + private WorkPrincipalService workPrincipalService; + private WorkDelayService workDelayService; + + @Override + public WorkTicketStatisticVO work(String start, String end, List areas) { + WorkTicketStatisticVO work = new WorkTicketStatisticVO(); + List infoList = this.list(new LambdaQueryWrapper() {{ + ge(WorkTicketInfoEntity::getPlanStartTime, start); + le(WorkTicketInfoEntity::getPlanStartTime, end); + in(WorkTicketInfoEntity::getCreateDept, areas); + }}); + if (CollectionUtil.isNotEmpty(infoList)) { + List infoIdList = infoList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList()); + work.setTotal(infoList.size()); + //工作票作废 + List invalidList = infoList.stream().filter(w -> TicketConstants.FirstWorkTicketFlowStatusEnum.INVALID.getStatus().equals(w.getStatus())) + .collect(Collectors.toList()); + work.setInvalid(CollectionUtil.isNotEmpty(invalidList) ? invalidList.size() : 0); + // 工作票完成数 + List completeList = infoList.stream().filter(w -> TicketConstants.FirstWorkTicketFlowStatusEnum.FINISH.getStatus().equals(w.getStatus())) + .collect(Collectors.toList()); + work.setComplete(CollectionUtil.isNotEmpty(completeList) ? completeList.size() : 0); + //工作票移交 + FutureTask transferTask = new FutureTask(() -> { + List moveList = workPrincipalService.list(new LambdaQueryWrapper() {{ + in(WorkTicketPrincipalChangeEntity::getTicketId, infoIdList); + }}); + return CollectionUtil.isNotEmpty(moveList) ? moveList.size() : 0; + }); + + new Thread(transferTask, "工作票移交Thread").start(); + //工作票延期 + FutureTask delayTask = new FutureTask(() -> { + log.info("开始工作票延期"); + List delayEntityList = workDelayService.list(Wrappers.lambdaQuery() + .in(WorkTicketDelayEntity::getTicketId, infoIdList) + ); + return CollectionUtil.isNotEmpty(delayEntityList) ? delayEntityList.size() : 0; + }); + new Thread(delayTask, "工作票延期Thread").start(); + try { + work.setDelay((Integer) delayTask.get()); + work.setTransfer((Integer) transferTask.get()); + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + Thread.currentThread().interrupt(); + } + } + return work; + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyGroupMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyGroupMapper.xml new file mode 100644 index 0000000..6078ecc --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyGroupMapper.xml @@ -0,0 +1,4 @@ + + + + diff --git a/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyMapper.xml new file mode 100644 index 0000000..6efe983 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyPersonMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyPersonMapper.xml new file mode 100644 index 0000000..d4dca99 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/DutyPersonMapper.xml @@ -0,0 +1,4 @@ + + + + diff --git a/hzims-service/hzims-scheduled/src/main/resources/mapper/ticket/WorkDelayMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/ticket/WorkDelayMapper.xml new file mode 100644 index 0000000..74634e7 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/resources/mapper/ticket/WorkDelayMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/hzims-scheduled/src/main/resources/mapper/ticket/WorkPrincipalMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/ticket/WorkPrincipalMapper.xml new file mode 100644 index 0000000..cae0516 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/resources/mapper/ticket/WorkPrincipalMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java index 7d58740..84a660b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java @@ -29,7 +29,7 @@ import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; -import com.hnac.hzims.operational.maintenance.vo.RegularWorkVO; +import com.hnac.hzims.operational.main.vo.RegularWorkVO; import com.hnac.hzims.operational.report.vo.DutyDefectVO; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.service.IStationService; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceTaskService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceTaskService.java index 45098e1..c821f1c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceTaskService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceTaskService.java @@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.RegularWorkVO; +import com.hnac.hzims.operational.main.vo.RegularWorkVO; import com.hnac.hzims.operational.report.vo.MaintenanceReportVO; import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo; import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskWithAreaVo; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java index b253525..f744297 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java @@ -10,21 +10,18 @@ import com.google.common.collect.Lists; import com.hnac.hzims.operational.defect.constants.DefectConstant; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.mapper.OperPhenomenonMapper; -import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity; -import com.hnac.hzims.operational.duty.service.IImsDutyClassService; -import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; -import com.hnac.hzims.operational.maintenance.vo.RegularWorkVO; -import com.hnac.hzims.operational.report.vo.MaintenanceReportVO; +import com.hnac.hzims.operational.main.vo.RegularWorkVO; import com.hnac.hzims.operational.maintenance.constants.DictConstant; import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant; +import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.mapper.OperMaintenanceTaskMapper; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; import com.hnac.hzims.operational.maintenance.wrapper.OperMaintenanceTaskWrapper; +import com.hnac.hzims.operational.report.vo.MaintenanceReportVO; import com.hnac.hzims.safeproduct.Constants; import com.hnac.hzims.safeproduct.feign.IDangerSourceClient; -import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo; import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo; import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskWithAreaVo; import com.hnac.hzims.vo.SafeCheckStatisticVO; @@ -53,7 +50,6 @@ import org.springframework.util.CollectionUtils; import java.text.DecimalFormat; import java.time.LocalDate; -import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.concurrent.atomic.AtomicReference; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/vo/RegularWorkVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/vo/RegularWorkVO.java deleted file mode 100644 index 747e37d..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/vo/RegularWorkVO.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.hnac.hzims.operational.maintenance.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 定期工作 - */ -@Data -public class RegularWorkVO{ - - @ApiModelProperty("定期工作总数") - private Integer regularWorkSum; - - @ApiModelProperty("修改人名称") - private Integer regularWork; - - @ApiModelProperty("日常维护任务Id 按逗号分隔") - private String mainTaskIds; -} From f2d89e306c92be2fad403f45014f19fce823442f Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 8 Jun 2023 15:38:28 +0800 Subject: [PATCH 3/6] =?UTF-8?q?#=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=8A=BD=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/main/constant/MainConstants.java | 2 +- .../scheduled/scheduled/ShowScheduledTask.java | 15 ++- .../service/inspect/impl/TaskServiceImpl.java | 2 + .../scheduled/service/operation/ShowService.java | 2 + .../service/operation/impl/ShowServiceImpl.java | 104 +++++++++++++++++++-- .../safeproduct/impl/CompanyServiceImpl.java | 2 + .../safeproduct/impl/InstanceServiceImpl.java | 2 + .../service/safeproduct/impl/MonthServiceImpl.java | 2 + .../service/safeproduct/impl/TrialServiceImpl.java | 4 + .../service/ticket/impl/WorkDelayServiceImpl.java | 2 + .../ticket/impl/WorkPrincipalServiceImpl.java | 2 + .../main/scheduled/ScheduledCreateTask.java | 2 +- 12 files changed, 128 insertions(+), 13 deletions(-) diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java index 34d5a16..dee4c93 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java @@ -53,7 +53,7 @@ public interface MainConstants { String REGIONAL_DUTY_INFO = "regionalDutyInfo"; // 区域设备分类统计 - String DEVICE_CLASSIFY = "deviceClassify"; + String LOAD_DEVICE_CLASSIFY = "deviceClassify"; // 区域月报 String AREA_MONTH_REPORT = "areaMonthReport"; diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java index 19c294c..ee07df0 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java @@ -11,8 +11,7 @@ import org.springframework.stereotype.Component; import java.util.Date; -import static com.hnac.hzims.operational.main.constant.MainConstants.LOAD_HOME_TARGET; -import static com.hnac.hzims.operational.main.constant.MainConstants.REGIONAL_DUTY_INFO; +import static com.hnac.hzims.operational.main.constant.MainConstants.*; /** @@ -48,4 +47,16 @@ public class ShowScheduledTask { service.loadRegionalDuty(param); return new ReturnT<>("SUCCESS"); } + + /** + * 首页-区域设备分类统计 + */ + @XxlJob(LOAD_DEVICE_CLASSIFY) + public ReturnT loaddDeviceClassify(String param) { + if (Func.isBlank(param)) { + param = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + } + service.loaddDeviceClassify(param); + return new ReturnT<>("SUCCESS"); + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java index 6fcc206..e323d5b 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.scheduled.service.inspect.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.hnac.hzims.scheduled.mapper.inspect.TaskMapper; import com.hnac.hzims.scheduled.service.inspect.TaskService; @@ -21,6 +22,7 @@ import java.util.stream.Collectors; @Service @Slf4j @AllArgsConstructor +@DS("inspect") public class TaskServiceImpl extends BaseServiceImpl implements TaskService { /** diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ShowService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ShowService.java index 78a454b6..8bef00c 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ShowService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ShowService.java @@ -8,4 +8,6 @@ public interface ShowService { void loadHomeTarget(String param); void loadRegionalDuty(String param); + + void loaddDeviceClassify(String param); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ShowServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ShowServiceImpl.java index 9c64c59..52a9617 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ShowServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ShowServiceImpl.java @@ -1,14 +1,18 @@ package com.hnac.hzims.scheduled.service.operation.impl; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import com.hnac.hzims.EquipmentConstants; import com.hnac.hzims.equipment.entity.PlanGenerationEntity; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; +import com.hnac.hzims.operational.access.constants.AccessConstants; +import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; +import com.hnac.hzims.operational.defect.constants.DefectConstant; +import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.duty.vo.DutyInfoVo; import com.hnac.hzims.operational.duty.vo.DutyTaskVo; import com.hnac.hzims.operational.duty.vo.NextDutyInfoVo; @@ -27,11 +31,9 @@ import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketStatisticVO; import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient; import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO; -import com.xxl.job.core.log.XxlJobLogger; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.MapUtils; -import org.apache.poi.ss.formula.functions.T; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.*; import org.springblade.system.cache.DictCache; @@ -50,7 +52,6 @@ import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; import java.sql.Time; -import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; @@ -100,7 +101,13 @@ public class ShowServiceImpl implements ShowService { public String device_cache_cofig_final; @Value("${hzims.operation.region.areaDutyInfoKey}") - private String area_duty_cofig_final; + private String area_duty_cache_final; + + @Value("${hzims.operation.region.deviceClassifyKey}") + private String device_classify_cache_final; + + @Value("${hzims.operation.realIdKey}") + public String real_cache_final; /** * 集团总指标-首页数据 @@ -192,7 +199,7 @@ public class ShowServiceImpl implements ShowService { this.dutyRunCondition(startDate,endDate,singlet,areaDutyVo); areaDutyVoList.add(areaDutyVo); }); - redisTemplate.opsForValue().set(area_duty_cofig_final, areaDutyVoList); + redisTemplate.opsForValue().set(area_duty_cache_final, areaDutyVoList); } /** @@ -243,6 +250,55 @@ public class ShowServiceImpl implements ShowService { return target; } + + /** + * 设备分类 + * + * @param param + */ + @Override + public void loaddDeviceClassify(String param) { + // 获取所有设备 + List devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(), new TypeReference>() {}); + // 实时数据 + String json = (String) redisTemplate.opsForValue().get(real_cache_final); + Map realMap = null; + if (StringUtil.isNotBlank(json)) { + realMap = JSONObject.parseObject(json, new TypeReference>() {}); + } + Map> deviceClassifyMap = new HashMap<>(); + List deviceCodeList = devices.stream().map(EminfoAndEmParamVo::getEmCode).collect(Collectors.toList()); + // 故障 + List operPhenomenonEntityList = phenomenonService.list(new QueryWrapper() {{ + in("EM_CODE", deviceCodeList); + ne("IS_DEFECT", DefectConstant.IsDefectStatusEnum.IS_DEFECT.getStatus()); + ne("CONCLUSION_STATUS", DefectConstant.HandlerStatusEnum.FINISH_STATUS.getStatus()); + }}); + List faultList = operPhenomenonEntityList.stream().map(OperPhenomenonEntity::getEmCode).distinct().collect(Collectors.toList()); + deviceClassifyMap.put(HomePageConstant.FAULT,faultList); + // 检修 + List operAccessTaskEntityList = accessService.list(new QueryWrapper() {{ + in("EM_CODE", deviceCodeList); + ne("STATUS", AccessConstants.ACCESS_TASK_STATUS_4); + }}); + List overhaulList = operAccessTaskEntityList.stream().map(OperAccessTaskEntity::getEmCode).distinct().collect(Collectors.toList()); + List overhaulOldList = devices.stream().filter(o-> !faultList.contains(o.getEmCode()) && !overhaulList.contains(o.getEmCode()) && (Func.isNotEmpty(o.getRunStatus()) && EquipmentConstants.RunStatus.access.getStatus().equals(o.getRunStatus()))) + .map(EminfoAndEmParamVo::getEmCode).collect(Collectors.toList()); + overhaulList.addAll(overhaulOldList); + deviceClassifyMap.put(HomePageConstant.OVERHAUL,overhaulList); + // 运行 + List runDeviceList = devices.stream().filter(o-> !faultList.contains(o.getEmCode()) && !overhaulList.contains(o.getEmCode())).distinct().collect(Collectors.toList()); + List runList = this.runDevice(runDeviceList,realMap); + deviceClassifyMap.put(HomePageConstant.RUN,runList); + // 备用 + List spareList = devices.stream().filter(o-> !faultList.contains(o.getEmCode()) && !overhaulList.contains(o.getEmCode()) && !runList.contains(o.getEmCode()) && Func.isNotEmpty(o.getRunStatus()) + && EquipmentConstants.RunStatus.spare.getStatus().equals(o.getRunStatus())) + .map(EminfoAndEmParamVo::getEmCode).distinct().collect(Collectors.toList()); + deviceClassifyMap.put(HomePageConstant.SPARE,spareList); + redisTemplate.opsForValue().set(device_classify_cache_final, deviceClassifyMap); + } + + /** * 风电指标 * @return @@ -1127,9 +1183,9 @@ public class ShowServiceImpl implements ShowService { /** * 当班运行数据 - * @param start - * @param end - * @param childList + * @param startTime + * @param endTime + * @param areas * @param areaDutyVo */ private void dutyRunCondition(Date startTime, Date endTime, List areas,AreaDutyVo areaDutyVo) { @@ -1182,4 +1238,34 @@ public class ShowServiceImpl implements ShowService { } } } + + /** + * 获取运行设备列表 + * @param runDeviceList + * @param realMap + * @return + */ + private List runDevice(List runDeviceList, Map realMap) { + return runDeviceList.stream().map(o ->{ + Map points = o.getPoint(); + if(CollectionUtil.isEmpty(points)){ + return "0"; + } + String realId = points.get(HomePageConstant.JOINT_RELAY); + if(StringUtil.isEmpty(realId)){ + return "0"; + } + if(MapUtils.isEmpty(realMap)){ + return "0"; + } + String value = realMap.get(realId); + if(StringUtil.isEmpty(value)){ + return "0"; + } + if (value.contains("1") || "1.0".equals(value)) { + return o.getEmCode(); + } + return "0"; + }).distinct().collect(Collectors.toList()); + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/CompanyServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/CompanyServiceImpl.java index 7004ad3..9309b66 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/CompanyServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/CompanyServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.scheduled.service.safeproduct.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity; import com.hnac.hzims.scheduled.mapper.safeproduct.CompanyMapper; import com.hnac.hzims.scheduled.service.safeproduct.CompanyService; @@ -14,6 +15,7 @@ import org.springframework.stereotype.Service; @Service @AllArgsConstructor @Slf4j +@DS("safeproduct") public class CompanyServiceImpl extends BaseServiceImpl implements CompanyService { } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/InstanceServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/InstanceServiceImpl.java index 1b44fa8..5fd57ad 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/InstanceServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/InstanceServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.scheduled.service.safeproduct.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity; import com.hnac.hzims.scheduled.mapper.safeproduct.InstanceMapper; import com.hnac.hzims.scheduled.service.safeproduct.InstanceService; @@ -14,6 +15,7 @@ import org.springframework.stereotype.Service; @Service @AllArgsConstructor @Slf4j +@DS("safeproduct") public class InstanceServiceImpl extends BaseServiceImpl implements InstanceService { } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/MonthServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/MonthServiceImpl.java index 697e6c0..50d245d 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/MonthServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/MonthServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.scheduled.service.safeproduct.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity; @@ -29,6 +30,7 @@ import java.util.concurrent.atomic.AtomicInteger; @Service @AllArgsConstructor @Slf4j +@DS("safeproduct") public class MonthServiceImpl extends BaseServiceImpl implements MonthService { private final CompanyService companyService; diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/TrialServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/TrialServiceImpl.java index 37a2050..379fff7 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/TrialServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/TrialServiceImpl.java @@ -1,11 +1,13 @@ package com.hnac.hzims.scheduled.service.safeproduct.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO; import com.hnac.hzims.safeproduct.entity.SafeEquipmentTrialEntity; import com.hnac.hzims.scheduled.mapper.safeproduct.TrialMapper; import com.hnac.hzims.scheduled.service.safeproduct.TrialService; 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.ObjectUtil; @@ -17,7 +19,9 @@ import java.util.Optional; * @author ysj */ @Service +@Slf4j @RequiredArgsConstructor +@DS("safeproduct") public class TrialServiceImpl extends BaseServiceImpl implements TrialService { /** diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkDelayServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkDelayServiceImpl.java index 97d6b02..0f0fb63 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkDelayServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkDelayServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.scheduled.service.ticket.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hnac.hzims.scheduled.mapper.ticket.WorkDelayMapper; import com.hnac.hzims.scheduled.service.ticket.WorkDelayService; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; @@ -14,6 +15,7 @@ import org.springframework.stereotype.Service; @Service @AllArgsConstructor @Slf4j +@DS("ticket") public class WorkDelayServiceImpl extends BaseServiceImpl implements WorkDelayService { } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkPrincipalServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkPrincipalServiceImpl.java index fce60fd..427f272 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkPrincipalServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkPrincipalServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.scheduled.service.ticket.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hnac.hzims.scheduled.mapper.ticket.WorkPrincipalMapper; import com.hnac.hzims.scheduled.service.ticket.WorkPrincipalService; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketPrincipalChangeEntity; @@ -15,6 +16,7 @@ import org.springframework.stereotype.Service; @Service @AllArgsConstructor @Slf4j +@DS("ticket") public class WorkPrincipalServiceImpl extends BaseServiceImpl implements WorkPrincipalService { } \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java index 7cb4cc8..b66f01f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java @@ -195,7 +195,7 @@ public class ScheduledCreateTask { * 首页-区域设备分类统计 * @return ReturnT */ - @XxlJob(DEVICE_CLASSIFY) + @XxlJob(LOAD_DEVICE_CLASSIFY) //@Scheduled(cron = "0/10 * * * * ? ") public ReturnT deviceClassify(String param) throws Exception { if (Func.isBlank(param)) { From a186908addb5b3e2b0e0ab13267e91ed0c08313c Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 8 Jun 2023 15:56:05 +0800 Subject: [PATCH 4/6] =?UTF-8?q?#=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=8A=BD=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipment/impl/WorkshopInfoServiceImpl.java | 2 +- .../defect/service/IOperDefectService.java | 91 +++++++++++++++++++++- 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/WorkshopInfoServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/WorkshopInfoServiceImpl.java index d7ae08f..a82c6dc 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/WorkshopInfoServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/WorkshopInfoServiceImpl.java @@ -18,4 +18,4 @@ import org.springframework.stereotype.Service; @DS("equipment") public class WorkshopInfoServiceImpl extends BaseServiceImpl implements WorkshopInfoService { -} +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java index 30ab90c..6968b1d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java @@ -1,13 +1,102 @@ package com.hnac.hzims.operational.defect.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hnac.hzims.operational.defect.entity.OperDefectEntity; +import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; +import com.hnac.hzims.operational.defect.vo.OperDefectVO; +import com.hnac.hzims.operational.report.vo.DefectReportsVO; +import com.hnac.hzims.vo.SafeCheckStatisticVO; import org.springblade.core.mp.base.BaseService; +import org.springblade.core.tool.api.R; +import org.springblade.flow.core.entity.BladeFlow; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; +import java.util.Map; /** - * @author ysj + * 服务类 + * + * @author Chill */ public interface IOperDefectService extends BaseService { + /** + * 开始问题处理流程 + * 问题处理流程的第一个处理节点人key 必须是 problemUser + * @param + */ + void startFlow(OperPhenomenonEntity entity, OperDefectEntity defectEntity); + /** + * 处理问题 + * @param flow + * @return + */ + boolean handleProcess(BladeFlow flow); + + /** + * 获取缺陷的统计月报 + * @param month 格式:"2021-01" + */ + Map getDefectStatistics(String month); + + /** + * 导出缺陷统计月报报表 + * @param response + * @param month 格式 "2021-01" + * @throws IOException + */ + void exportFualtMonthExcel(HttpServletResponse response, String month) throws IOException; + + + List getDefectList(String emCode,List list); + + List getDefectByEmCodeList(String emCode); + + /** + * 站点月报统计 - 消缺 + * @param startDate + * @param endDate + * @param deptIdList + * @return + */ + List getFaultByFaultCode(LocalDate startDate,LocalDate endDate,List deptIdList); + + List getFaultByFaultCode(Map params); + + List> getDefectConclusion(Map params); + + /** + * 缺陷详情 + * @param defect + * @return + */ + R detail(OperDefectEntity defect); + + /** + * 获取安全检查消缺项统计 + * @param startDate 开始时间 + * @param endDate 结束时间 + * @param dept 机构ID + * @param defectType 缺陷类型;1: 重大缺陷 2:一般缺陷 + * @return SafeCheckStatisticVO 对象 + */ + SafeCheckStatisticVO getDefectCheck(String startDate,String endDate,Long dept,String defectType); + + boolean updateDefectInfo(OperDefectEntity entity); + + boolean updateDefectHanderState(OperDefectEntity entity); + + + /** + * 分页查询 + * @param operDefectEntityPage + * @param defect + * @return + */ + IPage selectPage(Page operDefectEntityPage, OperDefectEntity defect); } From 5085b922a73b86fbd5a718446ed97c4755514bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Thu, 8 Jun 2023 17:24:15 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spare/controller/SpAllocationController.java | 3 +- .../spare/controller/SpReceiveController.java | 2 +- .../spare/controller/SpReceivesController.java | 2 +- .../spare/controller/SpWarehouseInController.java | 3 +- .../spare/controller/SpWarehouseOutController.java | 3 +- .../spare/controller/WtSpTotalController.java | 5 +- .../hzims/fdp/controller/FdpDeviceController.java | 6 + .../hzims/fdp/controller/FdpMonitorController.java | 2 +- hzims-service/inspect/pom.xml | 7 + .../inspect/ai/controller/ClockController.java | 7 + .../inspect/ai/controller/ClockTypeController.java | 7 + .../inspect/ai/controller/RobotController.java | 7 + .../hzinfo/inspect/obj/web/ContentController.java | 6 + .../hzinfo/inspect/obj/web/ObjectController.java | 6 + .../inspect/obj/web/ObjectUserController.java | 7 + .../hzinfo/inspect/obj/web/ProjectController.java | 6 + .../hzinfo/inspect/obj/web/TemplateController.java | 6 + .../inspect/plan/controller/PlanController.java | 6 + .../inspect/plan/controller/RouteController.java | 175 ++++++------ .../report/controller/InspectReportController.java | 6 + .../inspect/task/controller/TaskController.java | 13 + .../task/controller/TaskRecordController.java | 6 + .../controller/OperAccessLibraryController.java | 3 +- .../controller/OperAccessStatisticsController.java | 3 +- .../controller/OperAccessTaskController.java | 3 +- .../alert/controller/AlarmHandleController.java | 6 + .../defect/controller/OperDefectController.java | 3 +- .../defect/controller/OperFaultController.java | 3 +- .../duty/controller/ImsDutyClassController.java | 5 +- .../controller/ImsDutyClassTypeController.java | 145 +++++----- .../duty/controller/ImsDutyGroupController.java | 6 +- .../duty/controller/ImsDutyMainController.java | 303 +++++++++++---------- .../duty/controller/ImsDutyRecController.java | 10 +- .../fill/controller/GenerateController.java | 6 + .../fill/controller/OtherController.java | 5 +- .../fill/controller/OverConfigController.java | 3 +- .../fill/controller/OverController.java | 5 +- .../fill/controller/PowerController.java | 5 +- .../fill/controller/RainfallController.java | 6 + .../fill/controller/SolveController.java | 5 +- .../fill/controller/StorageController.java | 6 + .../operational/fill/controller/UseController.java | 6 + .../main/controller/HomePageController.java | 4 +- .../controller/MainSystemMonitoringController.java | 2 +- .../OperMaintenanceLibraryController.java | 2 +- .../controller/CheckMonthController.java | 6 + .../controller/DangerSourceController.java | 6 + .../controller/EmergencyPlanController.java | 3 +- .../controller/ImsMonCameraInfoController.java | 7 + .../controller/SafeEquipmentTrialController.java | 3 +- .../controller/SystemFileController.java | 3 +- .../repair/controller/OperRepairController.java | 3 +- .../service/impl/TicketProcessServiceImpl.java | 5 +- .../controller/WorkTicketInfoController.java | 2 +- 54 files changed, 538 insertions(+), 336 deletions(-) diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java index 1ed8d0b..c69bbe2 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java @@ -67,7 +67,8 @@ public class SpAllocationController extends BladeController { @GetMapping("/pageList") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入sp_allocation") - @OperationAnnotation(title = "调泼单",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "资产管理", + title = "调泼单",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "分页查询") public R> pageList(SpAllocationVO allocationVO, Query query) { IPage pages = sp_allocationService.selectPageList(Condition.getPage(query),allocationVO); diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceiveController.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceiveController.java index 963dbc7..91b20cc 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceiveController.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceiveController.java @@ -54,7 +54,7 @@ public class SpReceiveController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入sp_receive") - @OperationAnnotation(title = "工具领用",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "资产管理",title = "工具领用",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "分页查询") public R> list(SpReceiveVO receiveVO, Query query) { IPage pages = sp_receiveService.selectPageList(Condition.getPage(query), receiveVO); diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceivesController.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceivesController.java index c7506ce..3b8a204 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceivesController.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceivesController.java @@ -57,7 +57,7 @@ public class SpReceivesController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入sp_receives") - @OperationAnnotation(title = "工具回退",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "资产管理",title = "工具回退",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "分页查询") public R> list(SpReceivesVO sp_receives, Query query) { IPage pages = sp_receivesService.selectPageList(Condition.getPage(query), sp_receives); diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseInController.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseInController.java index 2dcdacf..eb892ce 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseInController.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseInController.java @@ -66,7 +66,8 @@ public class SpWarehouseInController extends BladeController { @GetMapping("/pageList") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入sp_warehouse_in") - @OperationAnnotation(title = "入库单",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "资产管理",title = "入库单",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页条件") public R> pageList(SpWarehouseInVO warehouseInVO, Query query) { IPage pages = sp_warehouse_inService.selectPageList(Condition.getPage(query),warehouseInVO); diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java index 7612743..f73924d 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java @@ -54,7 +54,8 @@ public class SpWarehouseOutController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入sp_warehouse_out") - @OperationAnnotation(title = "出库单",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "资产管理",title = "出库单",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页查询") public R> list(SpWarehouseOutVO warehouseOutVO, Query query) { IPage pages = sp_warehouse_outService.selectPageList(Condition.getPage(query),warehouseOutVO); diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpTotalController.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpTotalController.java index adb1ce6..c9dfef9 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpTotalController.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpTotalController.java @@ -69,7 +69,8 @@ public class WtSpTotalController extends BladeController { @GetMapping("/pageList") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入spToolVO") - @OperationAnnotation(title = "库存清单",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "资产管理",title = "库存清单",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页条件") public R> pageList(WtSpToolVO spToolVO, Query query) { IPage pages = SP_TOTALService.selectSpToolList(Condition.getPage(query),spToolVO); @@ -81,7 +82,7 @@ public class WtSpTotalController extends BladeController { @GetMapping("/warnPageList") @ApiOperationSupport(order = 2) @ApiOperation(value = "库存预警列表", notes = "传入spToolVO") - @OperationAnnotation(title = "库存预警",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "资产管理",title = "库存预警",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "分页查询") public R> warnPageList(WtSpToolVO spToolVO, Query query) { IPage pages = SP_TOTALService.warnPageList(Condition.getPage(query),spToolVO); diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpDeviceController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpDeviceController.java index 6480bd0..39923b7 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpDeviceController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpDeviceController.java @@ -2,6 +2,9 @@ package com.hnac.hzims.fdp.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.equipment.entity.EmTreeNode; import com.hnac.hzims.fdp.dto.FdpDeviceDTO; import com.hnac.hzims.fdp.entity.FdpDeviceEntity; @@ -79,6 +82,9 @@ public class FdpDeviceController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 100) @ApiOperation(value = "自定义分页 FDP设备列表") + @OperationAnnotation(moduleName = "智能诊断",title = "智能诊断配置",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "分页条件") public R> list(FdpDeviceDTO entity, Query query) { return service.doList(Condition.getPage(query), entity); } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpMonitorController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpMonitorController.java index 2cf138e..18fe5f4 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpMonitorController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpMonitorController.java @@ -151,7 +151,7 @@ public class FdpMonitorController extends BladeController { @GetMapping("/listPage") @ApiOperationSupport(order = 110) @ApiOperation(value = "查询监测点列表") - @OperationAnnotation(moduleName = "智能诊断",title = "监测点绑定",operatorType = OperatorType.MOBILE,businessType = + @OperationAnnotation(moduleName = "智能诊断",title = "智能诊断配置",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "分页查询") public R> listPage(FdpMonitorEntity entity, Query query) { diff --git a/hzims-service/inspect/pom.xml b/hzims-service/inspect/pom.xml index 0483db8..f3610b8 100644 --- a/hzims-service/inspect/pom.xml +++ b/hzims-service/inspect/pom.xml @@ -216,6 +216,13 @@ + + + com.hnac.hzims + hzims-biz-common + 4.0.0-SNAPSHOT + + diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/ClockController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/ClockController.java index 85f957d..f1d4513 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/ClockController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/ClockController.java @@ -2,6 +2,9 @@ package com.hnac.hzinfo.inspect.ai.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.hzinfo.inspect.ai.vo.ClockVO; import io.swagger.annotations.*; import lombok.AllArgsConstructor; @@ -53,6 +56,10 @@ public class ClockController extends BladeController { @ApiOperation(value = "分页", notes = "传入st_clock") @ApiImplicitParams({ }) + @OperationAnnotation(moduleName = "巡检管理", title = "智能巡检配置", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "分页") public R> list(@ApiIgnore @RequestParam Map st_clock, Query query) { QueryWrapper queryWrapper = Condition.getQueryWrapper( st_clock, ClockEntity.class); IPage pages = st_clockService.page(Condition.getPage(query), queryWrapper); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/ClockTypeController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/ClockTypeController.java index 84ee06e..8d364e5 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/ClockTypeController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/ClockTypeController.java @@ -2,6 +2,9 @@ package com.hnac.hzinfo.inspect.ai.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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 io.swagger.annotations.*; import lombok.AllArgsConstructor; import javax.validation.Valid; @@ -51,6 +54,10 @@ public class ClockTypeController extends BladeController { @ApiOperation(value = "分页", notes = "传入st_clock_type") @ApiImplicitParams({ }) + @OperationAnnotation(moduleName = "巡检管理", title = "智能巡检配置", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "分页") public R> list(@ApiIgnore @RequestParam Map st_clock_type, Query query) { QueryWrapper queryWrapper = Condition.getQueryWrapper( st_clock_type, ClockTypeEntity.class); IPage pages = st_clock_typeService.page(Condition.getPage(query), queryWrapper); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotController.java index eee50ac..a7185fb 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotController.java @@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.hzinfo.inspect.ai.vo.robot.RobotAiReturnData; import com.hnac.hzinfo.inspect.ai.vo.robot.RobotServerTaskParam; import io.swagger.annotations.*; @@ -60,6 +63,10 @@ public class RobotController extends BladeController { @ApiOperation(value = "分页", notes = "传入st_robot") @ApiImplicitParams({ }) + @OperationAnnotation(moduleName = "巡检管理", title = "机器人管理", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "分页") public R> list(@ApiIgnore @RequestParam Map st_robot, Query query) { QueryWrapper queryWrapper = Condition.getQueryWrapper( st_robot, RobotEntity.class); IPage pages = st_robotService.page(Condition.getPage(query), queryWrapper); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentController.java index 549c8e3..fbd0691 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentController.java @@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.hzinfo.inspect.obj.entity.ContentEntity; import com.hnac.hzinfo.inspect.obj.entity.ProjectContentEntity; import com.hnac.hzinfo.inspect.obj.services.ProjectContentService; @@ -47,6 +50,9 @@ public class ContentController { */ @GetMapping("/list") @ApiOperation(value = "巡检内容列表", notes = "巡检内容列表") + @OperationAnnotation(moduleName = "巡检管理",title = "巡检配置",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "巡检对象列表") public R> list(ContentListQueryVO content, Query query, BladeUser bladeUser) { LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new ContentEntity(),content); queryWrapper.orderByDesc(ContentEntity::getUpdateTime); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectController.java index b9b0c9b..32bdf09 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectController.java @@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; 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.hzinfo.inspect.obj.entity.ObjectDangerEntity; import com.hnac.hzinfo.inspect.obj.entity.ObjectEntity; import com.hnac.hzinfo.inspect.obj.entity.ObjectTemplateEntity; @@ -86,6 +89,9 @@ public class ObjectController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "巡检对象列表", notes = "巡检对象列表") + @OperationAnnotation(moduleName = "巡检管理",title = "巡检配置",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "巡检对象列表") public R> list(ObjectListQueryVO object, Query query, BladeUser bladeUser) { IPage pages = Condition.getPage(query); ObjectEntity entity = new ObjectEntity(); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectUserController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectUserController.java index af1e46b..cfc380c 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectUserController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectUserController.java @@ -5,6 +5,9 @@ package com.hnac.hzinfo.inspect.obj.web; import com.baomidou.mybatisplus.core.metadata.IPage; import com.google.common.collect.Lists; +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.hzinfo.inspect.obj.entity.ObjectUserEntity; import com.hnac.hzinfo.inspect.obj.services.ObjectUserService; import com.hnac.hzinfo.inspect.obj.vo.ObjectUserAddVO; @@ -55,6 +58,10 @@ public class ObjectUserController { * 巡检对象用户列表 */ @GetMapping("/list") + @OperationAnnotation(moduleName = "巡检管理", title = "巡检配置", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "巡检对象用户列表") @ApiOperation(value = "巡检对象用户列表", notes = "巡检对象用户列表(跨服务查询)") public R> list(ObjectUserListQuery content, Query query, BladeUser bladeUser) { if(!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)){ diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java index 61aafd1..4dbb078 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java @@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; 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.hzinfo.inspect.obj.entity.ProjectContentEntity; import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; import com.hnac.hzinfo.inspect.obj.entity.TemplateProjectEntity; @@ -52,6 +55,9 @@ public class ProjectController { */ @GetMapping("/list") @ApiOperation(value = "巡检项目列表", notes = "巡检项目列表") + @OperationAnnotation(moduleName = "巡检管理",title = "巡检配置",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "巡检对象列表") public R> list(ProjectListQueryVO project, Query query, BladeUser bladeUser) { LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new ProjectEntity(),project); queryWrapper.orderByDesc(ProjectEntity::getUpdateTime); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/TemplateController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/TemplateController.java index 2b564a5..52c5f70 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/TemplateController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/TemplateController.java @@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; 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.hzinfo.inspect.obj.entity.ObjectTemplateEntity; import com.hnac.hzinfo.inspect.obj.entity.TemplateEntity; import com.hnac.hzinfo.inspect.obj.entity.TemplateProjectEntity; @@ -66,6 +69,9 @@ public class TemplateController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "巡检模板列表分页", notes = "传入巡检模板") + @OperationAnnotation(moduleName = "巡检管理",title = "巡检配置",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "巡检对象列表") public R> list(TemplateListQueryVO inspectionTemplate, Query query, BladeUser bladeUser) { LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new TemplateEntity(),inspectionTemplate); queryWrapper.orderByDesc(TemplateEntity::getUpdateTime); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java index d2c07ac..ab6c773 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java @@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; 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.hzinfo.inspect.Constants; import com.hnac.hzinfo.inspect.invalid.DictInvalid; import com.hnac.hzinfo.inspect.obj.utils.CodeUtils; @@ -69,6 +72,9 @@ public class PlanController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页显示计划列表", notes = "传入plan") + @OperationAnnotation(moduleName = "巡检管理",title = "巡检计划",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "分页显示计划列表") public R> list(PlanListQueryVO plan, Query query, BladeUser bladeUser) { LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new PlanEntity(),plan); if(plan.getStartTime()!=null){ diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/RouteController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/RouteController.java index 60f5591..57488ad 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/RouteController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/RouteController.java @@ -2,9 +2,14 @@ package com.hnac.hzinfo.inspect.plan.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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 io.swagger.annotations.*; import lombok.AllArgsConstructor; + import javax.validation.Valid; + import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -22,7 +27,7 @@ import java.util.List; import java.util.Map; /** - * 控制器 + * 控制器 * * @author py */ @@ -32,86 +37,90 @@ import java.util.Map; @Api(value = "hld-巡检路径", tags = "hld-巡检路径") public class RouteController extends BladeController { - private final IRouteService st_re_routeService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入st_re_route") - public R detail(RouteEntity st_re_route) { - RouteEntity detail = st_re_routeService.getOne(Condition.getQueryWrapper(st_re_route)); - return R.data(detail); - } - - /** - * 分页 代码自定义代号 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入st_re_route") - @ApiImplicitParams({ - }) - public R> list(@ApiIgnore @RequestParam Map st_re_route, Query query) { - QueryWrapper queryWrapper = Condition.getQueryWrapper( st_re_route, RouteEntity.class); - queryWrapper.orderByDesc("create_time","update_time"); - IPage pages = st_re_routeService.page(Condition.getPage(query), queryWrapper); - return R.data(pages); - } - - /** - * 新增 代码自定义代号 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入st_re_route") - public R save(@Valid @RequestBody RouteEntity st_re_route) { - return R.status(st_re_routeService.save(st_re_route)); - } - - /** - * 修改 代码自定义代号 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入st_re_route") - public R update(@Valid @RequestBody RouteEntity st_re_route) { - return R.status(st_re_routeService.updateById(st_re_route)); - } - - /** - * 新增或修改 代码自定义代号 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入st_re_route") - public R submit(@Valid @RequestBody RouteEntity st_re_route) { - return R.status(st_re_routeService.saveOrUpdate(st_re_route)); - } - - - /** - * 删除 代码自定义代号 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(st_re_routeService.deleteLogic(Func.toLongList(ids))); - } - - @GetMapping("/getRouteByObjectId") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "获取使用到相关对象ID的所有路径", notes = "传入对象id") - public R> getRouteByObjectId(@RequestParam Long objectId) { - return R.data(st_re_routeService.getRouteByObjectId(objectId)); - } - - @GetMapping("/getRouteByTemplateId") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "获取使用到相关模板ID的所有路径", notes = "传入模板id") - public R> getRouteByTemplateId(@RequestParam Long templateId) { - return R.data(st_re_routeService.getRouteByTemplateId(templateId)); - } + private final IRouteService st_re_routeService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入st_re_route") + public R detail(RouteEntity st_re_route) { + RouteEntity detail = st_re_routeService.getOne(Condition.getQueryWrapper(st_re_route)); + return R.data(detail); + } + + /** + * 分页 代码自定义代号 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入st_re_route") + @ApiImplicitParams({ + }) + @OperationAnnotation(moduleName = "巡检管理", title = "巡检配置", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "列表(不分页)") + public R> list(@ApiIgnore @RequestParam Map st_re_route, Query query) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(st_re_route, RouteEntity.class); + queryWrapper.orderByDesc("create_time", "update_time"); + IPage pages = st_re_routeService.page(Condition.getPage(query), queryWrapper); + return R.data(pages); + } + + /** + * 新增 代码自定义代号 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入st_re_route") + public R save(@Valid @RequestBody RouteEntity st_re_route) { + return R.status(st_re_routeService.save(st_re_route)); + } + + /** + * 修改 代码自定义代号 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入st_re_route") + public R update(@Valid @RequestBody RouteEntity st_re_route) { + return R.status(st_re_routeService.updateById(st_re_route)); + } + + /** + * 新增或修改 代码自定义代号 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入st_re_route") + public R submit(@Valid @RequestBody RouteEntity st_re_route) { + return R.status(st_re_routeService.saveOrUpdate(st_re_route)); + } + + + /** + * 删除 代码自定义代号 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(st_re_routeService.deleteLogic(Func.toLongList(ids))); + } + + @GetMapping("/getRouteByObjectId") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "获取使用到相关对象ID的所有路径", notes = "传入对象id") + public R> getRouteByObjectId(@RequestParam Long objectId) { + return R.data(st_re_routeService.getRouteByObjectId(objectId)); + } + + @GetMapping("/getRouteByTemplateId") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "获取使用到相关模板ID的所有路径", notes = "传入模板id") + public R> getRouteByTemplateId(@RequestParam Long templateId) { + return R.data(st_re_routeService.getRouteByTemplateId(templateId)); + } } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java index 777bfaa..9ad2d66 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java @@ -2,6 +2,9 @@ package com.hnac.hzinfo.inspect.report.controller; import com.alibaba.druid.support.json.JSONUtils; import com.alibaba.excel.EasyExcel; +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.hzinfo.inspect.gather.vo.TaskGatherQueryVO; import com.hnac.hzinfo.inspect.report.entity.InspectMonthReportExcel; import com.hnac.hzinfo.inspect.report.entity.MonthRoutReport; @@ -37,6 +40,9 @@ public class InspectReportController { @RequestMapping(value = "/getInspectMonthReport", method = { RequestMethod.POST,RequestMethod.GET }) @ApiOperation(notes = "子站-巡检月报表接口-按路径", value = "针对巡检月报表页") + @OperationAnnotation(moduleName = "生产月报", title = "巡检报表", operatorType = OperatorType.MOBILE, businessType = + BusinessType.GENCODE, + action = "子站-巡检月报表接口-按路径") public R> getInspectMonthReport( @ApiParam(value = "年月 2019-02") @RequestParam(required = true) String month, @ApiParam(value = "巡检路径id") @RequestParam(required = true) Long routId, diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java index 99cda99..dbbe93c 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java @@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fasterxml.jackson.annotation.JsonRawValue; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.google.common.collect.Lists; +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.hzinfo.core.push.enums.PushAudienceType; import com.hnac.hzinfo.core.push.model.PushAudience; import com.hnac.hzinfo.core.push.model.PushInfo; @@ -103,6 +106,9 @@ public class TaskController extends BladeController { */ @GetMapping("/list") @ApiOperation(value = "分页显示任务列表", notes = "传入task") + @OperationAnnotation(moduleName = "巡检管理",title = "我的巡检任务",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "分页显示任务列表") public R> list(TaskListQuery task, Query query) { //CacheUtil.put("test#2","inspect","test","12"); // LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new TaskEntity(),task); @@ -154,6 +160,9 @@ public class TaskController extends BladeController { */ @GetMapping("/robotList") @ApiOperation(value = "机器人任务列表", notes = "传入task") + @OperationAnnotation(moduleName = "巡检管理",title = "机器人巡检",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "机器人任务列表") public R> robotList(TaskListQuery task, Query query) { IPage pages = Condition.getPage(query); task.setAutoVideo(PlanContants.InspectTypeEnum.ROBOT.getVal()); @@ -167,6 +176,10 @@ public class TaskController extends BladeController { * 视频任务列表 */ @GetMapping("/videoList") + @OperationAnnotation(moduleName = "巡检管理", title = "视频巡检任务", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "视频任务列表") @ApiOperation(value = "视频任务列表", notes = "传入task") public R> videoList(TaskListQuery task, Query query) { IPage pages = Condition.getPage(query); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskRecordController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskRecordController.java index c9c7bc2..8b31e0d 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskRecordController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskRecordController.java @@ -5,6 +5,9 @@ package com.hnac.hzinfo.inspect.task.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +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.hzinfo.inspect.task.entity.TaskRecordEntity; import com.hnac.hzinfo.inspect.task.service.ITaskRecordService; import com.hnac.hzinfo.inspect.task.service.ITaskService; @@ -41,6 +44,9 @@ public class TaskRecordController { @GetMapping("/list") @ApiOperation(value = "巡检报备列表", notes = "巡检报备列表(只显示未开始)") + @OperationAnnotation(moduleName = "巡检管理",title = "巡检设备",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "巡检报备列表") public R> getListTaskRecord(TaskListQuery task, Query query) { IPage pages = Condition.getPage(query); if(!AuthUtil.isAdministrator()){ diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java index 31b720e..472a6c9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java @@ -85,7 +85,8 @@ public class OperAccessLibraryController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 50) @ApiOperation(value = "分页 查询参数:emCode,gradeCode") - @OperationAnnotation(title = "检修库",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "检修管理",title = "检修库",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页 查询参数:emCode,gradeCode") public R> list(OperAccessLibraryListDTO req, Query query) { return service.list(req, query); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java index 930002b..d70ac1b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java @@ -84,7 +84,8 @@ public class OperAccessStatisticsController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 50) @ApiOperation(value = "分页 查询参数:pid,taskId,manager") - @OperationAnnotation(title = "检修记录",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "检修管理",title = "检修记录",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页 查询参数:pid,taskId,manager") public R> list(OperAccessStatisticsDTO req, Query query) { return service.list(req, Condition.getPage(query)); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java index f3ae298..7fad159 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java @@ -83,7 +83,8 @@ public class OperAccessTaskController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 50) - @OperationAnnotation(title = "我的检修任务",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "检修管理",title = "我的检修任务",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页 查询参数:name,code,handler,status,planId,planCode") @ApiOperation(value = "分页 查询参数:name,code,handler,status,planId,planCode") public R> list(OperAccessTaskDTO req, Query query) { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.java index b26c8b5..0a9cd85 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.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.service.AlarmHandleService; import com.hnac.hzims.operational.alert.vo.AlarmHandleVo; import com.hnac.hzims.operational.alert.vo.HandleQueryVo; @@ -49,6 +52,9 @@ public class AlarmHandleController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入AlarmHandleEntity") + @OperationAnnotation(moduleName = "告警配置", title = "告警配置记录", operatorType = OperatorType.MOBILE, businessType = + BusinessType.GENCODE, + action = "分页") public R> list(HandleQueryVo param, Query query) { IPage pages = service.pageCondition(query, param); return R.data(pages); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java index dbe05cf..d23124c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java @@ -162,7 +162,8 @@ public class OperDefectController extends BladeController { @GetMapping("/getDefectStatistics") @ApiOperationSupport(order = 5) @ApiOperation(value = "获取缺陷的统计月报", notes = " month 格式:2021-01") - @OperationAnnotation(moduleName = "缺陷管理", title = "缺陷月报表", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "生产月报", title = "缺陷月报表", operatorType = OperatorType.MOBILE, businessType = + BusinessType.GENCODE, action = "获取缺陷的统计月报") public R> getDefectStatistics(@ApiParam(value = "month 格式:2021-01", required = true) @RequestParam String month) { Map defectStatistics = defectService.getDefectStatistics(month); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperFaultController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperFaultController.java index a4b0649..664d437 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperFaultController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperFaultController.java @@ -60,7 +60,8 @@ public class OperFaultController extends BladeController { @ApiOperation(value = "分页", notes = "传入fault") @ApiImplicitParams({ }) - @OperationAnnotation(title = "故障库",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "智能诊断",title = "故障库",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页查询") public R> list(OperFaultEntity entity, Query query) { LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new OperFaultEntity(),entity); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassController.java index b464ca2..4827769 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassController.java @@ -54,6 +54,9 @@ public class ImsDutyClassController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入imsDutyClass") + @OperationAnnotation(moduleName = "值班管理",title = "值班配置",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE,action + = "列表(不分页)") public R> list(ImsDutyClassEntity imsDutyClass, Query query) { LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new ImsDutyClassEntity(),imsDutyClass); if(null != imsDutyClass.getCreateDept()){ @@ -68,7 +71,7 @@ public class ImsDutyClassController extends BladeController { */ @GetMapping("/getlist") @ApiOperationSupport(order = 2) - @OperationAnnotation(moduleName = "值班管理",title = "班次设置",operatorType = OperatorType.MOBILE,businessType = + @OperationAnnotation(moduleName = "值班管理",title = "值班配置",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,action = "列表(不分页)") @ApiOperation(value = "列表(不分页)", notes = "传入imsDutyClass") diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassTypeController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassTypeController.java index f7036c9..39ef53a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassTypeController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassTypeController.java @@ -34,82 +34,87 @@ import java.util.List; @Api(value = "班次类型controller", tags = "班次类型相关操作") public class ImsDutyClassTypeController extends BladeController { - private final IImsDutyClassTypeService imsDutyClassTypeService; + private final IImsDutyClassTypeService imsDutyClassTypeService; - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入imsDutyClassType") - public R detail(ImsDutyClassTypeEntity imsDutyClassType) { - ImsDutyClassTypeEntity detail = imsDutyClassTypeService.getOne(Condition.getQueryWrapper(imsDutyClassType)); - return R.data(detail); - } + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入imsDutyClassType") + public R detail(ImsDutyClassTypeEntity imsDutyClassType) { + ImsDutyClassTypeEntity detail = imsDutyClassTypeService.getOne(Condition.getQueryWrapper(imsDutyClassType)); + return R.data(detail); + } - /** - * 分页 代码自定义代号 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入imsDutyClassType") - public R> list(ImsDutyClassTypeEntity imsDutyClassType, Query query) { - LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new ImsDutyClassTypeEntity(), imsDutyClassType); - if (null != imsDutyClassType.getCreateDept()) { - queryWrapper.eq(ImsDutyClassTypeEntity::getCreateDept, imsDutyClassType.getCreateDept()); - } - queryWrapper.orderByDesc(ImsDutyClassTypeEntity::getCreateTime); - IPage pages = imsDutyClassTypeService.page(Condition.getPage(query), queryWrapper); - return R.data(pages); - } + /** + * 分页 代码自定义代号 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @OperationAnnotation(moduleName = "值班管理", + title = "值班配置", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "分页") + @ApiOperation(value = "分页", notes = "传入imsDutyClassType") + public R> list(ImsDutyClassTypeEntity imsDutyClassType, Query query) { + LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new ImsDutyClassTypeEntity(), imsDutyClassType); + if (null != imsDutyClassType.getCreateDept()) { + queryWrapper.eq(ImsDutyClassTypeEntity::getCreateDept, imsDutyClassType.getCreateDept()); + } + queryWrapper.orderByDesc(ImsDutyClassTypeEntity::getCreateTime); + IPage pages = imsDutyClassTypeService.page(Condition.getPage(query), queryWrapper); + return R.data(pages); + } - /** - * 获取所有班次类型 代码自定义代号 - */ - @GetMapping("/listClassType") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "获取所有班次类型") - public R> listClassType(@RequestParam(required = false) Long createDept) { - List list = imsDutyClassTypeService.list(new LambdaQueryWrapper() {{ - if (null != createDept) { - eq(ImsDutyClassTypeEntity::getCreateDept, createDept); - } - }}); - return R.data(list); - } + /** + * 获取所有班次类型 代码自定义代号 + */ + @GetMapping("/listClassType") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "获取所有班次类型") + public R> listClassType(@RequestParam(required = false) Long createDept) { + List list = imsDutyClassTypeService.list(new LambdaQueryWrapper() {{ + if (null != createDept) { + eq(ImsDutyClassTypeEntity::getCreateDept, createDept); + } + }}); + return R.data(list); + } - /** - * 新增或修改 代码自定义代号 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入imsDutyClassType") - public R submit(@Valid @RequestBody ImsDutyClassTypeEntity imsDutyClassType) { - return imsDutyClassTypeService.saveOrUpdateImsDutyClassType(imsDutyClassType); - } + /** + * 新增或修改 代码自定义代号 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入imsDutyClassType") + public R submit(@Valid @RequestBody ImsDutyClassTypeEntity imsDutyClassType) { + return imsDutyClassTypeService.saveOrUpdateImsDutyClassType(imsDutyClassType); + } - /** - * 删除 代码自定义代号 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return imsDutyClassTypeService.doDeleteLogic(Func.toLongList(ids)); - } + /** + * 删除 代码自定义代号 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return imsDutyClassTypeService.doDeleteLogic(Func.toLongList(ids)); + } - /** - * 获取不存在班次中的班次类型 - */ - @GetMapping("/classTypeList") - @ApiOperationSupport(order = 9) - @OperationAnnotation(moduleName = "值班管理",title = "班次类型设置",operatorType = OperatorType.MOBILE,businessType = - BusinessType.GENCODE,action - = "获取不存在班次中的班次类型") - @ApiOperation(value = "获取不存在班次中的班次类型", notes = "传入ids") - public R> classTypeList(@ApiParam(value = "机构ID", required = true) @RequestParam Long createDept,@ApiParam(value = "班次类型ID", required = true) @RequestParam(required = false) Long classTypeId) { - return R.data(imsDutyClassTypeService.getClassTypeList(createDept,classTypeId)); - } + /** + * 获取不存在班次中的班次类型 + */ + @GetMapping("/classTypeList") + @ApiOperationSupport(order = 9) + @OperationAnnotation(moduleName = "值班管理", title = "班次类型设置", operatorType = OperatorType.MOBILE, businessType = + BusinessType.GENCODE, action + = "获取不存在班次中的班次类型") + @ApiOperation(value = "获取不存在班次中的班次类型", notes = "传入ids") + public R> classTypeList(@ApiParam(value = "机构ID", required = true) @RequestParam Long createDept, @ApiParam(value = "班次类型ID", required = true) @RequestParam(required = false) Long classTypeId) { + return R.data(imsDutyClassTypeService.getClassTypeList(createDept, classTypeId)); + } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyGroupController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyGroupController.java index 19bf181..c3ded48 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyGroupController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyGroupController.java @@ -54,8 +54,10 @@ public class ImsDutyGroupController extends BladeController { /** * 分页 代码自定义代号 */ - @OperationAnnotation(moduleName = "值班管理",title = "班组管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,action - = "分页") + @OperationAnnotation(moduleName = "值班管理",title = "签到记录", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "分页") @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入imsDutyGroup") diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyMainController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyMainController.java index 7f248e5..1c7727b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyMainController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyMainController.java @@ -2,6 +2,9 @@ package com.hnac.hzims.operational.duty.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.duty.entity.ImsDutyMainEntity; import com.hnac.hzims.operational.duty.service.IImsDutyMainService; import com.hnac.hzims.operational.duty.vo.ChangeDutyMainVo; @@ -34,75 +37,75 @@ import java.util.List; @Api(value = "值班信息主表controller", tags = "值班信息主表相关操作") public class ImsDutyMainController extends BladeController { - private final IImsDutyMainService imsDutyMainService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入imsDutyMainEntity") - public R detail(ImsDutyMainEntity imsDutyMain) { - ImsDutyMainEntity detail = imsDutyMainService.getOne(Condition.getQueryWrapper(imsDutyMain)); - return R.data(detail); - } - - /** - * 分页 代码自定义代号 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入imsDutyMain") - public R> list(ImsDutyMainEntity imsDutyMain, Query query) { - IPage pages = imsDutyMainService.page(Condition.getPage(query), Condition.getQueryWrapper(imsDutyMain)); - return R.data(pages); - } - - - /** - * 根据时间查询所有值班信息列表(不分页) - */ - @GetMapping("/getList") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "列表(不分页)", notes = "传入imsDutyMain") - public R getlists(@ApiParam(value = "值班时间") @Valid @RequestParam("dutyDate") String dutyDate, @ApiParam(value = "申请人ID") Long personId) { - return imsDutyMainService.getByDateListAll(dutyDate, personId); - } - - - /** - * 新增或修改 代码自定义代号 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入imsDutyMain") - public R submit(@Valid @RequestBody ImsDutyMainEntity imsDutyMain) { - return imsDutyMainService.saveOrUpdateImsDutyMain(imsDutyMain); - } - - - /** - * 删除 代码自定义代号 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return imsDutyMainService.deleteV2(Func.toLongList(ids)); - } - - /** - * 排班管理 - */ - @PostMapping("/scheduling") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "排班管理", notes = "") - public R scheduling(@Valid @RequestBody ImsSchedulingVo imsSchedulingVo) { - if (null == imsSchedulingVo.getCreateDept()) { - imsSchedulingVo.setCreateDept(Long.valueOf(AuthUtil.getDeptId())); - } - return imsDutyMainService.getSchedulingV2(imsSchedulingVo); - } + private final IImsDutyMainService imsDutyMainService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入imsDutyMainEntity") + public R detail(ImsDutyMainEntity imsDutyMain) { + ImsDutyMainEntity detail = imsDutyMainService.getOne(Condition.getQueryWrapper(imsDutyMain)); + return R.data(detail); + } + + /** + * 分页 代码自定义代号 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入imsDutyMain") + public R> list(ImsDutyMainEntity imsDutyMain, Query query) { + IPage pages = imsDutyMainService.page(Condition.getPage(query), Condition.getQueryWrapper(imsDutyMain)); + return R.data(pages); + } + + + /** + * 根据时间查询所有值班信息列表(不分页) + */ + @GetMapping("/getList") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "列表(不分页)", notes = "传入imsDutyMain") + public R getlists(@ApiParam(value = "值班时间") @Valid @RequestParam("dutyDate") String dutyDate, @ApiParam(value = "申请人ID") Long personId) { + return imsDutyMainService.getByDateListAll(dutyDate, personId); + } + + + /** + * 新增或修改 代码自定义代号 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入imsDutyMain") + public R submit(@Valid @RequestBody ImsDutyMainEntity imsDutyMain) { + return imsDutyMainService.saveOrUpdateImsDutyMain(imsDutyMain); + } + + + /** + * 删除 代码自定义代号 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return imsDutyMainService.deleteV2(Func.toLongList(ids)); + } + + /** + * 排班管理 + */ + @PostMapping("/scheduling") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "排班管理", notes = "") + public R scheduling(@Valid @RequestBody ImsSchedulingVo imsSchedulingVo) { + if (null == imsSchedulingVo.getCreateDept()) { + imsSchedulingVo.setCreateDept(Long.valueOf(AuthUtil.getDeptId())); + } + return imsDutyMainService.getSchedulingV2(imsSchedulingVo); + } // /** // * 排班管理 @@ -116,81 +119,89 @@ public class ImsDutyMainController extends BladeController { // } // return imsDutyMainService.getScheduling(imsSchedulingVo); // } - /** - * 查询排班 - */ - @PostMapping("/scheduling/list") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "查询排班", notes = "传年份和月份 year month") - public R schedulingList(@Valid @ApiParam(value = "年份", required = true) @RequestParam int year, - @ApiParam(value = "月份", required = true) @RequestParam int month, - @ApiParam(value = "机构Id", required = true) Long deptId) { - if (null == deptId) { - deptId = Long.valueOf(AuthUtil.getDeptId()); - } - return imsDutyMainService.getSchedulingListV2(year, month, deptId); - } - - /** - * 根据值班id查询值班人员 - */ - @PostMapping("/person") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "根据值班id查询人员", notes = "传id") - public R person(@ApiParam(value = "值班Id", required = true) @RequestParam Long id) { - return imsDutyMainService.getMainIdByPersonV2(id); - } - - /** - * 数据清理 - */ - @PostMapping("/dataDelete") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "数据清理", notes = "传id") - public R dataDelete(@ApiParam(value = "机构ID", required = true) @RequestParam Long deptId, - @ApiParam(value = "开始时间", required = true) @RequestParam String startDate, - @ApiParam(value = "结束时间", required = true) @RequestParam String endDate) { - return imsDutyMainService.dataDelete(deptId, startDate, endDate); - } - - - /** - * 根据值班id查询值班人员 - */ - @GetMapping("/getHomePageDutyInfo") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "获取首页值班数据", notes = "传id") - public R> getHomePageDutyInfo(Long deptId) { - return R.data(imsDutyMainService.getHomePageDutyInfo(deptId)); - } - - /** - * 返回对应部门所有人员 - */ - @GetMapping("/getAllPersonInfo") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "返回对应部门所有人员", notes = "") - public R getAllPersonInfo(Long deptId) { - return R.data(imsDutyMainService.getAllPersonInfo(deptId)); - } - - /** - * 值班人员ID对应班次信息 - */ - @GetMapping("/getDutyMainInfoVoById") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "值班人员ID对应班次信息", notes = "") - public R getDutyMainInfoVoById(@ApiParam(value = "机构ID") Long deptId,@ApiParam(value = "申请人ID") Long personId) { - return imsDutyMainService.getDutyEmergencyEntityById(deptId,personId); - } - - /** - *灵活调入,调出 - */ - @PostMapping("/updateDutyMainInfoVoById") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "灵活调入,调出", notes = "") - public R updateDutyMainInfoVoById(@RequestBody ChangeDutyMainVo changeDutyMainVo) { - return imsDutyMainService.updateDutyMainInfoVoById(changeDutyMainVo); - } + + /** + * 查询排班 + */ + @PostMapping("/scheduling/list") + @ApiOperationSupport(order = 8) + @OperationAnnotation(moduleName = "值班管理", title = "排班计划", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, action = "查询排班") + @ApiOperation(value = "查询排班", notes = "传年份和月份 year month") + public R schedulingList(@Valid @ApiParam(value = "年份", required = true) @RequestParam int year, + @ApiParam(value = "月份", required = true) @RequestParam int month, + @ApiParam(value = "机构Id", required = true) Long deptId) { + if (null == deptId) { + deptId = Long.valueOf(AuthUtil.getDeptId()); + } + return imsDutyMainService.getSchedulingListV2(year, month, deptId); + } + + /** + * 根据值班id查询值班人员 + */ + @PostMapping("/person") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "根据值班id查询人员", notes = "传id") + public R person(@ApiParam(value = "值班Id", required = true) @RequestParam Long id) { + return imsDutyMainService.getMainIdByPersonV2(id); + } + + /** + * 数据清理 + */ + @PostMapping("/dataDelete") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "数据清理", notes = "传id") + public R dataDelete(@ApiParam(value = "机构ID", required = true) @RequestParam Long deptId, + @ApiParam(value = "开始时间", required = true) @RequestParam String startDate, + @ApiParam(value = "结束时间", required = true) @RequestParam String endDate) { + return imsDutyMainService.dataDelete(deptId, startDate, endDate); + } + + + /** + * 根据值班id查询值班人员 + */ + @GetMapping("/getHomePageDutyInfo") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "获取首页值班数据", notes = "传id") + public R> getHomePageDutyInfo(Long deptId) { + return R.data(imsDutyMainService.getHomePageDutyInfo(deptId)); + } + + /** + * 返回对应部门所有人员 + */ + @GetMapping("/getAllPersonInfo") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "返回对应部门所有人员", notes = "") + @OperationAnnotation(moduleName = "值班管理", title = "调班管理", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "返回对应部门所有人员") + public R getAllPersonInfo(Long deptId) { + return R.data(imsDutyMainService.getAllPersonInfo(deptId)); + } + + /** + * 值班人员ID对应班次信息 + */ + @GetMapping("/getDutyMainInfoVoById") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "值班人员ID对应班次信息", notes = "") + public R getDutyMainInfoVoById(@ApiParam(value = "机构ID") Long deptId, @ApiParam(value = "申请人ID") Long personId) { + return imsDutyMainService.getDutyEmergencyEntityById(deptId, personId); + } + + /** + * 灵活调入,调出 + */ + @PostMapping("/updateDutyMainInfoVoById") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "灵活调入,调出", notes = "") + public R updateDutyMainInfoVoById(@RequestBody ChangeDutyMainVo changeDutyMainVo) { + return imsDutyMainService.updateDutyMainInfoVoById(changeDutyMainVo); + } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyRecController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyRecController.java index ce66e89..51eb8f6 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyRecController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyRecController.java @@ -79,7 +79,8 @@ public class ImsDutyRecController extends BladeController { /** * 自定义分页 附件表 */ - @OperationAnnotation(title = "交接班记录",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "值班管理",title = "交接班记录",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页--交接班记录") @GetMapping("/pageList") @ApiOperationSupport(order = 3) @@ -254,6 +255,9 @@ public class ImsDutyRecController extends BladeController { */ @PostMapping("/queryEmergency") @ApiOperationSupport(order = 6) + @OperationAnnotation(moduleName = "值班管理",title = "值班突发事件登记",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE,action + = "列表(不分页)") @ApiOperation(value = "查询突发事件记录", notes = "传入imsDutyEmergencyEntity") public R queryEmergency( @Valid @RequestBody ImsDutyEmergencyVo imsDutyEmergencyVo,Query query) { return iImsDutyEmergencyService.queryEntity(imsDutyEmergencyVo,query); @@ -286,6 +290,10 @@ public class ImsDutyRecController extends BladeController { @PostMapping("/queryAnalyseExample") @ApiOperationSupport(order = 6) @ApiOperation(value = "查询分析实例模板", notes = "传入analyseExample") + @OperationAnnotation(moduleName = "值班管理", title = "值班日志配置", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "查询分析实例模板") public R queryAnalyseExample( AnalyseExample analyseExample,Query query) { return iImsAnalyseExampleService.queryAnalyseExample(analyseExample,query); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java index ea2e873..7211b51 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java @@ -2,6 +2,9 @@ package com.hnac.hzims.operational.fill.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.fill.entity.GenerateEntity; import com.hnac.hzims.operational.fill.service.GenerateService; import com.hnac.hzims.operational.fill.vo.GenerateVo; @@ -57,6 +60,9 @@ public class GenerateController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 4) + @OperationAnnotation(moduleName = "数据填报", + title = "水电站发电量填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + action = "分页") @ApiOperation(value = "分页", notes = "查询条件::startTime,endTime,stationCode") public R> list(QueryVo filter, Query query) { return service.pageCondition(filter, query); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OtherController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OtherController.java index 8368608..e50b207 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OtherController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OtherController.java @@ -66,8 +66,9 @@ public class OtherController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 4) - @OperationAnnotation(title = "其他填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页条件") + @OperationAnnotation(moduleName = "数据填报", + title = "配置数据填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + action = "分页") @ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime") public R> list(OtherVo vo, Query query) { return service.pageCondition(vo, query); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OverConfigController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OverConfigController.java index 9397166..67bcc41 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OverConfigController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OverConfigController.java @@ -66,7 +66,8 @@ public class OverConfigController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 4) - @OperationAnnotation(title = "检修卡配置",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "数据填报", + title = "配置数据填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "查询条件") @ApiOperation(value = "分页", notes = "查询条件:over_name") public R> list(OverConfigVo vo, Query query) { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OverController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OverController.java index 55c01ec..41f6693 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OverController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OverController.java @@ -67,8 +67,9 @@ public class OverController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 4) - @OperationAnnotation(title = "检修卡填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页条件") + @OperationAnnotation(moduleName = "数据填报", + title = "配置数据填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + action = "分页") @ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime") public R> list(OverVo vo, Query query) { return service.pageCondition(vo, query); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/PowerController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/PowerController.java index c17258b..9167c5c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/PowerController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/PowerController.java @@ -66,8 +66,9 @@ public class PowerController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 4) - @OperationAnnotation(title = "(风电 光扶)数据填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页条件") + @OperationAnnotation(moduleName = "数据填报", + title = "风电数据填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + action = "分页") @ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime") public R> list(PowerVo vo, Query query) { return service.pageCondition(vo, query); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java index 5bc4b7e..611a5f2 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java @@ -1,6 +1,9 @@ package com.hnac.hzims.operational.fill.controller; import com.baomidou.mybatisplus.core.metadata.IPage; +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.fill.vo.RainfallVo; import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.mp.support.Query; @@ -58,6 +61,9 @@ public class RainfallController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 4) + @OperationAnnotation(moduleName = "数据填报", + title = "降雨量填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + action = "分页") @ApiOperation(value = "分页", notes = "查询条件::startTime,endTime,stationCode") public R> list(QueryVo filter, Query query) { return service.pageCondition(filter, query); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/SolveController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/SolveController.java index 040c9da..d3367a8 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/SolveController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/SolveController.java @@ -66,8 +66,9 @@ public class SolveController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 4) - @OperationAnnotation(title = "消缺填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页条件") + @OperationAnnotation(moduleName = "数据填报", + title = "配置数据填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + action = "分页") @ApiOperation(value = "分页", notes = "查询条件:startDate,endDate,createDept") public R> list(SolveVo vo, Query query) { return service.pageCondition(vo, query); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/StorageController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/StorageController.java index 1351748..1b90b78 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/StorageController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/StorageController.java @@ -2,6 +2,9 @@ package com.hnac.hzims.operational.fill.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.fill.entity.StorageEntity; import com.hnac.hzims.operational.fill.service.StorageService; import com.hnac.hzims.operational.fill.vo.QueryVo; @@ -55,6 +58,9 @@ public class StorageController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 4) + @OperationAnnotation(moduleName = "数据填报", + title = "储能站发电量填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + action = "分页") @ApiOperation(value = "分页", notes = "查询条件:startTime,endTime,stationCode") public R> list(QueryVo vo, Query query) { return service.pageCondition(vo, query); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java index d8ab1c0..a7ce9bf 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java @@ -2,6 +2,9 @@ package com.hnac.hzims.operational.fill.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.fill.entity.UseEntity; import com.hnac.hzims.operational.fill.service.UseService; import com.hnac.hzims.operational.fill.vo.QueryVo; @@ -56,6 +59,9 @@ public class UseController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 4) + @OperationAnnotation(moduleName = "数据填报", + title = "磊站用电填报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + action = "分页") @ApiOperation(value = "分页", notes = "查询条件::startTime,endTime,stationCode") public R> list(QueryVo filter, Query query) { return service.pageCondition(filter, query); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HomePageController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HomePageController.java index 1f3d183..97f87376 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HomePageController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HomePageController.java @@ -82,8 +82,8 @@ public class HomePageController extends BladeController { @ApiLog @ApiOperation("年计划发电完成趋势") @GetMapping("/planAactualTrend") - @OperationAnnotation(moduleName = "演示大屏",title = "演示大屏", operatorType = OperatorType.MOBILE, - businessType = BusinessType.GENCODE,action = "年计划发电完成趋势") + // @OperationAnnotation(moduleName = "演示大屏",title = "演示大屏", operatorType = OperatorType.MOBILE, + // businessType = BusinessType.GENCODE,action = "年计划发电完成趋势") @ApiOperationSupport(order = 6) public R> planActualTrend(@ApiParam(value = "区域机构ID") Long deptId) { return R.data(homePageService.planActualTrend(deptId)); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainSystemMonitoringController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainSystemMonitoringController.java index 503e110..514f1c1 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainSystemMonitoringController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainSystemMonitoringController.java @@ -128,7 +128,7 @@ public class MainSystemMonitoringController { @GetMapping("/listByAuthDept") @OperationAnnotation(moduleName = "值班管理", - title = "排班计划",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,action + title = "值班配置",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,action = "根据用户权限查询站点及部门") @ApiOperationSupport(order = 100) @ApiOperation(value = "根据用户权限查询站点及部门", notes = "") diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceLibraryController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceLibraryController.java index 1bf6b50..08ba99f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceLibraryController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceLibraryController.java @@ -87,7 +87,7 @@ public class OperMaintenanceLibraryController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 50) - @OperationAnnotation(moduleName = "设备管理",title = "设备维护库",operatorType = OperatorType.MOBILE,businessType = + @OperationAnnotation(moduleName = "日常维护",title = "设备维护库",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "分页 查询参数:libraryCode,emCode,typeCode,procDefId,disposers(仅支持一人)") @ApiOperation(value = "分页 查询参数:libraryCode,emCode,typeCode,procDefId,disposers(仅支持一人)") diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckMonthController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckMonthController.java index 2359474..71dcd62 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckMonthController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckMonthController.java @@ -3,6 +3,9 @@ package com.hnac.hzims.safeproduct.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.safeproduct.dto.CheckMonthDTO; import com.hnac.hzims.safeproduct.entity.CheckMonthEntity; import com.hnac.hzims.safeproduct.service.ICheckMonthService; @@ -98,6 +101,9 @@ public class CheckMonthController extends BladeController { @GetMapping("/listNotDataScope") @ApiOperationSupport(order = 50) @ApiOperation(value = "分页", notes = "查询条件:month,status,createDept") + @OperationAnnotation(moduleName = "安全管理", + title = "月度自查核查",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + action = "分页") public R> listNotDataScope(CheckMonthEntity req, Query query) { R> pageR = checkMonthlyService.pageNotDataScope(req, query); IPage page = pageR.getData(); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java index bc11634..81f5068 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java @@ -2,6 +2,9 @@ package com.hnac.hzims.safeproduct.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.safeproduct.dto.DangerSourceDTO; import com.hnac.hzims.safeproduct.entity.DangerSourceEntity; import com.hnac.hzims.safeproduct.service.IDangerSourceService; @@ -78,6 +81,9 @@ public class DangerSourceController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 50) @ApiOperation(value = "分页", notes = "查询条件:eqId,level,`dangerEle,applyType,type") + @OperationAnnotation(moduleName = "安全管理",title = "危险点列表",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, + action = "分页") public R> list(DangerSourceEntity req, Query query) { return dangerSourceService.pageCondition(req, query); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/EmergencyPlanController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/EmergencyPlanController.java index 413dd5a..307abc0 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/EmergencyPlanController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/EmergencyPlanController.java @@ -79,7 +79,8 @@ public class EmergencyPlanController extends BladeController { @ApiLog @GetMapping("/list") @ApiOperationSupport(order = 50) - @OperationAnnotation(title = "应急预案文件",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "安全管理",title = "应急预案文件",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页条件") @ApiOperation(value = "分页", notes = "查询条件:typeId,fileStatus,fileName") public R> list(EmergencyPlanListDTO req, Query query) { diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ImsMonCameraInfoController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ImsMonCameraInfoController.java index 9389b53..d99e0a9 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ImsMonCameraInfoController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ImsMonCameraInfoController.java @@ -3,6 +3,9 @@ package com.hnac.hzims.safeproduct.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.safeproduct.entity.ImsMonCameraInfoEntity; import com.hnac.hzims.safeproduct.service.IImsMonCameraInfoService; import io.swagger.annotations.*; @@ -76,6 +79,10 @@ public class ImsMonCameraInfoController extends BladeController { @ApiImplicitParam(name = "isControl", value = "是否云台控制", paramType = "query", dataType = "Integer"), @ApiImplicitParam(name = "isHikvideo", value = "是否平台接入", paramType = "query", dataType = "Integer"), }) + @OperationAnnotation(moduleName = "巡检管理", title = "智能巡检配置", + operatorType = OperatorType.MOBILE, + businessType = BusinessType.GENCODE, + action = "分页") public R> list(@ApiIgnore @RequestParam Map cameraInfo, Query query) { QueryWrapper queryWrapper = new QueryWrapper<>(); if (!Func.isEmpty(cameraInfo.get("tenantId"))) { diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeEquipmentTrialController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeEquipmentTrialController.java index 20685f3..1c835a9 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeEquipmentTrialController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeEquipmentTrialController.java @@ -57,7 +57,8 @@ public class SafeEquipmentTrialController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 50) @ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime") - @OperationAnnotation(title = "设备试验",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "设备管理",title = "设备试验",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页条件") public R> list(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query) { return service.pageCondition(safeEquipmentTrialDTO, query); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SystemFileController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SystemFileController.java index 48156f3..677242c 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SystemFileController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SystemFileController.java @@ -85,7 +85,8 @@ public class SystemFileController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 50) @ApiOperation(value = "分页", notes = "查询条件:fTypeId,fileStatus,fileName") - @OperationAnnotation(title = "体系文件",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "安全管理",title = "体系文件",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "分页条件") public R> list(SystemFileListDTO req, Query query) { return systemFileService.pageCondition(req, query); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/OperRepairController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/OperRepairController.java index f2a6831..1c2fe07 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/OperRepairController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/OperRepairController.java @@ -56,7 +56,8 @@ public class OperRepairController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 1) @ApiOperation(value = "确认抢修单", notes = "流程对象") - @OperationAnnotation(title = "两票管理(应急单)",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, + @OperationAnnotation(moduleName = "两票管理",title = "应急单",operatorType = OperatorType.MOBILE,businessType = + BusinessType.GENCODE, action = "确认抢修单") public R> list(RepairEntity entity, Query query) { return R.data(service.pages(entity,query)); 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 47bb99b..92cfce7 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 @@ -415,11 +415,12 @@ public class TicketProcessServiceImpl implements TicketProcessService { message.setPushType(MessageConstants.IMMEDIATELY); //您有一张工作票待审批,工作内容:*****,审批环节:*****; String countent = - "您有一张工作票待审批,工作内容:".concat(workTicketInfo.getWorkContent()) - .concat(",审批环节:") + "您有一张工作票待审批,工作内容: ".concat(workTicketInfo.getWorkContent()) + .concat(",审批环节: ") .concat(response.getTaskName()); message.setContent(countent); message.setDeptId(workTicketInfo.getCreateDept()); + message.setCreateDept(workTicketInfo.getCreateDept()); R deptName = sysClient.getDeptName(workTicketInfo.getCreateDept()); if (deptName.isSuccess()) { message.setDeptName(deptName.getData()); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java index f92e35e..c9fbc87 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java @@ -156,7 +156,7 @@ public class WorkTicketInfoController { @GetMapping("/userListByRoleAlias") @ApiOperationSupport(order = 100) @OperationAnnotation(moduleName = "两票管理", - title = "两票管理(工作票)", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, + title = "工作票", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, action = "获取某机构下角色的人员列表") @ApiOperation(value = "获取某机构下角色的人员列表") public R userListByRoleAlias(@RequestParam("roleAlias") @ApiParam("角色别称") String roleAlias) { From 653db3d1fe1e5789214c4d09d8c432e78bf12088 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 9 Jun 2023 08:17:33 +0800 Subject: [PATCH 6/6] =?UTF-8?q?#=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=8A=BD=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/fill/mapper/OtherMapper.java | 8 +++++++ .../hzims/operational/fill/mapper/OtherMapper.xml | 25 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/OtherMapper.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/OtherMapper.xml diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/OtherMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/OtherMapper.java new file mode 100644 index 0000000..5d0b450 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/OtherMapper.java @@ -0,0 +1,8 @@ +package com.hnac.hzims.operational.fill.mapper; + +import com.hnac.hzims.operational.fill.entity.OtherEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +public interface OtherMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/OtherMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/OtherMapper.xml new file mode 100644 index 0000000..44e22e4 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/OtherMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + ID, START_DATE, END_DATE , FA_QUANTITY , ONLINE_RATE ,TENANT_ID, STATUS, CREATE_TIME, + UPDATE_TIME, CREATE_USER, UPDATE_USER, IS_DELETED, CREATE_DEPT + + +