|
@@ -3,17 +3,21 @@ package com.idea.paymentManagement.service;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+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.ParkFloorDiscMapper;
|
|
|
import com.idea.buildManage.mapper.ParkInfoMapper;
|
|
|
import com.idea.buildManage.mapper.ParkRoomExtendMapper;
|
|
|
+import com.idea.buildManage.mapper.ParkRoomMapper;
|
|
|
import com.idea.buildManage.model.ParkFloorDisc;
|
|
|
import com.idea.buildManage.model.ParkInfo;
|
|
|
import com.idea.buildManage.model.ParkInfoExample;
|
|
|
import com.idea.buildManage.model.ParkRoom;
|
|
|
import com.idea.buildManage.response.ParkRoomResponse;
|
|
|
import com.idea.customerManagement.dto.ContractManageDto;
|
|
|
+import com.idea.customerManagement.dto.IntentionalDepositDto;
|
|
|
import com.idea.customerManagement.mapper.ContractManageMapper;
|
|
|
import com.idea.customerManagement.mapper.CustomerManagementMapper;
|
|
|
import com.idea.customerManagement.model.*;
|
|
@@ -24,6 +28,8 @@ import com.idea.invoice.model.InvoiceManageExample;
|
|
|
import com.idea.invoice.model.ReceiptManage;
|
|
|
import com.idea.invoice.service.InvoiceManageService;
|
|
|
import com.idea.invoice.service.ReceiptManageService;
|
|
|
+import com.idea.invoice.util.InvoiceConstant;
|
|
|
+import com.idea.invoice.util.InvoiceUtil;
|
|
|
import com.idea.paymentManagement.dto.PayLogDto;
|
|
|
import com.idea.paymentManagement.mapper.PayLogExtendMapper;
|
|
|
import com.idea.paymentManagement.mapper.PayLogMapper;
|
|
@@ -33,6 +39,7 @@ import com.idea.util.DateUtils;
|
|
|
import com.idea.util.MoneyUtils;
|
|
|
import com.idea.util.ReplaceWord;
|
|
|
import com.rockstar.common.base.BaseService;
|
|
|
+import com.rockstar.common.domain.AjaxResult;
|
|
|
import com.rockstar.frame.model.FrameUser;
|
|
|
import com.rockstar.frame.model.extend.DateTrans;
|
|
|
import com.rockstar.frame.model.extend.Tablepar;
|
|
@@ -78,6 +85,8 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
@Autowired
|
|
|
private ParkRoomExtendMapper roomExtendMapper;
|
|
|
@Autowired
|
|
|
+ private ParkRoomMapper roomMapper;
|
|
|
+ @Autowired
|
|
|
private ParkInfoMapper parkInfoMapper;
|
|
|
@Autowired
|
|
|
private ParkFloorDiscMapper parkFloorDiscMapper;
|
|
@@ -436,5 +445,93 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public AjaxResult sendVoucher(PayLogDto model) {
|
|
|
+
|
|
|
+ // 银行流水id
|
|
|
+ String pkInformerId = model.getPkInformerId();
|
|
|
+ PayLog payLog = selectByPrimaryKey(model.getId());
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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", 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", buyer.getIdentityCard()); //客商的纳税人识别号
|
|
|
+ ar_gatheritemJson.put("money_cr", payLog.getPayMoney()); //金额,必选
|
|
|
+ ar_gatheritemJson.put("taxrate", "10"); //税率,必选,数字——3/10/6````
|
|
|
+ ar_gatheritemJson.put("pk_balatype", "0"); //结算方式,必选,看云文档结算方式
|
|
|
+ ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
|
|
|
+ ar_gatheritemJson.put("prepay", "0"); //收款性质应收款时传"0",收款性质预收款时传"1"
|
|
|
+ ar_gatheritemJson.put("recaccount", InvoiceUtil.bank_number); //收款银行账号,必填
|
|
|
+// ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
|
|
|
+ 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", InvoiceConstant.INVOICE_MATERIAL_djjy); //项目档案编码,看云文档项目档案对照
|
|
|
+ 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);
|
|
|
+ updateByPrimaryKeySelective(payLog);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("收诚意金凭证推送报错",e);
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|