This commit is contained in:
xiang2lin 2024-11-06 13:27:39 +08:00
commit ec06ed2272
242 changed files with 17778 additions and 81 deletions

7
.gitignore vendored
View File

@ -19,7 +19,7 @@ Icon
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
*.iml
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
@ -60,3 +60,8 @@ $RECYCLE.BIN/
/common/target/
/buildpackage/target/
/webapp/target/
/E:/yongansystem/log/2024-10-15/
/base-buildpackage/target/
/base-common/target/
/base-core/target/
/fw-weixin/target/

View File

@ -0,0 +1,36 @@
package com.hzya.frame.plugin.a8bill.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import java.util.HashMap;
import java.util.List;
/**
* 组织档案(mdm_org: table)表数据库访问层
*
* @author makejava
* @since 2024-06-07 18:30:04
*/
public interface IPayBillPluginInitializerDao extends IBaseDao<PayBillEntity, String> {
/**
*
* @content 通用获取OA数据接口
* @author laborer
* @date 2024/7/10 0010 16:06
*
*/
List<HashMap<String, Object>> getOaBillData(String str , PayBillEntity entity)throws Exception;
/**
*
* @content 通过ID修改单据状态
* @author laborer
* @date 2024/7/10 0010 17:32
*
*/
int updateStateForId(String str , PayBillEntity entity)throws Exception;
}

View File

@ -0,0 +1,33 @@
package com.hzya.frame.plugin.a8bill.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.execsql.service.IExecSqlService;
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.List;
/**
* 组织档案(MdmOrg)表数据库访问层
*
* @author makejava
* @since 2024-06-07 18:30:04
*/
public class PayBillPluginInitializerDaoImpl extends MybatisGenericDao<PayBillEntity, String> implements IPayBillPluginInitializerDao {
@Autowired
private IExecSqlService execSqlService;
@DS("#entity.dataSourceCode")
@Override
public List<HashMap<String, Object>> getOaBillData(String str, PayBillEntity entity)throws Exception {
return execSqlService.execSelectSql(str, "");
}
@DS("#entity.dataSourceCode")
@Override
public int updateStateForId(String str , PayBillEntity entity)throws Exception {
return super.update("com.hzya.frame.plugin.a8bill.dao.impl.PayBillPluginInitializerDaoImpl.PayBillEntity_update",entity);
}
}

View File

@ -9,6 +9,14 @@ import com.hzya.frame.web.entity.BaseEntity;
* @since 2024-06-07 18:30:04
*/
public class PayBillEntity extends BaseEntity {
private String sql;
public String getSql() {
return sql;
}
public void setSql(String sql) {
this.sql = sql;
}
}

View File

@ -1,16 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.plugin.a8bill.dao.impl.PayBillDaoImpl">
<mapper namespace="com.hzya.frame.plugin.a8bill.dao.impl.PayBillPluginInitializerDaoImpl">
<resultMap id="get-PayBillEntity-result" type="com.hzya.frame.plugin.a8bill.entity.PayBillEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="id" column="id" jdbcType="VARCHAR"/>
</resultMap>
</resultMap>
<!-- 查询的字段-->
<sql id = "PayBillEntity_Base_Column_List">
id
</sql>
</sql>
<!--执行update语句-->
<update id="PayBillEntity_update" parameterType="com.hzya.frame.plugin.a8bill.entity.PayBillEntity">
<if test="null != sql and sql != ''">
${sql}
</if>
</update>
</mapper>

View File

@ -0,0 +1,158 @@
package com.hzya.frame.plugin.a8bill.plugin;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapBuilder;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.ningboBankTreasury.dto.req.AccTransactionReq;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes;
import com.hzya.frame.ningboBankTreasury.util.NingboBankUtil;
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService;
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 org.springframework.beans.factory.annotation.Value;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description 查询宁波银行账户交易明细 保存到OA
* @Author xiangerlin
* @Date 2024/7/25 16:24
**/
public class AccLogPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private INingboBankPluginService ningboBankPluginService;
@Value("${OA.data_source_code}")
private String oa_data_source_code;
@Autowired
private IPayBillPluginInitializerDao payBillDao;
/***
* 插件初始化方法
* @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 "AccLogPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "查询交易明细插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "AccLogPlugin";
}
/***
* 插件类型 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 {
//查询银行账户列表
PayBillEntity oaBillEntity = new PayBillEntity();
oaBillEntity.setDataSourceCode(oa_data_source_code);
List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData("SELECT field0002 from formmain_0053",oaBillEntity);
List<String> accList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(hashMaps)){
for (HashMap<String, Object> hashMap : hashMaps) {
String field0002 = String.valueOf(hashMap.get("field0002"));
accList.add(field0002);
}
}
accList = Convert.toList(String.class,"86041110000110293,86041110000109337,6223160030547665,6214180002001411023,6214180000002609736");
//1查询宁波银行的交易记录
AccTransactionReq accTransactionReq = new AccTransactionReq();
accTransactionReq.setCdSign(NingboBankUtil.SHOURU);
accTransactionReq.setBeginDate(DateUtil.format(DateUtil.yesterday(),"yyyy-MM-dd"));
accTransactionReq.setEndDate(DateUtil.today());
accTransactionReq.setBankAccList(accList);
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", "8000360002")
.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")
.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
.put("appId","800036")
.build();
String body = HttpRequest.post("http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(JSONObject.toJSONString(accTransactionReq)).timeout(60000).execute().body();
System.out.println(body);
if (StrUtil.isNotEmpty(body)){
JSONObject response = JSONObject.parseObject(body);
if (response.getBoolean("flag")){
List<AccTransactionRes> accTransactionResList = JSONObject.parseArray(response.getJSONObject("attribute").getString("attribute"), AccTransactionRes.class);
//2保存到OA底表
if (CollectionUtils.isNotEmpty(accTransactionResList)){
ningboBankPluginService.saveAccLog(accTransactionResList);
}
return BaseResult.getSuccessMessageEntity(getPluginName()+"执行成功:{}",accTransactionResList);
}
}
return BaseResult.getSuccessMessageEntity(getPluginName()+"执行成功");
}
}

View File

@ -0,0 +1,144 @@
package com.hzya.frame.plugin.a8bill.plugin;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
/**
* @Description
* @Author xiangerlin
* @Date 2024/7/29 11:08
**/
public class NingboBankPayPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private INingboBankPluginService ningboBankPluginService;
@Resource
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private IPayBillPluginInitializerDao payBillDao;
@Value("${OA.data_source_code:}")
private String oa_data_source_code;
/***
* 插件初始化方法
* @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 "NingboBankPayPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "宁波银行转账插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "宁波银行转账插件";
}
/***
* 插件类型 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 {
JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class);
String interId = requestJsonObj.getString("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity();
if(StrUtil.isNotEmpty(interId)){
oldMsg = taskLivingDetailsService.get(interId);
}
String rootAppPk = oldMsg.getRootAppPk();
try {
StringBuffer sb = new StringBuffer();
if(StrUtil.isNotEmpty(rootAppPk)){
String code = requestJson.getString("code");
sb.append(" and id = '"+rootAppPk+"'");
}else{
sb.append(" and payState is null");
}
PayBillEntity oaBillEntity = new PayBillEntity();
oaBillEntity.setDataSourceCode(oa_data_source_code);
StringBuffer stringBuffer = new StringBuffer();
//付款单
stringBuffer.append("select * from v_hzya_pay where 1=1 " );
stringBuffer.append(sb.toString());
List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity);
ningboBankPluginService.payRequest(hashMaps,getPluginId(),"8000360000",interId);
} catch (Exception e) {
logger.info("获取OA数据失败"+e.getMessage());
e.printStackTrace();
}
return new JsonResultEntity("成功",true,new JsonResultEntity());
}
}

View File

@ -0,0 +1,129 @@
package com.hzya.frame.plugin.a8bill.plugin;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.ningboBankTreasury.enums.PayStatusEnum;
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService;
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 org.springframework.beans.factory.annotation.Value;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description 宁波银行 单笔付款交易结果查询
* @Author xiangerlin
* @Date 2024/7/29 16:59
**/
public class NingboBankPayResultPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Value("${OA.data_source_code}")
private String oa_data_source_code;
@Autowired
private IPayBillPluginInitializerDao payBillDao;
@Autowired
private INingboBankPluginService ningboBankPluginService;
/***
* 插件初始化方法
* @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 "NingboBankPayResultPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "宁波银行转账结果查询插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "宁波银行转账结果查询插件";
}
/***
* 插件类型 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 {
PayBillEntity oaBillEntity = new PayBillEntity();
oaBillEntity.setDataSourceCode(oa_data_source_code);
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("select * from v_hzya_pay where payState ='1'");
try {
List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity);
if(CollectionUtils.isNotEmpty(hashMaps)){
//查询交易结果
ningboBankPluginService.queryResult(hashMaps,"8000360001");
}
} catch (Exception e) {
e.printStackTrace();
}
return new JsonResultEntity("成功",true,new JsonResultEntity());
}
}

View File

@ -0,0 +1,147 @@
package com.hzya.frame.plugin.a8bill.plugin;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* @Description 外汇 TT 汇款
* @Author xiangerlin
* @Date 2024/8/1 14:33
**/
public class NingboBankTTPayPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private INingboBankPluginService ningboBankPluginService;
@Resource
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private IPayBillPluginInitializerDao payBillDao;
@Value("${OA.data_source_code}")
private String oa_data_source_code;
/***
* 插件初始化方法
* @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 "NingboBankTTPayPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "宁波银行T/T汇款插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "宁波银行T/T汇款插件";
}
/***
* 插件类型 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 {
JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class);
String interId = requestJsonObj.getString("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity();
if(StrUtil.isNotEmpty(interId)){
oldMsg = taskLivingDetailsService.get(interId);
}
String rootAppPk = oldMsg.getRootAppPk();
try {
StringBuffer sb = new StringBuffer();
if(StrUtil.isNotEmpty(rootAppPk)){
String code = requestJson.getString("code");
sb.append(" and id = '"+rootAppPk+"'");
}else{
sb.append(" and payState is null");
}
PayBillEntity oaBillEntity = new PayBillEntity();
oaBillEntity.setDataSourceCode(oa_data_source_code);
StringBuffer stringBuffer = new StringBuffer();
//付款单
stringBuffer.append("select * from v_hzya_pay_tt where 1=1 " );
stringBuffer.append(sb.toString());
List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity);
ningboBankPluginService.payRequest(hashMaps,getPluginId(),"8000360003",interId);
} catch (Exception e) {
logger.info("获取OA数据失败"+e.getMessage());
e.printStackTrace();
}
return new JsonResultEntity("成功",true,new JsonResultEntity());
}
}

View File

@ -0,0 +1,129 @@
package com.hzya.frame.plugin.a8bill.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
/**
* @Description TT汇款汇出交易结果查询
* @Author xiangerlin
* @Date 2024/8/2 10:47
**/
public class NingboBankTTPayResultPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private INingboBankPluginService ningboBankPluginService;
@Resource
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private IPayBillPluginInitializerDao payBillDao;
@Value("${OA.data_source_code}")
private String oa_data_source_code;
/***
* 插件初始化方法
* @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 "NingboBankTTPayResultPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "宁波银行T/T汇款交易状态查询插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "宁波银行T/T汇款交易状态查询插件";
}
/***
* 插件类型 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 {
PayBillEntity oaBillEntity = new PayBillEntity();
oaBillEntity.setDataSourceCode(oa_data_source_code);
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("select * from v_hzya_pay_tt where payState ='1'");
try {
List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity);
if(CollectionUtils.isNotEmpty(hashMaps)){
//查询交易结果
ningboBankPluginService.queryResult(hashMaps,"8000360007");
}
} catch (Exception e) {
e.printStackTrace();
}
return new JsonResultEntity("成功",true,new JsonResultEntity());
}
}

View File

@ -0,0 +1,154 @@
package com.hzya.frame.plugin.a8bill.plugin;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
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 javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
/**
* @Description OA付款申请审批完成后传u8c
* @Author xiangerlin
* @Date 2024/10/9 14:19
**/
public class PayReqSyncU8CPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private INingboBankPluginService ningboBankPluginService;
@Resource
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private IPayBillPluginInitializerDao payBillDao;
@Value("${OA.data_source_code}")
private String oa_data_source_code;
/***
* 插件初始化方法
* @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 "PayReqSyncU8CPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "付款申请审批结果传U8C";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "付款申请审批结果传U8C";
}
/***
* 插件类型 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("======开始执行付款申请审批结果传U8C========");
JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(), JSONObject.class);
String integration_task_living_details_id = requestJsonObj.getString("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity();
if (StrUtil.isNotEmpty(integration_task_living_details_id)) {
oldMsg = taskLivingDetailsService.get(integration_task_living_details_id);
}
String rootAppPk = oldMsg.getRootAppPk();
try {
StringBuffer sb = new StringBuffer();
if (StrUtil.isNotEmpty(rootAppPk)) {
sb.append(" and id = '" + rootAppPk + "'");
}else {
sb.append("and finishedflag = '1' and pushState is null");
}
PayBillEntity oaBillEntity = new PayBillEntity();
oaBillEntity.setDataSourceCode(oa_data_source_code);
StringBuffer stringBuffer = new StringBuffer();
//付款单
stringBuffer.append("SELECT * from v_hzya_payres_u8c WHERE 1= 1 ");
stringBuffer.append(sb.toString());
List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(), oaBillEntity);
for (HashMap<String, Object> hashMap : hashMaps) {
JSONObject main = new JSONObject();
for (String key : hashMap.keySet()) {
main.put(key, hashMap.get(key));
}
logger.info("组装数据前"+JSON.toJSONString(hashMaps));
logger.info("组装数据前1"+main.toString());
ningboBankPluginService.updateU8CStatus(main,integration_task_living_details_id);
}
} catch (Exception e) {
logger.info("获取OA数据失败" + e.getMessage());
e.printStackTrace();
}
return BaseResult.getSuccessMessageEntity(getPluginName()+"执行成功");
}
}

View File

@ -0,0 +1,60 @@
package com.hzya.frame.plugin.a8bill.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes;
import java.util.HashMap;
import java.util.List;
/**
* @Description 宁波银行插件用
* @Author xiangerlin
* @Date 2024/7/25 16:33
**/
public interface INingboBankPluginService {
/**
* 支付申请
* @param hashMaps oa 查到的数据
* @param pluginId 插件 id
* @param apiCode api 编码
* @param interId 重试 id
*/
void payRequest(List<HashMap<String, Object>> hashMaps,String pluginId,String apiCode,String interId);
/**
* 调用宁波银行esb接口
* @param params 参数
* @param apiCode 接口编码
* @param appId 应用id
* @return
*/
String executeEsb(String params,String apiCode,String appId);
/**
* 保存收款日志到oa底表
* @param accTransactionResList
*/
void saveAccLog(List<AccTransactionRes> accTransactionResList);
/**
* 查询交易结果
* @param hashMaps
* @param apiCode
*/
void queryResult(List<HashMap<String, Object>> hashMaps,String apiCode);
/**
* 查询OA附件并上传到宁波银行
* @param oaId oa主键id
* @return 宁波银行附件上传编码
*/
String fileUpload(String oaId);
/**
* 更新u8c单据状态
* @param jsonObject
* @param integration_task_living_details_id 重试id
*/
void updateU8CStatus(JSONObject jsonObject,String integration_task_living_details_id);
}

View File

