Merge branch 'yuecheng-project' of http://hzya.ufyct.com:9015/root/kangarooDataCenterV3 into yuecheng-project

This commit is contained in:
lvleigang 2024-06-21 16:45:59 +08:00
commit 37cbcfb620
12 changed files with 236 additions and 105 deletions

View File

@ -3,6 +3,7 @@ package com.hzya.frame.plugin.cbs8.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -96,8 +97,16 @@ public class PayApplyPluginInitializer extends PluginBaseEntity {
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
PaymentEntity paymentEntity = null;
if (null != requestJson){
requestJson.remove("jsonStr");
paymentEntity = JSONObject.parseObject(requestJson.toString(),PaymentEntity.class);
}
if (null == paymentEntity)
paymentEntity = new PaymentEntity();
//支付申请
// cbsPluginService.applyPay(requestJson);
paymentEntity.setOaId("5490849762671477371");
cbsPluginService.applyPay(paymentEntity);
return null;
}
}

View File

@ -3,6 +3,7 @@ package com.hzya.frame.plugin.cbs8.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -95,7 +96,15 @@ public class PayResultPluginInitializer extends PluginBaseEntity {
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
cbsPluginService.queryResult(requestJson);
CbsLogEntity cbsLogEntity = null;
if (null != requestJson){
requestJson.remove("jsonStr");
cbsLogEntity = JSONObject.parseObject(requestJson.toString(),CbsLogEntity.class);
}
if (null == cbsLogEntity){
cbsLogEntity = new CbsLogEntity();
}
cbsPluginService.queryResult(cbsLogEntity);
return null;
}
}

View File

@ -1,5 +1,6 @@
package com.hzya.frame.plugin.cbs8.plugin;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.cbs8.dto.req.TransactionDetailReqDTO;
@ -101,10 +102,23 @@ public class TransactionDetailPluginInitializer extends PluginBaseEntity {
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
TransactionDetailReqDTO transactionDetailReqDTO = new TransactionDetailReqDTO();
TransactionDetailReqDTO transactionDetailReqDTO = null;
if (null != requestJson){
requestJson.remove("jsonStr");
transactionDetailReqDTO = JSONObject.parseObject(requestJson.toString(),TransactionDetailReqDTO.class);
}
if (null == transactionDetailReqDTO){
transactionDetailReqDTO = new TransactionDetailReqDTO();
}
transactionDetailReqDTO.setCurrentPage(CBSUtil.DEFAULT_CURRENT_PAGE);
transactionDetailReqDTO.setPageSize(CBSUtil.DEFAULT_PAGE_SIZE);
transactionDetailReqDTO.setStartDate(DateUtil.today());
transactionDetailReqDTO.setEndDate(DateUtil.today());
transactionDetailReqDTO.setDateType("0");
transactionDetailReqDTO.setLoanType("2");
List<TransactionDetailDTO> transactionDetailList = cbsPluginService.queryTransactionDetail(transactionDetailReqDTO);
return null;
System.out.println("11111");
return new JsonResultEntity("成功",true,transactionDetailList);
//return null;
}
}

View File

