Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 9 months ago
parent
commit
0c208a71c1
  1. 14
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  2. 12
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java
  3. BIN
      hzims-service/ticket/src/main/resources/template/电气操作票.docx

14
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java

@ -122,6 +122,13 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
req.setTicketId(id); req.setTicketId(id);
List<StandardTicketMeasureVO> measureVOList = standardTicketMeasureService.list(req); List<StandardTicketMeasureVO> measureVOList = standardTicketMeasureService.list(req);
standardTicketInfoVO.setStandardTicketMeasureVOList(measureVOList); standardTicketInfoVO.setStandardTicketMeasureVOList(measureVOList);
List<StandardTicketMeasureVO> 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); return R.data(standardTicketInfoVO);
} }
@ -906,6 +913,11 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
StandardTicketInfoVO detail = this.detail(ticketId).getData(); StandardTicketInfoVO detail = this.detail(ticketId).getData();
Map<String, Object> params = com.hnac.hzims.ticket.utils.ObjectUtils.obj2Map(detail); Map<String, Object> params = com.hnac.hzims.ticket.utils.ObjectUtils.obj2Map(detail);
params.put("measureMapList", this.convert(detail.getStandardTicketMeasureVOList())); 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; XWPFDocument xwpfDocument = null;
String fileName = "template/电气操作票.docx"; String fileName = "template/电气操作票.docx";
try { try {
@ -942,7 +954,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
if ("linux".equals(os)) { if ("linux".equals(os)) {
return pdfSavePath; return pdfSavePath;
} else { } else {
return "E://template/"; return "D://template/";
} }
} }

12
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java

@ -50,12 +50,12 @@ public class ObjectUtils {
result.put(field.getName(),DateUtil.format(time,DateUtil.PATTERN_DATETIME)); result.put(field.getName(),DateUtil.format(time,DateUtil.PATTERN_DATETIME));
} }
else { else {
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"year",time.getYear()); result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"year",String.format("%02d", time.getYear()));
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"month",time.getMonth()); result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"month",String.format("%02d", time.getMonth()));
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"day",time.getDay()); result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"day",String.format("%02d", time.getDay()));
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"hour",time.getHours()); result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"hour",String.format("%02d", time.getHours()));
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"minuter",time.getMinutes()); result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"minuter",String.format("%02d",time.getMinutes()));
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"second",time.getSeconds()); result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"second",String.format("%02d", time.getSeconds()));
} }
} }
else { else {

BIN
hzims-service/ticket/src/main/resources/template/电气操作票.docx

Binary file not shown.
Loading…
Cancel
Save