|
@@ -973,7 +973,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
tranSettlementReport.setLossWeight(tranSettlementReport.getLoadingWeight() - tranSettlementReport.getUnloadingWeight());
|
|
tranSettlementReport.setLossWeight(tranSettlementReport.getLoadingWeight() - tranSettlementReport.getUnloadingWeight());
|
|
//汽运类型
|
|
//汽运类型
|
|
if (tranSettlementReport.getTranTypeKey().equals(NumberConstant.CONSTANT1)) {
|
|
if (tranSettlementReport.getTranTypeKey().equals(NumberConstant.CONSTANT1)) {
|
|
- //结算重量
|
|
|
|
|
|
+ //未手动修改过结算重量
|
|
if ("0".equals(tranSettlementReport.getManualFlag())) {
|
|
if ("0".equals(tranSettlementReport.getManualFlag())) {
|
|
//卸车不为空时,结算重量=装卸取小
|
|
//卸车不为空时,结算重量=装卸取小
|
|
tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
|
|
tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
|
|
@@ -1003,19 +1003,18 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
tranSettlementReport.setDeductionAmount(0d);
|
|
tranSettlementReport.setDeductionAmount(0d);
|
|
}
|
|
}
|
|
if (tranSettlementReport.getTransportPrice()!=null) {
|
|
if (tranSettlementReport.getTransportPrice()!=null) {
|
|
- if (tranSettlementReport.getLossWeight() <= (tranSettlementReport.getLoadingWeight() / 1000)) {
|
|
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
//应付=单价x结算重量
|
|
//应付=单价x结算重量
|
|
tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
- //实付金额
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
|
- } else {
|
|
|
|
- //应付=单价x结算重量-扣款
|
|
|
|
- tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight() - Float.valueOf(String.valueOf(tranSettlementReport.getDeductionAmount())));
|
|
|
|
- //实付金额
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
|
}
|
|
}
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付金额=应付-扣款-服务费
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable() - Float.valueOf(String.valueOf(tranSettlementReport.getDeductionAmount())) - tranSettlementReport.getServiceCharge());
|
|
//税点
|
|
//税点
|
|
tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
//合计应付
|
|
//合计应付
|
|
@@ -1102,44 +1101,120 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
}
|
|
}
|
|
//退库派车情况
|
|
//退库派车情况
|
|
if (warehouseInOutInfo.getCarId()!=null) {
|
|
if (warehouseInOutInfo.getCarId()!=null) {
|
|
- //生成汽运报表
|
|
|
|
- TranSettlementReport tranSettlementReport = new TranSettlementReport();
|
|
|
|
- tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
|
|
|
|
- tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
|
|
|
|
- tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
|
|
|
|
- tranSettlementReport.setId(IdGenerator.generateUUID());
|
|
|
|
- tranSettlementReport.setTranType("汽运");
|
|
|
|
- tranSettlementReport.setTranTypeKey("1");
|
|
|
|
- tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
- tranSettlementReport.setServiceCharge(20d);
|
|
|
|
- TranCarInfo tranCarInfo = tranCarInfoService.selectById(warehouseInOutInfo.getCarId());
|
|
|
|
- if (tranCarInfo != null) {
|
|
|
|
- TranTaskInfo tranTaskInfo = tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
|
|
- tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
|
|
- tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
- TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
|
|
- tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
|
|
- //运输单价不为空
|
|
|
|
- if (tranCarInfo.getTranPrice() != null) {
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
|
- //税点
|
|
|
|
- tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid() / 0.946 * 0.054);
|
|
|
|
- //合计应付
|
|
|
|
- tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid() + tranSettlementReport.getTaxPoint());
|
|
|
|
- //未付
|
|
|
|
- tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
- tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
- tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
|
|
+ //退库入库时更新汽运报表卸车数据
|
|
|
|
+ TranSettlementReport tranSettlementReport = tranSettlementReportService.selectOne(new EntityWrapper<TranSettlementReport>()
|
|
|
|
+ .eq("car_id", warehouseInOutInfo.getCarId()));
|
|
|
|
+ if (tranSettlementReport!=null) {
|
|
|
|
+ tranSettlementReport.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
+ //损耗
|
|
|
|
+ tranSettlementReport.setLossWeight(tranSettlementReport.getLoadingWeight() - tranSettlementReport.getUnloadingWeight());
|
|
|
|
+ //汽运类型
|
|
|
|
+ if (tranSettlementReport.getTranTypeKey().equals(NumberConstant.CONSTANT1)) {
|
|
|
|
+ //结算重量
|
|
|
|
+ if ("0".equals(tranSettlementReport.getManualFlag())) {
|
|
|
|
+ //卸车不为空时,结算重量=装卸取小
|
|
|
|
+ tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
|
|
|
|
+ tranSettlementReport.setTransportDamage(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ }
|
|
|
|
+ if(tranSettlementReport.getLossWeight()<0){
|
|
|
|
+ tranSettlementReport.setActualLoss(0d);
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ //损耗大于结算重量的1‰时
|
|
|
|
+ else if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
|
+ //货损=损耗-结算重量x1‰
|
|
|
|
+ tranSettlementReport.setCargoDamage(tranSettlementReport.getLossWeight()-tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ //实际损耗默认为结算重量的1‰
|
|
|
|
+ tranSettlementReport.setActualLoss(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ if (tranSettlementReport.getGrainPrice()!=null){
|
|
|
|
+ tranSettlementReport.setDeductionAmount(tranSettlementReport.getCargoDamage()*tranSettlementReport.getGrainPrice());
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //0<损耗<=结算重量的1‰时
|
|
|
|
+ else if(tranSettlementReport.getLossWeight()>0&&tranSettlementReport.getLossWeight()<=tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
|
+ //实际损耗默认为损耗
|
|
|
|
+ tranSettlementReport.setActualLoss(Double.valueOf(String.valueOf(tranSettlementReport.getLossWeight())));
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ if (tranSettlementReport.getTransportPrice()!=null) {
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付金额=应付-扣款-服务费
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable() - Float.valueOf(String.valueOf(tranSettlementReport.getDeductionAmount())) - tranSettlementReport.getServiceCharge());
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
+ //合计应付
|
|
|
|
+ tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ //生成汽运报表
|
|
|
|
+ TranSettlementReport tranSettlementReport1 = new TranSettlementReport();
|
|
|
|
+ tranSettlementReport1.setCompId(warehouseBaseInfo.getCompId());
|
|
|
|
+ tranSettlementReport1.setCarId(warehouseInOutInfo.getCarId());
|
|
|
|
+ tranSettlementReport1.setTranCarNo(warehouseInOutInfo.getTranCarNo());
|
|
|
|
+ tranSettlementReport1.setId(IdGenerator.generateUUID());
|
|
|
|
+ tranSettlementReport1.setTranType("汽运");
|
|
|
|
+ tranSettlementReport1.setTranTypeKey("1");
|
|
|
|
+ tranSettlementReport1.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport1.setServiceCharge(20d);
|
|
|
|
+ TranCarInfo tranCarInfo = tranCarInfoService.selectById(warehouseInOutInfo.getCarId());
|
|
|
|
+ if (tranCarInfo != null) {
|
|
|
|
+ TranTaskInfo tranTaskInfo = tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
|
|
+ tranSettlementReport1.setTaskNo(tranTaskInfo.getTaskNo());
|
|
|
|
+ tranSettlementReport1.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
+ TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
|
|
+ tranSettlementReport1.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
|
|
+ tranSettlementReport1.setBillingMethod(tranCarInfo.getBillingMethod());
|
|
|
|
+ //运输单价不为空
|
|
|
|
+ if (tranCarInfo.getTranPrice() != null) {
|
|
|
|
+ tranSettlementReport1.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ tranSettlementReport1.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport1.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice() * tranSettlementReport1.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付=应付-服务费
|
|
|
|
+ tranSettlementReport1.setAmountActuallyPaid(tranSettlementReport1.getAmountIngPayable()
|
|
|
|
+ - tranSettlementReport1.getServiceCharge());
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport1.setTaxPoint(tranSettlementReport1.getAmountActuallyPaid() / 0.946 * 0.054);
|
|
|
|
+ //合计应付=实付+税点
|
|
|
|
+ tranSettlementReport1.setTotalPayable(tranSettlementReport1.getAmountActuallyPaid() + tranSettlementReport1.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport1.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport1.getTotalPayable())));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ tranSettlementReport1.setContractNo(warehouseInOutInfo.getContractNo());
|
|
|
|
+ tranSettlementReport1.setCarNo(warehouseInOutInfo.getCarNo());
|
|
|
|
+ tranSettlementReport1.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
+ tranSettlementReport1.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport1.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
|
|
|
|
+ tranSettlementReport1.setStatus(StatusEnum.PENDING_PAY.getName());
|
|
|
|
+ tranSettlementReportService.insert(tranSettlementReport1);
|
|
}
|
|
}
|
|
- tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
|
|
|
|
- tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
|
|
|
|
- tranSettlementReport.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
- tranSettlementReport.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
- tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
|
|
|
|
- tranSettlementReport.setStatus(StatusEnum.PENDING_PAY.getName());
|
|
|
|
- tranSettlementReportService.insert(tranSettlementReport);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Wrapper wrapper = new EntityWrapper<TranCarInfo>()
|
|
Wrapper wrapper = new EntityWrapper<TranCarInfo>()
|
|
@@ -1296,44 +1371,120 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
if ("退库".equals(warehouseInOutInfo.getInOutType())){
|
|
if ("退库".equals(warehouseInOutInfo.getInOutType())){
|
|
//退库派车情况
|
|
//退库派车情况
|
|
if (warehouseInOutInfo.getCarId()!=null) {
|
|
if (warehouseInOutInfo.getCarId()!=null) {
|
|
- //生成汽运报表
|
|
|
|
- TranSettlementReport tranSettlementReport = new TranSettlementReport();
|
|
|
|
- tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
|
|
|
|
- tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
|
|
|
|
- tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
|
|
|
|
- tranSettlementReport.setId(IdGenerator.generateUUID());
|
|
|
|
- tranSettlementReport.setTranType("汽运");
|
|
|
|
- tranSettlementReport.setTranTypeKey("1");
|
|
|
|
- tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
- tranSettlementReport.setServiceCharge(20d);
|
|
|
|
- TranCarInfo tranCarInfo = tranCarInfoService.selectById(warehouseInOutInfo.getCarId());
|
|
|
|
- if (tranCarInfo != null) {
|
|
|
|
- TranTaskInfo tranTaskInfo = tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
|
|
- tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
|
|
- tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
- TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
|
|
- tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
|
|
- //运输单价不为空
|
|
|
|
- if (tranCarInfo.getTranPrice() != null) {
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
|
- //税点
|
|
|
|
- tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid() / 0.946 * 0.054);
|
|
|
|
- //合计应付
|
|
|
|
- tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid() + tranSettlementReport.getTaxPoint());
|
|
|
|
- //未付
|
|
|
|
- tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
- tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
- tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
|
|
+ //退库入库时更新汽运报表卸车数据
|
|
|
|
+ TranSettlementReport tranSettlementReport = tranSettlementReportService.selectOne(new EntityWrapper<TranSettlementReport>()
|
|
|
|
+ .eq("car_id", warehouseInOutInfo.getCarId()));
|
|
|
|
+ if (tranSettlementReport!=null) {
|
|
|
|
+ tranSettlementReport.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
+ //损耗
|
|
|
|
+ tranSettlementReport.setLossWeight(tranSettlementReport.getLoadingWeight() - tranSettlementReport.getUnloadingWeight());
|
|
|
|
+ //汽运类型
|
|
|
|
+ if (tranSettlementReport.getTranTypeKey().equals(NumberConstant.CONSTANT1)) {
|
|
|
|
+ //结算重量
|
|
|
|
+ if ("0".equals(tranSettlementReport.getManualFlag())) {
|
|
|
|
+ //卸车不为空时,结算重量=装卸取小
|
|
|
|
+ tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
|
|
|
|
+ tranSettlementReport.setTransportDamage(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ }
|
|
|
|
+ if(tranSettlementReport.getLossWeight()<0){
|
|
|
|
+ tranSettlementReport.setActualLoss(0d);
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ //损耗大于结算重量的1‰时
|
|
|
|
+ else if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
|
+ //货损=损耗-结算重量x1‰
|
|
|
|
+ tranSettlementReport.setCargoDamage(tranSettlementReport.getLossWeight()-tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ //实际损耗默认为结算重量的1‰
|
|
|
|
+ tranSettlementReport.setActualLoss(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ if (tranSettlementReport.getGrainPrice()!=null){
|
|
|
|
+ tranSettlementReport.setDeductionAmount(tranSettlementReport.getCargoDamage()*tranSettlementReport.getGrainPrice());
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //0<损耗<=结算重量的1‰时
|
|
|
|
+ else if(tranSettlementReport.getLossWeight()>0&&tranSettlementReport.getLossWeight()<=tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
|
+ //实际损耗默认为损耗
|
|
|
|
+ tranSettlementReport.setActualLoss(Double.valueOf(String.valueOf(tranSettlementReport.getLossWeight())));
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ if (tranSettlementReport.getTransportPrice()!=null) {
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付金额=应付-扣款-服务费
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable() - Float.valueOf(String.valueOf(tranSettlementReport.getDeductionAmount())) - tranSettlementReport.getServiceCharge());
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
+ //合计应付
|
|
|
|
+ tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ //生成汽运报表
|
|
|
|
+ TranSettlementReport tranSettlementReport1 = new TranSettlementReport();
|
|
|
|
+ tranSettlementReport1.setCompId(warehouseBaseInfo.getCompId());
|
|
|
|
+ tranSettlementReport1.setCarId(warehouseInOutInfo.getCarId());
|
|
|
|
+ tranSettlementReport1.setTranCarNo(warehouseInOutInfo.getTranCarNo());
|
|
|
|
+ tranSettlementReport1.setId(IdGenerator.generateUUID());
|
|
|
|
+ tranSettlementReport1.setTranType("汽运");
|
|
|
|
+ tranSettlementReport1.setTranTypeKey("1");
|
|
|
|
+ tranSettlementReport1.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport1.setServiceCharge(20d);
|
|
|
|
+ TranCarInfo tranCarInfo = tranCarInfoService.selectById(warehouseInOutInfo.getCarId());
|
|
|
|
+ if (tranCarInfo != null) {
|
|
|
|
+ TranTaskInfo tranTaskInfo = tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
|
|
+ tranSettlementReport1.setTaskNo(tranTaskInfo.getTaskNo());
|
|
|
|
+ tranSettlementReport1.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
+ tranSettlementReport1.setBillingMethod(tranCarInfo.getBillingMethod());
|
|
|
|
+ TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
|
|
+ tranSettlementReport1.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
|
|
+ //运输单价不为空
|
|
|
|
+ if (tranCarInfo.getTranPrice() != null) {
|
|
|
|
+ tranSettlementReport1.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ tranSettlementReport1.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport1.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice() * tranSettlementReport1.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付=应付-服务费
|
|
|
|
+ tranSettlementReport1.setAmountActuallyPaid(tranSettlementReport1.getAmountIngPayable()
|
|
|
|
+ - tranSettlementReport1.getServiceCharge());
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport1.setTaxPoint(tranSettlementReport1.getAmountActuallyPaid() / 0.946 * 0.054);
|
|
|
|
+ //合计应付=实付+税点
|
|
|
|
+ tranSettlementReport1.setTotalPayable(tranSettlementReport1.getAmountActuallyPaid() + tranSettlementReport1.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport1.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport1.getTotalPayable())));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ tranSettlementReport1.setContractNo(warehouseInOutInfo.getContractNo());
|
|
|
|
+ tranSettlementReport1.setCarNo(warehouseInOutInfo.getCarNo());
|
|
|
|
+ tranSettlementReport1.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
+ tranSettlementReport1.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport1.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
|
|
|
|
+ tranSettlementReport1.setStatus(StatusEnum.PENDING_PAY.getName());
|
|
|
|
+ tranSettlementReportService.insert(tranSettlementReport1);
|
|
}
|
|
}
|
|
- tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
|
|
|
|
- tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
|
|
|
|
- tranSettlementReport.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
- tranSettlementReport.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
- tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
|
|
|
|
- tranSettlementReport.setStatus(StatusEnum.PENDING_PAY.getName());
|
|
|
|
- tranSettlementReportService.insert(tranSettlementReport);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//更新库存量
|
|
//更新库存量
|
|
@@ -1616,26 +1767,38 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
tranSettlementReport.setTranTypeKey("1");
|
|
tranSettlementReport.setTranTypeKey("1");
|
|
tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
+ tranSettlementReport.setBillingMethod(tranProcessInfo.getBillingMethod());
|
|
tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
tranSettlementReport.setServiceCharge(20d);
|
|
tranSettlementReport.setServiceCharge(20d);
|
|
//运输单价不为空
|
|
//运输单价不为空
|
|
if (tranProcessInfo.getTranPrice()!=null){
|
|
if (tranProcessInfo.getTranPrice()!=null){
|
|
- //实付金额
|
|
|
|
|
|
+ tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
|
|
|
|
+ tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())));
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //扣款
|
|
if(tranSettlementReport.getDeductionAmount() != null){
|
|
if(tranSettlementReport.getDeductionAmount() != null){
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
|
|
+ //实付金额=应付-扣款-服务费
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
- Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
- Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
}else{
|
|
}else{
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
- tranSettlementReport.getServiceCharge());
|
|
- tranSettlementReport.getServiceCharge());
|
|
}
|
|
}
|
|
//税点
|
|
//税点
|
|
tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
- //合计应付
|
|
|
|
|
|
+ //合计应付=实付+税点
|
|
tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
//未付
|
|
//未付
|
|
tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
- tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
|
|
|
|
- tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())));
|
|
|
|
}
|
|
}
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
tranSettlementReport.setTranType("火运");
|
|
tranSettlementReport.setTranType("火运");
|
|
@@ -1817,29 +1980,41 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
+ tranSettlementReport.setBillingMethod(tranCarInfo.getBillingMethod());
|
|
TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
if (tranProcessInfo!=null){
|
|
if (tranProcessInfo!=null){
|
|
|
|
+ //货值
|
|
tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //运输单价不为空
|
|
|
|
- if (tranCarInfo!=null&&tranCarInfo.getTranPrice()!=null){
|
|
|
|
- //实付金额
|
|
|
|
- if(tranSettlementReport.getDeductionAmount() != null){
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
|
- }else{
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
|
|
|
+ //运输单价不为空
|
|
|
|
+ if (tranCarInfo.getTranPrice()!=null){
|
|
|
|
+ tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付金额
|
|
|
|
+ if(tranSettlementReport.getDeductionAmount() != null){
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
|
|
+ - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
|
+ }else{
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
|
|
+ - tranSettlementReport.getServiceCharge());
|
|
|
|
+ }
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
+ //合计应付
|
|
|
|
+ tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
}
|
|
}
|
|
- //税点
|
|
|
|
- tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
- //合计应付
|
|
|
|
- tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
- //未付
|
|
|
|
- tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
- tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
- tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
}
|
|
}
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
tranSettlementReport.setTranType("火运");
|
|
tranSettlementReport.setTranType("火运");
|
|
@@ -2380,29 +2555,40 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
+ tranSettlementReport.setBillingMethod(tranCarInfo.getBillingMethod());
|
|
TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
if (tranProcessInfo!=null){
|
|
if (tranProcessInfo!=null){
|
|
tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //运输单价不为空
|
|
|
|
- if (tranCarInfo!=null&&tranCarInfo.getTranPrice()!=null){
|
|
|
|
- //实付金额
|
|
|
|
- if(tranSettlementReport.getDeductionAmount() != null){
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
|
- }else{
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
|
|
|
+ //运输单价不为空
|
|
|
|
+ if (tranCarInfo.getTranPrice()!=null){
|
|
|
|
+ tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付金额
|
|
|
|
+ if(tranSettlementReport.getDeductionAmount() != null){
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
|
|
+ - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
|
+ }else{
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
|
|
+ - tranSettlementReport.getServiceCharge());
|
|
|
|
+ }
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
+ //合计应付
|
|
|
|
+ tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
}
|
|
}
|
|
- //税点
|
|
|
|
- tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
- //合计应付
|
|
|
|
- tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
- //未付
|
|
|
|
- tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
- tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
- tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
}
|
|
}
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
tranSettlementReport.setTranType("火运");
|
|
tranSettlementReport.setTranType("火运");
|
|
@@ -3995,19 +4181,18 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
tranSettlementReport.setDeductionAmount(0d);
|
|
tranSettlementReport.setDeductionAmount(0d);
|
|
}
|
|
}
|
|
if (tranSettlementReport.getTransportPrice() != null) {
|
|
if (tranSettlementReport.getTransportPrice() != null) {
|
|
- if (tranSettlementReport.getLossWeight() <= (tranSettlementReport.getLoadingWeight() / 1000)) {
|
|
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
//应付=单价x结算重量
|
|
//应付=单价x结算重量
|
|
tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
- //实付金额
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
|
- } else {
|
|
|
|
- //应付=单价x结算重量-扣款
|
|
|
|
- tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight() - Float.valueOf(String.valueOf(tranSettlementReport.getDeductionAmount())));
|
|
|
|
- //实付金额
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
|
}
|
|
}
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付金额=应付-扣款-服务费
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable() - Float.valueOf(String.valueOf(tranSettlementReport.getDeductionAmount())) - tranSettlementReport.getServiceCharge());
|
|
//税点
|
|
//税点
|
|
tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
//合计应付
|
|
//合计应付
|
|
@@ -4101,44 +4286,120 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
}
|
|
}
|
|
//退库派车情况
|
|
//退库派车情况
|
|
if (warehouseInOutInfo.getCarId()!=null) {
|
|
if (warehouseInOutInfo.getCarId()!=null) {
|
|
- //生成汽运报表
|
|
|
|
- TranSettlementReport tranSettlementReport = new TranSettlementReport();
|
|
|
|
- tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
|
|
|
|
- tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
|
|
|
|
- tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
|
|
|
|
- tranSettlementReport.setId(IdGenerator.generateUUID());
|
|
|
|
- tranSettlementReport.setTranType("汽运");
|
|
|
|
- tranSettlementReport.setTranTypeKey("1");
|
|
|
|
- tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
- tranSettlementReport.setServiceCharge(20d);
|
|
|
|
- TranCarInfo tranCarInfo = tranCarInfoService.selectById(warehouseInOutInfo.getCarId());
|
|
|
|
- if (tranCarInfo != null) {
|
|
|
|
- TranTaskInfo tranTaskInfo = tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
|
|
- tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
|
|
- tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
- TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
|
|
- tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
|
|
- //运输单价不为空
|
|
|
|
- if (tranCarInfo.getTranPrice() != null) {
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
|
- //税点
|
|
|
|
- tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid() / 0.946 * 0.054);
|
|
|
|
- //合计应付
|
|
|
|
- tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid() + tranSettlementReport.getTaxPoint());
|
|
|
|
- //未付
|
|
|
|
- tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
- tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
- tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
|
|
+ //退库入库时更新汽运报表卸车数据
|
|
|
|
+ TranSettlementReport tranSettlementReport = tranSettlementReportService.selectOne(new EntityWrapper<TranSettlementReport>()
|
|
|
|
+ .eq("car_id", warehouseInOutInfo.getCarId()));
|
|
|
|
+ if (tranSettlementReport!=null) {
|
|
|
|
+ tranSettlementReport.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
+ //损耗
|
|
|
|
+ tranSettlementReport.setLossWeight(tranSettlementReport.getLoadingWeight() - tranSettlementReport.getUnloadingWeight());
|
|
|
|
+ //汽运类型
|
|
|
|
+ if (tranSettlementReport.getTranTypeKey().equals(NumberConstant.CONSTANT1)) {
|
|
|
|
+ //结算重量
|
|
|
|
+ if ("0".equals(tranSettlementReport.getManualFlag())) {
|
|
|
|
+ //卸车不为空时,结算重量=装卸取小
|
|
|
|
+ tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
|
|
|
|
+ tranSettlementReport.setTransportDamage(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ }
|
|
|
|
+ if(tranSettlementReport.getLossWeight()<0){
|
|
|
|
+ tranSettlementReport.setActualLoss(0d);
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ //损耗大于结算重量的1‰时
|
|
|
|
+ else if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
|
+ //货损=损耗-结算重量x1‰
|
|
|
|
+ tranSettlementReport.setCargoDamage(tranSettlementReport.getLossWeight()-tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ //实际损耗默认为结算重量的1‰
|
|
|
|
+ tranSettlementReport.setActualLoss(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ if (tranSettlementReport.getGrainPrice()!=null){
|
|
|
|
+ tranSettlementReport.setDeductionAmount(tranSettlementReport.getCargoDamage()*tranSettlementReport.getGrainPrice());
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //0<损耗<=结算重量的1‰时
|
|
|
|
+ else if(tranSettlementReport.getLossWeight()>0&&tranSettlementReport.getLossWeight()<=tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
|
+ //实际损耗默认为损耗
|
|
|
|
+ tranSettlementReport.setActualLoss(Double.valueOf(String.valueOf(tranSettlementReport.getLossWeight())));
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ if (tranSettlementReport.getTransportPrice()!=null) {
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付金额=应付-扣款-服务费
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable() - Float.valueOf(String.valueOf(tranSettlementReport.getDeductionAmount())) - tranSettlementReport.getServiceCharge());
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
+ //合计应付
|
|
|
|
+ tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ //生成汽运报表
|
|
|
|
+ TranSettlementReport tranSettlementReport1 = new TranSettlementReport();
|
|
|
|
+ tranSettlementReport1.setCompId(warehouseBaseInfo.getCompId());
|
|
|
|
+ tranSettlementReport1.setCarId(warehouseInOutInfo.getCarId());
|
|
|
|
+ tranSettlementReport1.setTranCarNo(warehouseInOutInfo.getTranCarNo());
|
|
|
|
+ tranSettlementReport1.setId(IdGenerator.generateUUID());
|
|
|
|
+ tranSettlementReport1.setTranType("汽运");
|
|
|
|
+ tranSettlementReport1.setTranTypeKey("1");
|
|
|
|
+ tranSettlementReport1.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport1.setServiceCharge(20d);
|
|
|
|
+ TranCarInfo tranCarInfo = tranCarInfoService.selectById(warehouseInOutInfo.getCarId());
|
|
|
|
+ if (tranCarInfo != null) {
|
|
|
|
+ TranTaskInfo tranTaskInfo = tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
|
|
+ tranSettlementReport1.setTaskNo(tranTaskInfo.getTaskNo());
|
|
|
|
+ tranSettlementReport1.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
+ TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
|
|
+ tranSettlementReport1.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
|
|
+ tranSettlementReport1.setBillingMethod(tranCarInfo.getBillingMethod());
|
|
|
|
+ //运输单价不为空
|
|
|
|
+ if (tranCarInfo.getTranPrice() != null) {
|
|
|
|
+ tranSettlementReport1.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ tranSettlementReport1.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport1.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice() * tranSettlementReport1.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付=应付-服务费
|
|
|
|
+ tranSettlementReport1.setAmountActuallyPaid(tranSettlementReport1.getAmountIngPayable()
|
|
|
|
+ - tranSettlementReport1.getServiceCharge());
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport1.setTaxPoint(tranSettlementReport1.getAmountActuallyPaid() / 0.946 * 0.054);
|
|
|
|
+ //合计应付
|
|
|
|
+ tranSettlementReport1.setTotalPayable(tranSettlementReport1.getAmountActuallyPaid() + tranSettlementReport1.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport1.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport1.getTotalPayable())));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ tranSettlementReport1.setContractNo(warehouseInOutInfo.getContractNo());
|
|
|
|
+ tranSettlementReport1.setCarNo(warehouseInOutInfo.getCarNo());
|
|
|
|
+ tranSettlementReport1.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
+ tranSettlementReport1.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport1.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
|
|
|
|
+ tranSettlementReport1.setStatus(StatusEnum.PENDING_PAY.getName());
|
|
|
|
+ tranSettlementReportService.insert(tranSettlementReport1);
|
|
}
|
|
}
|
|
- tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
|
|
|
|
- tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
|
|
|
|
- tranSettlementReport.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
- tranSettlementReport.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
- tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
|
|
|
|
- tranSettlementReport.setStatus(StatusEnum.PENDING_PAY.getName());
|
|
|
|
- tranSettlementReportService.insert(tranSettlementReport);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (warehouseInOutInfo.getWeighingManagement() != null) {
|
|
if (warehouseInOutInfo.getWeighingManagement() != null) {
|
|
@@ -4378,44 +4639,120 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
if ("退库".equals(warehouseInOutInfo.getInOutType())){
|
|
if ("退库".equals(warehouseInOutInfo.getInOutType())){
|
|
//退库派车情况
|
|
//退库派车情况
|
|
if (warehouseInOutInfo.getCarId()!=null) {
|
|
if (warehouseInOutInfo.getCarId()!=null) {
|
|
- //生成汽运报表
|
|
|
|
- TranSettlementReport tranSettlementReport = new TranSettlementReport();
|
|
|
|
- tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
|
|
|
|
- tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
|
|
|
|
- tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
|
|
|
|
- tranSettlementReport.setId(IdGenerator.generateUUID());
|
|
|
|
- tranSettlementReport.setTranType("汽运");
|
|
|
|
- tranSettlementReport.setTranTypeKey("1");
|
|
|
|
- tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
- tranSettlementReport.setServiceCharge(20d);
|
|
|
|
- TranCarInfo tranCarInfo = tranCarInfoService.selectById(warehouseInOutInfo.getCarId());
|
|
|
|
- if (tranCarInfo != null) {
|
|
|
|
- TranTaskInfo tranTaskInfo = tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
|
|
- tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
|
|
- tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
- TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
|
|
- tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
|
|
- //运输单价不为空
|
|
|
|
- if (tranCarInfo.getTranPrice() != null) {
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
|
- //税点
|
|
|
|
- tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid() / 0.946 * 0.054);
|
|
|
|
- //合计应付
|
|
|
|
- tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid() + tranSettlementReport.getTaxPoint());
|
|
|
|
- //未付
|
|
|
|
- tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
- tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
- tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
|
|
+ //退库入库时更新汽运报表卸车数据
|
|
|
|
+ TranSettlementReport tranSettlementReport = tranSettlementReportService.selectOne(new EntityWrapper<TranSettlementReport>()
|
|
|
|
+ .eq("car_id", warehouseInOutInfo.getCarId()));
|
|
|
|
+ if (tranSettlementReport!=null) {
|
|
|
|
+ tranSettlementReport.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
+ //损耗
|
|
|
|
+ tranSettlementReport.setLossWeight(tranSettlementReport.getLoadingWeight() - tranSettlementReport.getUnloadingWeight());
|
|
|
|
+ //汽运类型
|
|
|
|
+ if (tranSettlementReport.getTranTypeKey().equals(NumberConstant.CONSTANT1)) {
|
|
|
|
+ //结算重量
|
|
|
|
+ if ("0".equals(tranSettlementReport.getManualFlag())) {
|
|
|
|
+ //卸车不为空时,结算重量=装卸取小
|
|
|
|
+ tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
|
|
|
|
+ tranSettlementReport.setTransportDamage(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ }
|
|
|
|
+ if(tranSettlementReport.getLossWeight()<0){
|
|
|
|
+ tranSettlementReport.setActualLoss(0d);
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ //损耗大于结算重量的1‰时
|
|
|
|
+ else if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
|
+ //货损=损耗-结算重量x1‰
|
|
|
|
+ tranSettlementReport.setCargoDamage(tranSettlementReport.getLossWeight()-tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ //实际损耗默认为结算重量的1‰
|
|
|
|
+ tranSettlementReport.setActualLoss(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
|
+ if (tranSettlementReport.getGrainPrice()!=null){
|
|
|
|
+ tranSettlementReport.setDeductionAmount(tranSettlementReport.getCargoDamage()*tranSettlementReport.getGrainPrice());
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //0<损耗<=结算重量的1‰时
|
|
|
|
+ else if(tranSettlementReport.getLossWeight()>0&&tranSettlementReport.getLossWeight()<=tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
|
+ //实际损耗默认为损耗
|
|
|
|
+ tranSettlementReport.setActualLoss(Double.valueOf(String.valueOf(tranSettlementReport.getLossWeight())));
|
|
|
|
+ tranSettlementReport.setDeductionAmount(0d);
|
|
|
|
+ }
|
|
|
|
+ if (tranSettlementReport.getTransportPrice()!=null) {
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付金额=应付-扣款-服务费
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable() - Float.valueOf(String.valueOf(tranSettlementReport.getDeductionAmount())) - tranSettlementReport.getServiceCharge());
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
+ //合计应付
|
|
|
|
+ tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ //生成汽运报表
|
|
|
|
+ TranSettlementReport tranSettlementReport1 = new TranSettlementReport();
|
|
|
|
+ tranSettlementReport1.setCompId(warehouseBaseInfo.getCompId());
|
|
|
|
+ tranSettlementReport1.setCarId(warehouseInOutInfo.getCarId());
|
|
|
|
+ tranSettlementReport1.setTranCarNo(warehouseInOutInfo.getTranCarNo());
|
|
|
|
+ tranSettlementReport1.setId(IdGenerator.generateUUID());
|
|
|
|
+ tranSettlementReport1.setTranType("汽运");
|
|
|
|
+ tranSettlementReport1.setTranTypeKey("1");
|
|
|
|
+ tranSettlementReport1.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport1.setServiceCharge(20d);
|
|
|
|
+ TranCarInfo tranCarInfo = tranCarInfoService.selectById(warehouseInOutInfo.getCarId());
|
|
|
|
+ if (tranCarInfo != null) {
|
|
|
|
+ TranTaskInfo tranTaskInfo = tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
|
|
+ tranSettlementReport1.setTaskNo(tranTaskInfo.getTaskNo());
|
|
|
|
+ tranSettlementReport1.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
+ tranSettlementReport1.setBillingMethod(tranCarInfo.getBillingMethod());
|
|
|
|
+ TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
|
|
+ tranSettlementReport1.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
|
|
+ //运输单价不为空
|
|
|
|
+ if (tranCarInfo.getTranPrice() != null) {
|
|
|
|
+ tranSettlementReport1.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ tranSettlementReport1.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport1.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice() * tranSettlementReport1.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付=应付-服务费
|
|
|
|
+ tranSettlementReport1.setAmountActuallyPaid(tranSettlementReport1.getAmountIngPayable()
|
|
|
|
+ - tranSettlementReport1.getServiceCharge());
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport1.setTaxPoint(tranSettlementReport1.getAmountActuallyPaid() / 0.946 * 0.054);
|
|
|
|
+ //合计应付
|
|
|
|
+ tranSettlementReport1.setTotalPayable(tranSettlementReport1.getAmountActuallyPaid() + tranSettlementReport1.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport1.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport1.getTotalPayable())));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ tranSettlementReport1.setContractNo(warehouseInOutInfo.getContractNo());
|
|
|
|
+ tranSettlementReport1.setCarNo(warehouseInOutInfo.getCarNo());
|
|
|
|
+ tranSettlementReport1.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
+ tranSettlementReport1.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
+ tranSettlementReport1.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
|
|
|
|
+ tranSettlementReport1.setStatus(StatusEnum.PENDING_PAY.getName());
|
|
|
|
+ tranSettlementReportService.insert(tranSettlementReport1);
|
|
}
|
|
}
|
|
- tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
|
|
|
|
- tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
|
|
|
|
- tranSettlementReport.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
|
|
|
|
- tranSettlementReport.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
|
- tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
|
|
|
|
- tranSettlementReport.setStatus(StatusEnum.PENDING_PAY.getName());
|
|
|
|
- tranSettlementReportService.insert(tranSettlementReport);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//更新库存量
|
|
//更新库存量
|
|
@@ -4721,16 +5058,29 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
tranSettlementReport.setTranType("汽运");
|
|
tranSettlementReport.setTranType("汽运");
|
|
tranSettlementReport.setTranTypeKey("1");
|
|
tranSettlementReport.setTranTypeKey("1");
|
|
|
|
+ tranSettlementReport.setBillingMethod(tranProcessInfo.getBillingMethod());
|
|
tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
tranSettlementReport.setServiceCharge(20d);
|
|
tranSettlementReport.setServiceCharge(20d);
|
|
//运输单价不为空
|
|
//运输单价不为空
|
|
if (tranProcessInfo.getTranPrice()!=null){
|
|
if (tranProcessInfo.getTranPrice()!=null){
|
|
|
|
+ tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
|
|
|
|
+ tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())));
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
//实付金额
|
|
//实付金额
|
|
if(tranSettlementReport.getDeductionAmount() != null){
|
|
if(tranSettlementReport.getDeductionAmount() != null){
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())) * tranSettlementReport.getSettlementWeight()
|
|
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
- Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
- Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
}else{
|
|
}else{
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())) * tranSettlementReport.getSettlementWeight()
|
|
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
- tranSettlementReport.getServiceCharge());
|
|
- tranSettlementReport.getServiceCharge());
|
|
}
|
|
}
|
|
//税点
|
|
//税点
|
|
@@ -4739,8 +5089,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
//未付
|
|
//未付
|
|
tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
- tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
|
|
|
|
- tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())));
|
|
|
|
}
|
|
}
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
tranSettlementReport.setTranType("火运");
|
|
tranSettlementReport.setTranType("火运");
|
|
@@ -4945,29 +5293,40 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
+ tranSettlementReport.setBillingMethod(tranCarInfo.getBillingMethod());
|
|
TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
if (tranProcessInfo!=null){
|
|
if (tranProcessInfo!=null){
|
|
tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //运输单价不为空
|
|
|
|
- if (tranCarInfo!=null&&tranCarInfo.getTranPrice()!=null){
|
|
|
|
- //实付金额
|
|
|
|
- if(tranSettlementReport.getDeductionAmount() != null){
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
|
- }else{
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
|
|
|
+ //运输单价不为空
|
|
|
|
+ if (tranCarInfo.getTranPrice()!=null){
|
|
|
|
+ tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付金额
|
|
|
|
+ if(tranSettlementReport.getDeductionAmount() != null){
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
|
|
+ - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
|
+ }else{
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
|
|
+ - tranSettlementReport.getServiceCharge());
|
|
|
|
+ }
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
+ //合计应付
|
|
|
|
+ tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
}
|
|
}
|
|
- //税点
|
|
|
|
- tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
- //合计应付
|
|
|
|
- tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
- //未付
|
|
|
|
- tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
- tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
- tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
}
|
|
}
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
tranSettlementReport.setTranType("火运");
|
|
tranSettlementReport.setTranType("火运");
|
|
@@ -5582,29 +5941,40 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
|
|
tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
|
|
|
|
+ tranSettlementReport.setBillingMethod(tranCarInfo.getBillingMethod());
|
|
TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
|
|
if (tranProcessInfo!=null){
|
|
if (tranProcessInfo!=null){
|
|
tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //运输单价不为空
|
|
|
|
- if (tranCarInfo!=null&&tranCarInfo.getTranPrice()!=null){
|
|
|
|
- //实付金额
|
|
|
|
- if(tranSettlementReport.getDeductionAmount() != null){
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
|
- }else{
|
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
|
|
|
+ //运输单价不为空
|
|
|
|
+ if (tranCarInfo.getTranPrice()!=null){
|
|
|
|
+ tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
+ //按吨计费
|
|
|
|
+ if("1".equals(tranSettlementReport.getBillingMethod())) {
|
|
|
|
+ //应付=单价x结算重量
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else{
|
|
|
|
+ //应付
|
|
|
|
+ tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice());
|
|
|
|
+ }
|
|
|
|
+ //实付金额
|
|
|
|
+ if(tranSettlementReport.getDeductionAmount() != null){
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
|
|
+ - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
|
+ }else{
|
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(tranSettlementReport.getAmountIngPayable()
|
|
|
|
+ - tranSettlementReport.getServiceCharge());
|
|
|
|
+ }
|
|
|
|
+ //税点
|
|
|
|
+ tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
+ //合计应付
|
|
|
|
+ tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
+ //未付
|
|
|
|
+ tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
}
|
|
}
|
|
- //税点
|
|
|
|
- tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
|
|
- //合计应付
|
|
|
|
- tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
|
|
|
|
- //未付
|
|
|
|
- tranSettlementReport.setAmountNotPayable(Float.valueOf(String.valueOf(tranSettlementReport.getTotalPayable())));
|
|
|
|
- tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
- tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
|
|
|
|
}
|
|
}
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
} else if ("火运".equals(warehouseInOutInfo.getOutType())) {
|
|
tranSettlementReport.setTranType("火运");
|
|
tranSettlementReport.setTranType("火运");
|