@ -0,0 +1,479 @@
package com.hzya.frame.plugin.a8bill.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapBuilder;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.ningboBankTreasury.dto.req.SingleTransferReq;
import com.hzya.frame.ningboBankTreasury.dto.req.TTRemitReq;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes;
import com.hzya.frame.ningboBankTreasury.enums.CurrencyEnum;
import com.hzya.frame.ningboBankTreasury.enums.PayStatusEnum;
import com.hzya.frame.ningboBankTreasury.enums.TTPayStatusEnum;
import com.hzya.frame.ningboBankTreasury.service.INingboBankTreasuryService;
import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao;
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService;
import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity;
import com.hzya.frame.seeyon.dongj.service.IFormmain0044Service;
import com.hzya.frame.seeyon.util.RestUtil;
import com.hzya.frame.stringutil.StringUtil;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Description 宁波银行插件用
* @Author xiangerlin
* @Date 2024/7/25 16:34
**/
public class NingboBankPluginServiceImpl implements INingboBankPluginService {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private IFormmain0044Service formmain0044Service;
@Resource
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private IPayBillPluginInitializerDao payBillDao;
@Autowired
private RestUtil restUtil;
@Autowired
private INingboBankTreasuryService ningboBankTreasuryService;
@Value("${OA.data_source_code}")
private String oa_data_source_code;
/**
* 支付申请
* @param hashMaps oa 查到的数据
* @param pluginId 插件 id
* @param apiCode api 编码
* @param interId 重试 id
*/
@Override
public void payRequest(List<HashMap<String, Object>> hashMaps, String pluginId, String apiCode,String interId) {
if(CollectionUtils.isNotEmpty(hashMaps)){
PayBillEntity oaBillEntity = new PayBillEntity();
oaBillEntity.setDataSourceCode(oa_data_source_code);
for (HashMap<String, Object> hashMap : hashMaps) {
try {
JSONObject main = new JSONObject();
for(String key:hashMap.keySet()) {
main.put(key, hashMap.get(key));
}
String param = "";
//单笔转账
if ("8000360000".equals(apiCode)){
SingleTransferReq singleTransferReq = JSONObject.parseObject(main.toString(), SingleTransferReq.class);
param = JSONObject.toJSONString(singleTransferReq);
}else if("8000360003".equals(apiCode)){
//TT汇款
TTRemitReq ttRemitReq = JSONObject.parseObject(main.toString(), TTRemitReq.class);
//货到付款时要上传附件
if ("01".equals(ttRemitReq.getPayMode())){
String fileCode = fileUpload(main.getString("id"));
ttRemitReq.setFileUploadCodes(Convert.toList(String.class,fileCode));
}
param = JSONObject.toJSONString(ttRemitReq);
}
if (StrUtil.isEmpty(param)){
param = main.toString();
}
logger.info("获取到付款单的数据:{}",main.toString());
String result = this.executeEsb(param,apiCode,"800036");
logger.info("推送宁波银行的返回结果:{}",result);
IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity();
logDetails.setRootAppPk(main.getString("id"));
logDetails.setRootAppBill(main.getString("serialNo"));
logDetails.setNewTransmitInfo(result);
logDetails.setNewPushDate(new Date());
logDetails.setRootAppNewData(JSON.toJSONString(main));
logDetails.setPluginId(pluginId);
JSONObject resultObj = JSON.parseObject(result);
String attribute = resultObj.getString("attribute");
boolean flag = resultObj.getBoolean("flag");
String subState = "";
String fieldName = main.getString("fieldName");
String tableName = main.getString("tableName");
String payMsg = main.getString("payMsg");
// String subMsg = main.getString("subMsg");
String str = "";
String sync_flag = "";
try {
if(StrUtil.isEmpty(interId)){// 银行状态 1支付中 2 支付失败 null 未提交支付 0支付成功
logDetails.setCreate_time(new Date());
logDetails.setModify_time(new Date());
if(flag){
subState = "1";
sync_flag = " ,"+payMsg+" = '支付中'";
taskLivingDetailsService.saveLogToSuccess(logDetails);
}else{
subState = "2";
String resMsg = JSONObject.parseObject(attribute).getString("retMsg");
sync_flag = " ,"+payMsg+" = '"+resMsg+"'";
taskLivingDetailsService.saveLogToFail(logDetails);
}
}else{
logDetails.setId(interId);
logDetails.setModify_time(new Date());
if(flag){
subState = "1";
sync_flag = " ,"+payMsg+" = '支付中'";
taskLivingDetailsService.saveLogFailToSuccess(logDetails);
}else{
subState = "2";
String resMsg = JSONObject.parseObject(attribute).getString("retMsg");
sync_flag = " ,"+payMsg+" = '"+resMsg+"'";
taskLivingDetailsService.updateLogFailToSuccess(logDetails);
}
}
str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +sync_flag+"where id = '"+main.getString("id")+"'";
} catch (Exception e) {
subState = "N";
str = "update "+tableName+" set " + fieldName + "= '" +subState+"'," +payMsg+" = '"+attribute+"' "+"where id = '"+main.getString("id")+"'";
logger.info("保存日志失败"+e.getMessage());
oaBillEntity.setSql(str);
payBillDao.updateStateForId(str,oaBillEntity);
e.printStackTrace();
}
//修改推送状态防止重复推送
oaBillEntity.setSql(str);
payBillDao.updateStateForId(str,oaBillEntity);
}catch (Exception e){
logger.info("宁波银行付款接口调用出错:{}",e);
}
}
}
}
/**
* 查询交易结果
*
* @param hashMaps
* @param apiCode
*/
@Override
public void queryResult(List<HashMap<String, Object>> hashMaps, String apiCode) {
if(CollectionUtils.isNotEmpty(hashMaps)){
PayBillEntity oaBillEntity = new PayBillEntity();
oaBillEntity.setDataSourceCode(oa_data_source_code);
for (HashMap<String, Object> hashMap : hashMaps) {
JSONObject main = new JSONObject();
for(String key:hashMap.keySet()) {
main.put(key, hashMap.get(key));
}
String tableName = main.getString("tableName");
String fieldName = main.getString("fieldName");
String payDate = main.getString("payDate");
String payMsg = main.getString("payMsg");
try {
logger.info("获取到付款单状态的数据"+main.toString());
JSONObject reMain = new JSONObject();
reMain.put("serialNo",main.getString("serialNo"));
String result = this.executeEsb(reMain.toString(),apiCode,"800036");
logger.info("获取付款状态结果"+result);
JSONObject resultObj = JSON.parseObject(result);
JSONObject attribute = resultObj.getJSONObject("attribute");
boolean flag = resultObj.getBoolean("flag");
StringBuffer sb = new StringBuffer();
sb.append("update "+tableName);
if(flag){
JSONObject data = attribute.getJSONObject("Data");
JSONObject transferDtl = new JSONObject();
String status = "";
String msg = "";
boolean isFinally = true;
if ("8000360001".equals(apiCode)){
transferDtl = data.getJSONObject("transferDtl");
status = transferDtl.getString("status");
msg = PayStatusEnum.getByCode(status);
isFinally = PayStatusEnum.isFinally(status);
}else if ("8000360007".equals(apiCode)){
status = data.getString("transState");
msg = TTPayStatusEnum.getByCode(status);
isFinally = TTPayStatusEnum.isFinally(status);
}
if(StrUtil.isEmpty(msg)){
msg ="未知交易状态,请联系管理员查证";
sb.append(" set "+payMsg+" = '"+msg+"'");
sb.append(" , "+fieldName+" = '2'");
}
sb.append(" set "+payMsg+" = '"+msg+"'");
//是否最终态
if(isFinally){
sb.append(" , "+fieldName+" = '0'");
String payDateStr = DateUtil.now();
sb.append(" , "+payDate+" = '"+payDateStr+"'");
}
}else {
sb.append(" set "+payMsg+" = '"+attribute.getString("retMsg")+"'");
sb.append(" ,"+fieldName+" = '2'");
}
sb.append(" where id = '"+main.getString("id")+"'");
//修改推送状态防止重复推送
oaBillEntity.setSql(sb.toString());
payBillDao.updateStateForId(sb.toString(),oaBillEntity);
} catch (Exception e) {
StringBuffer sb = new StringBuffer();
sb.append("update "+tableName );
sb.append(" set "+payMsg+" = '获取交易状态失败'");
sb.append(" , "+fieldName+" = '2'");
sb.append(" where id = '"+main.getString("id")+"'");
logger.info("获取交易状态失败,更新交易信息为失败状态,后续不在查询");
e.printStackTrace();
}
}
}
}
/**
* 调用宁波银行esb接口
*
* @param params
* @param apiCode
* @return
*/
@Override
public String executeEsb(String params, String apiCode,String appId) {
logger.info("请求apiCode:{},参数:{}",apiCode,params);
Map<String, String> header = MapBuilder.<String, String>create(true)
.put("apiCode", apiCode)
.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")
.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
//.put("appId","800036")
.put("appId",appId)
.build();
String res = HttpRequest.post("http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(50000).execute().body();
return res;
}
/**
* 保存收款日志到oa底表
* @param accTransactionResList
*/
@Override
public void saveAccLog(List<AccTransactionRes> accTransactionResList) {
if (CollectionUtils.isNotEmpty(accTransactionResList)){
//查询已经存在的数据
Formmain0044Entity formmain0044 = new Formmain0044Entity();
formmain0044.setStart_date(DateUtil.lastWeek().toDateStr());
formmain0044.setDataSourceCode(oa_data_source_code);
List<Formmain0044Entity> formmain0044List = formmain0044Service.querySeridId(formmain0044);
//过滤已保存的数据
if (CollectionUtils.isNotEmpty(formmain0044List) && CollectionUtils.isNotEmpty(accTransactionResList)){
accTransactionResList = accTransactionResList.stream()
.filter(acc -> formmain0044List.stream()
.noneMatch(f -> acc.getSerialId().equals(f.getField0018())))
.collect(Collectors.toList());
}
if (CollectionUtils.isNotEmpty(accTransactionResList)){
for (AccTransactionRes accTransactionRes : accTransactionResList) {
String bankAcc = StringUtil.nullConvert(accTransactionRes.getBankAcc());
String bankName = StringUtil.nullConvert(accTransactionRes.getBankName());
String accName = StringUtil.nullConvert(accTransactionRes.getAccName());
String oppAccNo = StringUtil.nullConvert(accTransactionRes.getOppAccNo());
String oppAccName = StringUtil.nullConvert(accTransactionRes.getOppAccName());
String oppAccBank = StringUtil.nullConvert(accTransactionRes.getOppAccBank());
String transTime = StringUtil.nullConvert(accTransactionRes.getTransTime());
//这个是唯一的
String serialId = StringUtil.nullConvert(StringUtil.replaceBlank(accTransactionRes.getSerialId()));
String amt = StringUtil.nullConvert(accTransactionRes.getAmt());
String abs = StringUtil.nullConvert(accTransactionRes.getAbs());
String bankType = StringUtil.nullConvert(accTransactionRes.getBankType());
String serialNo = StringUtil.nullConvert(accTransactionRes.getSerialNo());
String currency = StringUtil.nullConvert(CurrencyEnum.getNameByCode(accTransactionRes.getCurCode()));
String uses = StringUtil.nullConvert(accTransactionRes.getUses());
//String curCode = StringUtil.nullConvert(accTransactionRes.getCurCode());
//这里转换成货币符号
String curCode = StringUtil.nullConvert(CurrencyEnum.getSymbolByCode(accTransactionRes.getCurCode()));
String postScript = StringUtil.nullConvert(accTransactionRes.getPostScript());
String data = StrUtil.format(getAccLogXmlTemplate(),bankAcc,bankName,accName,oppAccNo,oppAccName,oppAccBank,transTime,serialId,amt,abs,bankType,serialNo,currency,uses,postScript,curCode);
JSONObject paramsTemplate = new JSONObject();
paramsTemplate.put("loginName", "oa1");
paramsTemplate.put("dataXml", data);
Map<String, String> header = MapBuilder.<String, String>create(true)
.put("apiCode", "8000340006")
.put("publicKey","ZJYAA9Z/jWMe1rC+Sjh8NVMRtwVMb5Bn0DbmIEsgpVlR3C9Ce7eDIk+3zDUT+v578prj")
.put("secretKey","B8sgQwEaskwM7BQj1XLvu3kdKD3xm7Lyd4FWsPaFQk5v+UtQLCkzVzLlCZ9Bdyv2j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
.put("appId","800034")
.build();
String res = HttpRequest.post("http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(paramsTemplate.toString()).timeout(60000).execute().body();
System.out.println("保存oa底表结果:"+res);
}
}
}
}
/**
* 查询OA附件并上传到宁波银行
*
* @param oaId oa主键id
* @return 宁波银行附件上传编码
*/
@Override
public String fileUpload(String oaId) {
if (StrUtil.isNotEmpty(oaId)){
try {
//查询oa单据关联附件
PayBillEntity oaBillEntity = new PayBillEntity();
oaBillEntity.setDataSourceCode(oa_data_source_code);
String sql = " SELECT\n" +
" formmain_0058.id,\n" +
" formmain_0058.field0024 ,\n" +
" CTP_ATTACHMENT.FILE_URL,\n" +
" CTP_ATTACHMENT.FILENAME\n" +
"FROM\n" +
" formmain_0058 \n" +
" LEFT JOIN CTP_ATTACHMENT ON CTP_ATTACHMENT.SUB_REFERENCE = formmain_0058.field0024 \n" +
"WHERE\n" +
" formmain_0058.field0061 = '境外'\n" +
" and formmain_0058.id = '" + oaId+"'";
oaBillEntity.setSql(sql);
List<HashMap<String, Object>> dataList = payBillDao.getOaBillData(sql, oaBillEntity);
if (CollectionUtils.isNotEmpty(dataList)){
HashMap<String, Object> oaDataMap = dataList.get(0);
String fileUrl = String.valueOf(oaDataMap.get("FILE_URL"));
String fileName = String.valueOf(oaDataMap.get("FILENAME"));
if (StrUtil.isNotEmpty(fileUrl)){
//下载OA附件
byte[] bytes = restUtil.downloadFileBytes("oa1", "8000340000", fileUrl, fileName);
//上传到宁波银行
logger.info("上传附件到宁波银行:{},{}",fileUrl,fileName);
JSONObject param = new JSONObject();
param.put("fileName",fileName);
param.put("bytes",bytes);
param.put("channelNo","open-filegateway");
String res = executeEsb(param.toString(), "8000360008","800036");
JsonResultEntity jsonResultEntity = JSONObject.parseObject(res, JsonResultEntity.class);
if (null != jsonResultEntity && jsonResultEntity.isFlag()){
JSONObject attribute = JSONObject.parseObject(String.valueOf(jsonResultEntity.getAttribute()));
JSONObject data = attribute.getJSONObject("Data");
String fileCode = data.getString("data");
return fileCode;
}
}
}
}catch(Exception e){
logger.error("上传附件到宁波银行出错:{}",e);
}
}
return null;
}
/**
* 更新u8c单据状态
* @param main
*/
@Override
public void updateU8CStatus(JSONObject main,String integration_task_living_details_id) {
String billCode = main.getString("serialNo");
String dwbm = main.getString("dwbm");
String state = main.getString("state");
String userCode = main.getString("userCode");
String id = main.getString("id");
if (StrUtil.isNotEmpty(billCode)){
PayBillEntity oaBillEntity = new PayBillEntity();
oaBillEntity.setDataSourceCode(oa_data_source_code);
String str = "update formmain_0058 set field0072 = 'N' where id = "+id;
try {
JSONObject param = new JSONObject();
param.put("billno",billCode);
param.put("corpcode",dwbm);
param.put("billType","paybill");
param.put("userCode",userCode);
param.put("ckeckResult","3".equals(state) ? "Y" :"N");
param.put("ckeckNote",getStateName(state));
String result = executeEsb(param.toString(), "8000350060","800035");
logger.info("调用U8C付款单审批返回参数:{}",result);
//保存日志
IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity();
taskLivingDetail.setCreate_time(new Date());
taskLivingDetail.setModify_time(new Date());
taskLivingDetail.setRootAppPk(id);
taskLivingDetail.setRootAppBill(main.getString("serialNo"));
taskLivingDetail.setPluginId("PayReqSyncU8CPlugin");
taskLivingDetail.setRootAppNewData(param.toString());
taskLivingDetail.setNewTransmitInfo(result);
taskLivingDetail.setNewPushDate(new Date());
JSONObject resultObj = JSON.parseObject(result);
boolean flag = resultObj.getBoolean("flag");
//保存日志
saveLog(integration_task_living_details_id,flag,taskLivingDetail);
//更新oa表单推送状态
if (flag){
str = "update formmain_0058 set field0072 = 'Y' where id = "+id;
}
}catch (Exception e){
logger.error("执行U8C付款单审批接口出错:{}",e);
}
//修改推送状态防止重复推送
oaBillEntity.setSql(str);
try {
payBillDao.updateStateForId(str,oaBillEntity);
} catch (Exception e) {
logger.error("执行U8C付款单审批接口后更新OA单据状态出错:{}",e);
}
}
}
//审批状态对应的中文
private String getStateName(String state){
if ("3".equals(state)){
return "审批通过";
}else if ("1".equals(state)){
return "流程终止";
}else if ("2".equals(state)){
return "流程撤销";
}
return "审批通过";
}
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);
}
}
private static String getAccLogXmlTemplate(){
// return "<forms version=\"2.1\"><formExport><summary id=\"1828182906863371818\" name=\"formmain_0044\"/><definitions><column id=\"field0001\" type=\"0\" name=\"我方账号\" isNullable=\"false\" length=\"200\"/><column id=\"field0017\" type=\"0\" name=\"我方开户行\" isNullable=\"false\" length=\"200\"/><column id=\"field0024\" type=\"0\" name=\"我方户名\" isNullable=\"false\" length=\"200\"/><column id=\"field0029\" type=\"0\" name=\"客户方账号\" isNullable=\"false\" length=\"200\"/><column id=\"field0022\" type=\"0\" name=\"客户方户名\" isNullable=\"false\" length=\"2000\"/><column id=\"field0030\" type=\"0\" name=\"客户方开户行\" isNullable=\"false\" length=\"500\"/><column id=\"field0018\" type=\"2\" name=\"交易日期\" isNullable=\"false\" length=\"255\"/><column id=\"field0019\" type=\"0\" name=\"交易流水号\" isNullable=\"false\" length=\"100\"/><column id=\"field0020\" type=\"4\" name=\"收款金额\" isNullable=\"false\" length=\"20\"/><column id=\"field0021\" type=\"0\" name=\"摘要\" isNullable=\"false\" length=\"500\"/><column id=\"field0025\" type=\"0\" name=\"银行类型\" isNullable=\"false\" length=\"100\"/><column id=\"field0026\" type=\"0\" name=\"银行流水号\" isNullable=\"false\" length=\"100\"/><column id=\"field0027\" type=\"0\" name=\"币种\" isNullable=\"false\" length=\"100\"/><column id=\"field0028\" type=\"0\" name=\"用途\" isNullable=\"false\" length=\"800\"/><column id=\"field0031\" type=\"0\" name=\"关联客户号\" isNullable=\"false\" length=\"100\"/><column id=\"field0032\" type=\"0\" name=\"客商编号\" isNullable=\"false\" length=\"100\"/><column id=\"field0033\" type=\"0\" name=\"交易代码\" isNullable=\"false\" length=\"100\"/><column id=\"field0034\" type=\"0\" name=\"客商名称\" isNullable=\"false\" length=\"100\"/><column id=\"field0035\" type=\"0\" name=\"对账码\" isNullable=\"false\" length=\"100\"/><column id=\"field0036\" type=\"0\" name=\"备注\" isNullable=\"false\" length=\"800\"/><column id=\"field0037\" type=\"0\" name=\"ERP业务参考号\" isNullable=\"false\" length=\"100\"/><column id=\"field0038\" type=\"0\" name=\"币种ID\" isNullable=\"false\" length=\"100\"/><column id=\"field0039\" type=\"0\" name=\"币种编码\" isNullable=\"false\" length=\"100\"/><column id=\"field0040\" type=\"0\" name=\"控制只关联1次\" isNullable=\"false\" length=\"100\"/><column id=\"field0044\" type=\"4\" name=\"收款剩余金额\" isNullable=\"false\" length=\"20\"/><column id=\"field0045\" type=\"0\" name=\"收款完成情况\" isNullable=\"false\" length=\"100\"/><column id=\"field0046\" type=\"4\" name=\"是否收款完成\" isNullable=\"false\" length=\"20\"/></definitions><values><column name=\"我方账号\"><value><![CDATA[{}]]></value></column><column name=\"我方开户行\"><value><![CDATA[{}]]></value></column><column name=\"我方户名\"><value><![CDATA[{}]]></value></column><column name=\"客户方账号\"><value><![CDATA[{}]]></value></column><column name=\"客户方户名\"><value><![CDATA[{}]]></value></column><column name=\"客户方开户行\"><value><![CDATA[{}]]></value></column><column name=\"交易日期\"><value><![CDATA[{}]]></value></column><column name=\"交易流水号\"><value><![CDATA[{}]]></value></column><column name=\"收款金额\"><value><![CDATA[{}]]></value></column><column name=\"摘要\"><value><![CDATA[{}]]></value></column><column name=\"银行类型\"><value><![CDATA[{}]]></value></column><column name=\"银行流水号\"><value><![CDATA[{}]]></value></column><column name=\"币种\"><value><![CDATA[{}]]></value></column><column name=\"用途\"><value><![CDATA[{}]]></value></column><column name=\"关联客户号\"><value><![CDATA[{}]]></value></column><column name=\"客商编号\"><value><![CDATA[{}]]></value></column><column name=\"交易代码\"><value><![CDATA[{}]]></value></column><column name=\"客商名称\"><value><![CDATA[{}]]></value></column><column name=\"对账码\"><value><![CDATA[{}]]></value></column><column name=\"备注\"><value><![CDATA[{}]]></value></column><column name=\"ERP业务参考号\"><value><![CDATA[{}]]></value></column><column name=\"币种ID\"><value><![CDATA[{}]]></value></column><column name=\"币种编码\"><value><![CDATA[{}]]></value></column><column name=\"控制只关联1次\"><value><![CDATA[{}]]></value></column><column name=\"收款剩余金额\"><value><![CDATA[{}]]></value></column><column name=\"收款完成情况\"><value><![CDATA[{}]]></value></column><column name=\"是否收款完成\"><value><![CDATA[{}]]></value></column></values><subForms/></formExport></forms>";
return "<forms version=\"2.1\"><formExport><summary id=\"1828182906863371818\" name=\"formmain_0044\"/><definitions><column id=\"field0001\" type=\"0\" name=\"我方账号\" isNullable=\"false\" length=\"200\"/><column id=\"field0017\" type=\"0\" name=\"我方开户行\" isNullable=\"false\" length=\"200\"/><column id=\"field0024\" type=\"0\" name=\"我方户名\" isNullable=\"false\" length=\"200\"/><column id=\"field0029\" type=\"0\" name=\"客户方账号\" isNullable=\"false\" length=\"200\"/><column id=\"field0022\" type=\"0\" name=\"客户方户名\" isNullable=\"false\" length=\"2000\"/><column id=\"field0030\" type=\"0\" name=\"客户方开户行\" isNullable=\"false\" length=\"500\"/><column id=\"field0018\" type=\"2\" name=\"交易日期\" isNullable=\"false\" length=\"255\"/><column id=\"field0019\" type=\"0\" name=\"交易流水号\" isNullable=\"false\" length=\"100\"/><column id=\"field0020\" type=\"4\" name=\"收款金额\" isNullable=\"false\" length=\"20\"/><column id=\"field0021\" type=\"0\" name=\"摘要\" isNullable=\"false\" length=\"500\"/><column id=\"field0025\" type=\"0\" name=\"银行类型\" isNullable=\"false\" length=\"100\"/><column id=\"field0026\" type=\"0\" name=\"银行流水号\" isNullable=\"false\" length=\"100\"/><column id=\"field0027\" type=\"0\" name=\"币种\" isNullable=\"false\" length=\"100\"/><column id=\"field0028\" type=\"0\" name=\"用途\" isNullable=\"false\" length=\"800\"/><column id=\"field0036\" type=\"0\" name=\"备注\" isNullable=\"false\" length=\"800\"/><column id=\"field0039\" type=\"0\" name=\"币种编码\" isNullable=\"false\" length=\"100\"/></definitions><values><column name=\"我方账号\"><value><![CDATA[{}]]></value></column><column name=\"我方开户行\"><value><![CDATA[{}]]></value></column><column name=\"我方户名\"><value><![CDATA[{}]]></value></column><column name=\"客户方账号\"><value><![CDATA[{}]]></value></column><column name=\"客户方户名\"><value><![CDATA[{}]]></value></column><column name=\"客户方开户行\"><value><![CDATA[{}]]></value></column><column name=\"交易日期\"><value><![CDATA[{}]]></value></column><column name=\"交易流水号\"><value><![CDATA[{}]]></value></column><column name=\"收款金额\"><value><![CDATA[{}]]></value></column><column name=\"摘要\"><value><![CDATA[{}]]></value></column><column name=\"银行类型\"><value><![CDATA[{}]]></value></column><column name=\"银行流水号\"><value><![CDATA[{}]]></value></column><column name=\"币种\"><value><![CDATA[{}]]></value></column><column name=\"用途\"><value><![CDATA[{}]]></value></column><column name=\"备注\"><value><![CDATA[{}]]></value></column><column name=\"币种编码\"><value><![CDATA[{}]]></value></column></values><subForms/></formExport></forms>";
}
}

