Commit e34f0033 authored by Lambertliu's avatar Lambertliu

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents ca90df08 7dacd2b3
......@@ -612,14 +612,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
List<JgInstallationNoticeEq> equList = jgInstallationNoticeEqService.lambdaQuery().eq(JgInstallationNoticeEq::getEquipTransferId, jgInstallationNotice.getSequenceNbr()).list();
HashMap<String, Object> map = new HashMap<>();
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)) {
throw new IllegalArgumentException("安装告知单不存在");
}
Map<String, Object> placeholders = fullFillTemplateObj(informationList, BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName().substring(0, 2));
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 url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders);
......@@ -633,7 +644,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
public Map<String, Object> fullFillTemplateObj(List<Map<String, Object>> informationList, String businessType) {
Map<String, Object> informObj = informationList.get(0);
String sequenceNbr = String.valueOf(informObj.get("sequenceNbr"));
String useCode = String.valueOf(informObj.get("installUnitCreditCode"));
LambdaQueryWrapper<TzBaseUnitLicence> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzBaseUnitLicence::getUnitCode, useCode);
......@@ -672,9 +683,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
placeholders.put("equList", getValue.apply("equList"));
placeholders.put("installUnitName", getValue.apply("installUnitName"));
placeholders.put("informNumber", getValue.apply("informNumber"));
placeholders.put("productName", getValue.apply("productName"));
placeholders.put("equipCode", getValue.apply("equRegisterCode"));
placeholders.put("produceCode", getValue.apply("factoryNum")); // 出厂编号
placeholders.put("produceUnitName", getValue.apply("produceUnitName"));
placeholders.put("produceLicenseNum", getValue.apply("produceLicenseNum"));
placeholders.put("installUnitAddress", getValue.apply("installUnitAddress")); // 施工单位地址
......@@ -688,11 +697,18 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
placeholders.put("useUnitLeaderPhone", getValue.apply("safetyManagerPhone"));
placeholders.put("useUnitLeaderAddress", getValue.apply("useUnitLeaderAddress"));
if ("压力管道".equals(getValue.apply("equList"))) {
ArrayList<String> equipTypeList = new ArrayList<>();// todo
equipTypeList.add("123123");
JgRegistrationHistory history = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>().eq(JgRegistrationHistory::getCurrentDocumentId, sequenceNbr));
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("produceCodeList", factoryNumList);
placeholders.put("productName", historyJson.get("projectContraption"));
} else {
placeholders.put("equipType", getValue.apply("equType"));
placeholders.put("produceCode", getValue.apply("factoryNum"));
placeholders.put("productName", getValue.apply("productName"));
}
......
......@@ -1407,61 +1407,277 @@
</w:r>
</w:p>
</w:tc>
<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>
<w:r>
<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:t>${(equipList.produceCode)!''}</w:t>
</w:r>
</w:p>
</w:tc>
<#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>
<w:r>
<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:t>${(equipList.produceCode)!''}</w:t>
</w:r>
</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: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