Compare commits

..

41 Commits

Author SHA1 Message Date
xiang2lin 7f54370a64 默认查询语句 2025-06-20 19:54:37 +08:00
xiang2lin 5dc30f1ac3 更新OA表单校验字段 2025-06-20 19:53:26 +08:00
xiang2lin 00e3dc6c05 注册bean 2025-06-20 14:02:53 +08:00
xiang2lin da55f281f8 增加赠品字段 2025-06-20 14:01:23 +08:00
xiang2lin 7a749fc323 采购订单 2025-06-19 19:20:08 +08:00
xiang2lin b2bf806bb7 采购订单模板编号 2025-06-19 15:29:42 +08:00
xiang2lin 64afeadd0e 查OA用户 2025-06-18 19:23:43 +08:00
xiang2lin fc740242a4 数量字段取数修改
最终数量不为空时取最终数量
2025-06-15 19:43:07 +08:00
xiang2lin 59ed5e7fae 获取token的loginName从外部传 2025-06-13 16:59:31 +08:00
xiang2lin 99e306dc9c 删除没用的代码 2025-06-13 16:59:04 +08:00
xiang2lin a266f7f541 采购订单 2025-06-13 16:58:41 +08:00
lvleigang e512b1278f ncc token 2025-06-12 17:20:19 +08:00
lvleigang cbec72c450 ncc token 2025-06-12 15:20:43 +08:00
lvleigang 61f604bad4 Merge branches 'fw-ncc' and 'jianhui0521' of http://ufidahz.com.cn:9015/hzya/kangarooDataCenterV3 into jianhui0521 2025-06-12 13:59:11 +08:00
xiang2lin f9a690a136 去掉没用的,不然打包报错 2025-06-12 10:28:15 +08:00
xiang2lin eed8a9d535 查询协同附件 2025-06-12 10:27:41 +08:00
xiang2lin 79a7f2a3ab 增加app_id 2025-06-12 10:27:27 +08:00
xiang2lin 91a768bae5 请购单 2025-06-12 10:26:59 +08:00
xiang2lin 5fa3cf64aa 测试类 2025-06-11 16:47:15 +08:00
xiang2lin 92f4f0be46 建辉环境 2025-06-09 13:25:29 +08:00
xiang2lin a619f68db7 OA请购单流程结束传NCC 2025-06-09 13:19:03 +08:00
xiang2lin 3a03ccbce0 采购订单参数组装 2025-06-05 13:33:29 +08:00
xiang2lin a5823872cb 发起流程参数处理 2025-06-05 13:33:13 +08:00
xiang2lin ed5b67a8d3 采购订单,请购单代码 2025-06-04 08:44:49 +08:00
xiang2lin 8f2ea8d28c OA流程事件触发插件,增加数据源编码 2025-06-03 16:32:12 +08:00
xiang2lin 09df8bcc6c 1、删除何灿之前的代码(NCC发起单据要去NCC开发,不用写到插件里)
2、重写CBS支付申请、查询交易结果插件
2025-05-29 19:02:47 +08:00
xiang2lin 4fe3292240 1、删除何灿之前的代码(NCC发起单据要去NCC开发,不用写到插件里)
2、重写CBS支付申请、查询交易结果插件
2025-05-29 19:02:37 +08:00
xiang2lin 972f8189bb 增加ds注解 2025-05-29 18:58:30 +08:00
xiang2lin 2baa228f10 调用插件方法增加数据源、请求头参数 2025-05-29 18:58:07 +08:00
xiang2lin 1c9963aab8 支付申请方法入参改成JSON 2025-05-29 18:57:45 +08:00
xiang2lin 313e72d5b8 cbs配置 2025-05-27 10:21:29 +08:00
xiang2lin 569a894307 zt_url 2025-05-27 10:21:08 +08:00
xiang2lin d4daabacdb Merge branch 'fw-cbs' of http://ufidahz.com.cn:9015/hzya/kangarooDataCenterV3 into jianhui0521 2025-05-27 09:14:08 +08:00
hecan 5626ab90cb NCC付款单传递OA以及OA付款单推送CBS 2025-05-23 14:09:34 +08:00
hecan fc2512bfa9 NCC付款单传递OA以及OA付款单推送CBS 2025-05-23 14:08:48 +08:00
xiang2lin 25be18824e 初始化请购单插件代码 2025-05-22 14:20:38 +08:00
xiang2lin 639115e237 Merge branch 'fw-oa' of http://ufidahz.com.cn:9015/hzya/kangarooDataCenterV3 into jianhui0521 2025-05-21 18:04:44 +08:00
476474485@qq.com a6af70de5f 调整OA插件调用方式 2025-04-07 16:49:25 +08:00
lvleigang 8b00953f47 fw-oa分支结构上传 2024-09-14 10:08:39 +08:00
lvleigang a177292fe1 fw-ncc分支结构上传 2024-09-14 09:58:15 +08:00
lvleigang 333904fc99 fw-cbs分支结构上传 2024-09-14 09:17:10 +08:00
187 changed files with 15947 additions and 895 deletions

View File

@ -45,9 +45,9 @@
</properties>
</profile>
<profile>
<id>zqtlocal</id> <!--曾庆拓-->
<id>jianhui</id><!-- 建辉环境打包用这个-->
<properties>
<profile.active>zqtlocal</profile.active>
<profile.active>jianhui</profile.active>
</properties>
</profile>

View File

@ -0,0 +1,102 @@
package com.hzya.frame.plugin.oa.payment.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.oa.payment.service.IPaymentPluginService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Description 查询交易结果
* @Author xiangerlin
* @Date 2025/5/29 17:19
**/
public class PayResultPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PayResultPluginInitializer.class);
@Autowired
private IPaymentPluginService paymentPluginService;
/***
* 插件初始化方法
* @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 "PayResultPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "查询CBS交易结果";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "查询CBS交易结果";
}
/***
* 插件类型 1场景插件
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 14:01
* @Param []
* @return java.lang.String
**/
@Override
public String getPluginType() {
return "0";
}
/***
* 执行业务代码
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-07 11:20
* @param requestJson 执行业务代码的参数
* @return void
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
logger.info("======开始查询CBS交易结果======");
paymentPluginService.payRequest(requestJson);
return BaseResult.getSuccessMessageEntity("执行成功");
}
}

View File

@ -0,0 +1,107 @@
package com.hzya.frame.plugin.oa.payment.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.oa.payment.service.IPaymentPluginService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Description 支付申请
* @Author xiangerlin
* @Date 2025/5/29 15:40
**/
public class PaymentRequestPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PaymentRequestPluginInitializer.class);
@Autowired
private IPaymentPluginService paymentPluginService;
/***
* 插件初始化方法
* @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 "PaymentRequestPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "OA支付申请CBS插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "OA支付申请CBS插件";
}
/***
* 插件类型 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 {
try {
logger.info("======开始执行OA支付申请CBS插件======");
JsonResultEntity jsonResultEntity = paymentPluginService.payRequest(requestJson);
return BaseResult.getSuccessMessageEntity("OA支付申请CBS插件执行成功",jsonResultEntity);
}catch (Exception e){
logger.info("======执行OA支付申请CBS插件出错======{}",e.getMessage());
return BaseResult.getFailureMessageEntity("OA支付申请CBS插件执行失败",e.getMessage());
}
}
}

View File

@ -0,0 +1,24 @@
package com.hzya.frame.plugin.oa.payment.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* @Description 支付申请
* @Author xiangerlin
* @Date 2025/5/29 15:43
**/
public interface IPaymentPluginService {
/**
* 支付申请
* @param requestJson
* @return
*/
JsonResultEntity payRequest(JSONObject requestJson);
/**
* 查询交易结果
* @param requestJson
*/
void queryPayResult(JSONObject requestJson);
}

View File

