Commit 7dacd2b3 authored by 韩桐桐's avatar 韩桐桐

fix(jg):压力管道打印安装告知书调整

parent 31a4333a
...@@ -612,14 +612,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -612,14 +612,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
List<JgInstallationNoticeEq> equList = jgInstallationNoticeEqService.lambdaQuery().eq(JgInstallationNoticeEq::getEquipTransferId, jgInstallationNotice.getSequenceNbr()).list(); List<JgInstallationNoticeEq> equList = jgInstallationNoticeEqService.lambdaQuery().eq(JgInstallationNoticeEq::getEquipTransferId, jgInstallationNotice.getSequenceNbr()).list();
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
ArrayList<Map<String, Object>> maps = new ArrayList<>(); ArrayList<Map<String, Object>> maps = new ArrayList<>();
equList.forEach(equ -> { // 管道按照装置打一份告知书
List<Map<String, Object>> informationList = jgInstallationNoticeMapper.queryEquipInformation(equ.getSequenceNbr()); if ("8000".equals(jgInstallationNotice.getEquListCode()) && !equList.isEmpty()) {
List<Map<String, Object>> informationList = jgInstallationNoticeMapper.queryEquipInformation(equList.get(0).getSequenceNbr());
if (CollectionUtils.isEmpty(informationList)) { if (CollectionUtils.isEmpty(informationList)) {
throw new IllegalArgumentException("安装告知单不存在"); throw new IllegalArgumentException("安装告知单不存在");
} }
Map<String, Object> placeholders = fullFillTemplateObj(informationList, BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName().substring(0, 2)); Map<String, Object> placeholders = fullFillTemplateObj(informationList, BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName().substring(0, 2));
maps.add(placeholders); maps.add(placeholders);
}); } else {
equList.forEach(equ -> {
List<Map<String, Object>> informationList = jgInstallationNoticeMapper.queryEquipInformation(equ.getSequenceNbr());
if (CollectionUtils.isEmpty(informationList)) {
throw new IllegalArgumentException("安装告知单不存在");
}
Map<String, Object> placeholders = fullFillTemplateObj(informationList, BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName().substring(0, 2));
maps.add(placeholders);
});
}
String tempFileName = "安装告知单_" + System.currentTimeMillis() + "_temp"; String tempFileName = "安装告知单_" + System.currentTimeMillis() + "_temp";
// String url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders); // String url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders);
...@@ -633,7 +644,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -633,7 +644,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
public Map<String, Object> fullFillTemplateObj(List<Map<String, Object>> informationList, String businessType) { public Map<String, Object> fullFillTemplateObj(List<Map<String, Object>> informationList, String businessType) {
Map<String, Object> informObj = informationList.get(0); Map<String, Object> informObj = informationList.get(0);
String sequenceNbr = String.valueOf(informObj.get("sequenceNbr"));
String useCode = String.valueOf(informObj.get("installUnitCreditCode")); String useCode = String.valueOf(informObj.get("installUnitCreditCode"));
LambdaQueryWrapper<TzBaseUnitLicence> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TzBaseUnitLicence> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzBaseUnitLicence::getUnitCode, useCode); wrapper.eq(TzBaseUnitLicence::getUnitCode, useCode);
...@@ -672,9 +683,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -672,9 +683,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
placeholders.put("equList", getValue.apply("equList")); placeholders.put("equList", getValue.apply("equList"));
placeholders.put("installUnitName", getValue.apply("installUnitName")); placeholders.put("installUnitName", getValue.apply("installUnitName"));
placeholders.put("informNumber", getValue.apply("informNumber")); placeholders.put("informNumber", getValue.apply("informNumber"));
placeholders.put("productName", getValue.apply("productName"));
placeholders.put("equipCode", getValue.apply("equRegisterCode")); placeholders.put("equipCode", getValue.apply("equRegisterCode"));
placeholders.put("produceCode", getValue.apply("factoryNum")); // 出厂编号
placeholders.put("produceUnitName", getValue.apply("produceUnitName")); placeholders.put("produceUnitName", getValue.apply("produceUnitName"));
placeholders.put("produceLicenseNum", getValue.apply("produceLicenseNum")); placeholders.put("produceLicenseNum", getValue.apply("produceLicenseNum"));
placeholders.put("installUnitAddress", getValue.apply("installUnitAddress")); // 施工单位地址 placeholders.put("installUnitAddress", getValue.apply("installUnitAddress")); // 施工单位地址
...@@ -688,11 +697,18 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -688,11 +697,18 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
placeholders.put("useUnitLeaderPhone", getValue.apply("safetyManagerPhone")); placeholders.put("useUnitLeaderPhone", getValue.apply("safetyManagerPhone"));
placeholders.put("useUnitLeaderAddress", getValue.apply("useUnitLeaderAddress")); placeholders.put("useUnitLeaderAddress", getValue.apply("useUnitLeaderAddress"));
if ("压力管道".equals(getValue.apply("equList"))) { if ("压力管道".equals(getValue.apply("equList"))) {
ArrayList<String> equipTypeList = new ArrayList<>();// todo JgRegistrationHistory history = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>().eq(JgRegistrationHistory::getCurrentDocumentId, sequenceNbr));
equipTypeList.add("123123"); JSONObject historyJson = JSON.parseObject(history.getChangeData());
List<Map<String, Object>> deviceList = (List<Map<String, Object>>) historyJson.get("deviceList");
List<Object> equipTypeList = deviceList.stream().limit(3).map(item -> item.get("pipelineNumber") + "(" + item.get("nominalDiameter") + "/" + item.get("wallThickness") + "/" + item.get("pipeLength") + ")").collect(Collectors.toList());
List<Object> factoryNumList = deviceList.stream().limit(3).map(item -> item.get("pipelineNumber")).collect(Collectors.toList());
placeholders.put("equipTypeList", equipTypeList); placeholders.put("equipTypeList", equipTypeList);
placeholders.put("produceCodeList", factoryNumList);
placeholders.put("productName", historyJson.get("projectContraption"));
} else { } else {
placeholders.put("equipType", getValue.apply("equType")); placeholders.put("equipType", getValue.apply("equType"));
placeholders.put("produceCode", getValue.apply("factoryNum"));
placeholders.put("productName", getValue.apply("productName"));
} }
......
...@@ -1407,61 +1407,277 @@ ...@@ -1407,61 +1407,277 @@
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
<w:tc> <#if equipList.equList?string != '压力管道'>
<w:tcPr> <w:tc>
<w:tcW w:w="1680" w:type="pct"/> <w:tcPr>
<w:gridSpan w:val="2"/> <w:tcW w:w="1680" w:type="pct"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/> <w:gridSpan w:val="2"/>
<w:noWrap w:val="0"/> <w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:vAlign w:val="center"/> <w:noWrap w:val="0"/>
</w:tcPr> <w:vAlign w:val="center"/>
<w:p> </w:tcPr>
<w:pPr> <w:p>
<w:keepNext w:val="off"/> <w:pPr>
<w:keepLines w:val="off"/> <w:keepNext w:val="off"/>
<w:pageBreakBefore w:val="off"/> <w:keepLines w:val="off"/>
<w:widowControl w:val="off"/> <w:pageBreakBefore w:val="off"/>
<w:kinsoku/> <w:widowControl w:val="off"/>
<w:wordWrap/> <w:kinsoku/>
<w:overflowPunct/> <w:wordWrap/>
<w:topLinePunct w:val="off"/> <w:overflowPunct/>
<w:autoSpaceDE/> <w:topLinePunct w:val="off"/>
<w:autoSpaceDN/> <w:autoSpaceDE/>
<w:adjustRightInd/> <w:autoSpaceDN/>
<w:snapToGrid/> <w:adjustRightInd/>
<w:spacing w:line="240" w:line-rule="auto"/> <w:snapToGrid/>
<w:jc w:val="left"/> <w:spacing w:line="240" w:line-rule="auto"/>
<w:textAlignment w:val="auto"/> <w:jc w:val="left"/>
<w:rPr> <w:textAlignment w:val="auto"/>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/> <w:rPr>
<w:b/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:i w:val="off"/> <w:b-cs/>
<w:i-cs w:val="off"/> <w:i w:val="off"/>
<w:color w:val="262626"/> <w:i-cs w:val="off"/>
<w:kern w:val="0"/> <w:color w:val="262626"/>
<w:sz w:val="21"/> <w:kern w:val="0"/>
<w:sz-cs w:val="21"/> <w:sz w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz-cs w:val="21"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:pPr> </w:rPr>
<w:r> </w:pPr>
<w:rPr> <w:r>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/> <w:rPr>
<w:b/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:i w:val="off"/> <w:b-cs/>
<w:i-cs w:val="off"/> <w:i w:val="off"/>
<w:color w:val="262626"/> <w:i-cs w:val="off"/>
<w:kern w:val="0"/> <w:color w:val="262626"/>
<w:sz w:val="21"/> <w:kern w:val="0"/>
<w:sz-cs w:val="21"/> <w:sz w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz-cs w:val="21"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
<w:t>${(equipList.produceCode)!''}</w:t> </w:rPr>
</w:r> <w:t>${(equipList.produceCode)!''}</w:t>
</w:p> </w:r>
</w:tc> </w:p>
</w:tc>
</#if>
<#if equipList.equList?string = '压力管道'>
<w:tc>
<w:tcPr>
<w:tcW w:w="1680" w:type="pct"/>
<w:gridSpan w:val="2"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:noWrap w:val="0"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p>
<w:pPr>
<w:keepNext w:val="off"/>
<w:keepLines w:val="off"/>
<w:pageBreakBefore w:val="off"/>
<w:widowControl w:val="off"/>
<w:kinsoku/>
<w:wordWrap/>
<w:overflowPunct/>
<w:topLinePunct w:val="off"/>
<w:autoSpaceDE/>
<w:autoSpaceDN/>
<w:adjustRightInd/>
<w:snapToGrid/>
<w:spacing w:line="240" w:line-rule="auto"/>
<w:jc w:val="left"/>
<w:textAlignment w:val="auto"/>
<w:rPr>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b/>
<w:b-cs/>
<w:i w:val="off"/>
<w:i-cs w:val="off"/>
<w:color w:val="262626"/>
<w:kern w:val="0"/>
<w:sz w:val="21"/>
<w:sz-cs w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:rPr>
</w:pPr>
<#if equipList.produceCodeList?size == 1>
<#list equipList.produceCodeList as item1>
<w:r>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体" w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${item1}</w:t>
</w:r>
</#list>
</#if>
<#if equipList.produceCodeList?size == 2>
<#list equipList.produceCodeList as item1>
<w:tr>
<w:tblPrEx>
<w:tblBorders>
<w:top w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:left w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:bottom w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:right w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
</w:tblBorders>
<w:tblCellMar>
<w:top w:w="0" w:type="dxa"/>
<w:left w:w="108" w:type="dxa"/>
<w:bottom w:w="0" w:type="dxa"/>
<w:right w:w="108" w:type="dxa"/>
</w:tblCellMar>
</w:tblPrEx>
<w:trPr>
<w:trHeight w:val="490" w:hRule="atLeast"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="1340" w:type="dxa"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p>
<w:pPr>
<w:spacing w:line="240" w:lineRule="auto"/>
<w:jc w:val="left"/>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${item1}</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</#list>
</#if>
<#if equipList.produceCodeList?size == 3>
<#list equipList.produceCodeList as item1>
<w:tr>
<w:tblPrEx>
<w:tblBorders>
<w:top w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:left w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:bottom w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:right w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
</w:tblBorders>
<w:tblCellMar>
<w:top w:w="0" w:type="dxa"/>
<w:left w:w="108" w:type="dxa"/>
<w:bottom w:w="0" w:type="dxa"/>
<w:right w:w="108" w:type="dxa"/>
</w:tblCellMar>
</w:tblPrEx>
<w:trPr>
<w:trHeight w:val="321" w:hRule="atLeast"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="1349" w:type="dxa"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p>
<w:pPr>
<w:spacing w:line="240" w:lineRule="auto"/>
<w:jc w:val="left"/>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${item1}</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</#list>
</#if>
</w:p>
</w:tc>
</#if>
</w:tr> </w:tr>
<w:tr> <w:tr>
<w:tblPrEx> <w:tblPrEx>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment