parent
7f9a513305
commit
1eac206f28
|
@ -0,0 +1,36 @@
|
|||
package com.hzya.frame.plugin.a8bill.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
|
||||
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组织档案(mdm_org: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-07 18:30:04
|
||||
*/
|
||||
public interface IPayBillPluginInitializerDao extends IBaseDao<PayBillEntity, String> {
|
||||
/**
|
||||
*
|
||||
* @content 通用获取OA数据接口
|
||||
* @author laborer
|
||||
* @date 2024/7/10 0010 16:06
|
||||
*
|
||||
*/
|
||||
|
||||
List<HashMap<String, Object>> getOaBillData(String str , PayBillEntity entity)throws Exception;
|
||||
/**
|
||||
*
|
||||
* @content 通过ID修改单据状态
|
||||
* @author laborer
|
||||
* @date 2024/7/10 0010 17:32
|
||||
*
|
||||
*/
|
||||
|
||||
int updateStateForId(String str , PayBillEntity entity)throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.hzya.frame.plugin.a8bill.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.execsql.service.IExecSqlService;
|
||||
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
|
||||
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组织档案(MdmOrg)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-07 18:30:04
|
||||
*/
|
||||
public class PayBillPluginInitializerDaoImpl extends MybatisGenericDao<PayBillEntity, String> implements IPayBillPluginInitializerDao {
|
||||
@Autowired
|
||||
private IExecSqlService execSqlService;
|
||||
@DS("#entity.dataSourceCode")
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getOaBillData(String str, PayBillEntity entity)throws Exception {
|
||||
return execSqlService.execSelectSql(str, "");
|
||||
}
|
||||
@DS("#entity.dataSourceCode")
|
||||
@Override
|
||||
public int updateStateForId(String str , PayBillEntity entity)throws Exception {
|
||||
return super.update("com.hzya.frame.plugin.a8bill.dao.impl.PayBillPluginInitializerDaoImpl.PayBillEntity_update",entity);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,14 @@ import com.hzya.frame.web.entity.BaseEntity;
|
|||
* @since 2024-06-07 18:30:04
|
||||
*/
|
||||
public class PayBillEntity extends BaseEntity {
|
||||
private String sql;
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public void setSql(String sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.plugin.a8bill.dao.impl.PayBillDaoImpl">
|
||||
<mapper namespace="com.hzya.frame.plugin.a8bill.dao.impl.PayBillPluginInitializerDaoImpl">
|
||||
|
||||
<resultMap id="get-PayBillEntity-result" type="com.hzya.frame.plugin.a8bill.entity.PayBillEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
|
||||
</resultMap>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "PayBillEntity_Base_Column_List">
|
||||
id
|
||||
|
||||
</sql>
|
||||
|
||||
</sql>
|
||||
<!--执行update语句-->
|
||||
<update id="PayBillEntity_update" parameterType="com.hzya.frame.plugin.a8bill.entity.PayBillEntity">
|
||||
<if test="null != sql and sql != ''">
|
||||
${sql}
|
||||
</if>
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -0,0 +1,212 @@
|
|||
package com.hzya.frame.plugin.a8bill.plugin;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
|
||||
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
|
||||
import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author xiangerlin
|
||||
* @Date 2024/7/29 11:08
|
||||
**/
|
||||
public class NingboBankPayPluginInitializer extends PluginBaseEntity {
|
||||
Logger logger = LoggerFactory.getLogger(getClass());
|
||||
@Autowired
|
||||
private INingboBankPluginService ningboBankPluginService;
|
||||
@Resource
|
||||
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
|
||||
@Autowired
|
||||
private IPayBillPluginInitializerDao payBillDao;
|
||||
|
||||
@Value("${OA.data_source_code}")
|
||||
private String oa_data_source_code;
|
||||
/***
|
||||
* 插件初始化方法
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-08-02 10:48
|
||||
* @Param []
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件销毁方法
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件的ID
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "NingboBankPayPlugin";
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件的名称
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "宁波银行转账插件";
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件的显示值
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "宁波银行转账插件";
|
||||
}
|
||||
|
||||
/***
|
||||
* 插件类型 1、场景插件
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-08-02 14:01
|
||||
* @Param []
|
||||
* @return java.lang.String
|
||||
**/
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
/***
|
||||
* 执行业务代码
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-08-07 11:20
|
||||
* @param requestJson 执行业务代码的参数
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class);
|
||||
String interId = requestJsonObj.getString("integration_task_living_details_id");
|
||||
IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity();
|
||||
if(StrUtil.isNotEmpty(interId)){
|
||||
oldMsg = taskLivingDetailsService.get(interId);
|
||||
}
|
||||
String rootAppPk = oldMsg.getRootAppPk();
|
||||
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
if(StrUtil.isNotEmpty(rootAppPk)){
|
||||
String code = requestJson.getString("code");
|
||||
sb.append(" and id = '"+rootAppPk+"'");
|
||||
}else{
|
||||
sb.append(" and payState is null");
|
||||
}
|
||||
|
||||
PayBillEntity oaBillEntity = new PayBillEntity();
|
||||
oaBillEntity.setDataSourceCode(oa_data_source_code);
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
|
||||
//备用金申请单
|
||||
stringBuffer.append("select * from v_hzya_pay where 1=1 " );
|
||||
stringBuffer.append(sb.toString());
|
||||
List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity);
|
||||
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||
for (HashMap<String, Object> hashMap : hashMaps) {
|
||||
JSONObject main = new JSONObject();
|
||||
for(String key:hashMap.keySet()) {
|
||||
main.put(key, hashMap.get(key));
|
||||
}
|
||||
logger.info("获取到付款单的数据"+main.toString());
|
||||
String result = ningboBankPluginService.executeEsb(main.toString(),"8000360000");
|
||||
logger.info("推送宁波银行的返回结果"+result);
|
||||
IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity();
|
||||
logDetails.setRootAppPk(main.getString("id"));
|
||||
logDetails.setRootAppBill(main.getString("serialNo"));
|
||||
logDetails.setNewTransmitInfo(result);
|
||||
logDetails.setNewPushDate(new Date());
|
||||
logDetails.setRootAppNewData(JSON.toJSONString(main));
|
||||
logDetails.setPluginId("NingboBankPayPlugin");
|
||||
JSONObject resultObj = JSON.parseObject(result);
|
||||
String attribute = resultObj.getString("attribute");
|
||||
boolean flag = resultObj.getBoolean("flag");
|
||||
String subState = "";
|
||||
String fieldName = main.getString("fieldName");
|
||||
String tableName = main.getString("tableName");
|
||||
String payMsg = main.getString("payMsg");
|
||||
// String subMsg = main.getString("subMsg");
|
||||
String str = "";
|
||||
String sync_flag = "";
|
||||
try {
|
||||
if(StrUtil.isEmpty(interId)){// 银行状态 1支付中 2 支付失败 null 未提交支付 0支付成功
|
||||
if(flag){
|
||||
subState = "1";
|
||||
sync_flag = " ,"+payMsg+" = '支付中'";
|
||||
taskLivingDetailsService.saveLogToSuccess(logDetails);
|
||||
}else{
|
||||
subState = "2";
|
||||
sync_flag = " ,"+payMsg+" = '"+attribute+"'";
|
||||
taskLivingDetailsService.saveLogToFail(logDetails);
|
||||
}
|
||||
}else{
|
||||
logDetails.setId(interId);
|
||||
if(flag){
|
||||
subState = "1";
|
||||
sync_flag = " ,"+payMsg+" = '支付中'";
|
||||
taskLivingDetailsService.saveLogFailToSuccess(logDetails);
|
||||
}else{
|
||||
subState = "2";
|
||||
sync_flag = " ,"+payMsg+" = '"+attribute+"'";
|
||||
taskLivingDetailsService.updateLogFailToSuccess(logDetails);
|
||||
}
|
||||
}
|
||||
|
||||
str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +sync_flag+"where id = '"+main.getString("id")+"'";
|
||||
} catch (Exception e) {
|
||||
subState = "N";
|
||||
str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +payMsg+" = '"+attribute+"' "+"where id = '"+main.getString("id")+"'";
|
||||
logger.info("保存日志失败"+e.getMessage());
|
||||
oaBillEntity.setSql(str);
|
||||
payBillDao.updateStateForId(str,oaBillEntity);
|
||||
e.printStackTrace();
|
||||
}
|
||||
//修改推送状态,防止重复推送
|
||||
oaBillEntity.setSql(str);
|
||||
payBillDao.updateStateForId(str,oaBillEntity);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("获取OA数据失败"+e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return new JsonResultEntity("成功",true,new JsonResultEntity());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,185 @@
|
|||
package com.hzya.frame.plugin.a8bill.plugin;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.ningboBankTreasury.enums.PayStatusEnum;
|
||||
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
|
||||
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
|
||||
import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description 宁波银行 单笔付款交易结果查询
|
||||
* @Author xiangerlin
|
||||
* @Date 2024/7/29 16:59
|
||||
**/
|
||||
public class NingboBankPayResultPluginInitializer extends PluginBaseEntity {
|
||||
Logger logger = LoggerFactory.getLogger(getClass());
|
||||
@Value("${OA.data_source_code}")
|
||||
private String oa_data_source_code;
|
||||
@Autowired
|
||||
private IPayBillPluginInitializerDao payBillDao;
|
||||
@Autowired
|
||||
private INingboBankPluginService ningboBankPluginService;
|
||||
/***
|
||||
* 插件初始化方法
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-08-02 10:48
|
||||
* @Param []
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public void initialize() {
|
||||
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件销毁方法
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件的ID
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "NingboBankPayResultPlugin";
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件的名称
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "宁波银行转账结果查询插件";
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件的显示值
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "宁波银行转账结果查询插件";
|
||||
}
|
||||
|
||||
/***
|
||||
* 插件类型 1、场景插件
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-08-02 14:01
|
||||
* @Param []
|
||||
* @return java.lang.String
|
||||
**/
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
/***
|
||||
* 执行业务代码
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-08-07 11:20
|
||||
* @param requestJson 执行业务代码的参数
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
PayBillEntity oaBillEntity = new PayBillEntity();
|
||||
oaBillEntity.setDataSourceCode(oa_data_source_code);
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select * from v_hzya_pay where payState ='1'");
|
||||
try {
|
||||
List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity);
|
||||
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||
for (HashMap<String, Object> hashMap : hashMaps) {
|
||||
JSONObject main = new JSONObject();
|
||||
for(String key:hashMap.keySet()) {
|
||||
main.put(key, hashMap.get(key));
|
||||
}
|
||||
String tableName = main.getString("tableName");
|
||||
String fieldName = main.getString("fieldName");
|
||||
String payDate = main.getString("payDate");
|
||||
String payMsg = main.getString("payMsg");
|
||||
try {
|
||||
|
||||
logger.info("获取到付款单状态的数据"+main.toString());
|
||||
JSONObject reMain = new JSONObject();
|
||||
reMain.put("serialNo",main.getString("serialNo"));
|
||||
String result = ningboBankPluginService.executeEsb(reMain.toString(),"8000360001");
|
||||
logger.info("获取付款状态结果"+result);
|
||||
|
||||
JSONObject resultObj = JSON.parseObject(result);
|
||||
JSONObject attribute = resultObj.getJSONObject("attribute");
|
||||
boolean flag = resultObj.getBoolean("flag");
|
||||
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("update "+tableName);
|
||||
if(flag){
|
||||
JSONObject data = attribute.getJSONObject("Data");
|
||||
JSONObject transferDtl = data.getJSONObject("transferDtl");
|
||||
String status = transferDtl.getString("status");
|
||||
String msg = PayStatusEnum.getByCode(status);
|
||||
if(StrUtil.isEmpty(msg)){
|
||||
msg ="未知交易状态,请联系管理员查证";
|
||||
sb.append(" set "+payMsg+" = '"+msg+"'");
|
||||
sb.append(" , "+fieldName+" = '2'");
|
||||
}
|
||||
sb.append(" set "+payMsg+" = '"+msg+"'");
|
||||
if(status.equals("0")||status.equals("-2")||status.equals("-3")||status.equals("2")||status.equals("4")||status.equals("5")||status.equals("6")||status.equals("96")||status.equals("112")){
|
||||
sb.append(" , "+fieldName+" = '0'");
|
||||
String payDateStr = DateUtil.now();
|
||||
sb.append(" , "+payDate+" = '"+payDateStr+"'");
|
||||
}
|
||||
}else {
|
||||
sb.append(" set "+payMsg+" = '查询失败,请联系管理员'");
|
||||
sb.append(" ,"+fieldName+" = '2'");
|
||||
|
||||
}
|
||||
sb.append(" where id = '"+main.getString("id")+"'");
|
||||
//修改推送状态,防止重复推送
|
||||
oaBillEntity.setSql(sb.toString());
|
||||
payBillDao.updateStateForId(sb.toString(),oaBillEntity);
|
||||
} catch (Exception e) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("update "+tableName );
|
||||
sb.append(" set "+payMsg+" = '获取交易状态失败'");
|
||||
sb.append(" , "+fieldName+" = '2'");
|
||||
sb.append(" where id = '"+main.getString("id")+"'");
|
||||
logger.info("获取交易状态失败,更新交易信息为失败状态,后续不在查询");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return new JsonResultEntity("成功",true,new JsonResultEntity());
|
||||
}
|
||||
}
|
|
@ -11,6 +11,15 @@ import java.util.List;
|
|||
**/
|
||||
public interface INingboBankPluginService {
|
||||
|
||||
/**
|
||||
* 调用宁波银行esb接口
|
||||
* @param params
|
||||
* @param apiCode
|
||||
* @return
|
||||
*/
|
||||
String executeEsb(String params,String apiCode);
|
||||
|
||||
|
||||
/**
|
||||
* 保存收款日志到oa底表
|
||||
* @param accTransactionResList
|
||||
|
|
|
@ -12,6 +12,8 @@ import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity;
|
|||
import com.hzya.frame.seeyon.dongj.service.IFormmain0044Service;
|
||||
import com.hzya.frame.stringutil.StringUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
|
@ -29,9 +31,30 @@ public class NingboBankPluginServiceImpl implements INingboBankPluginService {
|
|||
|
||||
@Autowired
|
||||
private IFormmain0044Service formmain0044Service;
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(getClass());
|
||||
@Value("${OA.data_source_code}")
|
||||
private String oa_data_source_code;
|
||||
|
||||
/**
|
||||
* 调用宁波银行esb接口
|
||||
*
|
||||
* @param params
|
||||
* @param apiCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String executeEsb(String params, String apiCode) {
|
||||
logger.info("请求apiCode:{},参数:{}",apiCode,params);
|
||||
Map<String, String> header = MapBuilder.<String, String>create(true)
|
||||
.put("apiCode", apiCode)
|
||||
.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")
|
||||
.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
|
||||
.put("appId","800036")
|
||||
.build();
|
||||
String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(60000).execute().body();
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存收款日志到oa底表
|
||||
* @param accTransactionResList
|
||||
|
|
|
@ -0,0 +1,209 @@
|
|||
package com.hzya.frame.ningboBankTreasury.dto.req;
|
||||
|
||||
/**
|
||||
* @Description 单笔转账请求参数
|
||||
* @Author xiangerlin
|
||||
* @Date 2024/7/26 16:27
|
||||
**/
|
||||
public class SingleTransferReq {
|
||||
//客户号 必填
|
||||
private String custId;
|
||||
//付款账号 必填
|
||||
private String payAcc;
|
||||
//用途 必填,长度不能超过70
|
||||
private String purpose;
|
||||
//收款账号 必填
|
||||
private String rcvAcc;
|
||||
//收款方行名 和联行号二者必须填一个
|
||||
private String rcvBankName;
|
||||
//收款方联行号 对公支付必填
|
||||
private String rcvBankNo;
|
||||
//金额 必填
|
||||
private String amt;
|
||||
//同城异地标识 0同城 1异地
|
||||
private String areaSign;
|
||||
//单位代码 必填
|
||||
private String corpCode;
|
||||
//是否同行转账 0他行 1同行
|
||||
private String difBank;
|
||||
//交易流水号
|
||||
private String serialNo;
|
||||
//对公对私标识 0对公 1对丝
|
||||
private String isForIndividual;
|
||||
//是否预约支付 0非预约 1预约
|
||||
private String isSubscribe;
|
||||
//是否短信通知收款人 0不通知 1通知,只支持宁波银行付款的情况
|
||||
private String isTellRcv;
|
||||
//收款方手机号
|
||||
private String rcvMobile;
|
||||
//收款户名
|
||||
private String rcvName;
|
||||
//备注
|
||||
private String remark;
|
||||
//预约转账时间
|
||||
private String wishPayTime;
|
||||
//支付方式 0直接付款 1代理支付 2联动支付 3自动请款 ,为空时默认直接付款
|
||||
private String payType;
|
||||
//代理/联动账号/拨款账号
|
||||
private String remarkAcc;
|
||||
|
||||
public String getCustId() {
|
||||
return custId;
|
||||
}
|
||||
|
||||
public void setCustId(String custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public String getPayAcc() {
|
||||
return payAcc;
|
||||
}
|
||||
|
||||
public void setPayAcc(String payAcc) {
|
||||
this.payAcc = payAcc;
|
||||
}
|
||||
|
||||
public String getPurpose() {
|
||||
return purpose;
|
||||
}
|
||||
|
||||
public void setPurpose(String purpose) {
|
||||
this.purpose = purpose;
|
||||
}
|
||||
|
||||
public String getRcvAcc() {
|
||||
return rcvAcc;
|
||||
}
|
||||
|
||||
public void setRcvAcc(String rcvAcc) {
|
||||
this.rcvAcc = rcvAcc;
|
||||
}
|
||||
|
||||
public String getRcvBankName() {
|
||||
return rcvBankName;
|
||||
}
|
||||
|
||||
public void setRcvBankName(String rcvBankName) {
|
||||
this.rcvBankName = rcvBankName;
|
||||
}
|
||||
|
||||
public String getRcvBankNo() {
|
||||
return rcvBankNo;
|
||||
}
|
||||
|
||||
public void setRcvBankNo(String rcvBankNo) {
|
||||
this.rcvBankNo = rcvBankNo;
|
||||
}
|
||||
|
||||
public String getAmt() {
|
||||
return amt;
|
||||
}
|
||||
|
||||
public void setAmt(String amt) {
|
||||
this.amt = amt;
|
||||
}
|
||||
|
||||
public String getAreaSign() {
|
||||
return areaSign;
|
||||
}
|
||||
|
||||
public void setAreaSign(String areaSign) {
|
||||
this.areaSign = areaSign;
|
||||
}
|
||||
|
||||
public String getCorpCode() {
|
||||
return corpCode;
|
||||
}
|
||||
|
||||
public void setCorpCode(String corpCode) {
|
||||
this.corpCode = corpCode;
|
||||
}
|
||||
|
||||
public String getDifBank() {
|
||||
return difBank;
|
||||
}
|
||||
|
||||
public void setDifBank(String difBank) {
|
||||
this.difBank = difBank;
|
||||
}
|
||||
|
||||
public String getSerialNo() {
|
||||
return serialNo;
|
||||
}
|
||||
|
||||
public void setSerialNo(String serialNo) {
|
||||
this.serialNo = serialNo;
|
||||
}
|
||||
|
||||
public String getIsForIndividual() {
|
||||
return isForIndividual;
|
||||
}
|
||||
|
||||
public void setIsForIndividual(String isForIndividual) {
|
||||
this.isForIndividual = isForIndividual;
|
||||
}
|
||||
|
||||
public String getIsSubscribe() {
|
||||
return isSubscribe;
|
||||
}
|
||||
|
||||
public void setIsSubscribe(String isSubscribe) {
|
||||
this.isSubscribe = isSubscribe;
|
||||
}
|
||||
|
||||
public String getIsTellRcv() {
|
||||
return isTellRcv;
|
||||
}
|
||||
|
||||
public void setIsTellRcv(String isTellRcv) {
|
||||
this.isTellRcv = isTellRcv;
|
||||
}
|
||||
|
||||
public String getRcvMobile() {
|
||||
return rcvMobile;
|
||||
}
|
||||
|
||||
public void setRcvMobile(String rcvMobile) {
|
||||
this.rcvMobile = rcvMobile;
|
||||
}
|
||||
|
||||
public String getRcvName() {
|
||||
return rcvName;
|
||||
}
|
||||
|
||||
public void setRcvName(String rcvName) {
|
||||
this.rcvName = rcvName;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getWishPayTime() {
|
||||
return wishPayTime;
|
||||
}
|
||||
|
||||
public void setWishPayTime(String wishPayTime) {
|
||||
this.wishPayTime = wishPayTime;
|
||||
}
|
||||
|
||||
public String getPayType() {
|
||||
return payType;
|
||||
}
|
||||
|
||||
public void setPayType(String payType) {
|
||||
this.payType = payType;
|
||||
}
|
||||
|
||||
public String getRemarkAcc() {
|
||||
return remarkAcc;
|
||||
}
|
||||
|
||||
public void setRemarkAcc(String remarkAcc) {
|
||||
this.remarkAcc = remarkAcc;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.hzya.frame.ningboBankTreasury.enums;
|
||||
|
||||
/**
|
||||
* @Description 转账状态
|
||||
* @Author xiangerlin
|
||||
* @Date 2024/7/29 17:11
|
||||
**/
|
||||
public enum PayStatusEnum {
|
||||
SUCCESS("0","交易成功"),
|
||||
// 失败状态
|
||||
FAILED_DELETED("-2", "已删除"),
|
||||
APPROVAL_REJECTED_CLOSED("-3", "审批打回交易关闭"),
|
||||
TRANSACTION_FAILED("2", "交易失败"),
|
||||
FUND_ALLOCATION_FAILED("4", "交易失败,资金下拨失败"),
|
||||
LINKAGE_PAYMENT_FAILED_REFUNDED("5", "联动支付失败,资金退回成功"),
|
||||
LINKAGE_PAYMENT_FAILED_REFUND_PENDING("6", "联动支付失败,资金退回查证中"),
|
||||
LINKAGE_PAYMENT_FAILED_REFUND_FAILED("96", "联动支付失败,资金退回失败"),
|
||||
PAYMENT_REQUEST_FAILED("112", "请款失败"),
|
||||
|
||||
// 其他状态
|
||||
REJECTED("-1", "驳回"),
|
||||
PENDING_VERIFICATION("1", "交易待查证"),
|
||||
PENDING_SEND("3", "待发送"),
|
||||
PENDING_APPROVAL("11", "待审批"),
|
||||
APPROVAL_THROUGH("95", "审批通过"),
|
||||
TEMPORARY_STORAGE("7", "暂存"),
|
||||
WITHDRAWN_BY_OPERATOR("-4", "经办撤回"),
|
||||
PAYMENT_REQUEST_PENDING("111", "请款查证中"),
|
||||
PAYMENT_REQUEST_SUCCEEDED_PENDING_SEND("113", "请款成功,交易待发送"),
|
||||
LINKAGE_PAYMENT_SUCCEEDED_PENDING_SEND("114", "联动支付成功,智能支付交易待发送");
|
||||
|
||||
// 枚举属性
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
// 枚举构造函数
|
||||
PayStatusEnum(String code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
// 获取状态码
|
||||
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
// 获取状态描述
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
// 根据状态码查找枚举
|
||||
public static PayStatusEnum fromCode(String code) {
|
||||
for (PayStatusEnum status : PayStatusEnum.values()) {
|
||||
if (status.getCode().equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown code: " + code);
|
||||
}
|
||||
|
||||
public static String getByCode(String code){
|
||||
for (PayStatusEnum status : PayStatusEnum.values()) {
|
||||
if (status.getCode().equals(code)) {
|
||||
return status.getDescription();
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown code: " + code);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue