加保护

This commit is contained in:
sxu 2024-10-23 17:04:41 +08:00
parent ef59a9c084
commit ef283145e0
1 changed files with 2 additions and 1 deletions

View File

@ -97,7 +97,8 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
//判断提交表单中是否存在相同编码 //判断提交表单中是否存在相同编码
for (int i = 0; i < machIneDtoList.size() - 1; i++) { for (int i = 0; i < machIneDtoList.size() - 1; i++) {
for (int j = i + 1; j < machIneDtoList.size(); j++) { for (int j = i + 1; j < machIneDtoList.size(); j++) {
if (machIneDtoList.get(i).getMaCode().equals(machIneDtoList.get(j).getMaCode())) { if (StringUtils.isNotEmpty(machIneDtoList.get(i).getMaCode()) && StringUtils.isNotEmpty(machIneDtoList.get(j).getMaCode())
&& machIneDtoList.get(i).getMaCode().equals(machIneDtoList.get(j).getMaCode())) {
throw new ServiceException("列表中包含以下相同的设备编码,请修改后重新提交:" + machIneDtoList.get(i).getMaCode()); throw new ServiceException("列表中包含以下相同的设备编码,请修改后重新提交:" + machIneDtoList.get(i).getMaCode());
} }
} }