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