Browse Source

修正:工作票格式

zhongwei
ty 7 months ago
parent
commit
086c2a6f5c
  1. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/constant/TicketConstant.java
  2. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java
  3. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/MergeDocUtils.java
  4. 12
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java
  5. BIN
      hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/constant/TicketConstant.java

@ -12,7 +12,7 @@ public class TicketConstant {
/** /**
* window操作系统工作票访问路径 * window操作系统工作票访问路径
*/ */
public static final String TICKET_WINDOW_PATH = "E:/project/HZIMS/hzims-service/ticket/src/main/resources/template/"; public static final String TICKET_WINDOW_PATH = "D:/Java/hzims-back/hzims-service/ticket/src/main/resources/template/";
/** /**
* Liunx操作系统工作票访问路径 * Liunx操作系统工作票访问路径

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

@ -321,7 +321,7 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl<WorkTicketInfoMa
return pdfSavePath; return pdfSavePath;
} }
else { else {
return "E://template/"; return "D://template/";
} }
} }
@ -394,9 +394,11 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl<WorkTicketInfoMa
if(Func.isNotEmpty(finish.getLicensorEndTime())) { if(Func.isNotEmpty(finish.getLicensorEndTime())) {
if(workTicketInfoEntity.getIsOffline()) { if(workTicketInfoEntity.getIsOffline()) {
params.put("licensorName2",finish.getEndLicensorName()); params.put("licensorName2",finish.getEndLicensorName());
params.put("licensorNameEnd",finish.getFinishLicensorName());
} }
else { else {
params.put("licensorName2",params.get("licensorName")); params.put("licensorName2",params.get("licensorName"));
params.put("licensorNameEnd",params.get("licensorName"));
} }
params.put("groundNum",finish.getGroundNum()); params.put("groundNum",finish.getGroundNum());
params.put("dismantleNum",finish.getDismantleNum()); params.put("dismantleNum",finish.getDismantleNum());

5
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/MergeDocUtils.java

@ -49,12 +49,13 @@ public class MergeDocUtils {
doc = documentList.get(0); doc = documentList.get(0);
if (i == 0) { if (i == 0) {
//首页直接分页,不再插入首页文档内容 //首页直接分页,不再插入首页文档内容
documentList.get(i).createParagraph().createRun().addBreak(BreakType.PAGE); // 去除增加得分页2024.0424
// documentList.get(i).createParagraph().createRun().addBreak(BreakType.PAGE);
} else if (i == documentList.size() - 1) { } else if (i == documentList.size() - 1) {
//尾页不再分页,直接插入最后文档内容 //尾页不再分页,直接插入最后文档内容
appendBody(doc, documentList.get(i)); appendBody(doc, documentList.get(i));
} else { } else {
documentList.get(i).createParagraph().createRun().addBreak(BreakType.PAGE); // documentList.get(i).createParagraph().createRun().addBreak(BreakType.PAGE);
appendBody(doc, documentList.get(i)); appendBody(doc, documentList.get(i));
} }
} }

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

@ -76,12 +76,12 @@ public class ObjectUtils {
*/ */
public static Map LocalDateConvertMap(LocalDateTime dateTime,String prefix,String split) { public static Map LocalDateConvertMap(LocalDateTime dateTime,String prefix,String split) {
HashMap<String, Object> result = new HashMap<String, Object>() {{ HashMap<String, Object> result = new HashMap<String, Object>() {{
put(prefix + split + "year", dateTime.getYear()); put(prefix + split + "year",String.format("%02d", dateTime.getYear()));
put(prefix + split + "month", dateTime.getMonthValue()); put(prefix + split + "month",String.format("%02d",dateTime.getMonthValue()));
put(prefix + split + "day", dateTime.getDayOfMonth()); put(prefix + split + "day",String.format("%02d", dateTime.getDayOfMonth()));
put(prefix + split + "hour", dateTime.getHour()); put(prefix + split + "hour",String.format("%02d", dateTime.getHour()));
put(prefix + split + "minuter", dateTime.getMinute()); put(prefix + split + "minuter", String.format("%02d",dateTime.getMinute()));
put(prefix + split + "second", dateTime.getSecond()); put(prefix + split + "second",String.format("%02d",dateTime.getSecond()));
}}; }};
return result; return result;
} }

BIN
hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx

Binary file not shown.
Loading…
Cancel
Save