@ -8,6 +8,8 @@ import com.hzya.frame.cbs8.dto.res.PayResponseDTO;
import com.hzya.frame.cbs8.dto.res.TransactionDetailDTO;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity;
import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
import java.util.List;
@ -20,16 +22,16 @@ public interface ICbsPluginService {
/**
* 支付申请
* @param requestJson
* @param entity
*/
void applyPay(JSONObject requestJson)throws Exception;
void applyPay(PaymentEntity entity)throws Exception;
/**
* 查询支付申请的交易结果
* @param requestJson
* @param cbsLogEntity
* @throws Exception
*/
void queryResult(JSONObject requestJson)throws Exception;
void queryResult(CbsLogEntity cbsLogEntity)throws Exception;
/**
* 电子回单查询 并上传OA

View File

@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Value;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@ -60,12 +61,14 @@ public class CbsPluginServiceImpl implements ICbsPluginService {
/**
* 支付申请
*
* @param requestJson
* @param paymentEntity
*/
@Override
public void applyPay(JSONObject requestJson) throws Exception{
public void applyPay(PaymentEntity paymentEntity) throws Exception{
//查询待支付的列表
PaymentEntity paymentEntity = new PaymentEntity();
if (null == paymentEntity){
paymentEntity = new PaymentEntity();
}
paymentEntity.setDataSourceCode(oa_data_source_code);
List<PaymentEntity> paymentList = paymentService.queryUnpaid(paymentEntity);
/* List<PaymentEntity> paymentList = new ArrayList<>();
@ -87,7 +90,14 @@ public class CbsPluginServiceImpl implements ICbsPluginService {
for (PaymentEntity pay : paymentList) {
//调用支付申请接口
PayResponseDTO payResponseDTO = cbs8Service.payApply(pay);
boolean successed = payResponseDTO.getSuccessed();
if (successed){
pay.setPayResult(PayState.p.getValue());
}else {
pay.setPayResult("推送失败");
}
//4更新OA表单
pay.setDataSourceCode(oa_data_source_code);
paymentService.updatePayState(pay);
//5记录操作日志
cbsLogService.saveLog(new CbsLogEntity());
@ -98,12 +108,14 @@ public class CbsPluginServiceImpl implements ICbsPluginService {
/**
* 查询支付申请的交易结果
*
* @param requestJson
* @param cbsLogEntity
* @throws Exception
*/
@Override
public void queryResult(JSONObject requestJson) throws Exception {
CbsLogEntity cbsLogEntity = new CbsLogEntity();
public void queryResult(CbsLogEntity cbsLogEntity) throws Exception {
if (null == cbsLogEntity){
cbsLogEntity = new CbsLogEntity();
}
// 1查询支付中的日志
List<CbsLogEntity> inPayList = cbsLogService.queryInPayment(cbsLogEntity);
if (CollectionUtils.isNotEmpty(inPayList)){
@ -162,7 +174,10 @@ public class CbsPluginServiceImpl implements ICbsPluginService {
public void elecBillUpload(JSONObject requestJson) throws Exception {
//查询支付成功 没有电子回单的数据
PaymentEntity paymentEntity = new PaymentEntity();
List<PaymentEntity> paymentList = paymentService.queryElecIsNull(paymentEntity);
// List<PaymentEntity> paymentList = paymentService.queryElecIsNull(paymentEntity);
paymentEntity.setPayDate("2024-06-20");
paymentEntity.setReferenceNum("41");
List<PaymentEntity> paymentList = Arrays.asList(paymentEntity);
if (CollectionUtils.isNotEmpty(paymentList)) {
for (PaymentEntity pay : paymentList) {
try {

View File

@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.cbs8.dto.req.PayRequestDTO;
import com.hzya.frame.cbs8.dto.req.PayResultRequestDTO;
import com.hzya.frame.cbs8.dto.res.PayResultResDTO;
@ -11,6 +12,9 @@ import com.hzya.frame.cbs8.service.ICbs8ExtService;
import com.hzya.frame.cbs8.service.ICbs8Service;
import com.hzya.frame.cbs8.util.CBSUtil;
import com.hzya.frame.cbs8.util.CbsAccessToken;
import com.hzya.frame.plugin.cbs8.plugin.PayApplyPluginInitializer;
import com.hzya.frame.plugin.cbs8.plugin.PayResultPluginInitializer;
import com.hzya.frame.plugin.cbs8.plugin.TransactionDetailPluginInitializer;
import com.hzya.frame.plugin.seeyonExt.plugin.SeeyonExtPluginInitializer;
import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
import com.hzya.frame.seeyon.cbs8.service.IPaymentService;
@ -45,6 +49,30 @@ public class temButtom {
ICbs8ExtService cbs8ExtService;
@Autowired
private IPaymentService paymentService;
@Autowired
private PayApplyPluginInitializer payApplyPluginInitializer;
@Autowired
private TransactionDetailPluginInitializer transactionDetailPluginInitializer;
@Autowired
private PayResultPluginInitializer payResultPluginInitializer;
@Test
public void cbs8PluginTest(){
try {
//支付申请 测试通过
//payApplyPluginInitializer.executeBusiness(new JSONObject());
//查询交易明细 测试通过
//transactionDetailPluginInitializer.executeBusiness(new JSONObject());
//交易结果查询 未测试 OA没有日志底表无法测试
payResultPluginInitializer.executeBusiness(new JSONObject());
//电子回单测试 通过apipost测试过了可以取到cbs电子回单只是没法上传到OA
//
}catch (Exception e){
e.printStackTrace();
}
}
@Test
public void queryUnpaid(){
//查询待支付的列表
@ -52,6 +80,7 @@ public class temButtom {
paymentEntity.setDataSourceCode("yc-test");
try {
List<PaymentEntity> paymentList = paymentService.queryUnpaid(paymentEntity);
System.out.println(paymentList);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);

View File

@ -2,7 +2,6 @@ package com.hzya.frame.cbs8.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.cbs8.dto.req.*;
import com.hzya.frame.cbs8.service.ICbs8ExtService;
@ -13,11 +12,10 @@ import com.hzya.frame.stringutil.StringUtil;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.http.protocol.HTTP;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
* @Description
@ -28,6 +26,7 @@ import java.util.Map;
@Service(value = "cbs8Ext")
public class Cbs8ExtServiceImpl implements ICbs8ExtService {
Logger logger = LoggerFactory.getLogger(getClass());
/**
* 支付经办
*
@ -60,7 +59,8 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
payRequestDTO.setApplyUnitCode(paymentEntity.getPayCompanyCode());
payRequestDTO.setPayAccount(null);
}
String requestData = JSONObject.toJSONString(payRequestDTO);
List<PayRequestDTO> list = Arrays.asList(payRequestDTO);
String requestData = JSONObject.toJSONString(list);
//加密 签名
encrypAndsign(entity,requestData);
}
@ -117,7 +117,7 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
@Override
public SysExtensionApiEntity transactionDetailQuery(SysExtensionApiEntity entity) {
String bodys = entity.getBodys();
if (StrUtil.isEmpty(bodys)){
if (StrUtil.isNotEmpty(bodys)){
TransactionDetailReqDTO transactionDetailReqDTO = JSONObject.parseObject(bodys,TransactionDetailReqDTO.class);
String requestData = JSONObject.toJSONString(transactionDetailReqDTO);
////加密签名
@ -205,11 +205,12 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
private void encrypAndsign(SysExtensionApiEntity entity, String requestData) {
//签名
long timestamp = System.currentTimeMillis();
logger.info("CBS请求参数明文:{}",requestData);
String sign = CBSUtil.sign(requestData,timestamp);
//加密
byte[] encryptedData = CBSUtil.encrypt(requestData);
Map<String,String> header = headersValueOf(sign,timestamp);
entity.setBodys(Base64.getEncoder().encodeToString(encryptedData));
entity.setByteBodys(encryptedData);
entity.setHeaders(header);
}
}

View File

@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapBuilder;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
@ -19,6 +20,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Map;
@ -44,8 +47,16 @@ public class Cbs8ServiceImpl implements ICbs8Service {
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(JSONObject.toJSONString(paymentEntity)).timeout(60000).execute().body();
//解密响应报文
String result = decryptResBody(body);
PayResponseDTO payResponseDTO = JSONObject.parseObject(result,PayResponseDTO.class);
return payResponseDTO;
if (StrUtil.isNotEmpty(result)){
CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
List<JSONObject> dataList = cbsResponseDTO.getData();
if (CollectionUtils.isNotEmpty(dataList)){
JSONObject o = dataList.get(0);
PayResponseDTO payResponseDTO = JSON.toJavaObject(o, PayResponseDTO.class);
return payResponseDTO;
}
}
return new PayResponseDTO();
}
/**
@ -71,7 +82,7 @@ public class Cbs8ServiceImpl implements ICbs8Service {
List<PayResultResDTO> payResultList = CBSUtil.convertJsonArrayToList(dataList, PayResultResDTO.class);
return payResultList;
}
return null;
return new ArrayList<PayResultResDTO>();
}
/**
@ -138,11 +149,18 @@ public class Cbs8ServiceImpl implements ICbs8Service {
int pageSize = transactionDetailReqDTO.getPageSize();
if (currentPage == 0){
currentPage = CBSUtil.DEFAULT_CURRENT_PAGE;
transactionDetailReqDTO.setCurrentPage(currentPage);//页码
}
if (pageSize == 0){
pageSize = CBSUtil.DEFAULT_PAGE_SIZE;
transactionDetailReqDTO.setPageSize(pageSize);
}
if (StrUtil.isNotEmpty(transactionDetailReqDTO.getStartDate())){
transactionDetailReqDTO.setStartDate(DateUtil.today());
}
if (StrUtil.isNotEmpty(transactionDetailReqDTO.getEndDate())){
transactionDetailReqDTO.setEndDate(DateUtil.today());
}
String params = JSON.toJSONString(transactionDetailReqDTO);
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", "8000260006")
@ -165,7 +183,7 @@ public class Cbs8ServiceImpl implements ICbs8Service {
}
}
}
return null;
return new CbsResDataDTO();
}
/**
@ -196,7 +214,7 @@ public class Cbs8ServiceImpl implements ICbs8Service {
return payResponseDTO;
}
}
return null;
return new PayResponseDTO();
}
/**
@ -226,7 +244,7 @@ public class Cbs8ServiceImpl implements ICbs8Service {
return agentPayResultResDTO;
}
}
return null;
return new AgentPayResultResDTO();
}
/**
@ -239,8 +257,14 @@ public class Cbs8ServiceImpl implements ICbs8Service {
JsonResultEntity resultEntity = JSONObject.parseObject(body,JsonResultEntity.class);
String bodyBase64 = String.valueOf(resultEntity.getAttribute());
byte[] bodyBytes = Base64.getDecoder().decode(bodyBase64);
//这里验证一下如果系统异常 返回的报文没加密
String test = new String(bodyBytes);
if (JSONUtil.isTypeJSON(test)){
return test;
}
//解密报文
String result = CBSUtil.decrypt(bodyBytes);
logger.info("银行响应参数:{}",result);
return result;
}
return null;

View File

@ -227,5 +227,11 @@ public class SM2Util {
byte[] decode = Base64.getDecoder().decode(encodeToString);
byte[] decrypt1 = decrypt("c3509b6df8bdaf84c464daa1b6fa11a8fca77b0e4a6f076ee68487f288278a85", decode);
System.out.println("解密完成1"+new String(decrypt1));
String base64 = "eyJtc2ciOiLns7vnu5/lvILluLjvvIzor7fnqI3lkI7lho3or5UiLCJkYXRhIjpudWxsLCJjb2RlIjoiNTAwIn0=";
byte[] decode1 = Base64.getDecoder().decode(base64);
String decode2 = new String(decode1);
byte[] decryptbyte = decrypt("83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44", decode1);
System.out.println("解密完成"+new String(decryptbyte));
}
}

View File

@ -64,6 +64,46 @@
personalFlag,
payType
</sql>
<!-- 基础查询语句 -->
<sql id="base_sql">
SELECT
formson_0210.id as oaId,
'formson_0210' as tableName,
COL_SUMMARY.SUBJECT as title,
unit.name as payCompany,
'差旅费报销单' as billName,
'field0072' as payResultField,
'field0073' as payDateField,
'' as receiptFiled,
COL_SUMMARY.id as summaryId,
formmain_0209.field0017||'-'||formson_0210.sort as referenceNum,
formmain_0209.START_DATE as startDate,
formmain_0209.FINISHEDFLAG as finishedflag,
formson_0210.field0073 as payDate,
formson_0210.field0072 as payResult,
REGEXP_REPLACE(formmain_0209.field0042, '[[:space:]]', '') as payAccount,
REGEXP_REPLACE(formmain_0209.field0041, '[[:space:]]', '') as payBankName,
formson_0210.field0031 as amount,
formmain_0209.field0038 as purpose,
formmain_0209.field0038 as cbsAbstract,
REGEXP_REPLACE(formson_0210.field0069, '[[:space:]]', '') as revAccount,
formson_0210.field0068 as revBankName,
'测试' as revAccountName,
REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode,
item.showvalue as personalFlag,
'OTH' as revBankType,
'10' as currency,
'202' as busType,
'' as receipt
from
formson_0210
LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id
-- LEFT JOIN CTP_AFFAIR ON CTP_AFFAIR.object_id = COL_SUMMARY.id
left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070
left join ORG_UNIT unit on unit.id =formmain_0209.field0002
</sql>
<!-- 采用==查询 -->
<select id="PaymentEntity_list_base" resultMap="get-PaymentEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.PaymentEntity">
<!-- select
@ -207,79 +247,35 @@
and receipt is null and personalFlag='0' and payResult = '支付成功'
</trim>
</select>
<!-- 查询推送状态为null的代表没有发送请求或者请求客户服务器没有返回的 采用==查询 -->
<!-- 查询待支付的 -->
<select id="PaymentEntity_list_base_unpaid" resultMap="get-PaymentEntity-result" parameterType="com.hzya.frame.seeyon.cbs8.entity.PaymentEntity">
<!--select
<include refid="PaymentEntity_Base_Column_List"/>
from
v_hzya_oa_cbs-->
-- 差旅费报销单
SELECT
formson_0210.id as oaId, -- 主表id
'formson_0210' as tableName, -- 表名
COL_SUMMARY.SUBJECT as title, -- 单据标题
unit.name as payCompany, -- 付款公司
'差旅费报销单' as billName,
'field0072' as payResultField, -- 支付结果字段
'field0073' as payDateField, -- 打款日期字段
'' as receiptFiled,-- 电子回单字段
COL_SUMMARY.id as summaryId,
formmain_0209.field0017||'-'||formson_0210.sort as referenceNum, -- 单据编号
formmain_0209.START_DATE as startDate, -- 单据日期
formmain_0209.FINISHEDFLAG as finishedflag, -- 流程状态
formson_0210.field0073 as payDate, -- 打款日期
formson_0210.field0072 as payResult, -- 支付结果
REGEXP_REPLACE(formmain_0209.field0042, '[[:space:]]', '') as payAccount, -- 付款账户
REGEXP_REPLACE(formmain_0209.field0041, '[[:space:]]', '') as payBankName, -- 付款开户行
formson_0210.field0031 as amount, -- 金额
formmain_0209.field0038 as purpose, -- 用途
formmain_0209.field0038 as cbsAbstract, -- 摘要
REGEXP_REPLACE(formson_0210.field0069, '[[:space:]]', '') as revAccount, -- 收款账户
formson_0210.field0068 as revBankName, -- 收款开户行
'' as revAccountName, -- 收款人
REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode, -- 收款联行号
item.showvalue as personalFlag,-- 公私标记
'' as revBankType,-- 收款银行类型
'10' as currency,-- 币种
'' as busType,-- 业务类型
'' as receipt -- 电子回单
from
formson_0210
LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id
LEFT JOIN CTP_AFFAIR ON CTP_AFFAIR.object_id = COL_SUMMARY.id
left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070
left join ORG_UNIT unit on unit.id =formmain_0209.field0002
-- left join V_USER_VIEW_ALL us on us.staffid=formmain_0209.field0024
WHERE 1=1
-- and formson_0210.field0031>0
and CTP_AFFAIR.node_name = '发起者' and CTP_AFFAIR.COMPLETE_TIME is null and CTP_AFFAIR.STATE = 3
select v.* from (
<include refid="base_sql"/>
) v
<trim prefix="where" prefixOverrides="and">
<if test="referenceNum != null and referenceNum !='' "> referenceNum = #{referenceNum} </if>
<if test="busType != null and busType !='' "> and busType = #{busType} </if>
<if test="amount != null and amount !='' ">and amount = #{amount} </if>
<if test="currency != null and currency !='' "> and currency = #{currency} </if>
<if test="payAccount != null and payAccount !='' ">and payAccount = #{payAccount} </if>
<if test="revAccount != null and revAccount !='' "> and revAccount = #{revAccount} </if>
<if test="revAccountName != null and revAccountName !='' "> and revAccountName = #{revAccountName} </if>
<if test="revBankType != null and revBankType !='' "> and revBankType = #{revBankType} </if>
<if test="revBankName != null and revBankName !='' ">and revBankName = #{revBankName} </if>
<if test="cnapsCode != null and cnapsCode !='' ">and cnapsCode = #{cnapsCode} </if>
<if test="purpose != null and purpose !='' "> and purpose = #{purpose} </if>
<if test="personalFlag != null and personalFlag !='' ">and personalFlag = #{personalFlag} </if>
<if test="tableName != null and tableName !='' "> and tableName = #{tableName} </if>
<if test="oaId != null and oaId !='' ">and oaId = #{oaId} </if>
<if test="payCompany != null and payCompany !='' "> and payCompany = #{payCompany} </if>
<if test="payCompanyCode != null and payCompanyCode !='' "> and payCompanyCode = #{payCompanyCode} </if>
<if test="title != null and title !='' "> and title = #{title} </if>
<if test="billName != null and billName !='' "> and billName = #{billName} </if>
<if test="payResult != null and payResult !='' ">and payResult = #{payResult} </if>
<if test="payBankName != null and payBankName !='' ">and payBankName = #{payBankName} </if>
<if test="payType != null and payType !='' "> and payType = #{payType} </if>
<if test="finishedflag != null and finishedflag !='' "> and finishedflag = #{finishedflag} </if>
and payResult is null
and oaId not in (select field0001 from formmain_1283)
and startDate >= #{startDate}
<if test="referenceNum != null and referenceNum !='' "> v.referenceNum = #{referenceNum} </if>
<if test="busType != null and busType !='' "> and v.busType = #{busType} </if>
<if test="amount != null and amount !='' ">and v.amount = #{amount} </if>
<if test="currency != null and currency !='' "> and v.currency = #{currency} </if>
<if test="payAccount != null and payAccount !='' ">and v.payAccount = #{payAccount} </if>
<if test="revAccount != null and revAccount !='' "> and v.revAccount = #{revAccount} </if>
<if test="revAccountName != null and revAccountName !='' "> and v.revAccountName = #{revAccountName} </if>
<if test="revBankType != null and revBankType !='' "> and v.revBankType = #{revBankType} </if>
<if test="revBankName != null and revBankName !='' ">and v.revBankName = #{revBankName} </if>
<if test="cnapsCode != null and cnapsCode !='' ">and v.cnapsCode = #{cnapsCode} </if>
<if test="purpose != null and purpose !='' "> and v.purpose = #{purpose} </if>
<if test="personalFlag != null and personalFlag !='' ">and v.personalFlag = #{personalFlag} </if>
<if test="tableName != null and tableName !='' "> and v.tableName = #{tableName} </if>
<if test="oaId != null and oaId !='' ">and v.oaId = #{oaId} </if>
<if test="payCompany != null and payCompany !='' "> and v.payCompany = #{payCompany} </if>
<if test="payCompanyCode != null and payCompanyCode !='' "> and v.payCompanyCode = #{payCompanyCode} </if>
<if test="title != null and title !='' "> and v.title = #{title} </if>
<if test="billName != null and billName !='' "> and v.billName = #{billName} </if>
<if test="payResult != null and payResult !='' ">and v.payResult = #{payResult} </if>
<if test="payBankName != null and payBankName !='' ">and v.payBankName = #{payBankName} </if>
<if test="payType != null and payType !='' "> and v.payType = #{payType} </if>
<if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if>
</trim>
</select>

View File

@ -99,4 +99,10 @@ public class CbsLogServiceImpl extends BaseService<CbsLogEntity,String> implemen
}
}
}
//获取xml模板
private String getXmlTemplate(){
// return "<forms version=\"2.1\"><formExport><summary id=\"859338107516044243\" name=\"formmain_1283\"/><definitions><column id=\"field0001\" type=\"0\" name=\"单据ID\" isNullable=\"false\" length=\"100\"/><column id=\"field0002\" type=\"0\" name=\"单据编号\" isNullable=\"false\" length=\"100\"/><column id=\"field0003\" type=\"0\" name=\"英文表名\" isNullable=\"false\" length=\"100\"/><column id=\"field0004\" type=\"0\" name=\"中文表名\" isNullable=\"false\" length=\"100\"/><column id=\"field0005\" type=\"0\" name=\"支付状态\" isNullable=\"false\" length=\"100\"/><column id=\"field0006\" type=\"0\" name=\"支付信息\" isNullable=\"false\" length=\"100\"/><column id=\"field0007\" type=\"0\" name=\"支付申请状态\" isNullable=\"false\" length=\"100\"/><column id=\"field0008\" type=\"0\" name=\"成功标记\" isNullable=\"false\" length=\"100\"/></definitions><values><column name=\"单据ID\"><value><![CDATA[{}]]></value></column><column name=\"单据编号\"><value><![CDATA[{}]]></value></column><column name=\"英文表名\"><value><![CDATA[{}]]></value></column><column name=\"中文表名\"><value><![CDATA[{}]]></value></column><column name=\"支付状态\"><value><![CDATA[{}]]></value></column><column name=\"支付信息\"><value><![CDATA[{}]]></value></column><column name=\"支付申请状态\"><value><![CDATA[{}]]></value></column><column name=\"成功标记\"><value><![CDATA[{}]]></value></column></values><subForms/></formExport></forms>";
return "<forms version=\"2.1\"><formExport><summary id=\"859338107516044243\" name=\"formmain_1283\"/><definitions><column id=\"field0001\" type=\"0\" name=\"单据ID\" isNullable=\"false\" length=\"100\"/><column id=\"field0002\" type=\"0\" name=\"单据编号\" isNullable=\"false\" length=\"100\"/><column id=\"field0003\" type=\"0\" name=\"英文表名\" isNullable=\"false\" length=\"100\"/><column id=\"field0004\" type=\"0\" name=\"中文表名\" isNullable=\"false\" length=\"100\"/><column id=\"field0005\" type=\"0\" name=\"支付状态\" isNullable=\"false\" length=\"100\"/><column id=\"field0006\" type=\"0\" name=\"支付信息\" isNullable=\"false\" length=\"100\"/><column id=\"field0007\" type=\"0\" name=\"支付申请状态\" isNullable=\"false\" length=\"100\"/><column id=\"field0008\" type=\"0\" name=\"成功标记\" isNullable=\"false\" length=\"100\"/><column id=\"field0009\" type=\"0\" name=\"流程标题\" isNullable=\"false\" length=\"255\"/><column id=\"field0010\" type=\"0\" name=\"请款主体\" isNullable=\"false\" length=\"100\"/><column id=\"field0011\" type=\"0\" name=\"收款对象\" isNullable=\"false\" length=\"100\"/><column id=\"field0012\" type=\"4\" name=\"金额\" isNullable=\"false\" length=\"20\"/><column id=\"field0013\" type=\"0\" name=\"CBS支付申请单号\" isNullable=\"false\" length=\"100\"/></definitions><values><column name=\"单据ID\"><value><![CDATA[{}]]></value></column><column name=\"单据编号\"><value><![CDATA[{}]]></value></column><column name=\"英文表名\"><value><![CDATA[{}]]></value></column><column name=\"中文表名\"><value><![CDATA[{}]]></value></column><column name=\"支付状态\"><value><![CDATA[{}]]></value></column><column name=\"支付信息\"><value><![CDATA[{}]]></value></column><column name=\"支付申请状态\"><value><![CDATA[{}]]></value></column><column name=\"成功标记\"><value><![CDATA[{}]]></value></column><column name=\"流程标题\"><value><![CDATA[{}]]></value></column><column name=\"请款主体\"><value><![CDATA[{}]]></value></column><column name=\"收款对象\"><value><![CDATA[{}]]></value></column><column name=\"金额\"><value><![CDATA[{}]]></value></column><column name=\"CBS支付申请单号\"><value><![CDATA[{}]]></value></column></values><subForms/></formExport></forms>";
}
}

View File

@ -1,7 +1,9 @@
package com.hzya.frame.seeyon.cbs8.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.cbs8.util.PayState;
import com.hzya.frame.seeyon.cbs8.dao.IPaymentDao;
import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
import com.hzya.frame.seeyon.cbs8.service.IPaymentService;
@ -56,7 +58,12 @@ public class PaymentServiceImpl extends BaseService<PaymentEntity,String> implem
@DS("#entity.dataSourceCode")
@Override
public List<PaymentEntity> querySuccess(PaymentEntity entity) throws Exception {
return null;
if (null == entity){
entity = new PaymentEntity();
}
entity.setPayResult(PayState.payStateGetValue("g"));
List<PaymentEntity> list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base");
return list;
}
/**
@ -69,7 +76,8 @@ public class PaymentServiceImpl extends BaseService<PaymentEntity,String> implem
@DS("#entity.dataSourceCode")
@Override
public List<PaymentEntity> queryElecIsNull(PaymentEntity entity) throws Exception {
return null;
List<PaymentEntity> list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base_elec_isnull");
return list;
}
/**
@ -83,7 +91,8 @@ public class PaymentServiceImpl extends BaseService<PaymentEntity,String> implem
@DS("#entity.dataSourceCode")
@Override
public List<PaymentEntity> queryInPayment(PaymentEntity entity) throws Exception {
return null;
List<PaymentEntity> list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base_in_payment");
return list;
}
/**
@ -95,7 +104,13 @@ public class PaymentServiceImpl extends BaseService<PaymentEntity,String> implem
@DS("#entity.dataSourceCode")
@Override
public void updatePayState(PaymentEntity entity) throws Exception {
if (null != entity
&& StrUtil.isNotEmpty(entity.getTableName())
&& StrUtil.isNotEmpty(entity.getOaId())
&& StrUtil.isNotEmpty(entity.getPayDateField())
&& StrUtil.isNotEmpty(entity.getPayResultField())){
paymentDao.update("com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_update_payState",entity);
}
}
/**
@ -107,6 +122,11 @@ public class PaymentServiceImpl extends BaseService<PaymentEntity,String> implem
@DS("#entity.dataSourceCode")
@Override
public void updateElec(PaymentEntity entity) throws Exception {
if (null != entity
&& StrUtil.isNotEmpty(entity.getTableName())
&& StrUtil.isNotEmpty(entity.getOaId())
&& StrUtil.isNotEmpty(entity.getReceiptFiled())){
paymentDao.update("com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_update_electronic",entity);
}
}
}