Compare commits

...

25 Commits
master ... kunb

Author SHA1 Message Date
yuqh c2efd012ea 1 2025-03-27 09:49:52 +08:00
yuqh 19d23fde97 修复因查询时间过长终端连接的问题 2025-03-26 18:50:12 +08:00
yuqh 6355fae36c 修复获取银行流水报错了不继续执行问题 2024-10-09 11:49:58 +08:00
yuqh 7fab551333 1 2024-08-30 15:55:54 +08:00
yuqh 2890f08d62 1 2024-08-16 20:44:07 +08:00
yuqh a50cc1dad5 1 2024-08-15 13:59:59 +08:00
yuqh c3f969541b Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into kunb 2024-08-14 11:05:01 +08:00
yuqh e4ea65a730 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into kunb 2024-08-14 10:59:07 +08:00
yuqh db28fdce5e 1 2024-08-14 10:57:58 +08:00
yuqh 7e27a4756c 堃博OA对接宁波银行 2024-07-31 14:27:29 +08:00
yuqh 5242a145a6 堃博OA对接宁波银行 2024-07-30 17:23:20 +08:00
yuqh 541bec5245 堃博OA对接宁波银行 2024-07-23 17:01:11 +08:00
yuqh 3cbada5649 堃博OA对接宁波银行 2024-07-22 11:29:29 +08:00
yuqh 23a998d815 堃博OA对接宁波银行 2024-07-22 11:28:58 +08:00
yuqh 62387004d6 堃博OA对接宁波银行 2024-07-22 11:27:59 +08:00
yuqh 07c2854ab4 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into kunb 2024-07-19 17:14:46 +08:00
yuqh 6d56bb72b1 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into kunb
 Conflicts:
	service/src/main/java/com/hzya/frame/sysnew/integtationTaskLivingDetails/entity/IntegrationTaskLivingDetailsEntity.xml
2024-07-18 15:08:13 +08:00
yuqh 68e4e7512e 堃博OA对接宁波银行 2024-07-18 15:07:29 +08:00
yuqh 35ea37fbfc 堃博OA对接宁波银行 2024-07-18 15:05:58 +08:00
yuqh 5202887be0 堃博OA对接宁波银行 2024-07-12 08:41:54 +08:00
yuqh c8972b3ac7 调整自增问题导致的写入失败 2024-07-10 18:35:29 +08:00
yuqh fae85a1d87 Merge branches 'dev' and 'kunb' of http://hzya.ufyct.com:9015/root/kangarooDataCenterV3 into kunb 2024-07-10 16:34:25 +08:00
yuqh 8490b8273d 堃博生物OA插件 2024-07-10 16:33:32 +08:00
yuqh 6b4017ee29 公用入口 2024-07-10 10:45:32 +08:00
yuqh db4ed30db8 BIP单点登录 2024-07-10 08:52:20 +08:00
25 changed files with 780 additions and 37 deletions

View File

@ -93,6 +93,18 @@
<profile.active>yc</profile.active>
</properties>
</profile>
<profile>
<id>dongj</id> <!--东进-->
<properties>
<profile.active>dongj</profile.active>
</properties>
</profile>
<profile>
<id>kunb</id> <!--堃博-->
<properties>
<profile.active>kunb</profile.active>
</properties>
</profile>
</profiles>
<build>
<finalName>kangarooDataCenterV3</finalName>

View File

@ -1,15 +0,0 @@
package com.hzya.frame.plugin.a8bill.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
/**
* 组织档案(mdm_org: table)表数据库访问层
*
* @author makejava
* @since 2024-06-07 18:30:04
*/
public interface IPayBillDao extends IBaseDao<PayBillEntity, String> {
}

View File

@ -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;
}

View File

@ -1,16 +0,0 @@
package com.hzya.frame.plugin.a8bill.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.a8bill.dao.IPayBillDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
/**
* 组织档案(MdmOrg)表数据库访问层
*
* @author makejava
* @since 2024-06-07 18:30:04
*/
public class PayBillDaoImpl extends MybatisGenericDao<PayBillEntity, String> implements IPayBillDao {
}

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -1,6 +1,6 @@
<?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"/>
@ -11,6 +11,11 @@
id
</sql>
<!--执行update语句-->
<update id="PayBillEntity_update" parameterType="com.hzya.frame.plugin.a8bill.entity.PayBillEntity">
<if test="null != sql and sql != ''">
${sql}
</if>
</update>
</mapper>

