Commit e7ff021e authored by tianbo's avatar tianbo

fix(module-jg): 优化设备信息表单提交校验逻辑- 修改 OtherInfoMapper 类型为 IdxBizJgOtherInfoMapper

- 在检查 96333 码唯一性时,排除待认领、已拒领和草稿状态的记录
parent e19ac257
......@@ -196,7 +196,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired
IdxBizJgRegisterInfoMapper idxBizJgRegisterInfoMapper;
@Autowired
OtherInfoMapper otherInfoMapper;
IdxBizJgOtherInfoMapper otherInfoMapper;
@Autowired
IIdxBizJgUseInfoService idxBizJgUseInfoService;
@Autowired
......@@ -888,9 +888,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private void check96333Code(LinkedHashMap equipmentInfoForm) {
if (!ObjectUtils.isEmpty(equipmentInfoForm.get(CODE96333))) {
// 根据96333码检查唯一性
LambdaQueryWrapper<OtherInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OtherInfo::getCode96333, equipmentInfoForm.get(CODE96333));
wrapper.ne(!ObjectUtils.isEmpty(equipmentInfoForm.get(OTHERINFO_SEQ)), OtherInfo::getSequenceNbr, equipmentInfoForm.get(OTHERINFO_SEQ));
LambdaQueryWrapper<IdxBizJgOtherInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IdxBizJgOtherInfo::getCode96333, equipmentInfoForm.get(CODE96333));
wrapper.notIn(IdxBizJgOtherInfo::getClaimStatus, "待认领,已拒领,草稿");
wrapper.ne(!ObjectUtils.isEmpty(equipmentInfoForm.get(OTHERINFO_SEQ)), IdxBizJgOtherInfo::getSequenceNbr, equipmentInfoForm.get(OTHERINFO_SEQ));
Integer count = otherInfoMapper.selectCount(wrapper);
if (count > 0) {
throw new BadRequest("96333码已存在,请确认后重新输入!");
......
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