@ -0,0 +1,181 @@
package com.hzya.frame.plugin.oa.payment.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.cbs8.dto.req.PayResultRequestDTO;
import com.hzya.frame.cbs8.dto.res.PayResponseDTO;
import com.hzya.frame.cbs8.dto.res.PayResultResDTO;
import com.hzya.frame.cbs8.service.ICbs8Service;
import com.hzya.frame.cbs8.util.CBSUtil;
import com.hzya.frame.cbs8.util.PayState;
import com.hzya.frame.plugin.oa.payment.service.IPaymentPluginService;
import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity;
import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
import com.hzya.frame.seeyon.cbs8.service.ICbsLogService;
import com.hzya.frame.seeyon.cbs8.service.IPaymentService;
import com.hzya.frame.web.entity.BaseResult;
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 2025/5/29 15:43
**/
public class PaymentPluginServiceImpl implements IPaymentPluginService {
Logger logger = LoggerFactory.getLogger(PaymentPluginServiceImpl.class);
@Autowired
private IPaymentService paymentService;
@Autowired
private ICbs8Service cbs8Service;
@Autowired
private ICbsLogService cbsLogService;;
/**
* 支付申请
*
* @param requestJson
* @return
*/
@Override
public JsonResultEntity payRequest(JSONObject requestJson) {
String headersStr = requestJson.getString("headers");//请求头
String formAppId = requestJson.getString("formAppId");
String eventType = requestJson.getString("eventType");
String id = requestJson.getString("id");
String dataSouceCode = requestJson.getString("sourceCode");
Assert.notEmpty(id,"id不能为空");
Assert.notEmpty(formAppId,"formAppId不能为空");
Assert.notEmpty(eventType,"eventType不能为空");
Assert.notEmpty(headersStr,"headers不能为空");
Assert.notEmpty(dataSouceCode,"数据源编码不能为空");
logger.info("准备开始查询待支付的单据");
PaymentEntity paymentEntity = new PaymentEntity();
paymentEntity.setId(id);
paymentEntity.setDataSourceCode(dataSouceCode);
try {
//查询OA待支付的数据
List<PaymentEntity> paymentList = paymentService.queryUnpaid(paymentEntity);
if (CollectionUtils.isNotEmpty(paymentList) && paymentList.size() == 1){
PaymentEntity pay = paymentList.get(0);
PayResponseDTO payResponseDTO = cbs8Service.payApply(JSONObject.toJSONString(pay));
String payResStr = JSONObject.toJSONString(payResponseDTO);
logger.info("支付申请响应结果:{}",payResStr);
if (null != payResponseDTO){
//保存支付日志
saveCbsLog(pay,payResponseDTO,dataSouceCode);
if (payResponseDTO.getSuccessed()) {
return BaseResult.getSuccessMessageEntity("支付申请成功",payResponseDTO.getBusNum());
}else {
BaseResult.getFailureMessageEntity("支付申请失败:{}",payResStr);
}
}else {
BaseResult.getFailureMessageEntity("支付申请失败");
}
return BaseResult.getSuccessMessageEntity("",payResponseDTO);
}
}catch (Exception e){
logger.error("OA单据推CBS支付申请失败:{}",e);
}
return null;
}
/**
* 查询交易结果
*
* @param requestJson
*/
@Override
public void queryPayResult(JSONObject requestJson) {
String dataSourceCode = requestJson.getString("sourceCode");
Assert.notEmpty(dataSourceCode,"数据源编码不能为空");
try {
CbsLogEntity cbsLogEntity = new CbsLogEntity();
cbsLogEntity.setDataSourceCode(dataSourceCode);
List<CbsLogEntity> queryList = cbsLogService.queryInPayment(cbsLogEntity);
if (CollectionUtils.isNotEmpty(queryList)){
for (CbsLogEntity entity : queryList) {
List<PayResultResDTO> payResultResDTOList = cbs8Service.queryPayResult(new PayResultRequestDTO(entity.getBill_code()));
if (CollectionUtils.isNotEmpty(payResultResDTOList)){
PayResultResDTO payResultResDTO = payResultResDTOList.get(0);
String status = payResultResDTO.getStatus();//支付申请状态
String pay_status = payResultResDTO.getPayStatus();//支付状态
if (!PayState.p.getType().equals(pay_status)){//不等于支付中的时候才更新
//如果支付状态为空保存支付申请状态如果支付状态不为空则保存支付状态
PaymentEntity paymentEntity = new PaymentEntity();
paymentEntity.setOaId(entity.getOa_id());
paymentEntity.setDataSourceCode(dataSourceCode);
List<PaymentEntity> paymentList = paymentService.query(paymentEntity);
if (CollectionUtils.isNotEmpty(paymentList)){
paymentEntity = paymentList.get(0);
if (StrUtil.isEmpty(pay_status)) {
paymentEntity.setPayResult(PayState.payStateGetValue(status));//支付申请状态 支付状态和支付申请状态用一个
} else {
paymentEntity.setPayResult(PayState.payStateGetValue(pay_status));//支付状态 支付状态和支付申请状态用一个
}
if (StrUtil.isNotEmpty(pay_status) && pay_status.equals(PayState.g.getType())) {
paymentEntity.setPayDate(CBSUtil.convertTimestampToString(payResultResDTO.getPayDate()));//支付时间
}
paymentService.updatePayState(paymentEntity);
//更新日志表状态
entity.setPay_state(paymentEntity.getPayResult());
entity.setApply_state(PayState.payStateGetValue(status));
entity.setDataSourceCode(dataSourceCode);
cbsLogService.update(entity);
}
}
}
}
}
}catch (Exception e){
logger.error("查询交易结果出错:{}",e);
}
}
/**
* 保存支付日志
* @param entity 支付参数
* @param payResponseDTO cbs返回参数
* @param dataSourceCode 数据源编码
* @throws Exception
*/
private void saveCbsLog(PaymentEntity entity,PayResponseDTO payResponseDTO,String dataSourceCode)throws Exception{
if (null != payResponseDTO){
//4. 保存日志
CbsLogEntity cbsLogEntity = new CbsLogEntity();
cbsLogEntity.setTitle(entity.getTitle());
cbsLogEntity.setPay_company(entity.getPayCompany());
cbsLogEntity.setPayee(entity.getRevAccountName());
cbsLogEntity.setAmount(entity.getAmount());
cbsLogEntity.setOa_id(entity.getOaId());
cbsLogEntity.setBill_code(Convert.toStr(entity.getReferenceNumNew(),entity.getReferenceNum()));
cbsLogEntity.setTab_name_ch(entity.getBillName());
cbsLogEntity.setTab_name_en(entity.getTableName());
Boolean successed = payResponseDTO.getSuccessed();
if (successed){
cbsLogEntity.setPay_state(PayState.p.getValue());
cbsLogEntity.setApply_state(PayState.two.getValue());
cbsLogEntity.setCbs_apply_code(payResponseDTO.getBusNum());
cbsLogEntity.setSuccessed("true");
entity.setPayResult(PayState.p.getValue());
}else {
cbsLogEntity.setPay_state("推送失败");
cbsLogEntity.setMessage(payResponseDTO.getErrorMsg());
cbsLogEntity.setSuccessed("false");
entity.setPayResult("推送失败");
}
cbsLogEntity.setDataSourceCode(dataSourceCode);
cbsLogService.saveLog(cbsLogEntity);
//5.更新视图的支付状态
paymentService.updatePayState(entity);
}
}
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.plugin.oa.poorder.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity;
/**
* @Description OA采购订单
* @Author xiangerlin
* @Date 2025/6/20 17:52
**/
public interface IPoOrderExtDao extends IBaseDao<PoOrderEntity,String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.plugin.oa.poorder.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.oa.poorder.dao.IPoOrderExtDao;
import com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity;
import org.springframework.stereotype.Repository;
/**
* @Description
* @Author xiangerlin
* @Date 2025/6/20 17:57
**/
@Repository("poOrderDaoExtImpl")
public class PoOrderDaoExtImpl extends MybatisGenericDao<PoOrderEntity,String> implements IPoOrderExtDao {
}

View File

@ -0,0 +1,39 @@
package com.hzya.frame.plugin.oa.poorder.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description OA采购订单
* @Author xiangerlin
* @Date 2025/6/20 17:47
**/
public class PoOrderEntity extends BaseEntity {
private String field0055;//NCC单据号
private String field0058;//校验1
private String field0059;//校验2
public String getField0055() {
return field0055;
}
public void setField0055(String field0055) {
this.field0055 = field0055;
}
public String getField0058() {
return field0058;
}
public void setField0058(String field0058) {
this.field0058 = field0058;
}
public String getField0059() {
return field0059;
}
public void setField0059(String field0059) {
this.field0059 = field0059;
}
}

View File

@ -0,0 +1,17 @@
<?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.oa.poorder.dao.impl.PoOrderDaoExtImpl">
<update id="entity_update" parameterType="com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity">
update formmain_0256
<set>
<if test="field0058 != null and field0058 != '' ">
field0058 = #{field0058},
</if>
<if test="field0059 != null and field0059 != '' ">
field0059 = #{field0059}
</if>
</set>
where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,107 @@
package com.hzya.frame.plugin.oa.poorder.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.oa.poorder.service.IPoOrderService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Description OA采购订单审批事件, 把审批结果传到NCC
* @Author xiangerlin
* @Date 2025/6/15 13:25
**/
public class PoOrderApprovalEventPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PoOrderApprovalEventPluginInitializer.class);
@Autowired
private IPoOrderService poOrderService;
/***
* 插件初始化方法
* @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 "PoOrderApprovalEventPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "OA采购订单审批事件插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "OA采购订单审批事件插件";
}
/***
* 插件类型 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 {
logger.info("======OA采购订单审批事件插件传NCC插件======{}",JSONObject.toJSONString(requestJson));
try {
poOrderService.approvedEvent(requestJson);
}catch (Exception e){
logger.info("======OA采购订单审批事件插件传NCC插件======{}",e.getMessage());
return BaseResult.getFailureMessageEntity("OA采购订单审批事件插件执行失败",e.getMessage());
}
return BaseResult.getSuccessMessageEntity("OA采购订单审批事件插件执行成功");
}
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.plugin.oa.poorder.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity;
/**
* @Description
* @Author xiangerlin
* @Date 2025/6/20 19:36
**/
public interface IPoOrderExtService extends IBaseService<PoOrderEntity,String> {
/**
* 更新校验字段防止用户从OA侧发起采购订单
* @param entity
*/
void updateVerifyFlag(PoOrderEntity entity);
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.plugin.oa.poorder.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* @Description 接收NCC采购订单的请求
* @Author xiangerlin
* @Date 2025/6/12 17:03
**/
public interface IPoOrderService {
/**
* 接收NCC的请求并转换成OA的参数
* @param reqJson
* @return
*/
JsonResultEntity buildOAParam(JSONObject reqJson);
/**
* OA审批事件
* @param reqJson
* @return
*/
JsonResultEntity approvedEvent(JSONObject reqJson)throws Exception;
}

View File

@ -0,0 +1,38 @@
package com.hzya.frame.plugin.oa.poorder.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.oa.poorder.dao.IPoOrderExtDao;
import com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity;
import com.hzya.frame.plugin.oa.poorder.service.IPoOrderExtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description
* @Author xiangerlin
* @Date 2025/6/20 19:37
**/
@Service(value = "poOrderExtServiceImpl")
public class PoOrderExtServiceImpl extends BaseService<PoOrderEntity,String> implements IPoOrderExtService {
private IPoOrderExtDao poOrderExtDao;
@Autowired
public void setPoOrderExtDao(IPoOrderExtDao dao) {
this.poOrderExtDao = dao;
this.dao = dao;
}
/**
* 更新校验字段防止用户从OA侧发起采购订单
*
* @param entity
*/
@DS("#entity.dataSourceCode")
@Override
public void updateVerifyFlag(PoOrderEntity entity) {
poOrderExtDao.update(entity);
}
}

View File

@ -0,0 +1,223 @@
package com.hzya.frame.plugin.oa.poorder.service.impl;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.execsql.entity.ExecSqlEntity;
import com.hzya.frame.execsql.service.IExecSqlService;
import com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity;
import com.hzya.frame.plugin.oa.poorder.service.IPoOrderExtService;
import com.hzya.frame.plugin.oa.poorder.service.IPoOrderService;
import com.hzya.frame.seeyon.enums.ColEventTypeEnum;
import com.hzya.frame.seeyon.org.member.entity.UserViewEntity;
import com.hzya.frame.seeyon.org.member.service.IUserViewService;
import com.hzya.frame.seeyon.util.OARestUtil;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.LinkedList;
import java.util.List;
/**
* @Description 接收NCC采购订单的请求
* @Author xiangerlin
* @Date 2025/6/12 17:04
**/
@Service(value="nCCPoOrderServiceImpl")
public class PoOrderServiceImpl implements IPoOrderService {
Logger logger = LoggerFactory.getLogger(PoOrderServiceImpl.class);
@Autowired
private IExecSqlService execSqlService;
@Autowired
private OARestUtil oaRestUtil;
@Autowired
private IUserViewService userViewService;
@Autowired
private IPoOrderExtService poOrderExtService;
@Value("${zt.url}")
private String interfaceUrl;
@Value("${oa.po_order_template_code:}")
private String templateCode;
/**
* 接收NCC的请求并转换成OA的参数
*
* @param reqJson
* @return
*/
@Override
public JsonResultEntity buildOAParam(JSONObject reqJson) {
JSONObject nccObj = JSONObject.parseObject(reqJson.getString("jsonStr"));
logger.info("中台接收到NCC采购订单的请求参数:{}",reqJson.getString("jsonStr"));
Assert.notNull(nccObj,"参数不能为空");
JSONObject head = nccObj.getJSONObject("head");
JSONArray detailList = nccObj.getJSONArray("body");
Assert.notNull(head,"参数不能为空");
Assert.notNull(detailList,"参数不能为空");
UserViewEntity userView = new UserViewEntity();
userView.setStaffNumber(head.getString("user_code"));
userView.setDataSourceCode("JH-OA");
UserViewEntity userViewEntity = userViewService.queryByStaffNumber(userView);
//组装参数
JSONObject formmain_0256 = new JSONObject();//主表数据
List<JSONObject> formson_0257_list = new LinkedList<>();//子表数据
formmain_0256.put("采购组织名称",head.getString("org_name"));
formmain_0256.put("订单日期",head.getString("dbilldate"));
formmain_0256.put("供应商",head.getString("sup_name"));
formmain_0256.put("采购员姓名",head.getString("cemployeename"));
formmain_0256.put("供应商名称",head.getString("sup_name"));
formmain_0256.put("开票供应商",head.getString("invc_sup_name"));
formmain_0256.put("付款协议",head.getString("payterm_name"));
formmain_0256.put("单据状态",head.getString("forderstatus"));
formmain_0256.put("备注",head.getString("vmemo"));
formmain_0256.put("补货",booleanToStr(head.getString("bisreplenish")));
formmain_0256.put("退货",booleanToStr(head.getString("breturn")));
formmain_0256.put("总数量",head.getString("ntotalastnum"));
formmain_0256.put("总价税合计",head.getString("ntotalorigmny"));
formmain_0256.put("币种",head.getString("currtype_name"));
formmain_0256.put("退货退库基于原订单补货",booleanToStr(head.getString("brefwhenreturn")));
formmain_0256.put("最终关闭",booleanToStr(head.getString("bfinalclose")));
formmain_0256.put("采购部门",head.getString("dept_name"));
formmain_0256.put("订单类型",head.getString("billtypename"));
formmain_0256.put("NCC采购订单编号",head.getString("vbillcode"));
formmain_0256.put("NCC采购订单PK",head.getString("pk_order"));
//子表
for (int i=0; i < detailList.size(); i++){
JSONObject detail = (JSONObject) detailList.get(i);
JSONObject formson_0257 = new JSONObject();
formson_0257.put("收货库存组织",detail.getString("arrvstoorg_name").toLowerCase());
formson_0257.put("行号",detail.getString("crowno"));
formson_0257.put("物料编码",detail.getString("material_code"));
formson_0257.put("物料名称",detail.getString("material_name"));
formson_0257.put("规格",detail.getString("materialspec"));
formson_0257.put("型号",detail.getString("materialtype"));
formson_0257.put("单位",detail.getString("cunitname"));
formson_0257.put("数量",detail.getString("nnum"));
formson_0257.put("换算率",detail.getString("vchangerate"));
formson_0257.put("无税单价",detail.getString("nqtorigprice"));
formson_0257.put("含税单价",detail.getString("nqtorigtaxprice"));
formson_0257.put("价税合计",detail.getString("norigtaxmny"));
formson_0257.put("集团本币无税金额",detail.getString("norigmny"));
formson_0257.put("集团本币价税合计",detail.getString("norigtaxmny"));
formson_0257.put("计划收货日期",detail.getString("dplanarrvdate"));
formson_0257.put("收货仓库",detail.getString("recvstordoc_name"));
formson_0257.put("税率",detail.getString("ntaxrate"));
formson_0257.put("赠品",booleanToStr(detail.getString("blargess")));
formson_0257.put("NCC采购订单表体PK",detail.getString("pk_order_b"));
formson_0257_list.add(formson_0257);
}
String param = oaRestUtil.processParamValueOf(formmain_0256, formson_0257_list, templateCode, "formmain_0256", "formson_0257");
String token = oaRestUtil.getToken(userViewEntity.getLoginName(), "8000640001");
logger.info("NCC发起OA采购订单请求参数{}",param);
//调用OA接口
String result = HttpRequest.post(interfaceUrl)
.header("token",token)// token
.header("appId","800064")// 建辉OA应用
.header("apiCode","8000640000")//流程表单接口
.header("publicKey","ZJYAAr9TeFduBYu7uJeie2KYdQsnBaEYZHmOjPWMMVZmzelCe7eDIk+3zDUT+v578prj")//NCC应用key
.header("secretKey","f4SSnYcDQmdkwwuGJd2+934q6lM1NnUm5dmOw/4Wvy2mo6PgkKsI/drXYyyLWQCaj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//NCC应用密钥
.body(param).execute().body();
logger.info("NCC发起OA采购订单响应参数:{}",result);
JSONObject resultJson = JSONObject.parseObject(result);
if (null == resultJson){
return BaseResult.getFailureMessageEntity("发起OA审批失败");
}
if (!resultJson.getBoolean("flag")){
return BaseResult.getFailureMessageEntity("发起OA审批失败"+resultJson.getString("msg"));
}
return BaseResult.getSuccessMessageEntity(resultJson.getJSONObject("attribute"));
}
/**
* OA审批事件
*POSTQUANTITY
* @param requestJson
* @return
*/
@Override
public JsonResultEntity approvedEvent(JSONObject requestJson)throws Exception {
//数据源编码
String datasourceCode = requestJson.getString("sourceCode");
String task_living_details_id = requestJson.getString("integration_task_living_details_id");
String headersStr = requestJson.getString("headers");//请求头
String eventType = requestJson.getString("eventType");
String summaryId = requestJson.getString("summaryId");
JSONObject headers = requestJson.getJSONObject("headers");
Assert.notEmpty(eventType,"eventType不能为空");
Assert.notEmpty(headersStr,"headers不能为空");
String formmainTableName = headers.getString("formmainTableName");
JSONObject jsonStrObj = requestJson.getJSONObject("jsonStr");
JSONObject businessData = jsonStrObj.getJSONObject("businessDataStr");
JSONObject formmainData = businessData.getJSONObject(formmainTableName);
if (null != formmainData){
String pk_order = formmainData.getString("field0056");//采购订单pk
String vbillcode = formmainData.getString("field0055");//采购订单code
String userId = headers.getString("user_id");//审批人id
JSONObject json = new JSONObject();
json.put("pk_order",pk_order);
json.put("vbillcode",vbillcode);
json.put("user_id",userId);
String params = json.toString();
//组装参数调用NCC审批接口
logger.info("OA采购订单审批后传到NCC请购参数。:{},{}",eventType,params);
String apiCode = "";
if (ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(eventType)){//审批完成
apiCode = "8000650002";
}else if (ColEventTypeEnum.ONSTOP.getType().equals(eventType) || ColEventTypeEnum.ONCANCEL.getType().equals(eventType)){//流程终止/撤销
apiCode = "8000650003";
}
String result = HttpRequest.post(interfaceUrl)
.header("appId", "800065")//NCC应用
.header("apiCode", apiCode)//NCC采购订单审批接口
.header("publicKey", "ZJYAbkr9+XjnDrlfQCRKXtpVvg/BjxqtxzcLgg5TIGagEKJCe7eDIk+3zDUT+v578prj")//OA公钥
.header("secretKey", "2GR4+yrcx+Ev+pN0Q6V6wxCdvisPX7wzNKBgc5SsIYGxYI5GTISXT6GvTPfp1u2Rj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥
.body(params)//表单内容
.timeout(30000)//超时毫秒
.execute().body();
logger.info("======OA采购单审批后传到NCC响应参数:{}======",result);
JSONObject resultJson = JSONObject.parseObject(result);
if (null == resultJson){
return BaseResult.getFailureMessageEntity("审批NCC采购订单失败");
}
if (!resultJson.getBoolean("flag")){
return BaseResult.getFailureMessageEntity("审批NCC采购订单失败"+resultJson.getString("msg"));
}
//如果是流程终止或撤销更新OA校验字段
if (ColEventTypeEnum.ONSTOP.getType().equals(eventType) || ColEventTypeEnum.ONCANCEL.getType().equals(eventType)){
String id = formmainData.getString("id");
if (StrUtil.isNotEmpty(id)){
logger.info("准备更新OA采购订单校验字段");
PoOrderEntity poOrderEntity = new PoOrderEntity();
poOrderEntity.setId(id);
poOrderEntity.setDataSourceCode("JH-OA");
poOrderEntity.setField0058("-1");
poOrderEntity.setField0059("-1");
poOrderExtService.updateVerifyFlag(poOrderEntity);
}
}
return BaseResult.getSuccessMessageEntity(resultJson.getJSONObject("attribute"));
}
return BaseResult.getSuccessMessageEntity("审批NCC采购订单");
}
/**
* 把NCC的 boolean类型转成OA
* NCC Y/N
* OA 1/0
* @param nccBoolean
* @return
*/
private String booleanToStr(String nccBoolean){
if ("Y".equals(nccBoolean)){
return "1";
}
return "0";
}
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.plugin.oa.praybill.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity;
/**
* @Description OA请购单
* @Author xiangerlin
* @Date 2025/6/8 17:06
**/
public interface IRequisitionOrderDao extends IBaseDao<RequisitionOrderEntity,String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.plugin.oa.praybill.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.oa.praybill.dao.IRequisitionOrderDao;
import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity;
import org.springframework.stereotype.Repository;
/**
* @Description OA请购单
* @Author xiangerlin
* @Date 2025/6/8 17:08
**/
@Repository("requisitionOrderDaoImpl")
public class RequisitionOrderDaoImpl extends MybatisGenericDao<RequisitionOrderEntity,String> implements IRequisitionOrderDao {
}

View File

@ -0,0 +1,31 @@
package com.hzya.frame.plugin.oa.praybill.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description OA请购单
*
* @Author xiangerlin
* @Date 2025/6/8 17:04
**/
public class RequisitionOrderEntity extends BaseEntity {
private String field0001;//单据号
private String field0059;//NCC
public String getField0001() {
return field0001;
}
public void setField0001(String field0001) {
this.field0001 = field0001;
}
public String getField0059() {
return field0059;
}
public void setField0059(String field0059) {
this.field0059 = field0059;
}
}

View File

@ -0,0 +1,8 @@
<?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.oa.praybill.dao.impl.RequisitionOrderDaoImpl">
<update id="entity_update" parameterType="com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity">
update formmain_0254 set field0059 = #{field0059} where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,108 @@
package com.hzya.frame.plugin.oa.praybill.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderPluginService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Description 请购单传NCC
* @Author xiangerlin
* @Date 2025/5/21 16:50
**/
public class RequisitionOrderPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(RequisitionOrderPluginInitializer.class);
@Autowired
private IRequisitionOrderPluginService requisitionOrderPluginService;
/***
* 插件初始化方法
* @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 "RequisitionOrderPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "请购单传NCC插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "请购单传NCC插件";
}
/***
* 插件类型 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 {
try {
logger.info("======开始执行请购单传NCC插件======{}",JSONObject.toJSONString(requestJson));
requisitionOrderPluginService.sync2ncc(requestJson);
}catch (Exception e){
e.printStackTrace();
logger.info("======执行请购单传NCC插件出错======{}",e.getMessage());
return BaseResult.getFailureMessageEntity("请购单传NCC插件执行失败",e.getMessage());
}
return BaseResult.getSuccessMessageEntity("请购单传NCC插件执行成功");
}
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.plugin.oa.praybill.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* @Description 请购单传nCC
* @Author xiangerlin
* @Date 2025/5/21 17:44
**/
public interface IRequisitionOrderPluginService {
/**
* 请购单同步到ncc
* @param requestJson
* @return
*/
JsonResultEntity sync2ncc(JSONObject requestJson);
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.plugin.oa.praybill.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity;
/**
* @Description OA 请购单
* @Author xiangerlin
* @Date 2025/6/8 17:10
**/
public interface IRequisitionOrderService extends IBaseService<RequisitionOrderEntity,String> {
/**
* 更新OA单据
* @param entity
* @return
*/
int updateOrder(RequisitionOrderEntity entity);
}

View File

@ -0,0 +1,287 @@
package com.hzya.frame.plugin.oa.praybill.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity;
import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderPluginService;
import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderService;
import com.hzya.frame.seeyon.entity.CollAttachmentResDTO;
import com.hzya.frame.seeyon.enums.ColEventTypeEnum;
import com.hzya.frame.seeyon.util.OARestUtil;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import java.io.File;
import java.net.URLDecoder;
import java.util.Base64;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
/**
* @Description OA请购单传NCC
* @Author xiangerlin
* @Date 2025/5/21 17:44
**/
public class RequisitionOrderPluginServiceImpl implements IRequisitionOrderPluginService {
@Value("${zt.url}")
private String baseUrl;
@Autowired
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private IRequisitionOrderService requisitionOrderService;
@Autowired
private OARestUtil oaRestUtil;
Logger logger = LoggerFactory.getLogger(IRequisitionOrderPluginService.class);
/**
* 请购单同步到ncc
*
* @param requestJson
* @return
*/
@Override
public JsonResultEntity sync2ncc(JSONObject requestJson) {
//数据源编码
String datasourceCode = requestJson.getString("sourceCode");
String task_living_details_id = requestJson.getString("integration_task_living_details_id");
String headersStr = requestJson.getString("headers");//请求头
String eventType = requestJson.getString("eventType");
String summaryId = requestJson.getString("summaryId");
JSONObject headers = requestJson.getJSONObject("headers");
Assert.notEmpty(eventType,"eventType不能为空");
Assert.notEmpty(headersStr,"headers不能为空");
String formmainTableName = headers.getString("formmainTableName");
String forsonTableName = headers.getString("forsonTableName");
String fileApiCode = headers.getString("fileApiCode");
JSONObject jsonStrObj = requestJson.getJSONObject("jsonStr");
JSONObject businessData = jsonStrObj.getJSONObject("businessDataStr");
JSONObject formmainData = businessData.getJSONObject(formmainTableName);
JSONArray forsonData = businessData.getJSONArray(forsonTableName);
//流程结束
if (ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(eventType)){
//组装请购单报文
JSONArray reqParams = praybillVaueOf(headers, formmainData, forsonData);
String req = JSONObject.toJSONString(reqParams);
logger.info("======OA请购单传NCC请求参数:{}======",req);
String result = HttpRequest.post(baseUrl)
.header("appId", "800065")//NCC请购单接口
.header("apiCode", "8000650000")//NCC应用
.header("publicKey", "ZJYAbkr9+XjnDrlfQCRKXtpVvg/BjxqtxzcLgg5TIGagEKJCe7eDIk+3zDUT+v578prj")//OA公钥
.header("secretKey", "2GR4+yrcx+Ev+pN0Q6V6wxCdvisPX7wzNKBgc5SsIYGxYI5GTISXT6GvTPfp1u2Rj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥
.body(req)//表单内容
.timeout(30000)//超时毫秒
.execute().body();
logger.info("======OA请购单传NCC响应参数:{}======",result);
if (StrUtil.isNotEmpty(result)){
JSONObject resultJson = JSONObject.parseObject(result);
Boolean flag = resultJson.getBoolean("flag");
//保存日志
IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity();
Date now = new Date();
taskLivingDetail.setCreate_time(now);
taskLivingDetail.setModify_time(now);
taskLivingDetail.setRootAppPk(formmainData.getString("id"));
taskLivingDetail.setRootAppBill(formmainData.getString("field0001"));
taskLivingDetail.setPluginId("RequisitionOrderPlugin");
taskLivingDetail.setRootAppNewData(req);
taskLivingDetail.setNewTransmitInfo(result);
taskLivingDetail.setNewPushDate(now);
saveLog(task_living_details_id,flag,taskLivingDetail);
//回写NCC单号到OA单据
JSONObject attribute = resultJson.getJSONObject("attribute");
if (null != attribute){
String code = attribute.getString("code");
if ("success".equals(code)){
JSONObject data = attribute.getJSONObject("data");
if (null != data){
JSONObject headVO = data.getJSONObject("headVO");
if (null != headVO){
String vbillcode = headVO.getString("code");
String pk_bill = headVO.getString("id");
logger.info("======vbillcode======:{}",vbillcode);
RequisitionOrderEntity requisitionOrderEntity = new RequisitionOrderEntity();
requisitionOrderEntity.setField0059(vbillcode);
requisitionOrderEntity.setDataSourceCode(datasourceCode);
requisitionOrderEntity.setId(formmainData.getString("id"));
requisitionOrderService.updateOrder(requisitionOrderEntity);
//下载OA附件上传到NCC
try {
uploadFile(summaryId, headers, fileApiCode, pk_bill);
}catch (Exception e){
logger.error("下载OA附件上传到NCC出错:{}",e);
}
}
}
}
}
}
}
return BaseResult.getSuccessMessageEntity("请购单推NCC成功");
}
/**
* 下载OA附件上传到NCC
* @param summaryId
* @param headers
* @param fileApiCode
* @param pk_bill
*/
public void uploadFile(String summaryId, JSONObject headers, String fileApiCode, String pk_bill) {
String token = oaRestUtil.getToken(null, fileApiCode);
List<CollAttachmentResDTO> collAttachmentList = oaRestUtil.getColAttachments(summaryId, "0", fileApiCode, token);
if (CollectionUtils.isNotEmpty(collAttachmentList)){
//获取OA token
for (CollAttachmentResDTO collAttachment : collAttachmentList) {
try {
String fileName = URLDecoder.decode(collAttachment.getFilename(), "UTF-8");
byte[] bytes = oaRestUtil.downloadFileBytes("hzya", fileApiCode, collAttachment.getFileUrl(), fileName, token);
String base64File = Base64.getEncoder().encodeToString(bytes);
JSONObject fileParams = new JSONObject();
fileParams.put("creator", headers.getString("creator"));
fileParams.put("pk_bill", pk_bill);
fileParams.put("filename",fileName);
fileParams.put("file",base64File);
String result = HttpRequest.post(baseUrl)
.header("appId", "800065")//NCC应用
.header("apiCode", "8000650001")//NCC附件上传接口
.header("publicKey", "ZJYAbkr9+XjnDrlfQCRKXtpVvg/BjxqtxzcLgg5TIGagEKJCe7eDIk+3zDUT+v578prj")//OA公钥
.header("secretKey", "2GR4+yrcx+Ev+pN0Q6V6wxCdvisPX7wzNKBgc5SsIYGxYI5GTISXT6GvTPfp1u2Rj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥
.body(fileParams.toString())//表单内容
.timeout(30000)//超时毫秒
.execute().body();
logger.info("======OA请购单附件上传到NCC响应参数:{}======",result);
}catch(Exception e){
e.printStackTrace();
logger.error("下载OA附件出错:{}",e);
}
}
}
}
/**
* 组装请购单报文
* @param headers 请求头
* @param formmainData 主表数据
* @param forsonData 子表数据
* @return
*/
@NotNull
private static JSONArray praybillVaueOf(JSONObject headers, JSONObject formmainData, JSONArray forsonData) {
JSONObject paramObj = new JSONObject();
JSONObject praybill = new JSONObject();
paramObj.put("head", praybill);
praybill.put("pk_group", formmainData.getString("field0058"));//集团
praybill.put("pk_org", formmainData.getString("field0027"));//库存组织
praybill.put("pk_org_v", formmainData.getString("field0051"));//库存组织v
//praybill.put("vbillcode",formmainData.getString("field0001"));//请购单号
praybill.put("dbilldate", formmainData.getString("field0004"));//请购日期
boolean bsctype = false;
if ("1".equals(formmainData.getString("field0009"))){
bsctype = true;
}
praybill.put("bsctype",bsctype);//委外
praybill.put("pk_planpsn", formmainData.getString("field0030"));//计划员
praybill.put("pk_plandept", formmainData.getString("field0052"));//计划部门
praybill.put("pk_plandept_v", formmainData.getString("field0053"));//计划部门v
praybill.put("vmemo", formmainData.getString("field0013"));//备注
praybill.put("fbillstatus", headers.getString("fbillstatus"));//单据状态
praybill.put("bdirecttransit",false);//zhiyun
praybill.put("billmaker", headers.getString("billmaker"));//制单人 yonyou99
praybill.put("dmakedate", formmainData.getString("field0004"));//制单日期
praybill.put("ctrantypeid", formmainData.getString("field0039"));//请购类型
praybill.put("bislatest", true);//最新版本
praybill.put("vdef1", formmainData.getString("field0037"));
praybill.put("creator", headers.getString("creator"));//
praybill.put("fpraysource", headers.getString("fpraysource"));//
praybill.put("ccurrencyid", headers.getString("ccurrencyid"));//
praybill.put("nversion", headers.getString("nversion"));//
praybill.put("nversion", headers.getString("nversion"));//
List<JSONObject> parybillList = new LinkedList<>();
paramObj.put("body",parybillList);
String pk_org = formmainData.getString("field0027");
String pk_org_v = formmainData.getString("field0051");
for(int i = 0; i< forsonData.size(); i++){
JSONObject forson = forsonData.getJSONObject(i);
String field0020 = forson.getString("field0020");
String field0040 = forson.getString("field0040");
String nnum = StrUtil.isNotEmpty(field0040) ? field0040 : field0020;
JSONObject praybillB = new JSONObject();
praybillB.put("crowno",forson.getString("field0014"));
praybillB.put("nnum",nnum);
praybillB.put("pk_org",pk_org);
praybillB.put("pk_org_v",pk_org_v);
praybillB.put("vchangerate","1");
praybillB.put("pk_srcmaterial",forson.getString("field0054"));//物料pk带版本的那个
praybillB.put("pk_material",forson.getString("field0031"));//物料pk
praybillB.put("castunitid",forson.getString("field0055"));//计量单位pk
praybillB.put("cunitid",forson.getString("field0055"));//计量单位pk
praybillB.put("nastnum",nnum);//数量
praybillB.put("dreqdate",forson.getString("field0021"));//需求日期
praybillB.put("dsuggestdate",forson.getString("field0022"));//建议订货日期
praybillB.put("pk_purchaseorg",pk_org);//采购组织
praybillB.put("pk_purchaseorg_v",pk_org_v);//采购组织 带版本的那个
praybillB.put("pk_suggestsupplier",forson.getString("field0056"));//建议供应商
praybillB.put("pk_suggestsupplier_v",forson.getString("field0056"));//建议供应商
praybillB.put("pk_reqstoorg",pk_org);
praybillB.put("pk_reqstoorg_v",pk_org_v);
praybillB.put("pk_group", formmainData.getString("field0058"));
praybillB.put("browclose","N");//行关闭
praybillB.put("vbdef1",forson.getString("field0032"));//现存量
praybillB.put("vbdef2",forson.getString("field0033"));//在途量
praybillB.put("vbdef3",forson.getString("field0035"));//月度消耗
praybillB.put("vbdef4",forson.getString("field0034"));//安全库存
parybillList.add(praybillB);
}
//调用NCC接口
JSONArray reqParams = new JSONArray();
reqParams.add(paramObj);
return reqParams;
}
public static void main(String[] args) {
String field0020 = null;
String field0040 = "22";
String s = StrUtil.isNotEmpty(field0040) ? field0040 : field0020;
System.out.println(s);
}
//保存日志
public void saveLog(String integration_task_living_details_id, Boolean flag, IntegrationTaskLivingDetailsEntity taskLivingDetail){
try {
//判断成功调用这个方法
if (StrUtil.isEmpty(integration_task_living_details_id)){
if (flag){
taskLivingDetailsService.saveLogToSuccess(taskLivingDetail);
}else {
//失败 调用这个方法
taskLivingDetailsService.saveLogToFail(taskLivingDetail);
}
}else {
taskLivingDetail.setId(integration_task_living_details_id);
if (flag){
//如果是重试 成功调这个方法
taskLivingDetailsService.saveLogFailToSuccess(taskLivingDetail);
}else {
//如果是重试 失败调这个方法
taskLivingDetailsService.updateLogFailToSuccess(taskLivingDetail);
}
}
}catch (Exception e){
logger.error("保存日志出错:{}",e);
}
}
}

View File

@ -0,0 +1,42 @@
package com.hzya.frame.plugin.oa.praybill.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.oa.praybill.dao.IRequisitionOrderDao;
import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity;
import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description OA请购单
* @Author xiangerlin
* @Date 2025/6/8 17:11
**/
@Service(value = "requisitionOrderServiceImpl")
public class RequisitionOrderServiceImpl extends BaseService<RequisitionOrderEntity,String> implements IRequisitionOrderService {
private IRequisitionOrderDao requisitionOrderDao;
@Autowired
public void setRequisitionOrderDao(IRequisitionOrderDao dao) {
this.requisitionOrderDao = dao;
this.dao = dao;
}
/**
* 更新OA单据
*
* @param entity
* @return
*/
@DS(value = "#entity.dataSourceCode")
@Override
public int updateOrder(RequisitionOrderEntity entity) {
if (null != entity && StrUtil.isNotEmpty(entity.getId())){
requisitionOrderDao.update(entity);
}
return 0;
}
}

View File

@ -0,0 +1,31 @@
#######################本地环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: D:\yongansystem\kangarooDataCenter\v3\logs
spring:
datasource:
dynamic:
datasource:
master:
# url: jdbc:mysql://ufidahz.com.cn:9096/businesscenternew?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: bd993088e8a7c3dc5f44441617f9b4bf
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
url: jdbc:mysql://127.0.0.1:3307/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: bd993088e8a7c3dc5f44441617f9b4bf
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: D:\yongansystem\kangarooDataCenter\v3\logs
tomcatpath: D:\yongansystem\kangarooDataCenter\v3\tomcat
pluginpath: D:\yongansystem\kangarooDataCenter\v3\plugin
zt:
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
oa:
po_order_template_code: formmain_0256_dev

View File

@ -32,7 +32,7 @@ spring:
# type: com.alibaba.druid.pool.DruidDataSource
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
password: bd993088e8a7c3dc5f44441617f9b4bf
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle

View File

@ -21,3 +21,19 @@ savefile:
path: /Users/xiangerlin/work/app/file/dev
pluginpath: /Users/xiangerlin/work/app/file/dev
tomcatpath: /Users/xiangerlin/work/app/file/dev
zt:
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
oa:
po_order_template_code: formmain_0256_dev
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/

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>JHNCCPlugin</id>
<name>建辉NCC插件</name>
<category>202505210001</category>
</plugin>

View File

@ -0,0 +1,4 @@
<?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">
</beans>

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">
</beans>

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">
</beans>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>JHOAPlugin</id>
<name>建辉OA插件</name>
<category>202505230001</category>
</plugin>

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">
</beans>

View File

@ -0,0 +1,9 @@
<?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="paymentRequestPluginInitializer" class="com.hzya.frame.plugin.oa.payment.plugin.PaymentRequestPluginInitializer" />
<bean name="payResultPluginInitializer" class="com.hzya.frame.plugin.oa.payment.plugin.PayResultPluginInitializer" />
<bean name="requisitionOrderPluginInitializer" class="com.hzya.frame.plugin.oa.praybill.plugin.RequisitionOrderPluginInitializer" />
<bean name="poOrderApprovalEventPluginInitializer" class="com.hzya.frame.plugin.oa.poorder.plugin.PoOrderApprovalEventPluginInitializer" />
</beans>

View File

@ -0,0 +1,6 @@
<?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="paymentRequestPluginServiceImpl" class="com.hzya.frame.plugin.oa.payment.service.impl.PaymentPluginServiceImpl" />
<bean name="requisitionOrderPluginServiceImpl" class="com.hzya.frame.plugin.oa.praybill.service.impl.RequisitionOrderPluginServiceImpl" />
</beans>

View File

@ -0,0 +1,30 @@
package com.hzya.frame;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.oa.praybill.service.impl.RequisitionOrderPluginServiceImpl;
import com.hzya.frame.util.AESUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/**
* @Description
* @Author xiangerlin
* @Date 2025/6/11 10:20
**/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {WebappApplication.class})
public class Test1 {
@Autowired
private RequisitionOrderPluginServiceImpl requisitionOrderPluginService;
@Test
public void test01() {
JSONObject headers =new JSONObject();
headers.put("creator","1001P1100000000NUULI");
RequisitionOrderPluginServiceImpl service = new RequisitionOrderPluginServiceImpl();
requisitionOrderPluginService.uploadFile("-333447786976688302",headers,"8000640001","1001A3100000001B4COB");
}
}

View File

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

View File

@ -96,7 +96,7 @@ public abstract class MybatisGenericDao<E extends Serializable, PK extends Seria
public E query(E o, String stamentID) {
return (E) this.sqlSession.selectOne(stamentID, o);
}
@DS("#o.dataSourceCode")
@Override
public List<E> queryList(E o, String stamentID) {
List<E> tempList = this.sqlSession.selectList(stamentID, o);

View File

@ -22,11 +22,4 @@ public interface ISysDictionaryshopNewService {
* @return
*/
SysDictionaryshopNew getDictionaryshopByValue(String tabName, String columnName, String columnValue);
/**
* 查询列表
* @param object
* @return
*/
JsonResultEntity queryDictionaryList(JSONObject object);
}

View File

@ -1,6 +1,5 @@
package com.hzya.frame.sys.dictionaryshopNew.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.BaseResult;
import org.springframework.stereotype.Service;
import com.hzya.frame.serviceUtil.ServiceUtil;
@ -12,7 +11,7 @@ import org.slf4j.LoggerFactory;
import com.hzya.frame.web.entity.JsonResultEntity;
import javax.annotation.Resource;
import java.util.List;
/**
@ -50,17 +49,4 @@ public class SysDictionaryshopNewServiceImpl extends ServiceUtil implements ISy
sysDictionaryshopNew.setColumnValue(columnValue);
return sysdictionaryshopnewMapper.entity_get_by_value(sysDictionaryshopNew);
}
/**
* 查询列表
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryDictionaryList(JSONObject object) {
SysDictionaryshopNew dictionary = getData("jsonStr", object, SysDictionaryshopNew.class);
List<SysDictionaryshopNew> dictionaryList = sysdictionaryshopnewMapper.entity_list_base(dictionary);
return BaseResult.getSuccessMessageEntity("查询列表成功", dictionaryList);
}
}

View File

@ -9,13 +9,7 @@ import com.hzya.frame.web.entity.BaseEntity;
* @since 2025-04-29 10:16:27
*/
public class SysFlowStepAccountEntity extends BaseEntity {
//流程id
private String flowId;
//流程步骤id
private String stepId;
//应用id
private String appId;
/** 账户名称 */
private String name;
/** ip地址 */
@ -128,28 +122,5 @@ public class SysFlowStepAccountEntity extends BaseEntity {
this.agentid = agentid;
}
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
}

View File

@ -15,9 +15,6 @@
<result property="dbName" column="db_name" jdbcType="VARCHAR"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="flowId" column="flow_id" jdbcType="VARCHAR"/>
<result property="stepId" column="step_id" jdbcType="VARCHAR"/>
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
<result property="dbType" column="db_type" jdbcType="VARCHAR"/>
<result property="appKey" column="app_key" jdbcType="VARCHAR"/>
<result property="appSecret" column="app_secret" jdbcType="VARCHAR"/>
@ -38,10 +35,7 @@
,db_name
,user_name
,password
,flow_id
,step_id
,app_id
,db_type
,db_type
,app_key
,app_secret
,corpId
@ -65,9 +59,6 @@
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
@ -95,9 +86,6 @@
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
@ -127,9 +115,6 @@
<if test="dbName != null and dbName != ''"> and db_name like concat('%',#{dbName},'%') </if>
<if test="userName != null and userName != ''"> and user_name like concat('%',#{userName},'%') </if>
<if test="password != null and password != ''"> and password like concat('%',#{password},'%') </if>
<if test="flowId != null and flowId != ''"> and flow_id like concat('%',#{flowId},'%') </if>
<if test="stepId != null and stepId != ''"> and step_id like concat('%',#{stepId},'%') </if>
<if test="appId != null and appId != ''"> and app_id like concat('%',#{appId},'%') </if>
<if test="dbType != null and dbType != ''"> and db_type like concat('%',#{dbType},'%') </if>
<if test="appKey != null and appKey != ''"> and app_key like concat('%',#{appKey},'%') </if>
<if test="appSecret != null and appSecret != ''"> and app_secret like concat('%',#{appSecret},'%') </if>
@ -159,9 +144,6 @@
<if test="dbName != null and dbName != ''"> or db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> or user_name = #{userName} </if>
<if test="password != null and password != ''"> or password = #{password} </if>
<if test="flowId != null and flowId != ''"> or flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> or step_id = #{stepId} </if>
<if test="appId != null and appId != ''"> or app_id = #{appId} </if>
<if test="dbType != null and dbType != ''"> or db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> or app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> or app_secret = #{appSecret} </if>
@ -189,9 +171,6 @@
<if test="dbName != null and dbName != ''"> db_name , </if>
<if test="userName != null and userName != ''"> user_name , </if>
<if test="password != null and password != ''"> password , </if>
<if test="flowId != null and flowId != ''"> flow_id , </if>
<if test="stepId != null and stepId != ''"> step_id , </if>
<if test="appId != null and appId != ''"> app_id , </if>
<if test="dbType != null and dbType != ''"> db_type , </if>
<if test="appKey != null and appKey != ''"> app_key , </if>
<if test="appSecret != null and appSecret != ''"> app_secret , </if>
@ -214,9 +193,6 @@
<if test="dbName != null and dbName != ''"> #{dbName} ,</if>
<if test="userName != null and userName != ''"> #{userName} ,</if>
<if test="password != null and password != ''"> #{password} ,</if>
<if test="flowId != null and flowId != ''"> #{flowId} ,</if>
<if test="stepId != null and stepId != ''"> #{stepId} ,</if>
<if test="appId != null and appId != ''"> #{appId} ,</if>
<if test="dbType != null and dbType != ''"> #{dbType} ,</if>
<if test="appKey != null and appKey != ''"> #{appKey} ,</if>
<if test="appSecret != null and appSecret != ''"> #{appSecret} ,</if>
@ -229,18 +205,18 @@
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password,flow_id,step_id,app_id, db_type, app_key, app_secret, corpId, agentId, sts)
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password, db_type, app_key, app_secret, corpId, agentId, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.flowId},#{entity.stepId},#{entity.appId},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid}, 'Y')
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password,flow_id,step_id,app_id, db_type, app_key, app_secret, corpId, agentId)
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password, db_type, app_key, app_secret, corpId, agentId)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.flowId},#{entity.stepId},#{entity.appId},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid})
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid})
</foreach>
on duplicate key update
create_user_id = values(create_user_id),
@ -254,9 +230,6 @@
db_name = values(db_name),
user_name = values(user_name),
password = values(password),
flow_id = values(flow_id),
step_id = values(step_id),
app_id = values(app_id),
db_type = values(db_type),
app_key = values(app_key),
app_secret = values(app_secret),
@ -277,9 +250,6 @@ update sys_flow_step_account set
<if test="dbName != null and dbName != ''"> db_name = #{dbName},</if>
<if test="userName != null and userName != ''"> user_name = #{userName},</if>
<if test="password != null and password != ''"> password = #{password},</if>
<if test="flowId != null and flowId != ''"> flow_id = #{flowId},</if>
<if test="stepId != null and stepId != ''"> step_id = #{stepId},</if>
<if test="appId != null and appId != ''"> app_id = #{appId},</if>
<if test="dbType != null and dbType != ''"> db_type = #{dbType},</if>
<if test="appKey != null and appKey != ''"> app_key = #{appKey},</if>
<if test="appSecret != null and appSecret != ''"> app_secret = #{appSecret},</if>
@ -305,9 +275,6 @@ update sys_flow_step_account set sts= 'N' ,modify_time = #{modify_time},modify_
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>

View File

@ -35,8 +35,6 @@ public class SysFlowStepConfigEntity extends BaseEntity {
/** 动态sql语句 */
private String sqlStatement;
//步骤账户表id
private String stepAccountId;
public String getFlowId() {
return flowId;
@ -134,12 +132,5 @@ public class SysFlowStepConfigEntity extends BaseEntity {
this.sqlStatement = sqlStatement;
}
public String getStepAccountId() {
return stepAccountId;
}
public void setStepAccountId(String stepAccountId) {
this.stepAccountId = stepAccountId;
}
}

View File

@ -32,10 +32,8 @@ public class SysFlowStepEntity extends BaseEntity {
private String nifiApiId;
/** nifi应用排序模式;先进先出/先进后出 */
private String sortMode;
//定时任务 corn表达式
private String taskCorn;
//账户对象
private SysFlowStepAccountEntity account;
public Integer getStep() {
return step;
}
@ -123,21 +121,5 @@ public class SysFlowStepEntity extends BaseEntity {
public void setFlowId(String flowId) {
this.flowId = flowId;
}
public SysFlowStepAccountEntity getAccount() {
return account;
}
public void setAccount(SysFlowStepAccountEntity account) {
this.account = account;
}
public String getTaskCorn() {
return taskCorn;
}
public void setTaskCorn(String taskCorn) {
this.taskCorn = taskCorn;
}
}

View File

@ -17,31 +17,29 @@
<result property="actionType" column="action_type" jdbcType="VARCHAR"/>
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
<result property="apiId" column="api_id" jdbcType="VARCHAR"/>
<result property="taskCorn" column="task_corn" jdbcType="VARCHAR"/>
<result property="nifiAppId" column="nifi_app_id" jdbcType="VARCHAR"/>
<result property="nifiApiId" column="nifi_api_id" jdbcType="VARCHAR"/>
<result property="sortMode" column="sort_mode" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="SysFlowStepEntity_Base_Column_List">
id,
create_user_id,
create_time,
modify_user_id,
modify_time,
sts,
step,
step_type,
flowId,
description,
api_name,
action_type,
app_id,
api_id,
taskCorn,
nifi_app_id,
nifi_api_id,
sort_mode
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,step
,step_type
,flowId
,description
,api_name
,action_type
,app_id
,api_id
,nifi_app_id
,nifi_api_id
,sort_mode
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowStepEntity-result"
@ -184,7 +182,6 @@
<if test="actionType != null and actionType != ''">action_type ,</if>
<if test="appId != null and appId != ''">app_id ,</if>
<if test="apiId != null and apiId != ''">api_id ,</if>
<if test="taskCorn != null and taskCorn != ''">task_corn ,</if>
<if test="nifiAppId != null and nifiAppId != ''">nifi_app_id ,</if>
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id ,</if>
<if test="sortMode != null and sortMode != ''">sort_mode ,</if>
@ -207,7 +204,6 @@
<if test="actionType != null and actionType != ''">#{actionType} ,</if>
<if test="appId != null and appId != ''">#{appId} ,</if>
<if test="apiId != null and apiId != ''">#{apiId} ,</if>
<if test="taskCorn != null and taskCorn != ''">#{taskCorn} ,</if>
<if test="nifiAppId != null and nifiAppId != ''">#{nifiAppId} ,</if>
<if test="nifiApiId != null and nifiApiId != ''">#{nifiApiId} ,</if>
<if test="sortMode != null and sortMode != ''">#{sortMode} ,</if>
@ -271,7 +267,6 @@
<if test="actionType != null and actionType != ''">action_type = #{actionType},</if>
<if test="appId != null and appId != ''">app_id = #{appId},</if>
<if test="apiId != null and apiId != ''">api_id = #{apiId},</if>
<if test="taskCorn != null and taskCorn != ''">task_corn = #{taskCorn},</if>
<if test="nifiAppId != null and nifiAppId != ''">nifi_app_id = #{nifiAppId},</if>
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id = #{nifiApiId},</if>
<if test="sortMode != null and sortMode != ''">sort_mode = #{sortMode},</if>
@ -300,7 +295,6 @@
<if test="actionType != null and actionType != ''">and action_type = #{actionType}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="apiId != null and apiId != ''">and api_id = #{apiId}</if>
<if test="taskCorn != null and taskCorn != ''">and task_corn = #{taskCorn}</if>
<if test="nifiAppId != null and nifiAppId != ''">and nifi_app_id = #{nifiAppId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
<if test="sortMode != null and sortMode != ''">and sort_mode = #{sortMode}</if>

View File

@ -1,10 +1,7 @@
package com.hzya.frame.sys.flow.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 流程步骤账户表(SysFlowStepAccount)表服务接口
*
@ -12,53 +9,4 @@ import com.hzya.frame.web.entity.JsonResultEntity;
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepAccountService extends IBaseService<SysFlowStepAccountEntity, String>{
/**
* 保存账户信息
* @param object
* @return
*/
JsonResultEntity saveAccount(JSONObject object);
/**
* 更新账户信息
* @param object
* @return
*/
JsonResultEntity updateAccount(JSONObject object);
/**
* 删除账户信息
* @param object
* @return
*/
JsonResultEntity deleteAccount(JSONObject object);
/**
* 查询账户详情
* @param object
* @return
*/
JsonResultEntity getAccount(JSONObject object);
/**
* 查询账户列表数据
* @param object
* @return
*/
JsonResultEntity queryAccountList(JSONObject object);
/**
* 查询账户分页数据
* @param object
* @return
*/
JsonResultEntity queryAccountPaged(JSONObject object);
/**
* 验证数据库账户
* @param object
* @return
*/
JsonResultEntity verifyDataBase(JSONObject object);
}

View File

@ -1,10 +1,7 @@
package com.hzya.frame.sys.flow.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 映射信息主表(SysFlowStepConfig)表服务接口
*
@ -12,11 +9,4 @@ import com.hzya.frame.web.entity.JsonResultEntity;
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepConfigService extends IBaseService<SysFlowStepConfigEntity, String>{
/**
* 测试sql
* @param object
* @return
*/
JsonResultEntity testSql(JSONObject object);
}

View File

@ -1,10 +1,7 @@
package com.hzya.frame.sys.flow.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowStepEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 流程步骤信息(SysFlowStep)表服务接口
*
@ -12,39 +9,4 @@ import com.hzya.frame.web.entity.JsonResultEntity;
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowStepService extends IBaseService<SysFlowStepEntity, String>{
/**
* 保存流程步骤
* @param object
* @return
*/
JsonResultEntity saveFlowStep(JSONObject object);
/**
* 更新流程步骤
* @param object
* @return
*/
JsonResultEntity updateFlowStep(JSONObject object);
/**
* 删除流程步骤
* @param object
* @return
*/
JsonResultEntity deleteFlowStep(JSONObject object);
/**
* 查询列表
* @param object
* @return
*/
JsonResultEntity queryList(JSONObject object);
/**
* 步骤详情
* @param object
* @return
*/
JsonResultEntity getFlowStep(JSONObject object);
}

View File

@ -53,7 +53,7 @@ public class SysFlowServiceImpl extends BaseService<SysFlowEntity, String> imple
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowDao.save(flowEntity);
return BaseResult.getSuccessMessageEntity("保存成功",flowEntity);
return BaseResult.getSuccessMessageEntity("保存成功");
}
/**

View File

@ -1,30 +1,12 @@
package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.datasource.DataSourceUtilProperties;
import com.hzya.frame.serviceUtil.DsDataSourceUtil;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepAccountDao;
import com.hzya.frame.sys.flow.service.ISysFlowStepAccountService;
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
import com.hzya.frame.sysnew.application.database.service.ISysApplicationDatabaseService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.List;
/**
* 流程步骤账户表(SysFlowStepAccount)表服务实现类
*
@ -33,252 +15,12 @@ import java.util.List;
*/
@Service(value = "sysFlowStepAccountService")
public class SysFlowStepAccountServiceImpl extends BaseService<SysFlowStepAccountEntity, String> implements ISysFlowStepAccountService {
private ISysFlowStepAccountDao sysFlowStepAccountDao;
@Resource
private DsDataSourceUtil dsDataSourceUtil;
@Autowired
private ISysApplicationDatabaseService sysApplicationDatabaseService;
@Autowired
public void setSysFlowStepAccountDao(ISysFlowStepAccountDao dao) {
this.sysFlowStepAccountDao = dao;
this.dao = dao;
}
/**
* 保存账户信息
*
* @param object
* @return
*/
@Override
public JsonResultEntity saveAccount(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "save");
//控制一下名字不能重复
List<SysFlowStepAccountEntity> queryList = queryByName(entity);
if (CollectionUtils.isNotEmpty(queryList) && queryList.size() > 0) {
return BaseResult.getFailureMessageEntity(entity.getName() + "重复");
}
sysFlowStepAccountDao.save(entity);
//保存数据源表测试sql的时候要用动态数据源动态数据源是从sys_application_database表查数据的
saveOrDataBase(entity);
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return BaseResult.getSuccessMessageEntity("新增成功");
}
/**
* 保存数据源表测试sql的时候要用动态数据源动态数据源是从sys_application_database表查数据的
*
* @param entity
*/
private void saveOrDataBase(SysFlowStepAccountEntity entity) throws Exception {
Assert.notNull(entity, "参数不能为空");
Assert.notEmpty(entity.getName(), "账户名称不能为空");
SysApplicationDatabaseEntity db = new SysApplicationDatabaseEntity();
db.setSourceCode(entity.getName() + "_flow");
List<SysApplicationDatabaseEntity> queryList = sysApplicationDatabaseService.query(db);
if (CollectionUtils.isNotEmpty(queryList)) {
for (SysApplicationDatabaseEntity sys : queryList) {
sysApplicationDatabaseService.logicRemove(sys);
}
}
SysApplicationDatabaseEntity databaseEntity = new SysApplicationDatabaseEntity();
databaseEntity.setAppId(entity.getAppId());
databaseEntity.setSourceCode(entity.getName() + "_flow");
databaseEntity.setSourceName(entity.getName());
databaseEntity.setSourceType(entity.getDbType());
databaseEntity.setSourceIp(entity.getIpAddress());
databaseEntity.setSourcePort(entity.getPort());
databaseEntity.setLoginName(entity.getUserName());
databaseEntity.setPassword(entity.getPassword());
databaseEntity.setDbName(entity.getDbName());
databaseEntity.setDbStatus("1");
sysApplicationDatabaseService.save(databaseEntity);
}
/**
* 更新账户信息
*
* @param object
* @return
*/
@Override
public JsonResultEntity updateAccount(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "update");
//检查一下名字不能重复
List<SysFlowStepAccountEntity> queryList = queryByName(entity);
if (CollectionUtils.isNotEmpty(queryList) && queryList.size() > 0) {
for (SysFlowStepAccountEntity acc : queryList) {
if (!acc.getId().equals(entity.getId())) {
return BaseResult.getFailureMessageEntity(entity.getName() + "重复");
}
}
}
sysFlowStepAccountDao.update(entity);
//保存数据源表测试sql的时候要用动态数据源动态数据源是从sys_application_database表查数据的
saveOrDataBase(entity);
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return BaseResult.getSuccessMessageEntity("更新成功");
}
/**
* 删除账户信息
*
* @param object
* @return
*/
@Override
public JsonResultEntity deleteAccount(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "delete");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowStepAccountDao.logicRemove(entity);
return BaseResult.getSuccessMessageEntity("删除成功");
}
/**
* 查询账户详情
*
* @param object
* @return
*/
@Override
public JsonResultEntity getAccount(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "get");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowStepAccountEntity SysFlowStepAccountEntity = sysFlowStepAccountDao.get(entity.getId());
return BaseResult.getSuccessMessageEntity("查询账户详情成功", SysFlowStepAccountEntity);
}
/**
* 查询账户列表数据
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryAccountList(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "queryList");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
List<SysFlowStepAccountEntity> queryList = sysFlowStepAccountDao.query(entity);
return BaseResult.getSuccessMessageEntity("查询列表成功", queryList);
}
/**
* 查询账户分页数据
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryAccountPaged(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "queryPaged");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return null;
}
//根据账户名称查询
private List<SysFlowStepAccountEntity> queryByName(SysFlowStepAccountEntity entity) {
if (StrUtil.isNotEmpty(entity.getName())) {
SysFlowStepAccountEntity account = new SysFlowStepAccountEntity();
account.setName(entity.getName());
List<SysFlowStepAccountEntity> queryList = sysFlowStepAccountDao.query(account);
return queryList;
}
return null;
}
/**
* 验证账户
*
* @param object
* @return
*/
@Override
public JsonResultEntity verifyDataBase(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "verify");
String dbType = entity.getDbType();
String driveClass = "";
StringBuffer sourceUrl = new StringBuffer();
if (StrUtil.isNotEmpty(dbType)) {
if ("mysql".equals(dbType)) {
driveClass = DataSourceUtilProperties.MYSQLDRIVER_6;
sourceUrl.append("jdbc:mysql://").append(entity.getIpAddress()).append(":").append(entity.getPort()).append("/").append(entity.getDbName()).append("?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");
} else if ("oracle".equals(dbType)) {
driveClass = DataSourceUtilProperties.ORACLEDRIVER;
sourceUrl.append("jdbc:oracle:thin:@").append(entity.getIpAddress()).append(":").append(entity.getPort()).append(":").append(entity.getDbName());
} else if ("sqlserver2000".equals(dbType)) {
driveClass = DataSourceUtilProperties.SQL2000DRIVER;
sourceUrl.append("jdbc:sqlserver://").append(entity.getIpAddress()).append(":").append(entity.getPort()).append(";DatabaseName=").append(entity.getDbName()).append(";encrypt=false;trustServerCertificate=true");
} else if ("sqlserver2005".equals(dbType)) {
driveClass = DataSourceUtilProperties.SQL2005DRIVER;
sourceUrl.append("jdbc:sqlserver://").append(entity.getIpAddress()).append(":").append(entity.getPort()).append(";DatabaseName=").append(entity.getDbName()).append(";encrypt=false;trustServerCertificate=true");
}
//测试连接
Class.forName(driveClass);
Connection connection = DriverManager.getConnection(sourceUrl.toString(), entity.getUserName(), entity.getPassword());// 相当于连接数据库
if (null != connection) {
return BaseResult.getSuccessMessageEntity("验证成功");
} else {
return BaseResult.getFailureMessageEntity("验证失败");
}
}
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return null;
}
//数据检查
private void checkParam(SysFlowStepAccountEntity entity, String type) {
Assert.notNull(entity, "参数不能为空");
if ("save".equals(type)) {
Assert.notEmpty(entity.getFlowId(), "flowId不能为空");
Assert.notEmpty(entity.getAppId(), "appId不能为空");
Assert.notEmpty(entity.getName(), "账户名称不能为空");
} else if ("update".equals(type)) {
Assert.notEmpty(entity.getId(), "id不能为空");
} else if ("delete".equals(type)) {
Assert.notEmpty(entity.getId(), "id不能为空");
} else if ("get".equals(type)) {
Assert.notEmpty(entity.getId(), "id不能为空");
} else if ("queryList".equals(type)) {
Assert.notEmpty(entity.getFlowId(), "flowId不能为空");
Assert.notEmpty(entity.getStepId(), "stepId不能为空");
Assert.notEmpty(entity.getAppId(), "appId不能为空");
} else if ("queryPaged".equals(type)) {
Assert.notNull(entity.getPageNum(), "pageNum不能为空");
Assert.notNull(entity.getPageSize(), "pageSize不能为空");
} else if ("verify".equals(type)) {
}
}
public void setSysFlowStepAccountDao(ISysFlowStepAccountDao dao) {
this.sysFlowStepAccountDao = dao;
this.dao = dao;
}
}

View File

@ -1,27 +1,12 @@
package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigDao;
import com.hzya.frame.sys.flow.service.ISysFlowStepAccountService;
import com.hzya.frame.sys.flow.service.ISysFlowStepConfigService;
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
import com.hzya.frame.sysnew.application.database.service.ISysApplicationDatabaseService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 映射信息主表(SysFlowStepConfig)表服务实现类
*
@ -30,53 +15,12 @@ import java.util.List;
*/
@Service(value = "sysFlowStepConfigService")
public class SysFlowStepConfigServiceImpl extends BaseService<SysFlowStepConfigEntity, String> implements ISysFlowStepConfigService {
Logger logger = LoggerFactory.getLogger(ISysFlowStepConfigService.class);
private ISysFlowStepConfigDao sysFlowStepConfigDao;
@Autowired
private ISysFlowStepAccountService sysFlowStepAccountService;
@Autowired
private ISysApplicationDatabaseService sysApplicationDatabaseService;
@Autowired
public void setSysFlowStepConfigDao(ISysFlowStepConfigDao dao) {
this.sysFlowStepConfigDao = dao;
this.dao = dao;
}
/**
* 测试sql
*
* @param object
* @return
*/
@Override
public JsonResultEntity testSql(JSONObject object) {
SysFlowStepConfigEntity config = getData("jsonStr",object,SysFlowStepConfigEntity.class);
try {
checkParams(config,"type");
}catch (Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowStepAccountEntity accountEntity = sysFlowStepAccountService.get(config.getId());
Assert.notNull(accountEntity,"没有找到对应账户");
//查询数据源
SysApplicationDatabaseEntity database = new SysApplicationDatabaseEntity();
database.setSourceCode(accountEntity.getName()+"_flow");
List<SysApplicationDatabaseEntity> databaseList = sysApplicationDatabaseService.query(database);
if (CollectionUtils.isEmpty(databaseList)){
throw new BaseSystemException("没有找到数据源");
}
return null;
}
/**
* 验证数据
* @param entity
* @param type
*/
private void checkParams(SysFlowStepConfigEntity entity, String type) {
Assert.notNull(entity,"参数不能为空");
Assert.notEmpty(entity.getTableName(),"tabName不能为空");
Assert.notEmpty(entity.getStepAccountId(),"tabName不能为空");
}
}

View File

@ -1,21 +1,12 @@
package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.dao.ISysFlowStepAccountDao;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.sys.flow.entity.SysFlowStepEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepDao;
import com.hzya.frame.sys.flow.service.ISysFlowStepAccountService;
import com.hzya.frame.sys.flow.service.ISysFlowStepService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 流程步骤信息(SysFlowStep)表服务实现类
*
@ -24,137 +15,12 @@ import java.util.List;
*/
@Service(value = "sysFlowStepService")
public class SysFlowStepServiceImpl extends BaseService<SysFlowStepEntity, String> implements ISysFlowStepService {
private ISysFlowStepDao sysFlowStepDao;
@Autowired
private ISysFlowStepAccountService sysFlowStepAccountService;
@Autowired
public void setSysFlowStepDao(ISysFlowStepDao dao) {
this.sysFlowStepDao = dao;
this.dao = dao;
}
/**
* 保存流程步骤
*
* @param object
* @return
*/
@Override
public JsonResultEntity saveFlowStep(JSONObject object) {
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
try {
checkParams(sysFlowStep, "save");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowStepDao.save(sysFlowStep);
return BaseResult.getSuccessMessageEntity("保存成功", sysFlowStep);
}
/**
* 更新流程步骤
*
* @param object
* @return
*/
@Override
public JsonResultEntity updateFlowStep(JSONObject object) {
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
try {
checkParams(sysFlowStep, "update");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowStepDao.update(sysFlowStep);
//保存账户信息
if (null != sysFlowStep.getAccount()) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("jsonStr", JSONObject.toJSONString(sysFlowStep.getAccount()));
sysFlowStepAccountService.saveAccount(jsonObject);
}
return BaseResult.getSuccessMessageEntity("保存成功", sysFlowStep);
}
/**
* 删除流程步骤
*
* @param object
* @return
*/
@Override
public JsonResultEntity deleteFlowStep(JSONObject object) {
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
try {
checkParams(sysFlowStep, "delete");
String id = sysFlowStep.getId();
SysFlowStepEntity step = sysFlowStepDao.get(id);
//删除流程步骤账户表
SysFlowStepAccountEntity stepAccount = new SysFlowStepAccountEntity();
stepAccount.setFlowId(step.getFlowId());
stepAccount.setStepId(id);
sysFlowStepAccountService.logicRemoveMultiCondition(stepAccount);
//删除流程步骤
sysFlowStepDao.logicRemove(step);
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return BaseResult.getSuccessMessageEntity("删除成功");
}
/**
* 查询列表
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryList(JSONObject object) {
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
try {
checkParams(sysFlowStep, "queryList");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
List<SysFlowStepEntity> list = sysFlowStepDao.query(sysFlowStep);
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
}
/**
* 步骤详情
*
* @param object
* @return
*/
@Override
public JsonResultEntity getFlowStep(JSONObject object) {
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
try {
checkParams(sysFlowStep, "get");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowStepEntity entity = sysFlowStepDao.get(sysFlowStep.getId());
return BaseResult.getSuccessMessageEntity("查询详情成功", entity);
}
private void checkParams(SysFlowStepEntity entity, String type) {
Assert.notNull(entity, "参数不能为空");
if ("save".equals(type)) {
Assert.notEmpty(entity.getFlowId(), "flowId不能为空");
Assert.notNull(entity.getStep(), "步骤号不能为空");
Assert.notEmpty(entity.getStepType(), "stepType不能为空");
} else if ("update".equals(type)) {
Assert.notEmpty(entity.getAppId(), "appId不能为空");
Assert.notEmpty(entity.getNifiApiId(), "nifiApiId不能为空");
} else if ("delete".equals(type)) {
Assert.notEmpty(entity.getId(), "id不能为空");
}else if ("queryList".equals(type)){
Assert.notEmpty(entity.getFlowId(),"flowId不能为空");
}else if ("get".equals(type)){
Assert.notEmpty(entity.getId(),"id不能为空");
}
}
public void setSysFlowStepDao(ISysFlowStepDao dao) {
this.sysFlowStepDao = dao;
this.dao = dao;
}
}

View File

@ -82,9 +82,6 @@ public class SysApplicationApiEntity extends BaseEntity {
/** 返回描述字段*/
private String returnMsg;
//对应nifi的apiid
private String nifiApiId;
public String getReturnMsg() {
return returnMsg;
}
@ -324,13 +321,5 @@ public class SysApplicationApiEntity extends BaseEntity {
public void setAppCode(Long appCode) {
this.appCode = appCode;
}
public String getNifiApiId() {
return nifiApiId;
}
public void setNifiApiId(String nifiApiId) {
this.nifiApiId = nifiApiId;
}
}

View File

@ -10,7 +10,6 @@
<result property="appCode" column="app_code"/>
<result property="apiPath" column="api_path" jdbcType="VARCHAR"/>
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
<result property="nifiApiId" column="nifi_api_id" jdbcType="VARCHAR"/>
<result property="appName" column="app_name" jdbcType="VARCHAR"/>
<result property="appUrl" column="app_url" jdbcType="VARCHAR"/>
<result property="catalogueId" column="catalogue_id" jdbcType="VARCHAR"/>
@ -52,8 +51,7 @@
,api_code
,api_path
,app_id
,nifi_api_id
,catalogue_id
,catalogue_id
,api_name
,api_remark
,need_Login
@ -86,8 +84,8 @@
<!--api联查应用表like查询 -->
<sql id="SysApplicationApiEntity_join_sysApp_like_Column_Lis">
sys_application_api.id,
sys_application.id as app_id,
sys_application.app_id as app_code,
sys_application.nifi_api_id as nifi_api_id,
sys_application_api.api_code,
sys_application_api.api_name,
sys_application_api.api_remark,
@ -114,7 +112,6 @@
b.name as app_name,
b.interface_address as app_url,
a.app_id,
a.nifi_api_id,
a.catalogue_id,
c.name as catalogue_name,
a.api_name,
@ -166,7 +163,6 @@ WHERE
,api.api_code
,api.api_path
,api.app_id
,api.nifi_api_id
,api.catalogue_id
,api.api_name
,api.api_remark
@ -205,7 +201,6 @@ WHERE
<if test="apiCode != null ">and api.api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">and api.api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">and api.app_id = #{appId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and api.nifi_api_id = #{nifiApiId}</if>
<if test="catalogueId != null and catalogueId != ''">and api.catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">and api.api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">and api.api_remark = #{apiRemark}</if>
@ -257,7 +252,6 @@ WHERE
<if test="apiCode != null ">and api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">and api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
<if test="catalogueId != null and catalogueId != ''">and catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">and api_remark = #{apiRemark}</if>
@ -311,7 +305,6 @@ WHERE
<if test="apiCode != null ">and api_code like concat('%',#{apiCode},'%')</if>
<if test="apiPath != null and apiPath != ''">and api_path like concat('%',#{apiPath},'%')</if>
<if test="appId != null and appId != ''">and app_id like concat('%',#{appId},'%')</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id like concat('%',#{nifiApiId},'%')</if>
<if test="catalogueId != null and catalogueId != ''">and catalogue_id like concat('%',#{catalogueId},'%')
</if>
<if test="apiName != null and apiName != ''">and api_name like concat('%',#{apiName},'%')</if>
@ -380,7 +373,6 @@ WHERE
<if test="apiCode != null ">and sys_application_api.api_code like concat('%',#{apiCode},'%')</if>
<if test="apiPath != null and apiPath != ''">and sys_application_api.api_path like concat('%',#{apiPath},'%')</if>
<if test="appId != null and appId != ''">and sys_application_api.app_id like concat('%',#{appId},'%')</if>
<if test="nifiApiId != null and nifiApiId != ''">and sys_application_api.nifi_api_id like concat('%',#{nifiApiId},'%')</if>
<if test="catalogueId != null and catalogueId != ''">and sys_application_api.catalogue_id like concat('%',#{catalogueId},'%')
</if>
<if test="apiName != null and apiName != ''">and sys_application_api.api_name like concat('%',#{apiName},'%')</if>
@ -447,7 +439,6 @@ WHERE
<if test="apiCode != null ">or api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">or api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">or app_id = #{appId}</if>
<if test="nifiApiId != null and nifiApiId != ''">or nifi_api_id = #{nifiApiId}</if>
<if test="catalogueId != null and catalogueId != ''">or catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">or api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">or api_remark = #{apiRemark}</if>
@ -500,7 +491,6 @@ WHERE
<if test="apiCode == null ">api_code ,</if>
<if test="apiPath != null and apiPath != ''">api_path ,</if>
<if test="appId != null and appId != ''">app_id ,</if>
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id ,</if>
<if test="catalogueId != null and catalogueId != ''">catalogue_id ,</if>
<if test="apiName != null and apiName != ''">api_name ,</if>
<if test="apiRemark != null and apiRemark != ''">api_remark ,</if>
@ -542,7 +532,6 @@ WHERE
</if>
<if test="apiPath != null and apiPath != ''">#{apiPath} ,</if>
<if test="appId != null and appId != ''">#{appId} ,</if>
<if test="nifiApiId != null and nifiApiId != ''">#{nifiApiId} ,</if>
<if test="catalogueId != null and catalogueId != ''">#{catalogueId} ,</if>
<if test="apiName != null and apiName != ''">#{apiName} ,</if>
<if test="apiRemark != null and apiRemark != ''">#{apiRemark} ,</if>
@ -579,32 +568,31 @@ WHERE
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into sys_application_api(api_status,api_code,api_path, app_id,nifi_api_id, catalogue_id, api_name, api_remark,
insert into sys_application_api(api_status,api_code,api_path, app_id, catalogue_id, api_name, api_remark,
need_Login, authentication_port, parameter_passing_mode, destination_address, request_coding, request_method,
timeout_period, current_limiting, header_in, query_in, body_in_type, body_in, body_out, bean_name,return_msg,return_success_field,return_success_value, fun_name, extension_api, sorts, create_user_id,
create_time, modify_user_id, modify_time, sts, org_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.nifiApiId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into sys_application_api(api_status,api_code,api_path, app_id,nifi_api_id, catalogue_id, api_name, api_remark,
insert into sys_application_api(api_status,api_code,api_path, app_id, catalogue_id, api_name, api_remark,
need_Login, authentication_port, parameter_passing_mode, destination_address, request_coding, request_method,
timeout_period, current_limiting, header_in, query_in, body_in_type, body_in, body_out,bean_name,return_msg,return_success_field,return_success_value,fun_name,extension_api, sorts, create_user_id,
create_time, modify_user_id, modify_time, sts, org_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.nifiApiId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
</foreach>
on duplicate key update
api_status = values(api_status),
api_code = values(api_code),
api_path = values(api_path),
app_id = values(app_id),
nifi_api_id = values(nifi_api_id),
catalogue_id = values(catalogue_id),
api_name = values(api_name),
api_remark = values(api_remark),
@ -643,7 +631,6 @@ WHERE
<if test="apiCode != null ">api_code = #{apiCode},</if>
<if test="apiPath != null and apiPath != ''">api_path = #{apiPath},</if>
<if test="appId != null and appId != ''">app_id = #{appId},</if>
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id = #{nifiApiId},</if>
<if test="catalogueId != null and catalogueId != ''">catalogue_id = #{catalogueId},</if>
<if test="apiName != null and apiName != ''">api_name = #{apiName},</if>
<if test="apiRemark != null and apiRemark != ''">api_remark = #{apiRemark},</if>
@ -697,7 +684,6 @@ where id = #{id}
<if test="apiCode != null ">and api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">and api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
<if test="catalogueId != null and catalogueId != ''">and catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">and api_remark = #{apiRemark}</if>
@ -934,7 +920,6 @@ where id = #{id}
select
id
,app_id
,nifi_api_id
,api_name
from sys_application_api
<trim prefix="where" prefixOverrides="and">
@ -943,7 +928,6 @@ where id = #{id}
<if test="apiCode != null ">and api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">and api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
<if test="catalogueId != null and catalogueId != ''">and catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">and api_remark = #{apiRemark}</if>

View File

@ -1,8 +1,6 @@
package com.hzya.frame.sysnew.application.appAcount.entity;
import java.util.Date;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 应用账户表(SysApplicationAccount)实体类
@ -134,5 +132,6 @@ public class SysApplicationAccountEntity extends BaseEntity {
public void setAgentid(String agentid) {
this.agentid = agentid;
}
}

View File

@ -33,7 +33,7 @@
,modify_time
,sts
,sorts
,app_id
,appId
,name
,ip_address
,port
@ -46,14 +46,6 @@
,corpId
,agentId
</sql>
<select id="entity_get" parameterType="com.hzya.frame.sysnew.application.appAcount.entity.SysApplicationAccountEntity" resultMap="get-SysApplicationAccountEntity-result">
select
<include refid="SysApplicationAccountEntity_Base_Column_List"/>
from sys_application_account
where id = #{id}
and sts = 'Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysApplicationAccountEntity-result"
parameterType="com.hzya.frame.sysnew.application.appAcount.entity.SysApplicationAccountEntity">
@ -207,7 +199,6 @@
<if test="appSecret != null and appSecret != ''">app_secret ,</if>
<if test="corpid != null and corpid != ''">corpId ,</if>
<if test="agentid != null and agentid != ''">agentId ,</if>
<if test="appId != null and appId != ''">app_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
@ -231,10 +222,8 @@
<if test="appSecret != null and appSecret != ''">#{appSecret} ,</if>
<if test="corpid != null and corpid != ''">#{corpid} ,</if>
<if test="agentid != null and agentid != ''">#{agentid} ,</if>
<if test="appId != null and appId != ''">#{appId} ,</if>
<if test="sorts == null ">
COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_application_account a WHERE
a.sts = 'Y' ),1),
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_application_account a
WHERE a.sts = 'Y' )1),
</if>
<if test="sts == null ">'Y',</if>
</trim>
@ -295,7 +284,6 @@
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="dbType != null and dbType != ''">db_type = #{dbType},</if>
<if test="appId != null and appId != ''">app_id = #{appId},</if>
<if test="appKey != null and appKey != ''">app_key = #{appKey},</if>
<if test="appSecret != null and appSecret != ''">app_secret = #{appSecret},</if>
<if test="corpid != null and corpid != ''">corpId = #{corpid},</if>
@ -330,7 +318,6 @@
<if test="appKey != null and appKey != ''">and app_key = #{appKey}</if>
<if test="appSecret != null and appSecret != ''">and app_secret = #{appSecret}</if>
<if test="corpid != null and corpid != ''">and corpId = #{corpid}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="agentid != null and agentid != ''">and agentId = #{agentid}</if>
and sts='Y'
</trim>

View File

@ -1,21 +1,15 @@
package com.hzya.frame.sysnew.application.appAcount.service.impl;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.application.appAcount.entity.SysApplicationAccountEntity;
import com.hzya.frame.sysnew.application.appAcount.dao.ISysApplicationAccountDao;
import com.hzya.frame.sysnew.application.appAcount.service.ISysApplicationAccountService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 应用账户表(SysApplicationAccount)表服务实现类
*
@ -47,11 +41,6 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
}catch (Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
//控制一下名字不能重复
List<SysApplicationAccountEntity> queryList = queryByName(entity);
if (CollectionUtils.isNotEmpty(queryList) && queryList.size() > 0){
return BaseResult.getFailureMessageEntity(entity.getName()+"重复");
}
sysApplicationAccountDao.save(entity);
return BaseResult.getSuccessMessageEntity("新增成功");
}
@ -64,23 +53,7 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
*/
@Override
public JsonResultEntity updateAccount(JSONObject object) {
SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class);
try {
checkParam(entity,"update");
}catch (Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
//检查一下名字不能重复
List<SysApplicationAccountEntity> queryList = queryByName(entity);
if (CollectionUtils.isNotEmpty(queryList) && queryList.size() > 0){
for (SysApplicationAccountEntity acc : queryList) {
if (!acc.getId().equals(entity.getId())){
return BaseResult.getFailureMessageEntity(entity.getName()+"重复");
}
}
}
sysApplicationAccountDao.update(entity);
return BaseResult.getSuccessMessageEntity("更新成功");
return null;
}
/**
@ -91,14 +64,7 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
*/
@Override
public JsonResultEntity deleteAccount(JSONObject object) {
SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class);
try {
checkParam(entity,"delete");
}catch (Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysApplicationAccountDao.logicRemove(entity);
return BaseResult.getSuccessMessageEntity("删除成功");
return null;
}
/**
@ -109,14 +75,7 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
*/
@Override
public JsonResultEntity getAccount(JSONObject object) {
SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class);
try {
checkParam(entity,"get");
}catch (Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysApplicationAccountEntity sysApplicationAccountEntity = sysApplicationAccountDao.get(entity.getId());
return BaseResult.getSuccessMessageEntity("查询账户详情成功",sysApplicationAccountEntity);
return null;
}
/**
@ -127,14 +86,7 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
*/
@Override
public JsonResultEntity queryAccountList(JSONObject object) {
SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class);
try {
checkParam(entity,"queryList");
}catch (Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
List<SysApplicationAccountEntity> queryList = sysApplicationAccountDao.query(entity);
return BaseResult.getSuccessMessageEntity("查询列表成功",queryList);
return null;
}
/**
@ -145,43 +97,11 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
*/
@Override
public JsonResultEntity queryAccountPaged(JSONObject object) {
SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class);
try {
checkParam(entity,"queryPaged");
}catch (Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return null;
}
//根据账户名称查询
private List<SysApplicationAccountEntity> queryByName(SysApplicationAccountEntity entity){
if (StrUtil.isNotEmpty(entity.getName())){
SysApplicationAccountEntity account = new SysApplicationAccountEntity();
account.setName(entity.getName());
List<SysApplicationAccountEntity> queryList = sysApplicationAccountDao.query(account);
return queryList;
}
return null;
}
//数据检查
private void checkParam(SysApplicationAccountEntity entity,String type){
Assert.notNull(entity,"参数不能为空");
if ("save".equals(type)){
Assert.notEmpty(entity.getAppId(),"appId不能为空");
Assert.notEmpty(entity.getName(),"账户名称不能为空");
}else if ("update".equals(type)){
Assert.notEmpty(entity.getId(),"id不能为空");
}else if ("delete".equals(type)){
Assert.notEmpty(entity.getId(),"id不能为空");
}else if ("get".equals(type)){
Assert.notEmpty(entity.getId(),"id不能为空");
}else if ("queryList".equals(type)){
Assert.notEmpty(entity.getAppId(),"appId不能为空");
}else if ("queryPaged".equals(type)){
Assert.notNull(entity.getPageNum(),"pageNum不能为空");
Assert.notNull(entity.getPageSize(),"pageSize不能为空");
}
}
}

View File

@ -23,11 +23,11 @@
<!-- <artifactId>fw-bip</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-cbs</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-cbs</artifactId>
<version>${revision}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-dd</artifactId>-->
@ -44,21 +44,21 @@
<!-- <artifactId>fw-nc</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-ncc</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-ncc</artifactId>
<version>${revision}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-ningbobank</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-oa</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-oa</artifactId>
<version>${revision}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-u8</artifactId>-->

48
fw-cbs/pom.xml Normal file
View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>kangarooDataCenterV3</artifactId>
<groupId>com.hzya.frame</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fw-cbs</artifactId>
<packaging>jar</packaging>
<version>${revision}</version>
<dependencies>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>base-service</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法为了解决Unable to find main class的问题 -->
<classifier>execute</classifier> <!-- 为了解决依赖模块找不到此模块中的类或属性 -->
<skip>true</skip>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,32 @@
package com.hzya.frame.cbs8.dto.req;
import java.util.List;
/**
* @Description 代发代扣请求参数
* @Author xiangerlin
* @Date 2024/6/18 16:20
**/
public class AgentPayRequestDTO {
//代发表头
private PaymentApplySubmitReqDTO paymentApplySubmitReqDTO;
//代发明细
private List<PaymentApplyAgentDTO> paymentApplyAgentDTO;
public PaymentApplySubmitReqDTO getPaymentApplySubmitReqDTO() {
return paymentApplySubmitReqDTO;
}
public void setPaymentApplySubmitReqDTO(PaymentApplySubmitReqDTO paymentApplySubmitReqDTO) {
this.paymentApplySubmitReqDTO = paymentApplySubmitReqDTO;
}
public List<PaymentApplyAgentDTO> getPaymentApplyAgentDTO() {
return paymentApplyAgentDTO;
}
public void setPaymentApplyAgentDTO(List<PaymentApplyAgentDTO> paymentApplyAgentDTO) {
this.paymentApplyAgentDTO = paymentApplyAgentDTO;
}
}

View File

@ -0,0 +1,20 @@
package com.hzya.frame.cbs8.dto.req;
/**
* @Description 代发代扣详情查询请求参数
* @Author xiangerlin
* @Date 2024/6/18 17:40
**/
public class AgentPayResultRequestDTO {
//申请单编号 代发代扣支付接口会返回这个单号的
private String busNum;
public String getBusNum() {
return busNum;
}
public void setBusNum(String busNum) {
this.busNum = busNum;
}
}

View File

@ -0,0 +1,134 @@
package com.hzya.frame.cbs8.dto.req;
import java.util.List;
/**
* @Description 电子回单查询请求参数
* @Author xiangerlin
* @Date 2024/1/4 17:08
**/
public class ElecRequestDTO {
// 开始日期
private String startDate;
// 结束日期
private String endDate;
// 账号
private String accountNo;
// 币种列表
private List<String> currencyList;
// 银行类型列表
private List<String> bankTypeList;
// 回单文件状态 1-已取回 0-未取回
private String billStatus;
// 借贷 1- 2-
private String loanType;
// 单位编码列表
private List<String> unitCodeList;
// 对账码列表
private List<String> checkCodeList;
// ERP业务参考号
private String settleBusinessReferenceCode;
public ElecRequestDTO(String settleBusinessReferenceCode) {
this.settleBusinessReferenceCode = settleBusinessReferenceCode;
}
public ElecRequestDTO(String startDate, String endDate, String settleBusinessReferenceCode) {
this.startDate = startDate;
this.endDate = endDate;
this.settleBusinessReferenceCode = settleBusinessReferenceCode;
}
public ElecRequestDTO() {
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getAccountNo() {
return accountNo;
}
public void setAccountNo(String accountNo) {
this.accountNo = accountNo;
}
public List<String> getCurrencyList() {
return currencyList;
}
public void setCurrencyList(List<String> currencyList) {
this.currencyList = currencyList;
}
public List<String> getBankTypeList() {
return bankTypeList;
}
public void setBankTypeList(List<String> bankTypeList) {
this.bankTypeList = bankTypeList;
}
public String getBillStatus() {
return billStatus;
}
public void setBillStatus(String billStatus) {
this.billStatus = billStatus;
}
public String getLoanType() {
return loanType;
}
public void setLoanType(String loanType) {
this.loanType = loanType;
}
public List<String> getUnitCodeList() {
return unitCodeList;
}
public void setUnitCodeList(List<String> unitCodeList) {
this.unitCodeList = unitCodeList;
}
public List<String> getCheckCodeList() {
return checkCodeList;
}
public void setCheckCodeList(List<String> checkCodeList) {
this.checkCodeList = checkCodeList;
}
public String getSettleBusinessReferenceCode() {
return settleBusinessReferenceCode;
}
public void setSettleBusinessReferenceCode(String settleBusinessReferenceCode) {
this.settleBusinessReferenceCode = settleBusinessReferenceCode;
}
}

View File

@ -0,0 +1,272 @@
package com.hzya.frame.cbs8.dto.req;
/**
* @Description 经办支付请求DTO
* @Author xiangerlin
* @Date 2024/1/3 09:02
**/
public class PayRequestDTO {
private String referenceNum;//业务参考号必填
private String busType;//业务类型 必填
private String amount;//金额 必填
private String currency;//币种编码必填
private String payAccount;//付款账号非集中支付模式必填
private String revAccount;//收款账号 必填
private String revAccountName;//收款方户名 必填
private String revBankType;//收款银行类型编码必填
private String revBankName;//收款开户行名称
private String cnapsCode;//联行号 必填
private String purpose;//支付用途 必填
private String innerAccount;//内部账号
private String revBankArea;//收款银行地区名称
private String revProvince;//收款人省
private String revCity;//收款人市
private String bankNum;//收款地区码银行号
private String summary;//该笔支付备注
private String expectTime;//期望支付时间
private String personalFlag;//公私标记 1对私 0对公
private String urgentTag;//加急1加急0不加2特急
private String realTimeTag;//是否实时 1实时0落地
private String cityFlag;//同城标志 0同城1异地
private String payChannel;//支付渠道
private String busiStep;//业务步数 集中支付需要传1其他不用传
private String applyUnitCode;//申请人单位号集中支付必传
private String displayApplyUnitCode;//申请人单位号前端显示集中支付如果传了会将其转化为applyUnitCode
private String erpExtend1;//客户备用字段1
private String erpExtend2;//客户备用字段2
private String erpExtend3;//客户备用字段3
public String getReferenceNum() {
return referenceNum;
}
public void setReferenceNum(String referenceNum) {
this.referenceNum = referenceNum;
}
public String getBusType() {
return busType;
}
public void setBusType(String busType) {
this.busType = busType;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getPayAccount() {
return payAccount;
}
public void setPayAccount(String payAccount) {
this.payAccount = payAccount;
}
public String getRevAccount() {
return revAccount;
}
public void setRevAccount(String revAccount) {
this.revAccount = revAccount;
}
public String getRevAccountName() {
return revAccountName;
}
public void setRevAccountName(String revAccountName) {
this.revAccountName = revAccountName;
}
public String getRevBankType() {
return revBankType;
}
public void setRevBankType(String revBankType) {
this.revBankType = revBankType;
}
public String getRevBankName() {
return revBankName;
}
public void setRevBankName(String revBankName) {
this.revBankName = revBankName;
}
public String getCnapsCode() {
return cnapsCode;
}
public void setCnapsCode(String cnapsCode) {
this.cnapsCode = cnapsCode;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getInnerAccount() {
return innerAccount;
}
public void setInnerAccount(String innerAccount) {
this.innerAccount = innerAccount;
}
public String getRevBankArea() {
return revBankArea;
}
public void setRevBankArea(String revBankArea) {
this.revBankArea = revBankArea;
}
public String getRevProvince() {
return revProvince;
}
public void setRevProvince(String revProvince) {
this.revProvince = revProvince;
}
public String getRevCity() {
return revCity;
}
public void setRevCity(String revCity) {
this.revCity = revCity;
}
public String getBankNum() {
return bankNum;
}
public void setBankNum(String bankNum) {
this.bankNum = bankNum;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getExpectTime() {
return expectTime;
}
public void setExpectTime(String expectTime) {
this.expectTime = expectTime;
}
public String getPersonalFlag() {
return personalFlag;
}
public void setPersonalFlag(String personalFlag) {
this.personalFlag = personalFlag;
}
public String getUrgentTag() {
return urgentTag;
}
public void setUrgentTag(String urgentTag) {
this.urgentTag = urgentTag;
}
public String getRealTimeTag() {
return realTimeTag;
}
public void setRealTimeTag(String realTimeTag) {
this.realTimeTag = realTimeTag;
}
public String getCityFlag() {
return cityFlag;
}
public void setCityFlag(String cityFlag) {
this.cityFlag = cityFlag;
}
public String getPayChannel() {
return payChannel;
}
public void setPayChannel(String payChannel) {
this.payChannel = payChannel;
}
public String getBusiStep() {
return busiStep;
}
public void setBusiStep(String busiStep) {
this.busiStep = busiStep;
}
public String getApplyUnitCode() {
return applyUnitCode;
}
public void setApplyUnitCode(String applyUnitCode) {
this.applyUnitCode = applyUnitCode;
}
public String getDisplayApplyUnitCode() {
return displayApplyUnitCode;
}
public void setDisplayApplyUnitCode(String displayApplyUnitCode) {
this.displayApplyUnitCode = displayApplyUnitCode;
}
public String getErpExtend1() {
return erpExtend1;
}
public void setErpExtend1(String erpExtend1) {
this.erpExtend1 = erpExtend1;
}
public String getErpExtend2() {
return erpExtend2;
}
public void setErpExtend2(String erpExtend2) {
this.erpExtend2 = erpExtend2;
}
public String getErpExtend3() {
return erpExtend3;
}
public void setErpExtend3(String erpExtend3) {
this.erpExtend3 = erpExtend3;
}
}

View File

@ -0,0 +1,44 @@
package com.hzya.frame.cbs8.dto.req;
import java.util.List;
/**
* @Description 查询交易结果请求参数
* @Author xiangerlin
* @Date 2024/1/3 09:46
**/
public class PayResultRequestDTO {
public PayResultRequestDTO() {
}
public PayResultRequestDTO(String referenceNum) {
this.referenceNum = referenceNum;
}
private String referenceNum;//业务参考号必填
private List<String> statusList;//状态
private List<String> payStatusList;//支付状态
public String getReferenceNum() {
return referenceNum;
}
public void setReferenceNum(String referenceNum) {
this.referenceNum = referenceNum;
}
public List<String> getStatusList() {
return statusList;
}
public void setStatusList(List<String> statusList) {
this.statusList = statusList;
}
public List<String> getPayStatusList() {
return payStatusList;
}
public void setPayStatusList(List<String> payStatusList) {
this.payStatusList = payStatusList;
}
}

View File

@ -0,0 +1,132 @@
package com.hzya.frame.cbs8.dto.req;
/**
* @Description 代发代扣明细
* @Author xiangerlin
* @Date 2024/6/18 13:45
**/
public class PaymentApplyAgentDTO {
//每笔明细金额
private String dtlAmount;
//收款账号
private String dtlRevAccount;
//联行号 同行可不传跨行必传
private String dtlCnapsCode;
//收款账户名称
private String dtlRevName;
//收款开户行 ,如果传的联行号能匹配到对应到开户行cbs8会自动带出
private String dtlRevBankName;
//是否跨行 Y跨行 N同行
private String dtlBankFlag;
//明细用途
private String dtlPurpose;
//明细摘要
private String dtlRemark;
//收款账号银行号地区码
private String dtlRevBankArea;
//收款开户地
private String dtlRevBankCity;
//明细序号从1开始递增
private int dtlSeqNum;
//备用字段 一共6个
private String dtlExtend1;
public String getDtlAmount() {
return dtlAmount;
}
public void setDtlAmount(String dtlAmount) {
this.dtlAmount = dtlAmount;
}
public String getDtlRevAccount() {
return dtlRevAccount;
}
public void setDtlRevAccount(String dtlRevAccount) {
this.dtlRevAccount = dtlRevAccount;
}
public String getDtlCnapsCode() {
return dtlCnapsCode;
}
public void setDtlCnapsCode(String dtlCnapsCode) {
this.dtlCnapsCode = dtlCnapsCode;
}
public String getDtlRevName() {
return dtlRevName;
}
public void setDtlRevName(String dtlRevName) {
this.dtlRevName = dtlRevName;
}
public String getDtlRevBankName() {
return dtlRevBankName;
}
public void setDtlRevBankName(String dtlRevBankName) {
this.dtlRevBankName = dtlRevBankName;
}
public String getDtlBankFlag() {
return dtlBankFlag;
}
public void setDtlBankFlag(String dtlBankFlag) {
this.dtlBankFlag = dtlBankFlag;
}
public String getDtlPurpose() {
return dtlPurpose;
}
public void setDtlPurpose(String dtlPurpose) {
this.dtlPurpose = dtlPurpose;
}
public String getDtlRemark() {
return dtlRemark;
}
public void setDtlRemark(String dtlRemark) {
this.dtlRemark = dtlRemark;
}
public String getDtlRevBankArea() {
return dtlRevBankArea;
}
public void setDtlRevBankArea(String dtlRevBankArea) {
this.dtlRevBankArea = dtlRevBankArea;
}
public String getDtlRevBankCity() {
return dtlRevBankCity;
}
public void setDtlRevBankCity(String dtlRevBankCity) {
this.dtlRevBankCity = dtlRevBankCity;
}
public int getDtlSeqNum() {
return dtlSeqNum;
}
public void setDtlSeqNum(int dtlSeqNum) {
this.dtlSeqNum = dtlSeqNum;
}
public String getDtlExtend1() {
return dtlExtend1;
}
public void setDtlExtend1(String dtlExtend1) {
this.dtlExtend1 = dtlExtend1;
}
}

View File

@ -0,0 +1,245 @@
package com.hzya.frame.cbs8.dto.req;
/**
* @Description 批量代发代扣 203代发 201代扣
* @Author xiangerlin
* @Date 2024/6/18 11:58
**/
public class PaymentApplySubmitReqDTO {
//业务参考号
private String referenceNum;
/**
* 业务类型
* 201-代扣
* 203-代发
* 代发工资传203
*/
private String busType;
//总金额 小数位2位
private String amount;
//币种
private String currency;
//付款账号
private String payAccount;
//用途
private String purpose;
// 以上是必填字段
//备注
private String summary;
//期望支付时间
private String expectTime;
//公私标识 1对私 0对公
private String personalFlag;
//加急标志 1加急 0不加急
private String urgentTag;
//是否实时 1实时 0落地
private String realTimeTag;
/**
* 同城标志 0同城 1异地
* /付账号所属同一个城市为同城否则为异地
*/
private String cityFlag;
//银行备用字段 一共8个
private String bankExtend1;
private String bankExtend2;
private String bankExtend3;
private String bankExtend4;
private String bankExtend5;
private String bankExtend6;
private String bankExtend7;
private String bankExtend8;
//客户备用字段1
private String erpExtend1;
//客户备用字段1
private String erpExtend2;
//客户备用字段1
private String erpExtend3;
public String getReferenceNum() {
return referenceNum;
}
public void setReferenceNum(String referenceNum) {
this.referenceNum = referenceNum;
}
public String getBusType() {
return busType;
}
public void setBusType(String busType) {
this.busType = busType;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getPayAccount() {
return payAccount;
}
public void setPayAccount(String payAccount) {
this.payAccount = payAccount;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getExpectTime() {
return expectTime;
}
public void setExpectTime(String expectTime) {
this.expectTime = expectTime;
}
public String getPersonalFlag() {
return personalFlag;
}
public void setPersonalFlag(String personalFlag) {
this.personalFlag = personalFlag;
}
public String getUrgentTag() {
return urgentTag;
}
public void setUrgentTag(String urgentTag) {
this.urgentTag = urgentTag;
}
public String getRealTimeTag() {
return realTimeTag;
}
public void setRealTimeTag(String realTimeTag) {
this.realTimeTag = realTimeTag;
}
public String getCityFlag() {
return cityFlag;
}
public void setCityFlag(String cityFlag) {
this.cityFlag = cityFlag;
}
public String getBankExtend1() {
return bankExtend1;
}
public void setBankExtend1(String bankExtend1) {
this.bankExtend1 = bankExtend1;
}
public String getErpExtend1() {
return erpExtend1;
}
public void setErpExtend1(String erpExtend1) {
this.erpExtend1 = erpExtend1;
}
public String getErpExtend2() {
return erpExtend2;
}
public void setErpExtend2(String erpExtend2) {
this.erpExtend2 = erpExtend2;
}
public String getErpExtend3() {
return erpExtend3;
}
public void setErpExtend3(String erpExtend3) {
this.erpExtend3 = erpExtend3;
}
public String getBankExtend2() {
return bankExtend2;
}
public void setBankExtend2(String bankExtend2) {
this.bankExtend2 = bankExtend2;
}
public String getBankExtend3() {
return bankExtend3;
}
public void setBankExtend3(String bankExtend3) {
this.bankExtend3 = bankExtend3;
}
public String getBankExtend4() {
return bankExtend4;
}
public void setBankExtend4(String bankExtend4) {
this.bankExtend4 = bankExtend4;
}
public String getBankExtend5() {
return bankExtend5;
}
public void setBankExtend5(String bankExtend5) {
this.bankExtend5 = bankExtend5;
}
public String getBankExtend6() {
return bankExtend6;
}
public void setBankExtend6(String bankExtend6) {
this.bankExtend6 = bankExtend6;
}
public String getBankExtend7() {
return bankExtend7;
}
public void setBankExtend7(String bankExtend7) {
this.bankExtend7 = bankExtend7;
}
public String getBankExtend8() {
return bankExtend8;
}
public void setBankExtend8(String bankExtend8) {
this.bankExtend8 = bankExtend8;
}
}

View File

@ -0,0 +1,164 @@
package com.hzya.frame.cbs8.dto.req;
import java.util.List;
/**
* @Description 查询境内交易明细参数
* @Author xiangerlin
* @Date 2024/1/3 09:55
**/
public class TransactionDetailReqDTO {
private int currentPage;//当前页码 从1开始
private int pageSize;//本次查询的记录数最大1000条
private String startDate;//开始日期
private String endDate;//结束日期
private String dateType;//日期类型0交易日期1起息日期
private List<String> accountNoList;//账户列表
private List<String> bankTypeList;//银行类型列表
private List<String> currencyList;//币种列表
private String detailedSources;//明细来源
private String currentFlag;//明细类型
private String loanType;//借贷类型 1 2
private List<String> accountNatureList;//账户性质列表
private String bankSerialNumber;//银行流水号
private String transactionSerialNumber;//交易流水号
private List<String> unitCodeList ;//单位编码列表
private String erpSerialNumber ;//erp业务参考号
public TransactionDetailReqDTO() {
}
public TransactionDetailReqDTO(String startDate, String endDate) {
this.startDate = startDate;
this.endDate = endDate;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getDateType() {
return dateType;
}
public void setDateType(String dateType) {
this.dateType = dateType;
}
public List<String> getAccountNoList() {
return accountNoList;
}
public void setAccountNoList(List<String> accountNoList) {
this.accountNoList = accountNoList;
}
public List<String> getBankTypeList() {
return bankTypeList;
}
public void setBankTypeList(List<String> bankTypeList) {
this.bankTypeList = bankTypeList;
}
public List<String> getCurrencyList() {
return currencyList;
}
public void setCurrencyList(List<String> currencyList) {
this.currencyList = currencyList;
}
public String getDetailedSources() {
return detailedSources;
}
public void setDetailedSources(String detailedSources) {
this.detailedSources = detailedSources;
}
public String getCurrentFlag() {
return currentFlag;
}
public void setCurrentFlag(String currentFlag) {
this.currentFlag = currentFlag;
}
public String getLoanType() {
return loanType;
}
public void setLoanType(String loanType) {
this.loanType = loanType;
}
public List<String> getAccountNatureList() {
return accountNatureList;
}
public void setAccountNatureList(List<String> accountNatureList) {
this.accountNatureList = accountNatureList;
}
public String getBankSerialNumber() {
return bankSerialNumber;
}
public void setBankSerialNumber(String bankSerialNumber) {
this.bankSerialNumber = bankSerialNumber;
}
public String getTransactionSerialNumber() {
return transactionSerialNumber;
}
public void setTransactionSerialNumber(String transactionSerialNumber) {
this.transactionSerialNumber = transactionSerialNumber;
}
public List<String> getUnitCodeList() {
return unitCodeList;
}
public void setUnitCodeList(List<String> unitCodeList) {
this.unitCodeList = unitCodeList;
}
public String getErpSerialNumber() {
return erpSerialNumber;
}
public void setErpSerialNumber(String erpSerialNumber) {
this.erpSerialNumber = erpSerialNumber;
}
public int getCurrentPage() {
return currentPage;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
}

View File

@ -0,0 +1,280 @@
package com.hzya.frame.cbs8.dto.res;
/**
* @Description 代发代扣查询详情
* @Author xiangerlin
* @Date 2024/6/19 09:02
**/
public class AgentPayQueryDTO {
// 申请单编号
private String busNum;
// 代发/代扣明细序号
private String dtlSeqNum;
// 金额
private String dtlAmount; // 考虑到金额计算精度建议使用BigDecimal
// 收款人名称
private String dtlRevName;
// 收款人账号
private String dtlRevAccount;
// 收款人开户行
private String dtlRevBankName;
// 银行号
private String dtlBankNum;
// 联行号
private String dtlCnapsCode;
// 是否跨行Y开户行是招商银行N开户行是他行为空默认为招行
private String dtlBankFlag;
// 地区名称
private String dtlRevBankArea;
// 注释
private String dtlRemark;
// 状态
private String dtlStatus;
// 错误信息
private String dtlErrorMessage;
// 他行开户地
private String dtlRevBankCity;
// 备用字段1-6
private String dtlExtend1;
private String dtlExtend2;
private String dtlExtend3;
private String dtlExtend4;
private String dtlExtend5;
private String dtlExtend6;
// ERP备注1-3
private String dtlErpComment1;
private String dtlErpComment2;
private String dtlErpComment3;
// 用途
private String dtlPurpose;
// 银行支付时间
private String dtlPayTime;
// 实际扣款金额
private String dtlActualAmount;
public String getBusNum() {
return busNum;
}
public void setBusNum(String busNum) {
this.busNum = busNum;
}
public String getDtlSeqNum() {
return dtlSeqNum;
}
public void setDtlSeqNum(String dtlSeqNum) {
this.dtlSeqNum = dtlSeqNum;
}
public String getDtlAmount() {
return dtlAmount;
}
public void setDtlAmount(String dtlAmount) {
this.dtlAmount = dtlAmount;
}
public String getDtlRevName() {
return dtlRevName;
}
public void setDtlRevName(String dtlRevName) {
this.dtlRevName = dtlRevName;
}
public String getDtlRevAccount() {
return dtlRevAccount;
}
public void setDtlRevAccount(String dtlRevAccount) {
this.dtlRevAccount = dtlRevAccount;
}
public String getDtlRevBankName() {
return dtlRevBankName;
}
public void setDtlRevBankName(String dtlRevBankName) {
this.dtlRevBankName = dtlRevBankName;
}
public String getDtlBankNum() {
return dtlBankNum;
}
public void setDtlBankNum(String dtlBankNum) {
this.dtlBankNum = dtlBankNum;
}
public String getDtlCnapsCode() {
return dtlCnapsCode;
}
public void setDtlCnapsCode(String dtlCnapsCode) {
this.dtlCnapsCode = dtlCnapsCode;
}
public String getDtlBankFlag() {
return dtlBankFlag;
}
public void setDtlBankFlag(String dtlBankFlag) {
this.dtlBankFlag = dtlBankFlag;
}
public String getDtlRevBankArea() {
return dtlRevBankArea;
}
public void setDtlRevBankArea(String dtlRevBankArea) {
this.dtlRevBankArea = dtlRevBankArea;
}
public String getDtlRemark() {
return dtlRemark;
}
public void setDtlRemark(String dtlRemark) {
this.dtlRemark = dtlRemark;
}
public String getDtlStatus() {
return dtlStatus;
}
public void setDtlStatus(String dtlStatus) {
this.dtlStatus = dtlStatus;
}
public String getDtlErrorMessage() {
return dtlErrorMessage;
}
public void setDtlErrorMessage(String dtlErrorMessage) {
this.dtlErrorMessage = dtlErrorMessage;
}
public String getDtlRevBankCity() {
return dtlRevBankCity;
}
public void setDtlRevBankCity(String dtlRevBankCity) {
this.dtlRevBankCity = dtlRevBankCity;
}
public String getDtlExtend1() {
return dtlExtend1;
}
public void setDtlExtend1(String dtlExtend1) {
this.dtlExtend1 = dtlExtend1;
}
public String getDtlExtend2() {
return dtlExtend2;
}
public void setDtlExtend2(String dtlExtend2) {
this.dtlExtend2 = dtlExtend2;
}
public String getDtlExtend3() {
return dtlExtend3;
}
public void setDtlExtend3(String dtlExtend3) {
this.dtlExtend3 = dtlExtend3;
}
public String getDtlExtend4() {
return dtlExtend4;
}
public void setDtlExtend4(String dtlExtend4) {
this.dtlExtend4 = dtlExtend4;
}
public String getDtlExtend5() {
return dtlExtend5;
}
public void setDtlExtend5(String dtlExtend5) {
this.dtlExtend5 = dtlExtend5;
}
public String getDtlExtend6() {
return dtlExtend6;
}
public void setDtlExtend6(String dtlExtend6) {
this.dtlExtend6 = dtlExtend6;
}
public String getDtlErpComment1() {
return dtlErpComment1;
}
public void setDtlErpComment1(String dtlErpComment1) {
this.dtlErpComment1 = dtlErpComment1;
}
public String getDtlErpComment2() {
return dtlErpComment2;
}
public void setDtlErpComment2(String dtlErpComment2) {
this.dtlErpComment2 = dtlErpComment2;
}
public String getDtlErpComment3() {
return dtlErpComment3;
}
public void setDtlErpComment3(String dtlErpComment3) {
this.dtlErpComment3 = dtlErpComment3;
}
public String getDtlPurpose() {
return dtlPurpose;
}
public void setDtlPurpose(String dtlPurpose) {
this.dtlPurpose = dtlPurpose;
}
public String getDtlPayTime() {
return dtlPayTime;
}
public void setDtlPayTime(String dtlPayTime) {
this.dtlPayTime = dtlPayTime;
}
public String getDtlActualAmount() {
return dtlActualAmount;
}
public void setDtlActualAmount(String dtlActualAmount) {
this.dtlActualAmount = dtlActualAmount;
}
}

View File

@ -0,0 +1,450 @@
package com.hzya.frame.cbs8.dto.res;
import java.util.List;
/**
* @Description 代发代扣 返回参数对象
* @Author xiangerlin
* @Date 2024/6/19 08:53
**/
public class AgentPayResultResDTO {
// 支付的业务类型
private String busType;
// 申请单编号
private String busNum;
// 付款账户
private String payAccount;
// 付款账户名称
private String payAccountName;
// 付款账户开户行
private String payBankName;
// 付款银行类型
private String payBankType;
// 币种
private String currency;
// 金额
private String amount;
// 收款账户
private String revAccount;
// 收款账户名称
private String revAccountName;
// 收款开户行
private String revBankName;
// 收款银行类型
private String revBankType;
// 收款人省
private String revProvince;
// 对账码集合假设为String列表
private List<String> checkCodeList;
// 收款人市
private String revCity;
// 支付渠道
private String payChannel;
// 付款单提示信息/银行返回信息
private String errorMsg;
// 支付申请状态
private String status;
// 经办人ID
private String createBy;
// 经办人名称
private String createByName;
// 用途
private String purpose;
// 摘要/备注
private String summary;
// 期望支付时间
private String expectTime;
// 支付时间
private String payDate;
// 支付状态
private String payStatus;
// 客户备用字段1
private String erpExtend1;
// 客户备用字段2
private String erpExtend2;
// 客户备用字段3
private String erpExtend3;
// 计划流水号
private String planNumber;
// 资金预算编号
private String planItemCode;
// 预算项名称
private String planItemName;
// 预算所属单位编码
private String planUnitCode;
// 预算所属单位名称
private String planUnitName;
// 单位编码前端展示
private String displayUnitCode;
// 预算单位编码前端展示
private String displayPlanUnitCode;
// 经办用户单位编码前端展示
private String displayOperaterOrgCode;
// 付方单位编码前端展示
private String displayPayOrgCode;
// 客商编号
private String revCustomerCode;
// 结算方式
private String payType;
//代发代扣详情
private List<AgentPayQueryDTO> agentDetails;
public String getBusType() {
return busType;
}
public void setBusType(String busType) {
this.busType = busType;
}
public String getBusNum() {
return busNum;
}
public void setBusNum(String busNum) {
this.busNum = busNum;
}
public String getPayAccount() {
return payAccount;
}
public void setPayAccount(String payAccount) {
this.payAccount = payAccount;
}
public String getPayAccountName() {
return payAccountName;
}
public void setPayAccountName(String payAccountName) {
this.payAccountName = payAccountName;
}
public String getPayBankName() {
return payBankName;
}
public void setPayBankName(String payBankName) {
this.payBankName = payBankName;
}
public String getPayBankType() {
return payBankType;
}
public void setPayBankType(String payBankType) {
this.payBankType = payBankType;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public String getRevAccount() {
return revAccount;
}
public void setRevAccount(String revAccount) {
this.revAccount = revAccount;
}
public String getRevAccountName() {
return revAccountName;
}
public void setRevAccountName(String revAccountName) {
this.revAccountName = revAccountName;
}
public String getRevBankName() {
return revBankName;
}
public void setRevBankName(String revBankName) {
this.revBankName = revBankName;
}
public String getRevBankType() {
return revBankType;
}
public void setRevBankType(String revBankType) {
this.revBankType = revBankType;
}
public String getRevProvince() {
return revProvince;
}
public void setRevProvince(String revProvince) {
this.revProvince = revProvince;
}
public List<String> getCheckCodeList() {
return checkCodeList;
}
public void setCheckCodeList(List<String> checkCodeList) {
this.checkCodeList = checkCodeList;
}
public String getRevCity() {
return revCity;
}
public void setRevCity(String revCity) {
this.revCity = revCity;
}
public String getPayChannel() {
return payChannel;
}
public void setPayChannel(String payChannel) {
this.payChannel = payChannel;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getCreateByName() {
return createByName;
}
public void setCreateByName(String createByName) {
this.createByName = createByName;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getExpectTime() {
return expectTime;
}
public void setExpectTime(String expectTime) {
this.expectTime = expectTime;
}
public String getPayDate() {
return payDate;
}
public void setPayDate(String payDate) {
this.payDate = payDate;
}
public String getPayStatus() {
return payStatus;
}
public void setPayStatus(String payStatus) {
this.payStatus = payStatus;
}
public String getErpExtend1() {
return erpExtend1;
}
public void setErpExtend1(String erpExtend1) {
this.erpExtend1 = erpExtend1;
}
public String getErpExtend2() {
return erpExtend2;
}
public void setErpExtend2(String erpExtend2) {
this.erpExtend2 = erpExtend2;
}
public String getErpExtend3() {
return erpExtend3;
}
public void setErpExtend3(String erpExtend3) {
this.erpExtend3 = erpExtend3;
}
public String getPlanNumber() {
return planNumber;
}
public void setPlanNumber(String planNumber) {
this.planNumber = planNumber;
}
public String getPlanItemCode() {
return planItemCode;
}
public void setPlanItemCode(String planItemCode) {
this.planItemCode = planItemCode;
}
public String getPlanItemName() {
return planItemName;
}
public void setPlanItemName(String planItemName) {
this.planItemName = planItemName;
}
public String getPlanUnitCode() {
return planUnitCode;
}
public void setPlanUnitCode(String planUnitCode) {
this.planUnitCode = planUnitCode;
}
public String getPlanUnitName() {
return planUnitName;
}
public void setPlanUnitName(String planUnitName) {
this.planUnitName = planUnitName;
}
public String getDisplayUnitCode() {
return displayUnitCode;
}
public void setDisplayUnitCode(String displayUnitCode) {
this.displayUnitCode = displayUnitCode;
}
public String getDisplayPlanUnitCode() {
return displayPlanUnitCode;
}
public void setDisplayPlanUnitCode(String displayPlanUnitCode) {
this.displayPlanUnitCode = displayPlanUnitCode;
}
public String getDisplayOperaterOrgCode() {
return displayOperaterOrgCode;
}
public void setDisplayOperaterOrgCode(String displayOperaterOrgCode) {
this.displayOperaterOrgCode = displayOperaterOrgCode;
}
public String getDisplayPayOrgCode() {
return displayPayOrgCode;
}
public void setDisplayPayOrgCode(String displayPayOrgCode) {
this.displayPayOrgCode = displayPayOrgCode;
}
public String getRevCustomerCode() {
return revCustomerCode;
}
public void setRevCustomerCode(String revCustomerCode) {
this.revCustomerCode = revCustomerCode;
}
public String getPayType() {
return payType;
}
public void setPayType(String payType) {
this.payType = payType;
}
public List<AgentPayQueryDTO> getAgentDetails() {
return agentDetails;
}
public void setAgentDetails(List<AgentPayQueryDTO> agentDetails) {
this.agentDetails = agentDetails;
}
}

View File

@ -0,0 +1,458 @@
package com.hzya.frame.cbs8.dto.res;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import java.util.List;
/**
* @Description data节点
* @Author xiangerlin
* @Date 2024/1/2 09:26
**/
public class CbsResDataDTO {
private List<JSONObject> list;//明细数据
//------- 交易明细字段-----
private int endRow;
private Boolean hasNextPage;//是否有下一页
private Boolean hasPreviousPage;//是否有前一页
@JSONField(name = "isFirstPage")
private Boolean hasFirstPage;
@JSONField(name = "isLastPage")
private Boolean hasLastPage;
private int navigateFirstPage;
private int navigateLastPage;
private int navigatePages;
private int nextPage;
private int pageNum;
private int pageSize;
private int pages;
private int prePage;
private int size;
private int startRow;
private int total;
//------- 交易明细字段-----
//------经办支付返回参数------
private String busNum;//申请单编号
private String errorCode;//错误编码
private String errorMsg;//错误信息
private String freezeFlowNum;//内部户冻结流水号
private String recordNum;//批量经办序号
private String referenceNum;//业务参考号
private Boolean successed;//是否成功
//------经办支付返回参数------
//------查询交易结果返回参数-------
private String busType;//支付业务类型
private String payAccount;//付款账号
private String payAccountName;//付款户名
private String payBankName;//付款开户行名称
private String payBankType;//付款银行类型
private String currency;//币种
private String amount;//金额
private String revAccount;//收款账户
private String revAccountName;//收款账户名
private String revBankName;//收款开户行
private String revBankType;//收款银行类型
private String payChannel;//支付渠道
private String status;//支付申请单状态
private String payStatus;//支付状态
private String payDate;//支付时间
private String planNumber;//计划流水号
private String planItemCode;//资金预算编号
private String planItemName;//预算名称
private String erpExtend1;//客户备用字段1
private String erpExtend2;//客户备用字段1
private String erpExtend3;//客户备用字段1
//------查询交易结果返回参数-------
public List<JSONObject> getList() {
return list;
}
public void setList(List<JSONObject> list) {
this.list = list;
}
public int getEndRow() {
return endRow;
}
public void setEndRow(int endRow) {
this.endRow = endRow;
}
public Boolean getHasNextPage() {
return hasNextPage;
}
public void setHasNextPage(Boolean hasNextPage) {
this.hasNextPage = hasNextPage;
}
public Boolean getHasPreviousPage() {
return hasPreviousPage;
}
public void setHasPreviousPage(Boolean hasPreviousPage) {
this.hasPreviousPage = hasPreviousPage;
}
public Boolean getHasFirstPage() {
return hasFirstPage;
}
public void setHasFirstPage(Boolean hasFirstPage) {
this.hasFirstPage = hasFirstPage;
}
public Boolean getHasLastPage() {
return hasLastPage;
}
public void setHasLastPage(Boolean hasLastPage) {
this.hasLastPage = hasLastPage;
}
public int getNavigateFirstPage() {
return navigateFirstPage;
}
public void setNavigateFirstPage(int navigateFirstPage) {
this.navigateFirstPage = navigateFirstPage;
}
public int getNavigateLastPage() {
return navigateLastPage;
}
public void setNavigateLastPage(int navigateLastPage) {
this.navigateLastPage = navigateLastPage;
}
public int getNavigatePages() {
return navigatePages;
}
public void setNavigatePages(int navigatePages) {
this.navigatePages = navigatePages;
}
public int getNextPage() {
return nextPage;
}
public void setNextPage(int nextPage) {
this.nextPage = nextPage;
}
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPages() {
return pages;
}
public void setPages(int pages) {
this.pages = pages;
}
public int getPrePage() {
return prePage;
}
public void setPrePage(int prePage) {
this.prePage = prePage;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getStartRow() {
return startRow;
}
public void setStartRow(int startRow) {
this.startRow = startRow;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public String getBusNum() {
return busNum;
}
public void setBusNum(String busNum) {
this.busNum = busNum;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public String getFreezeFlowNum() {
return freezeFlowNum;
}
public void setFreezeFlowNum(String freezeFlowNum) {
this.freezeFlowNum = freezeFlowNum;
}
public String getRecordNum() {
return recordNum;
}
public void setRecordNum(String recordNum) {
this.recordNum = recordNum;
}
public String getReferenceNum() {
return referenceNum;
}
public void setReferenceNum(String referenceNum) {
this.referenceNum = referenceNum;
}
public Boolean getSuccessed() {
return successed;
}
public void setSuccessed(Boolean successed) {
this.successed = successed;
}
public String getBusType() {
return busType;
}
public void setBusType(String busType) {
this.busType = busType;
}
public String getPayAccount() {
return payAccount;
}
public void setPayAccount(String payAccount) {
this.payAccount = payAccount;
}
public String getPayAccountName() {
return payAccountName;
}
public void setPayAccountName(String payAccountName) {
this.payAccountName = payAccountName;
}
public String getPayBankName() {
return payBankName;
}
public void setPayBankName(String payBankName) {
this.payBankName = payBankName;
}
public String getPayBankType() {
return payBankType;
}
public void setPayBankType(String payBankType) {
this.payBankType = payBankType;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public String getRevAccount() {
return revAccount;
}
public void setRevAccount(String revAccount) {
this.revAccount = revAccount;
}
public String getRevAccountName() {
return revAccountName;
}
public void setRevAccountName(String revAccountName) {
this.revAccountName = revAccountName;
}
public String getRevBankName() {
return revBankName;
}
public void setRevBankName(String revBankName) {
this.revBankName = revBankName;
}
public String getRevBankType() {
return revBankType;
}
public void setRevBankType(String revBankType) {
this.revBankType = revBankType;
}
public String getPayChannel() {
return payChannel;
}
public void setPayChannel(String payChannel) {
this.payChannel = payChannel;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getPayStatus() {
return payStatus;
}
public void setPayStatus(String payStatus) {
this.payStatus = payStatus;
}
public String getPayDate() {
return payDate;
}
public void setPayDate(String payDate) {
this.payDate = payDate;
}
public String getPlanNumber() {
return planNumber;
}
public void setPlanNumber(String planNumber) {
this.planNumber = planNumber;
}
public String getPlanItemCode() {
return planItemCode;
}
public void setPlanItemCode(String planItemCode) {
this.planItemCode = planItemCode;
}
public String getPlanItemName() {
return planItemName;
}
public void setPlanItemName(String planItemName) {
this.planItemName = planItemName;
}
public String getErpExtend1() {
return erpExtend1;
}
public void setErpExtend1(String erpExtend1) {
this.erpExtend1 = erpExtend1;
}
public String getErpExtend2() {
return erpExtend2;
}
public void setErpExtend2(String erpExtend2) {
this.erpExtend2 = erpExtend2;
}
public String getErpExtend3() {
return erpExtend3;
}
public void setErpExtend3(String erpExtend3) {
this.erpExtend3 = erpExtend3;
}
/**
* 把json字符串转换成指定范型的list
* @param json
* @param list
* @param clazz
* @param <T>
*/
private static <T> void adaptAndAddToList(String json, List<Object> list, Class<T> clazz) {
JSONObject jsonObject = JSON.parseObject(json);
if (jsonObject.containsKey("list")) {
JSONArray listArray = jsonObject.getJSONArray("list");
for (Object item : listArray) {
JSONObject itemObject = (JSONObject) item;
// 适配不同类型的节点
list.add(JSON.toJavaObject(itemObject, clazz));
}
}
}
}

View File

@ -0,0 +1,44 @@
package com.hzya.frame.cbs8.dto.res;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import java.util.List;
/**
* @Description cbs响应DTO
* @Author xiangerlin
* @Date 2024/1/2 09:25
**/
public class CbsResponseDTO {
//private List<CbsResDataDTO> data;//数据
private List<JSONObject> data;//数据
private String code;//0表示成功
private String msg;//消息
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public List<JSONObject> getData() {
return data;
}
public void setData(List<JSONObject> data) {
this.data = data;
}
}

View File

@ -0,0 +1,305 @@
package com.hzya.frame.cbs8.dto.res;
/**
* @Description 电子回单查询返回参数
* @Author xiangerlin
* @Date 2024/1/4 17:13
**/
public class ElecResponseDTO {
// 账号
private String accountNo;
// 账号名称
private String accountName;
// 银行类型
private String bankType;
// 银行类型名称
private String bankTypeName;
// 开户行
private String openingBank;
// 交易日期
private String transactionDate;
// 电子回单文件状态
private String electronicBillStatus;
// 电子回单文件名称
private String billFileName;
// 回单文件下载地址
private String bucketFileUrl;
// 回单文件名称
private String bucketFileName;
// 回单类型
private String electronicBillType;
// 银行流水号
private String bankSerialNumber;
// 回单编号
private String printInstanceNumber;
// 币种
private String currency;
// 币种名称
private String currencyName;
// 借贷类型
private String loanType;
// 交易金额
private String transactionAmount;
// 对方账号
private String oppositeAccount;
// 对方账户名
private String oppositeAccountName;
// 对方开户地
private String oppositeOpeningPlace;
// 对方开户行
private String oppositeOpeningBank;
// 摘要
private String digest;
// 用途
private String purpose;
// 账户性质
private String accountNatureCode;
// 对账码
private String checkCode;
// 单位编码
private String unitCode;
// ERP业务参考号
private String settleBusinessReferenceCode;
public String getAccountNo() {
return accountNo;
}
public void setAccountNo(String accountNo) {
this.accountNo = accountNo;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public String getBankType() {
return bankType;
}
public void setBankType(String bankType) {
this.bankType = bankType;
}
public String getBankTypeName() {
return bankTypeName;
}
public void setBankTypeName(String bankTypeName) {
this.bankTypeName = bankTypeName;
}
public String getOpeningBank() {
return openingBank;
}
public void setOpeningBank(String openingBank) {
this.openingBank = openingBank;
}
public String getTransactionDate() {
return transactionDate;
}
public void setTransactionDate(String transactionDate) {
this.transactionDate = transactionDate;
}
public String getElectronicBillStatus() {
return electronicBillStatus;
}
public void setElectronicBillStatus(String electronicBillStatus) {
this.electronicBillStatus = electronicBillStatus;
}
public String getBillFileName() {
return billFileName;
}
public void setBillFileName(String billFileName) {
this.billFileName = billFileName;
}
public String getBucketFileUrl() {
return bucketFileUrl;
}
public void setBucketFileUrl(String bucketFileUrl) {
this.bucketFileUrl = bucketFileUrl;
}
public String getBucketFileName() {
return bucketFileName;
}
public void setBucketFileName(String bucketFileName) {
this.bucketFileName = bucketFileName;
}
public String getElectronicBillType() {
return electronicBillType;
}
public void setElectronicBillType(String electronicBillType) {
this.electronicBillType = electronicBillType;
}
public String getBankSerialNumber() {
return bankSerialNumber;
}
public void setBankSerialNumber(String bankSerialNumber) {
this.bankSerialNumber = bankSerialNumber;
}
public String getPrintInstanceNumber() {
return printInstanceNumber;
}
public void setPrintInstanceNumber(String printInstanceNumber) {
this.printInstanceNumber = printInstanceNumber;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getCurrencyName() {
return currencyName;
}
public void setCurrencyName(String currencyName) {
this.currencyName = currencyName;
}
public String getLoanType() {
return loanType;
}
public void setLoanType(String loanType) {
this.loanType = loanType;
}
public String getTransactionAmount() {
return transactionAmount;
}
public void setTransactionAmount(String transactionAmount) {
this.transactionAmount = transactionAmount;
}
public String getOppositeAccount() {
return oppositeAccount;
}
public void setOppositeAccount(String oppositeAccount) {
this.oppositeAccount = oppositeAccount;
}
public String getOppositeAccountName() {
return oppositeAccountName;
}
public void setOppositeAccountName(String oppositeAccountName) {
this.oppositeAccountName = oppositeAccountName;
}
public String getOppositeOpeningPlace() {
return oppositeOpeningPlace;
}
public void setOppositeOpeningPlace(String oppositeOpeningPlace) {
this.oppositeOpeningPlace = oppositeOpeningPlace;
}
public String getOppositeOpeningBank() {
return oppositeOpeningBank;
}
public void setOppositeOpeningBank(String oppositeOpeningBank) {
this.oppositeOpeningBank = oppositeOpeningBank;
}
public String getDigest() {
return digest;
}
public void setDigest(String digest) {
this.digest = digest;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getAccountNatureCode() {
return accountNatureCode;
}
public void setAccountNatureCode(String accountNatureCode) {
this.accountNatureCode = accountNatureCode;
}
public String getCheckCode() {
return checkCode;
}
public void setCheckCode(String checkCode) {
this.checkCode = checkCode;
}
public String getUnitCode() {
return unitCode;
}
public void setUnitCode(String unitCode) {
this.unitCode = unitCode;
}
public String getSettleBusinessReferenceCode() {
return settleBusinessReferenceCode;
}
public void setSettleBusinessReferenceCode(String settleBusinessReferenceCode) {
this.settleBusinessReferenceCode = settleBusinessReferenceCode;
}
}

View File

@ -0,0 +1,73 @@
package com.hzya.frame.cbs8.dto.res;
/**
* @Description 经办支付接口返回参数中的data节点
* @Author xiangerlin
* @Date 2024/1/3 14:35
**/
public class PayResponseDTO {
private String busNum;//申请单编号
private String errorCode;//错误编码
private String errorMsg;//错误信息
private String freezeFlowNum;//内部户冻结流水号
private String recordNum;//批量经办序号
private String referenceNum;//业务参考号
private Boolean successed;//是否成功
public String getBusNum() {
return busNum;
}
public void setBusNum(String busNum) {
this.busNum = busNum;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public String getFreezeFlowNum() {
return freezeFlowNum;
}
public void setFreezeFlowNum(String freezeFlowNum) {
this.freezeFlowNum = freezeFlowNum;
}
public String getRecordNum() {
return recordNum;
}
public void setRecordNum(String recordNum) {
this.recordNum = recordNum;
}
public String getReferenceNum() {
return referenceNum;
}
public void setReferenceNum(String referenceNum) {
this.referenceNum = referenceNum;
}
public Boolean getSuccessed() {
return successed;
}
public void setSuccessed(Boolean successed) {
this.successed = successed;
}
}

View File

@ -0,0 +1,890 @@
package com.hzya.frame.cbs8.dto.res;
/**
* @Description 交易结果查询data节点响应的参数
* @Author xiangerlin
* @Date 2024/1/3 15:45
**/
public class PayResultResDTO {
private String payDate;//支付日期
private String accountFlag;
private String agentDetails;
private String amount;
private String bankExtend1;
private String bankExtend10;
private String bankExtend11;
private String bankExtend2;
private String bankExtend3;
private String bankExtend4;
private String bankExtend5;
private String bankExtend6;
private String bankExtend7;
private String bankExtend8;
private String bankExtend9;
private String bankInterfaceType;
private String bankNum;
private String bankVersion;
private String batchNum;
private String busNum;
private String busType;
private String checkCodeList;
private String cityFlag;
private String cnapsCode;
private String createBy;
private String createByName;
private String createTime;
private String currency;
private String dealPeopleList;
private String detailNum;
private String erpExtend1;
private String erpExtend2;
private String erpExtend3;
private String errorMsg;
private String expectTime;
private String extend1;
private String extend2;
private String extend3;
private String extend4;
private String extend5;
private String freezeFlowNum;
private String freezeStatus;
private String id;
private String innerAccount;
private String innerAccountName;
private String inputType;
private String isDeleted;
private String isSaveRev;
private String lastPrintTime;
private String lastPrintUser;
private String operaterOrgCode;
private String operaterOrgCodeList;
private String operaterOrgName;
private String payAccount;
private String payAccountName;
private String payAccountSeq;
private String payBankName;
private String payBankType;
private String payChannel;
private String payOrgCode;
private String payOrgName;
private String payStatus;// 支付状态
private String paymentApplyUnionDTO;
private String personalFlag;
private String printTimes;
private String procInstId;
private String procStatus;
private String projectCode;
private String purpose;
private String realName;
private String realRevAccount;
private String realTimeTag;
private String referenceNum;
private String revAccount;
private String revAccountName;
private String revAccountSeq;
private String revBankArea;
private String revBankName;
private String revBankType;
private String revCity;
private String revProvince;
private String status;//支付申请状态
private String summary;
private String unitCode;
private String unitName;
private String updateBy;
private String updateTime;
private String urgentTag;
public String getAccountFlag() {
return accountFlag;
}
public void setAccountFlag(String accountFlag) {
this.accountFlag = accountFlag;
}
public String getAgentDetails() {
return agentDetails;
}
public void setAgentDetails(String agentDetails) {
this.agentDetails = agentDetails;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public String getBankExtend1() {
return bankExtend1;
}
public void setBankExtend1(String bankExtend1) {
this.bankExtend1 = bankExtend1;
}
public String getBankExtend10() {
return bankExtend10;
}
public void setBankExtend10(String bankExtend10) {
this.bankExtend10 = bankExtend10;
}
public String getBankExtend11() {
return bankExtend11;
}
public void setBankExtend11(String bankExtend11) {
this.bankExtend11 = bankExtend11;
}
public String getBankExtend2() {
return bankExtend2;
}
public void setBankExtend2(String bankExtend2) {
this.bankExtend2 = bankExtend2;
}
public String getBankExtend3() {
return bankExtend3;
}
public void setBankExtend3(String bankExtend3) {
this.bankExtend3 = bankExtend3;
}
public String getBankExtend4() {
return bankExtend4;
}
public void setBankExtend4(String bankExtend4) {
this.bankExtend4 = bankExtend4;
}
public String getBankExtend5() {
return bankExtend5;
}
public void setBankExtend5(String bankExtend5) {
this.bankExtend5 = bankExtend5;
}
public String getBankExtend6() {
return bankExtend6;
}
public void setBankExtend6(String bankExtend6) {
this.bankExtend6 = bankExtend6;
}
public String getBankExtend7() {
return bankExtend7;
}
public void setBankExtend7(String bankExtend7) {
this.bankExtend7 = bankExtend7;
}
public String getBankExtend8() {
return bankExtend8;
}
public void setBankExtend8(String bankExtend8) {
this.bankExtend8 = bankExtend8;
}
public String getBankExtend9() {
return bankExtend9;
}
public void setBankExtend9(String bankExtend9) {
this.bankExtend9 = bankExtend9;
}
public String getBankInterfaceType() {
return bankInterfaceType;
}
public void setBankInterfaceType(String bankInterfaceType) {
this.bankInterfaceType = bankInterfaceType;
}
public String getBankNum() {
return bankNum;
}
public void setBankNum(String bankNum) {
this.bankNum = bankNum;
}
public String getBankVersion() {
return bankVersion;
}
public void setBankVersion(String bankVersion) {
this.bankVersion = bankVersion;
}
public String getBatchNum() {
return batchNum;
}
public void setBatchNum(String batchNum) {
this.batchNum = batchNum;
}
public String getBusNum() {
return busNum;
}
public void setBusNum(String busNum) {
this.busNum = busNum;
}
public String getBusType() {
return busType;
}
public void setBusType(String busType) {
this.busType = busType;
}
public String getCheckCodeList() {
return checkCodeList;
}
public void setCheckCodeList(String checkCodeList) {
this.checkCodeList = checkCodeList;
}
public String getCityFlag() {
return cityFlag;
}
public void setCityFlag(String cityFlag) {
this.cityFlag = cityFlag;
}
public String getCnapsCode() {
return cnapsCode;
}
public void setCnapsCode(String cnapsCode) {
this.cnapsCode = cnapsCode;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getCreateByName() {
return createByName;
}
public void setCreateByName(String createByName) {
this.createByName = createByName;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getDealPeopleList() {
return dealPeopleList;
}
public void setDealPeopleList(String dealPeopleList) {
this.dealPeopleList = dealPeopleList;
}
public String getDetailNum() {
return detailNum;
}
public void setDetailNum(String detailNum) {
this.detailNum = detailNum;
}
public String getErpExtend1() {
return erpExtend1;
}
public void setErpExtend1(String erpExtend1) {
this.erpExtend1 = erpExtend1;
}
public String getErpExtend2() {
return erpExtend2;
}
public void setErpExtend2(String erpExtend2) {
this.erpExtend2 = erpExtend2;
}
public String getErpExtend3() {
return erpExtend3;
}
public void setErpExtend3(String erpExtend3) {
this.erpExtend3 = erpExtend3;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public String getExpectTime() {
return expectTime;
}
public void setExpectTime(String expectTime) {
this.expectTime = expectTime;
}
public String getExtend1() {
return extend1;
}
public void setExtend1(String extend1) {
this.extend1 = extend1;
}
public String getExtend2() {
return extend2;
}
public void setExtend2(String extend2) {
this.extend2 = extend2;
}
public String getExtend3() {
return extend3;
}
public void setExtend3(String extend3) {
this.extend3 = extend3;
}
public String getExtend4() {
return extend4;
}
public void setExtend4(String extend4) {
this.extend4 = extend4;
}
public String getExtend5() {
return extend5;
}
public void setExtend5(String extend5) {
this.extend5 = extend5;
}
public String getFreezeFlowNum() {
return freezeFlowNum;
}
public void setFreezeFlowNum(String freezeFlowNum) {
this.freezeFlowNum = freezeFlowNum;
}
public String getFreezeStatus() {
return freezeStatus;
}
public void setFreezeStatus(String freezeStatus) {
this.freezeStatus = freezeStatus;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getInnerAccount() {
return innerAccount;
}
public void setInnerAccount(String innerAccount) {
this.innerAccount = innerAccount;
}
public String getInnerAccountName() {
return innerAccountName;
}
public void setInnerAccountName(String innerAccountName) {
this.innerAccountName = innerAccountName;
}
public String getInputType() {
return inputType;
}
public void setInputType(String inputType) {
this.inputType = inputType;
}
public String getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(String isDeleted) {
this.isDeleted = isDeleted;
}
public String getIsSaveRev() {
return isSaveRev;
}
public void setIsSaveRev(String isSaveRev) {
this.isSaveRev = isSaveRev;
}
public String getLastPrintTime() {
return lastPrintTime;
}
public void setLastPrintTime(String lastPrintTime) {
this.lastPrintTime = lastPrintTime;
}
public String getLastPrintUser() {
return lastPrintUser;
}
public void setLastPrintUser(String lastPrintUser) {
this.lastPrintUser = lastPrintUser;
}
public String getOperaterOrgCode() {
return operaterOrgCode;
}
public void setOperaterOrgCode(String operaterOrgCode) {
this.operaterOrgCode = operaterOrgCode;
}
public String getOperaterOrgCodeList() {
return operaterOrgCodeList;
}
public void setOperaterOrgCodeList(String operaterOrgCodeList) {
this.operaterOrgCodeList = operaterOrgCodeList;
}
public String getOperaterOrgName() {
return operaterOrgName;
}
public void setOperaterOrgName(String operaterOrgName) {
this.operaterOrgName = operaterOrgName;
}
public String getPayAccount() {
return payAccount;
}
public void setPayAccount(String payAccount) {
this.payAccount = payAccount;
}
public String getPayAccountName() {
return payAccountName;
}
public void setPayAccountName(String payAccountName) {
this.payAccountName = payAccountName;
}
public String getPayAccountSeq() {
return payAccountSeq;
}
public void setPayAccountSeq(String payAccountSeq) {
this.payAccountSeq = payAccountSeq;
}
public String getPayBankName() {
return payBankName;
}
public void setPayBankName(String payBankName) {
this.payBankName = payBankName;
}
public String getPayBankType() {
return payBankType;
}
public void setPayBankType(String payBankType) {
this.payBankType = payBankType;
}
public String getPayChannel() {
return payChannel;
}
public void setPayChannel(String payChannel) {
this.payChannel = payChannel;
}
public String getPayOrgCode() {
return payOrgCode;
}
public void setPayOrgCode(String payOrgCode) {
this.payOrgCode = payOrgCode;
}
public String getPayOrgName() {
return payOrgName;
}
public void setPayOrgName(String payOrgName) {
this.payOrgName = payOrgName;
}
public String getPayStatus() {
return payStatus;
}
public void setPayStatus(String payStatus) {
this.payStatus = payStatus;
}
public String getPaymentApplyUnionDTO() {
return paymentApplyUnionDTO;
}
public void setPaymentApplyUnionDTO(String paymentApplyUnionDTO) {
this.paymentApplyUnionDTO = paymentApplyUnionDTO;
}
public String getPersonalFlag() {
return personalFlag;
}
public void setPersonalFlag(String personalFlag) {
this.personalFlag = personalFlag;
}
public String getPrintTimes() {
return printTimes;
}
public void setPrintTimes(String printTimes) {
this.printTimes = printTimes;
}
public String getProcInstId() {
return procInstId;
}
public void setProcInstId(String procInstId) {
this.procInstId = procInstId;
}
public String getProcStatus() {
return procStatus;
}
public void setProcStatus(String procStatus) {
this.procStatus = procStatus;
}
public String getProjectCode() {
return projectCode;
}
public void setProjectCode(String projectCode) {
this.projectCode = projectCode;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public String getRealRevAccount() {
return realRevAccount;
}
public void setRealRevAccount(String realRevAccount) {
this.realRevAccount = realRevAccount;
}
public String getRealTimeTag() {
return realTimeTag;
}
public void setRealTimeTag(String realTimeTag) {
this.realTimeTag = realTimeTag;
}
public String getReferenceNum() {
return referenceNum;
}
public void setReferenceNum(String referenceNum) {
this.referenceNum = referenceNum;
}
public String getRevAccount() {
return revAccount;
}
public void setRevAccount(String revAccount) {
this.revAccount = revAccount;
}
public String getRevAccountName() {
return revAccountName;
}
public void setRevAccountName(String revAccountName) {
this.revAccountName = revAccountName;
}
public String getRevAccountSeq() {
return revAccountSeq;
}
public void setRevAccountSeq(String revAccountSeq) {
this.revAccountSeq = revAccountSeq;
}
public String getRevBankArea() {
return revBankArea;
}
public void setRevBankArea(String revBankArea) {
this.revBankArea = revBankArea;
}
public String getRevBankName() {
return revBankName;
}
public void setRevBankName(String revBankName) {
this.revBankName = revBankName;
}
public String getRevBankType() {
return revBankType;
}
public void setRevBankType(String revBankType) {
this.revBankType = revBankType;
}
public String getRevCity() {
return revCity;
}
public void setRevCity(String revCity) {
this.revCity = revCity;
}
public String getRevProvince() {
return revProvince;
}
public void setRevProvince(String revProvince) {
this.revProvince = revProvince;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getUnitCode() {
return unitCode;
}
public void setUnitCode(String unitCode) {
this.unitCode = unitCode;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getUrgentTag() {
return urgentTag;
}
public void setUrgentTag(String urgentTag) {
this.urgentTag = urgentTag;
}
public String getPayDate() {
return payDate;
}
public void setPayDate(String payDate) {
this.payDate = payDate;
}
}

View File

@ -0,0 +1,207 @@
package com.hzya.frame.cbs8.dto.res;
/**
* @Description 境内账户交易明细
* @Author xiangerlin
* @Date 2023/12/29 16:40
**/
public class TransactionDetailDTO{
private String accountNo;//银行账号
private String accountName;//银行名称
private String bankType;//银行类型
private String openBank;//开户行名称
private String bankTransactionDate;//交易日期
private String bankSerialNumber;//银行流水号
private String transactionSerialNumber;//交易流水号
private String currency;//币种
private String loanType;//借贷类型
private String incurredAmount;//发生额
private String accountBalance;//交易后余额
private String purpose;//用途
private String digest;//摘要
private String oppositeAccount;//对方账号
private String oppositeName;//对方户名
private String oppositeOpeningBank;//对方开户行
private String associatedCustomerNumber;//关联客户号
private String merchantNumber;//客商编号
private String merchantName;//客商名称
private String transactionCode;//交易代码
private String remark;//备注
private String erpSerialNumber;//erp业务参考号
public String getAccountNo() {
return accountNo;
}
public void setAccountNo(String accountNo) {
this.accountNo = accountNo;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public String getBankType() {
return bankType;
}
public void setBankType(String bankType) {
this.bankType = bankType;
}
public String getOpenBank() {
return openBank;
}
public void setOpenBank(String openBank) {
this.openBank = openBank;
}
public String getBankTransactionDate() {
return bankTransactionDate;
}
public void setBankTransactionDate(String bankTransactionDate) {
this.bankTransactionDate = bankTransactionDate;
}
public String getBankSerialNumber() {
return bankSerialNumber;
}
public void setBankSerialNumber(String bankSerialNumber) {
this.bankSerialNumber = bankSerialNumber;
}
public String getTransactionSerialNumber() {
return transactionSerialNumber;
}
public void setTransactionSerialNumber(String transactionSerialNumber) {
this.transactionSerialNumber = transactionSerialNumber;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getLoanType() {
return loanType;
}
public void setLoanType(String loanType) {
this.loanType = loanType;
}
public String getIncurredAmount() {
return incurredAmount;
}
public void setIncurredAmount(String incurredAmount) {
this.incurredAmount = incurredAmount;
}
public String getAccountBalance() {
return accountBalance;
}
public void setAccountBalance(String accountBalance) {
this.accountBalance = accountBalance;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getDigest() {
return digest;
}
public void setDigest(String digest) {
this.digest = digest;
}
public String getOppositeAccount() {
return oppositeAccount;
}
public void setOppositeAccount(String oppositeAccount) {
this.oppositeAccount = oppositeAccount;
}
public String getOppositeName() {
return oppositeName;
}
public void setOppositeName(String oppositeName) {
this.oppositeName = oppositeName;
}
public String getOppositeOpeningBank() {
return oppositeOpeningBank;
}
public void setOppositeOpeningBank(String oppositeOpeningBank) {
this.oppositeOpeningBank = oppositeOpeningBank;
}
public String getAssociatedCustomerNumber() {
return associatedCustomerNumber;
}
public void setAssociatedCustomerNumber(String associatedCustomerNumber) {
this.associatedCustomerNumber = associatedCustomerNumber;
}
public String getMerchantNumber() {
return merchantNumber;
}
public void setMerchantNumber(String merchantNumber) {
this.merchantNumber = merchantNumber;
}
public String getMerchantName() {
return merchantName;
}
public void setMerchantName(String merchantName) {
this.merchantName = merchantName;
}
public String getTransactionCode() {
return transactionCode;
}
public void setTransactionCode(String transactionCode) {
this.transactionCode = transactionCode;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getErpSerialNumber() {
return erpSerialNumber;
}
public void setErpSerialNumber(String erpSerialNumber) {
this.erpSerialNumber = erpSerialNumber;
}
}

View File

@ -0,0 +1,327 @@
package com.hzya.frame.cbs8.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description
* @Author xiangerlin
* @Date 2024/6/6 16:17
**/
public class PaymentEntity extends BaseEntity {
private String oaId;//主表id
private String formsonId;//明细表id
private String payCompany;//付款公司
private String title;//流程标题
private String tableName;//表名称
private String billName;//单据名称
private String referenceNum;//业务参考号 唯一id
private String referenceNumNew;//重试的时候生成新的业务参考号
private String busType;//业务类型
private String payResultField;//支付结果字段
private String payDateField;//打款日期字段
private String applyCodeField;//支付申请单号字段
private String receiptFiled;//电子回单字段
private String summaryId;//summaryid
private String startDate;//单据日期
private String finishedflag;//流程状态
private String payDate;//打款日期
private String payResult;//支付结果
private String applyCode;//支付申请单号
private String payAccount;//付款账号
private String payBankName;//付款开户银行
private String amount;//金额
private String purpose;//支付用途
private String revAccount;//收款账号
private String revBankName;//收款开户行名称
private String revBankType;//收款银行类型
private String revAccountName;//收款账户名称
private String cnapsCode;//联行号
private String receipt;//电子回单
private String currency;//币种 数字
private String currencyName;//币种 中文
private String currencyCode;//币种编码
private String personalFlag;//公私标记
private String payType;//付款类别
private String payCompanyCode;//付款公司编码
public String getOaId() {
return oaId;
}
public void setOaId(String oaId) {
this.oaId = oaId;
}
public String getPayCompany() {
return payCompany;
}
public void setPayCompany(String payCompany) {
this.payCompany = payCompany;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getBillName() {
return billName;
}
public void setBillName(String billName) {
this.billName = billName;
}
public String getReferenceNum() {
return referenceNum;
}
public void setReferenceNum(String referenceNum) {
this.referenceNum = referenceNum;
}
public String getReferenceNumNew() {
return referenceNumNew;
}
public void setReferenceNumNew(String referenceNumNew) {
this.referenceNumNew = referenceNumNew;
}
public String getBusType() {
return busType;
}
public void setBusType(String busType) {
this.busType = busType;
}
public String getPayResultField() {
return payResultField;
}
public void setPayResultField(String payResultField) {
this.payResultField = payResultField;
}
public String getPayDateField() {
return payDateField;
}
public void setPayDateField(String payDateField) {
this.payDateField = payDateField;
}
public String getReceiptFiled() {
return receiptFiled;
}
public void setReceiptFiled(String receiptFiled) {
this.receiptFiled = receiptFiled;
}
public String getSummaryId() {
return summaryId;
}
public void setSummaryId(String summaryId) {
this.summaryId = summaryId;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getFinishedflag() {
return finishedflag;
}
public void setFinishedflag(String finishedflag) {
this.finishedflag = finishedflag;
}
public String getPayDate() {
return payDate;
}
public void setPayDate(String payDate) {
this.payDate = payDate;
}
public String getPayResult() {
return payResult;
}
public void setPayResult(String payResult) {
this.payResult = payResult;
}
public String getPayAccount() {
return payAccount;
}
public void setPayAccount(String payAccount) {
this.payAccount = payAccount;
}
public String getPayBankName() {
return payBankName;
}
public void setPayBankName(String payBankName) {
this.payBankName = payBankName;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getRevAccount() {
return revAccount;
}
public void setRevAccount(String revAccount) {
this.revAccount = revAccount;
}
public String getRevBankName() {
return revBankName;
}
public void setRevBankName(String revBankName) {
this.revBankName = revBankName;
}
public String getRevBankType() {
return revBankType;
}
public void setRevBankType(String revBankType) {
this.revBankType = revBankType;
}
public String getRevAccountName() {
return revAccountName;
}
public void setRevAccountName(String revAccountName) {
this.revAccountName = revAccountName;
}
public String getCnapsCode() {
return cnapsCode;
}
public void setCnapsCode(String cnapsCode) {
this.cnapsCode = cnapsCode;
}
public String getReceipt() {
return receipt;
}
public void setReceipt(String receipt) {
this.receipt = receipt;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getCurrencyName() {
return currencyName;
}
public void setCurrencyName(String currencyName) {
this.currencyName = currencyName;
}
public String getCurrencyCode() {
return currencyCode;
}
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
public String getPersonalFlag() {
return personalFlag;
}
public void setPersonalFlag(String personalFlag) {
this.personalFlag = personalFlag;
}
public String getPayType() {
return payType;
}
public void setPayType(String payType) {
this.payType = payType;
}
public String getPayCompanyCode() {
return payCompanyCode;
}
public void setPayCompanyCode(String payCompanyCode) {
this.payCompanyCode = payCompanyCode;
}
public String getFormsonId() {
return formsonId;
}
public void setFormsonId(String formsonId) {
this.formsonId = formsonId;
}
public String getApplyCodeField() {
return applyCodeField;
}
public void setApplyCodeField(String applyCodeField) {
this.applyCodeField = applyCodeField;
}
public String getApplyCode() {
return applyCode;
}
public void setApplyCode(String applyCode) {
this.applyCode = applyCode;
}
}

View File

@ -0,0 +1,60 @@
package com.hzya.frame.cbs8.service;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
/**
* @Description
* @Author xiangerlin
* @Date 2024/6/7 14:20
**/
public interface ICbs8ExtService {
/**
* 支付经办
* @param entity
* @return
*/
SysExtensionApiEntity payApply(SysExtensionApiEntity entity);
/**
* 代发代扣 支付申请
* @param entity
* @return
*/
SysExtensionApiEntity agentPayApply(SysExtensionApiEntity entity);
/**
* 交易结果查询
* @param entity
* @return
*/
SysExtensionApiEntity payResult(SysExtensionApiEntity entity);
/**
* 交易明细查询
* @param entity
* @return
*/
SysExtensionApiEntity transactionDetailQuery(SysExtensionApiEntity entity);
/**
* 代发代扣
* @param entity
* @return
*/
SysExtensionApiEntity payApplyAgent(SysExtensionApiEntity entity);
/**
* 代发代扣结果查询
* @param entity
* @return
*/
SysExtensionApiEntity payApplyAgentResult(SysExtensionApiEntity entity);
/**
* 电子回单查询
* @param entity
* @return
*/
SysExtensionApiEntity elecQuery(SysExtensionApiEntity entity);
}

View File

@ -0,0 +1,66 @@
package com.hzya.frame.cbs8.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.cbs8.dto.req.*;
import com.hzya.frame.cbs8.dto.res.*;
import com.hzya.frame.cbs8.entity.PaymentEntity;
import java.util.List;
/**
* @Description cbs8接口
* @Author xiangerlin
* @Date 2024/6/6 15:30
**/
public interface ICbs8Service {
/**
* 支付申请
* @param payJsonStr
*/
PayResponseDTO payApply(String payJsonStr);
/**
* 通过业务参考号查询交易结果 3.2.6
* @param resultRequestDTO
* @return
* @throws Exception
*/
List<PayResultResDTO> queryPayResult(PayResultRequestDTO resultRequestDTO);
/**
* 查询电子回单
* @param elecRequestDTO
* startDate 开始日期 - 必填
* endDate 结束日期 -必填
* billStatus 回单状态 1-已取回 0-未取回 只有已取回的才能下载
* settleBusinessReferenceCode 业务参考号
* @return List<ElecResponseDTO>
* bucketFileUrl 回单下载地址
* billFileName 回单文件名称
* settleBusinessReferenceCode 业务参考号
*/
List<ElecResponseDTO> queryElecBill(ElecRequestDTO elecRequestDTO);
/**
* 查询交易明细
* @param transactionDetailReqDTO
* @return
*/
CbsResDataDTO queryTransactionDetail(TransactionDetailReqDTO transactionDetailReqDTO);
/**
* 代发代扣 支付申请
* @param paymentApplySubmitReqDTO
* @param paymentApplyAgentList
*/
PayResponseDTO agentPayApply(PaymentApplySubmitReqDTO paymentApplySubmitReqDTO, List<PaymentApplyAgentDTO> paymentApplyAgentList);
/**
* 代发代扣 详情查询
* @param agentPayResultRequestDTO
* @return
*/
AgentPayResultResDTO agentPayResult(AgentPayResultRequestDTO agentPayResultRequestDTO);
}

View File

@ -0,0 +1,216 @@
package com.hzya.frame.cbs8.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.cbs8.dto.req.*;
import com.hzya.frame.cbs8.entity.PaymentEntity;
import com.hzya.frame.cbs8.service.ICbs8ExtService;
import com.hzya.frame.cbs8.util.CBSUtil;
import com.hzya.frame.cbs8.util.CbsAccessToken;
import com.hzya.frame.stringutil.StringUtil;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.http.protocol.HTTP;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @Description
* @Author xiangerlin
* @Date 2024/6/7 14:20
**/
@Service(value = "cbs8Ext")
public class Cbs8ExtServiceImpl implements ICbs8ExtService {
Logger logger = LoggerFactory.getLogger(getClass());
/**
* 支付经办
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity payApply(SysExtensionApiEntity entity) {
String bodys = entity.getBodys();
if (StrUtil.isNotEmpty(bodys)){
PaymentEntity paymentEntity = JSONObject.parseObject(bodys,PaymentEntity.class);
if (null != paymentEntity){
PayRequestDTO payRequestDTO = new PayRequestDTO();
String ferenceNum = Convert.toStr(paymentEntity.getReferenceNumNew(),paymentEntity.getReferenceNum());
payRequestDTO.setReferenceNum(ferenceNum);
payRequestDTO.setBusType(paymentEntity.getBusType());
payRequestDTO.setAmount(paymentEntity.getAmount());
payRequestDTO.setCurrency(paymentEntity.getCurrency());
payRequestDTO.setPayAccount(StringUtil.replaceBlank(paymentEntity.getPayAccount()));
payRequestDTO.setRevAccount(StringUtil.replaceBlank(paymentEntity.getRevAccount()));
payRequestDTO.setRevAccountName(StringUtil.replaceBlank(paymentEntity.getRevAccountName()));
payRequestDTO.setRevBankType(StringUtil.replaceBlank((paymentEntity.getRevBankType())));
payRequestDTO.setRevBankName(StringUtil.replaceBlank(paymentEntity.getRevBankName()));
payRequestDTO.setCnapsCode(StringUtil.replaceBlank((paymentEntity.getCnapsCode())));
payRequestDTO.setPurpose(paymentEntity.getPurpose());
payRequestDTO.setErpExtend1(paymentEntity.getPayType());
//集中支付模式
if (CBSUtil.CENTRALIZED_PAYMENT_TYPE.equals(payRequestDTO.getBusType())){
payRequestDTO.setBusiStep("1");
payRequestDTO.setApplyUnitCode(paymentEntity.getPayCompanyCode());
payRequestDTO.setPayAccount(null);
}
List<PayRequestDTO> list = Arrays.asList(payRequestDTO);
String requestData = JSONObject.toJSONString(list);
//加密 签名
encrypAndsign(entity,requestData);
}
}
return entity;
}
/**
* 代发代扣 支付申请
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity agentPayApply(SysExtensionApiEntity entity) {
String boyds = entity.getBodys();
if (StrUtil.isNotEmpty(boyds)){
AgentPayRequestDTO agentPayRequest = JSONObject.parseObject(boyds,AgentPayRequestDTO.class);
String requestData = JSONObject.toJSONString(agentPayRequest);
//加密签名
encrypAndsign(entity, requestData);
}
return entity;
}
/**
* 交易结果查询
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity payResult(SysExtensionApiEntity entity) {
String bodys = entity.getBodys();
if (StrUtil.isNotEmpty(bodys)){
PayResultRequestDTO payResultRequest = JSONObject.parseObject(bodys,PayResultRequestDTO.class);
if (null != payResultRequest && StrUtil.isNotEmpty(payResultRequest.getReferenceNum())){
String requestData = JSONObject.toJSONString(payResultRequest);
//加密 签名
encrypAndsign(entity,requestData);
}else {
throw new BaseSystemException("业务参考号不能为空!!!!");
}
}
return entity;
}
/**
* 交易明细查询
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity transactionDetailQuery(SysExtensionApiEntity entity) {
String bodys = entity.getBodys();
if (StrUtil.isNotEmpty(bodys)){
TransactionDetailReqDTO transactionDetailReqDTO = JSONObject.parseObject(bodys,TransactionDetailReqDTO.class);
String requestData = JSONObject.toJSONString(transactionDetailReqDTO);
////加密签名
encrypAndsign(entity, requestData);
}
return entity;
}
/**
* 代发代扣
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity payApplyAgent(SysExtensionApiEntity entity) {
String bodys = entity.getBodys();
if (StrUtil.isNotEmpty(bodys)){
AgentPayRequestDTO agentPayRequest = JSONObject.parseObject(bodys,AgentPayRequestDTO.class);
String requestData = JSONObject.toJSONString(agentPayRequest);
////加密签名
encrypAndsign(entity, requestData);
}
return entity;
}
/**
* 代发代扣结果查询
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity payApplyAgentResult(SysExtensionApiEntity entity) {
String bodys = entity.getBodys();
if (StrUtil.isNotEmpty(bodys)){
AgentPayResultRequestDTO agentPayResultRequestDTO = JSONObject.parseObject(bodys,AgentPayResultRequestDTO.class);
String requestData = JSONObject.toJSONString(agentPayResultRequestDTO);
encrypAndsign(entity,requestData);
}
return entity;
}
/**
* 电子回单查询
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity elecQuery(SysExtensionApiEntity entity) {
String bodys = entity.getBodys();
if (StrUtil.isNotEmpty(bodys)){
ElecRequestDTO elecRequestDTO = JSONObject.parseObject(bodys,ElecRequestDTO.class);
String requestData = JSONObject.toJSONString(elecRequestDTO);
//加密 签名
encrypAndsign(entity,requestData);
}
return entity;
}
/**
* 请求头
* @param sign
* @param timestamp
* @return
*/
private Map<String,String> headersValueOf(String sign, long timestamp){
Map<String,String> header = new HashMap();
header.put(CBSUtil.SIGN_HEADER_NAME,sign);
header.put(CBSUtil.TIMESTAMP_HEADER,Long.toString(timestamp));
header.put(HTTP.CONTENT_TYPE,CBSUtil.TARGET_CONTENT_TYPE);
header.put(CBSUtil.AUTHORIZATION,CBSUtil.BEARER+ CbsAccessToken.getToken());
return header;
}
/**
* 加密 签名
* @param entity 接口转发参数对象
* @param requestData 请求参数json字符串
*/
private void encrypAndsign(SysExtensionApiEntity entity, String requestData) {
//签名
long timestamp = System.currentTimeMillis();
logger.info("CBS请求参数明文:{}",requestData);
String sign = CBSUtil.sign(requestData,timestamp);
//加密
byte[] encryptedData = CBSUtil.encrypt(requestData);
Map<String,String> header = headersValueOf(sign,timestamp);
entity.setByteBodys(encryptedData);
entity.setHeaders(header);
}
}

View File

@ -0,0 +1,271 @@
package com.hzya.frame.cbs8.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapBuilder;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.hzya.frame.cbs8.dto.req.*;
import com.hzya.frame.cbs8.dto.res.*;
import com.hzya.frame.cbs8.entity.PaymentEntity;
import com.hzya.frame.cbs8.service.ICbs8Service;
import com.hzya.frame.cbs8.util.CBSUtil;
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.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Map;
/**
* @Description cbs8接口
* @Author xiangerlin
* @Date 2024/6/7 14:44
**/
@Service
public class Cbs8ServiceImpl implements ICbs8Service {
Logger logger = LoggerFactory.getLogger(getClass());
@Value("${zt.url}")
private String zt_url;
@Override
public PayResponseDTO payApply(String payJsonStr) {
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", "8000260001")
.put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")
.put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
.put("appId","800026")
.build();
String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(payJsonStr).timeout(60000).execute().body();
//解密响应报文
String result = decryptResBody(body);
if (StrUtil.isNotEmpty(result)){
CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
List<JSONObject> dataList = cbsResponseDTO.getData();
if (CollectionUtils.isNotEmpty(dataList)){
JSONObject o = dataList.get(0);
PayResponseDTO payResponseDTO = JSON.toJavaObject(o, PayResponseDTO.class);
return payResponseDTO;
}
}
return new PayResponseDTO();
}
/**
* 通过业务参考号查询交易结果 3.2.6
*
* @param resultRequestDTO
* @return
* @throws Exception
*/
@Override
public List<PayResultResDTO> queryPayResult(PayResultRequestDTO resultRequestDTO) {
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", "8000260002")
.put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")
.put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
.put("appId","800026")
.build();
String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(JSONObject.toJSONString(resultRequestDTO)).timeout(60000).execute().body();
String result = decryptResBody(body);
CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
if (CollectionUtils.isNotEmpty(cbsResponseDTO.getData())){
List<JSONObject> dataList = cbsResponseDTO.getData();
List<PayResultResDTO> payResultList = CBSUtil.convertJsonArrayToList(dataList, PayResultResDTO.class);
return payResultList;
}
return new ArrayList<PayResultResDTO>();
}
/**
* 查询电子回单
*
* @param elecRequestDTO startDate 开始日期 - 必填
* endDate 结束日期 -必填
* billStatus 回单状态 1-已取回 0-未取回 只有已取回的才能下载
* settleBusinessReferenceCode 业务参考号
* @return List<ElecResponseDTO>
* bucketFileUrl 回单下载地址
* billFileName 回单文件名称
* settleBusinessReferenceCode 业务参考号
*/
@Override
public List<ElecResponseDTO> queryElecBill(ElecRequestDTO elecRequestDTO) {
if (null == elecRequestDTO){
elecRequestDTO = new ElecRequestDTO();
}
if (StrUtil.isEmpty(elecRequestDTO.getStartDate())){
elecRequestDTO.setStartDate(DateUtil.today());
}
if (StrUtil.isEmpty(elecRequestDTO.getEndDate())){
elecRequestDTO.setEndDate(DateUtil.today());
}
String params = JSON.toJSONString(elecRequestDTO, SerializerFeature.WRITE_MAP_NULL_FEATURES, SerializerFeature.QuoteFieldNames);
logger.info("电子回单查询请求参数为:{}", params);
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", "8000260005")
.put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")
.put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
.put("appId","800026")
.build();
String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(params).timeout(60000).execute().body();
String result = decryptResBody(body);
if (StrUtil.isNotEmpty(result)){
CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
if (null != cbsResponseDTO){
if (CollectionUtils.isNotEmpty(cbsResponseDTO.getData())){
List<JSONObject> dataList = cbsResponseDTO.getData();
if (CollectionUtils.isNotEmpty(dataList)){
JSONObject jsonObject = dataList.get(0);
CbsResDataDTO dataDTO = JSON.toJavaObject(jsonObject, CbsResDataDTO.class);
List<ElecResponseDTO> elecResponseDTOList = CBSUtil.convertJsonArrayToList(dataDTO.getList(), ElecResponseDTO.class);
return elecResponseDTOList;
}
}
}
}
return null;
}
/**
* 查询交易明细
*
* @param transactionDetailReqDTO
* @return
*/
@Override
public CbsResDataDTO queryTransactionDetail(TransactionDetailReqDTO transactionDetailReqDTO) {
//页码
int currentPage = transactionDetailReqDTO.getCurrentPage();
//每页条数
int pageSize = transactionDetailReqDTO.getPageSize();
if (currentPage == 0){
currentPage = CBSUtil.DEFAULT_CURRENT_PAGE;
transactionDetailReqDTO.setCurrentPage(currentPage);//页码
}
if (pageSize == 0){
pageSize = CBSUtil.DEFAULT_PAGE_SIZE;
transactionDetailReqDTO.setPageSize(pageSize);
}
if (StrUtil.isNotEmpty(transactionDetailReqDTO.getStartDate())){
transactionDetailReqDTO.setStartDate(DateUtil.today());
}
if (StrUtil.isNotEmpty(transactionDetailReqDTO.getEndDate())){
transactionDetailReqDTO.setEndDate(DateUtil.today());
}
String params = JSON.toJSONString(transactionDetailReqDTO);
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", "8000260006")
.put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")
.put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
.put("appId","800026")
.build();
String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(params).timeout(60000).execute().body();
String result = decryptResBody(body);
if (StrUtil.isNotEmpty(result)){
CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
if (null != cbsResponseDTO){
if (CollectionUtils.isNotEmpty(cbsResponseDTO.getData())){
List<JSONObject> list = cbsResponseDTO.getData();
if (CollectionUtils.isNotEmpty(list)){
JSONObject jsonObject = list.get(0);
CbsResDataDTO dataDTO = JSON.toJavaObject(jsonObject, CbsResDataDTO.class);
return dataDTO;
}
}
}
}
return new CbsResDataDTO();
}
/**
* 代发代扣 支付申请
* @param paymentApplySubmitReqDTO
* @param paymentApplyAgentList
*/
@Override
public PayResponseDTO agentPayApply(PaymentApplySubmitReqDTO paymentApplySubmitReqDTO, List<PaymentApplyAgentDTO> paymentApplyAgentList) {
AgentPayRequestDTO param = new AgentPayRequestDTO();
param.setPaymentApplySubmitReqDTO(paymentApplySubmitReqDTO);
param.setPaymentApplyAgentDTO(paymentApplyAgentList);
String params = JSON.toJSONString(param);
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", "8000260003")
.put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")
.put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
.put("appId","800026")
.build();
String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(params).timeout(60000).execute().body();
String result = decryptResBody(body);
if (StrUtil.isNotEmpty(result)){
CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
List<JSONObject> dataList = cbsResponseDTO.getData();
if (CollectionUtils.isNotEmpty(dataList)){
JSONObject o = dataList.get(0);
PayResponseDTO payResponseDTO = JSON.toJavaObject(o, PayResponseDTO.class);
return payResponseDTO;
}
}
return new PayResponseDTO();
}
/**
* 代发代扣 详情查询
*
* @param agentPayResultRequestDTO
* @return
*/
@Override
public AgentPayResultResDTO agentPayResult(AgentPayResultRequestDTO agentPayResultRequestDTO) {
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", "8000260004")//数智办公
.put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//数智财资
.put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
.put("appId","800026")
.build();
String params = JSON.toJSONString(agentPayResultRequestDTO);
String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(params).timeout(60000).execute().body();
//解密报文
String result = decryptResBody(body);
if (StrUtil.isNotEmpty(result)){
CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class);
List<JSONObject> dataList = cbsResponseDTO.getData();
if (CollectionUtils.isNotEmpty(dataList)){
JSONObject o = dataList.get(0);
AgentPayResultResDTO agentPayResultResDTO = JSON.toJavaObject(o, AgentPayResultResDTO.class);
return agentPayResultResDTO;
}
}
return new AgentPayResultResDTO();
}
/**
* 解密响应报文
* @param body
* @return
*/
private String decryptResBody(String body){
if (StrUtil.isNotEmpty(body)){
JsonResultEntity resultEntity = JSONObject.parseObject(body,JsonResultEntity.class);
String bodyBase64 = String.valueOf(resultEntity.getAttribute());
byte[] bodyBytes = Base64.getDecoder().decode(bodyBase64);
//这里验证一下如果系统异常 返回的报文没加密
String test = new String(bodyBytes);
if (JSONUtil.isTypeJSON(test)){
return test;
}
//解密报文
String result = CBSUtil.decrypt(bodyBytes);
logger.info("银行响应参数:{}",result);
return result;
}
return null;
}
}

View File

@ -0,0 +1,187 @@
package com.hzya.frame.cbs8.util;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import org.apache.commons.codec.binary.Base64;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* @Description
* @Author xiangerlin
* @Date 2024/6/7 15:38
**/
@Component
public class CBSUtil {
/**
* 集中支付模式
*/
public static final String CENTRALIZED_PAYMENT_TYPE = "401";
/**
* 分页查询 最大条数
*/
public static final int MAX_PAGE_SIZE = 1000;
/**
* 默认分页查询条数
*/
public static final int DEFAULT_PAGE_SIZE = 100;
/**
* 默认页码
*/
public static final int DEFAULT_CURRENT_PAGE = 1;
static Logger logger = LogManager.getLogger(CBSUtil.class);
/**
* 请求参数格式
*/
public static String TARGET_CONTENT_TYPE = "application/json";
/**
* 签名请求头参数名
*/
public static String SIGN_HEADER_NAME = "X-MBCLOUD-API-SIGN";
/**
* 时间戳请求头参数名
*/
public static String TIMESTAMP_HEADER = "X-MBCLOUD-TIMESTAMP";
public static String ENCRYPTION_ENABLED_HEADER_NAME = "X-MBCLOUD-ENCRYPTION-ENABLED";
public static String X_MBCLOUD_COMPRESS = "X-Mbcloud-Compress";
/**
* 请求头token参数名
*/
public static String AUTHORIZATION = "Authorization";
/**
*token前缀
*/
public static String BEARER = "Bearer ";
/**
* 财资管理云公钥(平台公钥)
*/
public static String bodyEncryptionKey;
/**
* 企业私钥加密
*/
public static String signEncryptionPrivateKey;
/**
* 企业私钥解密
*/
public static String bodyDecryptionKey;
/**
* 财资管理云公钥(平台公钥)
*/
@Value("${cbs8.cbs_public_key:}")
public void setBodyEncryptionKey(String bodyEncryptionKey) {
CBSUtil.bodyEncryptionKey = bodyEncryptionKey;
}
/**
* 企业私钥解密
*/
@Value("${cbs8.ya_private_key:}")
public void setSignEncryptionPrivateKey(String signEncryptionPrivateKey) {
CBSUtil.signEncryptionPrivateKey = signEncryptionPrivateKey;
}
/**
* 企业私钥解密
*/
@Value("${cbs8.ya_private_key:}")
public void setBodyDecryptionKey(String bodyDecryptionKey) {
CBSUtil.bodyDecryptionKey = bodyDecryptionKey;
}
//将json数组转为list
public static <T> List<T> convertJsonArrayToList(List<JSONObject> list, Class<T> clazz) {
String jsonArray = JSON.toJSONString(list);
List<T> result = JSON.parseObject(jsonArray, new TypeReference<List<T>>(clazz) {});
return result;
}
/**
* 将时间戳转换成日期字符串
* @param timestamp
* @return
*/
public static String convertTimestampToString(String timestamp) {
if (StrUtil.isNotEmpty(timestamp) && NumberUtil.isNumber(timestamp)){
// 创建SimpleDateFormat对象指定日期时间格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 将时间戳转换为Date对象
Date date = new Date(Long.valueOf(timestamp));
// 使用SimpleDateFormat格式化Date对象得到字符串表示
return sdf.format(date);
}
return null;
}
/**
* 签名
* @param requestData
* @return
*/
public static String sign(String requestData){
long timestamp = System.currentTimeMillis();
return sign(requestData,timestamp);
}
/**
* 签名
* @param requestData
* @param timestamp
* @return
*/
public static String sign(String requestData,long timestamp){
// 请求数据拼接 报文体+时间戳
byte[] requestDataBytes = requestData.getBytes(StandardCharsets.UTF_8);
byte[] timestampBytes = ("&timestamp=" + timestamp).getBytes(StandardCharsets.UTF_8);
byte[] newBytes = new byte[requestDataBytes.length + timestampBytes.length];
System.arraycopy(requestDataBytes, 0, newBytes, 0, requestDataBytes.length);
System.arraycopy(timestampBytes, 0, newBytes, requestDataBytes.length, timestampBytes.length);
// 生成签名
byte[] signature = SM2Util.sign(signEncryptionPrivateKey, newBytes);
String sign = Base64.encodeBase64String(SM2Util.encodeDERSignature(signature));
logger.info("签名:{}", sign);
return sign;
}
/**
* 加密
* @param requestData
* @return
*/
public static byte[] encrypt(String requestData){
byte[] encrypt = SM2Util.encrypt(bodyEncryptionKey, requestData.getBytes(StandardCharsets.UTF_8));
return encrypt;
}
public static String decrypt(byte[] cipherData){
try {
byte[] decrypt = SM2Util.decrypt(bodyDecryptionKey, cipherData);
String text = new String(decrypt);
return text;
}catch (Exception e){
logger.error("解密失败",e);
e.printStackTrace();
}
return null;
}
}

View File

@ -0,0 +1,140 @@
package com.hzya.frame.cbs8.util;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.action.ApplicationContextUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.relational.core.sql.In;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;
/**
* @Description cbs token
* @Author xiangerlin
* @Date 2024/6/7 15:56
**/
@Component
public class CbsAccessToken {
private static final Logger logger = LoggerFactory.getLogger(CbsAccessToken.class);
@Value("${cbs8.appId:}")
private String app_id;
@Value("${cbs8.appSecret:}")
private String app_secret;
@Value("${cbs8.url:}")
private String app_url;
private static String appId;
private static String appSecret;
private static String url;
@PostConstruct
public void init() {
appId = app_id;
appSecret = app_secret;
url = app_url;
}
//刷新token用
private static final String BEARER = "Bearer ";
/**
* 过期时间
*/
private Long expiryTime ;
private String token;
private CbsAccessToken(){
}
private static CbsAccessToken cbsAccessToken = new CbsAccessToken();
public static CbsAccessToken getInstance() {
if (null == cbsAccessToken.token){
initToken();
}else {
//判断token有没有过期
if (System.currentTimeMillis() >= cbsAccessToken.expiryTime){
initToken();
}else {
refreshToken();
}
}
return cbsAccessToken;
}
public static String getToken(){
return getInstance().token;
}
/**
* 获取token
*/
private static void initToken(){
CbsAccessToken ct = (CbsAccessToken) ApplicationContextUtil.getBeanByName("cbsAccessToken");
logger.info("开始获取cbstoken");
Map<String,String> param = new HashMap<>();
param.put("app_id",ct.appId);
param.put("app_secret",ct.appSecret);
param.put("grant_type","client_credentials");
String res = HttpRequest.post(ct.url+"/openapi/app/v1/app/token").body(JSONObject.toJSONString(param)).execute().body();
logger.info("获取cbstoken结果",res);
if (StrUtil.isNotEmpty(res) && JSONUtil.isTypeJSON(res)){
JSONObject tokenObject = JSONObject.parseObject(res);
String code = tokenObject.getString("code");//0表示成功
if ("0".equals(code)){
JSONObject dataObj = tokenObject.getJSONObject("data");
if (null != dataObj){
String token = dataObj.getString("token");
//过期时间 单位是秒 30分钟有效
Integer expires = dataObj.getInteger("expires");
cbsAccessToken.token = token;
//提前5分钟让token失效 所以这里设置成过期时间为当前时间+25分钟
cbsAccessToken.expiryTime = System.currentTimeMillis()+1000*60*25L;
}
}
}
}
/**
* 刷新token
*/
private static void refreshToken(){
CbsAccessToken ct = (CbsAccessToken) ApplicationContextUtil.getBeanByName("cbsAccessToken");
//token不为空并且没过期 刷新token
if (null != cbsAccessToken.token && System.currentTimeMillis() < cbsAccessToken.expiryTime ){
String res = HttpRequest.get(ct.url + "/openapi/app/v1/app/refresh-token").header("Authorization", BEARER + cbsAccessToken.token).execute().body();
logger.info("刷新cbstoken结果",res);
if (StrUtil.isNotEmpty(res) && JSONUtil.isTypeJSON(res)){
JSONObject tokenObject = JSONObject.parseObject(res);
String code = tokenObject.getString("code");//0表示成功
if ("0".equals(code)){
JSONObject dataObj = tokenObject.getJSONObject("data");
if (null != dataObj){
//续期的token
String token = dataObj.getString("token");
//新token过期时间 单位是秒 30分钟有效
Integer expires = dataObj.getInteger("expires");
cbsAccessToken.token = token;
//提前5分钟让token失效 所以这里设置成过期时间为当前时间+25分钟
cbsAccessToken.expiryTime = System.currentTimeMillis()+1000*60*25L;
}
}else {
initToken();
}
}
}else {
initToken();
}
}
public static void main(String[] args) {
System.out.println("第1次取token"+getToken());
System.out.println("第2次取token"+getToken());
System.out.println("第3次取token"+getToken());
}
}

View File

@ -0,0 +1,137 @@
package com.hzya.frame.cbs8.util;
/**
* @Description 币种枚举表
* @Author xiangerlin
* @Date 2024/6/25 10:20
**/
public enum CurrencyEnum {
CNY("10", "人民币", "CNY", ""),
ASF("11", "记帐瑞士法朗", "ASF", "ASF"),
BRL("12", "巴西里亚尔", "BRL", "BRL"),
IDR("13", "印度尼西亚卢比", "IDR", "rps"),
INR("14", "印度卢比", "INR", "rs"),
IRR("15", "伊朗里亚尔", "IRR", "ri"),
JOD("16", "约旦第纳尔", "JOD", "jdr"),
KRW("17", "韩国圆", "KRW", "$"),
KWD("18", "科威特第纳尔", "KWD", "kd"),
MOP("19", "澳门元", "MOP", "pat"),
MXN("20", "墨西哥比索", "MXN", "mex$"),
HKD("21", "港币", "HKD", "HK$"),
MYR("22", "马来西亚林吉特", "MYR", "m$"),
NPR("23", "尼泊尔卢比", "NPR", "nrs"),
NZD("24", "新西兰元", "NZD", "$nz"),
PHP("25", "菲律宾比索", "PHP", "phil"),
PKR("26", "巴基斯坦卢比", "PKR", "prs"),
RUB("27", "俄罗斯卢布", "RUB", "RUB"),
AUD("29", "澳元", "AUD", "A$"),
THB("30", "泰国铢", "THB", "bt"),
TWD("31", "台湾元", "TWD", "$"),
USD("32", "美元", "USD", "US$"),
TZS("33", "坦桑尼亚先令", "TZS", "tsh"),
EUR("35", "欧元", "EUR", "EUR"),
CAD("39", "加拿大元", "CAD", "CAN$"),
GBP("43", "英镑", "GBP", ""),
JPY("65", "日元", "JPY", "J"),
SGD("69", "新加坡元", "SGD", "S$"),
NOK("83", "挪威克朗", "NOK", "nkr"),
DKK("85", "丹麦克朗", "DKK", "DKr"),
AED("86", "阿联酋迪拉姆", "AED", "AED"),
CHF("87", "瑞士法朗", "CHF", "SF"),
SEK("88", "瑞典克朗", "SEK", "SKR"),
ZAR("89", "南非兰特", "ZAR", "ZAR"),
AOA("71", "安哥拉宽扎", "AOA", "kz"),
DZD("72", "阿尔及利亚第纳尔", "DZD", "AD."),
GHS("73", "塞地", "GHS", ""),
KES("74", "肯尼亚先令", "KES", "K.Sh"),
NGN("75", "奈拉", "NGN", "N"),
QAR("76", "卡塔尔里亚尔", "QAR", "QR."),
VND("77", "越南盾", "VND", "D."),
PES("78", "新索尔", "PES", "S/."),
PLZ("79", "兹罗提", "PLZ", "ZL."),
TRY("80", "土耳其镑", "TRY", "£T."),
SAR("81", "亚尔", "SAR", "SAR."),
KZT("82", "哈萨克斯坦腾格", "KZT", ""),
CDF("90", "刚果法郎", "CDF", "FC"),
LYD("91", "利比亚第纳尔", "LYD", "LD."),
EGP("92", "埃及镑", "EGP", "£E."),
VEF("93", "委内瑞拉玻利瓦尔", "VEF", "B"),
OMR("94", "阿曼里尔", "OMR", "RO."),
PLN("95", "波兰兹罗提", "PLN", "Zl"),
HUF("96", "匈牙利福林", "HUF", "Ft"),
BDT("97", "孟加拉塔卡", "BDT", "TK"),
LAK("98", "老挝基普", "LAK", "K"),
ZMW("37", "赞比亚克瓦查", "ZMW", "ZM"),
ETB("28", "埃塞俄比亚比尔", "ETB", "Br"),
PRK("34", "巴基斯坦卢比", "PRK", "Rs."),
BND("36", "文莱元", "BND", "B$"),
XOF("38", "西非法郎", "XOF", "XOF"),
PGK("41", "巴布亚新几内亚基纳", "PGK", "PGK"),
LKR("40", "斯里兰卡卢比", "LKR", "LK"),
GNF("46", "几内亚法郎", "GNF", "GNF"),
TND("42", "突尼斯第纳尔", "TND", "TN"),
UZS("44", "乌兹别克斯坦苏姆", "UZS", "UZ"),
XAF("45", "中非法郎", "XAF", "XA"),
SDG("49", "苏丹磅", "SDG", "£S"),
GE("47", "格鲁吉亚拉里", "GEL", "GE"),
MN("48", "蒙图", "MNT", "MN"),
TJS("50", "塔吉克索莫尼", "TJS", "TJS"),
UGX("51", "乌干达先令", "UGX", "UGX"),
CLP("52", "智利比索", "CLP", "CLP"),
MMK("53", "缅元", "MMK", "MMK"),
KHR("54", "柬埔寨瑞尔", "KHR", "KHR"),
BHD("55", "巴林第纳尔", "BHD", "BHD"),
RSD("56", "塞尔维亚第纳尔", "RSD", "RSD"),
KGS("57", "吉尔吉斯斯坦索姆", "KGS", "KGS"),
COP("58", "哥伦比亚比索", "COP", "COP"),
GYD("59", "圭亚那元", "GYD", "GYD"),
ARS("60", "阿根廷比索", "ARS", "ARS"),
CZK("61", "捷克克朗", "CZK", "CZK"),
PEN("62", "秘鲁索尔", "PEN", "PEN"),
RON("63", "罗马尼亚列伊", "RON", "RON"),
UAH("64", "乌克兰格里夫纳", "UAH", "UAH"),
ILS("66", "以色列新谢克尔", "ILS", "ILS"),
IQD("67", "伊拉克第纳尔", "IQD", "IQD"),
ERN("68", "厄立特里亚纳克法", "ERN", "ERN"),
CNH("84", "离岸人民币", "CNH", "CNH"),
MKD("99", "马其顿第纳尔", "MKD", "MKD");
private final String code;
private final String chineseName;
private final String internationalCode;
private final String symbol;
CurrencyEnum(String code, String chineseName, String internationalCode, String symbol) {
this.code = code;
this.chineseName = chineseName;
this.internationalCode = internationalCode;
this.symbol = symbol;
}
public String getCode() {
return code;
}
public String getChineseName() {
return chineseName;
}
public String getInternationalCode() {
return internationalCode;
}
public String getSymbol() {
return symbol;
}
//根据币种code获取币种中文名
public static String getChineseNameByCode(String code) {
for (CurrencyEnum currency : values()) {
if (currency.code.equals(code)) {
return currency.chineseName;
}
}
return null; // 或者抛出异常表示找不到对应的币种
}
}

View File

@ -0,0 +1,73 @@
package com.hzya.frame.cbs8.util;
/**
* @Author:hecan
* @Description:支付类型(支付状态)
* @params:
* @return:
* @Date: 2023/3/14 15:05
*/
public enum PayState {
a("a","待提交直联"),
b("b","已提交直联"),
c("c","银行已受理"),
d("d","银行未受理"),
e("e","可疑"),
f("f","待人工确认"),
g("g","支付成功"),
h("h","支付失败"),
i("i","部分成功"),
j("j","退票"),
k("k","取消支付"),
n("n","其他"),
p("p","支付中"),
q("q","待支付"),
one("1","待处理"),
two("2","审批中"),
three("3","处理失败"),
four("4","审批完成"),
five("5","审批撤销"),
six("6","审批拒绝"),
seven("7","待发送审批"),
eight("8","集中受理中"),
nine("9","审批退回"),
ten("10","预处理中"),
eleven("11","预处理拒绝"),
twelve("12","资金监控审批中");
//类型
private String type;
//
private String value;
PayState(String type, String value){
this.type=type;
this.value=value;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static String payStateGetValue(String type){
for (PayState payState : PayState.values()){
if(payState.getType()==type||payState.getType().equals(type)){
return payState.getValue().toString();
}
}
return null;
}
}

View File

@ -0,0 +1,237 @@
package com.hzya.frame.cbs8.util;
import org.bouncycastle.asn1.*;
import org.bouncycastle.crypto.engines.SM2Engine;
import org.bouncycastle.crypto.params.*;
import org.bouncycastle.crypto.signers.SM2Signer;
import org.bouncycastle.jce.ECNamedCurveTable;
import org.bouncycastle.jce.spec.ECParameterSpec;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECPoint;
import org.bouncycastle.util.encoders.Hex;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayInputStream;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.Base64;
import java.util.Enumeration;
/**
* @author: xiang2lin
* @time: 2024/6/14
* @description: SM2加解密工具类
*/
public class SM2Util {
static Logger logger = LoggerFactory.getLogger(SM2Util.class);
private SM2Util() {
throw new IllegalStateException("Utility class");
}
private static final String STD_NAME = "sm2p256v1";
/**
* SM2加密算法
*
* @param publicKey 公钥
* @param data 明文数据
* @return
*/
public static byte[] encrypt(String publicKey, byte[] data) {
ECPublicKeyParameters ecPublicKeyParameters = encodePublicKey(Hex.decode(publicKey));
SM2Engine engine = new SM2Engine();
engine.init(true, new ParametersWithRandom(ecPublicKeyParameters, new SecureRandom()));
byte[] bytes = null;
try {
byte[] cipherText = engine.processBlock(data, 0, data.length);
bytes = C1C2C3ToC1C3C2(cipherText);
} catch (Exception e) {
logger.warn("SM2加密时出现异常:" + e.getMessage());
}
return bytes;
}
/**
* SM2解密算法
*
* @param privateKey 私钥
* @param cipherData 密文数据
* @return
*/
public static byte[] decrypt(String privateKey, byte[] cipherData) {
ECPrivateKeyParameters ecPrivateKeyParameters = encodePrivateKey(Hex.decode(privateKey));
SM2Engine engine = new SM2Engine();
engine.init(false, ecPrivateKeyParameters);
byte[] bytes = null;
try {
cipherData = C1C3C2ToC1C2C3(cipherData);
bytes = engine.processBlock(cipherData, 0, cipherData.length);
} catch (Exception e) {
logger.warn("SM2解密时出现异常:" + e.getMessage());
}
return bytes;
}
/**
* 签名算法
*
* @param privateKey 私钥
* @param data 明文数据
* @return
*/
public static byte[] sign(String privateKey, byte[] data) {
ECPrivateKeyParameters ecPrivateKeyParameters = encodePrivateKey(hexToByte(privateKey));
SM2Signer signer = new SM2Signer();
ParametersWithID parameters = new ParametersWithID(ecPrivateKeyParameters, "1234567812345678".getBytes());
signer.init(true, parameters);
signer.update(data, 0, data.length);
byte[] signature = null;
try {
signature = decodeDERSignature(signer.generateSignature());
} catch (Exception e) {
logger.warn("SM2签名时出现异常:" + e.getMessage());
}
return signature;
}
private static byte[] hexToByte(String hex)
throws IllegalArgumentException {
if (hex.length() % 2 != 0) {
throw new IllegalArgumentException();
}
char[] arr = hex.toCharArray();
byte[] b = new byte[hex.length() / 2];
for (int i = 0, j = 0, l = hex.length(); i < l; i++, j++) {
String swap = "" + arr[i++] + arr[i];
int byteInt = Integer.parseInt(swap, 16) & 0xFF;
b[j] = BigInteger.valueOf(byteInt).byteValue();
}
return b;
}
private static byte[] C1C2C3ToC1C3C2(byte[] cipherText) throws Exception {
if (cipherText != null && cipherText.length >= 97) {
byte[] bytes = new byte[cipherText.length];
System.arraycopy(cipherText, 0, bytes, 0, 65);
System.arraycopy(cipherText, cipherText.length - 32, bytes, 65, 32);
System.arraycopy(cipherText, 65, bytes, 97, cipherText.length - 97);
return bytes;
} else {
throw new Exception("SM2 cipher text error, must be more than 96 bytes and in the format C1||C3||C2.");
}
}
private static byte[] C1C3C2ToC1C2C3(byte[] cipherText) throws Exception {
if (cipherText != null && cipherText.length >= 97) {
byte[] bytes = new byte[cipherText.length];
System.arraycopy(cipherText, 0, bytes, 0, 65);
System.arraycopy(cipherText, 97, bytes, 65, cipherText.length - 97);
System.arraycopy(cipherText, 65, bytes, cipherText.length - 32, 32);
return bytes;
} else {
throw new Exception("SM2 cipher text error, must be more than 96 bytes and in the format C1||C3||C2.");
}
}
private static ECPublicKeyParameters encodePublicKey(byte[] value) {
byte[] x = new byte[32];
byte[] y = new byte[32];
System.arraycopy(value, 1, x, 0, 32);
System.arraycopy(value, 33, y, 0, 32);
BigInteger X = new BigInteger(1, x);
BigInteger Y = new BigInteger(1, y);
ECPoint Q = getSM2Curve().createPoint(X, Y);
return new ECPublicKeyParameters(Q, getECDomainParameters());
}
private static ECCurve getSM2Curve() {
ECParameterSpec spec = ECNamedCurveTable.getParameterSpec(STD_NAME);
return spec.getCurve();
}
private static ECPrivateKeyParameters encodePrivateKey(byte[] value) {
BigInteger d = new BigInteger(1, value);
return new ECPrivateKeyParameters(d, getECDomainParameters());
}
private static ECDomainParameters getECDomainParameters() {
ECParameterSpec spec = ECNamedCurveTable.getParameterSpec(STD_NAME);
return new ECDomainParameters(spec.getCurve(), spec.getG(), spec.getN(), spec.getH(), spec.getSeed());
}
private static byte[] decodeDERSignature(byte[] signature) {
ASN1InputStream stream = new ASN1InputStream(new ByteArrayInputStream(signature));
byte[] bytes = new byte[64];
try {
ASN1Sequence primitive = (ASN1Sequence) stream.readObject();
Enumeration enumeration = primitive.getObjects();
BigInteger R = ((ASN1Integer) enumeration.nextElement()).getValue();
BigInteger S = ((ASN1Integer) enumeration.nextElement()).getValue();
byte[] r = format(R.toByteArray());
byte[] s = format(S.toByteArray());
System.arraycopy(r, 0, bytes, 0, 32);
System.arraycopy(s, 0, bytes, 32, 32);
} catch (Exception e) {
logger.warn("decodeDERSignature时出现异常:" + e.getMessage());
}
return bytes;
}
public static byte[] encodeDERSignature(byte[] signature) {
byte[] r = new byte[32];
byte[] s = new byte[32];
System.arraycopy(signature, 0, r, 0, 32);
System.arraycopy(signature, 32, s, 0, 32);
ASN1EncodableVector vector = new ASN1EncodableVector();
vector.add(new ASN1Integer(new BigInteger(1, r)));
vector.add(new ASN1Integer(new BigInteger(1, s)));
byte[] encoded = null;
try {
encoded = (new DERSequence(vector)).getEncoded();
} catch (Exception e) {
logger.warn("encodeDERSignature时出现异常:" + e.getMessage());
}
return encoded;
}
private static byte[] format(byte[] value) {
if (value.length == 32) {
return value;
} else {
byte[] bytes = new byte[32];
if (value.length > 32) {
System.arraycopy(value, value.length - 32, bytes, 0, 32);
} else {
System.arraycopy(value, 0, bytes, 32 - value.length, value.length);
}
return bytes;
}
}
public static void main(String[] args) {
String requestData = "hello啊";
byte[] encrypt = encrypt("0452d60e72f6a3050d2f8e8f4505f874ef345e15da38fda8dd64b9e756b7231c056dff1674c4826ada424cc78ea36fd58afc50bcefb5d721bf25b179efac2ebb17", requestData.getBytes(StandardCharsets.UTF_8));
String temp = new String(encrypt);
byte[] decrypt = decrypt("c3509b6df8bdaf84c464daa1b6fa11a8fca77b0e4a6f076ee68487f288278a85", encrypt);
System.out.println("解密完成"+new String(decrypt));
String encodeToString = Base64.getEncoder().encodeToString(encrypt);
byte[] decode = Base64.getDecoder().decode(encodeToString);
byte[] decrypt1 = decrypt("c3509b6df8bdaf84c464daa1b6fa11a8fca77b0e4a6f076ee68487f288278a85", decode);
System.out.println("解密完成1"+new String(decrypt1));
String base64 = "eyJtc2ciOiLns7vnu5/lvILluLjvvIzor7fnqI3lkI7lho3or5UiLCJkYXRhIjpudWxsLCJjb2RlIjoiNTAwIn0=";
byte[] decode1 = Base64.getDecoder().decode(base64);
String decode2 = new String(decode1);
byte[] decryptbyte = decrypt("83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44", decode1);
System.out.println("解密完成"+new String(decryptbyte));
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
</web-app>

48
fw-ncc/pom.xml Normal file
View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>kangarooDataCenterV3</artifactId>
<groupId>com.hzya.frame</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fw-ncc</artifactId>
<packaging>jar</packaging>
<version>${revision}</version>
<dependencies>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>base-service</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法为了解决Unable to find main class的问题 -->
<classifier>execute</classifier> <!-- 为了解决依赖模块找不到此模块中的类或属性 -->
<skip>true</skip>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,12 @@
package com.hzya.frame.ncc.v202005.service;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
public interface INccTokenService {
SysExtensionApiEntity getNccToken(SysExtensionApiEntity entity);
SysExtensionApiEntity getNccBill(SysExtensionApiEntity entity);
}

View File

@ -0,0 +1,35 @@
package com.hzya.frame.ncc.v202005.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface INccV202005Service {
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询列表
* @Date 2:18 下午 2023/7/17
**/
JsonResultEntity thirdInterfaceGetToken(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取ncc数据
* @Date 2:18 下午 2023/7/17
**/
JsonResultEntity getNccDataDetail(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取ncc数据
* @Date 2:18 下午 2023/7/17
**/
JsonResultEntity getNccData(JSONObject jsonObject);
}

View File

@ -0,0 +1,99 @@
package com.hzya.frame.ncc.v202005.service.impl;
import com.hzya.frame.ncc.v202005.service.INccTokenService;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.util.bipV3.Encryption;
import com.hzya.frame.util.bipV3.SHA256Util;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.net.URLEncoder;
import java.util.*;
@Service(value="nccTokenService")
public class NccTokenServiceImpl implements INccTokenService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Override
public SysExtensionApiEntity getNccToken(SysExtensionApiEntity entity) {
try {
Map<String, String> headers = entity.getHeaders();
String client_id = headers.get("client_id");
Map<String, String> paramMap = new HashMap<String, String>();
// 密码模式认证
paramMap.put("grant_type", "client_credentials");
// 第三方应用id
paramMap.put("client_id", client_id);
// 第三方应用secret]
String client_secret = headers.get("client_secret");
// 账套编码
String busi_center = headers.get("busi_center");
//用户编码
String usercode = headers.get("usercode");
//数据库编码
String dsname = headers.get("dsname");
String pubKey = headers.get("pubKey");
// 第三方应用secret 公钥加密]
paramMap.put("client_secret", URLEncoder.encode(Encryption.pubEncrypt(pubKey, client_secret), "utf-8"));
// 账套编码
paramMap.put("biz_center", busi_center);
// // TODO 传递数据源和ncc登录用户
paramMap.put("dsname", dsname);
paramMap.put("usercode", usercode);
// 签名
String sign = SHA256Util.getSHA256(client_id + client_secret + pubKey,pubKey);
paramMap.put("signature", sign);
StringBuffer querys = new StringBuffer();
querys.append("biz_center="+busi_center);
querys.append("&grant_type="+"client_credentials");
querys.append("&signature="+sign);
querys.append("&dsname="+dsname);
querys.append("&client_secret="+ URLEncoder.encode(Encryption.pubEncrypt(pubKey, client_secret), "utf-8"));
querys.append("&usercode="+usercode);
querys.append("&client_id="+client_id);
entity.setQuerys(querys.toString());
headers.put("content-type","application/x-www-form-urlencoded");
} catch (Exception e) {
e.printStackTrace();
}
return entity;
}
@Override
public SysExtensionApiEntity getNccBill(SysExtensionApiEntity entity) {
try {
Map<String, String> headers = entity.getHeaders();
String client_id = headers.get("client_id");
//token信息
String access_token = headers.get("access_token");
//公钥
String pubKey = headers.get("pubKey");
StringBuffer sb = new StringBuffer();
sb.append(client_id);
String parm = entity.getBodys();
if (StringUtils.isNotBlank(parm)) {
sb.append(parm);
}
sb.append(pubKey);
// 签名
String sign = SHA256Util.getSHA256(sb.toString(), pubKey);
StringBuffer querys = new StringBuffer();
querys.append("access_token="+access_token);
querys.append("&signature="+sign);
querys.append("&client_id="+client_id);
entity.setQuerys(querys.toString());
headers.put("signature",sign);
// headers.put("content-type","application/x-www-form-urlencoded");
} catch (Exception e) {
e.printStackTrace();
}
return entity;
}
}

View File

@ -0,0 +1,216 @@
package com.hzya.frame.ncc.v202005.service.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.ncc.v202005.service.INccV202005Service;
import com.hzya.frame.util.oldNcc.Encryption;
import com.hzya.frame.util.oldNcc.SHA256Util;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
@Service(value="nccV202005Service")
public class NccV202005ServiceImpl implements INccV202005Service {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Override
public JsonResultEntity thirdInterfaceGetToken(JSONObject object) {
JSONObject jsonObject = getstrObj("jsonStr", object);
String client_id = jsonObject.getString("client_id");
String pubKey = jsonObject.getString("pubKey");
String client_secret = jsonObject.getString("client_secret");
String username = jsonObject.getString("username");
String pwd = jsonObject.getString("pwd");
String busi_center = jsonObject.getString("busi_center");
String dsname = jsonObject.getString("dsname");
String baseUrl = jsonObject.getString("baseUrl");
Map<String, String> paramMap = new HashMap<String, String>();
// 密码模式认证
paramMap.put("grant_type", "password");
// 第三方应用id
paramMap.put("client_id", client_id);
// 第三方应用secret 公钥加密
try {
paramMap.put("client_secret", URLEncoder.encode(Encryption.pubEncrypt(pubKey, client_secret), "utf-8"));
} catch (Exception e) {
return BaseResult.getFailureMessageEntity("获取token失败");
}
// ncc用户名
paramMap.put("username", username);
// 密码 公钥加密
try {
paramMap.put("password", URLEncoder.encode(Encryption.pubEncrypt(pubKey, pwd), "utf-8"));
} catch (Exception e) {
return BaseResult.getFailureMessageEntity("获取token失败");
}
// 账套编码
paramMap.put("biz_center", busi_center);
// 签名
String sign = SHA256Util.getSHA256(client_id + client_secret + username + pwd + pubKey);
paramMap.put("signature", sign);
paramMap.put("dsname", dsname);
String url = baseUrl + "/nccloud/opm/accesstoken";
String mediaType = "application/x-www-form-urlencoded";
String token = doPost(url, paramMap, mediaType, null, "");
//System.out.println("token:" + token);
if(JSONUtil.isTypeJSON(token)){
JSONObject jsonObject1 = JSONObject.parseObject(token);
return BaseResult.getSuccessMessageEntity("获取token成功",jsonObject1);
}else {
return BaseResult.getSuccessMessageEntity("获取token成功",token);
}
}
@Override
public JsonResultEntity getNccData(JSONObject object) {
String token = "{\"head\":{\"primal_money\":\"489.00\",\"bill_date\":\"2023-08-15 06:10:01\",\"pk_currtype\":\"1002Z0100000000001K1\",\"bill_type\":\"F4\",\"trade_type\":\"D4\",\"billmaker_date\":\"2023-08-15 06:10:01\",\"objecttype\":\"0\",\"source_flag\":\"2\",\"pk_org\":\"0001W310000000002WN9\"},\"body\":[{\"bill_date\":\"2023-08-15 06:10:01\",\"pk_customer\":\"1001W3100000000007PV\",\"pk_account\":\"1001W3100000000007RQ\",\"pk_recproject\":\"1001W3100000000007QR\",\"pk_currtype\":\"1002Z0100000000001K1\",\"bill_type\":\"F4\",\"trade_type\":\"D4\",\"creationtime\":\"2023-08-15 06:10:01\",\"objecttype\":\"0\",\"pk_org\":\"0001W310000000002WN9\",\"direction\":\"1\",\"rec_primal\":\"489.00\"}]}";
JSONObject jsonObject1 = JSONObject.parseObject(token);
return BaseResult.getSuccessMessageEntity("获取数据成功",jsonObject1);
}
@Override
public JsonResultEntity getNccDataDetail(JSONObject object) {
String token = "{\"primal_money\":\"489.00\",\"bill_date\":\"2023-08-15 06:10:01\",\"pk_currtype\":\"1002Z0100000000001K1\",\"bill_type\":\"F4\",\"trade_type\":\"D4\",\"billmaker_date\":\"2023-08-15 06:10:01\",\"objecttype\":\"0\",\"source_flag\":\"2\",\"pk_org\":\"0001W310000000002WN9\",\"bill_date1\":\"2023-08-15 06:10:01\",\"pk_customer\":\"1001W3100000000007PV\",\"pk_account\":\"1001W3100000000007RQ\",\"pk_recproject\":\"1001W3100000000007QR\",\"pk_currtype1\":\"1002Z0100000000001K1\",\"bill_type1\":\"F4\",\"trade_type1\":\"D4\",\"creationtime\":\"2023-08-15 06:10:01\",\"objecttype1\":\"0\",\"pk_org1\":\"0001W310000000002WN9\",\"direction\":\"1\",\"rec_primal\":\"489.00\"}";
JSONObject jsonObject1 = JSONObject.parseObject(token);
return BaseResult.getSuccessMessageEntity("获取数据成功",jsonObject1);
}
/**
* 发送post请求
*
* @param baseUrl
* @param paramMap
* @param mediaType
* @param headers
* @param json
* @return
*/
private String doPost(String baseUrl, Map<String, String> paramMap, String mediaType, Map<String, String> headers, String json) {
HttpURLConnection urlConnection = null;
InputStream in = null;
OutputStream out = null;
BufferedReader bufferedReader = null;
String result = null;
try {
StringBuffer sb = new StringBuffer();
sb.append(baseUrl);
if (paramMap != null) {
sb.append("?");
for (Map.Entry<String, String> entry : paramMap.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
sb.append(key + "=" + value).append("&");
}
baseUrl = sb.toString().substring(0, sb.toString().length() - 1);
}
URL urlObj = new URL(baseUrl);
urlConnection = (HttpURLConnection) urlObj.openConnection();
urlConnection.setConnectTimeout(50000);
urlConnection.setRequestMethod("POST");
urlConnection.setDoOutput(true);
urlConnection.setDoInput(true);
urlConnection.setUseCaches(false);
urlConnection.addRequestProperty("content-type", mediaType);
if (headers != null) {
for (String key : headers.keySet()) {
urlConnection.addRequestProperty(key, headers.get(key));
}
}
out = urlConnection.getOutputStream();
out.write(json.getBytes("utf-8"));
out.flush();
int resCode = urlConnection.getResponseCode();
if (resCode == HttpURLConnection.HTTP_OK || resCode == HttpURLConnection.HTTP_CREATED || resCode == HttpURLConnection.HTTP_ACCEPTED) {
in = urlConnection.getInputStream();
} else {
in = urlConnection.getErrorStream();
}
bufferedReader = new BufferedReader(new InputStreamReader(in, "utf-8"));
StringBuffer temp = new StringBuffer();
String line = bufferedReader.readLine();
while (line != null) {
temp.append(line).append("\r\n");
line = bufferedReader.readLine();
}
String ecod = urlConnection.getContentEncoding();
if (ecod == null) {
ecod = Charset.forName("utf-8").name();
}
result = new String(temp.toString().getBytes("utf-8"), ecod);
} catch (Exception e) {
//System.out.println(e);
} finally {
if (null != bufferedReader) {
try {
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (null != out) {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (null != in) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
urlConnection.disconnect();
}
return result;
}
/**
* @Author lvleigang
* @Description 获取对象转换成jsonobj
* @Date 11:51 下午 2023/7/10
* @param key
* @param object
* @return com.alibaba.fastjson.JSONObject
**/
protected JSONObject getstrObj(String key, JSONObject object) {
if (checkStr(object.getString(key)) ) {
return object.getJSONObject(key);
}
return new JSONObject();
}
/**
* @param str
* @return void
* @Author lvleigang
* @Description 校验字符串
* @Date 11:41 上午 2022/12/7
**/
protected Boolean checkStr(String str) {
Boolean flag = true;
if (str == null || "".equals(str)) {
flag = false;
}
return flag;
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
</web-app>

48
fw-oa/pom.xml Normal file
View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>kangarooDataCenterV3</artifactId>
<groupId>com.hzya.frame</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fw-oa</artifactId>
<packaging>jar</packaging>
<version>${revision}</version>
<dependencies>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>base-service</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法为了解决Unable to find main class的问题 -->
<classifier>execute</classifier> <!-- 为了解决依赖模块找不到此模块中的类或属性 -->
<skip>true</skip>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,74 @@
package com.hzya.frame.seeyon.cap4.form.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.List;
/**
* @Description 无流程表单批量保存请求参数
* @Author xiangerlin
* @Date 2024/1/8 11:18
**/
public class FormDTO {
@JSONField(ordinal = 4)
private String formCode;//模版编号
@JSONField(ordinal = 5)
private String loginName;//模版编号
@JSONField(ordinal = 2)
private String rightId;//权限id找到无流程表单点新增弹出的窗口上会有这个参数
@JSONField(ordinal = 3)
private List<FormDataDTO> dataList;//导入的数据
@JSONField(ordinal = 1)
private String[] uniqueFiled;//更新用的唯一标识
@JSONField(ordinal = 6)
private Boolean doTrigger;//是否执行触发(Since V8.0sp2),测试中发现传了这个参数会报错
public String getFormCode() {
return formCode;
}
public void setFormCode(String formCode) {
this.formCode = formCode;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getRightId() {
return rightId;
}
public void setRightId(String rightId) {
this.rightId = rightId;
}
public List<FormDataDTO> getDataList() {
return dataList;
}
public void setDataList(List<FormDataDTO> dataList) {
this.dataList = dataList;
}
public String[] getUniqueFiled() {
return uniqueFiled;
}
public void setUniqueFiled(String[] uniqueFiled) {
this.uniqueFiled = uniqueFiled;
}
public Boolean getDoTrigger() {
return doTrigger;
}
public void setDoTrigger(Boolean doTrigger) {
this.doTrigger = doTrigger;
}
}

View File

@ -0,0 +1,36 @@
package com.hzya.frame.seeyon.cap4.form.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.List;
/**
* @Description dataList节点
* @Author xiangerlin
* @Date 2024/1/8 11:26
**/
public class FormDataDTO {
@JSONField(ordinal = 1)
private MasterTableDTO masterTable;//主表数据
@JSONField(ordinal = 2)
private List<SubTableDTO> subTables;//子表数据
//private List<> attachmentInfos;//附件列表
public MasterTableDTO getMasterTable() {
return masterTable;
}
public void setMasterTable(MasterTableDTO masterTable) {
this.masterTable = masterTable;
}
public List<SubTableDTO> getSubTables() {
return subTables;
}
public void setSubTables(List<SubTableDTO> subTables) {
this.subTables = subTables;
}
}

View File

@ -0,0 +1,45 @@
package com.hzya.frame.seeyon.cap4.form.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.List;
/**
* @Description 主表数据
* @Author xiangerlin
* @Date 2024/1/8 11:29
**/
public class MasterTableDTO {
@JSONField(ordinal = 1)
private String name;//表名
@JSONField(ordinal = 2)
private RecordDTO record;//数据
@JSONField(ordinal = 3)
private List<String> changedFields;//需要计算的字段
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public RecordDTO getRecord() {
return record;
}
public void setRecord(RecordDTO record) {
this.record = record;
}
public List<String> getChangedFields() {
return changedFields;
}
public void setChangedFields(List<String> changedFields) {
this.changedFields = changedFields;
}
}

View File

@ -0,0 +1,34 @@
package com.hzya.frame.seeyon.cap4.form.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.List;
/**
* @Description record节点
* @Author xiangerlin
* @Date 2024/1/8 11:31
**/
public class RecordDTO {
@JSONField(ordinal = 1)
private long id;//数据id测试中发现新增时这个参数随便填写 不影响导入
@JSONField(ordinal = 2)
private List<RecordFieldDTO> fields;//字段列表
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public List<RecordFieldDTO> getFields() {
return fields;
}
public void setFields(List<RecordFieldDTO> fields) {
this.fields = fields;
}
}

View File

@ -0,0 +1,52 @@
package com.hzya.frame.seeyon.cap4.form.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* @Description masterTablerecordfields的结构
* @Author xiangerlin
* @Date 2024/1/8 11:32
**/
public class RecordFieldDTO {
@JSONField(ordinal = 1)
private String name;//数据域名称 ,fieldxxxx
@JSONField(ordinal = 2)
private String value;//数据值优先
@JSONField(ordinal = 3)
private String showValue;//显示值
public RecordFieldDTO() {
}
public RecordFieldDTO(String name, String value, String showValue) {
this.name = name;
this.value = value;
this.showValue = showValue;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getShowValue() {
return showValue;
}
public void setShowValue(String showValue) {
this.showValue = showValue;
}
}

View File

@ -0,0 +1,9 @@
package com.hzya.frame.seeyon.cap4.form.dto;
/**
* @Description 子表数据
* @Author xiangerlin
* @Date 2024/1/8 11:29
**/
public class SubTableDTO {
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.seeyon.cbs8.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
/**
* @Description 代发代扣
* @Author xiangerlin
* @Date 2024/6/26 10:50
**/
public interface IAgentPaymentDao extends IBaseDao<AgentPaymentEntity,String> {
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.seeyon.cbs8.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
/**
* @Description 代发代扣明细
* @Author xiangerlin
* @Date 2024/6/26 10:54
**/
public interface IAgentPaymentDetailDao extends IBaseDao<AgentPaymentDetailEntity,String> {
}

Some files were not shown because too many files have changed in this diff Show More