Commit ed09931b authored by lisong's avatar lisong

修复监管码导出重复问题

parent 3e730809
...@@ -487,6 +487,9 @@ public class EquipmentCategoryController extends BaseController { ...@@ -487,6 +487,9 @@ public class EquipmentCategoryController extends BaseController {
zipFile.delete(); zipFile.delete();
} }
List<Object> code96333 = equipExportData.stream().filter(item -> !ObjectUtils.isEmpty(item.get("CODE96333"))).map(item -> item.get("CODE96333")).collect(Collectors.toList()); List<Object> code96333 = equipExportData.stream().filter(item -> !ObjectUtils.isEmpty(item.get("CODE96333"))).map(item -> item.get("CODE96333")).collect(Collectors.toList());
if (ObjectUtils.isEmpty(code96333) && ImageSizeEnums.DT.getCode().equals(type)){
throw new FileDownLoadException("96333码为空!");
}
if (!ObjectUtils.isEmpty(code96333)) { if (!ObjectUtils.isEmpty(code96333)) {
LambdaQueryWrapper<IdxBizJgOtherInfo> lambda = new QueryWrapper<IdxBizJgOtherInfo>().lambda(); LambdaQueryWrapper<IdxBizJgOtherInfo> lambda = new QueryWrapper<IdxBizJgOtherInfo>().lambda();
lambda.eq(IdxBizJgOtherInfo::getClaimStatus, "已认领"); lambda.eq(IdxBizJgOtherInfo::getClaimStatus, "已认领");
...@@ -498,7 +501,7 @@ public class EquipmentCategoryController extends BaseController { ...@@ -498,7 +501,7 @@ public class EquipmentCategoryController extends BaseController {
// if (!ObjectUtils.isEmpty(strings) && strings.size() != strings1.size()){ // if (!ObjectUtils.isEmpty(strings) && strings.size() != strings1.size()){
// throw new FileDownLoadException("96333码存在重复数据,请联系管理员!"); // throw new FileDownLoadException("96333码存在重复数据,请联系管理员!");
// } // }
if (code96333.size()!=strings1.size()) { if (code96333.size()!=strings1.size() || idxBizJgOtherInfos.size() != code96333.size()) {
throw new FileDownLoadException("96333码存在重复数据,请联系管理员!"); throw new FileDownLoadException("96333码存在重复数据,请联系管理员!");
} }
} }
...@@ -511,7 +514,7 @@ public class EquipmentCategoryController extends BaseController { ...@@ -511,7 +514,7 @@ public class EquipmentCategoryController extends BaseController {
List<IdxBizJgOtherInfo> idxBizJgOtherInfos = idxBizJgOtherInfoMapper.selectList(lambda); List<IdxBizJgOtherInfo> idxBizJgOtherInfos = idxBizJgOtherInfoMapper.selectList(lambda);
List<String> collect = idxBizJgOtherInfos.stream().map(IdxBizJgOtherInfo::getSupervisoryCode).collect(Collectors.toList()); List<String> collect = idxBizJgOtherInfos.stream().map(IdxBizJgOtherInfo::getSupervisoryCode).collect(Collectors.toList());
HashSet<String> strings1 = new HashSet<>(collect); HashSet<String> strings1 = new HashSet<>(collect);
if (supervisoryCode.size() != strings1.size()) { if (supervisoryCode.size() != strings1.size() || supervisoryCode.size() != idxBizJgOtherInfos.size()) {
throw new FileDownLoadException("监管码存在重复数据,请联系管理员!"); throw new FileDownLoadException("监管码存在重复数据,请联系管理员!");
} }
} }
......
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