|
|
@@ -345,7 +345,7 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
|
|
|
invoiceManage.setInvoiceHeaderNumber(buyer.getIdentityCard());
|
|
|
// TODO: 2024/10/17 商品编码目前为空 对接接口后调整
|
|
|
// invoiceManage.setInvoiceGoodsCode(InvoiceConstant.INVOICE_GOODS_CODE_ADVANCE_PAYMENT);
|
|
|
- invoiceManage.setInvoiceGoodsName(invoiceGoodsName + room.getGroupName());
|
|
|
+ invoiceManage.setInvoiceGoodsName("*不动产*" + room.getGroupName());
|
|
|
invoiceManage.setSpecifications(room.getBuildName() + "-" + room.getRoomNo());
|
|
|
invoiceManage.setInvoiceCount(new BigDecimal(contract.getActualBuildArea().toString()));
|
|
|
invoiceManage.setInvoiceAmount(contract.getBuyerMoney());
|
|
|
@@ -418,19 +418,21 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
|
|
|
for (InvoiceBank invoiceBank : bankList) {
|
|
|
if (StringUtils.isNotEmpty(invoiceBank.getSuitFloor())) {
|
|
|
String[] floors = invoiceBank.getSuitFloor().split(",");
|
|
|
+ List<String> suitCostTypes = Arrays.asList(invoiceBank.getSuitCostType().split(","));
|
|
|
+ List<String> taxRates = Arrays.asList(invoiceBank.getTaxRate().split(","));
|
|
|
for (String floor : floors) {
|
|
|
if (parkRoom.getDiscId().contains(floor)) {
|
|
|
result = invoiceBank.getBankName() + invoiceBank.getBankBranchName() + invoiceBank.getBankNumber();
|
|
|
jsonObject.put("invoiceSellerBank", result);
|
|
|
- // 预收款发票税率默认为0
|
|
|
- jsonObject.put("invoiceTax", "0");
|
|
|
+ int index = suitCostTypes.indexOf(dictLabel);
|
|
|
+ String taxRate = taxRates.get(index);
|
|
|
+ jsonObject.put("invoiceTax", taxRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
return jsonObject;
|
|
|
@@ -489,104 +491,49 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- // TODO: 2024/12/18 预收款发票 细节待定 可能不需要新增
|
|
|
-// // 预收款发票 调收款单接口
|
|
|
-// if ("1".equals(newRecord.getType())) {
|
|
|
-//
|
|
|
-// Double invoiceTax = Double.parseDouble(model.getInvoiceTax()) * 100;
|
|
|
-//
|
|
|
-// JSONObject json = new JSONObject();
|
|
|
-// JSONObject ar_gatherbill = new JSONObject();
|
|
|
-// String srcsystemid = model.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", parkInfo.getOrganizationalCode()); //组织编码,必选
|
|
|
-// ar_gatherbill.put("billdate", billdate); //单据日期
|
|
|
-// ar_gatherbill.put("def2", srcsystemid); //外系统单据号,必填,
|
|
|
-// ar_gatherbill.put("def18", "2"); //销售发票类型,1-全电专票,2-全电普票
|
|
|
-// ar_gatherbill.put("def8", model.getRemark()); // 发票备注
|
|
|
-// 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", model.getInvoiceHeaderNumber()); //客商的纳税人识别号
|
|
|
-// ar_gatheritemJson.put("money_de", model.getInvoiceAmount()); //金额,必选
|
|
|
-// ar_gatheritemJson.put("taxrate", invoiceTax); //税率,必选,无税传0
|
|
|
-// // TODO: 2024/12/18 待定
|
|
|
-// ar_gatheritemJson.put("pk_balatype", ); // //结算方式,必选,看云文档结算方式(电汇、现金、POS)
|
|
|
-// ar_gatheritemJson.put("pk_recpaytype", "001"); //收款业务类型,必选,(默认001)
|
|
|
-// ar_gatheritemJson.put("prepay", "1"); //收款性质应收款时传"0",收款性质预收款时传"1"(默认=1)
|
|
|
-// // TODO: 2024/12/18 数据库字段目前为空 需处理
|
|
|
-// ar_gatheritemJson.put("recaccount", model.getInvoiceSellerBankNumber()); //收款银行账号,必填
|
|
|
-// ar_gatheritemJson.put("fphm", ""); //发票号码,非必选
|
|
|
-// ar_gatheritemJson.put("scomment",customerManagement.getBuyerName()); //客户名称,必选
|
|
|
-// // TODO: 2024/12/18 待定
|
|
|
-// ar_gatheritemJson.put("pk_subjcode",InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026); //收支项目编码
|
|
|
-// // TODO: 2024/12/18 待定
|
|
|
-// ar_gatheritemJson.put("hg",); //票据类型,必选,看云文档票据类型(收据)
|
|
|
-// ar_gatheritemJson.put("checkno",srcsystemid); //票据号,必选(收据号)
|
|
|
-// ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
|
|
|
-// ar_gatheritemJson.put("def11", parkRoom.getId()); //转出前房号编码,收除了诚意金之外的首期等需要选(收据中的房号字段)
|
|
|
-// ar_gatheritemJson.put("def10", parkInfo.getArchiveCode()); //项目档案编码,看云文档项目档案对照(项目管理中新增项目档案编号)
|
|
|
-// ar_gatheritemJson.put("def21", "7-21-1301"); //开票的规格型号,7-21-1301
|
|
|
-// ar_gatheritemJson.put("material", material); //物料
|
|
|
-//
|
|
|
-// ar_gatheritem.add(ar_gatheritemJson);
|
|
|
-// json.put("ar_recitem", ar_gatheritem);
|
|
|
-//
|
|
|
-// result = InvoiceUtil.gatheringbillAdd(json);
|
|
|
-// }
|
|
|
- // 正式发票 调收款单接口
|
|
|
- if ("2".equals(newRecord.getType())) {
|
|
|
- String def26 = "江苏省无锡市";
|
|
|
- if (StringUtils.isNotEmpty(parkInfo.getRegionalismCode())) {
|
|
|
- String dictLabel = sysDictService.getDictLabel("REGIONALISM_CODE", parkInfo.getRegionalismCode());
|
|
|
- def26 = def26 + dictLabel;
|
|
|
- }
|
|
|
- def26 = def26 + parkInfo.getGroupName() + roomResponse.getDiscName() + roomResponse.getBuildName()
|
|
|
- + "号" + roomResponse.getRoomNo() + "室";
|
|
|
-
|
|
|
-
|
|
|
- Double invoiceTax = Double.parseDouble(model.getInvoiceTax()) * 100;
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- JSONObject ar_recbill = new JSONObject();
|
|
|
- String srcsystemid = model.getId();
|
|
|
- String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
- ar_recbill.put("srcsystemid", srcsystemid); //外系统标识,必选
|
|
|
- ar_recbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F0_Cxx_05); //交易类型,必选
|
|
|
- ar_recbill.put("pk_org", parkInfo.getOrganizationalCode()); //组织编码,必选
|
|
|
- ar_recbill.put("billdate", billdate); //单据日期
|
|
|
- ar_recbill.put("def2", srcsystemid); //外系统单据号,必填,
|
|
|
- ar_recbill.put("def18", "2"); //销售发票类型,1-全电专票,2-全电普票
|
|
|
- ar_recbill.put("def23", "E05"); //特殊票种标识,默认是E05
|
|
|
- ar_recbill.put("def24", "0"); //征税方式,必填,默认0
|
|
|
- ar_recbill.put("def26", def26); //不动产地址 必填
|
|
|
- ar_recbill.put("def25", "N"); // 跨地市标志,必填,Y--是;N---否
|
|
|
- json.put("ar_recbill", ar_recbill);
|
|
|
-
|
|
|
- JSONArray ar_recitem = new JSONArray();
|
|
|
- JSONObject ar_recitemJson = new JSONObject();
|
|
|
- ar_recitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
|
|
|
- ar_recitemJson.put("scomment", model.getRemark()); //摘要,非必选
|
|
|
- ar_recitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
|
|
|
- ar_recitemJson.put("customer", model.getInvoiceHeaderNumber()); //客商的纳税人识别号
|
|
|
- ar_recitemJson.put("money_de", model.getInvoiceAmount()); //金额,必选
|
|
|
- ar_recitemJson.put("taxrate", invoiceTax); //税率,必选,无税传0
|
|
|
- ar_recitemJson.put("pk_subjcode", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003); //收支项目编码,非必选
|
|
|
- ar_recitemJson.put("def11", parkRoom.getId()); //转出前房号编码,收除了诚意金之外的首期等需要选
|
|
|
- ar_recitemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
|
|
|
- ar_recitemJson.put("def7", parkInfo.getProjectCode()); //房产工程项目,必选,看云文档
|
|
|
- ar_recitemJson.put("def8", parkRoom.getBuildId()); //楼栋,必选,看云文档
|
|
|
- ar_recitemJson.put("material", material); //物料
|
|
|
- ar_recitem.add(ar_recitemJson);
|
|
|
- json.put("ar_recitem", ar_recitem);
|
|
|
- result = InvoiceUtil.recbillAdd(json);
|
|
|
-
|
|
|
+ String def26 = "江苏省无锡市";
|
|
|
+ if (StringUtils.isNotEmpty(parkInfo.getRegionalismCode())) {
|
|
|
+ String dictLabel = sysDictService.getDictLabel("REGIONALISM_CODE", parkInfo.getRegionalismCode());
|
|
|
+ def26 = def26 + dictLabel;
|
|
|
}
|
|
|
+ def26 = def26 + parkInfo.getGroupName() + roomResponse.getDiscName() + roomResponse.getBuildName()
|
|
|
+ + "号" + roomResponse.getRoomNo() + "室";
|
|
|
+
|
|
|
+
|
|
|
+ Double invoiceTax = Double.parseDouble(model.getInvoiceTax()) * 100;
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ JSONObject ar_recbill = new JSONObject();
|
|
|
+ String srcsystemid = model.getId();
|
|
|
+ String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
+ ar_recbill.put("srcsystemid", srcsystemid); //外系统标识,必选
|
|
|
+ ar_recbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F0_Cxx_05); //交易类型,必选
|
|
|
+ ar_recbill.put("pk_org", parkInfo.getOrganizationalCode()); //组织编码,必选
|
|
|
+ ar_recbill.put("billdate", billdate); //单据日期
|
|
|
+ ar_recbill.put("def2", srcsystemid); //外系统单据号,必填,
|
|
|
+ ar_recbill.put("def18", "2"); //销售发票类型,1-全电专票,2-全电普票
|
|
|
+ ar_recbill.put("def23", "E05"); //特殊票种标识,默认是E05
|
|
|
+ ar_recbill.put("def24", "0"); //征税方式,必填,默认0
|
|
|
+ ar_recbill.put("def26", def26); //不动产地址 必填
|
|
|
+ ar_recbill.put("def25", "N"); // 跨地市标志,必填,Y--是;N---否
|
|
|
+ json.put("ar_recbill", ar_recbill);
|
|
|
+
|
|
|
+ JSONArray ar_recitem = new JSONArray();
|
|
|
+ JSONObject ar_recitemJson = new JSONObject();
|
|
|
+ ar_recitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
|
|
|
+ ar_recitemJson.put("scomment", model.getRemark()); //摘要,非必选
|
|
|
+ ar_recitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
|
|
|
+ ar_recitemJson.put("customer", model.getInvoiceHeaderNumber()); //客商的纳税人识别号
|
|
|
+ ar_recitemJson.put("money_de", model.getInvoiceAmount()); //金额,必选
|
|
|
+ ar_recitemJson.put("taxrate", invoiceTax); //税率,必选,无税传0
|
|
|
+ ar_recitemJson.put("pk_subjcode", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003); //收支项目编码,非必选
|
|
|
+ ar_recitemJson.put("def11", parkRoom.getId()); //转出前房号编码,收除了诚意金之外的首期等需要选
|
|
|
+ ar_recitemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
|
|
|
+ ar_recitemJson.put("def7", parkInfo.getProjectCode()); //房产工程项目,必选,看云文档
|
|
|
+ ar_recitemJson.put("def8", parkRoom.getBuildId()); //楼栋,必选,看云文档
|
|
|
+ ar_recitemJson.put("material", material); //物料
|
|
|
+ ar_recitem.add(ar_recitemJson);
|
|
|
+ json.put("ar_recitem", ar_recitem);
|
|
|
+ result = InvoiceUtil.recbillAdd(json);
|
|
|
|
|
|
return result;
|
|
|
|
|
|
@@ -622,6 +569,11 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
|
|
|
invoiceManage.setNcCode(code);
|
|
|
invoiceManageService.updateByPrimaryKeySelective(invoiceManage);
|
|
|
} else if ("false".equals(success)) {
|
|
|
+ invoiceManage.setSendStatus("2");
|
|
|
+ invoiceManage.setSubmitTime(new Date());
|
|
|
+ invoiceManage.setSubmitUser(ShiroUtils.getUserId());
|
|
|
+ invoiceManage.setNcJson(result);
|
|
|
+ invoiceManageService.updateByPrimaryKeySelective(invoiceManage);
|
|
|
throw new RuntimeException(jsonObject.getString("message"));
|
|
|
}
|
|
|
}
|