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 12726bd..e2477b1 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 @@ -599,6 +599,17 @@ public class EmInfoServiceImpl extends BaseServiceImpl Arrays.stream(path.split("/"))).distinct().collect(Collectors.toList()); emCodes.addAll(childrenEmCode); } + return this.getEmInfoTree(deptId,parentCode,emCodes); + } + + /** + * 获取设备树(巡检对象选择专用) + * @param deptId 机构ID + * @param parentCode 父设备编号 + * @param emCodes 巡检项目设备编号集合 + * @return 获取设备树 + */ + private List getEmInfoTree(Long deptId, String parentCode,List emCodes) { EmInfoEntity emInfo = this.getOne(Wrappers.lambdaQuery().eq(EmInfoEntity::getNumber, parentCode)); // 获取parentCode下的子设备集合 LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() @@ -608,13 +619,12 @@ public class EmInfoServiceImpl extends BaseServiceImpl result = emInfoList.stream().map(emInfoEntity -> { JSONObject object = JSONObject.parseObject(JSON.toJSONString(emInfoEntity)); object.put("disabled", emCodes.contains(emInfoEntity.getNumber()) ? false : true); + object.put("children",this.getEmInfoTree(deptId,emInfoEntity.getNumber(),emCodes)); return object; }).collect(Collectors.toList()); return result; } - - /** * 设备信息缓存(ct、pt、installedCapacity、监测点位) */ diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java index 2073ff6..94946e3 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java @@ -445,7 +445,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl> 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)); + List projects = projectService.list(queryWrapper); + if(CollectionUtil.isNotEmpty(projects)) { + QueryWrapper in = Wrappers.query().select("distinct project_id").in("project_id", projects.stream().map(ProjectEntity::getId).collect(Collectors.toList())); + List projectIds = projectContentService.listObjs(in, Func::toLong); + return R.data(projects.stream().filter(project -> projectIds.contains(project.getId())).map(ProjectEntity::getEmCode).collect(Collectors.toList())); + } + return R.data(projects.stream().map(ProjectEntity::getEmCode).collect(Collectors.toList())); } } 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 0614870..153cb48 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 @@ -276,10 +276,15 @@ public class ObjectServiceImpl extends BaseServiceImpl projectContentWrapper = Wrappers.lambdaQuery().eq(ProjectContentEntity::getProjectId, one.getId()); + if(CollectionUtil.isEmpty(projectContentService.list(projectContentWrapper))) { + return null; + } return TemplateProjectEntity.builder().templateId(template.getId()).projectId(one.getId()).build(); }; List templateProjectList = Stream.iterate(0,n -> n + 1).limit(emCodeList.size()) - .flatMap(index -> emInfoClient.getChildrenByEmCode(emCodeList.get(index)).getData().stream()).map(getTemplateProjectByEmCode).collect(Collectors.toList()); + .flatMap(index -> emInfoClient.getChildrenByEmCode(emCodeList.get(index)).getData().stream()).map(getTemplateProjectByEmCode).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList()); templateProjectService.saveBatch(templateProjectList); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/PointDataVo.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/PointDataVo.java index 444da82..8a6388c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/PointDataVo.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/PointDataVo.java @@ -42,4 +42,6 @@ public class PointDataVo { @JsonInclude(JsonInclude.Include.NON_EMPTY) private String signage; + private String name; + } diff --git a/hzims-service/operational/src/main/resources/db/1.0.2.sql b/hzims-service/operational/src/main/resources/db/1.0.2.sql new file mode 100644 index 0000000..86f166e --- /dev/null +++ b/hzims-service/operational/src/main/resources/db/1.0.2.sql @@ -0,0 +1,5 @@ +update hzims_oper_maintenance_task set flow_task_name = '待领用' where STATUS =1; +update hzims_oper_maintenance_task set flow_task_name = '待执行' where STATUS =2; +update hzims_oper_maintenance_task set flow_task_name = '待确认' where STATUS =3; +update hzims_oper_maintenance_task set flow_task_name = '待归档' where STATUS =4; +update hzims_oper_maintenance_task set flow_task_name = '结束' where STATUS =5; \ No newline at end of file diff --git a/hzims-service/ticket/src/main/resources/db/2.0.0.sql b/hzims-service/ticket/src/main/resources/db/2.0.0.sql index cc3d285..48a3b58 100644 --- a/hzims-service/ticket/src/main/resources/db/2.0.0.sql +++ b/hzims-service/ticket/src/main/resources/db/2.0.0.sql @@ -22,3 +22,31 @@ create table hzims_ticket_count ) comment '两票统计分析' row_format = DYNAMIC; +insert into hzims_work_ticket_finish(ticket_id, ground_num, brake_number) +select ticket_id, ground_switch_count,ground_wire_code +from hzims_work_ticket_flow; + + +alter table hzims_ticket_count add invalidated_ticket_num int null comment '废票数量'; + +# 工作票更新 +update hzims_work_ticket_info set flow_task_name = '签发' where status = 1; +update hzims_work_ticket_info set flow_task_name = '收到工作票' where status = 2; +update hzims_work_ticket_info set flow_task_name = '许可人许可' where status = 3; +update hzims_work_ticket_info set flow_task_name = '确认条件具备' where status = 4; +update hzims_work_ticket_info set flow_task_name = '工作负责人确认工作' where status = 5; +update hzims_work_ticket_info set flow_task_name = '许可人确认工作结束' where status = 6; +update hzims_work_ticket_info set flow_task_name = '工作票终结' where status = 7; +update hzims_work_ticket_info set flow_task_name = '许可人延期确认' where status = 9; +update hzims_work_ticket_info set flow_task_name = '负责人延期确认' where status = 10; +update hzims_work_ticket_info set flow_task_name = '作废' where status = 11; +update hzims_work_ticket_info set flow_task_name = '逾期' where status = 12; +# 操作票更新 +update hzims_standard_ticket_info set flow_task_name = '待监护人确认' where status = 1; +update hzims_standard_ticket_info set flow_task_name = '待值班负责人确认' where status = 2; +update hzims_standard_ticket_info set flow_task_name = '结束' where status = 3; +update hzims_standard_ticket_info set flow_task_name = '终止' where status = 4; + + +alter table hzims_ticket_count add wrong_ticket_num int null comment '错票数量'; +alter table hzims_ticket_count add percent_pass_ticket varchar(50) null comment '合格率'; diff --git a/hzims-service/ticket/src/main/resources/db/2.0.1.sql b/hzims-service/ticket/src/main/resources/db/2.0.1.sql deleted file mode 100644 index b4ff7d9..0000000 --- a/hzims-service/ticket/src/main/resources/db/2.0.1.sql +++ /dev/null @@ -1,3 +0,0 @@ -insert into hzims_work_ticket_finish(ticket_id, ground_num, brake_number) -select ticket_id, ground_switch_count,ground_wire_code -from hzims_work_ticket_flow; \ No newline at end of file diff --git a/hzims-service/ticket/src/main/resources/db/2.0.2.sql b/hzims-service/ticket/src/main/resources/db/2.0.2.sql deleted file mode 100644 index 85fa2b4..0000000 --- a/hzims-service/ticket/src/main/resources/db/2.0.2.sql +++ /dev/null @@ -1 +0,0 @@ -alter table hzims_ticket_count add invalidated_ticket_num int null comment '废票数量'; diff --git a/hzims-service/ticket/src/main/resources/db/2.0.3.sql b/hzims-service/ticket/src/main/resources/db/2.0.3.sql deleted file mode 100644 index 8f9af75..0000000 --- a/hzims-service/ticket/src/main/resources/db/2.0.3.sql +++ /dev/null @@ -1,18 +0,0 @@ -# 工作票更新 -update hzims_work_ticket_info set flow_task_name = '签发' where status = 1; -update hzims_work_ticket_info set flow_task_name = '收到工作票' where status = 2; -update hzims_work_ticket_info set flow_task_name = '许可人许可' where status = 3; -update hzims_work_ticket_info set flow_task_name = '确认条件具备' where status = 4; -update hzims_work_ticket_info set flow_task_name = '工作负责人确认工作' where status = 5; -update hzims_work_ticket_info set flow_task_name = '许可人确认工作结束' where status = 6; -update hzims_work_ticket_info set flow_task_name = '工作票终结' where status = 7; -update hzims_work_ticket_info set flow_task_name = '许可人延期确认' where status = 9; -update hzims_work_ticket_info set flow_task_name = '负责人延期确认' where status = 10; -update hzims_work_ticket_info set flow_task_name = '作废' where status = 11; -update hzims_work_ticket_info set flow_task_name = '逾期' where status = 12; -# 操作票更新 -update hzims_standard_ticket_info set flow_task_name = '待监护人确认' where status = 1; -update hzims_standard_ticket_info set flow_task_name = '待值班负责人确认' where status = 2; -update hzims_standard_ticket_info set flow_task_name = '结束' where status = 3; -update hzims_standard_ticket_info set flow_task_name = '终止' where status = 4; - diff --git a/hzims-service/ticket/src/main/resources/db/2.0.4.sql b/hzims-service/ticket/src/main/resources/db/2.0.4.sql deleted file mode 100644 index 58fafc0..0000000 --- a/hzims-service/ticket/src/main/resources/db/2.0.4.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table hzims_ticket_count add wrong_ticket_num int null comment '错票数量'; -alter table hzims_ticket_count add percent_pass_ticket varchar(50) null comment '合格率'; \ No newline at end of file