Commit 3a8bd898 authored by Lambertliu's avatar Lambertliu

fix(jg):作废功能bug修改完

parent eafb8348
......@@ -84,6 +84,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -502,11 +504,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
projectContraption.setEquCategoryName(equCategoryName);
projectContraption.setEquDefineName(equDefineName);
projectContraption.setPipelineLength(
pipelineList.stream()
.map(pipeline -> pipeline.get("pipeLength"))
.filter(Objects::nonNull)
.mapToDouble(pipeLength -> Double.parseDouble(String.valueOf(pipeLength)))
.sum()
BigDecimal.valueOf(pipelineList.stream()
.map(pipeline -> pipeline.get("pipeLength"))
.filter(Objects::nonNull)
.mapToDouble(pipeLength -> Double.parseDouble(String.valueOf(pipeLength)))
.sum())
.setScale(2, RoundingMode.HALF_UP)
.doubleValue()
);
projectContraption.setUscUnitName(companyInfoMap.get("companyName").toString());
......
......@@ -89,6 +89,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -1923,7 +1925,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
result.fluentPut("deviceList", deviceList)
.fluentPut("projectContraption", projectContraption.getProjectContraption())
.fluentPut("projectContraptionNo", projectContraption.getProjectContraptionNo())
.fluentPut("pipelineLength", projectContraption.getPipelineLength())
.fluentPut("pipelineLength", BigDecimal.valueOf(projectContraption.getPipelineLength())
.setScale(2, RoundingMode.HALF_UP)
.doubleValue())
.fluentPut("projectContraptionId", projectContraptionSeq);
if (!ValidationUtil.isEmpty(projectContraption.getCity())) {
result.fluentPut("city", projectContraption.getCity() + "_" + projectContraption.getCityName());
......
......@@ -276,110 +276,47 @@
</select>
<select id="countContraptionInUseTimesForDeleteByIntoManagement" resultType="java.lang.Integer">
SELECT
SUM(inUseNumber)
FROM (
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_equip_transfer a
LEFT JOIN tzs_jg_equip_transfer_eq b ON b.equip_transfer_id=a.sequence_nbr
LEFT JOIN idx_biz_jg_use_info c ON b.equ_id=c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND ( a.apply_status != '6617')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM
tzs_jg_use_registration a
WHERE a.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND ( a.status != '已作废')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_change_registration_unit a
LEFT JOIN tzs_jg_change_registration_unit_eq b ON b.unit_change_registration_id=a.sequence_nbr
LEFT JOIN idx_biz_jg_use_info c ON b.equ_id=c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND ( a.status != '已作废')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_enable_disable a
LEFT JOIN tzs_jg_enable_disable_eq b ON b.enable_disable_apply_id=a.sequence_nbr
LEFT JOIN idx_biz_jg_use_info c ON b.equ_id=c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND ( a.audit_status != '已作废')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_scrap_cancel a
LEFT JOIN tzs_jg_scrap_cancel_eq b ON b.equip_transfer_id=a.sequence_nbr
LEFT JOIN idx_biz_jg_use_info c ON b.equ_id=c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND ( a.audit_status != '使用单位已撤回')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_change_registration_transfer a
LEFT JOIN tzs_jg_change_registration_transfer_eq b ON b.equip_transfer_id=a.sequence_nbr
LEFT JOIN idx_biz_jg_use_info c ON b.equ_id=c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND ( a.audit_status != '使用单位已撤回')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_change_registration_name a
LEFT JOIN tzs_jg_change_registration_name_eq b ON b.name_change_registration_id=a.sequence_nbr
LEFT JOIN idx_biz_jg_use_info c ON b.equ_id=c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND ( a.audit_status != '使用单位已撤回')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM
tzs_jg_installation_notice a
WHERE a.project_contraption_id = #{projectContraptionId}
AND (a.notice_status != '6617')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_maintain_notice a
LEFT JOIN tzs_jg_maintain_notice_eq b ON b.equip_transfer_id=a.sequence_nbr
LEFT JOIN idx_biz_jg_use_info c ON b.equ_id=c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND ( a.notice_status != '6617')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_reform_notice a
LEFT JOIN tzs_jg_reform_notice_eq b ON b.equip_transfer_id=a.sequence_nbr
LEFT JOIN idx_biz_jg_use_info c ON b.equ_id=c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND ( a.notice_status != '6617')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_transfer_notice a
LEFT JOIN tzs_jg_transfer_notice_eq b ON b.equip_transfer_id=a.sequence_nbr
LEFT JOIN idx_biz_jg_use_info c ON b.equ_id=c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND ( a.notice_status != '6617')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tz_jyjc_inspection_application a
WHERE a.project_contraption_id = #{projectContraptionId}
AND ( a.status != '6617')
)
SELECT SUM(inUseNumber) FROM (
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_equip_transfer A
LEFT JOIN tzs_jg_equip_transfer_eq b ON b.equip_transfer_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.apply_status != '6617'
UNION
SELECT COUNT(1) AS inUseNumber FROM tzs_jg_use_registration A
WHERE A.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.status != '已作废'
UNION
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_change_registration_unit A
LEFT JOIN tzs_jg_change_registration_unit_eq b ON b.unit_change_registration_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.status != '已作废'
UNION
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_enable_disable A
LEFT JOIN tzs_jg_enable_disable_eq b ON b.enable_disable_apply_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.audit_status != '已作废'
UNION
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_scrap_cancel A
LEFT JOIN tzs_jg_scrap_cancel_eq b ON b.equip_transfer_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.audit_status != '使用单位已撤回'
UNION
SELECT COUNT(1) AS inUseNumber FROM tzs_jg_installation_notice A
WHERE A.project_contraption_id = #{projectContraptionId}
AND A.notice_status != '6617'
UNION
SELECT COUNT(1) AS inUseNumber FROM tz_jyjc_inspection_application A
WHERE A.project_contraption_id = #{projectContraptionId}
AND A.status != '6617'
) AS result
</select>
</mapper>
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