Commit 53403672 authored by tianbo's avatar tianbo

feat(jg): 添加装置报废查询功能并修复流程状态判断逻辑

- 新增 selectAllScrapedProIds 方法用于查询所有已报废装置ID - 修复了流程中装置查询时对空集合的判断逻辑
parent fef0c61f
......@@ -151,4 +151,6 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
List<JgUseRegistrationEq> selectListForInstallNoticeDiscard(@Param("records") List<String> records);
List<JgUseRegistrationEq> selectListForSelfDiscard(@Param("records") List<String> records);
List<String> selectAllScrapedProIds(Set<String> proIds);
}
......@@ -2135,4 +2135,17 @@
and (a.notice_status <![CDATA[ <> ]]> '6617')
and a.is_delete = 0
</select>
<select id="selectAllScrapedProIds" resultType="java.lang.String">
SELECT
ui."PROJECT_CONTRAPTION_ID" as projectContractionId
FROM idx_biz_jg_use_info ui
INNER JOIN idx_biz_jg_project_contraption pc
ON ui."PROJECT_CONTRAPTION_ID" = pc.sequence_nbr
WHERE pc.use_unit_credit_code = #{useUnitCreditCode}
AND (pc.use_registration_code IS NOT NULL OR pc.is_first_merge = true)
GROUP BY ui."PROJECT_CONTRAPTION_ID"
HAVING COUNT(*) = SUM(CASE WHEN ui."EQU_STATE" = '3' THEN 1 ELSE 0 END)
AND COUNT(*) > 0
</select>
</mapper>
......@@ -5011,7 +5011,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 查询流程中的装置
List<JgUseRegistration> flowIngPros = this.list(new LambdaQueryWrapper<JgUseRegistration>().notIn(JgUseRegistration::getStatus, NOT_FLOWING_STATE).select(BaseEntity::getSequenceNbr, JgUseRegistration::getProjectContraptionId));
Set<String> proIds = flowIngPros.stream().map(JgUseRegistration::getProjectContraptionId).collect(toSet());
if (ValidationUtil.isEmpty(proIds)) {
if (!ValidationUtil.isEmpty(proIds)) {
proIds.remove(null);
proIds.remove("");
}
......@@ -5052,7 +5052,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.collect(toSet());
if (!ValidationUtil.isEmpty(proIds)) {
// 同时需排除所有管道都已报废的装置id
List<String> allScrapedProIds = Lists.newArrayList();
List<String> allScrapedProIds = this.baseMapper.selectAllScrapedProIds(proIds);
proIds.addAll(allScrapedProIds);
proIds.remove(null);
proIds.remove("");
......
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