View File

@ -0,0 +1,139 @@
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.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import com.hzya.frame.plugin.a8bill.util.NingBBankUtil;
import com.hzya.frame.plugin.a8bill.util.OaFlowUtil;
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 java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 堃博OA单据推送宁波银行
*
* @author makejava
* @since 2024年7月10日14:13:18
*/
public class KunBFlowSubPluginInitializer extends PluginBaseEntity{
Logger logger = LoggerFactory.getLogger(KunBFlowSubPluginInitializer.class);
@Autowired
private IPayBillPluginInitializerDao payBillDao;
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "KunBFlowSubPluginInitializer";
}
@Override
public String getPluginName() {
return "KunBFlowSubPluginInitializer插件";
}
@Override
public String getPluginLabel() {
return "KunBFlowSubPluginInitializer";
}
@Override
public String getPluginType() {
return "1";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
PayBillEntity oaBillEntity = new PayBillEntity();
String dataSourceCode = "KUNBOA";
oaBillEntity.setDataSourceCode(dataSourceCode);
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("select * from v_hzya_pay_sub ");
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 affairId = main.getString("affair_id");
String memberId = main.getString("member_id");
String loginName = main.getString("loginName");
if(StrUtil.isNotEmpty(affairId)&& StrUtil.isNotEmpty(memberId)){
JSONObject tokenRes = new JSONObject();
tokenRes.put("loginName",loginName);
tokenRes.put("userName","restUser");
tokenRes.put("password","760e094c-361d-45a7-8ae0-e1a4c8fd169f");
logger.info("获取token请求参数"+tokenRes.toString());
String tokenResult = OaFlowUtil.sendOAToEsb(tokenRes.toString(),"8000320000","");
logger.info("获取token请求返回"+tokenResult);
JSONObject tokenObj = JSON.parseObject(tokenResult);
JSONObject attribute = tokenObj.getJSONObject("attribute");
if(null != attribute){
String token = attribute.getString("id");
if(StrUtil.isNotEmpty(token)){
//通过当前处理人获取token
Map res = new HashMap();
res.put("affairId", affairId);
res.put("memberid", memberId);//当前处理人ID
res.put("comment", "自动审批");//处理意见
res.put("attitude", "1");//态度1同意2不同意0已阅
logger.info("流程处理请求参数:"+ JSON.toJSONString(res));
String result = OaFlowUtil.sendOAToEsb(JSON.toJSONString(res),"8000320001",token);
logger.info("流程处理请求返回:"+result);
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return new JsonResultEntity("成功",true,new JsonResultEntity());
}
public String formatStatus(String status){
Map<String,String> statusMap = new HashMap<>();
statusMap.put("0","交易成功");
statusMap.put("-2","已删除");
statusMap.put("-3","审批打回交易关闭");
statusMap.put("2","交易失败");
statusMap.put("4","交易失败,资金下拨失败");
statusMap.put("5","联动支付失败,资金退回成功");
statusMap.put("6","联动支付失败,资金退回查证中、");
statusMap.put("96","联动支付失败,资金退回失败");
statusMap.put("112","请款失败");
statusMap.put("-1","驳回");
statusMap.put("1","交易待查证");
statusMap.put("3","待发送");
statusMap.put("95","审批通过");
statusMap.put("7","暂存");
statusMap.put("-4","经办撤回");
statusMap.put("111","请款查证中");
statusMap.put("113","请款成功,交易待发送");
statusMap.put("114","联动支付成功,智能支付交易待发送");
if(Long.valueOf(status)>=11 && Long.valueOf(status) <=94){
return "待审批";
}
return statusMap.get(status);
}
}

View File

@ -0,0 +1,180 @@
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.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import com.hzya.frame.plugin.a8bill.util.NingBBankUtil;
import com.hzya.frame.seeyon.paybill.service.IPayBillService;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
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 java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 堃博OA单据推送宁波银行
*
* @author makejava
* @since 2024年7月10日14:13:18
*/
public class KunBNingBBankPluginInitializer extends PluginBaseEntity{
Logger logger = LoggerFactory.getLogger(KunBNingBBankPluginInitializer.class);
@Autowired
private IPayBillPluginInitializerDao payBillDao;
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "KunBNingBBankPluginInitializer";
}
@Override
public String getPluginName() {
return "KunBNingBBankPluginInitializer插件";
}
@Override
public String getPluginLabel() {
return "KunBNingBBankPluginInitializer";
}
@Override
public String getPluginType() {
return "1";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
PayBillEntity oaBillEntity = new PayBillEntity();
String dataSourceCode = "KUNBOA";
oaBillEntity.setDataSourceCode(dataSourceCode);
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("select * from v_hzya_pay_state 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");
String payId = main.getString("payId");
String payDateStr = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
try {
logger.info("获取到付款单状态的数据"+main.toString());
String apiCode = "8000310001";
JSONObject reMain = new JSONObject();
reMain.put("serialNo",main.getString("serialNo"));
String result = NingBBankUtil.sendOAToNbBankEsb(reMain.toString(),apiCode);
logger.info("获取付款状态结果"+result);
JSONObject resultObj = JSON.parseObject(result);
JSONObject attribute = resultObj.getJSONObject("attribute");
boolean flag = resultObj.getBoolean("flag");
boolean payStateFlag = false;
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");
// if(1==1){
// status = "0";
// }
String msg = formatStatus(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'");
payStateFlag = true;
sb.append(" , "+payDate+" = '"+payDateStr+"'");
}
}else {
// todo 2024年10月9日09:47:06按照客户逻辑调整如果查询结果返回失败则继续查询直到成功为止
continue;
// sb.append(" set "+payMsg+" = '查询失败,请联系管理员'");
// sb.append(" ,"+fieldName+" = '2'");
}
sb.append(" where id = '"+main.getString("id")+"'");
//2024年7月29日10:54:47新增逻辑如果状态是付款成功则将当前时间写入汇总表一份客户林工提出
if(payStateFlag){
String sqlStr = "update formson_0416 set field0020 = '"+payDateStr+"' ,field0019 = '支付成功' where id = '"+payId+"'";
oaBillEntity.setSql(sqlStr);
payBillDao.updateStateForId(sqlStr,oaBillEntity);
}
//修改推送状态防止重复推送
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.getMessage());
e.printStackTrace();
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return new JsonResultEntity("成功",true,new JsonResultEntity());
}
public String formatStatus(String status){
Map<String,String> statusMap = new HashMap<>();
statusMap.put("0","交易成功");
statusMap.put("-2","已删除");
statusMap.put("-3","审批打回交易关闭");
statusMap.put("2","交易失败");
statusMap.put("4","交易失败,资金下拨失败");
statusMap.put("5","联动支付失败,资金退回成功");
statusMap.put("6","联动支付失败,资金退回查证中、");
statusMap.put("96","联动支付失败,资金退回失败");
statusMap.put("112","请款失败");
statusMap.put("-1","驳回");
statusMap.put("1","交易待查证");
statusMap.put("3","待发送");
statusMap.put("95","审批通过");
statusMap.put("7","暂存");
statusMap.put("-4","经办撤回");
statusMap.put("111","请款查证中");
statusMap.put("113","请款成功,交易待发送");
statusMap.put("114","联动支付成功,智能支付交易待发送");
if(Long.valueOf(status)>=11 && Long.valueOf(status) <=94){
return "待审批";
}
return statusMap.get(status);
}
}

