diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyLogController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyLogController.java new file mode 100644 index 0000000..c627cee --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyLogController.java @@ -0,0 +1,53 @@ +package com.hnac.hzims.operational.duty.controller; + + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.duty.entity.ImsDutyLogEntity; +import com.hnac.hzims.operational.duty.service.IImsDutyLogService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +import org.springblade.system.feign.ISysClient; +import org.springframework.web.bind.annotation.*; + + +import javax.validation.Valid; + + + +/** + * 控制器 + * + * @author Chill + */ +@RestController +@AllArgsConstructor +@RequestMapping("/imsDutyLog") +@Api(value = "值班日志", tags = "值班日志") +public class ImsDutyLogController extends BladeController { + + private final IImsDutyLogService imsDutyLogService; + + private final ISysClient sysClient; + + + /** + * 新增或修改 代码自定义代号 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入imsDutyMain") + public R submit(@Valid @RequestBody ImsDutyLogEntity imsDutyLogEntity) { + boolean b = imsDutyLogService.saveOrUpdate(imsDutyLogEntity); + if(b){ + return R.success("保存成功"); + }else { + return R.fail("保存失败"); + } + } + + + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyMainMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyMainMapper.xml index cc0bce1..267a575 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyMainMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyMainMapper.xml @@ -64,7 +64,8 @@ DM.PRE_DUTY_ID AS preDutyId, DM.status , DM.DUTY_DATE AS dutyDate, - CONCAT(CASE WHEN DM.`CLASS_ID` = 0 THEN '休息' ELSE DC.CLASS_NAME END, '-', DG.GROUP_NAME) AS name, + CONCAT(CASE WHEN DM.`CLASS_ID` = 0 THEN '休息' ELSE DC.CLASS_NAME END, '-', + CASE WHEN DG.GROUP_NAME is null THEN '临时班组' ELSE DG.GROUP_NAME END) AS name, DC.START_TIME AS startTime, DC.END_TIME AS endTime, DM.CREATE_USER, diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index cfd18ef..db48343 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -1585,6 +1585,8 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl unExecutedList = ticketInfoData.stream() + .filter(item -> !"结束".equals(item.getFlowTaskName())) + .filter(item -> !"废票".equals(item.getFlowTaskName())) .filter(item -> "0".equals(item.getImplementStatus())) .collect(Collectors.toList()); dutyLogEntity.setWorkUnFinish(String.valueOf(unExecutedList.size())); 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 32b028c..cebe8a9 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 @@ -136,9 +136,9 @@ public class WorkTaskServiceImpl extends BaseServiceImpl 100){ + if(number >= 100){ code += number; - }else if(number > 10){ + }else if(number >= 10){ code = code + "0" + number; }else{ code = code + "00" + number; 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 7eec751..645f899 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 @@ -122,6 +122,13 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl measureVOList = standardTicketMeasureService.list(req); standardTicketInfoVO.setStandardTicketMeasureVOList(measureVOList); + List collect = measureVOList.stream().filter(s -> Func.isNotEmpty(s.getExecuteTime())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(collect)){ + standardTicketInfoVO.setStartTime(collect.stream().map(StandardTicketMeasureVO::getExecuteTime) + .min(Comparator.comparing(LocalDateTime::toString)) + .orElse(null)); + } + standardTicketInfoVO.setEndTime(standardTicketInfoVO.getPrincipalTime()); return R.data(standardTicketInfoVO); } @@ -906,6 +913,11 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl params = com.hnac.hzims.ticket.utils.ObjectUtils.obj2Map(detail); params.put("measureMapList", this.convert(detail.getStandardTicketMeasureVOList())); + //操作票的开始时间取安全措施完成明细中最早的时间-2024.04.26 + LocalDateTime startTime = detail.getStandardTicketMeasureVOList() + .stream().map(StandardTicketMeasureVO::getExecuteTime).min(Comparator.comparing(LocalDateTime::toString)) + .orElse(null); + params.put("measureTimeLast", startTime.format(DateUtil.DATETIME_FORMATTER)); XWPFDocument xwpfDocument = null; String fileName = "template/电气操作票.docx"; try { @@ -942,7 +954,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl deptList = (List) params.get("deptList"); log.info("查询工作票"); List infoList = infoService.list(new LambdaQueryWrapper() {{ - ge(WorkTicketInfoEntity::getPlanStartTime, startDate); - le(WorkTicketInfoEntity::getPlanStartTime, endDate); + ge(WorkTicketInfoEntity::getUpdateTime, startDate); + le(WorkTicketInfoEntity::getUpdateTime, endDate); in(WorkTicketInfoEntity::getCreateDept, deptList); + eq(WorkTicketInfoEntity::getIsDeleted,0); }}); return R.data(infoList); } /** - * 获取首页操作票统计结果 + * 根据时间,和机构获取对应操作票 * * @param params * @return @@ -211,8 +212,9 @@ public class TicketInfoClient implements ITicketInfoClient { String endDate = (String) params.get("endDate"); List deptList = (List) params.get("deptList"); List standardTicketList = standardService.list(new LambdaQueryWrapper() {{ - ge(StandardTicketInfoEntity::getStartTime, startDate); - le(StandardTicketInfoEntity::getStartTime, endDate); + ge(StandardTicketInfoEntity::getUpdateTime, startDate); + le(StandardTicketInfoEntity::getUpdateTime, endDate); + eq(StandardTicketInfoEntity::getIsDeleted,0); in(StandardTicketInfoEntity::getCreateDept, deptList); }}); return R.data(standardTicketList); diff --git a/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx b/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx index 2d764d6..852a83b 100644 Binary files a/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx and b/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx differ diff --git a/hzims-service/ticket/src/main/resources/template/电气操作票.docx b/hzims-service/ticket/src/main/resources/template/电气操作票.docx index 4d4b795..ea4d8a0 100644 Binary files a/hzims-service/ticket/src/main/resources/template/电气操作票.docx and b/hzims-service/ticket/src/main/resources/template/电气操作票.docx differ diff --git a/hzims-service/ticket/src/main/resources/template/电气第二种工作票模版.docx b/hzims-service/ticket/src/main/resources/template/电气第二种工作票模版.docx index 9db9515..b4f4e21 100644 Binary files a/hzims-service/ticket/src/main/resources/template/电气第二种工作票模版.docx and b/hzims-service/ticket/src/main/resources/template/电气第二种工作票模版.docx differ