|
|
|
@ -88,8 +88,6 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
private BaseTDxRecordInvoiceDao baseTDxRecordInvoiceDao; |
|
|
|
|
|
|
|
|
|
public String pushCheckResultToSAP(JSONObject result) throws Exception { |
|
|
|
|
result.put("systemSign", ""); |
|
|
|
|
result.put("roleIds", ""); |
|
|
|
|
log.info("获取角色请求参数:{} , 请求地址:{}", result, snYxUrl); |
|
|
|
|
String post = HttpUtil.post(snYxUrl, result, 30000); |
|
|
|
|
log.info("获取角色返回信息:{}", post); |
|
|
|
@ -113,6 +111,13 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
|
|
|
|
|
String fpdm = snInvoice.getInvoiceCode(); |
|
|
|
|
String fphm = snInvoice.getInvoiceNumber(); |
|
|
|
|
|
|
|
|
|
QueryWrapper<BaseTDxRecordInvoice> recordWrapper = new QueryWrapper<>(); |
|
|
|
|
currentWrapper.eq("uuid", fpdm + fphm); |
|
|
|
|
|
|
|
|
|
BaseTDxRecordInvoice baseTDxRecordInvoice = baseTDxRecordInvoiceDao.selectOne(recordWrapper); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String kprq = snInvoice.getBillingDate(); |
|
|
|
|
String je = snInvoice.getTotalAmount(); |
|
|
|
|
String xfsh = snInvoice.getSalesTaxNo(); |
|
|
|
@ -145,7 +150,12 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
recordInvoice.setInvoiceStatus("0"); |
|
|
|
|
recordInvoice.setInvoiceType(invoiceType); |
|
|
|
|
recordInvoice.setCompany(company); |
|
|
|
|
baseTDxRecordInvoiceDao.insert(recordInvoice); |
|
|
|
|
|
|
|
|
|
if(baseTDxRecordInvoice != null) { |
|
|
|
|
baseTDxRecordInvoiceDao.update(recordInvoice,recordWrapper); |
|
|
|
|
}else{ |
|
|
|
|
baseTDxRecordInvoiceDao.insert(recordInvoice); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -185,7 +195,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
return queryInvoiceResult; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JSONObject singleCheckInvoice(Map<String, String> pramsMap) { |
|
|
|
|
public JSONObject singleCheckInvoice(Map<String, String> pramsMap) throws Exception{ |
|
|
|
|
|
|
|
|
|
//1.封装查验参数
|
|
|
|
|
ApiRequest apiRequest = new ApiRequest(); |
|
|
|
@ -231,80 +241,83 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
if ("0000".equals(contentMap.get("code"))) { |
|
|
|
|
|
|
|
|
|
HashMap<String, Object> invoiceData = JSONObject.parseObject(contentMap.get("data").toString(), HashMap.class); |
|
|
|
|
if("0001".equals(invoiceData.get("cyjg"))) { |
|
|
|
|
jsonObject.put("invoiceType", invoiceType); |
|
|
|
|
jsonObject.put("administrativeDivisionNo", ""); |
|
|
|
|
jsonObject.put("administrativeDivisionName", ""); |
|
|
|
|
|
|
|
|
|
jsonObject.put("invoiceCode", invoiceData.get("fpdm")); |
|
|
|
|
jsonObject.put("invoiceNumber", invoiceData.get("fphm")); |
|
|
|
|
jsonObject.put("billingDate", invoiceData.get("kprq")); |
|
|
|
|
jsonObject.put("purchaserName", invoiceData.get("gmfmc")); |
|
|
|
|
jsonObject.put("purchaserTaxNo", invoiceData.get("gmfsbh")); |
|
|
|
|
jsonObject.put("purchaserBank", invoiceData.get("gmfyhzh")); |
|
|
|
|
jsonObject.put("purchaserAddressPhone", invoiceData.get("gmfdzdh")); |
|
|
|
|
jsonObject.put("salesName", invoiceData.get("xhfmc")); |
|
|
|
|
jsonObject.put("salesTaxNo", invoiceData.get("xhfsbh")); |
|
|
|
|
jsonObject.put("salesAddressPhone", invoiceData.get("xhfdzdh")); |
|
|
|
|
jsonObject.put("salesBank", invoiceData.get("xhfyhzh")); |
|
|
|
|
jsonObject.put("totalAmount", invoiceData.get("totalAmount")); |
|
|
|
|
jsonObject.put("totalTax", invoiceData.get("fpse")); |
|
|
|
|
jsonObject.put("amountTax", invoiceData.get("jshj")); |
|
|
|
|
jsonObject.put("amountTaxCN", ""); |
|
|
|
|
jsonObject.put("checkCode", invoiceData.get("jym")); |
|
|
|
|
jsonObject.put("state", invoiceData.get("zfbz")); |
|
|
|
|
jsonObject.put("carrierName", invoiceData.get("cyrmc")); |
|
|
|
|
jsonObject.put("carrierTaxNo", invoiceData.get("cyrsbh")); |
|
|
|
|
jsonObject.put("draweeName", invoiceData.get("spfmc")); |
|
|
|
|
jsonObject.put("draweeTaxNo", invoiceData.get("spfsbh")); |
|
|
|
|
jsonObject.put("cargoInformation", invoiceData.get("ysgwxx")); |
|
|
|
|
jsonObject.put("transportRoute", invoiceData.get("qydjyddd")); |
|
|
|
|
jsonObject.put("machineCode", invoiceData.get("skph")); |
|
|
|
|
jsonObject.put("tonnage", invoiceData.get("ccdw")); |
|
|
|
|
jsonObject.put("taxAuthorityNo", invoiceData.get("zgswjgdm")); |
|
|
|
|
jsonObject.put("taxAuthorityName", invoiceData.get("zgswjgmc")); |
|
|
|
|
jsonObject.put("remarks", invoiceData.get("bz")); |
|
|
|
|
jsonObject.put("vehicleType", invoiceData.get("cllx")); |
|
|
|
|
jsonObject.put("brandModel", invoiceData.get("cpxh")); |
|
|
|
|
jsonObject.put("originPlace", invoiceData.get("cd")); |
|
|
|
|
jsonObject.put("certificateNo", invoiceData.get("hgzs")); |
|
|
|
|
jsonObject.put("inspectionListNo", invoiceData.get("sjdh")); |
|
|
|
|
jsonObject.put("engineNo", invoiceData.get("fdjhm")); |
|
|
|
|
jsonObject.put("vehicleNo", invoiceData.get("clsbh")); |
|
|
|
|
jsonObject.put("importCertificateNo", invoiceData.get("jszmsh")); |
|
|
|
|
jsonObject.put("paymentVoucherNo", invoiceData.get("wspzhm")); |
|
|
|
|
jsonObject.put("passengersLimited", invoiceData.get("xcrs")); |
|
|
|
|
jsonObject.put("tollSign", invoiceData.get("txfbz")); |
|
|
|
|
jsonObject.put("zeroTaxRateSign", invoiceData.get("lslbs")); |
|
|
|
|
jsonObject.put("source", ""); |
|
|
|
|
jsonObject.put("idcardNo", invoiceData.get("sfzh")); |
|
|
|
|
|
|
|
|
|
List<Map<String, String>> returnDetailList = new ArrayList<>(); |
|
|
|
|
JSONArray detailList = (JSONArray) invoiceData.get("detailList"); |
|
|
|
|
for (int i = 0; i < detailList.size(); i++) { |
|
|
|
|
JSONObject detail = (JSONObject) detailList.get(i); |
|
|
|
|
Map<String, String> snDetailMap = new HashMap<String, String>(); |
|
|
|
|
snDetailMap.put("rowNo", ++i + ""); |
|
|
|
|
snDetailMap.put("commodityCode", detail.getString("mxbh")); |
|
|
|
|
snDetailMap.put("commodityName", detail.getString("hwmc")); |
|
|
|
|
snDetailMap.put("specificationModel", detail.getString("ggxh")); |
|
|
|
|
snDetailMap.put("unit", detail.getString("jldw")); |
|
|
|
|
snDetailMap.put("quantity", detail.getString("spsl")); |
|
|
|
|
snDetailMap.put("unitPrice", detail.getString("hsdj")); |
|
|
|
|
snDetailMap.put("amount", detail.getString("je")); |
|
|
|
|
snDetailMap.put("taxRate", detail.getString("sl")); |
|
|
|
|
snDetailMap.put("tax", detail.getString("se")); |
|
|
|
|
snDetailMap.put("currentDateEnd", detail.getString("txrqz")); |
|
|
|
|
snDetailMap.put("currentDateStart", detail.getString("txrqq")); |
|
|
|
|
snDetailMap.put("licensePlateNum", detail.getString("cph")); |
|
|
|
|
snDetailMap.put("type", detail.getString("lx")); |
|
|
|
|
|
|
|
|
|
returnDetailList.add(snDetailMap); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
jsonObject.put("invoiceType", invoiceType); |
|
|
|
|
jsonObject.put("administrativeDivisionNo", ""); |
|
|
|
|
jsonObject.put("administrativeDivisionName", ""); |
|
|
|
|
|
|
|
|
|
jsonObject.put("invoiceCode", invoiceData.get("fpdm")); |
|
|
|
|
jsonObject.put("invoiceNumber", invoiceData.get("fphm")); |
|
|
|
|
jsonObject.put("billingDate", invoiceData.get("kprq")); |
|
|
|
|
jsonObject.put("purchaserName", invoiceData.get("gmfmc")); |
|
|
|
|
jsonObject.put("purchaserTaxNo", invoiceData.get("gmfsbh")); |
|
|
|
|
jsonObject.put("purchaserBank", invoiceData.get("gmfyhzh")); |
|
|
|
|
jsonObject.put("purchaserAddressPhone", invoiceData.get("gmfdzdh")); |
|
|
|
|
jsonObject.put("salesName", invoiceData.get("xhfmc")); |
|
|
|
|
jsonObject.put("salesTaxNo", invoiceData.get("xhfsbh")); |
|
|
|
|
jsonObject.put("salesAddressPhone", invoiceData.get("xhfdzdh")); |
|
|
|
|
jsonObject.put("salesBank", invoiceData.get("xhfyhzh")); |
|
|
|
|
jsonObject.put("totalAmount", invoiceData.get("totalAmount")); |
|
|
|
|
jsonObject.put("totalTax", invoiceData.get("fpse")); |
|
|
|
|
jsonObject.put("amountTax", invoiceData.get("jshj")); |
|
|
|
|
jsonObject.put("amountTaxCN", ""); |
|
|
|
|
jsonObject.put("checkCode", invoiceData.get("jym")); |
|
|
|
|
jsonObject.put("state", invoiceData.get("zfbz")); |
|
|
|
|
jsonObject.put("carrierName", invoiceData.get("cyrmc")); |
|
|
|
|
jsonObject.put("carrierTaxNo", invoiceData.get("cyrsbh")); |
|
|
|
|
jsonObject.put("draweeName", invoiceData.get("spfmc")); |
|
|
|
|
jsonObject.put("draweeTaxNo", invoiceData.get("spfsbh")); |
|
|
|
|
jsonObject.put("cargoInformation", invoiceData.get("ysgwxx")); |
|
|
|
|
jsonObject.put("transportRoute", invoiceData.get("qydjyddd")); |
|
|
|
|
jsonObject.put("machineCode", invoiceData.get("skph")); |
|
|
|
|
jsonObject.put("tonnage", invoiceData.get("ccdw")); |
|
|
|
|
jsonObject.put("taxAuthorityNo", invoiceData.get("zgswjgdm")); |
|
|
|
|
jsonObject.put("taxAuthorityName", invoiceData.get("zgswjgmc")); |
|
|
|
|
jsonObject.put("remarks", invoiceData.get("bz")); |
|
|
|
|
jsonObject.put("vehicleType", invoiceData.get("cllx")); |
|
|
|
|
jsonObject.put("brandModel", invoiceData.get("cpxh")); |
|
|
|
|
jsonObject.put("originPlace", invoiceData.get("cd")); |
|
|
|
|
jsonObject.put("certificateNo", invoiceData.get("hgzs")); |
|
|
|
|
jsonObject.put("inspectionListNo", invoiceData.get("sjdh")); |
|
|
|
|
jsonObject.put("engineNo", invoiceData.get("fdjhm")); |
|
|
|
|
jsonObject.put("vehicleNo", invoiceData.get("clsbh")); |
|
|
|
|
jsonObject.put("importCertificateNo", invoiceData.get("jszmsh")); |
|
|
|
|
jsonObject.put("paymentVoucherNo", invoiceData.get("wspzhm")); |
|
|
|
|
jsonObject.put("passengersLimited", invoiceData.get("xcrs")); |
|
|
|
|
jsonObject.put("tollSign", invoiceData.get("txfbz")); |
|
|
|
|
jsonObject.put("zeroTaxRateSign", invoiceData.get("lslbs")); |
|
|
|
|
jsonObject.put("source", ""); |
|
|
|
|
jsonObject.put("idcardNo", invoiceData.get("sfzh")); |
|
|
|
|
|
|
|
|
|
List<Map<String, String>> returnDetailList = new ArrayList<>(); |
|
|
|
|
JSONArray detailList = (JSONArray) invoiceData.get("detailList"); |
|
|
|
|
for (int i = 0;i<detailList.size();i++) { |
|
|
|
|
JSONObject detail = (JSONObject) detailList.get(i); |
|
|
|
|
Map<String, String> snDetailMap = new HashMap<String, String>(); |
|
|
|
|
snDetailMap.put("rowNo", i + ""); |
|
|
|
|
snDetailMap.put("commodityCode", detail.getString("mxbh")); |
|
|
|
|
snDetailMap.put("commodityName", detail.getString("hwmc")); |
|
|
|
|
snDetailMap.put("specificationModel", detail.getString("ggxh")); |
|
|
|
|
snDetailMap.put("unit", detail.getString("jldw")); |
|
|
|
|
snDetailMap.put("quantity", detail.getString("spsl")); |
|
|
|
|
snDetailMap.put("unitPrice", detail.getString("hsdj")); |
|
|
|
|
snDetailMap.put("amount", detail.getString("je")); |
|
|
|
|
snDetailMap.put("taxRate", detail.getString("sl")); |
|
|
|
|
snDetailMap.put("tax", detail.getString("se")); |
|
|
|
|
snDetailMap.put("currentDateEnd", detail.getString("txrqz")); |
|
|
|
|
snDetailMap.put("currentDateStart", detail.getString("txrqq")); |
|
|
|
|
snDetailMap.put("licensePlateNum", detail.getString("cph")); |
|
|
|
|
snDetailMap.put("type", detail.getString("lx")); |
|
|
|
|
|
|
|
|
|
returnDetailList.add(snDetailMap); |
|
|
|
|
i++; |
|
|
|
|
jsonObject.put("invoiceLineList", returnDetailList); |
|
|
|
|
}else{ |
|
|
|
|
jsonObject.put("cyjg",invoiceData.get("cyjg")); |
|
|
|
|
jsonObject.put("cyjgxx",invoiceData.get("cyjgxx")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
jsonObject.put("invoiceLineList", returnDetailList); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
jsonObject.put("code", contentMap.get("code")); |
|
|
|
|
jsonObject.put("message", contentMap.get("message")); |
|
|
|
|