zhangyuewww 2 سال پیش
والد
کامیت
b9e92f7640

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranProcessInfoServiceImpl.java

@@ -458,6 +458,11 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                                     if ("0".equals(tranSettlementReport1.getManualFlag())) {
                                         //卸车不为空时,结算重量=装卸取小
                                         tranSettlementReport1.setSettlementWeight(tranCarInfo.getLoadNetWeight() > tranCarInfo.getUnloadNetWeight() ? tranCarInfo.getUnloadNetWeight() : tranCarInfo.getLoadNetWeight());
+                                        tranSettlementReport1.setTransportDamage(tranSettlementReport1.getSettlementWeight()*0.001);
+                                    }
+                                    //损耗大于结算重量的1‰时=损耗-结算重量x1‰
+                                    if (tranSettlementReport1.getLossWeight()>tranSettlementReport1.getSettlementWeight()*0.001){
+                                        tranSettlementReport1.setCargoDamage(tranSettlementReport1.getLossWeight()-tranSettlementReport1.getSettlementWeight()*0.001);
                                     }
                                     //扣款
                                     if (tranSettlementReport1.getLossWeight() <= (tranCarInfo.getLoadNetWeight() / 1000)) {

+ 35 - 14
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranSettlementReportServiceImpl.java

@@ -226,7 +226,7 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
     }
 
     /**
-     * 修改结算重量0修改扣款1修改已开发票2设置本次账户3服务费4
+     * 修改结算重量0 修改扣款1 修改已开发票2 设置本次账户3 服务费4 实际损耗5 修改结算单价6
      *
      * @param tranSettlementReport
      * @return
@@ -268,7 +268,6 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
                 tranSettlementReport1.setAmountNotPayable(Float.parseFloat(df1.format(f)));
                 //更改汽运结算信息
                 this.updateById(tranSettlementReport1);
-                return "OK";
             }
             //1 修改扣款
             else if (tranSettlementReport.getFlag() == 1) {
@@ -289,24 +288,21 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
                 tranSettlementReport1.setAmountNotPayable(Float.parseFloat(df1.format(f)));
                 //更改汽运结算信息
                 this.updateById(tranSettlementReport1);
-                return "OK";
-            }
-            //3 设置本次账户
-            else if (tranSettlementReport.getFlag() == 3) {
-                tranSettlementReport1.setCardNo(tranSettlementReport.getCardNo());
-                //更改汽运结算信息
-                this.updateById(tranSettlementReport1);
-                return "OK";
             }
             //2 修改已开发票
             else if (tranSettlementReport.getFlag() == 2){
                 tranSettlementReport1.setAlreadyInvoice(tranSettlementReport1.getAlreadyInvoice() + tranSettlementReport.getAlreadyInvoice());
                 //更改汽运结算信息
                 this.updateById(tranSettlementReport1);
-                return "OK";
+            }
+            //3 设置本次账户
+            else if (tranSettlementReport.getFlag() == 3) {
+                tranSettlementReport1.setCardNo(tranSettlementReport.getCardNo());
+                //更改汽运结算信息
+                this.updateById(tranSettlementReport1);
             }
             //4 修改服务费
-            else{
+            else if (tranSettlementReport.getFlag() == 4){
                 tranSettlementReport1.setServiceCharge(tranSettlementReport.getServiceCharge());
                 //实付金额
                 tranSettlementReport1.setAmountActuallyPaid(Double.valueOf(tranSettlementReport1.getTransportPrice()) * tranSettlementReport1.getSettlementWeight()
@@ -322,10 +318,35 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
                 tranSettlementReport1.setAmountNotPayable(Float.parseFloat(df1.format(f)));
                 //更改汽运结算信息
                 this.updateById(tranSettlementReport1);
-                return "OK";
+            }
+            //5 实际损耗
+            else if (tranSettlementReport.getFlag() == 5){
+                tranSettlementReport1.setActualLoss(tranSettlementReport.getActualLoss());
+                //更改汽运结算信息
+                this.updateById(tranSettlementReport1);
+            }
+            //6 修改结算单价
+            else if (tranSettlementReport.getFlag() == 6) {
+                tranSettlementReport1.setSettlementPrice(tranSettlementReport.getSettlementPrice());
+                tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getSettlementWeight()*Float.valueOf(String.valueOf(tranSettlementReport1.getSettlementPrice()))-Float.valueOf(tranSettlementReport1.getDeductionAmount()));
+                tranSettlementReport1.setAmountNotPayable(tranSettlementReport1.getAmountIngPayable()-tranSettlementReport1.getAmountEdPayable());
+                //实付金额
+                tranSettlementReport1.setAmountActuallyPaid(tranSettlementReport1.getSettlementPrice() * tranSettlementReport1.getSettlementWeight()
+                        - Double.valueOf(tranSettlementReport1.getDeductionAmount() != null ? tranSettlementReport1.getDeductionAmount() : "0") - tranSettlementReport1.getServiceCharge());
+                //税点
+                tranSettlementReport1.setTaxPoint(tranSettlementReport1.getAmountActuallyPaid()/0.946*0.054);
+                //合计应付
+                tranSettlementReport1.setTotalPayable(tranSettlementReport1.getAmountActuallyPaid()+tranSettlementReport1.getTaxPoint());
+                //未付金额
+                Float f = 0.0f;
+                f = tranSettlementReport1.getTotalPayable().floatValue() - tranSettlementReport1.getAmountEdPayable();
+                DecimalFormat df1 = new DecimalFormat("#.00");
+                tranSettlementReport1.setAmountNotPayable(Float.parseFloat(df1.format(f)));
+                //更改汽运结算信息
+                this.updateById(tranSettlementReport1);
             }
         }
-        return "NG";
+        return "OK";
     }
 
     /**

+ 159 - 139
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java

@@ -967,6 +967,11 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                 if ("0".equals(tranSettlementReport.getManualFlag())) {
                                     //卸车不为空时,结算重量=装卸取小
                                     tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
+                                    tranSettlementReport.setTransportDamage(tranSettlementReport.getSettlementWeight()*0.001);
+                                }
+                                //损耗大于结算重量的1‰时=损耗-结算重量x1‰
+                                if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
+                                    tranSettlementReport.setCargoDamage(tranSettlementReport.getLossWeight()-tranSettlementReport.getSettlementWeight()*0.001);
                                 }
                                 if (tranSettlementReport.getTransportPrice()!=null) {
                                     //扣款
@@ -1494,6 +1499,29 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     if ("汽运".equals(warehouseInOutInfo.getOutType())) {
                                         tranSettlementReport.setTranType("汽运");
                                         tranSettlementReport.setTranTypeKey("1");
+                                        tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
+                                        tranSettlementReport.setServiceCharge(20d);
+                                        //运输单价不为空
+                                        if (tranProcessInfo.getTranPrice()!=null){
+                                            //应付
+                                            tranSettlementReport.setAmountIngPayable(Float.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
+                                            //实付金额
+                                            if(tranSettlementReport.getDeductionAmount() != null){
+                                                tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
+                                                        - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
+                                            }else{
+                                                tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
+                                                        - tranSettlementReport.getServiceCharge());
+                                            }
+                                            //税点
+                                            tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
+                                            //合计应付
+                                            tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
+                                            //未付
+                                            tranSettlementReport.setAmountNotPayable(Float.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
+                                            tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
+                                            tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())));
+                                        }
                                     } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
                                         tranSettlementReport.setTranType("火运");
                                         TranCarInfo tranCarInfo=tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
@@ -1524,29 +1552,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     }
                                     tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
                                     tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
-                                    tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                                    tranSettlementReport.setServiceCharge(20d);
-                                    //运输单价不为空
-                                    if (tranProcessInfo.getTranPrice()!=null){
-                                        //应付
-                                        tranSettlementReport.setAmountIngPayable(Float.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
-                                        //实付金额
-                                        if(tranSettlementReport.getDeductionAmount() != null){
-                                            tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
-                                                    - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
-                                        }else{
-                                            tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
-                                                    - tranSettlementReport.getServiceCharge());
-                                        }
-                                        //税点
-                                        tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
-                                        //合计应付
-                                        tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
-                                        //未付
-                                        tranSettlementReport.setAmountNotPayable(Float.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
-                                        tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
-                                        tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())));
-                                    }
                                     tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
                                     tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                                     tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
@@ -1690,6 +1695,30 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             if ("汽运".equals(warehouseInOutInfo.getOutType())) {
                                 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&&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());
+                                    }
+                                    //税点
+                                    tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
+                                    //合计应付
+                                    tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
+                                    //应付
+                                    tranSettlementReport.setAmountIngPayable(Float.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
+                                    //未付
+                                    tranSettlementReport.setAmountNotPayable(Float.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
+                                    tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
+                                    tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
+                                }
                             } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
                                 tranSettlementReport.setTranType("火运");
                                 TranCarInfo tranCarInfo=tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
@@ -1720,29 +1749,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             }
                             tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
                             tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
-                            tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                            tranSettlementReport.setServiceCharge(20d);
-                            //运输单价不为空
-                            if (warehouseInOutInfo.getFreight()!=null){
-                                //实付金额
-                                if(tranSettlementReport.getDeductionAmount() != null){
-                                    tranSettlementReport.setAmountActuallyPaid(Double.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight()
-                                            - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
-                                }else{
-                                    tranSettlementReport.setAmountActuallyPaid(Double.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight()
-                                            - tranSettlementReport.getServiceCharge());
-                                }
-                                //税点
-                                tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
-                                //合计应付
-                                tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
-                                //应付
-                                tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                                //未付
-                                tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                                tranSettlementReport.setTransportPrice(warehouseInOutInfo.getFreight());
-                                tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(warehouseInOutInfo.getFreight())));
-                            }
                             tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
                             tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                             tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
@@ -2231,7 +2237,31 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
                         if ("汽运".equals(warehouseInOutInfo.getOutType())) {
                             tranSettlementReport.setTranType("汽运");
+                            tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
+                            tranSettlementReport.setServiceCharge(20d);
                             tranSettlementReport.setTranTypeKey("1");
+                            TranCarInfo tranCarInfo=tranCarInfoService.selectById(warehouseInOutInfo.getCarId());
+                            //运输单价不为空
+                            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());
+                                }
+                                //税点
+                                tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
+                                //合计应付
+                                tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
+                                //应付
+                                tranSettlementReport.setAmountIngPayable(Float.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
+                                //未付
+                                tranSettlementReport.setAmountNotPayable(Float.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
+                                tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
+                                tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
+                            }
                         } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
                             tranSettlementReport.setTranType("火运");
                             TranCarInfo tranCarInfo=tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
@@ -2262,29 +2292,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         }
                         tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
                         tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
-                        tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                        tranSettlementReport.setServiceCharge(20d);
-                        //运输单价不为空
-                        if (warehouseInOutInfo.getFreight()!=null){
-                            //实付金额
-                            if(tranSettlementReport.getDeductionAmount() != null){
-                                tranSettlementReport.setAmountActuallyPaid(Double.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight()
-                                        - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
-                            }else{
-                                tranSettlementReport.setAmountActuallyPaid(Double.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight()
-                                        - tranSettlementReport.getServiceCharge());
-                            }
-                            //税点
-                            tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
-                            //合计应付
-                            tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
-                            //应付
-                            tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                            //未付
-                            tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                            tranSettlementReport.setTransportPrice(warehouseInOutInfo.getFreight());
-                            tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(warehouseInOutInfo.getFreight())));
-                        }
                         tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
                         tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                         tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
@@ -3773,6 +3780,11 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     if ("0".equals(tranSettlementReport.getManualFlag())) {
                                         //卸车不为空时,结算重量=装卸取小
                                         tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
+                                        tranSettlementReport.setTransportDamage(tranSettlementReport.getSettlementWeight()*0.001);
+                                    }
+                                    //损耗大于结算重量的1‰时=损耗-结算重量x1‰
+                                    if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
+                                        tranSettlementReport.setCargoDamage(tranSettlementReport.getLossWeight()-tranSettlementReport.getSettlementWeight()*0.001);
                                     }
                                     if (tranSettlementReport.getTransportPrice() != null) {
                                         //扣款
@@ -4416,6 +4428,29 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     if ("汽运".equals(warehouseInOutInfo.getOutType())) {
                                         tranSettlementReport.setTranType("汽运");
                                         tranSettlementReport.setTranTypeKey("1");
+                                        tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
+                                        tranSettlementReport.setServiceCharge(20d);
+                                        //运输单价不为空
+                                        if (tranProcessInfo.getTranPrice()!=null){
+                                            //实付金额
+                                            if(tranSettlementReport.getDeductionAmount() != null){
+                                                tranSettlementReport.setAmountActuallyPaid(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())) * tranSettlementReport.getSettlementWeight()
+                                                        - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
+                                            }else{
+                                                tranSettlementReport.setAmountActuallyPaid(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())) * tranSettlementReport.getSettlementWeight()
+                                                        - tranSettlementReport.getServiceCharge());
+                                            }
+                                            //税点
+                                            tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
+                                            //合计应付
+                                            tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
+                                            //应付
+                                            tranSettlementReport.setAmountIngPayable(tranProcessInfo.getTranPrice() * tranSettlementReport.getSettlementWeight());
+                                            //未付
+                                            tranSettlementReport.setAmountNotPayable(tranProcessInfo.getTranPrice() * tranSettlementReport.getSettlementWeight());
+                                            tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
+                                            tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())));
+                                        }
                                     } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
                                         tranSettlementReport.setTranType("火运");
                                         TranCarInfo tranCarInfo=tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
@@ -4448,29 +4483,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
                                     tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
                                     tranSettlementReport.setStartAddress(warehouseInOutInfo.getWarehouseName());
-                                    tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                                    tranSettlementReport.setServiceCharge(20d);
-                                    //运输单价不为空
-                                    if (tranProcessInfo.getTranPrice()!=null){
-                                        //实付金额
-                                        if(tranSettlementReport.getDeductionAmount() != null){
-                                            tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
-                                                    - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
-                                        }else{
-                                            tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight()
-                                                     - tranSettlementReport.getServiceCharge());
-                                        }
-                                        //税点
-                                        tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
-                                        //合计应付
-                                        tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
-                                        //应付
-                                        tranSettlementReport.setAmountIngPayable(Float.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
-                                        //未付
-                                        tranSettlementReport.setAmountNotPayable(Float.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
-                                        tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
-                                        tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())));
-                                    }
                                     tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
                                     tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                                     tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
@@ -4635,6 +4647,30 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             if ("汽运".equals(warehouseInOutInfo.getOutType())) {
                                 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&&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());
+                                    }
+                                    //税点
+                                    tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
+                                    //合计应付
+                                    tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
+                                    //应付
+                                    tranSettlementReport.setAmountIngPayable(Float.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
+                                    //未付
+                                    tranSettlementReport.setAmountNotPayable(Float.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
+                                    tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
+                                    tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
+                                }
                             } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
                                 tranSettlementReport.setTranType("火运");
                                 TranCarInfo tranCarInfo=tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
@@ -4666,29 +4702,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
                             tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
                             tranSettlementReport.setStartAddress(warehouseInOutInfo.getWarehouseName());
-                            tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                            tranSettlementReport.setServiceCharge(20d);
-                            //运输单价不为空
-                            if (warehouseInOutInfo.getFreight()!=null){
-                                //实付金额
-                                if(tranSettlementReport.getDeductionAmount() != null){
-                                    tranSettlementReport.setAmountActuallyPaid(Double.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight()
-                                            - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
-                                }else{
-                                    tranSettlementReport.setAmountActuallyPaid(Double.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight()
-                                            - tranSettlementReport.getServiceCharge());
-                                }
-                                //税点
-                                tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
-                                //合计应付
-                                tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
-                                //应付
-                                tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                                //未付
-                                tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                                tranSettlementReport.setTransportPrice(warehouseInOutInfo.getFreight());
-                                tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(warehouseInOutInfo.getFreight())));
-                            }
                             tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
                             tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                             tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
@@ -4962,6 +4975,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                 .eq("deliver_type", "2")
                                 .eq("contract_type", "1")
                                 .eq("delete_flag", "0"));
+
                         //现货销售出库报表
                         StockSaleReceiptReport stockSaleReceiptReport = new StockSaleReceiptReport();
                         stockSaleReceiptReport.setId(IdGenerator.generateUUID());
@@ -4974,7 +4988,12 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         stockSaleReceiptReport.setTare(Double.valueOf(String.valueOf(warehouseInOutInfo.getTare())));
                         stockSaleReceiptReport.setNetWeight(Double.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                         stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                        stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(warehouseInOutInfo.getCost()==null?(contractManagementInfoSale.getUnitContractPrice()==null?0:contractManagementInfoSale.getUnitContractPrice()):warehouseInOutInfo.getCost())));
+                        if (contractManagementInfoSale!=null) {
+                            stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(warehouseInOutInfo.getCost() == null ? (contractManagementInfoSale.getUnitContractPrice() == null ? 0 : contractManagementInfoSale.getUnitContractPrice()) : warehouseInOutInfo.getCost())));
+                        }
+                        else {
+                            stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(warehouseInOutInfo.getCost() == null ? (contractManagementInfo.getUnitContractPrice() == null ? 0 : contractManagementInfo.getUnitContractPrice()) : warehouseInOutInfo.getCost())));
+                        }
                         stockSaleReceiptReport.setAmountEdReceivable(0.0d);
                         stockSaleReceiptReport.setDeliveryDate(warehouseInOutInfo.getInOutDate());
                         stockSaleReceiptReport.setAmountIngReceivable(stockSaleReceiptReport.getSettlementPrice() * warehouseInOutInfo.getNetWeight());
@@ -5250,6 +5269,30 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         if ("汽运".equals(warehouseInOutInfo.getOutType())) {
                             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&&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());
+                                }
+                                //税点
+                                tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
+                                //合计应付
+                                tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
+                                //应付
+                                tranSettlementReport.setAmountIngPayable(Float.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
+                                //未付
+                                tranSettlementReport.setAmountNotPayable(Float.valueOf(tranCarInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
+                                tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
+                                tranSettlementReport.setSettlementPrice(Double.valueOf(tranCarInfo.getTranPrice()));
+                            }
                         } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
                             tranSettlementReport.setTranType("火运");
                             TranCarInfo tranCarInfo=tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
@@ -5282,29 +5325,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
                         tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
                         tranSettlementReport.setStartAddress(warehouseInOutInfo.getWarehouseName());
-                        tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                        tranSettlementReport.setServiceCharge(20d);
-                        //运输单价不为空
-                        if (warehouseInOutInfo.getFreight()!=null){
-                            //实付金额
-                            if(tranSettlementReport.getDeductionAmount() != null){
-                                tranSettlementReport.setAmountActuallyPaid(Double.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight()
-                                        - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
-                            }else{
-                                tranSettlementReport.setAmountActuallyPaid(Double.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight()
-                                        - tranSettlementReport.getServiceCharge());
-                            }
-                            //税点
-                            tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
-                            //合计应付
-                            tranSettlementReport.setTotalPayable(tranSettlementReport.getAmountActuallyPaid()+tranSettlementReport.getTaxPoint());
-                            //应付
-                            tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                            //未付
-                            tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                            tranSettlementReport.setTransportPrice(warehouseInOutInfo.getFreight());
-                            tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(warehouseInOutInfo.getFreight())));
-                        }
                         tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
                         tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                         tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());