diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/WorkTicketConstants.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/WorkTicketConstants.java index 68fbb3f..16e662d 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/WorkTicketConstants.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/WorkTicketConstants.java @@ -83,4 +83,25 @@ public interface WorkTicketConstants { return statusOptional.orElse(null); } } + + @AllArgsConstructor + enum TicketSignageEnum { + /**第一种工作票**/ + FIRST("6","D1"), + /**第二种工作票**/ + SECOND("7","D2"), + /**机械工作票**/ + MACHINE("8","JX"), + ; + @Getter + private String ticketType; + @Getter + private String signage; + + public static String getTicketSignageByType(String ticketType) { + Optional exist = Arrays.stream(TicketSignageEnum.class.getEnumConstants()) + .filter(e -> ticketType.equals(e.getTicketType())).findFirst(); + return exist.map(TicketSignageEnum::getSignage).orElse(null); + } + } } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml index c5dad21..7b3e34f 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml @@ -126,9 +126,9 @@ from hzims_em_info info LEFT JOIN hzims_em_tree tree ON info.tree_id = tree.id LEFT JOIN hzims_em_tree_basic etb ON tree.id = etb.tree_id - LEFT JOIN hzims_assets.wt_sp_basic basic ON etb.basic_id = basic.id - LEFT JOIN hzims_assets.wt_sp_total total ON basic.id = total.SP_BASIC_ID - LEFT JOIN hzims_assets.wt_sp_warehouse house ON total.WAREHOUSE_ID = house.id + LEFT JOIN `hzims-assets`.wt_sp_basic basic ON etb.basic_id = basic.id + LEFT JOIN `hzims-assets`.wt_sp_total total ON basic.id = total.SP_BASIC_ID + LEFT JOIN `hzims-assets`.wt_sp_warehouse house ON total.WAREHOUSE_ID = house.id LEFT JOIN hzims_operation.hzims_oper_access_material mat ON basic.id = mat.SP_BASIC_ID diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java index 6565190..056cd66 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java @@ -78,7 +78,7 @@ public class MessagePushRecordController extends BladeController { public R readMessage(@PathVariable @ApiParam("消息记录ID") String id) { MessagePushRecordEntity record = messagePushRecordService.getById(id); if (!(Long.parseLong(record.getPusher()) == AuthUtil.getUserId())) { - return R.fail("当前登录人不是消息推送人,修改状态失败"); + return R.fail("当前登录人不是消息接收人,修改状态失败"); } LambdaUpdateWrapper eq = Wrappers.lambdaUpdate() .set(MessagePushRecordEntity::getStatus, MessageConstants.CONFIRM) diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java index 6ab12eb..6383485 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java @@ -366,6 +366,7 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl query = Wrappers.query(); query.select("business_classify businessClassify,count(0) todoNum"); query.eq("pusher", AuthUtil.getUserId()); + query.eq("type", MessageConstants.WS_PUSH); query.in("status", Lists.newArrayList(MessageConstants.PUSH_SUCCESS)); query.groupBy("business_classify"); List> list = noAurhScopeMapper.selectMaps(query); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java index 5e5405b..fc36121 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java @@ -24,9 +24,7 @@ public class OperMaintenanceMonitorReportMonthDTO implements Serializable { @ApiModelProperty(value = "月", required = true) private Integer month; + @ApiModelProperty(value = "机构ID") + private Long deptId; - /** - * 站点code - */ - private String stationCode; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java index cc007e1..de665d9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java @@ -46,11 +46,10 @@ public class OperMaintenanceMonitorServiceImpl implements IOperMaintenanceMonito public R>> reportMonth(OperMaintenanceMonitorReportMonthDTO req) { List planEntities = planMapper.selectList(new LambdaQueryWrapper() {{ LocalDate startDate = LocalDate.of(req.getYear(), req.getMonth(), 1); - // Date startTime = DateUtil.parse(DateUtil.format(DateUtil.now(), "yyyy-MM") + "-01", DateUtil.PATTERN_DATE); eq(OperMaintenancePlanEntity::getIsDeleted, 0L); ge(OperMaintenancePlanEntity::getDisposeTime, startDate); - lt(OperMaintenancePlanEntity::getDisposeTime, startDate.with(TemporalAdjusters.lastDayOfMonth())) - .eq(StringUtils.isNoneBlank(req.getStationCode()), OperMaintenancePlanEntity::getStationCode, req.getStationCode()); + lt(OperMaintenancePlanEntity::getDisposeTime, startDate.with(TemporalAdjusters.lastDayOfMonth())); + eq(Func.isNotEmpty(req.getDeptId()), OperMaintenancePlanEntity::getCreateDept, req.getDeptId()); }}); //获取列表班次ID集合 diff --git a/hzims-service/operational/src/main/resources/files/日常维护流程.bpmn20.xml b/hzims-service/operational/src/main/resources/files/日常维护流程.bpmn20.xml index 0761b72..0f884ff 100644 --- a/hzims-service/operational/src/main/resources/files/日常维护流程.bpmn20.xml +++ b/hzims-service/operational/src/main/resources/files/日常维护流程.bpmn20.xml @@ -1,27 +1,27 @@ - + - - + + - + - + - + @@ -51,25 +51,25 @@ - + - - - - + + + + - - - - + + + + - + - + 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 3b46de4..decba6c 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 @@ -505,8 +505,8 @@ public class OperationTicketServiceImpl implements OperationTicketService { 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", ""); + map.put("hello", TicketConstants.MATTER_FINISH_STATUS.equals(measure.getStatus()) ? "√" : ""); + map.put("hello1", TicketConstants.MATTER_FINISH_STATUS.equals(measure.getStatus()) ? "√" : ""); index.getAndIncrement(); measureMapLists.add(map); } 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 index 803e2c1..21b8d9b 100644 --- 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 @@ -40,10 +40,13 @@ public class OperationWordHelper { * @return */ public static String getWorkTicketStatus(Integer status) { - String result = null; + String result; switch (status) { - case 1: - result = "电气操作票.docx"; + case 4: + result = "开机操作票.docx"; + break; + case 5: + result = "停机操作票.docx"; break; default: result = "电气操作票.docx"; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/OfflineTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/OfflineTicketController.java new file mode 100644 index 0000000..62f675d --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/OfflineTicketController.java @@ -0,0 +1,53 @@ +package com.hnac.hzims.ticket.workTicket.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto; +import com.hnac.hzims.ticket.workTicket.service.IOfflineTicketService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +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; + +/** + * @ClassName OfflineTicketController + * @description: 线下工作票管理 + * @author: hx + * @create: 2023-09-14 10:36 + * @Version 4.0 + **/ +@RestController +@RequestMapping("/offline/ticket") +@AllArgsConstructor +@Api(value = "线下工作票管理") +public class OfflineTicketController extends BladeController { + + private final IOfflineTicketService offlineTicketService; + + @PostMapping("/invoicing") + @ApiOperation("线下工作票开票") + @ApiOperationSupport(order = 1) + public R invoicing(@RequestBody WorkTicketInfoDto dto) { + return R.status(offlineTicketService.invoicing(dto)); + } + + @PostMapping("/licenseOfflineTicket") + @ApiOperation("线下工作票线下处理") + @ApiOperationSupport(order = 2) + public R licenseOfflineTicket(@RequestBody WorkTicketInfoDto dto) { + return R.status(offlineTicketService.licenseOfflineTicket(dto)); + } + + @PostMapping("/finishOfflineTicket") + @ApiOperation("线下工作票终结") + @ApiOperationSupport(order = 3) + public R finishOfflineTicket(@RequestBody WorkTicketInfoDto dto) { + return R.status(offlineTicketService.finishOfflineTicket(dto)); + } + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml index dc61936..dc78866 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml @@ -92,7 +92,7 @@ (select count(*) from hzims_ticket_info_evaluate e where evaluate = '合格!' and e.id = eval.id) as qualified from hzims_work_ticket_info info LEFT JOIN hzims_ticket_info_evaluate eval ON info.id = eval.ticket_id - LEFT JOIN equipment.hzims_em_info em ON info.em_code = em.NUMBER + LEFT JOIN `equipment`.hzims_em_info em ON info.em_code = em.NUMBER em.path like CONCAT(#{path},'%') diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IOfflineTicketService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IOfflineTicketService.java new file mode 100644 index 0000000..cb7b477 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IOfflineTicketService.java @@ -0,0 +1,15 @@ +package com.hnac.hzims.ticket.workTicket.service; + +import com.hnac.hzims.ticket.workTicket.dto.TicketAccessTaskDto; +import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import org.springblade.core.mp.base.BaseService; + +public interface IOfflineTicketService extends BaseService { + + boolean invoicing(WorkTicketInfoDto dto); + + boolean licenseOfflineTicket(WorkTicketInfoDto dto); + + boolean finishOfflineTicket(WorkTicketInfoDto dto); +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/OfflineTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/OfflineTicketServiceImpl.java new file mode 100644 index 0000000..312edca --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/OfflineTicketServiceImpl.java @@ -0,0 +1,206 @@ +package com.hnac.hzims.ticket.workTicket.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +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.constants.WorkTicketConstants; +import com.hnac.hzims.ticket.twoTicket.constant.TicketConstant; +import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketContentEntity; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketFlowEntity; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketSafetyMeasureEntity; +import com.hnac.hzims.ticket.workTicket.mapper.WorkTicketInfoMapper; +import com.hnac.hzims.ticket.workTicket.service.IOfflineTicketService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketContentService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketFlowService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketSafetyMeasureService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +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.CollectionUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.stereotype.Service; +import org.springframework.util.Assert; + +import java.time.LocalDateTime; +import java.time.YearMonth; +import java.time.format.DateTimeFormatter; +import java.time.temporal.TemporalAdjusters; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; +import java.util.stream.Collectors; + +/** + * @ClassName OfflineTicketServiceImpl + * @description: 线下工作票service类 + * @author: hx + * @create: 2023-09-13 14:00 + * @Version 4.0 + **/ +@AllArgsConstructor +@Service +@Slf4j +public class OfflineTicketServiceImpl extends BaseServiceImpl implements IOfflineTicketService { + private final IStationClient stationClient; + private final IWorkTicketSafetyMeasureService workTicketSafetyMeasureService; + private final IWorkTicketContentService contentService; + private final IUserClient userClient; + private final IWorkTicketFlowService workTicketFlowService; + + /** + * 线下工作票开票 + * @param dto 工作票开票内容 + * @return 开票结果 + */ + @Override + public boolean invoicing(WorkTicketInfoDto dto) { + WorkTicketInfoEntity ticketInfoEntity = BeanUtil.copy(dto,WorkTicketInfoEntity.class); + ticketInfoEntity.setCode(this.getTicketCode(ticketInfoEntity.getType(),ticketInfoEntity.getSignageCode())); + ticketInfoEntity.setStatus(WorkTicketConstants.FirstWorkTicketStatusEnum.OFFLINE_OPERATE.getStatus()); + ticketInfoEntity.setFlowTaskName(WorkTicketConstants.FirstWorkTicketStatusEnum.OFFLINE_OPERATE.getDescription()); + String userName = this.getLicensorNameByDept(Long.parseLong(AuthUtil.getDeptId())); + ticketInfoEntity.setStepOperator(userName); + ticketInfoEntity.setNextStepOperator(userName); + if(this.save(ticketInfoEntity)) { + Long ticketId = ticketInfoEntity.getId(); + // 保存安全措施 + if(CollectionUtil.isNotEmpty(dto.getWorkTicketSafetyMeasureDtoList())) { + List measureList = JSONArray.parseArray(JSON.toJSONString(dto.getWorkTicketSafetyMeasureDtoList()), WorkTicketSafetyMeasureEntity.class); + measureList.forEach(m -> m.setTicketId(ticketId)); + workTicketSafetyMeasureService.saveBatch(measureList); + } + // 保存工作任务 + if(CollectionUtil.isNotEmpty(dto.getWorkTicketContentDtoList())) { + List contentList = JSONArray.parseArray(JSON.toJSONString(dto.getWorkTicketContentDtoList()), WorkTicketContentEntity.class); + contentList.forEach(c -> c.setTicketId(ticketId)); + contentService.saveBatch(contentList); + } + return true; + } + return false; + } + + /** + * 线下执行任务 + * @param dto 工作票传参 + * @return 执行成功与否 + */ + @Override + public boolean licenseOfflineTicket(WorkTicketInfoDto dto) { + String userName = this.getLicensorNameByDept(Long.parseLong(AuthUtil.getDeptId())); + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate() + .set(WorkTicketInfoEntity::getStatus, WorkTicketConstants.FirstWorkTicketStatusEnum.OFFLINE_LICENSE.getStatus()) + .set(WorkTicketInfoEntity::getLicensor, AuthUtil.getUserId()) + .set(WorkTicketInfoEntity::getLicenseTime, LocalDateTime.now()) + .set(WorkTicketInfoEntity::getLicenseEndTime, dto.getLicenseEndTime()) + .set(WorkTicketInfoEntity::getStepOperator, userName) + .set(WorkTicketInfoEntity::getNextStepOperator, userName) + .eq(WorkTicketInfoEntity::getId, dto.getId()); + if(this.update(updateWrapper)) { + // 添加流程消息 + WorkTicketFlowEntity flowEntity = new WorkTicketFlowEntity(); + flowEntity.setTicketId(dto.getId()); + flowEntity.setFlowCode(WorkTicketConstants.FirstWorkTicketStatusEnum.OFFLINE_OPERATE.getStatus().toString()); + flowEntity.setFirstValue(dto.getLicenseImgUrls()); + flowEntity.setSecondValue(dto.getLicenseImgFilenames()); + workTicketFlowService.save(flowEntity); + return true; + } + return false; + } + + /** + * 线下许可人许可 + * @param dto 工作票传参 + * @return 执行成功与否 + */ + @Override + public boolean finishOfflineTicket(WorkTicketInfoDto dto) { + String userName = this.getLicensorNameByDept(Long.parseLong(AuthUtil.getDeptId())); + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate() + .set(WorkTicketInfoEntity::getStatus, WorkTicketConstants.FirstWorkTicketStatusEnum.OFFLINE_END.getStatus()) + .set(WorkTicketInfoEntity::getStepOperator, userName) + .set(WorkTicketInfoEntity::getNextStepOperator, null) + .eq(WorkTicketInfoEntity::getId, dto.getId()); + //添加流程信息 + if(this.update(updateWrapper)) { + WorkTicketFlowEntity flowEntity = new WorkTicketFlowEntity(); + flowEntity.setTicketId(dto.getId()); + flowEntity.setFlowCode(WorkTicketConstants.FirstWorkTicketStatusEnum.OFFLINE_LICENSE.getStatus().toString()); + flowEntity.setFirstValue(dto.getFinishImgUrls()); + flowEntity.setSecondValue(dto.getFinishImgFilenames()); + workTicketFlowService.save(flowEntity); + return true; + } + return false; + } + + /** + * 获取工作票票据编号 + * @param ticketType 票据类型 + * @param stationCode 站点编号 + * @return 工作票票据编号 + */ + private String getTicketCode(String ticketType ,String stationCode) { + String result = ""; + String signage = WorkTicketConstants.TicketSignageEnum.getTicketSignageByType(ticketType); + Assert.isTrue(Func.isNotBlank(signage),() -> { + throw new ServiceException("获取工作票编号失败!"); + }); + StationEntity station = new StationEntity(); + station.setCode(stationCode); + R stationR = stationClient.getOne(station); + Assert.isTrue(stationR.isSuccess() && ObjectUtil.isNotEmpty(stationR.getData()) && Func.isNotEmpty(stationR.getData().getSignage()),() -> { + throw new ServiceException("该工作票站点下未获取到两票抬头!"); + }); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyMM"); + String yearMonth = YearMonth.now().format(formatter); + Lock lock = new ReentrantLock(); + lock.lock(); + try { + LocalDateTime date = LocalDateTime.now(); + LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0); + LocalDateTime lastDay = date.with(TemporalAdjusters.lastDayOfMonth()).withHour(23).withMinute(59).withSecond(59); + List ticketList = this.list( + Wrappers.lambdaQuery().eq(WorkTicketInfoEntity::getType, ticketType).eq(WorkTicketInfoEntity::getSignageCode, stationCode) + .ge(WorkTicketInfoEntity::getCreateTime,firstDay).le(WorkTicketInfoEntity::getCreateTime,lastDay) + + ); + String suffix = "-" + String.format(String.format("%03d",ticketList.size()+1)); + result = stationR.getData().getSignage() + "-" + signage + "-" + yearMonth + "-" + suffix; + } + finally { + lock.unlock(); + } + return result; + } + + /** + * 获取机构下许可人名称 + * @param deptId 机构ID + * @return 许可人名称,按逗号分隔 + */ + private String getLicensorNameByDept(Long deptId) { + R> usersR = userClient.relationUserListByRoleAlias(AuthUtil.getTenantId(),deptId, TicketConstants.LICENSOR_ROLE); + if(usersR.isSuccess() && CollectionUtil.isNotEmpty(usersR.getData())) { + return usersR.getData().stream().map(User::getId).map(UserCache::getUser).map(User::getName).collect(Collectors.joining(",")); + } + return ""; + } + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java index 5186610..a8ce5bf 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java @@ -1120,6 +1120,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl workTicketBillList = baseMapper.getWorkTicketBill(emInfo.getPath(), startTime, endTime); return workTicketBillList; } diff --git a/hzims-service/ticket/src/main/resources/template/~$第一种工作票模版.docx b/hzims-service/ticket/src/main/resources/template/~$第一种工作票模版.docx deleted file mode 100644 index 1ffd967..0000000 Binary files a/hzims-service/ticket/src/main/resources/template/~$第一种工作票模版.docx and /dev/null differ diff --git a/hzims-service/ticket/src/main/resources/template/停机操作票.docx b/hzims-service/ticket/src/main/resources/template/停机操作票.docx new file mode 100644 index 0000000..e8c3054 Binary files /dev/null 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 new file mode 100644 index 0000000..b2cd2fe Binary files /dev/null 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 3272f23..836b2db 100644 Binary files a/hzims-service/ticket/src/main/resources/template/电气操作票.docx and b/hzims-service/ticket/src/main/resources/template/电气操作票.docx differ