bug 5803
This commit is contained in:
parent
faf6075b08
commit
3a160c97f8
|
|
@ -70,7 +70,7 @@ public class AllocAreaServiceImpl implements IAllocAreaService {
|
|||
}
|
||||
return allocAreaMapper.insertAllocArea(allocArea);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("新增异常," + e.getMessage());
|
||||
throw new ServiceException("新增区域异常," + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -84,9 +84,15 @@ public class AllocAreaServiceImpl implements IAllocAreaService {
|
|||
public int updateAllocArea(AllocArea allocArea) {
|
||||
allocArea.setUpdateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
List<AllocArea> allAreaList = allocAreaMapper.selectAllocAreaList(new AllocArea());
|
||||
List<String> otherAreaNameList = allAreaList.stream().filter(item -> !item.getAreaId().equals(allocArea.getAreaId()))
|
||||
.map(AllocArea::getAreaName).collect(Collectors.toList());
|
||||
if (otherAreaNameList.contains(allocArea.getAreaName())) {
|
||||
throw new ServiceException("区域名称已存在");
|
||||
}
|
||||
return allocAreaMapper.updateAllocArea(allocArea);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
throw new ServiceException("更新区域失败," + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue