dm
This commit is contained in:
parent
293f424070
commit
6592fb2599
@ -100,7 +100,7 @@ public interface IEmisTmsCostFeeService
|
||||
* @return
|
||||
* @throws EmisBizError
|
||||
*/
|
||||
public int reCalcSplitCostFee(String costNo) throws EmisBizError;
|
||||
public int reCalcSplitCostFee(String costNo,String billCode) throws EmisBizError;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -30,6 +30,7 @@ import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -390,7 +391,6 @@ public class EmisTmsCostFeeServiceImpl implements IEmisTmsCostFeeService
|
||||
|
||||
log.info("网点机场短驳费:计算公式:" + calcExprStr + ",重量:" + waybill.getBillWeight().stripTrailingZeros().toPlainString());
|
||||
|
||||
|
||||
splitItem.setCostFee(BigDecimal.valueOf(costFee));
|
||||
splitItem.setCalcExpr(calcExprStr);
|
||||
splitItem.setCalcRemark(calcExprStr+"="+String.valueOf(costFee));
|
||||
@ -431,7 +431,7 @@ public class EmisTmsCostFeeServiceImpl implements IEmisTmsCostFeeService
|
||||
if(!CollectionUtil.isEmpty(listCostFee)){
|
||||
for(EmisTmsCostFee item:listCostFee){
|
||||
try {
|
||||
reCalcSplitCostFee(item.getCostNo());
|
||||
reCalcSplitCostFee(item.getCostNo(),null);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
@ -539,7 +539,7 @@ public class EmisTmsCostFeeServiceImpl implements IEmisTmsCostFeeService
|
||||
* @throws EmisBizError
|
||||
*/
|
||||
@Override
|
||||
public int reCalcSplitCostFee(String costNo) throws EmisBizError {
|
||||
public int reCalcSplitCostFee(String costNo,String calcBillCode) throws EmisBizError {
|
||||
// 获取最新的数据
|
||||
EmisTmsCostFee oldCostFee = emisTmsCostFeeMapper.selectEmisTmsCostFeeByCostNo(costNo);
|
||||
// /* 总票数 总重量 总体积 */
|
||||
@ -562,13 +562,17 @@ public class EmisTmsCostFeeServiceImpl implements IEmisTmsCostFeeService
|
||||
}
|
||||
|
||||
// 删除与该成本关联的费用
|
||||
emisTmsCostFeeSplitMapper.deleteEmisTmsCostFeeSplitByCostNo(costNo);
|
||||
if(StringUtils.isEmpty(calcBillCode)) {
|
||||
emisTmsCostFeeSplitMapper.deleteEmisTmsCostFeeSplitByCostNo(costNo);
|
||||
}else{
|
||||
emisTmsCostFeeSplitMapper.deleteEmisTmsCostFeeSplitByBillCode(calcBillCode);
|
||||
}
|
||||
|
||||
Integer pieceNumber = 0;
|
||||
// 计算总重量
|
||||
for (CostFeeWaybillRel billCodeRel: listBillCodeRel) {
|
||||
for (CostFeeWaybillRel billCodeItem: listBillCodeRel) {
|
||||
// 获取运单信息
|
||||
EmisWaybill emisWaybill=billCodeRel.getWaybillDetail();
|
||||
EmisWaybill emisWaybill=billCodeItem.getWaybillDetail();
|
||||
// 累加应收
|
||||
totalWeight=totalWeight.add(emisWaybill.getBillWeight());
|
||||
totalVolume=totalVolume.add(emisWaybill.getTotalVolume());
|
||||
@ -578,8 +582,14 @@ public class EmisTmsCostFeeServiceImpl implements IEmisTmsCostFeeService
|
||||
|
||||
// 计算分摊成本
|
||||
for (CostFeeWaybillRel billCodeItem: listBillCodeRel) {
|
||||
|
||||
String billCode=billCodeItem.getBillCode();
|
||||
// 如果指定单号,则其他单号做过滤
|
||||
if(!StringUtils.isEmpty(calcBillCode)) {
|
||||
if(!billCode.equals(calcBillCode)){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
EmisWaybill waybill = billCodeItem.getWaybillDetail();
|
||||
EmisTmsCostFee costFeeDetail= billCodeItem.getCostFeeDetail();
|
||||
|
||||
@ -673,9 +683,19 @@ public class EmisTmsCostFeeServiceImpl implements IEmisTmsCostFeeService
|
||||
emisTmsCostFeeMapper.updateEmisTmsCostFee(emisTmsCostFee);
|
||||
|
||||
// 合并单个运单费用
|
||||
for (CostFeeWaybillRel feeRel: listBillCodeRel) {
|
||||
for (CostFeeWaybillRel billCodeItem: listBillCodeRel) {
|
||||
try {
|
||||
mergeCostFeeByBillCode(feeRel.getBillCode());
|
||||
|
||||
String billCode=billCodeItem.getBillCode();
|
||||
// 如果指定单号,则其他单号做过滤
|
||||
if(!StringUtils.isEmpty(calcBillCode)) {
|
||||
if(!billCode.equals(calcBillCode)){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
mergeCostFeeByBillCode(billCode);
|
||||
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user