仓库重名报错

This commit is contained in:
sxu 2024-10-16 18:59:09 +08:00
parent 18013a2e0f
commit 6623d7e57f
2 changed files with 10 additions and 2 deletions

View File

@ -110,7 +110,11 @@ public class WhHouseInfoController extends BaseController {
@SysLog(title = "仓库管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改仓库管理") @SysLog(title = "仓库管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改仓库管理")
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody WhHouseInfo whHouseInfo) { public AjaxResult edit(@RequestBody WhHouseInfo whHouseInfo) {
return toAjax(whHouseInfoService.updateWhHouseInfo(whHouseInfo)); try {
return toAjax(whHouseInfoService.updateWhHouseInfo(whHouseInfo));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
} }
/** /**

View File

@ -71,7 +71,11 @@ public class WhHouseInfoServiceImpl implements IWhHouseInfoService
public int updateWhHouseInfo(WhHouseInfo whHouseInfo) public int updateWhHouseInfo(WhHouseInfo whHouseInfo)
{ {
whHouseInfo.setUpdateTime(DateUtils.getNowDate()); whHouseInfo.setUpdateTime(DateUtils.getNowDate());
return whHouseInfoMapper.updateWhHouseInfo(whHouseInfo); try {
return whHouseInfoMapper.updateWhHouseInfo(whHouseInfo);
} catch (Exception e) {
throw new ServiceException("数据库错误或仓库重名");
}
} }
/** /**