|
@@ -5,6 +5,9 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.idea.buildManage.mapper.ParkInfoMapper;
|
|
|
+import com.idea.buildManage.model.ParkInfo;
|
|
|
+import com.idea.buildManage.model.ParkInfoExample;
|
|
|
import com.idea.buildManage.response.ParkRoomResponse;
|
|
|
import com.idea.customerManagement.dto.IntentionalDepositDto;
|
|
|
import com.idea.customerManagement.mapper.CustomerManagementMapper;
|
|
@@ -12,6 +15,7 @@ import com.idea.customerManagement.mapper.IntentionalDepositMapper;
|
|
|
import com.idea.customerManagement.model.Buyer;
|
|
|
import com.idea.customerManagement.model.BuyerExample;
|
|
|
import com.idea.customerManagement.model.CustomerManagement;
|
|
|
+import com.idea.customerManagement.model.CustomerManagementExample;
|
|
|
import com.idea.customerManagement.service.BuyerService;
|
|
|
import com.idea.invoice.mapper.InvoiceManageMapper;
|
|
|
import com.idea.invoice.model.InvoiceManage;
|
|
@@ -62,16 +66,19 @@ public class TransactionRecordService {
|
|
|
private IntentionalDepositMapper intentionalDepositMapper;
|
|
|
@Autowired
|
|
|
private InvoiceManageMapper invoiceManageMapper;
|
|
|
+ @Autowired
|
|
|
+ private ParkInfoMapper parkInfoMapper;
|
|
|
|
|
|
/**
|
|
|
* 收款记录
|
|
|
+ *
|
|
|
* @param model
|
|
|
* @return
|
|
|
*/
|
|
|
public PageInfo<NccRecordVo> collectionRecord(Tablepar tablepar, NccRecordVo model) {
|
|
|
|
|
|
PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
|
|
|
- if(StringUtils.isNotEmpty(model.getDiscIds())){
|
|
|
+ if (StringUtils.isNotEmpty(model.getDiscIds())) {
|
|
|
List<String> list = Arrays.asList(model.getDiscIds().split(","));
|
|
|
model.setDiscIdList(list);
|
|
|
}
|
|
@@ -105,6 +112,7 @@ public class TransactionRecordService {
|
|
|
|
|
|
/**
|
|
|
* 退款记录
|
|
|
+ *
|
|
|
* @param tablepar
|
|
|
* @param model
|
|
|
* @return
|
|
@@ -113,7 +121,7 @@ public class TransactionRecordService {
|
|
|
|
|
|
List<Map<String, String>> contentType = sysDictService.selectDictList("CONTENT_TYPE");
|
|
|
PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
|
|
|
- if(StringUtils.isNotEmpty(model.getDiscIds())){
|
|
|
+ if (StringUtils.isNotEmpty(model.getDiscIds())) {
|
|
|
List<String> list = Arrays.asList(model.getDiscIds().split(","));
|
|
|
model.setDiscIdList(list);
|
|
|
}
|
|
@@ -133,7 +141,7 @@ public class TransactionRecordService {
|
|
|
public List<NccRecordVo> refundRecordListAll(Tablepar tablepar, NccRecordVo model) {
|
|
|
|
|
|
List<Map<String, String>> contentType = sysDictService.selectDictList("CONTENT_TYPE");
|
|
|
- if(StringUtils.isNotEmpty(model.getDiscIds())){
|
|
|
+ if (StringUtils.isNotEmpty(model.getDiscIds())) {
|
|
|
List<String> list = Arrays.asList(model.getDiscIds().split(","));
|
|
|
model.setDiscIdList(list);
|
|
|
}
|
|
@@ -151,6 +159,7 @@ public class TransactionRecordService {
|
|
|
|
|
|
/**
|
|
|
* 转换记录
|
|
|
+ *
|
|
|
* @param tablepar
|
|
|
* @param model
|
|
|
* @return
|
|
@@ -158,13 +167,13 @@ public class TransactionRecordService {
|
|
|
public PageInfo<NccRecordVo> convertRecord(Tablepar tablepar, NccRecordVo model) {
|
|
|
|
|
|
PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
|
|
|
- if(StringUtils.isNotEmpty(model.getDiscIds())){
|
|
|
+ if (StringUtils.isNotEmpty(model.getDiscIds())) {
|
|
|
List<String> list = Arrays.asList(model.getDiscIds().split(","));
|
|
|
model.setDiscIdList(list);
|
|
|
}
|
|
|
// 转换记录
|
|
|
List<NccRecordVo> list = modelMapper.convertRecord(model);
|
|
|
- for (NccRecordVo recordVo : list){
|
|
|
+ for (NccRecordVo recordVo : list) {
|
|
|
recordVo.setContentType("7");
|
|
|
}
|
|
|
PageInfo<NccRecordVo> pageInfo = new PageInfo<>(list);
|
|
@@ -173,7 +182,7 @@ public class TransactionRecordService {
|
|
|
|
|
|
public List<NccRecordVo> convertRecordListAll(NccRecordVo model) {
|
|
|
|
|
|
- if(StringUtils.isNotEmpty(model.getDiscIds())){
|
|
|
+ if (StringUtils.isNotEmpty(model.getDiscIds())) {
|
|
|
List<String> list = Arrays.asList(model.getDiscIds().split(","));
|
|
|
model.setDiscIdList(list);
|
|
|
}
|
|
@@ -185,120 +194,130 @@ public class TransactionRecordService {
|
|
|
|
|
|
/**
|
|
|
* 收款记录 ncc提交
|
|
|
+ *
|
|
|
* @param collectionDateFrom
|
|
|
* @param collectionDateTo
|
|
|
* @return
|
|
|
*/
|
|
|
- public int collectionRecordSubmit(String collectionDateFrom, String collectionDateTo){
|
|
|
+ public int collectionRecordSubmit(String collectionDateFrom, String collectionDateTo) {
|
|
|
|
|
|
List<PayLog> payLogs = modelMapper.listByDate(collectionDateFrom, collectionDateTo);
|
|
|
- for(PayLog payLog : payLogs){
|
|
|
- CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(payLog.getCustomerManagementId());
|
|
|
- BuyerExample buyerExample = new BuyerExample();
|
|
|
- buyerExample.setOrderByClause("order_num");
|
|
|
- buyerExample.createCriteria().andCustomerManagementIdEqualTo(customerManagement.getId());
|
|
|
- List<Buyer> buyers = buyerService.selectByExample(buyerExample);
|
|
|
- Buyer buyer = buyers.get(0);
|
|
|
-
|
|
|
- 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;
|
|
|
- }
|
|
|
+ List<CustomerManagement> customerManagements = customerManagementMapper.selectByExample(new CustomerManagementExample());
|
|
|
+ Map<String, CustomerManagement> customerMap = customerManagements.stream()
|
|
|
+ .collect(Collectors.toMap(CustomerManagement::getId, item -> item));
|
|
|
+ List<ParkInfo> parkInfos = parkInfoMapper.selectByExample(new ParkInfoExample());
|
|
|
+ Map<String, ParkInfo> parkInfoMap = parkInfos.stream().collect(Collectors.toMap(ParkInfo::getId, item -> item));
|
|
|
+ for (PayLog payLog : payLogs) {
|
|
|
+ try {
|
|
|
|
|
|
- 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;
|
|
|
- }
|
|
|
+ if (customerMap.containsKey(payLog.getCustomerManagementId())) {
|
|
|
+ CustomerManagement customerManagement = customerMap.get(payLog.getCustomerManagementId());
|
|
|
+ // TODO: 2024/11/27 项目档案编码 项目中暂无次字段
|
|
|
+ String def10 = "";
|
|
|
+ if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
+ def10 = parkInfoMap.get(customerManagement.getGroupId()).getArchiveCode();
|
|
|
+ }
|
|
|
+ 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", InvoiceUtil.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);
|
|
|
|
|
|
+ log.info("收款凭证推送详情:{}", json.toJSONString());
|
|
|
+
|
|
|
+ String result = InvoiceUtil.gatheringbillAdd(json);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
+ if (jsonObject.getString("success").equals("true")) {
|
|
|
+ payLog.setNcJson(result);
|
|
|
+ payLog.setNcSubmitStatus(1);
|
|
|
+ payLog.setNcSubmitDate(new Date());
|
|
|
+ payLog.setNcSubmitName(ShiroUtils.getLoginName());
|
|
|
+ payLogMapper.updateByPrimaryKeySelective(payLog);
|
|
|
+ }
|
|
|
|
|
|
- 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", InvoiceUtil.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", buyer.getName()); //客户名称,必选
|
|
|
- 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()); //转出前房号编码,收除了诚意金之外的首期等需要选
|
|
|
- // TODO: 2024/11/14 项目档案编码 待定
|
|
|
- ar_gatheritemJson.put("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);
|
|
|
|
|
|
- try {
|
|
|
- String result = InvoiceUtil.gatheringbillAdd(json);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
- if(jsonObject.getString("success").equals("true")){
|
|
|
- payLog.setNcJson(result);
|
|
|
- payLog.setNcSubmitStatus(1);
|
|
|
- payLog.setNcSubmitDate(new Date());
|
|
|
- payLog.setNcSubmitName(ShiroUtils.getLoginName());
|
|
|
- payLogMapper.updateByPrimaryKeySelective(payLog);
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
- log.error("收款凭证推送报错",e);
|
|
|
+ log.error("收款凭证推送报错", e);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
return 1;
|
|
@@ -306,113 +325,134 @@ public class TransactionRecordService {
|
|
|
|
|
|
/**
|
|
|
* 退款记录推送
|
|
|
+ *
|
|
|
* @param collectionDateFrom
|
|
|
* @param collectionDateTo
|
|
|
* @return
|
|
|
*/
|
|
|
public int refundRecordSubmit(String collectionDateFrom, String collectionDateTo) {
|
|
|
|
|
|
+ // 开票列表
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
InvoiceManageExample invoiceManageExample = new InvoiceManageExample();
|
|
|
invoiceManageExample.createCriteria().andTypeEqualTo("1").andInvoiceStatusEqualTo("2");
|
|
|
List<InvoiceManage> invoiceManages = invoiceManageMapper.selectByExample(invoiceManageExample);
|
|
|
- if(CollectionUtils.isNotEmpty(invoiceManages)){
|
|
|
+ if (CollectionUtils.isNotEmpty(invoiceManages)) {
|
|
|
map = invoiceManages.stream().collect(Collectors.toMap(InvoiceManage::getCustomerManagementId, InvoiceManage::getId));
|
|
|
}
|
|
|
|
|
|
- List<RefundManageDto> refundManages = modelMapper.refundListByDate(collectionDateFrom, collectionDateTo);
|
|
|
- for (RefundManageDto refundManage : refundManages){
|
|
|
-
|
|
|
- CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(refundManage.getCustomerManagementId());
|
|
|
- String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
-
|
|
|
- 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;
|
|
|
- }
|
|
|
+ // 客户列表
|
|
|
+ List<CustomerManagement> customerManagements = customerManagementMapper.selectByExample(new CustomerManagementExample());
|
|
|
+ Map<String, CustomerManagement> customerMap = customerManagements.stream()
|
|
|
+ .collect(Collectors.toMap(CustomerManagement::getId, item -> item));
|
|
|
+ // 园区列表
|
|
|
+ List<ParkInfo> parkInfos = parkInfoMapper.selectByExample(new ParkInfoExample());
|
|
|
+ Map<String, ParkInfo> parkInfoMap = parkInfos.stream().collect(Collectors.toMap(ParkInfo::getId, item -> item));
|
|
|
|
|
|
+ // 退款列表
|
|
|
+ List<RefundManageDto> refundManages = modelMapper.refundListByDate(collectionDateFrom, collectionDateTo);
|
|
|
+ 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());
|
|
|
+
|
|
|
+ // TODO: 2024/11/27 项目档案编码 项目中暂无次字段
|
|
|
+ String def10 = "";
|
|
|
+ if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
+ def10 = parkInfoMap.get(customerManagement.getGroupId()).getArchiveCode();
|
|
|
+ }
|
|
|
+ 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", InvoiceUtil.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
|
|
|
+ // TODO: 2024/11/22 安居的退款账号 待定
|
|
|
+ ap_payitemJson.put("payaccount", ""); //付款银行账号,必选
|
|
|
+ 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());
|
|
|
+
|
|
|
+ String result = InvoiceUtil.paybillAdd(json);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
+ if (jsonObject.getString("success").equals("true")) {
|
|
|
+
|
|
|
+ RefundDetail detail = new RefundDetail();
|
|
|
+ detail.setId(refundManage.getRefundDetailId());
|
|
|
+ detail.setNcJson(result);
|
|
|
+ detail.setNcSubmitStatus(1);
|
|
|
+ detail.setNcSubmitDate(new Date());
|
|
|
+ detail.setNcSubmitName(ShiroUtils.getLoginName());
|
|
|
+ refundDetailMapper.updateByPrimaryKeySelective(detail);
|
|
|
+ }
|
|
|
|
|
|
- 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", InvoiceUtil.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
|
|
|
- // TODO: 2024/11/22 安居的退款账号 待定
|
|
|
- ap_payitemJson.put("payaccount", ""); //付款银行账号,必选
|
|
|
- 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"); //业态,必选,看云文档业态
|
|
|
- // TODO: 2024/11/19 项目档案 待定
|
|
|
- ap_payitemJson.put("def10", ""); //项目档案编码,看云文档项目档案对照
|
|
|
- ap_payitem.add(ap_payitemJson);
|
|
|
- json.put("ap_payitem", ap_payitem);
|
|
|
|
|
|
- try {
|
|
|
- String result = InvoiceUtil.paybillAdd(json);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
- if(jsonObject.getString("success").equals("true")){
|
|
|
-
|
|
|
- RefundDetail detail = new RefundDetail();
|
|
|
- detail.setId(refundManage.getRefundDetailId());
|
|
|
- detail.setNcJson(result);
|
|
|
- detail.setNcSubmitStatus(1);
|
|
|
- detail.setNcSubmitDate(new Date());
|
|
|
- detail.setNcSubmitName(ShiroUtils.getLoginName());
|
|
|
- refundDetailMapper.updateByPrimaryKeySelective(detail);
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
- log.error("退款凭证推送报错",e);
|
|
|
+ log.error("退款凭证推送报错", e);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -422,97 +462,108 @@ public class TransactionRecordService {
|
|
|
|
|
|
/**
|
|
|
* 转换记录 ncc提交
|
|
|
+ *
|
|
|
* @param collectionDateFrom
|
|
|
* @param collectionDateTo
|
|
|
* @return
|
|
|
*/
|
|
|
public int convertRecordSubmit(String collectionDateFrom, String collectionDateTo) {
|
|
|
|
|
|
- Map<String, String> cusIdMap = buyerService.getCusIdMap();
|
|
|
+ // 客户列表
|
|
|
+ List<CustomerManagement> customerManagements = customerManagementMapper.selectByExample(new CustomerManagementExample());
|
|
|
+ Map<String, CustomerManagement> customerMap = customerManagements.stream()
|
|
|
+ .collect(Collectors.toMap(CustomerManagement::getId, item -> item));
|
|
|
+ // 园区列表
|
|
|
+ List<ParkInfo> parkInfos = parkInfoMapper.selectByExample(new ParkInfoExample());
|
|
|
+ Map<String, ParkInfo> parkInfoMap = parkInfos.stream().collect(Collectors.toMap(ParkInfo::getId, item -> item));
|
|
|
|
|
|
+ // 意向金列表
|
|
|
List<IntentionalDepositDto> intentionalDeposits = modelMapper.convertListByDate(collectionDateFrom, collectionDateTo);
|
|
|
- for (IntentionalDepositDto intentionalDeposit : intentionalDeposits){
|
|
|
- String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
- String number = SnowflakeIdWorker.getUUID();
|
|
|
-
|
|
|
- CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(intentionalDeposit.getCustomerManagementId());
|
|
|
-
|
|
|
- // 目前只有意向金转定金
|
|
|
- String pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
|
|
|
-
|
|
|
- String pk_balatype = "";
|
|
|
- // 现金
|
|
|
- if(intentionalDeposit.getPaymentMethod() == 1){
|
|
|
- pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_0;
|
|
|
- }
|
|
|
- // 支付宝
|
|
|
- if(intentionalDeposit.getPaymentMethod() == 2){
|
|
|
- pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
- }
|
|
|
- // 微信
|
|
|
- if(intentionalDeposit.getPaymentMethod() == 3){
|
|
|
- pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
- }
|
|
|
- // 银行卡
|
|
|
- if(intentionalDeposit.getPaymentMethod() == 3){
|
|
|
- pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- JSONObject ar_gatherbill = new JSONObject();
|
|
|
- String srcsystemid = intentionalDeposit.getId();
|
|
|
- ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
|
|
|
- ar_gatherbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F2_Cxx_07); //交易类型,必选
|
|
|
- ar_gatherbill.put("pk_org", InvoiceUtil.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", intentionalDeposit.getReceivedAmount()); //金额,必选
|
|
|
- // TODO: 2024/11/20 税率 待定
|
|
|
- ar_gatheritemJson.put("taxrate", ""); //税率,必选,数字——3/10/6````
|
|
|
- ar_gatheritemJson.put("pk_balatype", pk_balatype); //结算方式,必选,看云文档结算方式
|
|
|
- ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
|
|
|
- ar_gatheritemJson.put("prepay", "0"); //收款性质应收款时传"0",收款性质预收款时传"1"
|
|
|
- // TODO: 2024/11/20 意向金暂无收款账号 待定
|
|
|
- ar_gatheritemJson.put("recaccount", ""); //收款银行账号,必填
|
|
|
+ for (IntentionalDepositDto intentionalDeposit : intentionalDeposits) {
|
|
|
+ try {
|
|
|
+ String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
+ if (customerMap.containsKey(intentionalDeposit.getCustomerManagementId())) {
|
|
|
+ CustomerManagement customerManagement = customerMap.get(intentionalDeposit.getCustomerManagementId());
|
|
|
+
|
|
|
+ // TODO: 2024/11/27 项目档案编码 项目中暂无次字段
|
|
|
+ String def10 = "";
|
|
|
+ if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
|
|
|
+ def10 = parkInfoMap.get(customerManagement.getGroupId()).getArchiveCode();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 目前只有意向金转定金
|
|
|
+ String pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
|
|
|
+
|
|
|
+ String pk_balatype = "";
|
|
|
+ // 现金
|
|
|
+ if (intentionalDeposit.getPaymentMethod() == 1) {
|
|
|
+ pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_0;
|
|
|
+ }
|
|
|
+ // 支付宝
|
|
|
+ if (intentionalDeposit.getPaymentMethod() == 2) {
|
|
|
+ pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
+ }
|
|
|
+ // 微信
|
|
|
+ if (intentionalDeposit.getPaymentMethod() == 3) {
|
|
|
+ pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
+ }
|
|
|
+ // 银行卡
|
|
|
+ if (intentionalDeposit.getPaymentMethod() == 3) {
|
|
|
+ pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ JSONObject ar_gatherbill = new JSONObject();
|
|
|
+ String srcsystemid = intentionalDeposit.getId();
|
|
|
+ ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
|
|
|
+ ar_gatherbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F2_Cxx_07); //交易类型,必选
|
|
|
+ ar_gatherbill.put("pk_org", InvoiceUtil.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", intentionalDeposit.getReceivedAmount()); //金额,必选
|
|
|
+ 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", "0"); //收款性质应收款时传"0",收款性质预收款时传"1"
|
|
|
+ ar_gatheritemJson.put("recaccount", intentionalDeposit.getBankName()); //收款银行账号,必填
|
|
|
// ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
|
|
|
- ar_gatheritemJson.put("scomment", customerManagement.getBuyerName()); //客户名称,必选
|
|
|
- ar_gatheritemJson.put("pk_subjcode", pk_subjcode); //收支项目编码,必选,看云文档收支项目对照
|
|
|
- ar_gatheritemJson.put("def11", intentionalDeposit.getHouseId()); //转出前房号编码,必选
|
|
|
- ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
|
|
|
+ ar_gatheritemJson.put("scomment", customerManagement.getBuyerName()); //客户名称,必选
|
|
|
+ ar_gatheritemJson.put("pk_subjcode", pk_subjcode); //收支项目编码,必选,看云文档收支项目对照
|
|
|
+ ar_gatheritemJson.put("def11", intentionalDeposit.getHouseId()); //转出前房号编码,必选
|
|
|
+ ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
|
|
|
// ar_gatheritemJson.put("def12", ""); //转出后房号编码,换房业务时要选
|
|
|
- ar_gatheritemJson.put("def14", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026); //原收支项目编码,定金转违约金项目时 必选
|
|
|
+ ar_gatheritemJson.put("def14", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026); //原收支项目编码,定金转违约金项目时 必选
|
|
|
// ar_gatheritemJson.put("def13", ""); //换票后票据号,换房业务必选
|
|
|
- // TODO: 2024/11/20 票据类型 待定
|
|
|
- ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
|
|
|
- ar_gatheritemJson.put("checkno", intentionalDeposit.getSerialNumber()); //票据号,必选
|
|
|
- // TODO: 2024/11/14 具体编码 未定
|
|
|
- ar_gatheritemJson.put("def10", ""); //项目档案编码,看云文档项目档案对照
|
|
|
- ar_gatheritem.add(ar_gatheritemJson);
|
|
|
- json.put("ar_gatheritem", ar_gatheritem);
|
|
|
+ ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
|
|
|
+ ar_gatheritemJson.put("checkno", intentionalDeposit.getSerialNumber()); //票据号,必选
|
|
|
+ ar_gatheritemJson.put("def10", def10); //项目档案编码,看云文档项目档案对照
|
|
|
+ ar_gatheritem.add(ar_gatheritemJson);
|
|
|
+ json.put("ar_gatheritem", ar_gatheritem);
|
|
|
+
|
|
|
+ log.info("转换记录推送详情:{}", json.toJSONString());
|
|
|
+ String result = InvoiceUtil.gatheringbillTurn(json);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
+ if (jsonObject.getString("success").equals("true")) {
|
|
|
+ intentionalDeposit.setNcJson(result);
|
|
|
+ intentionalDeposit.setNcSubmitStatus(1);
|
|
|
+ intentionalDeposit.setNcSubmitDate(new Date());
|
|
|
+ intentionalDeposit.setNcSubmitName(ShiroUtils.getLoginName());
|
|
|
+ intentionalDepositMapper.updateByPrimaryKeySelective(intentionalDeposit);
|
|
|
+ }
|
|
|
|
|
|
- try {
|
|
|
- String result = InvoiceUtil.gatheringbillTurn(json);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
- if (jsonObject.getString("success").equals("true")) {
|
|
|
- intentionalDeposit.setNcJson(result);
|
|
|
- intentionalDeposit.setNcSubmitStatus(1);
|
|
|
- intentionalDeposit.setNcSubmitDate(new Date());
|
|
|
- intentionalDeposit.setNcSubmitName(ShiroUtils.getLoginName());
|
|
|
- intentionalDepositMapper.updateByPrimaryKeySelective(intentionalDeposit);
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
- log.error("诚意金转定金凭证推送报错", e);
|
|
|
+ log.error("转换记录凭证推送报错", e);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
return 1;
|
|
|
|