View File

@ -0,0 +1,99 @@
package com.hzya.frame.plugin.kjs.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.kjs.service.IDingTalkBuService;
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;
public class DingAttendancePluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private IDingTalkBuService dingTalkBuService;
/***
* 插件初始化方法
* @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 "kjsDingAttendancePlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "kjs钉钉考勤数据插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "kjs钉钉考勤数据插件";
}
/***
* 插件类型 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("开始执行"+getPluginName()+requestJson.toString());
String res = dingTalkBuService.getAttendanceList(requestJson);
return BaseResult.getSuccessMessageEntity("操作成功");
}
}

View File

@ -0,0 +1,106 @@
package com.hzya.frame.plugin.kjs.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.u8.otherin.service.IOtherInService;
import com.hzya.frame.u8.receipt.service.IReceiptService;
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;
/**
*
* @content 其他入库单同步CRM
* @className: Administrator
* @author laborer
* @date 2024-10-18 8:46
*
*/
public class OtherInPluginInitializer extends PluginBaseEntity {
@Autowired
private IOtherInService otherInService;
Logger logger = LoggerFactory.getLogger(getClass());
/***
* 插件初始化方法
* @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 "OtherInPluginInitializer";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "其他入库单同步CRM";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "其他入库单同步CRM";
}
/***
* 插件类型 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 {
otherInService.getU8OtherInToCrm(requestJson);
return BaseResult.getSuccessMessageEntity("操作成功");
}
}

View File

@ -0,0 +1,106 @@
package com.hzya.frame.plugin.kjs.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.u8.otherout.service.IOtherOutService;
import com.hzya.frame.u8.receipt.service.IReceiptService;
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;
/**
*
* @content 其他出库单同步CRM
* @className: Administrator
* @author laborer
* @date 2024-10-18 8:46
*
*/
public class OtherOutPluginInitializer extends PluginBaseEntity {
@Autowired
private IOtherOutService otherOutService;
Logger logger = LoggerFactory.getLogger(getClass());
/***
* 插件初始化方法
* @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 "OtherOutPluginInitializer";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "其他出库单同步CRM";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "其他出库单同步CRM";
}
/***
* 插件类型 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 {
otherOutService.getU8OtherOutToCrm(requestJson);
return BaseResult.getSuccessMessageEntity("操作成功");
}
}

View File

@ -0,0 +1,105 @@
package com.hzya.frame.plugin.kjs.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.u8.receipt.service.IReceiptService;
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;
/**
*
* @content 收款单同步CRM插件
* @className: Administrator
* @author laborer
* @date 2024-10-18 8:46
*
*/
public class ReceiptPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private IReceiptService receiptService;
/***
* 插件初始化方法
* @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 "ReceiptPluginInitializer";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "收款单同步CRM插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "收款单同步CRM插件";
}
/***
* 插件类型 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 {
receiptService.getU8ReceiptCrm(requestJson);
return BaseResult.getSuccessMessageEntity("操作成功");
}
}

View File

@ -0,0 +1,106 @@
package com.hzya.frame.plugin.kjs.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.u8.receipt.service.IReceiptService;
import com.hzya.frame.u8.saleinv.service.ISaleInvService;
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;
/**
*
* @content 销售发票同步CRM
* @className: Administrator
* @author laborer
* @date 2024-10-18 8:46
*
*/
public class SaleInvPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private ISaleInvService saleInvService;
/***
* 插件初始化方法
* @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 "SaleInvPluginInitializer";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "销售发票同步CRM";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "销售发票同步CRM";
}
/***
* 插件类型 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 {
saleInvService.getU8SaleInvToCrm(requestJson);
return BaseResult.getSuccessMessageEntity("操作成功");
}
}

View File

@ -0,0 +1,106 @@
package com.hzya.frame.plugin.kjs.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.kjs.service.IDeliveryOrderPluginService;
import com.hzya.frame.u8.saleout.service.ISaleOutService;
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;
/**
*
* @content 销售发货单同步CRM插件
* @className: Administrator
* @author laborer
* @date 2024-10-18 8:46
*
*/
public class SaleOutPluginInitializer extends PluginBaseEntity {
@Autowired
private ISaleOutService saleOutService;
Logger logger = LoggerFactory.getLogger(getClass());
/***
* 插件初始化方法
* @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 "SaleOutPluginInitializer";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "销售发货单同步CRM插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "销售发货单同步CRM插件";
}
/***
* 插件类型 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 {
saleOutService.getU8SaleOutToCrm(requestJson);
return BaseResult.getSuccessMessageEntity("操作成功");
}
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.plugin.kjs.service;
import com.alibaba.fastjson.JSONObject;
public interface IDingTalkBuService {
/**
* 获取考勤打卡信息
* @return
*/
String getAttendanceList(JSONObject requestJso);
}

View File

@ -0,0 +1,113 @@
package com.hzya.frame.plugin.kjs.service.impl;
import cn.hutool.core.map.MapBuilder;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.dingtalk.api.response.OapiAttendanceListRecordResponse;
import com.hzya.frame.dingtalk.service.IDingTalkService;
import com.hzya.frame.kjsData.attendance.entity.AttendanceEntity;
import com.hzya.frame.plugin.kjs.service.IDingTalkBuService;
import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import java.text.SimpleDateFormat;
import java.util.*;
public class DingTalkBuServiceImpl implements IDingTalkBuService {
@Value("${dingtalk.appKey:}")
private String appKey;
@Value("${dingtalk.appSecret:}")
private String appSecret;
@Autowired
private IDingTalkService dingTalkService;
@Autowired
private ComparisonServiceImpl comparisonServiceimpl;
@Override
public String getAttendanceList(JSONObject requestJson){
//获取用户信息
JSONObject jsonObjectUser = new JSONObject();
JSONObject jsonStr = new JSONObject();
jsonObjectUser.put("mdmCode", "10015");
jsonStr.put("jsonStr", jsonObjectUser);
//先查询编码和名称查询是否存在
Object attribute = comparisonServiceimpl.queryEntityPage(jsonStr);
JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
JSONArray jsonArrayList = jsonObjectAttribute.getJSONObject("pageInfo").getJSONArray("list");
List<String> userIds = new ArrayList<>();
List<AttendanceEntity> userList = new ArrayList<>();
for (int i = 0; i < jsonArrayList.size(); i++) {
JSONObject item = jsonArrayList.getJSONObject(i).getJSONObject("mdm_dd_user");
userIds.add(item.getString("userid"));
AttendanceEntity user = new AttendanceEntity();
user.setUserid(item.getString("userid"));
user.setUsername(item.getString("name"));
user.setUserjob(item.getString("job_number"));
userList.add(user);
}
int groupSize = 50;
String result = "";
for (int i = 0; i < userIds.size(); i += groupSize) {
List<String> subList = userIds.subList(i, Math.min(i + groupSize, userIds.size()));
result = saveAttendanceList(subList, userList);
}
return result;
}
public String saveAttendanceList(List<String> ids, List<AttendanceEntity> userList){
//根据用户id去获取打卡记录
List<OapiAttendanceListRecordResponse.Recordresult> attendanceList =
dingTalkService.getAttendanceList(ids,"dingq3vbsswvyujiuwa7", "m4IRNcKQn-W9QBLERHWt0iW2hSirvxPS684xiNw-4QFMNg2gsBCur9T4QMvvAR4I");
List<AttendanceEntity> list = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (int i = 0; i < attendanceList.size(); i++) {
OapiAttendanceListRecordResponse.Recordresult jsonObject = attendanceList.get(i);
AttendanceEntity entity = new AttendanceEntity();
entity.setUserid(jsonObject.getUserId());
entity.setUserchecktime(jsonObject.getUserCheckTime() != null ? sdf.format(jsonObject.getUserCheckTime()): null);
entity.setUserlongitude(jsonObject.getUserLongitude());
entity.setUserlatitude(jsonObject.getUserLatitude());
entity.setWorkdate(jsonObject.getWorkDate() != null ? sdf.format(jsonObject.getWorkDate()): null);
entity.setUseraddress(jsonObject.getUserAddress());
entity.setTimeresult(jsonObject.getTimeResult());
entity.setSourcetype(jsonObject.getSourceType());
entity.setOutsideremark(jsonObject.getOutsideRemark());
entity.setLocationresult(jsonObject.getLocationResult());
entity.setGmtmodified(jsonObject.getGmtModified() != null ? sdf.format(jsonObject.getGmtModified()): null);
entity.setChecktype(jsonObject.getCheckType());
entity.setBasechecktime(jsonObject.getBaseCheckTime() != null ? sdf.format(jsonObject.getBaseCheckTime()): null);
Optional<AttendanceEntity> userInfo = userList.stream().filter(s->s.getUserid().equals(entity.getUserid()))
.findFirst();
if (userInfo.isPresent()){
entity.setUsername(userInfo.get().getUsername());
entity.setUserjob(userInfo.get().getUserjob());
}
list.add(entity);
}
String body = "";
int groupSize = 100;
for (int i = 0; i < list.size(); i += groupSize) {
List<AttendanceEntity> subList = list.subList(i, Math.min(i + groupSize, list.size()));
String reqParams = JSONObject.toJSONString(subList);
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", "8000100000")
.put("publicKey","ZJYAn/EBWEhLUMezDLU4iZ1vTO9kc6pM6XrYLajnqnK60Q9Ce7eDIk+3zDUT+v578prj")
.put("secretKey","ctMIYyauwoKSFeU4tg5gH1aWC/3OJK6HsKJrSR0oyDmdmdvRNgdoTzX0C1OQ+whrj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
.put("appId","800010")
.build();
body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(reqParams).timeout(60000).execute().body();
}
return body;
}
}

View File

@ -452,6 +452,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
}
}
} catch (Exception e) {
logger.info("执行异常错误原因:"+e);
logger.error("新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute());
taskDetailEntity.setResult("新增返回脚本解析保存三方id错误");
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
@ -543,7 +544,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
map1.put("dataStatus", "N");
map1.put("deleteStatus", "0");
map1.put("size", 10);
map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -738,7 +739,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
//map1.put("dataStatus", "F");
map1.put("updateStatus", "0");
map1.put("size", 10);
map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -926,7 +927,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
//map1.put("dataStatus", "Y");
map1.put("addStatus", "0");
map1.put("size", 100);
map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);

View File

@ -0,0 +1,7 @@
package com.hzya.frame.plugin.oaReceipt.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.oaReceipt.entity.OaReceiptEntity;
public interface IOaReceiptDao extends IBaseDao<OaReceiptEntity, String> {
}

View File

@ -0,0 +1,8 @@
package com.hzya.frame.plugin.oaReceipt.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.oaReceipt.dao.IOaReceiptDao;
import com.hzya.frame.plugin.oaReceipt.entity.OaReceiptEntity;
public class OaReceiptDaoImpl extends MybatisGenericDao<OaReceiptEntity, String> implements IOaReceiptDao {
}

View File

@ -0,0 +1,6 @@
package com.hzya.frame.plugin.oaReceipt.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class OaReceiptEntity extends BaseEntity {
}

View File

@ -0,0 +1,16 @@
<?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.oaReceipt.dao.impl.OaReceiptDaoImpl">
<resultMap id="get-OaReceiptEntity-result" type="com.hzya.frame.plugin.oaReceipt.entity.OaReceiptEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "PayBillEntity_Base_Column_List">
id
</sql>
</mapper>

View File

@ -0,0 +1,58 @@
package com.hzya.frame.plugin.oaReceipt.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.a8bill.plugin.PayBillPluginInitializer;
import com.hzya.frame.seeyon.receiptFor.service.IReceiptForService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
public class OaReceiptPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PayBillPluginInitializer.class);
@Autowired
private IReceiptForService receiptForService;
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "OaReceiptPlugin";
}
@Override
public String getPluginName() {
return "OaReceiptPlugin插件";
}
@Override
public String getPluginLabel() {
return "OaReceiptPlugin";
}
@Override
public String getPluginType() {
return "1";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
logger.info("======开始执行付款单据信息同步========");
return receiptForService.sendReceiptFor(requestJson);
}catch (Exception e){
logger.info("======执行付款单据同步失败:{}========",e.getMessage());
e.printStackTrace();
}
return null;
}
}

View File

@ -0,0 +1,7 @@
package com.hzya.frame.plugin.oaReceipt.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.oaReceipt.entity.OaReceiptEntity;
public interface IOaReceiptService extends IBaseService<OaReceiptEntity, String> {
}

View File

@ -0,0 +1,8 @@
package com.hzya.frame.plugin.oaReceipt.service.impl;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.oaReceipt.entity.OaReceiptEntity;
import com.hzya.frame.plugin.oaReceipt.service.IOaReceiptService;
public class OaReceiptServiceImpl extends BaseService<OaReceiptEntity, String> implements IOaReceiptService {
}

View File

@ -0,0 +1,7 @@
package com.hzya.frame.plugin.pushMessage.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
public interface IPushMessageDao extends IBaseDao<PushMessageEntity, String> {
}

View File

@ -0,0 +1,8 @@
package com.hzya.frame.plugin.pushMessage.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
public class PushMessageDaoImpl extends MybatisGenericDao<PushMessageEntity, String> implements IPushMessageDao {
}

View File

@ -0,0 +1,106 @@
package com.hzya.frame.plugin.pushMessage.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class PushMessageEntity extends BaseEntity {
private String pushMethod;
private String warningAppCode;
private String warningApiCode;
private String recipientIdList;
private String warningAppType;
private String sendAppName;
private String receiveAppName;
private String receiveApiName;
private String returnData;
private String receiveApiCode;
private String status;
public String getPushMethod() {
return pushMethod;
}
public void setPushMethod(String pushMethod) {
this.pushMethod = pushMethod;
}
public String getWarningAppCode() {
return warningAppCode;
}
public void setWarningAppCode(String warningAppCode) {
this.warningAppCode = warningAppCode;
}
public String getWarningApiCode() {
return warningApiCode;
}
public void setWarningApiCode(String warningApiCode) {
this.warningApiCode = warningApiCode;
}
public String getRecipientIdList() {
return recipientIdList;
}
public void setRecipientIdList(String recipientIdList) {
this.recipientIdList = recipientIdList;
}
public String getWarningAppType() {
return warningAppType;
}
public void setWarningAppType(String warningAppType) {
this.warningAppType = warningAppType;
}
public String getSendAppName() {
return sendAppName;
}
public void setSendAppName(String sendAppName) {
this.sendAppName = sendAppName;
}
public String getReceiveAppName() {
return receiveAppName;
}
public void setReceiveAppName(String receiveAppName) {
this.receiveAppName = receiveAppName;
}
public String getReceiveApiName() {
return receiveApiName;
}
public void setReceiveApiName(String receiveApiName) {
this.receiveApiName = receiveApiName;
}
public String getReturnData() {
return returnData;
}
public void setReturnData(String returnData) {
this.returnData = returnData;
}
public String getReceiveApiCode() {
return receiveApiCode;
}
public void setReceiveApiCode(String receiveApiCode) {
this.receiveApiCode = receiveApiCode;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}

View File

@ -0,0 +1,43 @@
<?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.pushMessage.dao.impl.PushMessageDaoImpl">
<resultMap id="get-PushMessageEntity-result" type="com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity" >
<result property="pushMessage" column="push_message" jdbcType="VARCHAR"/>
<result property="warningAppCode" column="warning_app_code" jdbcType="VARCHAR"/>
<result property="warningApiCode" column="warning_api_code" jdbcType="VARCHAR"/>
<result property="appType" column="app_type" jdbcType="VARCHAR"/>
<result property="recipientIdList" column="recipient_id_list" jdbcType="VARCHAR"/>
<result property="sendAppName" column="send_app_name" jdbcType="VARCHAR"/>
<result property="receiveAppName" column="receive_app_name" jdbcType="VARCHAR"/>
<result property="receiveApiName" column="receive_api_name" jdbcType="VARCHAR"/>
<result property="receiveApiCode" column="receive_api_code" jdbcType="VARCHAR"/>
<result property="returnData" column="return_data" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-PushMessageEntity-result" parameterType = "com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity">
SELECT
warning_config.push_method,
warning_config.sendAppid AS warning_app_code,
warning_config.endApiCode AS warning_api_code,
warning_config.app_type,
warning_config.recipient_id AS recipient_id_list,
log.send_app_name,
log.receive_app_name,
receive_api_name,
log.receive_api_code,
log.return_data,
log.STATUS
FROM
v_hzya_sys_warning warning_config
LEFT JOIN v_hzya_sys_send_message_log log ON warning_config.api_code = log.receive_api_code
WHERE
log.STATUS = '4'
AND warning_config.push_method = '定时'
</select>
</mapper>

View File

@ -0,0 +1,77 @@
package com.hzya.frame.plugin.pushMessage.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService;
import com.hzya.frame.sysnew.pushMessage.dao.ISysPushMessageDao;
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
import com.hzya.frame.sysnew.pushMessage.service.ISysPushMessageService;
import com.hzya.frame.sysnew.sendMessageLog.service.ISysSendMessageLogService;
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.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("PushMessagePluginInitializer")
public class PushMessagePluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PushMessagePluginInitializer.class);
@Autowired
private ISysPushMessageDao sysPushMessageDao;
@Resource
public ISysSendMessageLogService sysSendMessageLogService;
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "PushMessagePlugin";
}
@Override
public String getPluginName() {
return "PushMessagePlugin插件";
}
@Override
public String getPluginLabel() {
return "PushMessagePlugin";
}
@Override
public String getPluginType() {
return "1";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
logger.info("======开始执行定时消息推送========");
List<SysPushMessageEntity> list = sysPushMessageDao.getAll();
for(SysPushMessageEntity entity : list){
sysSendMessageLogService.sendMessage(entity);
}
return BaseResult.getSuccessMessageEntity("定时推送消息成功");
}catch (Exception e){
logger.info("======执行定时消息推送失败:{}========",e.getMessage());
e.printStackTrace();
}
return null;
}
}

View File

