cbs8插件

This commit is contained in:
xiang2lin 2024-06-19 13:47:44 +08:00
parent 004250f55d
commit e4d0f19e02
4 changed files with 241 additions and 1 deletions

View File

@ -0,0 +1,111 @@
package com.hzya.frame.plugin.cbs8.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.cbs8.dto.req.AgentPayResultRequestDTO;
import com.hzya.frame.cbs8.dto.res.AgentPayResultResDTO;
import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Description
* @Author xiangerlin
* @Date 2024/6/18 17:22
**/
public class AgentPayResultPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(AgentPayResultPluginInitializer.class);
@Autowired
private ICbsPluginService cbsPluginService;
/***
* 插件初始化方法
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 10:48
* @Param []
* @return void
**/
@Override
public void 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 "CBS8AgentPayResultPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "cbs8代发代扣详情查询插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "cbs8代发代扣详情查询插件";
}
/***
* 插件类型 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 {
//1查询代发代扣交易未完成代
//2调用cbs接口
AgentPayResultRequestDTO agentPayResultRequestDTO = new AgentPayResultRequestDTO();
agentPayResultRequestDTO.setBusNum("");
AgentPayResultResDTO agentPayResultResDTO = cbsPluginService.agentPayResult(agentPayResultRequestDTO);
//更新OA表单
//记录日志
return null;
}
}

View File

@ -0,0 +1,128 @@
package com.hzya.frame.plugin.cbs8.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.cbs8.dto.res.PayResponseDTO;
import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentService;
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.List;
/**
* @Description
* @Author xiangerlin
* @Date 2024/6/18 14:03
**/
public class PayApplyAgentPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PayApplyAgentPluginInitializer.class);
@Autowired
private ICbsPluginService cbsPluginService;
@Autowired
private IAgentPaymentService agentPaymentService;
/***
* 插件初始化方法
* @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 "CBS8PayApplyAgentPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "cbs8代发代扣插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "cbs8代发代扣插件";
}
/***
* 插件类型 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 {
//1查询代支付的
AgentPaymentEntity agentPaymentEntity = new AgentPaymentEntity();
List<AgentPaymentEntity> agentPaymentList = agentPaymentService.queryUnpaid(agentPaymentEntity);
if (CollectionUtils.isNotEmpty(agentPaymentList)){
for (AgentPaymentEntity paymentEntity : agentPaymentList) {
AgentPaymentDetailEntity detailEntity = new AgentPaymentDetailEntity();
detailEntity.setFormmainId(paymentEntity.getId());
List<AgentPaymentDetailEntity> agentPaymentDetailList = agentPaymentService.queryDetails(detailEntity);
if (CollectionUtils.isNotEmpty(agentPaymentDetailList)){
//调用代发代扣接口
PayResponseDTO payResponseDTO = cbsPluginService.applyAgentPay(paymentEntity, agentPaymentDetailList);
//更新OA表单
//记录日志
}
}
}
return null;
}
}

View File

@ -97,7 +97,7 @@ public class PayApplyPluginInitializer extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
//支付申请
cbsPluginService.applyPay(requestJson);
//cbsPluginService.applyPay(requestJson);
return null;
}
}

View File

@ -269,6 +269,7 @@ public class CbsPluginServiceImpl implements ICbsPluginService {
public AgentPayResultResDTO agentPayResult(AgentPayResultRequestDTO agentPayResultRequestDTO) {
if (null != agentPayResultRequestDTO && StrUtil.isNotEmpty(agentPayResultRequestDTO.getBusNum())){
AgentPayResultResDTO agentPayResultResDTO = cbs8Service.agentPayResult(agentPayResultRequestDTO);
return agentPayResultResDTO;
}
return null;
}