View File

@ -0,0 +1,166 @@
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.util.NingBBankUtil;
import com.hzya.frame.seeyon.paybill.service.IPayBillService;
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 javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* 堃博OA单据推送宁波银行
*
* @author makejava
* @since 2024年7月10日14:13:18
*/
public class KunBPayBillPluginInitializer extends PluginBaseEntity{
Logger logger = LoggerFactory.getLogger(KunBPayBillPluginInitializer.class);
@Autowired
private IPayBillService payBillService;
@Resource
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private IPayBillPluginInitializerDao payBillDao;
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "KunBPayBillPluginInitializer";
}
@Override
public String getPluginName() {
return "堃博OA付款单同步宁波银行";
}
@Override
public String getPluginLabel() {
return "KunBPayBillPluginInitializer";
}
@Override
public String getPluginType() {
return "1";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
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();
String dataSourceCode = "KUNBOA";
oaBillEntity.setDataSourceCode(dataSourceCode);
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 apiCode = "8000310000";
String result = NingBBankUtil.sendOAToNbBankEsb(main.toString(),apiCode);
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("KunBPayBillPluginInitializer");
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)){//todo 银行状态 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());
}
}

View File

@ -0,0 +1,37 @@
package com.hzya.frame.plugin.a8bill.util;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.u9c.util.CrmUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
/**
* com.hzya.frame.u9c.util
*
* @author yqh
* @date 2023-10 -25 15:26
*/
public class NingBBankUtil {
public static String sendOAToNbBankEsb(String parm,String apiCode){
String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface";
// String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
// System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl)
.header("appId", "800031")//头信息多个头信息多次调用此方法即可
.header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYAFwrMhQyJ5AHRyroAsMjt7//GlcLHuD2xA6dXN5mq45pCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "m6imCUH9V8RKiWIu93SVqbMHfmBaAVZTZTdh7tWIyqnznOZ19jU47zDL5uOs0qQyj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(parm)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
return result;
}
}