@ -0,0 +1,10 @@
package com.hzya.frame.plugin.pushMessage.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface IPushMessageService extends IBaseService<PushMessageEntity, String> {
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.plugin.pushMessage.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
import com.hzya.frame.plugin.pushMessage.service.IPushMessageService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
public class PushMessageServiceImpl extends BaseService<PushMessageEntity, String> implements IPushMessageService {
private IPushMessageDao pushMessageDao;
@Autowired
public void setPushMessageDao(IPushMessageDao dao) {
this.pushMessageDao = dao;
this.dao = dao;
}
}

View File

@ -0,0 +1,100 @@
package com.hzya.frame.plugin.u8c.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.u8c.service.ISalesBillingService;
import com.hzya.frame.u8c.sosale.service.ISoSaleService;
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;
public class SaleConPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(SaleConPluginInitializer.class);
@Autowired
private ISoSaleService soSaleService;
/***
* 插件初始化方法
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 10:48
* @Param []
* @return void
**/
@Override
public void initialize() {
}
/****
* 插件销毁方法
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
/****
* 插件的ID
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginId() {
return "SaleConPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "U8C销售合同同步OA销售合同";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "U8C销售合同同步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 {
soSaleService.getU8cSaleToOa(requestJson);
return BaseResult.getSuccessMessageEntity("销售订单同步OA成功");
}
}

View File

@ -0,0 +1,98 @@
package com.hzya.frame.plugin.u8c.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.u8c.service.ISalesBillingService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
public class SalesBillingPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(SalesBillingPluginInitializer.class);
@Autowired
private ISalesBillingService salesBillingService;
/***
* 插件初始化方法
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 10:48
* @Param []
* @return void
**/
@Override
public void initialize() {
}
/****
* 插件销毁方法
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
/****
* 插件的ID
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginId() {
return "SalesBillingPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "u8c销售开票审核状态同步插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "u8c销售开票审核状态同步插件";
}
/***
* 插件类型 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 {
JsonResultEntity jsonResultEntity = salesBillingService.doSalesBilling(requestJson);
return jsonResultEntity;
}
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.plugin.u8c.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface ISalesBillingService {
/**
* @Author lvleigang
* @Description OA同步销售开票审核状态到U8C
* @Date 10:21 上午 2024/8/2
* @param requestJson
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity doSalesBilling(JSONObject requestJson);
}

View File

@ -0,0 +1,161 @@
package com.hzya.frame.plugin.u8c.service.impl;
import cn.hutool.core.map.MapBuilder;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.u8c.service.ISalesBillingService;
import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity;
import com.hzya.frame.u8c.salesBilling.service.IU8cSalesBillingService;
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 java.util.List;
import java.util.Map;
public class SalesBillingServiceImpl implements ISalesBillingService {
Logger logger = LoggerFactory.getLogger(SalesBillingServiceImpl.class);
@Value("${OA.data_source_code}")
private String oa_data_source_code;
@Autowired
private IU8cSalesBillingService iu8cSalesBillingService;
private final String appId = "800035";
//这个接口调错了要用开发的那个审批接口
//private final String apiCode = "8000350047";
private final String apiCode = "8000350060";
private final String publicKey = "ZJYATW/MfYZX7zF0eAh4DJXbyTLwUtwSoSz5Y/o1ksAaN/dCe7eDIk+3zDUT+v578prj";
private final String secretKey = "+5BUkLQh3iX3VHgEt5bE2IPh+ZeebGvDaEspsvVu739Ar6sFnwg+fpPod4t6XhoTj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=";
/**
* @param requestJson
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 同步销售开票审核状态
* @Date 10:21 上午 2024/8/2
**/
@Override
public JsonResultEntity doSalesBilling(JSONObject requestJson) {
//查询需要同步的数据
try {
U8cSalesBillingEntity u8cSalesBillingEntity = new U8cSalesBillingEntity();
u8cSalesBillingEntity.setDataSourceCode(oa_data_source_code);
List<U8cSalesBillingEntity> u8cSalesBillingEntities = iu8cSalesBillingService.queryDoSalesBilling(u8cSalesBillingEntity);
if (u8cSalesBillingEntities != null && u8cSalesBillingEntities.size() > 0) {
for (int i = 0; i < u8cSalesBillingEntities.size(); i++) {
U8cSalesBillingEntity entity = u8cSalesBillingEntities.get(i);
String params = getSendData(entity);
//发送数据
String returnData = executeEsb(params,appId,apiCode,publicKey,secretKey);
//解析结果
boolean flag = analyzeReturnData(returnData);
if(flag){
entity.setPushStatus("Y");
}else {
entity.setPushStatus("N");
}
entity.setDataSourceCode(oa_data_source_code);
iu8cSalesBillingService.updateDoSalesBilling(entity);
}
return BaseResult.getSuccessMessageEntity("同步销售开票审核状态成功");
} else {
return BaseResult.getSuccessMessageEntity("同步销售开票审核状态成功");
}
} catch (Exception e) {
return BaseResult.getFailureMessageEntity("同步销售开票审核状态失败" + e.getMessage());
}
}
/**
* @Author lvleigang
* @Description 解析返回状态
* @Date 2:50 下午 2024/8/2
* @param returnData
* @return boolean
**/
private boolean analyzeReturnData(String returnData) {
boolean falg = false ;
if (JSONUtil.isTypeJSON(returnData)) {
JSONObject jsonObject = JSONObject.parseObject(returnData);
if(jsonObject != null && jsonObject.get("flag") != null && jsonObject.getBoolean("flag")) {
JSONObject attribute = jsonObject.getJSONObject("attribute");
if(attribute != null && attribute.get("status") != null && "success".equals(attribute.getString("status"))) {
falg = true;
}
}
}
return falg;
}
private String getSendData(U8cSalesBillingEntity entity) {
String params = "";
//{
// "queryinfo": {
// "code": [
// "SITH1904180026",
// "SOTH1805240023"
// ],
// "corp": "1000",
// "date_begin": "2019-03-24",
// "date_end": "2019-05-24"
// },
// "approveinfo": {
// "approvid": "18612329914",
// "approveDate": "2018-04-19",
// "status": "Y",
// "note": "哈哈"
// }
//}
JSONObject data = new JSONObject();
JSONObject queryinfo = new JSONObject();
JSONObject approveinfo = new JSONObject();
JSONArray code = new JSONArray();
code.add(entity.getCode());//单据号
queryinfo.put("code", code);
queryinfo.put("corp", entity.getCorp());//公司编码
queryinfo.put("date_begin", entity.getDateBegin());//单据开始日期
queryinfo.put("date_end", entity.getDateEnd());//单据结束日期
approveinfo.put("approvid", entity.getApprovid());//审批人
approveinfo.put("approveDate", entity.getApprovedate());//审核时间
approveinfo.put("status", entity.getStatus());//审批状态Y通过N不通过R驳回
approveinfo.put("note", entity.getNote());//批语
data.put("queryinfo", queryinfo);
data.put("approveinfo", approveinfo);
params = data.toJSONString();
//用新的审批接口
JSONObject jsonObject = new JSONObject();
jsonObject.put("billno",entity.getCode());
jsonObject.put("corpcode",entity.getCorp());
jsonObject.put("billType","saleinvoice");
jsonObject.put("userCode","15715849962");
jsonObject.put("ckeckResult","Y");
jsonObject.put("ckeckNote","审批通过");
params = jsonObject.toString();
return params;
}
public String executeEsb(String params, String appId, String apiCode, String publicKey, String secretKey) {
logger.info("请求apiCode:{},参数:{}", apiCode, params);
Map<String, String> header = MapBuilder.<String, String>create(true)
.put("apiCode", apiCode)
.put("publicKey", publicKey)
.put("secretKey", secretKey)
.put("appId", appId)
.build();
String res = HttpRequest.post("http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(60000).execute().body();
return res;
}
}

View File

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

View File

@ -1,5 +1,5 @@
server:
port: 9999
port: 8901
servlet:
context-path: /kangarooDataCenterV3
localIP: 127.0.0.1
@ -93,7 +93,7 @@ mybatis-plus:
db-config:
id-type: auto # 主键策略
zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface
#JimuReport[minidao配置]
minidao :
base-package: org.jeecg.modules.jmreport.desreport.dao*

View File

@ -4,4 +4,9 @@
<bean name="deliveryOrderPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.DeliveryOrderPluginInitializer" />
<bean name="momOrderPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.MomOrderPluginInitializer" />
<bean name="dingTalkInitPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.DingTalkInitPluginInitializer" />
<bean name="DingAttendancePluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.DingAttendancePluginInitializer" />
<bean name="SaleOutPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.SaleOutPluginInitializer" />
<bean name="ReceiptPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.ReceiptPluginInitializer" />
<bean name="SaleInvPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.SaleInvPluginInitializer" />
<bean name="OtherInPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.OtherInPluginInitializer" />
</beans>

View File

@ -6,4 +6,5 @@
<bean name="kjsPluginBaseService" class="com.hzya.frame.plugin.kjs.service.impl.KjsPluginBaseService" />
<bean name="genericEventConsumer" class="com.hzya.frame.plugin.kjs.service.GenericEventConsumer" />
<bean name="dingTalkInitServiceImpl" class="com.hzya.frame.plugin.kjs.service.impl.DingTalkInitServiceImpl" />
<bean name="dingTalkBuServiceImpl" class="com.hzya.frame.plugin.kjs.service.impl.DingTalkBuServiceImpl" />
</beans>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>NingboBankPlugin</id>
<name>宁波银行财资大管家插件</name>
<category>202407250001</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">
<bean name="payBillPluginInitializerDaoImpl" class="com.hzya.frame.plugin.a8bill.dao.impl.PayBillPluginInitializerDaoImpl" />
</beans>

View File

@ -0,0 +1,10 @@
<?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="accLogPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.AccLogPluginInitializer" />
<bean name="ningboBankPayPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.NingboBankPayPluginInitializer" />
<bean name="ningboBankPayResultPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.NingboBankPayResultPluginInitializer" />
<bean name="ningboBankTTPayPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.NingboBankTTPayPluginInitializer" />
<bean name="ningboBankTTPayResultPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.NingboBankTTPayResultPluginInitializer" />
<bean name="payReqSyncU8CPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.PayReqSyncU8CPluginInitializer" />
</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">
<bean name="ningboBankPluginServiceImpl" class="com.hzya.frame.plugin.a8bill.service.impl.NingboBankPluginServiceImpl" />
</beans>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>OaReceiptPlugin</id>
<name>OaReceiptPlugin插件</name>
<category>90000026</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">
<bean name="oaReceiptCustomerDao" class="com.hzya.frame.plugin.oaReceipt.dao.impl.OaReceiptDaoImpl" />
</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">
<bean name="oaReceiptCustomerInitializer" class="com.hzya.frame.plugin.oaReceipt.plugin.OaReceiptPluginInitializer" />
</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">
<bean name="oaReceiptCustomerService" class="com.hzya.frame.plugin.oaReceipt.service.impl.OaReceiptServiceImpl" />
</beans>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>SalesBillingPlugin</id>
<name>u8c插件</name>
<category>202408020001</category>
</plugin>

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="SalesBillingPluginInitializer" class="com.hzya.frame.plugin.u8c.plugin.SalesBillingPluginInitializer" />
<bean name="SaleConPluginInitializer1" class="com.hzya.frame.plugin.u8c.plugin.SaleConPluginInitializer" />
</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">
<bean name="salesBillingServiceImpl" class="com.hzya.frame.plugin.u8c.service.impl.SalesBillingServiceImpl" />
</beans>

View File

@ -51,6 +51,7 @@ public class GroovyUtil {
logger.info("创建newInstance失败:"+ e);
throw new BaseSystemException(e);
}
logger.info("开始执行脚本:"+parameterJson);
Object returnObj = groovyObject.invokeMethod("execute",parameterJson);
logger.info("脚本参数:{}",parameterJson);
logger.info("执行脚本结束:"+returnObj);

View File

@ -22,7 +22,7 @@ public class BipUtil {
*/
public static String sendU9cTOBipEsb(String parm, String apiCode,String token){
String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface";
System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl)
.header("appId", "800023")//头信息多个头信息多次调用此方法即可
@ -40,7 +40,7 @@ public class BipUtil {
return null;
}
public static String getBipToken(String userCode, String apiCode){
String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface";
String result = HttpRequest.post(baseUrl)
.header("appId", "800023")//头信息多个头信息多次调用此方法即可
.header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可
@ -58,6 +58,24 @@ public class BipUtil {
}
return null;
}
public static String sendOaToU8c(String parm, String apiCode){
String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface";
System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl)
.header("appId", "800035")//头信息多个头信息多次调用此方法即可
.header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYATW/MfYZX7zF0eAh4DJXbyTLwUtwSoSz5Y/o1ksAaN/dCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "+5BUkLQh3iX3VHgEt5bE2IPh+ZeebGvDaEspsvVu739Ar6sFnwg+fpPod4t6XhoTj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(parm)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
System.out.println("返回参数"+result);
if(StrUtil.isNotEmpty(result)){
return analytic(result);
}
return null;
}
public static String analytic(String parm){
JSONObject main = JSON.parseObject(parm);
return main.getString("attribute");

View File

@ -0,0 +1,51 @@
package com.hzya.frame.crm.util;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
/**
*
* @content CRM通用工具类
* @className: Administrator
* @author laborer
* @date 2024-10-18 11:21
*
*/
public class CrmUtil {
/**
*
* @content 发送单据到CRM系统
* @className: Administrator
* @author laborer
* @date 2024-10-18 11:21
*
*/
public static String sendU8TOCrmEsb(String parm, String apiCode){
String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl)
.header("appId", "800023")//头信息多个头信息多次调用此方法即可
.header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(parm)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
System.out.println("返回参数"+result);
if(StrUtil.isNotEmpty(result)){
return analytic(result);
}
return null;
}
public static String analytic(String parm){
JSONObject main = JSON.parseObject(parm);
return main.getString("attribute");
}
}

View File

@ -49,7 +49,7 @@ public class OerDjmlExtServiceImpl implements IOerDjmlExtService {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private RestUtil restUtil;
@Value("${savefile.path}")
@Value("${savefile.path:}")
public String DSK;
@Autowired
private ISysApplicationDatabaseService sysApplicationDatabaseService;

View File

@ -0,0 +1,18 @@
package com.hzya.frame.kjsData.attendance.dao;
import com.hzya.frame.kjsData.attendance.entity.AttendanceEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* (attendance: table)表数据库访问层
*
* @author makejava
* @since 2024-09-19 13:26:00
*/
public interface IAttendanceDao extends IBaseDao<AttendanceEntity, String> {
Integer createLists(List<AttendanceEntity> entities);
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.kjsData.attendance.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.kjsData.attendance.entity.AttendanceEntity;
import com.hzya.frame.kjsData.attendance.dao.IAttendanceDao;
import com.hzya.frame.wms_21.basemdm.entity.CustomerEntity;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* (Attendance)表数据库访问层
*
* @author makejava
* @since 2024-09-19 13:26:00
*/
@Repository("AttendanceDaoImpl")
public class AttendanceDaoImpl extends MybatisGenericDao<AttendanceEntity, String> implements IAttendanceDao{
@DS("KJS_DATA")
@Override
public Integer createLists(List<AttendanceEntity> entities) {
return super.insert("com.hzya.frame.kjsData.attendance.dao.impl.AttendanceEntityDaoImpl.AttendanceEntityInsertBatch",entities);
}
}

View File

@ -0,0 +1,173 @@
package com.hzya.frame.kjsData.attendance.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (Attendance)实体类
*
* @author makejava
* @since 2024-09-19 13:26:00
*/
public class AttendanceEntity extends BaseEntity {
private String userid;
private String username;
private String userdept;
private String userjob;
private String useraddress;
private String userlatitude;
private String userlongitude;
private String checktype;
private String sourcetype;
private String basechecktime;
private String gmtmodified;
private String userchecktime;
private String locationresult;
private String timeresult;
private String workdate;
private String outsideremark;
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getUserdept() {
return userdept;
}
public void setUserdept(String userdept) {
this.userdept = userdept;
}
public String getUserjob() {
return userjob;
}
public void setUserjob(String userjob) {
this.userjob = userjob;
}
public String getUseraddress() {
return useraddress;
}
public void setUseraddress(String useraddress) {
this.useraddress = useraddress;
}
public String getUserlatitude() {
return userlatitude;
}
public void setUserlatitude(String userlatitude) {
this.userlatitude = userlatitude;
}
public String getUserlongitude() {
return userlongitude;
}
public void setUserlongitude(String userlongitude) {
this.userlongitude = userlongitude;
}
public String getChecktype() {
return checktype;
}
public void setChecktype(String checktype) {
this.checktype = checktype;
}
public String getSourcetype() {
return sourcetype;
}
public void setSourcetype(String sourcetype) {
this.sourcetype = sourcetype;
}
public String getBasechecktime() {
return basechecktime;
}
public void setBasechecktime(String basechecktime) {
this.basechecktime = basechecktime;
}
public String getGmtmodified() {
return gmtmodified;
}
public void setGmtmodified(String gmtmodified) {
this.gmtmodified = gmtmodified;
}
public String getUserchecktime() {
return userchecktime;
}
public void setUserchecktime(String userchecktime) {
this.userchecktime = userchecktime;
}
public String getLocationresult() {
return locationresult;
}
public void setLocationresult(String locationresult) {
this.locationresult = locationresult;
}
public String getTimeresult() {
return timeresult;
}
public void setTimeresult(String timeresult) {
this.timeresult = timeresult;
}
public String getWorkdate() {
return workdate;
}
public void setWorkdate(String workdate) {
this.workdate = workdate;
}
public String getOutsideremark() {
return outsideremark;
}
public void setOutsideremark(String outsideremark) {
this.outsideremark = outsideremark;
}
}

View File

@ -0,0 +1,16 @@
<?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.kjsData.attendance.dao.impl.AttendanceEntityDaoImpl">
<!-- 批量新增 -->
<insert id="AttendanceEntityInsertBatch">
insert into attendance(userId, userName, userDept, userJob, userAddress, userLatitude, userLongitude, checkType, sourceType, baseCheckTime, gmtModified, userCheckTime, locationResult, timeResult, workDate, outsideRemark)
values
<foreach collection="list" item="entity" separator=",">
(#{entity.userid},#{entity.username},#{entity.userdept},#{entity.userjob},#{entity.useraddress},#{entity.userlatitude},#{entity.userlongitude},#{entity.checktype},#{entity.sourcetype},
#{entity.basechecktime}, #{entity.gmtmodified}, #{entity.userchecktime},
#{entity.locationresult},#{entity.timeresult},#{entity.workdate},#{entity.outsideremark})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,17 @@
package com.hzya.frame.kjsData.attendance.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.kjsData.attendance.entity.AttendanceEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* (Attendance)表服务接口
*
* @author makejava
* @since 2024-09-19 13:26:00
*/
public interface IAttendanceService{
JsonResultEntity createRecord(JSONObject requestData);
}

View File

@ -0,0 +1,48 @@
package com.hzya.frame.kjsData.attendance.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.hzya.frame.kjsData.attendance.entity.AttendanceEntity;
import com.hzya.frame.kjsData.attendance.dao.IAttendanceDao;
import com.hzya.frame.kjsData.attendance.service.IAttendanceService;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.wms_21.basemdm.service.impl.BaseMdmServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.ArrayList;
import java.util.List;
/**
* (Attendance)表服务实现类
*
* @author makejava
* @since 2024-09-19 13:26:00
*/
@Service("attendanceService")
public class AttendanceServiceImpl implements IAttendanceService {
private static final Logger logger = LoggerFactory.getLogger(AttendanceServiceImpl.class);
@Autowired
private IAttendanceDao attendanceDao;
@Override
public JsonResultEntity createRecord(JSONObject requestData){
List<AttendanceEntity> list = new ArrayList<>();
JSONArray jsonArray = requestData.getJSONArray("jsonStr");
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
AttendanceEntity entity = JSONObject.parseObject(jsonObject.toString(), new TypeReference<AttendanceEntity>() {});
list.add(entity);
}
attendanceDao.createLists(list);
return new JsonResultEntity("插入成功:"+ JSON.toJSONString(list),true);
}
}

View File

@ -0,0 +1,190 @@
package com.hzya.frame.ningboBankTreasury.dto.req;
import java.util.List;
/**
* @Description 交易明细查询请求参数
* @Author xiangerlin
* @Date 2024/7/24 17:52
**/
public class AccTransactionReq {
//客户号 必填
private String custId;
//账号列表 每次对多1000个账号 必填
private List<String> bankAccList;
//增量查询标识0增量查询 1全量查询
private String queryFlag;
//增量查询起始时间 yyyy-MM-dd HH:mm:ss
private String recTime;
//开始日期 yyyy-MM-dd
private String beginDate;
//结束日期 yyyy-MM-dd
private String endDate;
//起始金额
private String beginAmt;
//终止金额
private String endAmt;
//收支方向 0收入 1支出
private String cdSign;
//每页条数
private String pageSize;
//当前页数
private String currentPage;
//查询方式 0分页查询 1下载文件查询
private String queryType;
//账户标识 0统计助手 1实体账户
private String bankAccSign;//
//排序方式asc正序 desc倒序
private String sortType;
//单账号当日明细最大序号
private String singleAccTodayMaxOrderNo;
//币种编码
private String curCode;
//统计编号
private List<String> subBankAccList;
public String getCustId() {
return custId;
}
public void setCustId(String custId) {
this.custId = custId;
}
public List<String> getBankAccList() {
return bankAccList;
}
public void setBankAccList(List<String> bankAccList) {
this.bankAccList = bankAccList;
}
public String getQueryFlag() {
return queryFlag;
}
public void setQueryFlag(String queryFlag) {
this.queryFlag = queryFlag;
}
public String getRecTime() {
return recTime;
}
public void setRecTime(String recTime) {
this.recTime = recTime;
}
public String getBeginDate() {
return beginDate;
}
public void setBeginDate(String beginDate) {
this.beginDate = beginDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getBeginAmt() {
return beginAmt;
}
public void setBeginAmt(String beginAmt) {
this.beginAmt = beginAmt;
}
public String getEndAmt() {
return endAmt;
}
public void setEndAmt(String endAmt) {
this.endAmt = endAmt;
}
public String getCdSign() {
return cdSign;
}
public void setCdSign(String cdSign) {
this.cdSign = cdSign;
}
public String getPageSize() {
return pageSize;
}
public void setPageSize(String pageSize) {
this.pageSize = pageSize;
}
public String getCurrentPage() {
return currentPage;
}
public void setCurrentPage(String currentPage) {
this.currentPage = currentPage;
}
public String getQueryType() {
return queryType;
}
public void setQueryType(String queryType) {
this.queryType = queryType;
}
public String getBankAccSign() {
return bankAccSign;
}
public void setBankAccSign(String bankAccSign) {
this.bankAccSign = bankAccSign;
}
public String getSortType() {
return sortType;
}
public void setSortType(String sortType) {
this.sortType = sortType;
}
public String getSingleAccTodayMaxOrderNo() {
return singleAccTodayMaxOrderNo;
}
public void setSingleAccTodayMaxOrderNo(String singleAccTodayMaxOrderNo) {
this.singleAccTodayMaxOrderNo = singleAccTodayMaxOrderNo;
}
public String getCurCode() {
return curCode;
}
public void setCurCode(String curCode) {
this.curCode = curCode;
}
public List<String> getSubBankAccList() {
return subBankAccList;
}
public void setSubBankAccList(List<String> subBankAccList) {
this.subBankAccList = subBankAccList;
}
public AccTransactionReq() {
}
public AccTransactionReq(String custId, List<String> bankAccList) {
this.custId = custId;
this.bankAccList = bankAccList;
}
}

View File

@ -0,0 +1,209 @@
package com.hzya.frame.ningboBankTreasury.dto.req;
/**
* @Description 单笔转账请求参数
* @Author xiangerlin
* @Date 2024/7/26 16:27
**/
public class SingleTransferReq {
//客户号 必填
private String custId;
//付款账号 必填
private String payAcc;
//用途 必填长度不能超过70
private String purpose;
//收款账号 必填
private String rcvAcc;
//收款方行名 和联行号二者必须填一个
private String rcvBankName;
//收款方联行号 对公支付必填
private String rcvBankNo;
//金额 必填
private String amt;
//同城异地标识 0同城 1异地
private String areaSign;
//单位代码 必填
private String corpCode;
//是否同行转账 0他行 1同行
private String difBank;
//交易流水号
private String serialNo;
//对公对私标识 0对公 1对丝
private String isForIndividual;
//是否预约支付 0非预约 1预约
private String isSubscribe;
//是否短信通知收款人 0不通知 1通知只支持宁波银行付款的情况
private String isTellRcv;
//收款方手机号
private String rcvMobile;
//收款户名
private String rcvName;
//备注
private String remark;
//预约转账时间
private String wishPayTime;
//支付方式 0直接付款 1代理支付 2联动支付 3自动请款 为空时默认直接付款
private String payType;
//代理/联动账号/拨款账号
private String remarkAcc;
public String getCustId() {
return custId;
}
public void setCustId(String custId) {
this.custId = custId;
}
public String getPayAcc() {
return payAcc;
}
public void setPayAcc(String payAcc) {
this.payAcc = payAcc;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getRcvAcc() {
return rcvAcc;
}
public void setRcvAcc(String rcvAcc) {
this.rcvAcc = rcvAcc;
}
public String getRcvBankName() {
return rcvBankName;
}
public void setRcvBankName(String rcvBankName) {
this.rcvBankName = rcvBankName;
}
public String getRcvBankNo() {
return rcvBankNo;
}
public void setRcvBankNo(String rcvBankNo) {
this.rcvBankNo = rcvBankNo;
}
public String getAmt() {
return amt;
}
public void setAmt(String amt) {
this.amt = amt;
}
public String getAreaSign() {
return areaSign;
}
public void setAreaSign(String areaSign) {
this.areaSign = areaSign;
}
public String getCorpCode() {
return corpCode;
}
public void setCorpCode(String corpCode) {
this.corpCode = corpCode;
}
public String getDifBank() {
return difBank;
}
public void setDifBank(String difBank) {
this.difBank = difBank;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
public String getIsForIndividual() {
return isForIndividual;
}
public void setIsForIndividual(String isForIndividual) {
this.isForIndividual = isForIndividual;
}
public String getIsSubscribe() {
return isSubscribe;
}
public void setIsSubscribe(String isSubscribe) {
this.isSubscribe = isSubscribe;
}
public String getIsTellRcv() {
return isTellRcv;
}
public void setIsTellRcv(String isTellRcv) {
this.isTellRcv = isTellRcv;
}
public String getRcvMobile() {
return rcvMobile;
}
public void setRcvMobile(String rcvMobile) {
this.rcvMobile = rcvMobile;
}
public String getRcvName() {
return rcvName;
}
public void setRcvName(String rcvName) {
this.rcvName = rcvName;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getWishPayTime() {
return wishPayTime;
}
public void setWishPayTime(String wishPayTime) {
this.wishPayTime = wishPayTime;
}
public String getPayType() {
return payType;
}
public void setPayType(String payType) {
this.payType = payType;
}
public String getRemarkAcc() {
return remarkAcc;
}
public void setRemarkAcc(String remarkAcc) {
this.remarkAcc = remarkAcc;
}
}

View File

@ -0,0 +1,390 @@
package com.hzya.frame.ningboBankTreasury.dto.req;
import java.util.List;
/**
* @Description T/T汇款提交
* @Author xiangerlin
* @Date 2024/8/1 17:14
**/
public class TTRemitReq {
private String custId;
private String serialNo;
private String remitType;
private String transferType;
private String corpCode;
private String remitAddress;
private String bankType;
private String payMode;
private String estimateDate;
private String remitCurCode;
private String smallCurCode;
private String totalAmt;
private String transAmt;
private String subTransCode;
private String goods;
private String transAmt2;
private String subTransCode2;
private String goods2;
private String remitAcc;
private String curRemitAmt;
private String remitAcc2;
private String curRemitAmt2;
private String curRemitAmt3;
private String remitAcc3;
private String isAgent;
private String agentAcc;
private String agentBankSwiftCode;
private String rcvSettleType;
private String rcvBankCode;
private String rcvCountryCode;
private String rcvName;
private String rcvAddress;
private String rcvAcc;
private String costPayer;
private String costAcc;
private String isFullPay;
private String paymentProp;
private String contacts;
private String contactPhone;
private String payUnderFreeTax;
//private List<ContractDetail> contractDtlList;
private String postscript;
private List<String> fileUploadCodes;
public String getCustId() {
return custId;
}
public void setCustId(String custId) {
this.custId = custId;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
public String getRemitType() {
return remitType;
}
public void setRemitType(String remitType) {
this.remitType = remitType;
}
public String getTransferType() {
return transferType;
}
public void setTransferType(String transferType) {
this.transferType = transferType;
}
public String getCorpCode() {
return corpCode;
}
public void setCorpCode(String corpCode) {
this.corpCode = corpCode;
}
public String getRemitAddress() {
return remitAddress;
}
public void setRemitAddress(String remitAddress) {
this.remitAddress = remitAddress;
}
public String getBankType() {
return bankType;
}
public void setBankType(String bankType) {
this.bankType = bankType;
}
public String getPayMode() {
return payMode;
}
public void setPayMode(String payMode) {
this.payMode = payMode;
}
public String getEstimateDate() {
return estimateDate;
}
public void setEstimateDate(String estimateDate) {
this.estimateDate = estimateDate;
}
public String getRemitCurCode() {
return remitCurCode;
}
public void setRemitCurCode(String remitCurCode) {
this.remitCurCode = remitCurCode;
}
public String getSmallCurCode() {
return smallCurCode;
}
public void setSmallCurCode(String smallCurCode) {
this.smallCurCode = smallCurCode;
}
public String getTotalAmt() {
return totalAmt;
}
public void setTotalAmt(String totalAmt) {
this.totalAmt = totalAmt;
}
public String getTransAmt() {
return transAmt;
}
public void setTransAmt(String transAmt) {
this.transAmt = transAmt;
}
public String getSubTransCode() {
return subTransCode;
}
public void setSubTransCode(String subTransCode) {
this.subTransCode = subTransCode;
}
public String getGoods() {
return goods;
}
public void setGoods(String goods) {
this.goods = goods;
}
public String getTransAmt2() {
return transAmt2;
}
public void setTransAmt2(String transAmt2) {
this.transAmt2 = transAmt2;
}
public String getSubTransCode2() {
return subTransCode2;
}
public void setSubTransCode2(String subTransCode2) {
this.subTransCode2 = subTransCode2;
}
public String getGoods2() {
return goods2;
}
public void setGoods2(String goods2) {
this.goods2 = goods2;
}
public String getRemitAcc() {
return remitAcc;
}
public void setRemitAcc(String remitAcc) {
this.remitAcc = remitAcc;
}
public String getCurRemitAmt() {
return curRemitAmt;
}
public void setCurRemitAmt(String curRemitAmt) {
this.curRemitAmt = curRemitAmt;
}
public String getRemitAcc2() {
return remitAcc2;
}
public void setRemitAcc2(String remitAcc2) {
this.remitAcc2 = remitAcc2;
}
public String getCurRemitAmt2() {
return curRemitAmt2;
}
public void setCurRemitAmt2(String curRemitAmt2) {
this.curRemitAmt2 = curRemitAmt2;
}
public String getCurRemitAmt3() {
return curRemitAmt3;
}
public void setCurRemitAmt3(String curRemitAmt3) {
this.curRemitAmt3 = curRemitAmt3;
}
public String getRemitAcc3() {
return remitAcc3;
}
public void setRemitAcc3(String remitAcc3) {
this.remitAcc3 = remitAcc3;
}
public String getIsAgent() {
return isAgent;
}
public void setIsAgent(String isAgent) {
this.isAgent = isAgent;
}
public String getAgentAcc() {
return agentAcc;
}
public void setAgentAcc(String agentAcc) {
this.agentAcc = agentAcc;
}
public String getAgentBankSwiftCode() {
return agentBankSwiftCode;
}
public void setAgentBankSwiftCode(String agentBankSwiftCode) {
this.agentBankSwiftCode = agentBankSwiftCode;
}
public String getRcvSettleType() {
return rcvSettleType;
}
public void setRcvSettleType(String rcvSettleType) {
this.rcvSettleType = rcvSettleType;
}
public String getRcvBankCode() {
return rcvBankCode;
}
public void setRcvBankCode(String rcvBankCode) {
this.rcvBankCode = rcvBankCode;
}
public String getRcvCountryCode() {
return rcvCountryCode;
}
public void setRcvCountryCode(String rcvCountryCode) {
this.rcvCountryCode = rcvCountryCode;
}
public String getRcvName() {
return rcvName;
}
public void setRcvName(String rcvName) {
this.rcvName = rcvName;
}
public String getRcvAddress() {
return rcvAddress;
}
public void setRcvAddress(String rcvAddress) {
this.rcvAddress = rcvAddress;
}
public String getRcvAcc() {
return rcvAcc;
}
public void setRcvAcc(String rcvAcc) {
this.rcvAcc = rcvAcc;
}
public String getCostPayer() {
return costPayer;
}
public void setCostPayer(String costPayer) {
this.costPayer = costPayer;
}
public String getCostAcc() {
return costAcc;
}
public void setCostAcc(String costAcc) {
this.costAcc = costAcc;
}
public String getIsFullPay() {
return isFullPay;
}
public void setIsFullPay(String isFullPay) {
this.isFullPay = isFullPay;
}
public String getPaymentProp() {
return paymentProp;
}
public void setPaymentProp(String paymentProp) {
this.paymentProp = paymentProp;
}
public String getContacts() {
return contacts;
}
public void setContacts(String contacts) {
this.contacts = contacts;
}
public String getContactPhone() {
return contactPhone;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getPayUnderFreeTax() {
return payUnderFreeTax;
}
public void setPayUnderFreeTax(String payUnderFreeTax) {
this.payUnderFreeTax = payUnderFreeTax;
}
public String getPostscript() {
return postscript;
}
public void setPostscript(String postscript) {
this.postscript = postscript;
}
public List<String> getFileUploadCodes() {
return fileUploadCodes;
}
public void setFileUploadCodes(List<String> fileUploadCodes) {
this.fileUploadCodes = fileUploadCodes;
}
}

View File

@ -0,0 +1,472 @@
package com.hzya.frame.ningboBankTreasury.dto.res;
/**
* @Description 宁波银行 境内交易明细返回参数
* @Author xiangerlin
* @Date 2024/7/24 16:53
**/
public class AccTransactionRes {
//账号
private String bankAcc;
private String bankSubAcc;
//户名
private String accName;
//开户行名
private String bankName;
//对方户名
private String oppAccName;
//对方账号
private String oppAccNo;
//对方开户行名
private String oppAccBank;
//收支方向 0支出 1支出
private String cdSign;
//业务类型 其他
private String cdSignName;
//交易金额
private String amt;
//明细余额
private String bal;
//时间
private String transTime;
//子流水号
private String subSerialNo;
//交易流水号
private String serialNo;
//币种编号
private String curCode;
//用途
private String uses;
//摘要
private String abs;
//回单匹配号
private String voucherNo;
//银行类别代码
private String bifCode;
//银行类别
private String bankType;
//对方银行类别
private String oppBankType;
//对公对私标志 0对公 1对私
private String isForIndividual;
//流水号 这个字段是唯一的
private String serialId;
//银行交易流水号
private String bankSerialId;
//集团内交易
private String groupTrans;
//资金划拨
private String capitalTrans;
//交易备注
private String postScript;
private String accType;
private String accTypeName;
//现转标识
private String cashTfrFlg;
// 所属 行号
private String chinaDevelopBankNo;
// 所属 账号类型
private String chinaDevelopAccType;
//支付匹配号
private String payBillCode;
//业务基础订单号
private String alipayBaseOrderNumber;
//业务描述
private String alipayBusinessDescription;
//备注1
private String labelValue1;
private String labelValue2;
private String labelValue3;
private String labelValue4;
private String downloadNo;
//排序规则
private String sortRule;
//明细编码
private String orderNo;
//商品名称
private String alipayTradeName;
//回单匹配号
private String matchCode;
//回单个性化描述
private String receiptInfo;
//凭证号
private String billNum;
//明细更新时间
private String recTime;
public String getBankAcc() {
return bankAcc;
}
public void setBankAcc(String bankAcc) {
this.bankAcc = bankAcc;
}
public String getBankSubAcc() {
return bankSubAcc;
}
public void setBankSubAcc(String bankSubAcc) {
this.bankSubAcc = bankSubAcc;
}
public String getAccName() {
return accName;
}
public void setAccName(String accName) {
this.accName = accName;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getOppAccNo() {
return oppAccNo;
}
public void setOppAccNo(String oppAccNo) {
this.oppAccNo = oppAccNo;
}
public String getOppAccBank() {
return oppAccBank;
}
public void setOppAccBank(String oppAccBank) {
this.oppAccBank = oppAccBank;
}
public String getCdSign() {
return cdSign;
}
public void setCdSign(String cdSign) {
this.cdSign = cdSign;
}
public String getCdSignName() {
return cdSignName;
}
public void setCdSignName(String cdSignName) {
this.cdSignName = cdSignName;
}
public String getAmt() {
return amt;
}
public void setAmt(String amt) {
this.amt = amt;
}
public String getBal() {
return bal;
}
public void setBal(String bal) {
this.bal = bal;
}
public String getTransTime() {
return transTime;
}
public void setTransTime(String transTime) {
this.transTime = transTime;
}
public String getSubSerialNo() {
return subSerialNo;
}
public void setSubSerialNo(String subSerialNo) {
this.subSerialNo = subSerialNo;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
public String getCurCode() {
return curCode;
}
public void setCurCode(String curCode) {
this.curCode = curCode;
}
public String getUses() {
return uses;
}
public void setUses(String uses) {
this.uses = uses;
}
public String getAbs() {
return abs;
}
public void setAbs(String abs) {
this.abs = abs;
}
public String getVoucherNo() {
return voucherNo;
}
public void setVoucherNo(String voucherNo) {
this.voucherNo = voucherNo;
}
public String getBifCode() {
return bifCode;
}
public void setBifCode(String bifCode) {
this.bifCode = bifCode;
}
public String getBankType() {
return bankType;
}
public void setBankType(String bankType) {
this.bankType = bankType;
}
public String getOppBankType() {
return oppBankType;
}
public void setOppBankType(String oppBankType) {
this.oppBankType = oppBankType;
}
public String getIsForIndividual() {
return isForIndividual;
}
public void setIsForIndividual(String isForIndividual) {
this.isForIndividual = isForIndividual;
}
public String getSerialId() {
return serialId;
}
public void setSerialId(String serialId) {
this.serialId = serialId;
}
public String getBankSerialId() {
return bankSerialId;
}
public void setBankSerialId(String bankSerialId) {
this.bankSerialId = bankSerialId;
}
public String getGroupTrans() {
return groupTrans;
}
public void setGroupTrans(String groupTrans) {
this.groupTrans = groupTrans;
}
public String getCapitalTrans() {
return capitalTrans;
}
public void setCapitalTrans(String capitalTrans) {
this.capitalTrans = capitalTrans;
}
public String getPostScript() {
return postScript;
}
public void setPostScript(String postScript) {
this.postScript = postScript;
}
public String getAccType() {
return accType;
}
public void setAccType(String accType) {
this.accType = accType;
}
public String getAccTypeName() {
return accTypeName;
}
public void setAccTypeName(String accTypeName) {
this.accTypeName = accTypeName;
}
public String getCashTfrFlg() {
return cashTfrFlg;
}
public void setCashTfrFlg(String cashTfrFlg) {
this.cashTfrFlg = cashTfrFlg;
}
public String getChinaDevelopBankNo() {
return chinaDevelopBankNo;
}
public void setChinaDevelopBankNo(String chinaDevelopBankNo) {
this.chinaDevelopBankNo = chinaDevelopBankNo;
}
public String getChinaDevelopAccType() {
return chinaDevelopAccType;
}
public void setChinaDevelopAccType(String chinaDevelopAccType) {
this.chinaDevelopAccType = chinaDevelopAccType;
}
public String getPayBillCode() {
return payBillCode;
}
public void setPayBillCode(String payBillCode) {
this.payBillCode = payBillCode;
}
public String getAlipayBaseOrderNumber() {
return alipayBaseOrderNumber;
}
public void setAlipayBaseOrderNumber(String alipayBaseOrderNumber) {
this.alipayBaseOrderNumber = alipayBaseOrderNumber;
}
public String getAlipayBusinessDescription() {
return alipayBusinessDescription;
}
public void setAlipayBusinessDescription(String alipayBusinessDescription) {
this.alipayBusinessDescription = alipayBusinessDescription;
}
public String getLabelValue1() {
return labelValue1;
}
public void setLabelValue1(String labelValue1) {
this.labelValue1 = labelValue1;
}
public String getLabelValue2() {
return labelValue2;
}
public void setLabelValue2(String labelValue2) {
this.labelValue2 = labelValue2;
}
public String getLabelValue3() {
return labelValue3;
}
public void setLabelValue3(String labelValue3) {
this.labelValue3 = labelValue3;
}
public String getLabelValue4() {
return labelValue4;
}
public void setLabelValue4(String labelValue4) {
this.labelValue4 = labelValue4;
}
public String getDownloadNo() {
return downloadNo;
}
public void setDownloadNo(String downloadNo) {
this.downloadNo = downloadNo;
}
public String getSortRule() {
return sortRule;
}
public void setSortRule(String sortRule) {
this.sortRule = sortRule;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getAlipayTradeName() {
return alipayTradeName;
}
public void setAlipayTradeName(String alipayTradeName) {
this.alipayTradeName = alipayTradeName;
}
public String getMatchCode() {
return matchCode;
}
public void setMatchCode(String matchCode) {
this.matchCode = matchCode;
}
public String getReceiptInfo() {
return receiptInfo;
}
public void setReceiptInfo(String receiptInfo) {
this.receiptInfo = receiptInfo;
}
public String getBillNum() {
return billNum;
}
public void setBillNum(String billNum) {
this.billNum = billNum;
}
public String getRecTime() {
return recTime;
}
public void setRecTime(String recTime) {
this.recTime = recTime;
}
public String getOppAccName() {
return oppAccName;
}
public void setOppAccName(String oppAccName) {
this.oppAccName = oppAccName;
}
}

View File

@ -0,0 +1,94 @@
package com.hzya.frame.ningboBankTreasury.dto.res;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
/**
* @Description 宁波银行查询交易明细
* @Author xiangerlin
* @Date 2024/7/24 16:45
**/
public class AccTrxResponse {
//返回交易码 0000成功0001失败
private String retCode;
//返回信息
private String retMsg;
//每条页数
private String pageSize;
//当前页数
private String currentPage;
//总页数
private String totalPage;
//总条数
private String totalSize;
//收款明细列表
private List<AccTransactionRes> list;
public String getRetCode() {
return retCode;
}
public void setRetCode(String retCode) {
this.retCode = retCode;
}
public String getRetMsg() {
return retMsg;
}
public void setRetMsg(String retMsg) {
this.retMsg = retMsg;
}
public String getPageSize() {
return pageSize;
}
public void setPageSize(String pageSize) {
this.pageSize = pageSize;
}
public String getCurrentPage() {
return currentPage;
}
public void setCurrentPage(String currentPage) {
this.currentPage = currentPage;
}
public String getTotalPage() {
return totalPage;
}
public void setTotalPage(String totalPage) {
this.totalPage = totalPage;
}
public String getTotalSize() {
return totalSize;
}
public void setTotalSize(String totalSize) {
this.totalSize = totalSize;
}
public List<AccTransactionRes> getList() {
return list;
}
public void setList(List<AccTransactionRes> list) {
this.list = list;
}
public static AccTrxResponse valueOf(String str){
if (StrUtil.isNotEmpty(str) && JSONUtil.isTypeJSON(str)){
NingBoResponse ningBoResponse = JSONObject.parseObject(str,NingBoResponse.class);
AccTrxResponse accTrxResponse = ningBoResponse.getData().toJavaObject(AccTrxResponse.class);
return accTrxResponse;
}
return null;
}
}

View File

@ -0,0 +1,23 @@
package com.hzya.frame.ningboBankTreasury.dto.res;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
/**
* @Description 宁波银行返回对象
* @Author xiangerlin
* @Date 2024/7/24 17:46
**/
public class NingBoResponse {
@JSONField(name ="Data")
private JSONObject data;
public JSONObject getData() {
return data;
}
public void setData(JSONObject data) {
this.data = data;
}
}

View File

@ -0,0 +1,72 @@
package com.hzya.frame.ningboBankTreasury.enums;
/**
* @Description 币种枚举
* @Author xiangerlin
* @Date 2024/7/24 17:07
**/
public enum CurrencyEnum {
人民币("01","人民币","CNY"),
美元("02","美元","USD"),
澳元("03","澳元","AUD"),
欧元("04","欧元","EUR"),
日元("05","日元","JPY"),
英镑("06","英镑","GBP"),
港币("07","港币","HKD"),
新加坡元("08","新加坡元","SGD"),
加拿大元("09","加拿大元","CAD"),
瑞士("10","瑞士","CHF"),
泰铢("23","泰铢","THB"),
新台币("92","新台币","TWD"),
ALL("ALL","多币","ALL");
private final String code;
private final String name;
//英文代码 CNY USD之类的
private final String symbol;
CurrencyEnum(String code,String name,String symbol) {
this.code = code;
this.name = name;
this.symbol = symbol;
}
public String getName() {
return name;
}
public String getCode() {
return code;
}
public String getSymbol() {
return symbol;
}
/**
* 根据code获取币种名字
* @param code
* @return
*/
public static String getNameByCode(String code){
for (CurrencyEnum currency : values()) {
if (currency.code.equals(code)) {
return currency.name;
}
}
return null; // 或者抛出异常表示找不到对应的币种
}
/**
* 根据code获取币种符号
* @param code
* @return
*/
public static String getSymbolByCode(String code){
for (CurrencyEnum currency : values()) {
if (currency.code.equals(code)) {
return currency.symbol;
}
}
return null; // 或者抛出异常表示找不到对应的币种
}
}

View File

@ -0,0 +1,88 @@
package com.hzya.frame.ningboBankTreasury.enums;
/**
* @Description 转账状态
* @Author xiangerlin
* @Date 2024/7/29 17:11
**/
public enum PayStatusEnum {
SUCCESS("0","交易成功"),
// 失败状态
FAILED_DELETED("-2", "已删除"),
APPROVAL_REJECTED_CLOSED("-3", "审批打回交易关闭"),
TRANSACTION_FAILED("2", "交易失败"),
FUND_ALLOCATION_FAILED("4", "交易失败,资金下拨失败"),
LINKAGE_PAYMENT_FAILED_REFUNDED("5", "联动支付失败,资金退回成功"),
LINKAGE_PAYMENT_FAILED_REFUND_PENDING("6", "联动支付失败,资金退回查证中"),
LINKAGE_PAYMENT_FAILED_REFUND_FAILED("96", "联动支付失败,资金退回失败"),
PAYMENT_REQUEST_FAILED("112", "请款失败"),
// 其他状态
REJECTED("-1", "驳回"),
PENDING_VERIFICATION("1", "交易待查证"),
PENDING_SEND("3", "待发送"),
PENDING_APPROVAL("11", "待审批"),
APPROVAL_THROUGH("95", "审批通过"),
TEMPORARY_STORAGE("7", "暂存"),
WITHDRAWN_BY_OPERATOR("-4", "经办撤回"),
PAYMENT_REQUEST_PENDING("111", "请款查证中"),
PAYMENT_REQUEST_SUCCEEDED_PENDING_SEND("113", "请款成功,交易待发送"),
LINKAGE_PAYMENT_SUCCEEDED_PENDING_SEND("114", "联动支付成功,智能支付交易待发送");
// 枚举属性
private final String code;
private final String description;
// 枚举构造函数
PayStatusEnum(String code, String description) {
this.code = code;
this.description = description;
}
// 获取状态码
public String getCode() {
return code;
}
// 获取状态描述
public String getDescription() {
return description;
}
// 根据状态码查找枚举
public static PayStatusEnum fromCode(String code) {
for (PayStatusEnum status : PayStatusEnum.values()) {
if (status.getCode().equals(code)) {
return status;
}
}
throw new IllegalArgumentException("Unknown code: " + code);
}
public static String getByCode(String code){
for (PayStatusEnum status : PayStatusEnum.values()) {
if (status.getCode().equals(code)) {
return status.getDescription();
}
}
throw new IllegalArgumentException("Unknown code: " + code);
}
/**
* 是否为最终态
* @param code
* @return
*/
public static boolean isFinally(String code){
return SUCCESS.code.equals(code)
|| FAILED_DELETED.code.equals(code)
|| APPROVAL_REJECTED_CLOSED.code.equals(code)
|| TRANSACTION_FAILED.code.equals(code)
|| FUND_ALLOCATION_FAILED.code.equals(code)
|| LINKAGE_PAYMENT_FAILED_REFUNDED.code.equals(code)
|| LINKAGE_PAYMENT_FAILED_REFUND_PENDING.code.equals(code)
|| LINKAGE_PAYMENT_FAILED_REFUND_FAILED.code.equals(code)
|| PAYMENT_REQUEST_FAILED.code.equals(code);
}
}

View File

@ -0,0 +1,78 @@
package com.hzya.frame.ningboBankTreasury.enums;
/**
* @Description T/T汇款 支付状态枚举
* @Author xiangerlin
* @Date 2024/8/2 15:42
**/
public enum TTPayStatusEnum{
// 成功和失败状态
SUCCESS("0", "交易成功"),
TRANSACTION_FAILED("2", "交易失败"),
TRANSACTION_SENDING("8", "交易发送中"),
// 审批状态
APPROVAL_IN_PROGRESS("11-94", "审批中"),
APPROVAL_PASSED("95", "审批通过"),
APPROVAL_REJECTED_CLOSED("-3", "审批打回,交易关闭"),
// 其他状态
TEMPORARY_STORAGE("7", "暂存"),
DELETED("-2", "删除"),
BANK_PROCESSING("1", "银行处理中"),
APPROVAL_REJECTED("-1", "审批打回");
// 枚举属性
private final String code;
private final String description;
// 枚举构造函数
TTPayStatusEnum(String code, String description) {
this.code = code;
this.description = description;
}
// 获取状态码
public String getCode() {
return code;
}
// 获取状态描述
public String getDescription() {
return description;
}
// 根据状态码查找枚举
public static TTPayStatusEnum fromCode(String code) {
for (TTPayStatusEnum status : TTPayStatusEnum.values()) {
if (status.getCode().equals(code)) {
return status;
}
}
throw new IllegalArgumentException("Unknown code: " + code);
}
public static String getByCode(String code){
for (TTPayStatusEnum status : TTPayStatusEnum.values()) {
if (status.getCode().equals(code)) {
return status.getDescription();
}
}
throw new IllegalArgumentException("Unknown code: " + code);
}
/**
* 是否为最终态
* @param code
* @return
*/
public static boolean isFinally(String code){
return SUCCESS.code.equals(code)
|| APPROVAL_REJECTED_CLOSED.code.equals(code)
|| DELETED.code.equals(code)
|| TRANSACTION_FAILED.code.equals(code);
}
}

View File

@ -1,9 +1,14 @@
package com.hzya.frame.ningboBankTreasury.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.ningboBankTreasury.dto.req.AccTransactionReq;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTrxResponse;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import java.util.List;
public interface INingboBankTreasuryService {
@ -33,4 +38,22 @@ public interface INingboBankTreasuryService {
*
*/
SysExtensionApiEntity doChangeData(SysExtensionApiEntity entity);
/**
* 银行原生方法
* 分页方式 全量查询境内账户交易明细
* accTransactionReq.custId 客户号 必填
* accTransactionReq.bankAccList 账号列表 必填
* @param accTransactionReq
* @return
*/
List<AccTransactionRes> queryAccDetails(AccTransactionReq accTransactionReq);
/**
* esb方法
* 分页方式 全量查询境内账户交易明细
* @param jsonObject
* @return
*/
JsonResultEntity queryAccountDetailsEsb(JSONObject jsonObject);
}

View File

@ -1,11 +1,13 @@
package com.hzya.frame.ningboBankTreasury.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.bip.v3.v2207.dps.service.impl.PayMentServiceImpl;
import com.hzya.frame.ningboBankTreasury.dto.req.AccTransactionReq;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTrxResponse;
import com.hzya.frame.ningboBankTreasury.service.INingboBankTreasuryService;
import com.hzya.frame.ningboBankTreasury.util.NingboBankUtil;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity;
import com.hzya.frame.util.bipV3.SHA256Util;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.nbcb.sdk.OpenSDK;
@ -17,7 +19,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -30,7 +34,7 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 单笔查证接口
* @Description 单笔转账查证接口
* @Date 4:45 下午 2024/7/9
**/
@Override
@ -56,6 +60,7 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService
}
//发送数据
try {
logger.info("调用宁波银行接口最终参数:{}",dataJson);
String returnData = OpenSDK.send(productID,serviceID,dataJson.replace(" ",""));
if(returnData == null || "".equals(returnData)){
returnJson.put("retCode","9999");
@ -145,6 +150,105 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService
}
}
/**
* 分页方式 全量查询境内账户交易明细
* accTransactionReq.custId 客户号 必填
* accTransactionReq.bankAccList 账号列表 必填
*
* @param accTransactionReq
* @return
*/
@Override
public List<AccTransactionRes> queryAccDetails(AccTransactionReq accTransactionReq) {
accTransactionReq = defValue(accTransactionReq);
//当前页数
int currentPage = Integer.valueOf(accTransactionReq.getCurrentPage());
//总页数
int totalPage = 0;
JSONObject data = new JSONObject();
List<AccTransactionRes> resList = new ArrayList<>();
try {
do {
ConfigParam configParam = new ConfigParam("MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgTt6OadouxxxSDg/0SZdOIBqtnFGKrpwmL+quEUf+hfSgCgYIKoEcz1UBgi2hRANCAAQGHNN2NO7btp+w1248yk98E0asGC8sG0bmIzdom4M0xp3vc4IfXjmZ8omUz4oVcjzAuyMSSpJM6uPLcU1SH4HZ","http://cz-test.nbcb.com.cn:7070/nbcb/api","54b3e05c-7983-4e6c-8920-f9ab8a0004a6","MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEXAt6fxeKlpREIyXoT3jDwGU7L6JkKrzdOKP1cMB14rtNwwlyaUGLrtuHVoArAHP3x7XN2rUw0GxSngYQwOAsjQ==",10000,20000);
OpenSDK.dynamicInit(configParam,true);
data.put("Data",JSONObject.toJSONString(accTransactionReq));
logger.info("查询交易明细请求参数:{}",data.toString());
String returnData = OpenSDK.send(NingboBankUtil.TMSREPORT, NingboBankUtil.QUERYACCDETAIL,data.toString());
System.out.println(returnData);
logger.info("查询交易明细返回数据:{}",returnData);
AccTrxResponse accTrxResponse = AccTrxResponse.valueOf(returnData);
if (null != accTrxResponse && NingboBankUtil.isSuccess(accTrxResponse.getRetCode())){
totalPage = Integer.valueOf(accTrxResponse.getTotalPage());
resList.addAll(accTrxResponse.getList());
}
currentPage++;//页码自增
accTransactionReq.setCurrentPage(String.valueOf(currentPage));//页码
}while (currentPage <= totalPage);//当前页 <= 总页数 继续循环
} catch (Exception e) {
logger.error("查询账户交易明细出错:{}",e);
}
return resList;
}
/**
* esb方法
* 分页方式 全量查询境内账户交易明细
*
* @param jsonObject
* @return
*/
@Override
public JsonResultEntity queryAccountDetailsEsb(JSONObject jsonObject) {
JSONObject entity = getstrObj("jsonStr", jsonObject);
String dataJson = entity.getJSONObject("Data").getString("Data");
AccTransactionReq accTransactionReq = JSONObject.parseObject(dataJson,AccTransactionReq.class );
accTransactionReq = defValue(accTransactionReq);
//当前页数
int currentPage = Integer.valueOf(accTransactionReq.getCurrentPage());
//总页数
int totalPage = 0;
JSONObject data = new JSONObject();
List<AccTransactionRes> resList = new ArrayList<>();
try {
do {
data.put("Data",JSONObject.toJSONString(accTransactionReq));
entity.put("Data",data);
JSONObject param = new JSONObject();
param.put("jsonStr",entity);
logger.info("查询交易明细请求参数:{}",JSONObject.toJSONString(param));
JSONObject returnObj = (JSONObject) sendNbBank(param);
logger.info("查询交易明细返回数据:{}",returnObj.toString());
AccTrxResponse accTrxResponse = AccTrxResponse.valueOf(returnObj.toString());
if (null != accTrxResponse && NingboBankUtil.isSuccess(accTrxResponse.getRetCode())){
totalPage = Integer.valueOf(accTrxResponse.getTotalPage());
resList.addAll(accTrxResponse.getList());
}
currentPage++;//页码自增
accTransactionReq.setCurrentPage(String.valueOf(currentPage));//页码
}while (currentPage <= totalPage);//当前页 <= 总页数 继续循环
} catch (Exception e) {
logger.error("查询账户交易明细出错:{}",e);
return BaseResult.getFailureMessageEntity("查询账户交易明细出错"+e.getMessage());
}
return BaseResult.getSuccessMessageEntity("查询账户交易明细成功",resList);
}
//默认值检查
private AccTransactionReq defValue(AccTransactionReq accTransactionReq){
if (StrUtil.isEmpty(accTransactionReq.getPageSize())){
accTransactionReq.setPageSize("1000");
}
if (StrUtil.isEmpty(accTransactionReq.getCurrentPage())){
accTransactionReq.setCurrentPage("1");
}
if (StrUtil.isEmpty(accTransactionReq.getQueryType())){
accTransactionReq.setQueryType("0");
}
if (StrUtil.isEmpty(accTransactionReq.getCdSign())){
accTransactionReq.setCdSign(NingboBankUtil.SHOURU);
}
return accTransactionReq;
}
/**
* @param entity
* @content 此方法获取初始化参数拼接请求参数

View File

@ -0,0 +1,27 @@
package com.hzya.frame.ningboBankTreasury.util;
/**
* @Description 宁波银行
* @Author xiangerlin
* @Date 2024/7/24 18:15
**/
public class NingboBankUtil {
//产品id
public static final String TMSREPORT = "tmsReport";
//交易明细查询服务id
public static final String QUERYACCDETAIL = "queryAccDetail";
public static final String QUERYACCOUNT = "queryAccount";
//成功编码
public static final String SUCCESSCODE = "0000";
//收入
public static final String SHOURU = "0";
//支出
public static final String ZHICHU = "1";
//是否成功
public static boolean isSuccess(String retCode){
return SUCCESSCODE.equals(retCode) ? true : false;
}
}

View File

@ -0,0 +1,51 @@
package com.hzya.frame.seeyon.dao;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity;
import com.hzya.frame.seeyon.entity.CtpFileEntity;
import com.hzya.frame.seeyon.paybill.entity.PayBillEntity;
import java.util.List;
/**
*
* @content OA字段配置表DAO
* @className: Administrator
* @author laborer
* @date 2024-09-09 16:00
*
*/
public interface ICapFormDefinitionDao extends IBaseDao<CapFormDefinitionEntity,String> {
/**
*
* @content 通过模版编号获取无流程表单配置信息
* @className: Administrator
* @author laborer
* @date 2024-09-09 16:02
*
*/
List<CapFormDefinitionEntity> getFormFiled(CapFormDefinitionEntity fieldInfo);
/**
*
* @content 通过主键删除单据数据
* @className: Administrator
* @author laborer
* @date 2024-09-09 17:04
*
*/
int deleteByKey(CapFormDefinitionEntity fieldInfo);
/**
*
* @content 通过客户传递的数据值查询古河条件的数据
* @className: Administrator
* @author laborer
* @date 2024-09-09 17:05
*
*/
List<CapFormDefinitionEntity> getFormFiledByFileValue(CapFormDefinitionEntity fieldInfo);
}

View File

@ -0,0 +1,39 @@
package com.hzya.frame.seeyon.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.seeyon.dao.ICapFormDefinitionDao;
import com.hzya.frame.seeyon.dao.ICtpFileDao;
import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity;
import com.hzya.frame.seeyon.entity.CtpFileEntity;
import com.hzya.frame.seeyon.paybill.entity.PayBillEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
*
* @content OA字段配置表DAO
* @className: Administrator
* @author laborer
* @date 2024-09-09 16:00
*
*/
@Repository(value = "CapFormDefinitionDaoImpl")
public class CapFormDefinitionDaoImpl extends MybatisGenericDao<CapFormDefinitionEntity,String> implements ICapFormDefinitionDao {
@DS("#fieldInfo.dataSourceCode")
@Override
public List<CapFormDefinitionEntity> getFormFiled(CapFormDefinitionEntity fieldInfo) {
return (List<CapFormDefinitionEntity>) selectList("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_list_base",fieldInfo);
}
@DS("#fieldInfo.dataSourceCode")
@Override
public int deleteByKey(CapFormDefinitionEntity fieldInfo) {
return super.delete("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_delete",fieldInfo);
}
@DS("#fieldInfo.dataSourceCode")
@Override
public List<CapFormDefinitionEntity> getFormFiledByFileValue(CapFormDefinitionEntity fieldInfo) {
return (List<CapFormDefinitionEntity>) selectList("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_list_table_info",fieldInfo);
}
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.seeyon.dongj.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity;
/**
* @Description
* @Author xiangerlin
* @Date 2024/7/26 11:01
**/
public interface IFormmain0044Dao extends IBaseDao<Formmain0044Entity,String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.seeyon.dongj.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.seeyon.dongj.dao.IFormmain0044Dao;
import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity;
import org.springframework.stereotype.Repository;
/**
* @Description
* @Author xiangerlin
* @Date 2024/7/26 11:02
**/
@Repository()
public class Formmain0044DaoImpl extends MybatisGenericDao<Formmain0044Entity,String> implements IFormmain0044Dao {
}

View File

@ -0,0 +1,146 @@
package com.hzya.frame.seeyon.dongj.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description oa收款明细底表
* @Author xiangerlin
* @Date 2024/7/26 10:56
**/
public class Formmain0044Entity extends BaseEntity {
private String field0001; // 我方账号
private String field0017; // 我方开户行
private String field0024; // 我方户名
private String field0029; // 客户方账号
private String field0022; // 客户方户名
private String field0030; // 客户方开户行
private String field0018; // 交易日期
private String field0019; // 交易流水号 唯一值
private String field0020; // 收款金额
private String field0021; // 摘要
private String field0025; // 银行类型
private String field0026; // 银行流水号
private String field0027; // 币种
private String field0028; // 用途
private String start_date;
public String getField0001() {
return field0001;
}
public void setField0001(String field0001) {
this.field0001 = field0001;
}
public String getField0017() {
return field0017;
}
public void setField0017(String field0017) {
this.field0017 = field0017;
}
public String getField0024() {
return field0024;
}
public void setField0024(String field0024) {
this.field0024 = field0024;
}
public String getField0029() {
return field0029;
}
public void setField0029(String field0029) {
this.field0029 = field0029;
}
public String getField0022() {
return field0022;
}
public void setField0022(String field0022) {
this.field0022 = field0022;
}
public String getField0030() {
return field0030;
}
public void setField0030(String field0030) {
this.field0030 = field0030;
}
public String getField0018() {
return field0018;
}
public void setField0018(String field0018) {
this.field0018 = field0018;
}
public String getField0019() {
return field0019;
}
public void setField0019(String field0019) {
this.field0019 = field0019;
}
public String getField0020() {
return field0020;
}
public void setField0020(String field0020) {
this.field0020 = field0020;
}
public String getField0021() {
return field0021;
}
public void setField0021(String field0021) {
this.field0021 = field0021;
}
public String getField0025() {
return field0025;
}
public void setField0025(String field0025) {
this.field0025 = field0025;
}
public String getField0026() {
return field0026;
}
public void setField0026(String field0026) {
this.field0026 = field0026;
}
public String getField0027() {
return field0027;
}
public void setField0027(String field0027) {
this.field0027 = field0027;
}
public String getField0028() {
return field0028;
}
public void setField0028(String field0028) {
this.field0028 = field0028;
}
public String getStart_date() {
return start_date;
}
public void setStart_date(String start_date) {
this.start_date = start_date;
}
}

View File

@ -0,0 +1,57 @@
<?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.seeyon.dongj.dao.impl.Formmain0044DaoImpl">
<resultMap id="get-Formmain0044Entity-result" type="com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity">
<result property="id" column="id" />
<result property="field0001" column="field0001" />
<result property="field0017" column="field0017" />
<result property="field0024" column="field0024" />
<result property="field0029" column="field0029" />
<result property="field0022" column="field0022" />
<result property="field0030" column="field0030" />
<result property="field0018" column="field0018" />
<result property="field0019" column="field0019" />
<result property="field0020" column="field0020" />
<result property="field0021" column="field0021" />
<result property="field0025" column="field0025" />
<result property="field0026" column="field0026" />
<result property="field0027" column="field0027" />
<result property="field0028" column="field0028" />
</resultMap>
<sql id="Formmain0044Entity_Base_Column_List">
id,
field0001,
field0017,
field0024,
field0029,
field0022,
field0030,
field0018,
field0019,
field0020,
field0021,
field0025,
field0026,
field0027,
field0028
</sql>
<!-- 采用==查询 -->
<select id="entity_list_base" resultMap="get-Formmain0044Entity-result" parameterType="com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity">
select
<include refid="Formmain0044Entity_Base_Column_List"/>
from
formmain_0044
<trim prefix="where" prefixOverrides="and">
<if test="field0001 != null and field0001 !='' "> field0001 = #{field0001} </if>
<if test="field0019 != null and field0019 !='' "> and field0019 = #{field0019} </if>
<if test="field0018 != null and field0018 !='' "> and field0018 = #{field0018} </if>
<if test="start_date != null and start_date !='' "> and start_date >= #{start_date} </if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,16 @@
package com.hzya.frame.seeyon.dongj.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity;
import java.util.List;
/**
* @Description
* @Author xiangerlin
* @Date 2024/7/26 11:03
**/
public interface IFormmain0044Service extends IBaseService<Formmain0044Entity,String> {
List<Formmain0044Entity> querySeridId(Formmain0044Entity entity);
}

View File

@ -0,0 +1,40 @@
package com.hzya.frame.seeyon.dongj.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity;
import com.hzya.frame.seeyon.cbs8.service.ICbsLogService;
import com.hzya.frame.seeyon.dongj.dao.IFormmain0044Dao;
import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity;
import com.hzya.frame.seeyon.dongj.service.IFormmain0044Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description
* @Author xiangerlin
* @Date 2024/7/26 11:05
**/
@Service
public class Formmain0044ServiceImpl extends BaseService<Formmain0044Entity,String> implements IFormmain0044Service {
Logger log = LoggerFactory.getLogger(getClass());
private IFormmain0044Dao formmain0044Dao;
@Autowired
public void setFormmain0044Dao(IFormmain0044Dao dao) {
this.formmain0044Dao = dao;
this.dao = dao;
}
@DS(value = "#entity.dataSourceCode")
@Override
public List<Formmain0044Entity> querySeridId(Formmain0044Entity entity) {
List<Formmain0044Entity> list = formmain0044Dao.query(entity);
return list;
}
}

View File

@ -0,0 +1,71 @@
package com.hzya.frame.seeyon.entity;
import com.hzya.frame.web.entity.BaseEntity;
import java.io.File;
/**
*
* @content OA字段配置表
* @className: Administrator
* @author laborer
* @date 2024-09-09 15:48
*
*/
public class CapFormDefinitionEntity extends BaseEntity {
private String fieldInfo;//字段属性定义
private String viewInfo;//视图权限定义
private String appbindInfo;//应用绑定定义
private String tableName;//表名
private String fieldName;//字段名称
private String fieldValue;//字段值
public String getFieldValue() {
return fieldValue;
}
public void setFieldValue(String fieldValue) {
this.fieldValue = fieldValue;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
public String getFieldInfo() {
return fieldInfo;
}
public void setFieldInfo(String fieldInfo) {
this.fieldInfo = fieldInfo;
}
public String getViewInfo() {
return viewInfo;
}
public void setViewInfo(String viewInfo) {
this.viewInfo = viewInfo;
}
public String getAppbindInfo() {
return appbindInfo;
}
public void setAppbindInfo(String appbindInfo) {
this.appbindInfo = appbindInfo;
}
}

View File

@ -0,0 +1,41 @@
<?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.seeyon.entity.CapFormDefinitionEntity">
<resultMap id="get-CapFormDefinitionEntity-result" type="com.hzya.frame.seeyon.entity.CapFormDefinitionEntity">
<!--主键 -->
<result property="id" column="id" />
<result property="fieldInfo" column="field_info" />
<result property="viewInfo" column="view_info" />
<result property="appbindInfo" column="appbind_info" />
</resultMap>
<sql id="CapFormDefinitionEntity_sql">
id,
field_info,
view_info,
appbind_info
</sql>
<!-- 查询 采用==查询 -->
<select id="CapFormDefinitionEntity_list_base" resultMap="get-CapFormDefinitionEntity-result" parameterType="com.hzya.frame.seeyon.entity.CapFormDefinitionEntity">
select
<include refid="CapFormDefinitionEntity_sql"/>
from
cap_form_definition
<trim prefix="where" prefixOverrides="and">
<if test="appbindInfo != null and appbindInfo != ''">and APPBIND_INFO like '%${appbindInfo}%'</if>
</trim>
</select>
<!-- 查询 采用==查询 -->
<select id="CapFormDefinitionEntity_list_table_info" resultMap="get-CapFormDefinitionEntity-result" parameterType="com.hzya.frame.seeyon.entity.CapFormDefinitionEntity">
select id from ${tableName} where ${fieldName} = #{fieldValue}
</select>
<delete id="CapFormDefinitionEntity_delete" parameterType="com.hzya.frame.basedao.entity.RequestDisposeEntity">
delete from ${tableName} where ${fieldName} = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,11 @@
package com.hzya.frame.seeyon.receiptFor.dao;
import com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity;
import java.util.List;
public interface IReceiptForDao{
public List<ReceiptForEntity> getOaReceipt(ReceiptForEntity recEntity);
public int updateState(ReceiptForEntity recEntity);
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.seeyon.receiptFor.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.seeyon.receiptFor.dao.IReceiptForDao;
import com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("receiptForDao")
public class ReceiptForDaoImpl extends MybatisGenericDao implements IReceiptForDao {
@DS("#recEntity.dataSourceCode")
@Override
public List<ReceiptForEntity> getOaReceipt(ReceiptForEntity recEntity){
return super.selectList(getSqlIdPrifx()+"ReceiptForEntity_list_base",recEntity);
}
@DS("#recEntity.dataSourceCode")
@Override
public int updateState(ReceiptForEntity recEntity){
return super.update(getSqlIdPrifx()+"ReceiptForEntity_update_state",recEntity);
}
}

View File

@ -0,0 +1,293 @@
package com.hzya.frame.seeyon.receiptFor.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class ReceiptForEntity extends BaseEntity {
private String djrq;//field0003单据日期合同申请日期
private String dwbm;
private String hbbm;//field0090客商客商编码客商档案
private String lrr;
private String shr;
private String shrq;
private String state;
private String djbh;//field0001单据号
private Long wldx;//field0004往来对象
private String deptid;//field0091部门部门档案部门编码
private String ywybm;//field0092业务员人员档案业务员编码
private String bfyhzh;//field0060收款银行账号客户方账号
private String skyhmc;//field0062收款银行名称客户方开户行
private String dfyhzh;//field0014付款银行账号我方账号
private String fkyhmc;//field0051付款银行名称我方开户行
private String bzbm;//field0072币种默认CNY币种编码
private String dfbbje;
private String dfybje;
private String ddh;
private String bbhl;
private String contractno;
private String djlxbm;//交易类型编码
private String pj_jsfs;//结算方式编码
private String scomment;//备注
private String zyx22;//合同号
private String zyx24;//合同名称
private String zyx28;//用途
private String szxmid;//收支项目
public String getSzxmid() {
return szxmid;
}
public void setSzxmid(String szxmid) {
this.szxmid = szxmid;
}
public String getZyx28() {
return zyx28;
}
public void setZyx28(String zyx28) {
this.zyx28 = zyx28;
}
public String getZyx22() {
return zyx22;
}
public void setZyx22(String zyx22) {
this.zyx22 = zyx22;
}
public String getZyx24() {
return zyx24;
}
public void setZyx24(String zyx24) {
this.zyx24 = zyx24;
}
public String getScomment() {
return scomment;
}
public void setScomment(String scomment) {
this.scomment = scomment;
}
public String getPj_jsfs() {
return pj_jsfs;
}
public void setPj_jsfs(String pj_jsfs) {
this.pj_jsfs = pj_jsfs;
}
public String getDjlxbm() {
return djlxbm;
}
public void setDjlxbm(String djlxbm) {
this.djlxbm = djlxbm;
}
public String getDfbbje() {
return dfbbje;
}
public void setDfbbje(String dfbbje) {
this.dfbbje = dfbbje;
}
public String getDdh() {
return ddh;
}
public void setDdh(String ddh) {
this.ddh = ddh;
}
public String getBbhl() {
return bbhl;
}
public void setBbhl(String bbhl) {
this.bbhl = bbhl;
}
public String getContractno() {
return contractno;
}
public void setContractno(String contractno) {
this.contractno = contractno;
}
private String fph;//field0019发票号
private String zy;//field0059摘要
private String bzbm_code;//field0073币种编码
public String getFph() {
return fph;
}
public void setFph(String fph) {
this.fph = fph;
}
public String getZy() {
return zy;
}
public void setZy(String zy) {
this.zy = zy;
}
public String getBzbm_code() {
return bzbm_code;
}
public void setBzbm_code(String bzbm_code) {
this.bzbm_code = bzbm_code;
}
public String getDjbh() {
return djbh;
}
public void setDjbh(String djbh) {
this.djbh = djbh;
}
public Long getWldx() {
return wldx;
}
public void setWldx(Long wldx) {
this.wldx = wldx;
}
public String getDeptid() {
return deptid;
}
public void setDeptid(String deptid) {
this.deptid = deptid;
}
public String getYwybm() {
return ywybm;
}
public void setYwybm(String ywybm) {
this.ywybm = ywybm;
}
public String getBfyhzh() {
return bfyhzh;
}
public void setBfyhzh(String bfyhzh) {
this.bfyhzh = bfyhzh;
}
public String getSkyhmc() {
return skyhmc;
}
public void setSkyhmc(String skyhmc) {
this.skyhmc = skyhmc;
}
public String getDfyhzh() {
return dfyhzh;
}
public void setDfyhzh(String dfyhzh) {
this.dfyhzh = dfyhzh;
}
public String getFkyhmc() {
return fkyhmc;
}
public void setFkyhmc(String fkyhmc) {
this.fkyhmc = fkyhmc;
}
public String getBzbm() {
return bzbm;
}
public void setBzbm(String bzbm) {
this.bzbm = bzbm;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getDfybje() {
return dfybje;
}
public void setDfybje(String dfybje) {
this.dfybje = dfybje;
}
public String getDjrq() {
return djrq;
}
public void setDjrq(String djrq) {
this.djrq = djrq;
}
public String getDwbm() {
return dwbm;
}
public void setDwbm(String dwbm) {
this.dwbm = dwbm;
}
public String getHbbm() {
return hbbm;
}
public void setHbbm(String hbbm) {
this.hbbm = hbbm;
}
public String getLrr() {
return lrr;
}
public void setLrr(String lrr) {
this.lrr = lrr;
}
public String getShr() {
return shr;
}
public void setShr(String shr) {
this.shr = shr;
}
public String getShrq() {
return shrq;
}
public void setShrq(String shrq) {
this.shrq = shrq;
}
}

View File

@ -0,0 +1,119 @@
<?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.seeyon.receiptFor.dao.impl.ReceiptForDaoImpl">
<resultMap id="get-ReceiptForEntity-result" type="com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="dfybje" column="r_dfybje" jdbcType="VARCHAR"/>
<result property="djrq" column="r_djrq" jdbcType="VARCHAR"/>
<result property="dwbm" column="r_dwbm" jdbcType="VARCHAR"/>
<result property="hbbm" column="r_hbbm" jdbcType="VARCHAR"/>
<result property="lrr" column="r_lrr" jdbcType="VARCHAR"/>
<result property="shr" column="r_shr" jdbcType="VARCHAR"/>
<result property="shrq" column="r_shrq" jdbcType="VARCHAR"/>
<result property="djlxbm" column="djlxbm" jdbcType="VARCHAR"/>
<result property="pj_jsfs" column="pj_jsfs" jdbcType="VARCHAR"/>
<result property="djbh" column="r_djbh" jdbcType="VARCHAR"/>
<result property="wldx" column="r_wldx" jdbcType="INTEGER"/>
<result property="deptid" column="r_deptid" jdbcType="VARCHAR"/>
<result property="ywybm" column="r_ywybm" jdbcType="VARCHAR"/>
<result property="bfyhzh" column="bfyhzh" jdbcType="VARCHAR"/>
<result property="skyhmc" column="r_skyhmc" jdbcType="VARCHAR"/>
<result property="fkyhmc" column="r_fkyhmc" jdbcType="VARCHAR"/>
<result property="bzbm" column="r_bzbm" jdbcType="VARCHAR"/>
<result property="scomment" column="scomment" jdbcType="VARCHAR"/>
<result property="fph" column="r_fph" jdbcType="VARCHAR"/>
<result property="zy" column="r_zy" jdbcType="VARCHAR"/>
<result property="bzbm_code" column="r_bzbm_code" jdbcType="VARCHAR"/>
<result property="dfbbje" column="r_dfbbje" jdbcType="VARCHAR"/>
<result property="dfyhzh" column="dfyhzh" jdbcType="VARCHAR"/>
<result property="zyx22" column="zyx22" jdbcType="VARCHAR"/>
<result property="zyx24" column="zyx24" jdbcType="VARCHAR"/>
<result property="zyx28" column="zyx28" jdbcType="VARCHAR"/>
<result property="szxmid" column="szxmid" jdbcType="VARCHAR"/>
</resultMap>
<!-- <select id="ReceiptForEntity_list_base" resultMap="get-ReceiptForEntity-result" parameterType="com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity">-->
<!-- select-->
<!-- state as r_dfybje,-->
<!-- '2024-07-23' as r_djrq,-->
<!-- '001' as r_dwbm,-->
<!-- 'C000001' as r_hbbm,-->
<!-- '17633965916' as r_lrr,-->
<!-- '17633965916' as r_shr,-->
<!-- '2024-07-23' as r_shrq-->
<!-- from formmain_0045-->
<!-- </select>-->
<!-- <select id="ReceiptForEntity_list_base" resultMap="get-ReceiptForEntity-result" parameterType="com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity">-->
<!-- select-->
<!-- id,-->
<!-- '1' as r_dfybje,-->
<!-- '2024-07-23' as r_djrq,-->
<!-- '001' as r_dwbm,-->
<!-- field0090 as r_hbbm,-->
<!-- field0092 as r_lrr,-->
<!-- field0094 as r_shr,-->
<!-- '2024-07-23' as r_shrq-->
<!-- from formmain_0045-->
<!-- where field0089 = 'N'-->
<!-- <trim>-->
<!-- <if test="id !=null and id!=''">and id like concat('%',#{id},'%')</if>-->
<!-- </trim>-->
<!-- </select>-->
<select id="ReceiptForEntity_list_base" resultMap="get-ReceiptForEntity-result" parameterType="com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity">
select
id,
field0003 as r_djrq,
field0003 as r_shrq,
field0047 as r_dwbm,
field0090 as r_hbbm,
field0092 as r_lrr,
field0092 as r_shr,
field0013 as r_dfbbje,
field0011 as r_dfybje,
field0019 as r_fph,
'D2' as djlxbm,
field0095 as pj_jsfs,
field0014 as bfyhzh,
field0059 as r_zy,
field0073 as r_bzbm_code,
field0001 as r_djbh,
field0004 as r_wldx,
field0091 as r_deptid,
field0060 as dfyhzh,
field0062 as r_skyhmc,
field0014 as r_dfyhzh,
field0051 as r_fkyhmc,
field0073 as r_bzbm,
field0068 as scomment,
field0042 as zyx22,
field0009 as zyx24,
field0092 as r_ywybm,
field0096 as szxmid,
field0058 as zyx28
from formmain_0045
where field0089 is null
and finishedflag = '1'
<trim>
<if test="id !=null and id!=''">and id like concat('%',#{id},'%')</if>
</trim>
</select>
<!-- ReceiptForEntity_update_state-->
<!--通过主键修改方法-->
<update id="ReceiptForEntity_update_state" parameterType = "com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity" >
update formmain_0045 set field0089 = #{state} where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,11 @@
package com.hzya.frame.seeyon.receiptFor.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface IReceiptForService extends IBaseService<ReceiptForEntity,String> {
public JsonResultEntity sendReceiptFor(JSONObject requestJson);
}

View File

@ -0,0 +1,238 @@
package com.hzya.frame.seeyon.receiptFor.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.bip.v3.v2207.util.BipUtil;
import com.hzya.frame.seeyon.receiptFor.dao.IReceiptForDao;
import com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity;
import com.hzya.frame.seeyon.receiptFor.service.IReceiptForService;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service("ReceiptForServiceImpl")
public class ReceiptForServiceImpl extends BaseService<ReceiptForEntity,String> implements IReceiptForService {
Logger logger = LoggerFactory.getLogger(ReceiptForServiceImpl.class);
@Autowired
private IReceiptForDao receiptForDao;
@Autowired
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Override
public JsonResultEntity sendReceiptFor(JSONObject requestJson){
//获取重推信息id并记录日志
JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class);
String interId = requestJsonObj.getString("integration_task_living_details_id");
logger.info("收款单重推解析后:"+requestJsonObj.toString());
logger.info("收款单重新执行的任务主键:"+interId);
//更换数据源
JsonResultEntity resultEntity = new JsonResultEntity();
ReceiptForEntity entity = new ReceiptForEntity();
requestJson.put("db_code","djoatest");
entity.setDataSourceCode(requestJson.getString("db_code"));
//根据重推信息id查询该条重推记录信息
IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity();
if(StrUtil.isNotEmpty(interId)){
oldMsg = taskLivingDetailsService.get(interId);
}
String rootAppPk = oldMsg.getRootAppPk();
entity.setId(rootAppPk);
if(StrUtil.isEmpty(rootAppPk)){
//entity.setQueryState("查询");
}
//如果是重推是否通过entity传入的id只能查到一条数据
//entity.setId("-8845102890648320822");
List<ReceiptForEntity> receiptList = receiptForDao.getOaReceipt(entity);
logger.info("收款单查询数据{}",JSONObject.toJSONString(receiptList));
if(CollectionUtils.isNotEmpty(receiptList)){
for(ReceiptForEntity rec : receiptList){
try{
logger.info("组装数据");
JSONObject main = bindingAdd(rec);
logger.info("收款认领单推送数据:"+main.toString());
String result = BipUtil.sendOaToU8c(main.toString(),"8000350034");
logger.info("收款认领单推送结果:"+result);
IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity();
logDetails.setRootAppPk(rec.getId());
logDetails.setRootAppBill(rec.getDjbh());
logDetails.setNewTransmitInfo(result);
logDetails.setNewPushDate(new Date());
logDetails.setRootAppNewData(JSON.toJSONString(rec));
logDetails.setPluginId("OaReceiptPlugin");
JSONObject resultObj = JSON.parseObject(result);
boolean flag = resultObj.get("status").equals("success");
if(flag){
// 推送成功更新状态
rec.setState("Y");
}else{
// 推送失败
rec.setState("N");
}
rec.setDataSourceCode(requestJson.getString("db_code"));
try{
if(StrUtil.isEmpty(interId)){
if(flag){
//首推成功
taskLivingDetailsService.saveLogToSuccess(logDetails);
}else{
//首推失败
taskLivingDetailsService.saveLogToFail(logDetails);
}
}else{
logDetails.setId(interId);
if(flag){
//重推成功
taskLivingDetailsService.saveLogFailToSuccess(logDetails);
}else{
//重推失败把失败信息更新到重推表中
taskLivingDetailsService.updateLogFailToSuccess(logDetails);
}
}
}catch (Exception e){
logger.info("保存日志失败"+e.getMessage());
receiptForDao.updateState(rec);
e.printStackTrace();
}
receiptForDao.updateState(rec);
//
} catch (Exception e) {
logger.info("收款单执行失败1"+e);
logger.info("收款单执行失败"+e.getMessage());
e.printStackTrace();
}
}
}
return new JsonResultEntity("成功",true,resultEntity);
}
// @NotNull
// private JSONObject bindingAdd(ReceiptForEntity rec) {
// String djrq = rec.getDjrq().substring(0,10);
// if(djrq.length()>10){
// djrq = rec.getDjrq().substring(0,10);
// }
// String shrq = rec.getShrq().substring(0,10);
// if(shrq.length()>10){
// shrq = rec.getShrq().substring(0,10);
// }
//
// JSONObject childrenJson = new JSONObject();
// childrenJson.put("dfybje",rec.getDfybje());
//
// childrenJson.put("dfbbje","24");
// childrenJson.put("dfybje","12");
// childrenJson.put("ddh","1231231");
// childrenJson.put("fph","fph12312");
// childrenJson.put("zy","zy");
// childrenJson.put("bzbm_code","CNY");
// childrenJson.put("bbhl","2");
// childrenJson.put("contractno","hth123123");
//
//
// JSONArray childrenArray = new JSONArray();
// childrenArray.add(childrenJson);
//
// JSONObject parentvo = new JSONObject();
// parentvo.put("djrq",djrq);
// parentvo.put("dwbm",rec.getDwbm());
// parentvo.put("hbbm",rec.getHbbm());
// parentvo.put("lrr",rec.getLrr());
// parentvo.put("shr",rec.getShr());
// parentvo.put("shrq",shrq);
//
// JSONObject billvoJson = new JSONObject();
// billvoJson.put("children",childrenArray);
// billvoJson.put("parentvo",parentvo);
//
// JSONArray billvoArray = new JSONArray();
// billvoArray.add(billvoJson);
// JSONObject main = new JSONObject();
// main.put("billvo",billvoArray);
// return main;
// }
@NotNull
private JSONObject bindingAdd(ReceiptForEntity rec) {
// if(rec.getDjrq()!=null){
// String djrq = rec.getDjrq().substring(0,10);
// if(djrq.length()>10){
// djrq = rec.getDjrq().substring(0,10);
// }
// }
// if(rec.getShrq()!=null){
// String shrq = rec.getShrq().substring(0,10);
// if(shrq.length()>10){
// shrq = rec.getShrq().substring(0,10);
// }
// }
JSONObject childrenJson = new JSONObject();
childrenJson.put("dfybje",rec.getDfybje());
//childrenJson.put("dfbbje",rec.getDfbbje());
childrenJson.put("ddh",rec.getDdh());
childrenJson.put("fph",rec.getFph());
childrenJson.put("zy",rec.getZy());
childrenJson.put("bzbm_code",rec.getBzbm_code());
childrenJson.put("bbhl",rec.getBbhl());
childrenJson.put("contractno",rec.getContractno());
JSONArray childrenArray = new JSONArray();
childrenArray.add(childrenJson);
JSONObject parentvo = new JSONObject();
parentvo.put("djrq",rec.getDjrq().substring(0,10));
parentvo.put("dwbm",rec.getDwbm());
parentvo.put("hbbm",rec.getHbbm());
parentvo.put("lrr",rec.getLrr());
parentvo.put("djlxbm",rec.getDjlxbm());//交易类型编码
parentvo.put("shr",rec.getShr());
parentvo.put("shrq",rec.getShrq().substring(0,10));
parentvo.put("djbh",rec.getDjbh());
//parentvo.put("wldx",rec.getWldx());
parentvo.put("deptid",rec.getDeptid());
//parentvo.put("ywybm",rec.getYwybm());
parentvo.put("bfyhzh",rec.getBfyhzh());//本方银行账号
parentvo.put("skyhmc",rec.getSkyhmc());//收款银行账号
parentvo.put("pj_jsfs",rec.getPj_jsfs());//结算方式
parentvo.put("dfyhzh",rec.getDfyhzh());//对方银行账号
parentvo.put("scomment",rec.getScomment());//备注
parentvo.put("zyx22",rec.getZyx22());//合同号
parentvo.put("zyx24",rec.getZyx24());//合同名称
parentvo.put("zyx28",rec.getZyx28());//用途
parentvo.put("szxmid",rec.getSzxmid());//收支项目
parentvo.put("fkyhmc",rec.getFkyhmc());
parentvo.put("bzbm",rec.getBzbm());
JSONObject billvoJson = new JSONObject();
billvoJson.put("children",childrenArray);
billvoJson.put("parentvo",parentvo);
JSONArray billvoArray = new JSONArray();
billvoArray.add(billvoJson);
JSONObject main = new JSONObject();
main.put("billvo",billvoArray);
return main;
}
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.seeyon.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
*
* @content 无流程表单公用service
* @className: Administrator
* @author laborer
* @date 2024-09-09 14:53
*
*/
public interface INoProcessService {
/**
*
* @content 无流程删除通用接口
* @className: Administrator
* @author laborer
* @date 2024-09-09 15:08
*
*/
JsonResultEntity DeleteProcessField(JSONObject requestData);
}

View File

@ -26,4 +26,11 @@ public interface ISeeyonExtService {
* @param logEntity
*/
void ydcSeeyon2u8CallBack(SysMessageManageLogEntity logEntity);
/**
* 东进 宁波银行交易明细保存到OA底表参数组装
* @param entity
* @return
*/
SysExtensionApiEntity dongjAccLog(SysExtensionApiEntity entity);
}

View File

@ -0,0 +1,119 @@
package com.hzya.frame.seeyon.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.seeyon.dao.ICapFormDefinitionDao;
import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity;
import com.hzya.frame.seeyon.service.INoProcessService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
/**
*
* @content 无流程表单公用service
* @className: Administrator
* @author laborer
* @date 2024-09-09 14:53
*
*/
@Service(value = "NoProcessServiceImpl")
public class NoProcessServiceImpl implements INoProcessService {
private static final Logger logger = LoggerFactory.getLogger(NoProcessServiceImpl.class);
@Autowired
private ICapFormDefinitionDao capFormDefinitionDao;
@Override
public JsonResultEntity DeleteProcessField(JSONObject requestData) {
List<String>count =new ArrayList<>();
JSONObject jsonStrObj = requestData.getJSONObject("jsonStr");
String formCode = jsonStrObj.getString("formCode");
String fieldName = jsonStrObj.getString("fieldName");
String fieldValue = jsonStrObj.getString("fieldValue");
if(StrUtil.isEmpty(formCode)){
return new JsonResultEntity("表单编码不能为空formCode",false);
}
if(StrUtil.isEmpty(fieldName)){
return new JsonResultEntity("字段名称不能为空fieldName",false);
}
if(StrUtil.isEmpty(fieldValue)){
return new JsonResultEntity("字段值不能为空fieldValue",false);
}
//通过表单编号获取表单字段信息
CapFormDefinitionEntity fieldInfo = new CapFormDefinitionEntity();
fieldInfo.setAppbindInfo(formCode);
fieldInfo.setDataSourceCode("djoatest");
List<CapFormDefinitionEntity>capFormDefinitionEntityList = capFormDefinitionDao.getFormFiled(fieldInfo);
if(CollectionUtils.isEmpty(capFormDefinitionEntityList)){
return new JsonResultEntity("通过表单编号查询表单有误,请检查表单编号:"+formCode,false);
}
try {
capFormDefinitionEntityList.forEach(item->{
String appbindInfo = item.getAppbindInfo();
//格式化字段信息
JSONObject jsonObject = JSONObject.parseObject(appbindInfo);
boolean queryFlag = false;
//如果模版编号相同则继续删除反正跳过
if(formCode.equals(jsonObject.getString("formCode"))){
JSONObject field = JSONObject.parseObject(item.getFieldInfo());
JSONObject frontFormmain = field.getJSONObject("front_formmain");
JSONArray formsons = field.getJSONArray("formsons");
JSONArray fieldInfoTable = frontFormmain.getJSONArray("fieldInfo");
//验证需要删除的条件字段在表单属性中是否存在
for (int i = 0; i < fieldInfoTable.size(); i++) {
JSONObject fieldInfoTableObj = fieldInfoTable.getJSONObject(i);
String name = fieldInfoTableObj.getString("name");
//如果表单属性中存在该字段则验证通过如果不存在直接返回错误
if(name.equals(fieldName)){
queryFlag = true;
}
}
//验证通过获取数据库表名称进行数据删除
if(queryFlag){
String tableName = frontFormmain.getString("tableName");
//如果主表名称获取主表的主键进行数据删除
fieldInfo.setTableName(tableName);
fieldInfo.setFieldName(fieldName);
fieldInfo.setFieldValue(fieldValue);
List<CapFormDefinitionEntity>dataFormList = capFormDefinitionDao.getFormFiledByFileValue(fieldInfo);
if(CollectionUtils.isNotEmpty(dataFormList)){
dataFormList.forEach(item1->{
String id = item1.getId();
count.add(id);
fieldInfo.setFieldName("id");
fieldInfo.setId(id);
capFormDefinitionDao.deleteByKey(fieldInfo);
//循环该表单下面的所有子表信息进行子表删除
if(CollectionUtils.isNotEmpty(formsons)){
formsons.forEach(formsonsItem->{
JSONObject jsonObjectBoddy = JSONObject.parseObject(formsonsItem.toString());
String bodyTableName = jsonObjectBoddy.getString("tableName");
fieldInfo.setTableName(bodyTableName);
fieldInfo.setFieldName("formmain_id");
fieldInfo.setId(id);
capFormDefinitionDao.deleteByKey(fieldInfo);
});
}
});
}
}
}
});
} catch (Exception e) {
throw new RuntimeException(e);
}
return new JsonResultEntity("删除成功,删除的数据ID"+ JSON.toJSONString(count),true);
}
}

View File

@ -5,8 +5,10 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes;
import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity;
import com.hzya.frame.seeyon.service.ISeeyonExtService;
import com.hzya.frame.seeyon.util.RestUtil;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
@ -14,6 +16,7 @@ import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogStatusEnum;
import com.hzya.frame.u8.util.U8Util;
import com.hzya.frame.uuid.UUIDLong;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,6 +24,7 @@ import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -36,6 +40,8 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
@Autowired
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private RestUtil restUtil;
/**
* 英德赛 OA档案传U8
@ -150,6 +156,20 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
}
}
/**
* 东进 宁波银行交易明细保存到OA底表参数组装
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity dongjAccLog(SysExtensionApiEntity entity) {
String token = restUtil.getToken("", "8000340000");
Map<String, String> headers = entity.getHeaders();
headers.put("token",token);
return entity;
}
//存货参数组装
private SysExtensionApiEntity getInventory(JSONObject businessData,SysExtensionApiEntity param){
if (null != businessData){

View File

@ -206,4 +206,57 @@ public class RestUtil {
}
return null;
}
public static String sendU8CToOA(String parm, String apiCode,String userCode){
String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface";
//获取OAtoken
logger.info("推送参数"+parm);
JSONObject tokenObj = new JSONObject();
tokenObj.put("password","2cdd6cfc-5b87-47d1-aaea-756a55f6b5a6");
tokenObj.put("userName","restUser");
tokenObj.put("loginName",userCode);
tokenObj.put("loginName","yuqh");
String token = getOaTokenForEsb(tokenObj.toString(),"");
if(StrUtil.isNotEmpty(token)){
tokenObj = JSON.parseObject(token);
token = tokenObj.getString("id");
}
String result = HttpRequest.post(baseUrl)
.header("appId", "800034")//头信息多个头信息多次调用此方法即可
.header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可
.header("token", token)//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYA0iD/DtdYCBYE1AqHlz4All0gLb96p8G1xNjdGz4tDZlCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "nL860JIPqIuB0jUsJE5RZLcyZfi8ArRSz6rk0h69TDbkf3Qq0Jstwk9FIgbGa6ejj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(parm)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
logger.info("返回参数"+parm);
if(StrUtil.isNotEmpty(result)){
return analytic(result);
}
return null;
}
public static String getOaTokenForEsb(String parm, String apiCode){
String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface";
System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl)
.header("appId", "800034")//头信息多个头信息多次调用此方法即可
.header("apiCode", "8000340000")//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYA0iD/DtdYCBYE1AqHlz4All0gLb96p8G1xNjdGz4tDZlCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "nL860JIPqIuB0jUsJE5RZLcyZfi8ArRSz6rk0h69TDbkf3Qq0Jstwk9FIgbGa6ejj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(parm)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
System.out.println("返回参数"+result);
if(StrUtil.isNotEmpty(result)){
return analytic(result);
}
return null;
}
public static String analytic(String parm){
JSONObject main = JSON.parseObject(parm);
return main.getString("attribute");
}
}

View File

@ -40,7 +40,7 @@ import java.util.zip.ZipFile;
*/
@Service(value = "sys_fileUploadService")
public class FileUploadServiceImpl extends BaseService<FileUploadEntity, Long> implements IFileUploadService {
@Value("${savefile.path}")
@Value("${savefile.path:}")
public String DSK;
@Value("${savefile.pluginpath:}")

View File

@ -79,7 +79,7 @@
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = 'businesscenter'
TABLE_SCHEMA = 'businesscenter_kjs'
and TABLE_NAME = #{tableName}
</select>

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