Commit c4faf3ed authored by suhuiguang's avatar suhuiguang

1.告知类业务出去安装告知,增加约束,只有有使用登记证且纳管状态的才可以做业务

parent 21c93758
......@@ -1331,21 +1331,25 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
BoolQueryBuilder wbBuilder = QueryBuilders.boolQuery();
wbBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE"));
boolMust.must(wbBuilder);
} else if (!ObjectUtils.isEmpty(queryType) && ValidationUtil.equals(queryType, "SY")) {
} else if (ValidationUtil.equals(queryType, "SY")) {
// 查询 使用登记【可选设备列表】【(EQU_STATUS=== null || "" ) && (USE_ORG_CODE(使用登记证编号) ==="" || null)】
BoolQueryBuilder syBuilder = QueryBuilders.boolQuery();
syBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE"));
syBuilder.mustNot(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"));
boolMust.must(syBuilder);
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegister");
}
// 注意:上面条件是过滤出【未做过】某个业务的设备,下面部分是过滤出【做过】某个业务的设备
else if(!ObjectUtils.isEmpty(queryType) && ValidationUtil.equals(queryType, "FINISH_SY")){
} else if(ValidationUtil.equals(queryType, "FINISH_SY")){
// 注意:上面条件是过滤出【未做过】某个业务的设备,下面部分是过滤出【做过】某个业务的设备
// 查询 已经做过【使用登记】 的设备 【(EQU_STATUS != 空 ) && (USE_ORG_CODE(使用登记证编号) != 空)】
BoolQueryBuilder syBuilder = QueryBuilders.boolQuery();
syBuilder.must(QueryBuilders.existsQuery("EQU_STATE"))
.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"));
boolMust.must(syBuilder);
} else if(ValidationUtil.equals(queryType, "GZ_GZ") || ValidationUtil.equals(queryType, "GZ_WX") || ValidationUtil.equals(queryType, "GZ_YZ")){
BoolQueryBuilder syBuilder = QueryBuilders.boolQuery();
syBuilder.must(QueryBuilders.existsQuery("EQU_STATE"));
syBuilder.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"));
boolMust.must(syBuilder);
}
}
......
......@@ -118,8 +118,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
@Autowired
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
@Autowired
private IdxBizJgUseInfoMapper idxBizJgUseInfoMapper;
/**
* 根据sequenceNbr查询
*
......@@ -408,11 +407,6 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
if (CollectionUtils.isEmpty(deviceList)) {
throw new BadRequest("请选择设备");
}
List<String> sequenceNbrList = deviceList.stream().map(t -> (String) t.get("SEQUENCE_NBR")).collect(Collectors.toList());
int equipCount = idxBizJgUseInfoMapper.countByRecords(sequenceNbrList);
if(sequenceNbrList.size() != equipCount){
throw new BadRequest("请先完成使用登记");
}
// 获取告知单号
ResponseModel<List<String>> applyNoResult = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.WXGZ.getCode(), deviceList.size());
......
......@@ -106,8 +106,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
private RedissonClient redissonClient;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
@Autowired
private IdxBizJgUseInfoMapper idxBizJgUseInfoMapper;
/**
* 根据sequenceNbr查询
*
......@@ -362,11 +361,6 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
if (CollectionUtils.isEmpty(deviceList)) {
throw new BadRequest("请选择设备!");
}
List<String> sequenceNbrList = deviceList.stream().map(t -> (String) t.get("SEQUENCE_NBR")).collect(Collectors.toList());
int equipCount = idxBizJgUseInfoMapper.countByRecords(sequenceNbrList);
if(sequenceNbrList.size() != equipCount){
throw new BadRequest("请先完成使用登记");
}
// 获取告知单号
ResponseModel<List<String>> codeResult = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.GZGZ.getCode(), deviceList.size());
List<String> applyNoList = null;
......
......@@ -396,11 +396,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
if (CollectionUtils.isEmpty(deviceList)) {
return new ArrayList<>();
}
List<String> sequenceNbrList = deviceList.stream().map(t -> (String) t.get("SEQUENCE_NBR")).collect(Collectors.toList());
int equipCount = idxBizJgUseInfoMapper.countByRecords(sequenceNbrList);
if(sequenceNbrList.size() != equipCount){
throw new BadRequest("请先完成使用登记");
}
// 获取告知单号
ResponseModel<List<String>> responseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.YZGZ.getCode(), deviceList.size());
if (CollectionUtils.isEmpty(responseModel.getResult())) {
......
......@@ -13,6 +13,4 @@ import java.util.List;
*/
public interface IdxBizJgUseInfoMapper extends BaseMapper<IdxBizJgUseInfo> {
void batchUpdateUseInfo(@Param("records") List<String> records, Integer code);
int countByRecords(@Param("sequenceNbrList") List<String> sequenceNbrList);
}
......@@ -8,10 +8,4 @@
#{record}
</foreach>
</update>
<select id="countByRecords" resultType="java.lang.Integer">
SELECT COUNT(1) FROM idx_biz_jg_use_info WHERE "RECORD" IN
<foreach collection="sequenceNbrList" separator="," item="record" open="(" close=")">
#{record}
</foreach>
</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