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 7940416..3b46de4 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 @@ -118,10 +118,10 @@ public class OperationTicketServiceImpl implements OperationTicketService { //获取站点编号 String signage = station.getSignage(); - if (StringUtils.isBlank(signage) || signage.length() < 2) { + if (StringUtils.isBlank(signage)) { throw new ServiceException("票据抬头未配置,请您到站点管理配置"); } - signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2); + //signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2); standardTicketInfoVo.setSignage(signage); standardTicketInfoVo.setSignageCode(station.getCode()); @@ -168,8 +168,9 @@ public class OperationTicketServiceImpl implements OperationTicketService { try { JSONObject jsonObject = JSONObject.parseObject(formData); // standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class); - standardTicketInfoVo = JSONObject.parseObject(jsonObject.getString("standardTicketInfoVo"), - new TypeReference(){}); + standardTicketInfoVo = JSONObject.parseObject(jsonObject.getString("standardTicketInfoVo"), + new TypeReference() { + }); } catch (Exception e) { log.error("获取表单出现异常了~~~~"); e.printStackTrace(); @@ -401,10 +402,10 @@ public class OperationTicketServiceImpl implements OperationTicketService { result = "DZ"; break; case "4": - result = type; + result = "KJ"; break; case "5": - result = type; + result = "TJ"; break; default: result = "DZ"; @@ -433,6 +434,11 @@ public class OperationTicketServiceImpl implements OperationTicketService { Map workTicketInfoMap = this.convertMap(standardTicketInfoVo); //导入下在word Map resultMap = OperationWordHelper.resultMap(workTicketInfoMap); + + + String name = getBuilder(standardTicketInfoVo.getTicketType()); + resultMap.put("headTitle", name); + String workTicketStatus = OperationWordHelper.getWorkTicketStatus(status); String os = TicketConstant.OS_NAME; //Windows操作系统 @@ -453,6 +459,32 @@ public class OperationTicketServiceImpl implements OperationTicketService { /** + * 获取操作票的名称 + * + * @param ticketType + * @return + */ + private String getBuilder(String ticketType) { + String result = null; + switch (ticketType) { + case "3": + result = "倒闸"; + break; + case "4": + result = "开机"; + break; + case "5": + result = "停机"; + break; + default: + result = "倒闸"; + break; + } + return result; + } + + + /** * 将查询的数据转换为map * * @param standardTicketInfoVo diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java index 1d8c7fa..eee0811 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java @@ -188,10 +188,10 @@ public class TicketProcessServiceImpl implements TicketProcessService { //获取站点编号 String signage = station.getSignage(); - if (StringUtils.isBlank(signage) || signage.length() < 2) { + if (StringUtils.isBlank(signage)) { throw new ServiceException("票据抬头未配置,请您到站点管理配置"); } - signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2); + //signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2); workTicketVo.getWorkTicket().setSignage(station.getSignage()); workTicketVo.getWorkTicket().setSignageCode(station.getCode()); diff --git a/hzims-service/ticket/src/main/resources/template/电气操作票.docx b/hzims-service/ticket/src/main/resources/template/电气操作票.docx index 18d85af..3272f23 100644 Binary files a/hzims-service/ticket/src/main/resources/template/电气操作票.docx and b/hzims-service/ticket/src/main/resources/template/电气操作票.docx differ