zhangyuewww 1 年之前
父节点
当前提交
490a004b15

+ 9 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/TranSettlementReportController.java

@@ -83,6 +83,15 @@ public class TranSettlementReportController {
     public String openInvoiceList(@RequestBody TranSettlementReport tranSettlementReport) {
         return tranSettlementReportService.openInvoiceList(tranSettlementReport);
     }
+    /**
+     * 批量清空服务费/税点
+     * @param tranSettlementReport
+     * @return
+     */
+    @PostMapping("/api/batchEmptying")
+    public String batchEmptying(@RequestBody TranSettlementReport tranSettlementReport) {
+        return tranSettlementReportService.batchEmptying(tranSettlementReport);
+    }
     /**
      * 查看
      */

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ITranSettlementReportService.java

@@ -63,4 +63,5 @@ public interface ITranSettlementReportService extends IService<TranSettlementRep
     void export(TranSettlementReport tranSettlementReport, HttpServletResponse response) throws Exception;
 
 
+    String batchEmptying(TranSettlementReport tranSettlementReport);
 }

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

@@ -678,6 +678,69 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
         return "ok";
     }
 
+    /**
+     * 批量清空
+     * @param tranSettlementReport
+     * @return
+     */
+    @Override
+    public String batchEmptying(TranSettlementReport tranSettlementReport) {
+        List<TranSettlementReport> tranSettlementReportList = tranSettlementReport.getTranSettlementReportList();
+        //批量
+        if (!CollectionUtils.isEmpty(tranSettlementReportList)) {
+            //1清空服务费
+            if (tranSettlementReport.getFlag()==1) {
+                for (TranSettlementReport tranSettlementReport1 : tranSettlementReportList) {
+                    tranSettlementReport1.setServiceCharge(0d);
+                    //按吨计费
+                    if("1".equals(tranSettlementReport1.getBillingMethod())) {
+                        //应付=单价x结算重量
+                        tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice() * tranSettlementReport1.getSettlementWeight());
+                    }
+                    //按车
+                    else{
+                        //应付
+                        tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice());
+                    }
+                    //实付金额
+                    tranSettlementReport1.setAmountActuallyPaid(tranSettlementReport1.getAmountIngPayable()
+                            - (tranSettlementReport1.getDeductionAmount() != null ? tranSettlementReport1.getDeductionAmount() : 0d) - tranSettlementReport1.getServiceCharge());
+                    //手动清空过税点的不再被影响
+                    if (!"1".equals(tranSettlementReport1.getManualTax())) {
+                        //税点
+                        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);
+                }
+            }
+            //2清空税点
+            else if (tranSettlementReport.getFlag()==2) {
+                for (TranSettlementReport tranSettlementReport1 : tranSettlementReportList) {
+                    tranSettlementReport1.setManualTax("1");
+                    //税点
+                    tranSettlementReport1.setTaxPoint(0d);
+                    //合计应付
+                    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 "ok";
+    }
     /**
      * 查看
      * @param id

+ 2 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/TranSettlementReportMapper.xml

@@ -115,6 +115,8 @@
         actual_loss as actualLoss,
         cargo_damage as cargoDamage,
         manual_flag as manualFlag,
+        manual_tax as manualTax,
+        manual_identification as manualIdentification,
         transport_price as transportPrice,
         settlement_price as settlementPrice,
         settlement_weight as settlementWeight,