This commit is contained in:
parent
7e27a4756c
commit
db28fdce5e
|
@ -0,0 +1,130 @@
|
|||
package com.hzya.frame.plugin.a8bill.plugin;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
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 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 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);
|
||||
logger.info("获取token请求参数:"+tokenRes.toString());
|
||||
String tokenResult = OaFlowUtil.sendOAToEsb(tokenRes.toString(),"8000320000");
|
||||
logger.info("获取token请求返回:"+tokenResult);
|
||||
//通过当前处理人获取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");
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -21,8 +21,8 @@ import java.util.List;
|
|||
|
||||
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";
|
||||
// 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")//头信息,多个头信息多次调用此方法即可
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
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 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("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可
|
||||
.header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可
|
||||
.body(parm)//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
|
|
|
@ -5,4 +5,5 @@
|
|||
<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>
|
||||
|
|
Loading…
Reference in New Issue