From 53705a9f1c53b31c8eb3c3bd5875487b41fd9f85 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, 27 Jul 2023 16:29:39 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E7=A5=A8=E9=94=99=E7=A5=A8=E5=8F=8A=E5=BA=9F=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../twoTicket/service/impl/TicketProcessServiceImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 4ca47ff..1d8c7fa 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 @@ -59,6 +59,7 @@ import org.springblade.system.feign.ISysClient; import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -497,6 +498,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { * @param response */ private void saveWorkTicket(WorkTicketInfoEntity workTicket, ProcessWorkFlowResponse response) { + String flowTaskName = workTicket.getFlowTaskName(); String flowDescription = ""; //如果response.getHandleType() 是0使用户 if ("0".equals(response.getHandleType())) { @@ -534,11 +536,12 @@ public class TicketProcessServiceImpl implements TicketProcessService { workTicket.setFlowDescription(flowDescription); } + //如果签发人为false if (workTicket.getSignFlag() != null) { if (!workTicket.getSignFlag()) { - workTicket.setFlowDescription("errancy"); - workTicket.setFlowTaskName("errancy"); + workTicket.setFlowDescription(flowTaskName); + workTicket.setFlowTaskName(flowTaskName); workTicket.setNextStepOperator(" "); workTicket.setStepOperator(" "); } @@ -548,8 +551,8 @@ public class TicketProcessServiceImpl implements TicketProcessService { //运行人员false if (workTicket.getRecieveFlag() != null) { if (!workTicket.getRecieveFlag()) { - workTicket.setFlowDescription("errancy"); - workTicket.setFlowTaskName("errancy"); + workTicket.setFlowDescription(flowTaskName); + workTicket.setFlowTaskName(flowTaskName); workTicket.setNextStepOperator(" "); workTicket.setStepOperator(" "); } From 31e38b644b64963ffbe2669cf61d471ef73b1dca Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 28 Jul 2023 14:44:51 +0800 Subject: [PATCH 2/5] =?UTF-8?q?#=20=E6=8E=A5=E7=AB=99FDP=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E6=8E=A8=E9=80=81bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hnac/hzims/fdp/feign/IQuestionClient.java | 6 +++--- .../src/main/java/com/hnac/hzims/fdp/feign/QuestionClient.java | 6 +++--- .../hzims/operational/station/service/impl/StationServiceImpl.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IQuestionClient.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IQuestionClient.java index 42292c1..350ee77 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IQuestionClient.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IQuestionClient.java @@ -28,9 +28,9 @@ public interface IQuestionClient { * @return */ @GetMapping(SUBMIT_STATION_INFO) - R submitStationInfo(@RequestParam("fdp站点类型") Integer fdpStationType, - @RequestParam("站点编码") String stationCode, - @RequestParam(value = "站点描述",required = false) String stationDesc); + R submitStationInfo(@RequestParam Integer fdpStationType, + @RequestParam String stationCode, + @RequestParam(required = false) String stationDesc); @DeleteMapping(DELETE_STATION_INFO) R deleteStationInfo(@RequestParam String stationId); diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/QuestionClient.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/QuestionClient.java index b6880f4..7432864 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/QuestionClient.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/QuestionClient.java @@ -21,9 +21,9 @@ public class QuestionClient implements IQuestionClient { @GetMapping(SUBMIT_STATION_INFO) @Override - public R submitStationInfo(@RequestParam("fdp站点类型") Integer fdpStationType, - @RequestParam("站点编码") String stationCode, - @RequestParam(value = "站点描述",required = false) String stationDesc) { + public R submitStationInfo(@RequestParam Integer fdpStationType, + @RequestParam String stationCode, + @RequestParam(required = false) String stationDesc) { return R.status(fdpQuestionService.submitStationInfo(fdpStationType,stationCode,stationDesc)); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java index ea3c4cf..e2b5123 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java @@ -114,7 +114,7 @@ public class StationServiceImpl extends BaseServiceImpl questionClient.submitStationInfo(configVO.getFdpStationType(), req.getCode(), ""), "智能诊断站点推送").start(); + new Thread(() -> questionClient.submitStationInfo(configVO.getFdpStationType(), req.getCode(), "运维平台推送"), "智能诊断站点推送").start(); } // 如果设备数据来源未选定其他 则进行站点初始化操作 if (StationConstants.GATHER.equals(req.getDataOrigin()) && !StationConstants.HZ3000_OTHER.equals(req.getDataSource())) { From 51fa0536e7152a840ffbcbe3f9aaf5160a37b344 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 28 Jul 2023 16:09:03 +0800 Subject: [PATCH 3/5] =?UTF-8?q?#=20=E5=B7=A1=E6=A3=80=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E6=87=92=E5=8A=A0=E8=BD=BD=E6=A0=91=E6=8E=A5=E5=8F=A3=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzinfo/inspect/obj/entity/TemplateEntity.java | 4 +-- .../hzinfo/inspect/obj/feign/IProjectClient.java | 25 +++++++------- .../hzinfo/inspect/plan/entity/RouteEntity.java | 16 ++++++--- .../com/hnac/hzinfo/inspect/task/dto/TaskDTO.java | 37 ++++++++++++++++++++ .../hzinfo/inspect/task/entity/TaskEntity.java | 18 ++++++++++ .../entity/TaskObjectProjectContentEntity.java | 6 ++++ .../equipment/controller/EmInfoController.java | 8 +++++ .../hzims/equipment/service/IEmInfoService.java | 9 +++++ .../equipment/service/impl/EmInfoServiceImpl.java | 30 +++++++++++++++++ .../java/com/hnac/hzims/equipment/vo/EmInfoVO.java | 1 + .../hzinfo/inspect/obj/feign/ProjectClient.java | 17 +++++++--- .../obj/services/impl/ObjectServiceImpl.java | 27 +++++++++------ .../hnac/hzinfo/inspect/obj/vo/TemplateAddVo.java | 7 ---- .../inspect/task/controller/TaskController.java | 10 ++++++ .../hzinfo/inspect/task/service/ITaskService.java | 4 +++ .../impl/TaskObjectProjectContentServiceImpl.java | 2 ++ .../inspect/task/service/impl/TaskServiceImpl.java | 39 ++++++++++++++++++++++ .../task/vo/TaskObjectProjectContentVO.java | 6 ++++ .../com/hnac/hzinfo/inspect/task/vo/TaskVo.java | 7 ++++ .../inspect/src/main/resources/db/1.0.1.sql | 14 ++++++++ 20 files changed, 246 insertions(+), 41 deletions(-) create mode 100644 hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/dto/TaskDTO.java diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/TemplateEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/TemplateEntity.java index cf0f4a1..91516e6 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/TemplateEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/TemplateEntity.java @@ -59,6 +59,6 @@ public class TemplateEntity extends TenantEntity { @ApiModelProperty(value = "inspectType 支持的巡检类型 0普通巡检,1视频自动巡检,2机器人巡检") private String supportAutoVideo; - - //private Boolean ; + @ApiModelProperty(value = "巡检对象ID") + private Long objectId; } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IProjectClient.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IProjectClient.java index 2f9131c..8e27d50 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IProjectClient.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IProjectClient.java @@ -1,22 +1,17 @@ package com.hnac.hzinfo.inspect.obj.feign; import com.hnac.hzinfo.inspect.Constants; -import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; -import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; import com.hnac.hzinfo.inspect.obj.request.ProjectContentRequest; import com.hnac.hzinfo.inspect.obj.vo.ProjectVO; -import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.cloud.openfeign.SpringQueryMap; -import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import javax.validation.Valid; -import javax.validation.constraints.NotNull; import java.util.List; @FeignClient(value = Constants.APP_NAME) @@ -25,7 +20,7 @@ public interface IProjectClient { String API_PREFIX = "/feign/project"; String ADD_PROJECT_AND_CONTENT = API_PREFIX + "/addProjectAndContent"; String GET_PROJECT_AND_CONTENT_BY_EM_CODE = API_PREFIX + "/getProjectAndContentByEmCode"; - + String GET_EM_CODES_BY_DEPT_ID = API_PREFIX + "/getEmCodesByDeptId"; /** * 批量新增/更新项目 @@ -36,13 +31,19 @@ public interface IProjectClient { R addProjectAndContent(@RequestBody @Valid List request); /** - * - * @param emCode 设备编号 - * @param content name、recordType、checkType - * @param query 分页参数 - * @return + * 根据设备Code获取巡检项目、内容 + * @param request 分页 - 内容筛选条件 - 设备编号 + * @return 巡检项目、内容 */ @PostMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE) R getProjectAndContentByEmCode(@RequestBody ProjectContentRequest request); + /** + * 根据机构ID获取设备编号列表 + * @param deptId 机构ID + * @return 设备编号列表 + */ + @GetMapping(GET_EM_CODES_BY_DEPT_ID) + R> getEmCodesByDeptId(@RequestParam Long deptId); + } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/entity/RouteEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/entity/RouteEntity.java index 7c2d1d8..13061c4 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/entity/RouteEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/entity/RouteEntity.java @@ -1,13 +1,13 @@ package com.hnac.hzinfo.inspect.plan.entity; +import com.baomidou.mybatisplus.annotation.SqlCondition; import com.baomidou.mybatisplus.annotation.TableName; -import org.springblade.core.tenant.mp.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; +import com.hnac.hzinfo.inspect.utils.QueryField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Date; -import java.time.LocalDateTime; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; /** @@ -27,6 +27,7 @@ public class RouteEntity extends TenantEntity { * 路线名称 */ @ApiModelProperty(value = "路线名称") + @QueryField(condition = SqlCondition.LIKE) private String routeName; /** * 路线数据 @@ -41,6 +42,11 @@ public class RouteEntity extends TenantEntity { * 巡检类型标识 */ @ApiModelProperty(value = " 巡检类型标识 0普通巡检,1视频自动巡检,2机器人巡检") + @QueryField(condition = SqlCondition.EQUAL) private String supportAutoVideo; + @ApiModelProperty(value = "巡检路线 字典:routeType 1-值班 2-计划") + @QueryField(condition = SqlCondition.EQUAL) + private String type; + } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/dto/TaskDTO.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/dto/TaskDTO.java new file mode 100644 index 0000000..2d6a4a2 --- /dev/null +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/dto/TaskDTO.java @@ -0,0 +1,37 @@ +package com.hnac.hzinfo.inspect.task.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hnac.hzinfo.inspect.task.entity.TaskEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @ClassName TaskDTO + * @description: 巡检任务DTO对象 + * @author: hx + * @create: 2023-07-27 14:37 + * @Version 4.0 + **/ +@EqualsAndHashCode +@Data +@ApiModel("巡检任务DTO") +public class TaskDTO extends TaskEntity implements Serializable { + + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + @ApiModelProperty(value = "任务计划开始时间-起") + private LocalDateTime planStartTime; + + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + @ApiModelProperty(value = "任务计划开始时间-止") + private LocalDateTime planStartTimeEnd; + +} diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskEntity.java index 6743e12..42dd88a 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskEntity.java @@ -1,10 +1,12 @@ package com.hnac.hzinfo.inspect.task.entity; +import com.baomidou.mybatisplus.annotation.SqlCondition; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import org.springblade.core.mp.support.QueryField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -32,21 +34,25 @@ public class TaskEntity extends TenantEntity { * 计划ID */ @ApiModelProperty(value = "计划ID") + @QueryField(condition = SqlCondition.EQUAL) private Long planId; /** * 计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式 */ @ApiModelProperty(value = "计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式") + @QueryField(condition = SqlCondition.EQUAL) private String type; /** * 计划名称 */ @ApiModelProperty(value = "计划名称") + @QueryField(condition = SqlCondition.LIKE) private String planName; /** * 任务批次号 */ @ApiModelProperty(value = "任务批次号") + @QueryField(condition = SqlCondition.EQUAL) private String batchNumber; /** * 任务计划开始时间 @@ -96,15 +102,18 @@ public class TaskEntity extends TenantEntity { * 巡检备案 0 未备案 1已备案 */ @ApiModelProperty(value = "任务报备 0 未报备 1已报备") + @QueryField(condition = SqlCondition.EQUAL) private String keepOnRecord; /** * 计划周期 0: 从不 1:每天 2:每月 3:每季度 4:每年 5:每周 */ @ApiModelProperty(value = "计划周期 0: 从不 1:每天 2:每月 3:每季度 4:每年 5:每周") + @QueryField(condition = SqlCondition.EQUAL) private String cycle; @ApiModelProperty(value = "任务模式:0抢占,1并发") + @QueryField(condition = SqlCondition.EQUAL) private String method; @TableField(exist=false) @@ -127,6 +136,7 @@ public class TaskEntity extends TenantEntity { * 巡检类型标识: 0普通巡检,1视频自动巡检,2机器人巡检 */ @ApiModelProperty(value = "巡检类型标识: 0普通巡检,1视频自动巡检,2机器人巡检") + @QueryField(condition = SqlCondition.EQUAL) private String autoVideo; /** @@ -134,25 +144,30 @@ public class TaskEntity extends TenantEntity { */ @ApiModelProperty(value = "计划类型") + @QueryField(condition = SqlCondition.EQUAL) private String planType; /** * 任务开始前 是否发送提醒短信 标识 */ @ApiModelProperty(value = "任务开始前 是否发送提醒短信 标识") + @QueryField(condition = SqlCondition.EQUAL) private Boolean startRemindFlag ; /** * 任务结束前 是否发送提醒短信 标识 */ @ApiModelProperty(value = "任务结束前 是否发送提醒短信 标识") + @QueryField(condition = SqlCondition.EQUAL) private Boolean endRemindFlag ; @ApiModelProperty(value = "计划、任务增加开始前提醒时间") + @QueryField(condition = SqlCondition.EQUAL) private LocalDateTime startRemindTime; @ApiModelProperty(value = "计划、任务增加结束前提醒时间") + @QueryField(condition = SqlCondition.EQUAL) private LocalDateTime endRemindTime; /** @@ -165,14 +180,17 @@ public class TaskEntity extends TenantEntity { * 值班id */ @ApiModelProperty(value = "值班id") + @QueryField(condition = SqlCondition.EQUAL) private Long dutyId; @ApiModelProperty(value = "消息模板ID") @JsonSerialize(nullsUsing = NullSerializer.class) + @QueryField(condition = SqlCondition.EQUAL) private Long messageTemplateId; @ApiModelProperty(value = "消息推送状态") @JsonSerialize(nullsUsing = NullSerializer.class) + @QueryField(condition = SqlCondition.EQUAL) private Boolean pushStatus; } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskObjectProjectContentEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskObjectProjectContentEntity.java index 33b939c..bf83bba 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskObjectProjectContentEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskObjectProjectContentEntity.java @@ -120,4 +120,10 @@ public class TaskObjectProjectContentEntity extends TenantEntity { @ApiModelProperty(value = "记值方式为选择时选择值") private String dictType; + @ApiModelProperty(value = "绑定物模型属性标识") + private String attrSignage; + + @ApiModelProperty(value = "绑定物模型属性名称") + private String attrName; + } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java index f5b6fc3..082039e 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java @@ -1,5 +1,6 @@ package com.hnac.hzims.equipment.controller; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -404,4 +405,11 @@ public class EmInfoController extends BladeController { public R> getSparePart(String emCode, String startTime, String endTime) { return R.data(em_infoService.getSparePart(emCode, startTime, endTime)); } + + @GetMapping("/getEmTreeByDeptAndParentCode") + @ApiOperationSupport(order = 11) + @ApiOperation(value = "根据所属机构、父级设备Code获取设备树下级设备列表") + public R> getEmTreeByDeptAndParentCode(@ApiParam("机构ID") Long deptId, @ApiParam("父级设备编号") String parentCode) { + return R.data(em_infoService.getEmTreeByDeptAndParentCode(deptId,parentCode)); + } } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java index 79c864e..fe9aa95 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java @@ -1,5 +1,6 @@ package com.hnac.hzims.equipment.service; +import com.alibaba.fastjson.JSONObject; import com.hnac.hzims.equipment.dto.DeviceTreeDTO; import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.vo.*; @@ -82,4 +83,12 @@ public interface IEmInfoService extends BaseService { List getSparePart(String emCode, String startTime, String endTime); List convertToTree(Long pid, List list); + + /** + * 根据所属机构、父级设备Code获取设备树下级设备列表 + * @param deptId 设备所属机构 + * @param parentCode 父级设备Code + * @return 设备信息列表 + */ + List getEmTreeByDeptAndParentCode(Long deptId, String parentCode); } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java index e1eec7d..8535ae9 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.equipment.service.impl; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -15,6 +16,7 @@ import com.hnac.hzims.equipment.mapper.EmInfoMapper; import com.hnac.hzims.equipment.mapper.EmInfoNoScopeMapper; import com.hnac.hzims.equipment.service.*; import com.hnac.hzims.equipment.vo.*; +import com.hnac.hzims.equipment.wrapper.EmInfoWrapper; import com.hnac.hzims.fdp.service.IFdpQuestionService; import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.station.entity.StationEntity; @@ -583,6 +585,34 @@ public class EmInfoServiceImpl extends BaseServiceImpl item.getGpid().equals(pid)).collect(Collectors.toList()); } + @Override + public List getEmTreeByDeptAndParentCode(Long deptId, String parentCode) { + // 获取该机构下的巡检项目绑定的设备编号 + List emCodes = Lists.newArrayList(); + List projectEmCodes = projectClient.getEmCodesByDeptId(deptId).getData(); + // 获取巡检项目绑定的设备的父设备集合 + if(CollectionUtil.isNotEmpty(projectEmCodes)) { + emCodes.addAll(projectEmCodes); + LambdaQueryWrapper childrenEmInfoWrapper = Wrappers.lambdaQuery().in(EmInfoEntity::getNumber, projectEmCodes); + List projectEmInfos = this.list(childrenEmInfoWrapper); + List childrenEmCode = projectEmInfos.stream().map(EmInfoEntity::getPath).filter(Func::isNotEmpty) + .flatMap(path -> Arrays.stream(path.split("/"))).distinct().collect(Collectors.toList()); + emCodes.addAll(childrenEmCode); + } + // 获取parentCode下的子设备集合 + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() + .eq(EmInfoEntity::getGpid, parentCode) + .eq(EmInfoEntity::getDepartment,deptId); + List emInfoList = this.list(queryWrapper); + List result = emInfoList.stream().map(emInfoEntity -> { + JSONObject object = JSONObject.parseObject(JSON.toJSONString(emInfoEntity)); + object.put("disabled", emCodes.contains(emInfoEntity.getNumber()) ? true : false); + return object; + }).collect(Collectors.toList()); + return result; + } + + /** * 设备信息缓存(ct、pt、installedCapacity、监测点位) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/vo/EmInfoVO.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/vo/EmInfoVO.java index ebb4e53..9917111 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/vo/EmInfoVO.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/vo/EmInfoVO.java @@ -20,4 +20,5 @@ public class EmInfoVO { private List children; private List params; private List attachs; + } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java index 83b0650..bbaf72f 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java @@ -1,8 +1,12 @@ package com.hnac.hzinfo.inspect.obj.feign; +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.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; +import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; import com.hnac.hzinfo.inspect.obj.request.ProjectContentRequest; import com.hnac.hzinfo.inspect.obj.services.ProjectService; import com.hnac.hzinfo.inspect.obj.vo.ProjectVO; @@ -12,10 +16,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import javax.validation.constraints.NotNull; @@ -50,4 +51,12 @@ public class ProjectClient extends BladeController implements IProjectClient { return R.data(projectService.getProjectAndContentByEmCode(request.getEmCode(), request.getContentDTO(), query)); } + @Override + @GetMapping(GET_EM_CODES_BY_DEPT_ID) + public R> getEmCodesByDeptId(@RequestParam Long deptId) { + QueryWrapper queryWrapper = Wrappers.query().eq("create_dept", deptId); + queryWrapper.select("distinct em_code emCode"); + queryWrapper.ne("em_code","").isNotNull("em_code"); + return R.data(projectService.listObjs(queryWrapper, String::valueOf)); + } } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectServiceImpl.java index 7c55b54..2e97031 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzinfo.inspect.obj.services.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; @@ -31,6 +32,7 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; @@ -243,24 +245,27 @@ public class ObjectServiceImpl extends BaseServiceImpllambdaQuery().eq(ObjectTemplateEntity::getObjectId,object.getId())); - } - TemplateEntity template = new TemplateEntity(); + TemplateEntity template = Optional.ofNullable(templateService.getOne(Wrappers.lambdaQuery().eq(TemplateEntity::getObjectId, object.getId()))).orElse(new TemplateEntity()); + template.setObjectId(object.getId()); template.setCode(String.valueOf(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant().getEpochSecond())); template.setName(object.getName()); template.setDuplicateRecord(ObjectConstants.TemplateRecordEnum.ALLOW.getRecordType()); template.setSupportAutoVideo(Constants.InspectTypeEnum.COMMON.getVal()); template.setStatus(ObjectConstants.TemplateEnableEnum.YES.getEnableType()); - Assert.isTrue(templateService.save(template),() -> { + Assert.isTrue(templateService.saveOrUpdate(template),() -> { throw new ServiceException("保存巡检模板失败!"); }); - // 保存巡检对象与巡检模板的绑定关系 - ObjectTemplateEntity banding = ObjectTemplateEntity.builder() - .templateId(template.getId()).objectId(object.getId()).code(template.getCode()) - .name(template.getName()).supportAutoVideo(object.getSupportAutoVideo()).build(); - objectTemplateService.save(banding); + // 查询对象与模板的绑定关系是否存在 若不在线则新建绑定关系 + LambdaQueryWrapper objTemBanding = Wrappers.lambdaQuery().eq(ObjectTemplateEntity::getObjectId, object.getId()).eq(ObjectTemplateEntity::getTemplateId, template.getId()); + if(Func.isEmpty(objectTemplateService.getOne(objTemBanding))) { + ObjectTemplateEntity banding = ObjectTemplateEntity.builder() + .templateId(template.getId()).objectId(object.getId()).code(template.getCode()) + .name(template.getName()).supportAutoVideo(object.getSupportAutoVideo()).build(); + objectTemplateService.save(banding); + } + // 解除该模板下与项目的绑定关系 新增编辑后的绑定关系 + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery().eq(TemplateProjectEntity::getTemplateId, template.getId()); + templateProjectService.remove(queryWrapper); // 保存巡检模板与巡检项目的绑定关系 List emCodeList = Func.toStrList(",", object.getEmCodes()); Function getTemplateProjectByEmCode = index -> { diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/TemplateAddVo.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/TemplateAddVo.java index 759fafc..ce5e49d 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/TemplateAddVo.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/TemplateAddVo.java @@ -17,13 +17,6 @@ import java.util.List; public class TemplateAddVo extends TemplateEntity { /** - * 对象Id - */ - @ApiModelProperty(value = "对象Id") - private Long objectId; - - - /** * 模板项目绑定list */ @ApiModelProperty(value = "模板项目绑定list") 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 340c05f..90b5af1 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 @@ -1,6 +1,7 @@ package com.hnac.hzinfo.inspect.task.controller; 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.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -16,6 +17,7 @@ import com.hnac.hzinfo.core.push.model.PushInfo; import com.hnac.hzinfo.core.push.model.PushPlatform; import com.hnac.hzinfo.inspect.plan.PlanContants; import com.hnac.hzinfo.inspect.task.TaskContants.ClaimStatusEnum; +import com.hnac.hzinfo.inspect.task.dto.TaskDTO; import com.hnac.hzinfo.inspect.task.entity.EventEntity; import com.hnac.hzinfo.inspect.task.entity.TaskEntity; import com.hnac.hzinfo.inspect.task.entity.TaskUserEntity; @@ -35,6 +37,7 @@ import org.springblade.core.mp.support.Query; import org.springblade.core.secure.annotation.PreAuth; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; import org.springblade.resource.feign.IPushClient; import org.springblade.resource.vo.PushInfoVO; @@ -101,6 +104,13 @@ public class TaskController extends BladeController { return R.data(detail); } + @GetMapping("/listPage") + @ApiOperation(value = "巡检任务分页查询-站长级", notes = "传入task") + @ApiOperationSupport(order = 1) + public R> listPage(TaskDTO taskDTO, Query query) { + return R.data(taskService.page(taskDTO,query)); + } + /** * PC端分页显示任务列表 */ diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/ITaskService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/ITaskService.java index 9a4186f..e0f7ec3 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/ITaskService.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/ITaskService.java @@ -3,11 +3,13 @@ package com.hnac.hzinfo.inspect.task.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hnac.hzims.vo.SafeCheckStatisticVO; +import com.hnac.hzinfo.inspect.task.dto.TaskDTO; import com.hnac.hzinfo.inspect.task.entity.InspectionTaskSMS; import com.hnac.hzinfo.inspect.task.entity.TaskEntity; import com.hnac.hzinfo.inspect.task.vo.*; import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.BladePage; +import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.RequestParam; @@ -63,6 +65,8 @@ public interface ITaskService extends BaseService { */ List getTaskById(Long id); + IPage page(TaskDTO taskDTO, Query query); + /** * PC端任务列表 * @return diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskObjectProjectContentServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskObjectProjectContentServiceImpl.java index 5d2d9ce..3588451 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskObjectProjectContentServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskObjectProjectContentServiceImpl.java @@ -64,6 +64,8 @@ public class TaskObjectProjectContentServiceImpl extends BaseServiceImpl imp } @Override + public IPage page(TaskDTO taskDTO, Query query) { + TaskEntity request = BeanUtil.copy(taskDTO,TaskEntity.class); + LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(TaskEntity.class,request); + queryWrapper.ge(Func.isNotEmpty(taskDTO.getPlanStartTime()),TaskEntity::getPlanStartTime,taskDTO.getPlanStartTime()); + queryWrapper.le(Func.isNotEmpty(taskDTO.getPlanStartTimeEnd()),TaskEntity::getPlanStartTime,taskDTO.getPlanStartTimeEnd()); + queryWrapper.eq(Func.isNotEmpty(taskDTO.getCreateDept()),TaskEntity::getCreateDept,taskDTO.getCreateDept()); + queryWrapper.eq(Func.isNotEmpty(taskDTO.getStatus()),TaskEntity::getStatus,taskDTO.getStatus()); + queryWrapper.orderByDesc(TaskEntity::getCreateTime); + IPage page = this.page(Condition.getPage(query), queryWrapper); + List records = page.getRecords(); + List taskVos = records.stream().map(task -> { + TaskVo taskVo = BeanUtil.copy(task, TaskVo.class); + // 补充巡检任务人员 + List taskUserList = taskUserService.list(Wrappers.lambdaQuery().eq(TaskUserEntity::getTaskId, task.getId())); + String userIds = taskUserList.stream().filter(Func::isNotEmpty).map(TaskUserEntity::getUserId) + .filter(Func::isNotEmpty).map(String::valueOf).collect(Collectors.joining(",")); + // 获取巡检任务人员名称 + String userNames = taskUserList.stream().filter(Func::isNotEmpty).map(TaskUserEntity::getUserId).filter(Func::isNotEmpty) + .map(UserCache::getUser).map(user -> Optional.ofNullable(user).map(User::getName).orElse("")) + .collect(Collectors.joining(",")); + taskVo.setUserIds(userIds); + taskVo.setUserNames(userNames); + // 获取机器人信息 + if (taskVo.getAutoVideo().equals(PlanContants.InspectTypeEnum.ROBOT.getVal()) && taskUserList.size() == 1) { + if (Func.isNotEmpty(taskUserList.get(0))) { + taskVo.setRobot(robotService.getDetailByUserId(taskUserList.get(0).getUserId())); + } + } + return taskVo; + }).collect(Collectors.toList()); + page.setRecords(taskVos); + return page; + } + + @Override public List getListPage(IPage page, TaskListQuery task) { List re = this.baseMapper.getListPage(page, task); setVoInfo(re); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskObjectProjectContentVO.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskObjectProjectContentVO.java index 46d5259..76c4f40 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskObjectProjectContentVO.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskObjectProjectContentVO.java @@ -127,4 +127,10 @@ public class TaskObjectProjectContentVO implements Serializable { @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) private LocalDateTime gatherTime; + + @ApiModelProperty(value = "绑定物模型属性标识") + private String attrSignage; + + @ApiModelProperty(value = "绑定物模型属性名称") + private String attrName; } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskVo.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskVo.java index d3d1981..3b4f82b 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskVo.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskVo.java @@ -3,6 +3,7 @@ package com.hnac.hzinfo.inspect.task.vo; import com.hnac.hzinfo.inspect.ai.vo.RobotVO; import com.hnac.hzinfo.inspect.task.entity.TaskEntity; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -22,4 +23,10 @@ public class TaskVo extends TaskEntity { * 机器人信息 */ private RobotVO robot; + + @ApiModelProperty("执行人ID,按逗号分隔") + private String userIds; + + @ApiModelProperty("执行名称,按逗号分隔") + private String userNames; } diff --git a/hzims-service/inspect/src/main/resources/db/1.0.1.sql b/hzims-service/inspect/src/main/resources/db/1.0.1.sql index d534287..f5d29b5 100644 --- a/hzims-service/inspect/src/main/resources/db/1.0.1.sql +++ b/hzims-service/inspect/src/main/resources/db/1.0.1.sql @@ -56,3 +56,17 @@ alter table hz_st_re_project add COLUMN `em_code` VARCHAR(50) comment '设备编 -- 设备巡检对象添加设备字段 alter table hz_st_re_object add COLUMN `em_codes` VARCHAR(255) comment '设备编号,按逗号分隔'; +-- 巡检模板添加巡检对象 +alter table hz_st_re_template add COLUMN `object_id` BIGINT(20) comment '巡检对象ID'; + +-- 巡检任务中巡检内容执行情况添加模型属性标识、名称字段 +alter table hz_st_ex_object_project_content add COLUMN `attr_signage` VARCHAR(50) comment '属性标识'; +alter table hz_st_ex_object_project_content add COLUMN `attr_name` VARCHAR(64) comment '属性名称'; + +-- 巡检路径添加类型 +alter table hz_st_re_route add COLUMN `type` VARCHAR(2) comment '巡检路线 字典:routeType 1-值班 2-通用'; + +-- 巡检路径类型字典 +INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1684523371508834306, 0, 'routeType', '-1', '巡检路径类型', 23, '', 0, 0, 0, -1, 'inspect'); +INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1684523447710949377, 1684523371508834306, 'routeType', '1', '值班', 1, '', 0, 0, 0, -1, 'inspect'); +INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1684523498650771458, 1684523371508834306, 'routeType', '2', '计划', 2, '', 0, 0, 0, -1, 'inspect'); From eae705971534fc4e38b27e094ca8495844a1a1cc Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 28 Jul 2023 17:10:17 +0800 Subject: [PATCH 4/5] =?UTF-8?q?#=20=E5=B7=A1=E6=A3=80=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=A0=91-=E6=9C=BA=E6=9E=84=E5=B1=82?= =?UTF-8?q?=E7=BA=A7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzinfo/inspect/obj/web/ProjectController.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 bf4cfa5..2e2aabd 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 @@ -32,6 +32,8 @@ import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.Func; +import org.springblade.system.entity.Dept; +import org.springblade.system.feign.ISysClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; @@ -41,6 +43,7 @@ import javax.validation.constraints.NotNull; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -59,6 +62,8 @@ public class ProjectController { private TemplateProjectService templateProjectService; @Autowired private ProjectContentServiceImpl projectContentService; + @Autowired + private ISysClient sysClient; /** * 巡检项目列表 @@ -178,4 +183,17 @@ public class ProjectController { public R> getProjectAndContentByEmCodes(@RequestParam String emCodes) { return R.data(projectService.getProjectAndContentByEmCodes(emCodes)); } + + @GetMapping("/getProjectDept") + @ApiOperation(value = "获取巡检项目下的机构") + @ApiOperationSupport(order = 9) + public R getProjectDept() { + QueryWrapper queryWrapper = Wrappers.query().select("distinct create_dept deptId"); + List deptIdList = projectService.listObjs(queryWrapper, Func::toLong); + List result = deptIdList.stream().map(deptId -> new HashMap() {{ + put("deptId", deptId); + put("deptName", Optional.ofNullable(sysClient.getDept(deptId).getData()).map(Dept::getDeptName).orElse(deptId.toString())); + }}).collect(Collectors.toList()); + return R.data(result); + } } From e407f343899424e7a22ca88b91410ee31571cb8c Mon Sep 17 00:00:00 2001 From: tanghaihao <850814414@qq.com> Date: Fri, 28 Jul 2023 17:11:56 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E5=B7=A1=E6=A3=80=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E9=9C=80=E8=A6=81=E5=92=8C=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=20=E8=AE=BE=E5=A4=87=E7=AD=94=E9=A2=98?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E7=BB=91=E5=AE=9A=E6=A8=A1=E5=9E=8B=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hnac/hzims/equipment/entity/EmInfoEntity.java | 3 +++ .../com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java | 1 + .../hzims/monitor/server/impl/EquipmentInstanceServiceImpl.java | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/EmInfoEntity.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/EmInfoEntity.java index 088f2db..de44d52 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/EmInfoEntity.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/EmInfoEntity.java @@ -234,6 +234,9 @@ public class EmInfoEntity extends TenantEntity { @ApiModelProperty("站点编码") private String stationCode; + @ApiModelProperty(value = "模型标识") + private String modelSignage; + @TableField(exist = false) @ApiModelProperty("站点名称") private String stationName; diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java index 8535ae9..0d468b4 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java @@ -841,6 +841,7 @@ public class EmInfoServiceImpl extends BaseServiceImpl inspectWrapper = new LambdaQueryWrapper(); diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/EquipmentInstanceServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/EquipmentInstanceServiceImpl.java index d86c986..9363710 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/EquipmentInstanceServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/EquipmentInstanceServiceImpl.java @@ -2,8 +2,12 @@ package com.hnac.hzims.monitor.server.impl; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.equipment.entity.EmDefinitionEntity; import com.hnac.hzims.equipment.entity.EmInfoEntity; +import com.hnac.hzims.equipment.entity.EmTreeEntity; +import com.hnac.hzims.equipment.service.IEmDefinitionService; import com.hnac.hzims.equipment.service.IEmInfoService; +import com.hnac.hzims.equipment.service.IEmTreeService; import com.hnac.hzims.fdp.request.AnswerFormatReq; import com.hnac.hzims.fdp.request.SubmitAnswerReq; import com.hnac.hzims.fdp.service.IFdpQuestionService; @@ -78,6 +82,10 @@ public class EquipmentInstanceServiceImpl implements IEquipmentInstanceService { } private String getModelSignageByAnswer(SubmitAnswerReq submitAnswerReq) { + EmInfoEntity emInfoEntity = emInfoService.getEmInfoByEmCode(submitAnswerReq.getEmCode()); + if (Func.isNotEmpty(emInfoEntity.getModelSignage())) { + return emInfoEntity.getModelSignage(); + } if(IFdpQuestionService.COMMON_TYPE.equals(submitAnswerReq.getDeviceType())) { return commonSignage; }