diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java index 548d1f93..c8e81f0c 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java @@ -1058,7 +1058,19 @@ public class SDNYMainProcessController extends AbstractController { checkInvoice.put("salesName", checkInvoice.get("xfName")); checkInvoice.put("salesTaxNo", checkInvoice.get("xfTaxNo")); checkInvoice.put("salesAddressPhone", checkInvoice.get("xfAddressAndPhone")); - checkInvoice.put("salesBank", checkInvoice.get("gfBankAndNo")); + checkInvoice.put("salesBank", checkInvoice.get("xfBankAndNo")); + log.info(" salesBank={}",checkInvoice.getString("salesBank")); + String xfAddressAndPhone = checkInvoice.getString("xfAddressAndPhone"); + log.info("xfAddressAndPhone={}",xfAddressAndPhone); + if (StringUtils.isNotBlank(xfAddressAndPhone)){ + String[] split = xfAddressAndPhone.split("\t"); + if (split.length == 2) { + checkInvoice.put("sellerPhone", split[1]); + }else { + checkInvoice.put("sellerPhone", xfAddressAndPhone); + } + } + log.info("sellerPhone={}",checkInvoice.getString("sellerPhone")); checkInvoice.put("checkCode", checkInvoice.get("checkCode")); if("1".equals(checkInvoice.get("invoiceStatus"))){ checkInvoice.put("state", "3"); @@ -1071,6 +1083,14 @@ public class SDNYMainProcessController extends AbstractController { }else if("0".equals(checkInvoice.get("invoiceStatus"))){ checkInvoice.put("state", "0"); } + //机动车添加税率 + if (vehicleList != null && StringUtils.isNotBlank(vehicleList.getString("taxRate"))) { + String taxRate = vehicleList.getString("taxRate"); + BigDecimal tax = new BigDecimal(taxRate); + BigDecimal rate = tax.divide(new BigDecimal(100)); + checkInvoice.put("taxRate", rate); + } + log.info("taxRate={}", checkInvoice.get("taxRate")); checkInvoice.put("tollSign", "07"); //机动车 diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java index 1f7eb926..3ed04e4e 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java @@ -389,13 +389,14 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { jsonObject.put("salesName", invoiceData.get("xhfmc")); jsonObject.put("salesTaxNo", invoiceData.get("xhfsbh")); jsonObject.put("salesAddressPhone", invoiceData.get("xhfdzdh")); -// if (StringUtils.isBlank(jsonObject.getString("salesAddressPhone")) && invoiceData.get("smfdwgrzz") != null && invoiceData.get("smfdh") != null){ -// jsonObject.put("salesAddressPhone", invoiceData.get("smfdwgrzz").toString() +"\t"+ invoiceData.get("smfdh").toString()); -// } + if (StringUtils.isBlank(jsonObject.getString("salesAddressPhone")) && invoiceData.get("smfdwgrzz") != null && invoiceData.get("smfdh") != null){ + jsonObject.put("salesAddressPhone", invoiceData.get("smfdwgrzz").toString() +"\t"+ invoiceData.get("smfdh").toString()); + } if (FplxEnum.JDC.getFplxDm().equals(invoiceType)) { if (invoiceData.get("khyh") != null && invoiceData.get("khzh") != null) { jsonObject.put("salesBank", invoiceData.get("khyh").toString() + invoiceData.get("khzh").toString()); } + jsonObject.put("sellerPhone",invoiceData.get("smfdh")); } else { jsonObject.put("salesBank", invoiceData.get("xhfyhzh")); } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java index 0d4e8bc4..0bd85f44 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java @@ -94,6 +94,7 @@ public class SignSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl 0) { @@ -183,41 +186,41 @@ public class SignSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl 0) { -// boolean deleteStatistics = signInvoiceStatisticsService -// .deleteStatistics(recordInvoice.getInvoiceCode(), recordInvoice.getInvoiceNo(), dbName); -// if (deleteStatistics) { -// signInvoiceStatisticsService.saveInvoiceStatistics(invoiceStatistics, dbName); -// } -// } -// -// } -// // 二手车 -// if (vehicleInvoice != null) { -// -// boolean deleteVehicleSaleInvoice = -// signJdcService.deleteVehicleSaleInvoice(recordInvoice.getUuid(), dbName); -// if (deleteVehicleSaleInvoice) { -// signJdcService.saveVehicleSaleInvoice(vehicleInvoice, dbName); -// } -// -// // 保存税率统计表 -// if (invoiceStatistics.size() > 0) { -// signInvoiceStatisticsService.remove(new UpdateWrapper() -// .eq("invoice_code", recordInvoice.getInvoiceCode()).eq("invoice_no", recordInvoice.getInvoiceNo())); -// signInvoiceStatisticsService.saveBatch(invoiceStatistics); -// } -// -// } + //机动车票 + if (vehicleSaleInvoice != null) { + + boolean deleteVehicleSaleInvoice = + signJdcService.deleteVehicleSaleInvoice(recordInvoice.getUuid(), dbName); + if (deleteVehicleSaleInvoice) { + signJdcService.saveVehicleSaleInvoice(vehicleSaleInvoice, dbName); + } + // 保存税率统计表 + if (invoiceStatistics.size() > 0) { + boolean deleteStatistics = signInvoiceStatisticsService + .deleteStatistics(recordInvoice.getInvoiceCode(), recordInvoice.getInvoiceNo(), dbName); + if (deleteStatistics) { + signInvoiceStatisticsService.saveInvoiceStatistics(invoiceStatistics, dbName); + } + } + + } + // 二手车 + if (vehicleInvoice != null) { + + boolean deleteVehicleSaleInvoice = + signJdcService.deleteVehicleSaleInvoice(recordInvoice.getUuid(), dbName); + if (deleteVehicleSaleInvoice) { + signJdcService.saveVehicleSaleInvoice(vehicleInvoice, dbName); + } + + // 保存税率统计表 + if (invoiceStatistics.size() > 0) { + signInvoiceStatisticsService.remove(new UpdateWrapper() + .eq("invoice_code", recordInvoice.getInvoiceCode()).eq("invoice_no", recordInvoice.getInvoiceNo())); + signInvoiceStatisticsService.saveBatch(invoiceStatistics); + } + + } } }