This commit is contained in:
yuqh 2024-08-15 13:59:59 +08:00
parent c3f969541b
commit a50cc1dad5
3 changed files with 24 additions and 14 deletions

View File

@ -2,8 +2,8 @@ package com.hzya.frame.plugin.a8bill.plugin;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao; import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
@ -65,7 +65,7 @@ public class KunBFlowSubPluginInitializer extends PluginBaseEntity{
String dataSourceCode = "KUNBOA"; String dataSourceCode = "KUNBOA";
oaBillEntity.setDataSourceCode(dataSourceCode); oaBillEntity.setDataSourceCode(dataSourceCode);
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("select * from v_hzya_pay where payState ='1'"); stringBuffer.append("select * from v_hzya_pay_sub ");
try { try {
List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity); List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity);
if(CollectionUtils.isNotEmpty(hashMaps)){ if(CollectionUtils.isNotEmpty(hashMaps)){
@ -80,9 +80,16 @@ public class KunBFlowSubPluginInitializer extends PluginBaseEntity{
if(StrUtil.isNotEmpty(affairId)&& StrUtil.isNotEmpty(memberId)){ if(StrUtil.isNotEmpty(affairId)&& StrUtil.isNotEmpty(memberId)){
JSONObject tokenRes = new JSONObject(); JSONObject tokenRes = new JSONObject();
tokenRes.put("loginName",loginName); tokenRes.put("loginName",loginName);
tokenRes.put("userName","restUser");
tokenRes.put("password","f91a3aea-f202-4366-8958-61a778f613bc");
logger.info("获取token请求参数"+tokenRes.toString()); logger.info("获取token请求参数"+tokenRes.toString());
String tokenResult = OaFlowUtil.sendOAToEsb(tokenRes.toString(),"8000320000"); String tokenResult = OaFlowUtil.sendOAToEsb(tokenRes.toString(),"8000320000","");
logger.info("获取token请求返回"+tokenResult); 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 //通过当前处理人获取token
Map res = new HashMap(); Map res = new HashMap();
res.put("affairId", affairId); res.put("affairId", affairId);
@ -90,11 +97,13 @@ public class KunBFlowSubPluginInitializer extends PluginBaseEntity{
res.put("comment", "自动审批");//处理意见 res.put("comment", "自动审批");//处理意见
res.put("attitude", "1");//态度1同意2不同意0已阅 res.put("attitude", "1");//态度1同意2不同意0已阅
logger.info("流程处理请求参数:"+ JSON.toJSONString(res)); logger.info("流程处理请求参数:"+ JSON.toJSONString(res));
String result = OaFlowUtil.sendOAToEsb(JSON.toJSONString(res),"8000320001"); String result = OaFlowUtil.sendOAToEsb(JSON.toJSONString(res),"8000320001",token);
logger.info("流程处理请求返回:"+result); logger.info("流程处理请求返回:"+result);
} }
} }
} }
}
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -125,7 +125,7 @@ public class KunBNingBBankPluginInitializer extends PluginBaseEntity{
sb.append(" where id = '"+main.getString("id")+"'"); sb.append(" where id = '"+main.getString("id")+"'");
//2024年7月29日10:54:47新增逻辑如果状态是付款成功则将当前时间写入汇总表一份客户林工提出 //2024年7月29日10:54:47新增逻辑如果状态是付款成功则将当前时间写入汇总表一份客户林工提出
if(payStateFlag){ if(payStateFlag){
String sqlStr = "update formson_0416 set field0020 = '"+payDateStr+"' where id = '"+payId+"'"; String sqlStr = "update formson_0416 set field0020 = '"+payDateStr+"' ,field0019 = '支付成功' where id = '"+payId+"'";
payBillDao.updateStateForId(sqlStr,oaBillEntity); payBillDao.updateStateForId(sqlStr,oaBillEntity);
} }
//修改推送状态防止重复推送 //修改推送状态防止重复推送

View File

@ -10,13 +10,14 @@ import cn.hutool.http.HttpRequest;
*/ */
public class OaFlowUtil { public class OaFlowUtil {
public static String sendOAToEsb(String parm,String apiCode){ 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:8901/kangarooDataCenterV3/entranceController/externalCallInterface";
String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
// System.out.println("推送参数"+parm); // System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl) String result = HttpRequest.post(baseUrl)
.header("appId", "800032")//头信息多个头信息多次调用此方法即可 .header("appId", "800032")//头信息多个头信息多次调用此方法即可
.header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可 .header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可
.header("token", token)//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可 .header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可 .header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(parm)//表单内容 .body(parm)//表单内容