md
This commit is contained in:
parent
6c4017e1d3
commit
8472f435e5
@ -28,6 +28,7 @@ import com.xdadan.erp.common.utils.DBUtil;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybillAttachment;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybillCargo;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybillFeeitem;
|
||||
import com.xdadan.erp.emis.domain.exception.CalcFeeException;
|
||||
import com.xdadan.erp.emis.domain.vo.*;
|
||||
import com.xdadan.erp.emis.service.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -129,7 +130,12 @@ public class EmisWaybillController extends BaseController
|
||||
jObjFee.put("feeList",feeItem.cvtToVoList(emisWaybillSave.getFeeitemList()));
|
||||
|
||||
return AjaxResult.success("计算成功", jObjFee);
|
||||
}catch (Exception ex){
|
||||
}
|
||||
catch (CalcFeeException ex){
|
||||
ex.printStackTrace();
|
||||
return AjaxResult.error("("+ex.getErrorCode()+")"+ex.getMessage());
|
||||
}
|
||||
catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
return AjaxResult.error("服务器异常,联系客服");
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xdadan.erp.emis.domain.exception;
|
||||
|
||||
public class CalcFeeException extends Exception {
|
||||
|
||||
private String errorCode;
|
||||
|
||||
public CalcFeeException(String errorCode,String message) {
|
||||
super(message);
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public String getErrorCode() {
|
||||
return errorCode;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -12,6 +12,7 @@ package com.xdadan.erp.emis.service;
|
||||
import java.util.List;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybillFeeitem;
|
||||
import com.xdadan.erp.emis.domain.exception.CalcFeeException;
|
||||
import com.xdadan.erp.emis.domain.vo.WaybillOrder;
|
||||
|
||||
/**
|
||||
@ -105,7 +106,7 @@ public interface IEmisWaybillService
|
||||
|
||||
|
||||
//计算运单费用
|
||||
public void calcWaybillFee(EmisWaybill emisWaybill) throws Exception;
|
||||
public void calcWaybillFee(EmisWaybill emisWaybill) throws CalcFeeException;
|
||||
|
||||
|
||||
// 计算结算重量
|
||||
|
||||
@ -28,6 +28,7 @@ import com.xdadan.erp.common.utils.DBUtil;
|
||||
import com.xdadan.erp.common.utils.DateUtils;
|
||||
import com.xdadan.erp.common.utils.SecurityUtils;
|
||||
import com.xdadan.erp.emis.domain.*;
|
||||
import com.xdadan.erp.emis.domain.exception.CalcFeeException;
|
||||
import com.xdadan.erp.emis.domain.vo.*;
|
||||
import com.xdadan.erp.emis.mapper.EmisTransLineMapper;
|
||||
import com.xdadan.erp.emis.service.*;
|
||||
@ -354,7 +355,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void calcWaybillFee(EmisWaybill emisWaybill) throws Exception {
|
||||
public void calcWaybillFee(EmisWaybill emisWaybill) throws CalcFeeException {
|
||||
|
||||
/**
|
||||
* 计算逻辑,获取表达式进行计算
|
||||
@ -366,7 +367,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
emisWaybill.getCalcFeeType()
|
||||
)
|
||||
){
|
||||
throw new Exception("参数不整取不能计算");
|
||||
throw new CalcFeeException("E3001","参数不完整");
|
||||
}
|
||||
|
||||
List<EmisQuotePrice> emisQuotePriceList=getValidQuotePriceList(emisWaybill.getProductType(),
|
||||
@ -375,7 +376,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
|
||||
|
||||
if(CollectionUtils.isEmpty(emisQuotePriceList)){
|
||||
throw new Exception("计算失败,无有效资费");
|
||||
throw new CalcFeeException("E3002","报价未配置");
|
||||
}
|
||||
|
||||
// 根据表达式计算费用
|
||||
|
||||
Loading…
Reference in New Issue
Block a user