Commit b3034ef6 authored by qiankunpingtai's avatar qiankunpingtai
Browse files

修改异常提示

parent d676e258
...@@ -428,21 +428,22 @@ public class SerialNumberService { ...@@ -428,21 +428,22 @@ public class SerialNumberService {
public void checkAndUpdateSerialNumber(DepotItem depotItem,User userInfo) throws Exception{ public void checkAndUpdateSerialNumber(DepotItem depotItem,User userInfo) throws Exception{
if(depotItem!=null){ if(depotItem!=null){
//查询商品下已分配的可用序列号数量 //查询商品下已分配的可用序列号数量
int serialNumberSum=0;
try{ try{
int SerialNumberSum= serialNumberMapperEx.countSerialNumberByMaterialIdAndDepotheadId(depotItem.getMaterialid(),null,BusinessConstants.IS_SELL_HOLD); serialNumberSum= serialNumberMapperEx.countSerialNumberByMaterialIdAndDepotheadId(depotItem.getMaterialid(),null,BusinessConstants.IS_SELL_HOLD);
//BasicNumber=OperNumber*ratio //BasicNumber=OperNumber*ratio
if((depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue()>SerialNumberSum){
//获取商品名称
Material material= materialMapper.selectByPrimaryKey(depotItem.getMaterialid());
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE,
String.format(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG,material==null?"":material.getName()));
}
}catch(Exception e){ }catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]", logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
ExceptionConstants.DATA_READ_FAIL_MSG); ExceptionConstants.DATA_READ_FAIL_MSG);
} }
if((depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue()>serialNumberSum){
//获取商品名称
Material material= materialMapper.selectByPrimaryKey(depotItem.getMaterialid());
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE,
String.format(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG,material==null?"":material.getName()));
}
//商品下序列号充足,分配序列号 //商品下序列号充足,分配序列号
sellSerialNumber(depotItem.getMaterialid(),depotItem.getHeaderid(),(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue(),userInfo); sellSerialNumber(depotItem.getMaterialid(),depotItem.getHeaderid(),(depotItem.getBasicnumber()==null?0:depotItem.getBasicnumber()).intValue(),userInfo);
......
Supports Markdown
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