View File

@ -0,0 +1,28 @@
package com.hzya.frame.plugin.a8bill.util;
import cn.hutool.http.HttpRequest;
/**
* com.hzya.frame.u9c.util
*
* @author yqh
* @date 2023-10 -25 15:26
*/
public class OaFlowUtil {
public static String sendOAToEsb(String parm,String apiCode,String token){
String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface";
// String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
// System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl)
.header("appId", "800032")//头信息多个头信息多次调用此方法即可
.header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可
.header("token", token)//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(parm)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
return result;
}
}

View File

@ -102,8 +102,9 @@ public class PayApplyPluginInitializer extends PluginBaseEntity {
requestJson.remove("jsonStr");
paymentEntity = JSONObject.parseObject(requestJson.toString(),PaymentEntity.class);
}
if (null == paymentEntity)
if (null == paymentEntity) {
paymentEntity = new PaymentEntity();
}
//支付申请
paymentEntity.setOaId("8475071606892874568");
cbsPluginService.applyPay(paymentEntity);

View File

@ -0,0 +1,35 @@
#######################dev环境#######################
logging:
#日志级别 指定目录级别
level:
root: warn
encodings: UTF-8
file:
# 日志保存路径
path: D:\yongansystem\log
spring:
datasource:
dynamic:
datasource:
master:
url: jdbc:mysql://115.239.174.22:3306/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: D:\yongansystem\file
cbs8:
appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
# 这个私钥到时候上传到cbs和下面到是同一对
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
cbs_public_key: 0469146F06BF3B01236E84632441E826
#电子回单下载临时存放位置
elec_path: /Users/xiangerlin/Downloads/
OA:
data_source_code: yc_oa

View File

@ -0,0 +1,41 @@
#######################本地环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: D:\yongansystem\log
spring:
datasource:
dynamic:
datasource:
master:
# url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
# username: root
# password: 62e4295b615a30dbf3b8ee96f41c820b
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
url: jdbc:mysql://10.5.8.81:3306/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: D:\yongansystem\file
zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
cbs8:
appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
# 这个私钥到时候上传到cbs和下面到是同一对
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
cbs_public_key: 0469146F06BF3B01236E84632441E826
#电子回单下载临时存放位置
elec_path: /zt/elecfile
OA:
data_source_code: yc_oa

View File

@ -1,5 +1,5 @@
server:
port: 9999
port: 8901
servlet:
context-path: /kangarooDataCenterV3
localIP: 127.0.0.1

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<bean name="PayBillPluginInitializerDaoImpl" class="com.hzya.frame.plugin.a8bill.dao.impl.PayBillPluginInitializerDaoImpl" />
</beans>

View File

@ -3,4 +3,7 @@
<beans default-autowire="byName">
<bean name="PayBillPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.PayBillPluginInitializer" />
<bean name="RecBillPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.RecBillPluginInitializer" />
<bean name="KunBPayBillPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.KunBPayBillPluginInitializer" />
<bean name="KunBNingBBankPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.KunBNingBBankPluginInitializer" />
<bean name="KunBFlowSubPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.KunBFlowSubPluginInitializer" />
</beans>

View File

