|
@@ -678,6 +678,69 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
|
|
return "ok";
|
|
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
|
|
* @param id
|