From 55a357c2d210e0f5b51670bf7b984c522f94755e Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 11 Jan 2024 10:59:30 +0800 Subject: [PATCH] =?UTF-8?q?#=E6=A3=80=E4=BF=AE=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../access/entity/OperAccessStatisticsEntity.java | 21 +++++++++++++++++++++ .../access/entity/OperAccessTaskEntity.java | 6 ++++++ .../equipment/controller/EmInfoController.java | 7 +++++++ .../hzims/equipment/service/IEmInfoService.java | 2 ++ .../equipment/service/impl/EmInfoServiceImpl.java | 14 ++++++++++++++ .../access/dto/OperAccessStatisticsDTO.java | 3 +++ .../access/mapper/OperAccessStatisticsMapper.xml | 14 ++++++++++++-- .../access/mapper/OperAccessTaskDetailMapper.java | 4 ++++ .../access/mapper/OperAccessTaskDetailMapper.xml | 5 +++++ .../service/impl/AccessPlanV4ServiceImpl.java | 9 ++++++++- .../service/impl/AccessTaskV4ServiceImpl.java | 2 ++ .../impl/OperAccessStatisticsServiceImpl.java | 2 -- .../access/vo/OperAccessStatisticsVO.java | 6 ++++++ .../repair/service/impl/WorkTaskServiceImpl.java | 2 ++ 14 files changed, 92 insertions(+), 5 deletions(-) diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java index 8609df3..273e5e1 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java @@ -35,6 +35,20 @@ public class OperAccessStatisticsEntity extends TenantEntity { /** * 任务ID */ + @ApiModelProperty(value = "设备编号") + @JsonSerialize(nullsUsing = NullSerializer.class) + private String emCode; + + /** + * 任务ID + */ + @ApiModelProperty(value = "设备名称") + @JsonSerialize(nullsUsing = NullSerializer.class) + private String emName; + + /** + * 任务ID + */ @ApiModelProperty(value = "任务ID") @JsonSerialize(nullsUsing = NullSerializer.class) private Long taskId; @@ -59,6 +73,13 @@ public class OperAccessStatisticsEntity extends TenantEntity { private Date planEndTime; /** + * 实际工时 + */ + @ApiModelProperty(value = "计划工时") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer planHours; + + /** * 实际开始时间 */ @ApiModelProperty(value = "实际开始时间") diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java index bbeb2a7..f9f6054 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java @@ -79,6 +79,12 @@ public class OperAccessTaskEntity extends TenantEntity { private Date planEndTime; /** + * 计划结束时间 + */ + @ApiModelProperty(value = "计划工时") + private Integer planHours; + + /** * 实际开始时间 */ @ApiModelProperty(value = "实际开始时间") 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 6239612..da112b3 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 @@ -420,4 +420,11 @@ public class EmInfoController extends BladeController { public R> hkVideoDevices() { return R.data(em_infoService.hkVideoDevices()); } + + @GetMapping("/select") + @ApiOperationSupport(order = 13) + @ApiOperation(value = "下拉框设备查询") + public R> select(@RequestParam(value = "deptId",required = false) Long deptId) { + return R.data(em_infoService.select(deptId)); + } } 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 e3527c3..8732f88 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 @@ -94,4 +94,6 @@ public interface IEmInfoService extends BaseService { List hkVideoDevices(); List deviceByPath(String emCode); + + List select(Long deptId); } 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 c796b39..6c3b991 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 @@ -990,4 +990,18 @@ public class EmInfoServiceImpl extends BaseServiceImpllambdaQuery().in(EmInfoEntity::getNumber, Arrays.asList(deviceCodes))); } + /** + * 根据机构查询设备 + * @param deptId + * @return + */ + @Override + public List select(Long deptId) { + if(ObjectUtil.isEmpty(deptId)){ + return this.list(); + } + return this.list(Wrappers.lambdaQuery() + .eq(EmInfoEntity::getDepartment,deptId)); + } + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java index bb9effb..f6337fd 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java @@ -20,6 +20,9 @@ public class OperAccessStatisticsDTO extends OperAccessStatisticsEntity { private static final long serialVersionUID = 1L; + @ApiModelProperty("设备编码") + private String emCode; + @ApiModelProperty(value = "任务名称") private String taskName; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml index e390f35..caedd20 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml @@ -3,12 +3,15 @@ - + + + + @@ -22,12 +25,19 @@ + + - SELECT OT.`NAME` AS taskName,OS.* FROM hzims_oper_access_statistics OS JOIN hzims_oper_access_task OT ON OS.`TASK_ID` = OT.`ID` WHERE OS.IS_DELETED = 0 + + and OS.emCode = #{dto.emCode} + and OT.`NAME` like concat('%',#{dto.taskName},'%') diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.java index c9ca368..f0b06b1 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.java @@ -2,8 +2,11 @@ package com.hnac.hzims.operational.access.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity; +import org.apache.ibatis.annotations.Param; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; +import java.util.List; + /** * * Mapper 接口 @@ -13,4 +16,5 @@ import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; **/ public interface OperAccessTaskDetailMapper extends BaseMapper { + List selectByTaskId(@Param("taskId") Long taskId); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.xml index 49b57fa..977c8ce 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.xml @@ -17,5 +17,10 @@ + \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java index dce780c..0d3bdbe 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java @@ -32,6 +32,9 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.text.DecimalFormat; +import java.time.Duration; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -229,7 +232,7 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{ if(ObjectUtil.isEmpty(plan)){ throw new ServiceException("未查询到检修计划!"); } - + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); for(OperAccessContentDTO item : entity.getAccessContents()){ //任务参数 AccessTaskV4DTO task = BeanUtil.copy(item, AccessTaskV4DTO.class); @@ -239,6 +242,10 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{ task.setProcDefId(plan.getProcDefId()); task.setHandler(item.getManager()); task.setPlanId(plan.getId()); + LocalDateTime start = LocalDateTime.parse(DateUtil.format(task.getPlanStartTime(),DateUtil.PATTERN_DATETIME), formatter); + LocalDateTime end = LocalDateTime.parse(DateUtil.format(task.getPlanEndTime(),DateUtil.PATTERN_DATETIME), formatter); + Duration duration = Duration.between(start, end); + task.setPlanHours((int) duration.toHours()); task.setContentId(item.getId()); task.setEmCode(item.getEmCode()); task.setTenantId(plan.getTenantId()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java index e873831..ec72544 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java @@ -251,6 +251,8 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { OperAccessStatisticsDTO statisticsDTO = BeanUtil.copy(entity, OperAccessStatisticsDTO.class); statisticsDTO.setId(null); statisticsDTO.setTaskId(entity.getId()); + statisticsDTO.setEmCode(entity.getEmCode()); + statisticsDTO.setPlanHours(entity.getPlanHours()); statisticsDTO.setManager(entity.getHandler()); OperAccessContentEntity content = contentService.getById(entity.getId()); if (ObjectUtil.isNotEmpty(content)) { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java index 4d89199..548fd15 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java @@ -50,8 +50,6 @@ public class OperAccessStatisticsServiceImpl extends BaseServiceImpl> list(OperAccessStatisticsDTO req, IPage page) { List operAccessStatisticsVOS = this.baseMapper.selectPageList(page, req); - /* IPage pages = super.page(Condition.getPage(query), getQueryWrapperByList(req)); - pages.setRecords(OperAccessStatisticsWrapper.build().listVO(pages.getRecords()));*/ return R.data(page.setRecords(OperAccessStatisticsWrapper.build().listVO(operAccessStatisticsVOS))); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java index 1e1760f..1b085da 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java @@ -1,10 +1,13 @@ package com.hnac.hzims.operational.access.vo; import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity; +import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.List; + /** * 模型VO * @@ -28,4 +31,7 @@ public class OperAccessStatisticsVO extends OperAccessStatisticsEntity { @ApiModelProperty(value = "任务名称") private String taskName; + + @ApiModelProperty(value = "检修内容") + private List details; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java index 392ff00..c95c627 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java @@ -20,6 +20,7 @@ import org.springblade.flow.core.utils.FlowUtil; import org.springblade.flow.core.utils.TaskUtil; import org.springframework.stereotype.Service; +import java.util.Date; import java.util.Map; /** @@ -67,6 +68,7 @@ public class WorkTaskServiceImpl extends BaseServiceImpl