@ -167,7 +167,7 @@ public class temButtom {
@Test
public void test01() {
String a = AESUtil.encrypt("hzya@1314");
String a = AESUtil.encrypt("SEEYONV71SP12");
System.out.println(a);
String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b");
System.out.println(b);

View File

@ -80,13 +80,14 @@ public class ExecSqlServiceImpl implements IExecSqlService {
@Override
public int execUpdateSql(String sql, String data_source_code) throws Exception {
logger.info("=============进入execUpdateSql方法============");
if (ObjectUtils.isEmpty(sql)) {
if (!ObjectUtils.isEmpty(sql)) {
if (sql.contains("where") || sql.contains("WHERE")) {
// SqlSession sqlSession = getSqlSession(data_source_code);
// SqlSession sqlSession = new DataSourceUtil().getDefaultSqlSession();
logger.info("=============execUpdateSql方法要执行的sql============" + sql);
ExecSqlEntity entity = new ExecSqlEntity();
entity.setSql(sql);
entity.setDatasource_code(data_source_code);
int result = sqlSession.update("com.hzya.frame.sysnew.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_update", entity);
logger.info("update受影响行数" + result);
//sqlSession.close();

View File

@ -28,4 +28,13 @@ public interface IBipSsoService extends IBaseService<BipTokenVo,String>{
*
*/
SysExtensionApiEntity ssoEncrypt(SysExtensionApiEntity entity);
/**
*
* @content 天智单点登录
* @author laborer
* @date 2024/7/8 0008 10:34
*
*/
String biSso(HttpServletRequest request, String ticket);
}

View File

@ -6,6 +6,7 @@ import cn.hutool.http.HttpException;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.bip.v3.v2207.entity.BipTokenVo;
import com.hzya.frame.bip.v3.v2207.service.IBipSsoService;
@ -111,6 +112,30 @@ public class BipSsoServiceImpl extends BaseService<BipTokenVo, String> implement
}
return entity;
}
@Override
public String biSso(HttpServletRequest request, String ticket) {
JSONObject obj = new JSONObject();
obj.put("username","admin");
obj.put("password","hzya@1314");
try {
String result = HttpRequest.post("http://192.168.2.237:9191/api/rest/user/login/")
// .header("Content-Type", "application/x-www-form-urlencoded")//头信息多个头信息多次调用此方法即可
// .header("Content-Length", "10000")//头信息多个头信息多次调用此方法即可
// .header("userid", "admin")//头信息多个头信息多次调用此方法即可
.body(obj.toString())//表单内容
.timeout(20000)//超时毫秒
.execute().body();
JSONObject resultObj = JSON.parseObject(result);
String token = resultObj.getString("token");
String ssoUrl = "http://192.168.2.237:9191/bi/admin";
return ssoUrl+"?token="+token;
} catch (HttpException e) {
e.printStackTrace();
return "http://192.168.2.237:9191/bi/login";
}
}
/**获取NCC的key*/
private static String genKey(String userid, String key) throws Exception {
return new Base64().encodeToString(SignatureTookKit.digestSign(userid.getBytes(), key.getBytes()));

View File

@ -402,6 +402,7 @@
<if test="def3 != null and def3 != ''"> #{def3} ,</if>
<if test="def4 != null and def4 != ''"> #{def4} ,</if>
<if test="def5 != null and def5 != ''"> #{def5} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -183,4 +183,10 @@ public class EntranceController {
response.sendRedirect(bipSsoService.erpSso(request,ticket));
return null;
}
@RequestMapping(value = "/biSso")
@ResponseBody
public String biSso(HttpServletRequest request, HttpServletResponse response, String ticket) throws Exception {
response.sendRedirect(bipSsoService.biSso(request,ticket));
return null;
}
}

View File

@ -135,6 +135,9 @@ public class AopDynamicRoutingDataSourceInit {
druidDataSource.setMinIdle(5);
druidDataSource.setMaxActive(100);
druidDataSource.setMaxWait(60000);
druidDataSource.setConnectTimeout(600000);
druidDataSource.setSocketTimeout(600000);
druidDataSource.setTimeBetweenEvictionRunsMillis(60000);
druidDataSource.setMinEvictableIdleTimeMillis(300000);
druidDataSource.setMaxEvictableIdleTimeMillis(600000);