|
@@ -271,115 +271,118 @@ public class TransactionRecordService {
|
|
|
for (PayLog payLog : payLogs) {
|
|
|
try {
|
|
|
|
|
|
- if (customerMap.containsKey(payLog.getCustomerManagementId())) {
|
|
|
- CustomerManagement customerManagement = customerMap.get(payLog.getCustomerManagementId());
|
|
|
- // 项目档案编码
|
|
|
- String def10 = "";
|
|
|
- if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
- def10 = parkInfoMap.get(customerManagement.getGroupId()).getArchiveCode();
|
|
|
- }
|
|
|
- // 组织机构编码
|
|
|
- String pk_org = "";
|
|
|
- if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
- pk_org = parkInfoMap.get(customerManagement.getGroupId()).getOrganizationalCode();
|
|
|
- }
|
|
|
- String pk_subjcode = "";
|
|
|
- // 定金
|
|
|
- if (payLog.getContentType() == 1) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
|
|
|
- }
|
|
|
- // 首付
|
|
|
- if (payLog.getContentType() == 2) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ002;
|
|
|
- }
|
|
|
- // 银行按揭
|
|
|
- if (payLog.getContentType() == 3) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ006;
|
|
|
- }
|
|
|
- // 专项维修资金
|
|
|
- if (payLog.getContentType() == 4) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ015;
|
|
|
- }
|
|
|
- // 楼款
|
|
|
- if (payLog.getContentType() == 5) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003;
|
|
|
- }
|
|
|
- // 补差款
|
|
|
- if (payLog.getContentType() == 6) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ004;
|
|
|
- }
|
|
|
- // 意向金
|
|
|
- if (payLog.getContentType() == 7) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026;
|
|
|
- }
|
|
|
-
|
|
|
- String pk_balatype = "";
|
|
|
- // 现金
|
|
|
- if (payLog.getPaymentMethod() == 1) {
|
|
|
- pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_0;
|
|
|
- }
|
|
|
- // 支付宝
|
|
|
- if (payLog.getPaymentMethod() == 2) {
|
|
|
- pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
- }
|
|
|
- // 微信
|
|
|
- if (payLog.getPaymentMethod() == 3) {
|
|
|
- pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
- }
|
|
|
- // 银行卡
|
|
|
- if (payLog.getPaymentMethod() == 3) {
|
|
|
- pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- JSONObject ar_gatherbill = new JSONObject();
|
|
|
- String srcsystemid = payLog.getId();
|
|
|
- String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
- ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
|
|
|
- ar_gatherbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F2_Cxx_06); //交易类型,必选
|
|
|
- ar_gatherbill.put("pk_org", pk_org); //组织编码,必选
|
|
|
- ar_gatherbill.put("billdate", billdate); //单据日期
|
|
|
- ar_gatherbill.put("def2", srcsystemid); //外系统单据号,必填,
|
|
|
- json.put("ar_gatherbill", ar_gatherbill);
|
|
|
-
|
|
|
- JSONArray ar_gatheritem = new JSONArray();
|
|
|
- JSONObject ar_gatheritemJson = new JSONObject();
|
|
|
- ar_gatheritemJson.put("srcsystemid", srcsystemid); //外系统子表标识
|
|
|
- ar_gatheritemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
|
|
|
- ar_gatheritemJson.put("customer", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
|
|
|
- ar_gatheritemJson.put("money_cr", payLog.getPayMoney()); //金额,必选
|
|
|
- ar_gatheritemJson.put("taxrate", "0"); //税率,必选,数字——3/10/6````
|
|
|
- ar_gatheritemJson.put("pk_balatype", pk_balatype); //结算方式,必选,看云文档结算方式
|
|
|
- ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
|
|
|
- ar_gatheritemJson.put("prepay", "1"); //收款性质应收款时传"0",收款性质预收款时传"1"
|
|
|
- ar_gatheritemJson.put("recaccount", payLog.getBankNumber()); //收款银行账号,必填
|
|
|
- ar_gatheritemJson.put("scomment", customerManagement.getBuyerName()); //客户名称,必选
|
|
|
- ar_gatheritemJson.put("pk_subjcode", pk_subjcode); //收款类型
|
|
|
- ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
|
|
|
- ar_gatheritemJson.put("checkno", payLog.getSerialNumber()); //票据号,必选
|
|
|
- ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
|
|
|
- ar_gatheritemJson.put("def11", payLog.getHouseId()); //转出前房号编码,收除了诚意金之外的首期等需要选
|
|
|
- ar_gatheritemJson.put("def10", def10); //项目档案编码,看云文档项目档案对照
|
|
|
- // TODO: 2024/11/22 银行流水号 待定 暂时不传
|
|
|
+ // 只有未推送或推送失败的才进行推送
|
|
|
+ if(payLog.getNcSubmitStatus() == null || payLog.getNcSubmitStatus() == 0 || payLog.getNcSubmitStatus() == 2) {
|
|
|
+ if (customerMap.containsKey(payLog.getCustomerManagementId())) {
|
|
|
+ CustomerManagement customerManagement = customerMap.get(payLog.getCustomerManagementId());
|
|
|
+ // 项目档案编码
|
|
|
+ String def10 = "";
|
|
|
+ if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
+ def10 = parkInfoMap.get(customerManagement.getGroupId()).getArchiveCode();
|
|
|
+ }
|
|
|
+ // 组织机构编码
|
|
|
+ String pk_org = "";
|
|
|
+ if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
+ pk_org = parkInfoMap.get(customerManagement.getGroupId()).getOrganizationalCode();
|
|
|
+ }
|
|
|
+ String pk_subjcode = "";
|
|
|
+ // 定金
|
|
|
+ if (payLog.getContentType() == 1) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
|
|
|
+ }
|
|
|
+ // 首付
|
|
|
+ if (payLog.getContentType() == 2) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ002;
|
|
|
+ }
|
|
|
+ // 银行按揭
|
|
|
+ if (payLog.getContentType() == 3) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ006;
|
|
|
+ }
|
|
|
+ // 专项维修资金
|
|
|
+ if (payLog.getContentType() == 4) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ015;
|
|
|
+ }
|
|
|
+ // 楼款
|
|
|
+ if (payLog.getContentType() == 5) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003;
|
|
|
+ }
|
|
|
+ // 补差款
|
|
|
+ if (payLog.getContentType() == 6) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ004;
|
|
|
+ }
|
|
|
+ // 意向金
|
|
|
+ if (payLog.getContentType() == 7) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026;
|
|
|
+ }
|
|
|
+
|
|
|
+ String pk_balatype = "";
|
|
|
+ // 现金
|
|
|
+ if (payLog.getPaymentMethod() == 1) {
|
|
|
+ pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_0;
|
|
|
+ }
|
|
|
+ // 支付宝
|
|
|
+ if (payLog.getPaymentMethod() == 2) {
|
|
|
+ pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
+ }
|
|
|
+ // 微信
|
|
|
+ if (payLog.getPaymentMethod() == 3) {
|
|
|
+ pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
+ }
|
|
|
+ // 银行卡
|
|
|
+ if (payLog.getPaymentMethod() == 3) {
|
|
|
+ pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ JSONObject ar_gatherbill = new JSONObject();
|
|
|
+ String srcsystemid = payLog.getId();
|
|
|
+ String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
+ ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
|
|
|
+ ar_gatherbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F2_Cxx_06); //交易类型,必选
|
|
|
+ ar_gatherbill.put("pk_org", pk_org); //组织编码,必选
|
|
|
+ ar_gatherbill.put("billdate", billdate); //单据日期
|
|
|
+ ar_gatherbill.put("def2", srcsystemid); //外系统单据号,必填,
|
|
|
+ json.put("ar_gatherbill", ar_gatherbill);
|
|
|
+
|
|
|
+ JSONArray ar_gatheritem = new JSONArray();
|
|
|
+ JSONObject ar_gatheritemJson = new JSONObject();
|
|
|
+ ar_gatheritemJson.put("srcsystemid", srcsystemid); //外系统子表标识
|
|
|
+ ar_gatheritemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
|
|
|
+ ar_gatheritemJson.put("customer", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
|
|
|
+ ar_gatheritemJson.put("money_cr", payLog.getPayMoney()); //金额,必选
|
|
|
+ ar_gatheritemJson.put("taxrate", "0"); //税率,必选,数字——3/10/6````
|
|
|
+ ar_gatheritemJson.put("pk_balatype", pk_balatype); //结算方式,必选,看云文档结算方式
|
|
|
+ ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
|
|
|
+ ar_gatheritemJson.put("prepay", "1"); //收款性质应收款时传"0",收款性质预收款时传"1"
|
|
|
+ ar_gatheritemJson.put("recaccount", payLog.getBankNumber()); //收款银行账号,必填
|
|
|
+ ar_gatheritemJson.put("scomment", customerManagement.getBuyerName()); //客户名称,必选
|
|
|
+ ar_gatheritemJson.put("pk_subjcode", pk_subjcode); //收款类型
|
|
|
+ ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
|
|
|
+ ar_gatheritemJson.put("checkno", payLog.getSerialNumber()); //票据号,必选
|
|
|
+ ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
|
|
|
+ ar_gatheritemJson.put("def11", payLog.getHouseId()); //转出前房号编码,收除了诚意金之外的首期等需要选
|
|
|
+ ar_gatheritemJson.put("def10", def10); //项目档案编码,看云文档项目档案对照
|
|
|
+ // TODO: 2024/11/22 银行流水号 待定 暂时不传
|
|
|
// ar_gatheritemJson.put("top_billid", pkInformerId); //到账通知生单时,(银行流水中返回的id,见5.2.10到账通知认领查询pk_informer字段)
|
|
|
- ar_gatheritem.add(ar_gatheritemJson);
|
|
|
- json.put("ar_gatheritem", ar_gatheritem);
|
|
|
+ ar_gatheritem.add(ar_gatheritemJson);
|
|
|
+ json.put("ar_gatheritem", ar_gatheritem);
|
|
|
+
|
|
|
+ log.info("收款凭证推送详情:{}", json.toJSONString());
|
|
|
+
|
|
|
+ String result = InvoiceUtil.gatheringbillAdd(json);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
+ if (jsonObject.getString("success").equals("true")) {
|
|
|
+ payLog.setNcSubmitStatus(1);
|
|
|
+ } else {
|
|
|
+ payLog.setNcSubmitStatus(2);
|
|
|
+ }
|
|
|
+ payLog.setNcJson(result);
|
|
|
+ payLog.setNcSubmitDate(new Date());
|
|
|
+ payLog.setNcSubmitName(ShiroUtils.getUser().getTruename());
|
|
|
+ payLogMapper.updateByPrimaryKeySelective(payLog);
|
|
|
|
|
|
- log.info("收款凭证推送详情:{}", json.toJSONString());
|
|
|
-
|
|
|
- String result = InvoiceUtil.gatheringbillAdd(json);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
- if (jsonObject.getString("success").equals("true")) {
|
|
|
- payLog.setNcSubmitStatus(1);
|
|
|
- } else {
|
|
|
- payLog.setNcSubmitStatus(2);
|
|
|
}
|
|
|
- payLog.setNcJson(result);
|
|
|
- payLog.setNcSubmitDate(new Date());
|
|
|
- payLog.setNcSubmitName(ShiroUtils.getUser().getTruename());
|
|
|
- payLogMapper.updateByPrimaryKeySelective(payLog);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
@@ -423,108 +426,110 @@ public class TransactionRecordService {
|
|
|
List<RefundManageDto> refundManages = modelMapper.refundListByIds(model);
|
|
|
for (RefundManageDto refundManage : refundManages) {
|
|
|
try {
|
|
|
- if (customerMap.containsKey(refundManage.getCustomerManagementId())) {
|
|
|
- CustomerManagement customerManagement = customerMap.get(refundManage.getCustomerManagementId());
|
|
|
-
|
|
|
- String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
- // 项目档案编码
|
|
|
- String def10 = "";
|
|
|
- if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
- def10 = parkInfoMap.get(customerManagement.getGroupId()).getArchiveCode();
|
|
|
- }
|
|
|
- // 组织机构编码
|
|
|
- String pk_org = "";
|
|
|
- if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
- pk_org = parkInfoMap.get(customerManagement.getGroupId()).getOrganizationalCode();
|
|
|
- }
|
|
|
- String pk_subjcode = "";
|
|
|
- // 定金
|
|
|
- if (refundManage.getContentType() == 1) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
|
|
|
- }
|
|
|
- // 首付
|
|
|
- if (refundManage.getContentType() == 2) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ002;
|
|
|
- }
|
|
|
- // 银行按揭
|
|
|
- if (refundManage.getContentType() == 3) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ006;
|
|
|
- }
|
|
|
- // 专项维修资金
|
|
|
- if (refundManage.getContentType() == 4) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ015;
|
|
|
- }
|
|
|
- // 楼款
|
|
|
- if (refundManage.getContentType() == 5) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003;
|
|
|
+ // 只有未推送或推送失败的退款记录才推送
|
|
|
+ if(refundManage.getNcSubmitStatus() == null || refundManage.getNcSubmitStatus() == 0 || refundManage.getNcSubmitStatus() == 2){
|
|
|
+ if (customerMap.containsKey(refundManage.getCustomerManagementId())) {
|
|
|
+ CustomerManagement customerManagement = customerMap.get(refundManage.getCustomerManagementId());
|
|
|
+
|
|
|
+ String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
+ // 项目档案编码
|
|
|
+ String def10 = "";
|
|
|
+ if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
+ def10 = parkInfoMap.get(customerManagement.getGroupId()).getArchiveCode();
|
|
|
+ }
|
|
|
+ // 组织机构编码
|
|
|
+ String pk_org = "";
|
|
|
+ if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
+ pk_org = parkInfoMap.get(customerManagement.getGroupId()).getOrganizationalCode();
|
|
|
+ }
|
|
|
+ String pk_subjcode = "";
|
|
|
+ // 定金
|
|
|
+ if (refundManage.getContentType() == 1) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
|
|
|
+ }
|
|
|
+ // 首付
|
|
|
+ if (refundManage.getContentType() == 2) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ002;
|
|
|
+ }
|
|
|
+ // 银行按揭
|
|
|
+ if (refundManage.getContentType() == 3) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ006;
|
|
|
+ }
|
|
|
+ // 专项维修资金
|
|
|
+ if (refundManage.getContentType() == 4) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ015;
|
|
|
+ }
|
|
|
+ // 楼款
|
|
|
+ if (refundManage.getContentType() == 5) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003;
|
|
|
+ }
|
|
|
+ // 补差款
|
|
|
+ if (refundManage.getContentType() == 6) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ004;
|
|
|
+ }
|
|
|
+ // 意向金
|
|
|
+ if (refundManage.getContentType() == 7) {
|
|
|
+ pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026;
|
|
|
+ }
|
|
|
+
|
|
|
+ String checktype = InvoiceConstant.INVOICE_RECEIPT_TYPE_3;
|
|
|
+ // 如对应项目的客户,未开预收款发票的退款,则为收据;开了预收款发票则为发票
|
|
|
+ if (map.containsKey(refundManage.getCustomerManagementId())) {
|
|
|
+ checktype = InvoiceConstant.INVOICE_RECEIPT_TYPE_2;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ JSONObject ap_paybill = new JSONObject();
|
|
|
+ String srcsystemid = IdUtil.simpleUUID();
|
|
|
+ ap_paybill.put("srcsystemid", srcsystemid); //外系统标识,必选
|
|
|
+ ap_paybill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F3_Cxx_06); //交易类型,必选
|
|
|
+ ap_paybill.put("pk_org", pk_org); //组织编码,必选
|
|
|
+ ap_paybill.put("billdate", billdate); //单据日期
|
|
|
+ ap_paybill.put("def2", srcsystemid); //外系统单据号,必填,
|
|
|
+ json.put("ap_paybill", ap_paybill);
|
|
|
+
|
|
|
+ JSONArray ap_payitem = new JSONArray();
|
|
|
+ JSONObject ap_payitemJson = new JSONObject();
|
|
|
+ ap_payitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
|
|
|
+ ap_payitemJson.put("scomment", customerManagement.getBuyerName()); //客户名称,必选
|
|
|
+ ap_payitemJson.put("pk_subjcode", pk_subjcode); //收支项目编码,必选
|
|
|
+ ap_payitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
|
|
|
+ ap_payitemJson.put("customer", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
|
|
|
+ ap_payitemJson.put("money_de", refundManage.getActualRefundAmount()); //金额,必选
|
|
|
+ ap_payitemJson.put("taxrate", "0"); //税率,必选,无税传0
|
|
|
+ ap_payitemJson.put("pk_balatype", "4"); //结算方式,必选,默认是4
|
|
|
+ ap_payitemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
|
|
|
+ ap_payitemJson.put("prepay", "0"); //默认值0
|
|
|
+ ap_payitemJson.put("payaccount", refundManage.getBankNumber()); //付款银行账号,必选
|
|
|
+ ap_payitemJson.put("checktype", checktype); //票据类型,必选,看云文档票据类型
|
|
|
+ // TODO: 2024/11/22 退款的记录 是汇合的多笔的 票据号待定
|
|
|
+ ap_payitemJson.put("checkno", IdUtil.simpleUUID()); //票据号,必选
|
|
|
+ ap_payitemJson.put("def11", refundManage.getHouseId()); //转出前房号编码,必选
|
|
|
+ ap_payitemJson.put("def9", "001"); //业态,必选,看云文档业态
|
|
|
+ ap_payitemJson.put("def10", def10); //项目档案编码,看云文档项目档案对照
|
|
|
+ ap_payitem.add(ap_payitemJson);
|
|
|
+ json.put("ap_payitem", ap_payitem);
|
|
|
+
|
|
|
+ log.info("退款凭证推送详情:{}", json.toJSONString());
|
|
|
+
|
|
|
+ RefundDetail detail = new RefundDetail();
|
|
|
+ detail.setId(refundManage.getRefundDetailId());
|
|
|
+
|
|
|
+ String result = InvoiceUtil.paybillAdd(json);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
+
|
|
|
+ if (jsonObject.getString("success").equals("true")) {
|
|
|
+ detail.setNcSubmitStatus(1);
|
|
|
+ } else {
|
|
|
+ detail.setNcSubmitStatus(2);
|
|
|
+ }
|
|
|
+ detail.setNcJson(result);
|
|
|
+ detail.setNcSubmitDate(new Date());
|
|
|
+ detail.setNcSubmitName(ShiroUtils.getUser().getTruename());
|
|
|
+ refundDetailMapper.updateByPrimaryKeySelective(detail);
|
|
|
}
|
|
|
- // 补差款
|
|
|
- if (refundManage.getContentType() == 6) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ004;
|
|
|
- }
|
|
|
- // 意向金
|
|
|
- if (refundManage.getContentType() == 7) {
|
|
|
- pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026;
|
|
|
- }
|
|
|
-
|
|
|
- String checktype = InvoiceConstant.INVOICE_RECEIPT_TYPE_3;
|
|
|
- // 如对应项目的客户,未开预收款发票的退款,则为收据;开了预收款发票则为发票
|
|
|
- if (map.containsKey(refundManage.getCustomerManagementId())) {
|
|
|
- checktype = InvoiceConstant.INVOICE_RECEIPT_TYPE_2;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- JSONObject ap_paybill = new JSONObject();
|
|
|
- String srcsystemid = IdUtil.simpleUUID();
|
|
|
- ap_paybill.put("srcsystemid", srcsystemid); //外系统标识,必选
|
|
|
- ap_paybill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F3_Cxx_06); //交易类型,必选
|
|
|
- ap_paybill.put("pk_org", pk_org); //组织编码,必选
|
|
|
- ap_paybill.put("billdate", billdate); //单据日期
|
|
|
- ap_paybill.put("def2", srcsystemid); //外系统单据号,必填,
|
|
|
- json.put("ap_paybill", ap_paybill);
|
|
|
-
|
|
|
- JSONArray ap_payitem = new JSONArray();
|
|
|
- JSONObject ap_payitemJson = new JSONObject();
|
|
|
- ap_payitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
|
|
|
- ap_payitemJson.put("scomment", customerManagement.getBuyerName()); //客户名称,必选
|
|
|
- ap_payitemJson.put("pk_subjcode", pk_subjcode); //收支项目编码,必选
|
|
|
- ap_payitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
|
|
|
- ap_payitemJson.put("customer", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
|
|
|
- ap_payitemJson.put("money_de", refundManage.getActualRefundAmount()); //金额,必选
|
|
|
- ap_payitemJson.put("taxrate", "0"); //税率,必选,无税传0
|
|
|
- ap_payitemJson.put("pk_balatype", "4"); //结算方式,必选,默认是4
|
|
|
- ap_payitemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
|
|
|
- ap_payitemJson.put("prepay", "0"); //默认值0
|
|
|
- ap_payitemJson.put("payaccount", refundManage.getBankNumber()); //付款银行账号,必选
|
|
|
- ap_payitemJson.put("checktype", checktype); //票据类型,必选,看云文档票据类型
|
|
|
- // TODO: 2024/11/22 退款的记录 是汇合的多笔的 票据号待定
|
|
|
- ap_payitemJson.put("checkno", IdUtil.simpleUUID()); //票据号,必选
|
|
|
- ap_payitemJson.put("def11", refundManage.getHouseId()); //转出前房号编码,必选
|
|
|
- ap_payitemJson.put("def9", "001"); //业态,必选,看云文档业态
|
|
|
- ap_payitemJson.put("def10", def10); //项目档案编码,看云文档项目档案对照
|
|
|
- ap_payitem.add(ap_payitemJson);
|
|
|
- json.put("ap_payitem", ap_payitem);
|
|
|
-
|
|
|
- log.info("退款凭证推送详情:{}", json.toJSONString());
|
|
|
-
|
|
|
- RefundDetail detail = new RefundDetail();
|
|
|
- detail.setId(refundManage.getRefundDetailId());
|
|
|
-
|
|
|
- String result = InvoiceUtil.paybillAdd(json);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
-
|
|
|
- if (jsonObject.getString("success").equals("true")) {
|
|
|
- detail.setNcSubmitStatus(1);
|
|
|
- } else {
|
|
|
- detail.setNcSubmitStatus(2);
|
|
|
- }
|
|
|
- detail.setNcJson(result);
|
|
|
- detail.setNcSubmitDate(new Date());
|
|
|
- detail.setNcSubmitName(ShiroUtils.getUser().getTruename());
|
|
|
- refundDetailMapper.updateByPrimaryKeySelective(detail);
|
|
|
}
|
|
|
-
|
|
|
} catch (Exception e) {
|
|
|
log.error("退款凭证推送报错", e);
|
|
|
}
|
|
@@ -560,7 +565,7 @@ public class TransactionRecordService {
|
|
|
List<NccRecordVo> list = modelMapper.convertRecord(model);
|
|
|
for (NccRecordVo record : list) {
|
|
|
// 剔除已提交的记录
|
|
|
- if (record.getNcSubmitStatus() != 1) {
|
|
|
+ if (record.getNcSubmitStatus() == null || record.getNcSubmitStatus() == 0 || record.getNcSubmitStatus() == 2) {
|
|
|
convertRecordSubmitInfo(record,customerMap,parkInfoMap);
|
|
|
}
|
|
|
}
|