Compare commits

...

51 Commits

Author SHA1 Message Date
476474485@qq.com d317c18910 调整OA插件调用方式 2025-04-17 08:47:31 +08:00
lvleigang 1319cce5f6 Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2025-02-18 16:37:41 +08:00
lvleigang d81f39f080 Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-11-06 13:57:44 +08:00
lvleigang 04801b5a64 Merge branches '237master' and 'fw-bip' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-11-06 13:57:06 +08:00
lvleigang e332567135 修改凭证接口 2024-11-06 13:55:53 +08:00
lvleigang 4a0e2e0f53 删除合同接口修改 2024-11-05 18:07:09 +08:00
lvleigang 53c145832a 删除合同接口修改 2024-11-05 17:10:31 +08:00
lvleigang 108dd57ad6 转换凭证 2024-11-05 13:56:40 +08:00
lvleigang a92e4e3ef9 Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-30 11:24:34 +08:00
lvleigang 14d3a6bf56 Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-25 16:53:25 +08:00
lvleigang 9228089692 Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-25 16:16:04 +08:00
lvleigang 7cf2f6d3c0 Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-25 15:31:38 +08:00
lvleigang f5500c7014 Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-25 15:20:34 +08:00
lvleigang e479808bbd Merge branches '237master' and 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-25 09:31:37 +08:00
lvleigang 97d952d469 修改237master依赖 2024-09-24 15:28:52 +08:00
lvleigang 25cd346dca Merge branch 'fw-weixin' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
 Conflicts:
	base-webapp/pom.xml
2024-09-24 15:26:52 +08:00
lvleigang 88a10fe9c8 Merge branch 'fw-ningbobank' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
 Conflicts:
	pom.xml
2024-09-24 15:26:12 +08:00
lvleigang 081772d2e3 Merge branch 'fw-bip' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
 Conflicts:
	pom.xml
2024-09-24 15:25:29 +08:00
lvleigang 93727f30b0 Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
 Conflicts:
	base-webapp/pom.xml
	pom.xml
2024-09-24 15:24:30 +08:00
lvleigang c1362f563a 修改master依赖 2024-09-24 15:22:55 +08:00
xiang2lin ace9f1c1c6 fix:
去掉没用的依赖
2024-09-24 11:14:37 +08:00
xiang2lin 86dbda2d28 fix:授权码接口默认设置token 2024-09-24 10:28:17 +08:00
xiang2lin 14f1503435 fix:@Value取值修改、子摸快依赖添加 2024-09-24 08:48:39 +08:00
xiang2lin 426932d0ab feat: 企业微信接口 2024-09-24 08:42:44 +08:00
lvleigang 28d5864f6e Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into fw-ningbobank
 Conflicts:
	pom.xml
2024-09-20 15:54:58 +08:00
lvleigang 2bb854e4a5 修改lib目录 2024-09-20 15:54:24 +08:00
lvleigang af75461f14 Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into fw-bip
 Conflicts:
	pom.xml
2024-09-20 15:53:13 +08:00
lvleigang 8a8ce95aa6 修改lib目录 2024-09-20 15:52:13 +08:00
lvleigang bb524e9831 Merge branches '237master' and 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-20 09:57:01 +08:00
lvleigang 92a564b441 237分支结构上传 2024-09-14 14:26:25 +08:00
lvleigang a16b05a9a2 Merge branch 'fw-u9c' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
 Conflicts:
	pom.xml
2024-09-14 14:24:53 +08:00
lvleigang 918848887c Merge branch 'fw-u8c' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-14 14:24:22 +08:00
lvleigang 2c7da04993 Merge branch 'fw-u8' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
 Conflicts:
	base-webapp/pom.xml
	pom.xml
2024-09-14 14:24:04 +08:00
lvleigang 96d1531b9a Merge branch 'fw-oa' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-14 14:23:45 +08:00
lvleigang ec223c07cd Merge branch 'fw-ningbobank' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
 Conflicts:
	base-webapp/pom.xml
	pom.xml
2024-09-14 14:23:31 +08:00
lvleigang d1255fb152 Merge branch 'fw-ncc' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-14 14:23:17 +08:00
lvleigang 3f68f17d62 Merge branch 'fw-nc' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
 Conflicts:
	base-webapp/pom.xml
	pom.xml
2024-09-14 14:23:02 +08:00
lvleigang 86d7b13da7 Merge branch 'fw-grpU8' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master 2024-09-14 14:22:46 +08:00
lvleigang 6b7821e2f3 Merge branch 'fw-dd' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
 Conflicts:
	base-webapp/pom.xml
	pom.xml
2024-09-14 14:22:30 +08:00
lvleigang cafd94c94f Merge branch 'fw-cbs' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into 237master
 Conflicts:
	base-webapp/pom.xml
	pom.xml
2024-09-14 14:21:36 +08:00
lvleigang 9f0fbc9d45 fw-u9c分支结构上传 2024-09-14 10:21:51 +08:00
lvleigang 2537ece2b1 fw-u8c分支结构上传 2024-09-14 10:17:59 +08:00
lvleigang 1d927c3eaa fw-oa分支结构上传 2024-09-14 10:13:01 +08:00
lvleigang 8b00953f47 fw-oa分支结构上传 2024-09-14 10:08:39 +08:00
lvleigang 988fd14adc fw-ningbobank分支结构上传 2024-09-14 10:03:53 +08:00
lvleigang a177292fe1 fw-ncc分支结构上传 2024-09-14 09:58:15 +08:00
lvleigang e11cf4b083 fw-nc分支结构上传 2024-09-14 09:53:23 +08:00
lvleigang 0fbc2b3679 fw-grpU8分支结构上传 2024-09-14 09:49:03 +08:00
lvleigang 7b372f3d0b fw-dd分支结构上传 2024-09-14 09:23:19 +08:00
lvleigang 333904fc99 fw-cbs分支结构上传 2024-09-14 09:17:10 +08:00
lvleigang 85e1821f75 fw-bip分支结构上传 2024-09-14 09:06:23 +08:00
528 changed files with 65378 additions and 115 deletions

View File

@ -44,7 +44,12 @@
<profile.active>zqtlocal</profile.active>
</properties>
</profile>
<profile>
<id>xel</id> <!--曾庆拓-->
<properties>
<profile.active>xel</profile.active>
</properties>
</profile>
</profiles>
<build>
<finalName>kangarooDataCenterV3</finalName>

View File

@ -3,7 +3,7 @@ logging:
#日志级别 指定目录级别
level:
root: warn
encodings: UTF-8
encodings: GBK
file:
# 日志保存路径
path: /home/webservice/zt/log
@ -14,7 +14,7 @@ spring:
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
password: bd993088e8a7c3dc5f44441617f9b4bf
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
@ -39,4 +39,5 @@ cbs8:
OA:
data_source_code: yc_oa
zt:
url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface
/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -30,13 +30,13 @@ import java.util.zip.ZipInputStream;
public class FileDownloadServiceImpl extends BaseService< FileDownloadEntity,Long> implements IFileDownloadService{
protected IFileDownloadDao filedownloadDao;
@Value("${savefile.path}")
@Value("${savefile.path:}")
public String DSK;
@Value("${savefile.pluginpath}")
@Value("${savefile.pluginpath:}")
public String PLUGINPATH;
@Value("${savefile.tomcatpath}")
@Value("${savefile.tomcatpath:}")
public String TOMCATPATH;
@Autowired
public void setFileDownloadDao(IFileDownloadDao dao) {

View File

@ -40,10 +40,10 @@ 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}")
@Value("${savefile.pluginpath:}")
public String PLUGINPATH;
protected IFileUploadDao fileUploadDao;

View File

@ -18,69 +18,69 @@
<artifactId>base-service</artifactId>
<version>${revision}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-bip</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-cbs</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-dd</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-bip</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-cbs</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-dd</artifactId>
<version>${revision}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-grpU8</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-nc</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-ncc</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-ningbobank</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-oa</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-u8</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-grpU8</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-nc</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-ncc</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-ningbobank</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-oa</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-u8</artifactId>
<version>${revision}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-u8c</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-u8c</artifactId>
<version>${revision}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-u9c</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-weixin</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-u9c</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-weixin</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<build>

85
fw-bip/pom.xml Normal file
View File

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

View File

@ -0,0 +1,15 @@
package com.hzya.frame.bip.v3.v2207.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.bip.v3.v2207.entity.BipArchivesEntity;
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
import java.util.List;
public interface IBipArchivesDao extends IBaseDao<BipArchivesEntity, String> {
List<BipArchivesEntity> queryArchivesData(BipArchivesEntity archivesEntity);
List<BipArchivesEntity> queryArchivesDatays(BipArchivesEntity archivesEntity);
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.bip.v3.v2207.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
import java.util.List;
public interface IBipOrgsDao extends IBaseDao<BipOrgsEntity, String> {
/**
* 查询BIP业务单元
* @param BipOrgsEntity
* @return
*/
List<BipOrgsEntity> thirdInterfaceGetOrgs(BipOrgsEntity BipOrgsEntity);
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.bip.v3.v2207.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity;
import java.util.List;
public interface IBipOrgsDetailsDao extends IBaseDao<BipOrgsDetailsEntity, String> {
/**
* 查询BIP业务单元银行账户
* @param BipOrgsDetailsEntity
* @return
*/
List<BipOrgsDetailsEntity> thirdInterfaceGetOrgsDetails(BipOrgsDetailsEntity BipOrgsDetailsEntity);
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.bip.v3.v2207.dao;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
import java.util.List;
public interface IBipSupplierDao extends IBaseDao<BipSupplierEntity, String> {
/**
* 查询BIP供应商
* @param bipSupplierEntity
* @return
*/
List<BipSupplierEntity> thirdInterfaceGetSupplier(BipSupplierEntity bipSupplierEntity);
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.bip.v3.v2207.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity;
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
import java.util.List;
public interface IBipSupplierDetailsDao extends IBaseDao<BipSupplierDetailsEntity, String> {
/**
* 查询BIP供应商明细
* @param bipSupplierDetailsEntity
* @return
*/
List<BipSupplierDetailsEntity> thirdInterfaceGetSupplierDetails(BipSupplierDetailsEntity bipSupplierDetailsEntity);
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.bip.v3.v2207.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipArchivesDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDao;
import com.hzya.frame.bip.v3.v2207.entity.BipArchivesEntity;
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("bipArchivesDaoImpl")
public class BipArchivesDaoImpl extends MybatisGenericDao<BipArchivesEntity,String> implements IBipArchivesDao {
@Override
public List<BipArchivesEntity> queryArchivesData(BipArchivesEntity entity) {
List<BipArchivesEntity> o = super.query(getSqlIdPrifx() + "queryArchivesData", entity);
return o;
} @Override
public List<BipArchivesEntity> queryArchivesDatays(BipArchivesEntity entity) {
List<BipArchivesEntity> o = super.query(getSqlIdPrifx() + "queryArchivesDatays", entity);
return o;
}
}

View File

@ -0,0 +1,24 @@
package com.hzya.frame.bip.v3.v2207.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("bipOrgsDaoImpl")
public class BipOrgsDaoImpl extends MybatisGenericDao<BipOrgsEntity,String> implements IBipOrgsDao {
/**
* 查询BIP业务单元
* @param BipOrgsEntity
* @return
*/
@DS("oracle91")
@Override
public List<BipOrgsEntity> thirdInterfaceGetOrgs(BipOrgsEntity BipOrgsEntity) {
return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipOrgsDaoImpl.thirdInterfaceGetOrgs",BipOrgsEntity);
}
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.bip.v3.v2207.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDetailsDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDetailsDao;
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("bipOrgsDetailsDaoImpl")
public class BipOrgsDetailsDaoImpl extends MybatisGenericDao<BipOrgsDetailsEntity,String> implements IBipOrgsDetailsDao {
@DS("oracle91")
@Override
public List<BipOrgsDetailsEntity> thirdInterfaceGetOrgsDetails(BipOrgsDetailsEntity bipOrgsDetailsEntity) {
return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipOrgsDetailsDaoImpl.thirdInterfaceGetOrgsDetails",bipOrgsDetailsEntity);
}
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.bip.v3.v2207.dao.impl;
import cn.hutool.http.HttpRequest;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
import com.hzya.frame.util.HttpUtil;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("bipSupplierDaoImpl")
public class BipSupplierDaoImpl extends MybatisGenericDao<BipSupplierEntity,String> implements IBipSupplierDao {
/**
* 查询BIP供应商
* @param bipSupplierEntity
* @return
*/
@DS("oracle91")
@Override
public List<BipSupplierEntity> thirdInterfaceGetSupplier(BipSupplierEntity bipSupplierEntity) {
return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipSupplierDaoImpl.thirdInterfaceGetSupplier",bipSupplierEntity);
}
}

View File

@ -0,0 +1,20 @@
package com.hzya.frame.bip.v3.v2207.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDetailsDao;
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity;
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("bipSupplierDetailsDaoImpl")
public class BipSupplierDetailsDaoImpl extends MybatisGenericDao<BipSupplierDetailsEntity,String> implements IBipSupplierDetailsDao {
@DS("oracle91")
@Override
public List<BipSupplierDetailsEntity> thirdInterfaceGetSupplierDetails(BipSupplierDetailsEntity bipSupplierDetailsEntity) {
return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipSupplierDetailsDaoImpl.thirdInterfaceGetSupplierDetails",bipSupplierDetailsEntity);
}
}

View File

@ -0,0 +1,38 @@
package com.hzya.frame.bip.v3.v2207.dps.service;
import com.alibaba.fastjson.JSONObject;
public interface IPayMentService {
/**
*
* @content 获取杭泰OA付款单传递CFS
* @Param
* @Return
* @Author hecan
* @Date 2023/10/16 11:59
* **/
String sendOAPayMentToCFS(JSONObject jsonObject, String type);
/**
*
* @content 获取CFS登录校验码
* @Param
* @Return
* @Author hecan
* @Date 2023/10/16 13:37
* **/
String sendCFSToken(String name, String password);
/**
*
* @content 获取杭泰OA报销单传递CFS
* @Param
* @Return
* @Author hecan
* @Date 2023/10/16 16:17
* **/
String sendExpenseToCFS(JSONObject jsonObject);
}

View File

@ -0,0 +1,389 @@
package com.hzya.frame.bip.v3.v2207.dps.service.impl;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.bip.v3.v2207.dps.service.IPayMentService;
import com.hzya.frame.dateutil.DateUtil;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.xml.sax.InputSource;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.StringReader;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Service(value = "payMentServiceImpl")
public class PayMentServiceImpl implements IPayMentService {
private static final Logger logger = LoggerFactory.getLogger(PayMentServiceImpl.class);
private static final String NAME="admin";
private static final String PASSWORD="aHRzejg4OA==";
private static final String CFSURL="http://101.132.140.208:26883/erp/services/";//测试端口:26893,正式端口:26883
/**
*
* @content 杭泰OA付款单传递CFS 付款单资金归集资金拨付同名账户划转和借款单都用同一个接口
* @Param
* @Return
* @Author hecan
* @Date 2023/10/13 10:40
* **/
public String sendOAPayMentToCFS(JSONObject jsonStr,String type){
logger.info("开始执行杭泰OA付款单传递CFS");
try {
String cfsToken = sendCFSToken(NAME, PASSWORD);
if(null!=cfsToken) {
String jsonStrObj = jsonStr.getString("jsonStr");
JSONObject jsonObjectMain = JSON.parseObject(jsonStrObj);
String erpVoucherNo = jsonObjectMain.getString("erpVoucherNo");//OA主键
String purpose = jsonObjectMain.getString("purpose");//摘要
String isForindividual = "0";//是否对私付款
StringBuffer stringBuffer = new StringBuffer();
String documentType=null;
switch (type){
case "pay"://付款单
documentType="01";
break;
case "fundc"://资金归集
documentType="02";
break;
case "funda"://资金拨付
documentType="03";
break;
case "acc"://同名账户划转
documentType="04";
break;
case "loan"://借款单
documentType="05";
break;
default:
break;
}
JSONArray jsonStrList = jsonObjectMain.getJSONArray("details");
if (null != jsonStrList && jsonStrList.size() > 0) {
for (Object seeyonEntity : jsonStrList) {
JSONObject jsonObjectFormson = JSON.parseObject(JSON.toJSONString(seeyonEntity));
String payerAccName = jsonObjectFormson.getString("payerAccName");//转出方账户名(付款账户)
String payerAccNo = jsonObjectFormson.getString("payerAccNo");//转出方账号(付款账号)
String curCode = jsonObjectFormson.getString("curCode");//付款方币种
String payeeAccName = jsonObjectFormson.getString("payeeAccName");//收款人帐户名称
String payeeAccNo = jsonObjectFormson.getString("payeeAccNo");//收款方账户号
BigDecimal amount = jsonObjectFormson.getBigDecimal("amount");//发生额
String payeeBankCode = jsonObjectFormson.getString("payeeBankCode");//联行号
String isQuick = jsonObjectFormson.getString("isQuick");//加急标志
String payType = jsonObjectFormson.getString("payType");//结算方式
String businessType = jsonObjectFormson.getString("businessType");//业务类别
stringBuffer.append("<map>\n");
stringBuffer.append("<documentType>" + nullConvert(documentType) + "</documentType>\n");
stringBuffer.append("<erpVoucherNo>" + nullConvert(erpVoucherNo) + "</erpVoucherNo>\n");
//stringBuffer.append("<payerAccName>"+"浙江杭泰数智能源开发有限公司"+"</payerAccName>\n");
stringBuffer.append("<payerAccName>"+nullConvert(payerAccName)+"</payerAccName>\n");
//stringBuffer.append("<payerAccNo>" +"71010122002702903"+ "</payerAccNo>\n");
stringBuffer.append("<payerAccNo>" + nullConvert(payerAccNo) + "</payerAccNo>\n");
stringBuffer.append("<curCode>" + nullConvert(curCode) + "</curCode>\n");
stringBuffer.append("<payeeAccName>" + nullConvert(payeeAccName) + "</payeeAccName>\n");
stringBuffer.append("<payeeAccNo>" + nullConvert(payeeAccNo) + "</payeeAccNo>\n");
stringBuffer.append("<amount>" + nullConvert(String.valueOf(amount)) + "</amount>\n");
//stringBuffer.append("<payeeBankCode>"+"301331000029"+"</payeeBankCode>\n");
stringBuffer.append("<payeeBankCode>"+nullConvert(payeeBankCode)+"</payeeBankCode>\n");
stringBuffer.append("<isQuick>" + nullConvert(isQuick) + "</isQuick>\n");
stringBuffer.append("<isForindividual>" + nullConvert(isForindividual) + "</isForindividual>\n");
stringBuffer.append("<payType>" + nullConvert(payType) + "</payType>\n");
stringBuffer.append("<purpose>" + nullConvert(purpose) + "</purpose>\n");
stringBuffer.append("<businessType>" + nullConvert(businessType) + "</businessType>\n");
stringBuffer.append("<debitByCustomer>" + nullConvert(jsonObjectFormson.getString("debitByCustomer")) + "</debitByCustomer>\n");//借方客商辅助核算编码
stringBuffer.append("<debitByBankAcc>" + nullConvert(payeeAccNo) + "</debitByBankAcc>\n");//借方银行账户辅助核算编码
stringBuffer.append("<debitByPersonnel>" + nullConvert(jsonObjectFormson.getString("debitByPersonnel")) + "</debitByPersonnel>\n");//借方人员辅助核算编码
stringBuffer.append("<creditByCustomer>" + nullConvert(jsonObjectFormson.getString("creditByCustomer")) + "</creditByCustomer>\n");//贷方客商辅助核算编码
stringBuffer.append("<creditByBankAcc>" + nullConvert(payerAccNo) + "</creditByBankAcc>\n");//贷方银行辅助核算编码
stringBuffer.append("</map>\n");
}
} else {
stringBuffer.append("<map>\n");
stringBuffer.append("<erpVoucherNo>" + nullConvert(erpVoucherNo) + "</erpVoucherNo>");
stringBuffer.append("<purpose>" + nullConvert(purpose) + "</purpose>");
stringBuffer.append("<isForindividual>" + nullConvert(isForindividual) + "</isForindividual>");
stringBuffer.append("</map>\n");
}
String result=null;
String xml= requestXML(cfsToken,"BkPaymentMainExchange",stringBuffer,"OA付款单同步发送");
String url = "HTSZ_OA_BkPaymentMainWebService?wsdl";
switch (type){
case "pay"://付款单
logger.info("OA付款单发送CFS的请求参数为:{}", xml);
result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
logger.info("OA付款单发送CFS的返回参数为:{}", result);
break;
case "fundc"://资金归集
logger.info("OA资金归集发送CFS的请求参数为:{}", xml);
result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
logger.info("OA资金归集发送CFS的返回参数为:{}", result);
break;
case "funda"://资金调拨
logger.info("OA资金拨付发送CFS的请求参数为:{}", xml);
result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
logger.info("OA资金拨付发送CFS的返回参数为:{}", result);
break;
case "acc"://同名账户划转
logger.info("OA同名账户划转发送CFS的请求参数为:{}", xml);
result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
logger.info("OA同名账户划转发送CFS的返回参数为:{}", result);
break;
case "loan"://借款单
logger.info("OA借还款发送CFS的请求参数为:{}", xml);
result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
logger.info("OA借还款发送CFS的返回参数为:{}", result);
break;
default:
break;
}
return analyzeXML(result,"pay");
}else{
logger.info("请先登录CFS登录接口获取Token");
return null;
}
} catch (Exception e) {
e.printStackTrace();
logger.info("杭泰OA付款单传递CFS错误原因为:{}", e.getMessage());
}
return null;
}
/**
*
* @content 获取CFS登录校验码
* @Param
* @Return
* @Author hecan
* @Date 2023/10/13 15:38
* **/
public String sendCFSToken(String name,String password) {
try {
String xml="<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:mdm=\"http://mdmData.server.webservice.banck.com\">\n" +
" <soap:Header/>\n" +
" <soap:Body>\n" +
" <mdm:intoPaymentDataXml>\n" +
" <!--Optional:-->\n" +
" <mdm:xml>\n" +
" <![CDATA[\n" +
" <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<message>\n" +
"<head>\n" +
"<transCode>LogOn</transCode>\n" +
"<erpTimestamp>"+DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss")+"</erpTimestamp>\n" +
"<sourcePlat>OA</sourcePlat>\n" +
"<desPlat>CFS</desPlat>\n" +
"<rmk>OA登录验证发送</rmk>\n" +
"</head>\n" +
"<body>\n" +
"<user>"+name+"</user>\n" +
"<password>"+password+"</password>\n" +
"</body>\n" +
"</message>\n" +
" ]]>\n" +
" </mdm:xml>\n" +
" </mdm:intoPaymentDataXml>\n" +
" </soap:Body>\n" +
"</soap:Envelope>";
logger.info("CFS登录的请求参数为:{}",xml);
String url="HTSZ_OA_LogOnWebService?wsdl";
String result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
logger.info("CFS登录的返回参数为:{}",result);
return analyzeXML(result,"login");
}catch (Exception e){
e.printStackTrace();
logger.info("获取CFS登录失败原因为:{}",e.getMessage());
}
return null;
}
/**
*
* @content 获取杭泰OA报销单传递CFS
* @Param
* @Return
* @Author hecan
* @Date 2023/10/16 16:17
* **/
@Override
public String sendExpenseToCFS(JSONObject jsonStr) {
logger.info("开始执行杭泰OA报销单传递CFS");
try {
String token = sendCFSToken(NAME, PASSWORD);
if(null != token){
String jsonStrObj = jsonStr.getString("jsonStr");
JSONObject jsonObjectMain = JSON.parseObject(jsonStrObj);
String erpVoucherNo = jsonObjectMain.getString("erpVoucherNo");//OA主键
String purpose = jsonObjectMain.getString("purpose");//摘要
StringBuffer stringBuffer = new StringBuffer();
JSONArray jsonStrList = jsonObjectMain.getJSONArray("details");
if(null != jsonStrList && jsonStrList.size()>0){
for (Object o : jsonStrList) {
JSONObject jsonObjectDetails = JSON.parseObject(JSON.toJSONString(o));
String payerAccName = jsonObjectDetails.getString("payerAccName");//转出方账户名(付款账户)
String payerAccNo = jsonObjectDetails.getString("payerAccNo");//转出方账号(付款账号)
String curCode = jsonObjectDetails.getString("curCode");//付款方币种
String payeeAccName = jsonObjectDetails.getString("payeeAccName");//收款人帐户名称
String payeeAccNo = jsonObjectDetails.getString("payeeAccNo");//收款方账户号
BigDecimal amount = jsonObjectDetails.getBigDecimal("amount");//发生额
String payeeBankCode = jsonObjectDetails.getString("payeeBankCode");//联行号
String isQuick = jsonObjectDetails.getString("isQuick");//加急标志
String payType = jsonObjectDetails.getString("payType");//结算方式
stringBuffer.append("<map>\n");
stringBuffer.append("<erpVoucherNo>" + nullConvert(erpVoucherNo) + "</erpVoucherNo>\n");
stringBuffer.append("<payerAccName>" + nullConvert(payerAccName) + "</payerAccName>\n");
//stringBuffer.append("<payerAccName>"+"浙江杭泰数智能源开发有限公司"+"</payerAccName>\n");
stringBuffer.append("<payerAccNo>" + nullConvert(payerAccNo) + "</payerAccNo>\n");
//stringBuffer.append("<payerAccNo>" +"71010122002702903"+ "</payerAccNo>\n");
stringBuffer.append("<curCode>" + nullConvert(curCode) + "</curCode>\n");
stringBuffer.append("<payeeAccName>" + nullConvert(payeeAccName) + "</payeeAccName>\n");
stringBuffer.append("<payeeAccNo>" + nullConvert(payeeAccNo) + "</payeeAccNo>\n");
stringBuffer.append("<amount>" + nullConvert(String.valueOf(amount)) + "</amount>\n");
stringBuffer.append("<payeeBankCode>" + nullConvert(payeeBankCode) + "</payeeBankCode>\n");
//stringBuffer.append("<payeeBankCode>"+"301331000029"+"</payeeBankCode>\n");
stringBuffer.append("<isQuick>" + nullConvert(isQuick) + "</isQuick>\n");
stringBuffer.append("<payType>" + nullConvert(payType) + "</payType>\n");
stringBuffer.append("<purpose>" + nullConvert(purpose) + "</purpose>\n");
stringBuffer.append("</map>\n");
}
} else {
stringBuffer.append("<map>\n");
stringBuffer.append("<erpVoucherNo>" + erpVoucherNo + "</erpVoucherNo>\n");
stringBuffer.append("<purpose>" + purpose + "</purpose>\n");
stringBuffer.append("</map>\n");
}
String xml= requestXML(token,"BkExpenseExchange",stringBuffer,"OA费用报销单同步发送");
logger.info("OA报销单发送CFS的请求参数为:{}", xml);
String url = "HTSZ_OA_BkExpenseWebService?wsdl";
String result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
logger.info("OA报销单发送CFS的返回参数为:{}", result);
return analyzeXML(result,"pay");
}
}catch (Exception e){
logger.info("杭泰OA报销单传递CFS错误原因为:{}", e.getMessage());
}
return null;
}
//null转成空字符串
private static String nullConvert(String str){
if (null == str){
return "";
}
return str;
}
private String requestXML(String token,String code,StringBuffer stringBuffer,String remark){
String xml = "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:mdm=\"http://mdmData.server.webservice.banck.com\">\n" +
" <soap:Header/>\n" +
" <soap:Body>\n" +
" <mdm:intoPaymentDataXml>\n" +
" <!--Optional:-->\n" +
" <mdm:xml>\n" +
" <![CDATA[\n" +
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<message>\n" +
"<head>\n" +
"<transCode>" + code + "</transCode>\n" +
"<erpTimestamp>" + DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + "</erpTimestamp>\n" +
"<sourcePlat>OA</sourcePlat>\n" +
"<desPlat>CFS</desPlat>\n" +
"<rmk>" + remark + "</rmk>\n" +
"<sessionId>" + token + "</sessionId>\n" +
"</head>\n" +
"<body>\n" +
"<list>\n";
if (stringBuffer != null) {
xml += stringBuffer.toString();
xml += "</list>\n" +
"</body>\n" +
"</message>\n" +
" ]]>\n" +
" </mdm:xml>\n" +
" </mdm:intoPaymentDataXml>\n" +
" </soap:Body>\n" +
"</soap:Envelope>";
} else {
xml += "</list>\n" +
"</body>\n" +
"</message>\n" +
"]]>\n" +
" </mdm:xml>\n" +
" </mdm:intoPaymentDataXml>\n" +
" </soap:Body>\n" +
"</soap:Envelope>";
}
return xml;
}
/**
*
* @content 解析CFS返回的xml格式
* @Param
* @Return
* @Author hecan
* @Date 2023/10/19 14:07
* **/
private static String analyzeXML(String result,String type){
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
org.w3c.dom.Document document = builder.parse(new InputSource(new StringReader(result)));
org.w3c.dom.Element bodyElement = (org.w3c.dom.Element) document.getElementsByTagName("ns:return").item(0);
if (null!=bodyElement) {
String textContent = bodyElement.getTextContent();
Document documentContext = DocumentHelper.parseText(textContent);
Element rootElement = documentContext.getRootElement();
Element body = rootElement.element("body");
if (null != body) {
switch (type) {
case "login"://登录
Element sessionId = body.element("sessionId");
if (null != sessionId) {
logger.info("CFS登录的登录校验码为:{}", sessionId.getText());
return sessionId.getText();
} else {
logger.info("CFS登录的登录校验码没有获取到请重新获取");
return null;
}
case "pay"://付款单和报销单
Element list = body.element("list");
List<Element> elements = list.elements();
String serialNo = null;
String statusMsg = null;
String erpVoucherNoCfs = null;
for (Element element : elements) {
serialNo = element.element("serialNo").getText();
statusMsg = element.element("statusMsg").getText();
erpVoucherNoCfs = element.element("erpVoucherNo").getText();
}
JSONObject jsonObject=new JSONObject();
jsonObject.put("erpVoucherNoCfs",erpVoucherNoCfs);
jsonObject.put("statusMsg",statusMsg);
jsonObject.put("serialNo",serialNo);
//return "当前单据:" + erpVoucherNoCfs + ",传递CFS返回信息:" + statusMsg + ",流水号:" + serialNo;
return jsonObject.toJSONString();
default:
break;
}
}
}
}catch (Exception e){
logger.info("解析CFS返回的xml格式错误:{}",e.getMessage());
}
return null;
}
}

View File

@ -0,0 +1,194 @@
package com.hzya.frame.bip.v3.v2207.dps.task;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.bip.v3.v2207.dps.service.IPayMentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.File;
import java.util.HashMap;
@EnableScheduling
@Component
public class ElectronicTask {
static Logger logger= LoggerFactory.getLogger(ElectronicTask.class);
@Resource
private IPayMentService payMentService;
//@Resource
//private ISeeYonDao seeYonDao;
//@Resource
//private ICtpAttachmentDao ctpAttachmentDao;
//@Scheduled(cron = "0 20 10 * * ?")
//public void sendElectronicToCFS() {
// logger.info("CFS电子回单共享开始执行---------->");
// try {
// String token = payMentService.sendCFSToken("admin", "aHRzejg4OA==");
// if(null!=token) {
// List<SeeyonEntity> seeyonEntities = seeYonDao.selectOAListByTypeformmain_0327(new SeeyonEntity());
// if (seeyonEntities != null && seeyonEntities.size() > 0) {
// for (SeeyonEntity seeyonEntity : seeyonEntities) {
// String bankAcc = seeyonEntity.getField0137();//付款账号
// //String bankAcc="03005389347";
// String erpVoucherNo = seeyonEntity.getId();//OA付款单号
// String xml = "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:mdm=\"http://mdmData.server.webservice.banck.com\">\n" +
// " <soap:Header/>\n" +
// " <soap:Body>\n" +
// " <mdm:intoPaymentDataXml>\n" +
// " <!--Optional:-->\n" +
// " <mdm:xml>\n" +
// " <![CDATA[\n" +
// " <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
// "<message>\n" +
// "<head>\n" +
// "<transCode>BkReceiptQueryExchange</transCode>\n" +
// "<erpTimestamp>" + DateUtil.dateToString(new Date(), "yyyy-mm-dd hh:mm:ss") + "</erpTimestamp>\n" +
// "<sourcePlat>CFS</sourcePlat>\n" +
// "<desPlat>OA</desPlat>\n" +
// "<rmk>OA电子回单共享发送</rmk>\n" +
// "<sessionId>" + token + "</sessionId>\n" +
// "</head>\n" +
// "<body>\n" +
// "<bankAcc>" + bankAcc + "</bankAcc>\n" +
// "<erpVoucherNo>" + erpVoucherNo + "</erpVoucherNo>\n" +
// "</body>\n" +
// "</message>\n" +
// " ]]>\n" +
// " </mdm:xml>\n" +
// " </mdm:intoPaymentDataXml>\n" +
// " </soap:Body>\n" +
// "</soap:Envelope>";
// logger.info("CFS电子回单共享请求参数为:{}", xml);
// String url = "http://101.132.140.208:26893/erp/services/HTSZ_OA_BkReceiptQueryWebService?wsdl";
// String result = HttpRequest.post(url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
// logger.info("CFS电子回单共享请求参数为:{}", result);
// DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
// DocumentBuilder builder = factory.newDocumentBuilder();
// org.w3c.dom.Document document = builder.parse(new InputSource(new StringReader(result)));
// org.w3c.dom.Element bodyElement = (org.w3c.dom.Element) document.getElementsByTagName("ns:return").item(0);
// if (null != bodyElement) {
// String textContent = bodyElement.getTextContent();
// Document documentContext = DocumentHelper.parseText(textContent);
// Element rootElement = documentContext.getRootElement();
// Element body = rootElement.element("body");
// if("0000".equalsIgnoreCase(rootElement.element("head").element("returnCode").getText())){
// if (null != body) {
// Element listElc = body.element("list");
// List<Element> elementsElc = listElc.elements();
// for (Element element : elementsElc) {
// String fielPath = element.element("filePath").getText();//电子回单附件路径
// if (fielPath != null && fielPath!="") {
// // String fielPath="C:\\Users\\笃曙\\Desktop\\15HZ000342CIBN2023091100066856211000001.pdf";
// File file = new File(fielPath);
// JSONObject jsonObject = fileUpload(file);
// logger.info("上传返回的附件id为:{}", jsonObject.getString("fileUrl"));
// if (jsonObject.getString("fileUrl") != null) {
// //表单的附件字段=ctpAttachment的Sub_reference表单的Summary_id=ctpAttachment的att_reference
// String sub_reference = String.valueOf(UUIDLong.longUUID());
// seeyonEntity.setField0264(sub_reference);
// seeYonDao.updateFormformmain_0327(seeyonEntity);
// //根据附件id查询附件业务数据
// String file_url = jsonObject.getString("fileUrl");
// CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity();
// ctpAttachmentEntity.setFile_url(file_url);
// String att_reference = seeyonEntity.getSummary_id();//Summary_id
// ctpAttachmentEntity.setSub_reference(sub_reference);
// ctpAttachmentEntity.setAtt_reference(att_reference);
// List<CtpAttachmentEntity> ctpAttachmentEntities = ctpAttachmentDao.queryCtpAttachment(ctpAttachmentEntity);
// //如果没有查询到数据就新增附件业务否则更新
// if (ctpAttachmentEntities.size() == 0) {
// String category = jsonObject.getString("category");
// String type = jsonObject.getString("type");
// String filename = jsonObject.getString("filename");
// String mime_type = jsonObject.getString("mimeType");
// String attachment_size = jsonObject.getString("size");
// String id = String.valueOf(UUIDLong.longUUID());
// ctpAttachmentEntity.setCategory(category);
// ctpAttachmentEntity.setFilename(filename);
// ctpAttachmentEntity.setType(type);
// ctpAttachmentEntity.setMime_type(mime_type);
// ctpAttachmentEntity.setAttachment_size(attachment_size);
// ctpAttachmentEntity.setId(id);
// ctpAttachmentEntity.setCategory("66");
// ctpAttachmentEntity.setCreatedate(new Date());
// ctpAttachmentDao.saveCtpAttachment(ctpAttachmentEntity);
// } else {
// if (ctpAttachmentEntities.size() > 1) {
// throw new BaseSystemException("OA附件业务表中查到多条记录");
// }
// //更新数据到OA附件业务表中
// ctpAttachmentDao.updateCtpAttachment(ctpAttachmentEntity);
// }
// }
// }
// }
// }
// }else{
// logger.info("CFS电子回单返回得错误编码{},以及返回的错误信息:{}",rootElement.element("head").element("returnCode").getText(),rootElement.element("head").element("returnMsg").getText());
// }
// }
// }
// }
// }
// }catch (Exception e){
// logger.info("CFS电子回单共享错误:{}",e.getMessage());
// }
//}
public static JSONObject fileUpload(File file) {
if (null != file) {
try {
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("file", file);
String url = "/seeyon/rest/attachment?token=@token@";//如果后面加上applicationCategory=1&extensions=&firstSave=true附件业务自动生成一条记录
url = url.replaceAll("@token@", getToken());
String result = HttpUtil.post("http://60.204.152.210" + url, paramMap);
if (StrUtil.isNotBlank(result)) {
logger.info("附件上传结果"+result);
JSONObject jsonObject = JSONObject.parseObject(result);
String atts = jsonObject.get("atts").toString();
if (StrUtil.isNotEmpty(atts)) {
JSONArray jsonArray = JSONArray.parseArray(atts);
JSONObject res = (JSONObject) jsonArray.get(0);
/* String fileUrl = res.getString("fileUrl");
logger.info("附件id:" + fileUrl);
return fileUrl;*/
return res;
}
}
}catch (Exception e){
logger.error("附件上传失败"+e.getMessage());
}
}
return null;
}
private static String getToken() {
//获取oatoken
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("userName", "hzyaRest");
hashMap.put("password", "a5ce21b8-91db-4cec-b3e3-3e44719655fd");
hashMap.put("loginName","bdmanager");
String result = HttpUtil.post("http://60.204.152.210" + "/seeyon/rest/token", JSON.toJSONString(hashMap));
JSONObject jsonObject = JSONObject.parseObject(result);
if (null != jsonObject) {
logger.info(result);
logger.info("======token{}======" + jsonObject.getString("id"));
return jsonObject.getString("id");
}
return null;
}
}

View File

@ -0,0 +1,188 @@
package com.hzya.frame.bip.v3.v2207.entity;
import cn.dev33.satoken.stp.StpUtil;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseEntity;
import java.util.Date;
/**
* (BdCorp)实体类
*
* @author makejava
* @since 2023-09-06 14:47:18
*/
public class BipArchivesEntity extends BaseEntity {
private String archivesType;//类型
private String leftCode;//左编码
private String rightCode;//右编码
private String leftAppId;//左应用id
private String leftAppCode;//左应用编码
private String leftAppName;//左应用名称
private String leftApiId;//左接口ID
private String leftId;//左id
private String leftName;//左名称
private String rightAppId;//右应用id
private String rightAppCode;//右应用编码
private String rightAppName;//右应用名称
private String rightApiId;//右接口ID
private String rightId;//右id
private String rightName;//右名称
private String leftOrg;//左公司
private String rightOrg;//右公司
public String getArchivesType() {
return archivesType;
}
public void setArchivesType(String archivesType) {
this.archivesType = archivesType;
}
public String getLeftCode() {
return leftCode;
}
public void setLeftCode(String leftCode) {
this.leftCode = leftCode;
}
public String getRightCode() {
return rightCode;
}
public void setRightCode(String rightCode) {
this.rightCode = rightCode;
}
public String getLeftAppId() {
return leftAppId;
}
public void setLeftAppId(String leftAppId) {
this.leftAppId = leftAppId;
}
public String getLeftAppCode() {
return leftAppCode;
}
public void setLeftAppCode(String leftAppCode) {
this.leftAppCode = leftAppCode;
}
public String getLeftAppName() {
return leftAppName;
}
public void setLeftAppName(String leftAppName) {
this.leftAppName = leftAppName;
}
public String getLeftApiId() {
return leftApiId;
}
public void setLeftApiId(String leftApiId) {
this.leftApiId = leftApiId;
}
public String getLeftId() {
return leftId;
}
public void setLeftId(String leftId) {
this.leftId = leftId;
}
public String getLeftName() {
return leftName;
}
public void setLeftName(String leftName) {
this.leftName = leftName;
}
public String getRightAppId() {
return rightAppId;
}
public void setRightAppId(String rightAppId) {
this.rightAppId = rightAppId;
}
public String getRightAppCode() {
return rightAppCode;
}
public void setRightAppCode(String rightAppCode) {
this.rightAppCode = rightAppCode;
}
public String getRightAppName() {
return rightAppName;
}
public void setRightAppName(String rightAppName) {
this.rightAppName = rightAppName;
}
public String getRightApiId() {
return rightApiId;
}
public void setRightApiId(String rightApiId) {
this.rightApiId = rightApiId;
}
public String getRightId() {
return rightId;
}
public void setRightId(String rightId) {
this.rightId = rightId;
}
public String getRightName() {
return rightName;
}
public void setRightName(String rightName) {
this.rightName = rightName;
}
public String getLeftOrg() {
return leftOrg;
}
public void setLeftOrg(String leftOrg) {
this.leftOrg = leftOrg;
}
public String getRightOrg() {
return rightOrg;
}
public void setRightOrg(String rightOrg) {
this.rightOrg = rightOrg;
}
public void setCreate() {
this.setId(UUIDUtils.getUUID());
this.setSts("Y");
this.setCreate_user_id("1");
this.setModify_user_id("1");
this.setCreate_time(new Date());
this.setModify_time(new Date());
this.setOrg_id("0");
this.setCompanyId("0");
}
//修改信息
public void setUpdate() {
this.setModify_user_id("1");
this.setModify_time(new Date());
}
}

View File

@ -0,0 +1,71 @@
<?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.bip.v3.v2207.dao.impl.BipArchivesDaoImpl">
<resultMap id="get-ArchivesEntity-result" type="com.hzya.frame.bip.v3.v2207.entity.BipArchivesEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="leftAppId" column="left_app_id" jdbcType="VARCHAR"/>
<result property="leftAppCode" column="left_app_code" jdbcType="VARCHAR"/>
<result property="leftAppName" column="left_app_name" jdbcType="VARCHAR"/>
<result property="leftApiId" column="left_api_id" jdbcType="VARCHAR"/>
<result property="leftId" column="left_id" jdbcType="VARCHAR"/>
<result property="leftCode" column="left_code" jdbcType="VARCHAR"/>
<result property="leftName" column="left_name" jdbcType="VARCHAR"/>
<result property="rightAppId" column="right_app_id" jdbcType="VARCHAR"/>
<result property="rightAppCode" column="right_app_code" jdbcType="VARCHAR"/>
<result property="rightAppName" column="right_app_name" jdbcType="VARCHAR"/>
<result property="rightApiId" column="right_api_id" jdbcType="VARCHAR"/>
<result property="rightId" column="right_id" jdbcType="VARCHAR"/>
<result property="rightCode" column="right_code" jdbcType="VARCHAR"/>
<result property="rightName" column="right_name" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<select id="queryArchivesData" resultMap="get-ArchivesEntity-result"
parameterType="com.hzya.frame.bip.v3.v2207.entity.BipArchivesEntity">
select
right_code
from
<choose>
<when test="archivesType == '1'.toString()"> sys_personnel_control </when>
<when test="archivesType == '2'.toString()"> sys_org_control </when>
<when test="archivesType == '6'.toString()"> sys_stock_control </when>
<when test="archivesType == '73'.toString()"> sys_merchant_control </when>
<when test="archivesType == 'D01'.toString()"> sys_taxrate_control </when>
<when test="archivesType == 'jobass'.toString()"> sys_project_control </when>
<when test="archivesType == '93'.toString()"> sys_bank_control </when>
<when test="archivesType == '96'.toString()"> sys_bankaccount_control </when>
<when test="archivesType == '22'.toString()"> sys_assets_control </when>
</choose>
<trim prefix="where" prefixOverrides="and">
<if test="leftCode != null and leftCode != ''">and left_code = #{leftCode}</if>
<if test="leftOrg != null and leftOrg != ''">and left_org = #{leftOrg}</if>
and sts='Y'
</trim>
</select>
<select id="queryArchivesDatays" resultMap="get-ArchivesEntity-result"
parameterType="com.hzya.frame.bip.v3.v2207.entity.BipArchivesEntity">
select
right_code
from
<choose>
<when test="archivesType == '0012'.toString()"> sys_stock_control </when>
<when test="archivesType == '0006'.toString()"> sys_stock_control </when>
<when test="archivesType == '0004'.toString()"> sys_merchant_control </when>
</choose>
<trim prefix="where" prefixOverrides="and">
<if test="leftCode != null and leftCode != ''">and left_code = #{leftCode}</if>
<if test="leftOrg != null and leftOrg != ''">and left_org = #{leftOrg}</if>
and sts='Y'
</trim>
</select>
</mapper>

View File

@ -0,0 +1,24 @@
package com.hzya.frame.bip.v3.v2207.entity;
public class BipAss {
private String checktypecode;
private String checkvaluecode;
public String getChecktypecode() {
return checktypecode;
}
public void setChecktypecode(String checktypecode) {
this.checktypecode = checktypecode;
}
public String getCheckvaluecode() {
return checkvaluecode;
}
public void setCheckvaluecode(String checkvaluecode) {
this.checkvaluecode = checkvaluecode;
}
}

View File

@ -0,0 +1,23 @@
package com.hzya.frame.bip.v3.v2207.entity;
public class BipCashflow {
private String money;
private String pk_cashflow;
public String getMoney() {
return money;
}
public void setMoney(String money) {
this.money = money;
}
public String getPk_cashflow() {
return pk_cashflow;
}
public void setPk_cashflow(String pk_cashflow) {
this.pk_cashflow = pk_cashflow;
}
}

View File

@ -0,0 +1,65 @@
package com.hzya.frame.bip.v3.v2207.entity;
import com.hzya.frame.web.entity.BaseEntity;
/****
* BIP组织账户
* @content:
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-10-24 10:03
* @param
* @return
**/
public class BipOrgsDetailsEntity extends BaseEntity {
/*开户行编码*/
private String bankCode;
/*开户行名称*/
private String bankName;
/*账户*/
private String accnum;
/*与组织关联的字段*/
private String controlorg;
/*联行号*/
private String cnapsCode;
public String getCnapsCode() {
return cnapsCode;
}
public void setCnapsCode(String cnapsCode) {
this.cnapsCode = cnapsCode;
}
public String getControlorg() {
return controlorg;
}
public void setControlorg(String controlorg) {
this.controlorg = controlorg;
}
public String getBankCode() {
return bankCode;
}
public void setBankCode(String bankCode) {
this.bankCode = bankCode;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getAccnum() {
return accnum;
}
public void setAccnum(String accnum) {
this.accnum = accnum;
}
}

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.bip.v3.v2207.dao.impl.BipOrgsDetailsDaoImpl">
<resultMap id="get-BipOrgsDetailsEntity-result" type="com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity">
<result property="bankCode" column="bankCode" />
<result property="bankName" column="bankName" />
<result property="accnum" column="accnum" />
<result property="controlorg" column="controlorg" />
<result property="cnapsCode" column="cnapsCode" />
</resultMap>
<sql id="BipOrgsDetailsEntity_Base_Column_List">
bankdoc.code as bankCode,bankdoc.name as bankName,bankaccbas.accnum,bankaccbas.controlorg,bankaccbas.combinenum as cnapsCode
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-BipOrgsDetailsEntity-result">
select
<include refid="BipOrgsDetailsEntity_Base_Column_List" />
from bd_bankaccbas where pk_bankaccbas = #{pk_bankaccbas}
</select>
<!-- 查询 采用==查询 -->
<select id="thirdInterfaceGetOrgsDetails" resultMap="get-BipOrgsDetailsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity">
select
<include refid="BipOrgsDetailsEntity_Base_Column_List" />
from bd_bankaccbas bankaccbas
left join bd_bankdoc bankdoc on bankdoc.pk_bankdoc=bankaccbas.pk_bankdoc
<trim prefix="where" prefixOverrides="and">
<if test="bankCode != null and bankCode !=''">bankdoc.code=#{bankCode}</if>
<if test="bankName != null and bankName !='' "> and bankdoc.name = #{bankName}</if>
<if test="accnum != null and accnum !='' "> and bankaccbas.accnum = #{accnum}</if>
and bankaccbas.dr='0' and bankdoc.dr='0' and bankaccbas.pk_banktype!='0001Z01000000000036S' and bankaccbas.controlorg = #{controlorg}
</trim>
</select>
</mapper>

View File

@ -0,0 +1,63 @@
package com.hzya.frame.bip.v3.v2207.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @description: BIP组织 entity
* @tableName: org_orgs
* @entityName: BipOrgsEntity
* @author: gjh
* @history: 1.0
*/
public class BipOrgsEntity extends BaseEntity {
/*单位编码*/
private String code;
/*开户单位*/
private String name;
/*BIPID*/
private String tripartiteId;
private String pk_financeorg;
private String orgsts;
public String getOrgsts() {
return orgsts;
}
public void setOrgsts(String orgsts) {
this.orgsts = orgsts;
}
public String getPk_financeorg() {
return pk_financeorg;
}
public void setPk_financeorg(String pk_financeorg) {
this.pk_financeorg = pk_financeorg;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTripartiteId() {
return tripartiteId;
}
public void setTripartiteId(String tripartiteId) {
this.tripartiteId = tripartiteId;
}
}

View File

@ -0,0 +1,98 @@
<?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.bip.v3.v2207.dao.impl.BipOrgsDaoImpl">
<resultMap id="get-BipOrgsEntity-result" type="com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity">
<result property="tripartiteId" column="tripartiteId" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="pk_financeorg" column="pk_financeorg"/>
<result property="orgsts" column="orgsts"/>
</resultMap>
<sql id="BipOrgsEntity_Base_Column_List">
orgs.pk_financeorg as tripartiteId,
orgs.name ,
orgs.code,
max(org_bank.ts)as ts
</sql>
<sql id="BipOrgsEntity_Base_Column_List_details">
bankdoc.code as bankCode,bankdoc.name as bankName,bankaccbas.accnum,bankaccbas.controlorg
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-BipOrgsEntity-result">
select
<include refid="BipOrgsEntity_Base_Column_List" />
from org_financeorg where pk_financeorg = #{pk_financeorg}
</select>
<select id="thirdInterfaceGetOrgs" resultMap="get-BipOrgsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity">
select
<include refid="BipOrgsEntity_Base_Column_List" />
FROM
org_financeorg orgs
left join v_hzya_org_bank org_bank on org_bank.controlorg = orgs.pk_financeorg
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code !=''"> orgs.code = #{code}</if>
<if test="name != null and name !='' "> and orgs.name = #{name}</if>
<if test="pk_financeorg != null and pk_financeorg !='' "> and orgs.pk_financeorg = #{tripartiteId}</if>
<if test="orgsts != null and orgsts !='' "> and orgs.ts >'2023-09-30 14:18:39' and orgs.ts > #{orgsts}</if>
and orgs.dr='0'
</trim>
GROUP BY orgs.pk_financeorg ,orgs.name,orgs.code
</select>
<!-- 查询 采用==查询 -->
<select id="thirdInterfaceGetSupplierDetails" resultMap="get-BipOrgsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity">
select
<include refid="BipOrgsEntity_Base_Column_List_details" />
from bd_bankaccbas bankaccbas
left join bd_bankdoc bankdoc on bankdoc.pk_bankdoc=bankaccbas.pk_bankdoc
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code !=''">bankdoc.code=#{code}</if>
<if test="name != null and name !='' "> and bankdoc.name = #{name}</if>
<if test="accnum != null and accnum !='' "> and bankaccbas.accnum = #{accnum}</if>
<if test="controlorg != null and controlorg !='' "> and bankaccbas.controlorg = #{controlorg}</if>
and bankaccbas.dr='0' and bankdoc.dr='0' and bankaccbas.pk_banktype!='0001Z01000000000036S'
</trim>
</select>
<!-- 查询 采用==查询 -->
<!--<select id="BipOrgsEntity_list_base" resultMap="get-BipOrgsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity">
select
<include refid="BipOrgsEntity_Base_Column_List" />
FROM bd_cust_supplier supplier
left join db_customerbank bank ON supplier.code = bank.code
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code !=''">supplier.code=#{code}</if>
<if test="name != null and name !='' "> and supplier.name = #{name}</if>
<if test="taxpayerid != null and taxpayerid !='' "> and supplier.taxpayerid = #{taxpayerid}</if>
<if test="def1 != null and def1 !='' "> and bank.def1 = #{def1}</if>
<if test="def2 != null and def2 !='' "> and bank.def2 = #{def2}</if>
<if test="def3 != null and def3 !='' "> and bank.def3 = #{def3}</if>
</trim>
</select>-->
<!-- 分页查询列表 采用like格式 -->
<!--<select id="entity_list_like" resultMap="get-BipOrgsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity">
select
<include refid="BipOrgsEntity_Base_Column_List" />
FROM bd_cust_supplier supplier
left join db_customerbank bank ON supplier.code = bank.code
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code !=''"> supplier.code like concat('%',#{code},'%')</if>
<if test="name != null and name !='' "> and supplier.name like concat('%',#{name},'%')</if>
<if test="taxpayerid != null and taxpayerid !='' "> and supplier.taxpayeridlike concat('%',#{taxpayeridlike},'%')</if>
<if test="def1 != null and def1 !='' "> and bank.def1 like concat('%',#{def1},'%')</if>
<if test="def2 != null and def2 !='' "> and bank.def2 like concat('%',#{def2},'%')</if>
<if test="def3 != null and def3 !='' "> and bank.def3 like concat('%',#{def3},'%')</if>
</trim>
</select>-->
</mapper>

View File

@ -0,0 +1,77 @@
package com.hzya.frame.bip.v3.v2207.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class BipSupplierDetailsEntity extends BaseEntity {
private String code;
private String name;
/*开户行*/
private String splitbank;
/*银行账号*/
private String bankaccno;
/*是否默认*/
private String isdefault;
/*联行号*/
private String combinno;
private String tripartiteId;
public String getCombinno() {
return combinno;
}
public void setCombinno(String combinno) {
this.combinno = combinno;
}
public String getTripartiteId() {
return tripartiteId;
}
public void setTripartiteId(String tripartiteId) {
this.tripartiteId = tripartiteId;
}
public String getIsdefault() {
return isdefault;
}
public void setIsdefault(String isdefault) {
this.isdefault = isdefault;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSplitbank() {
return splitbank;
}
public void setSplitbank(String splitbank) {
this.splitbank = splitbank;
}
public String getBankaccno() {
return bankaccno;
}
public void setBankaccno(String bankaccno) {
this.bankaccno = bankaccno;
}
}

View File

@ -0,0 +1,44 @@
<?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.bip.v3.v2207.dao.impl.BipSupplierDetailsDaoImpl">
<resultMap id="get-BipSupplierDetailsEntity-result" type="com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity">
<result property="code" column="code" />
<result property="name" column="name" />
<result property="splitbank" column="splitbank" />
<result property="bankaccno" column="bankaccno" />
<result property="tripartiteId" column="tripartiteId"></result>
<result property="combinno" column="combinno"></result>
</resultMap>
<sql id="BipSupplierDetailsEntity_Base_Column_List">
splitbank,bankaccno,combinno,name,code
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-BipSupplierDetailsEntity-result">
select
<include refid="BipSupplierDetailsEntity_Base_Column_List" />
from BD_SUPPLIER where pk_supplier = #{pk_supplier} and sdr='0'
</select>
<!-- 查询 采用==查询 -->
<select id="thirdInterfaceGetSupplierDetails" resultMap="get-BipSupplierDetailsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity">
select
<include refid="BipSupplierDetailsEntity_Base_Column_List" />
FROM db_customerbank
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code !=''">code=#{code}</if>
<if test="name != null and name !='' "> and name = #{name}</if>
<if test="bankaccno != null and bankaccno !='' "> and bankaccno = #{bankaccno}</if>
<if test="splitbank != null and splitbank !='' "> and splitbank = #{splitbank}</if>
<if test="combinno != null and combinno !='' "> and combinno = #{combinno}</if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,92 @@
package com.hzya.frame.bip.v3.v2207.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @description: BIP供应商 entity
* @tableName: BD_SUPPLIER
* @entityName: BipSupplierEntity
* @author: gjh
* @history: 1.0
*/
public class BipSupplierEntity extends BaseEntity {
private String code;
private String name;
/*税号*/
private String taxpayerid;
/*地址*/
private String def1;
/*电话*/
private String def2;
/*联系人*/
private String def3;
private String tripartiteId;
public String getTripartiteId() {
return tripartiteId;
}
public void setTripartiteId(String tripartiteId) {
this.tripartiteId = tripartiteId;
}
private String ts;
public String getTs() {
return ts;
}
public void setTs(String ts) {
this.ts = ts;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTaxpayerid() {
return taxpayerid;
}
public void setTaxpayerid(String taxpayerid) {
this.taxpayerid = taxpayerid;
}
public String getDef1() {
return def1;
}
public void setDef1(String def1) {
this.def1 = def1;
}
public String getDef2() {
return def2;
}
public void setDef2(String def2) {
this.def2 = def2;
}
public String getDef3() {
return def3;
}
public void setDef3(String def3) {
this.def3 = def3;
}
}

View File

@ -0,0 +1,96 @@
<?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.bip.v3.v2207.dao.impl.BipSupplierDaoImpl">
<resultMap id="get-BipSupplierEntity-result" type="com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity">
<result property="taxpayerid" column="taxpayerid" />
<result property="def1" column="def1" />
<result property="def2" column="def2" />
<result property="def3" column="def3" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="ts" column="ts" />
<result property="tripartiteId" column="tripartiteId" />
</resultMap>
<sql id="BipSupplierEntity_Base_Column_List">
supplier.code,supplier.name,supplier.taxpayerid,bank.def1,bank.def2,bank.def3,supplier.ts, supplier.pk_cust_sup as tripartiteId
</sql>
<sql id="BipSupplierEntity_Base_Column_List_details">
splitbank,bankaccno,name,code
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-BipSupplierEntity-result">
select
<include refid="BipSupplierEntity_Base_Column_List" />
from BD_SUPPLIER where pk_supplier = #{pk_supplier} and sdr='0'
</select>
<select id="thirdInterfaceGetSupplier" resultMap="get-BipSupplierEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity">
select
<include refid="BipSupplierEntity_Base_Column_List" />
FROM bd_cust_supplier supplier
left join db_customerbank bank ON supplier.code = bank.code
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code !=''">supplier.code=#{code}</if>
<if test="name != null and name !='' "> and supplier.name = #{name}</if>
<if test="taxpayerid != null and taxpayerid !='' "> and supplier.taxpayerid = #{taxpayerid}</if>
<if test="def1 != null and def1 !='' "> and bank.def1 = #{def1}</if>
<if test="def2 != null and def2 !='' "> and bank.def2 = #{def2}</if>
<if test="def3 != null and def3 !='' "> and bank.def3 = #{def3}</if>
<if test="tripartiteId != null and tripartiteId !='' "> and supplier.tripartiteId = #{tripartiteId}</if>
<if test="ts != null and ts !='' "> and supplier.ts >'2023-09-30 14:18:39' and supplier.ts > #{ts} </if>
</trim>
group by supplier.code,supplier.name,supplier.taxpayerid,bank.def1,bank.def2,bank.def3,supplier.ts, supplier.pk_cust_sup
</select>
<!-- 查询 采用==查询 -->
<select id="thirdInterfaceGetSupplierDetails" resultMap="get-BipSupplierEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity">
select
<include refid="BipSupplierEntity_Base_Column_List_details" />
FROM db_customerbank
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code !=''">code=#{code}</if>
<if test="name != null and name !='' "> and name = #{name}</if>
<if test="bankaccno != null and bankaccno !='' "> and bankaccno = #{bankaccno}</if>
<if test="splitbank != null and splitbank !='' "> and splitbank = #{splitbank}</if>
</trim>
</select>
<!-- 查询 采用==查询 -->
<select id="BipSupplierEntity_list_base" resultMap="get-BipSupplierEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity">
select
<include refid="BipSupplierEntity_Base_Column_List" />
FROM bd_cust_supplier supplier
left join db_customerbank bank ON supplier.code = bank.code
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code !=''">supplier.code=#{code}</if>
<if test="name != null and name !='' "> and supplier.name = #{name}</if>
<if test="taxpayerid != null and taxpayerid !='' "> and supplier.taxpayerid = #{taxpayerid}</if>
<if test="def1 != null and def1 !='' "> and bank.def1 = #{def1}</if>
<if test="def2 != null and def2 !='' "> and bank.def2 = #{def2}</if>
<if test="def3 != null and def3 !='' "> and bank.def3 = #{def3}</if>
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-BipSupplierEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity">
select
<include refid="BipSupplierEntity_Base_Column_List" />
FROM bd_cust_supplier supplier
left join db_customerbank bank ON supplier.code = bank.code
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code !=''"> supplier.code like concat('%',#{code},'%')</if>
<if test="name != null and name !='' "> and supplier.name like concat('%',#{name},'%')</if>
<if test="taxpayerid != null and taxpayerid !='' "> and supplier.taxpayeridlike concat('%',#{taxpayeridlike},'%')</if>
<if test="def1 != null and def1 !='' "> and bank.def1 like concat('%',#{def1},'%')</if>
<if test="def2 != null and def2 !='' "> and bank.def2 like concat('%',#{def2},'%')</if>
<if test="def3 != null and def3 !='' "> and bank.def3 like concat('%',#{def3},'%')</if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,13 @@
package com.hzya.frame.bip.v3.v2207.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* com.hzya.frame.bip.v3.v2207.entity
*
* @author makejava
* @date 2024-05 -27 11:24
*/
public class BipTokenVo extends BaseEntity {
}

View File

@ -0,0 +1,69 @@
package com.hzya.frame.bip.v3.v2207.entity;
import java.util.List;
public class BipVoucher {
private List<BipVoucherDetails> details;
private String no;
private String pk_corp;
private String pk_glorgbook;
private String pk_prepared;
private String pk_vouchertype;
private String pk_voucher;
public List<BipVoucherDetails> getDetails() {
return details;
}
public void setDetails(List<BipVoucherDetails> details) {
this.details = details;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getPk_corp() {
return pk_corp;
}
public void setPk_corp(String pk_corp) {
this.pk_corp = pk_corp;
}
public String getPk_glorgbook() {
return pk_glorgbook;
}
public void setPk_glorgbook(String pk_glorgbook) {
this.pk_glorgbook = pk_glorgbook;
}
public String getPk_prepared() {
return pk_prepared;
}
public void setPk_prepared(String pk_prepared) {
this.pk_prepared = pk_prepared;
}
public String getPk_vouchertype() {
return pk_vouchertype;
}
public void setPk_vouchertype(String pk_vouchertype) {
this.pk_vouchertype = pk_vouchertype;
}
public String getPk_voucher() {
return pk_voucher;
}
public void setPk_voucher(String pk_voucher) {
this.pk_voucher = pk_voucher;
}
}

View File

@ -0,0 +1,105 @@
package com.hzya.frame.bip.v3.v2207.entity;
import java.util.List;
public class BipVoucherDetails {
private List<BipAss> ass;
private List<BipCashflow> cashflow;
private String creditamount;
private String debitamount;
private String explanation;
private String localcreditamount;
private String localdebitamount;
private String pk_accsubj;
private String pk_currtype;
private String debitquantity;
private String price;
public List<BipAss> getAss() {
return ass;
}
public void setAss(List<BipAss> ass) {
this.ass = ass;
}
public List<BipCashflow> getCashflow() {
return cashflow;
}
public void setCashflow(List<BipCashflow> cashflow) {
this.cashflow = cashflow;
}
public String getCreditamount() {
return creditamount;
}
public void setCreditamount(String creditamount) {
this.creditamount = creditamount;
}
public String getDebitamount() {
return debitamount;
}
public void setDebitamount(String debitamount) {
this.debitamount = debitamount;
}
public String getExplanation() {
return explanation;
}
public void setExplanation(String explanation) {
this.explanation = explanation;
}
public String getLocalcreditamount() {
return localcreditamount;
}
public void setLocalcreditamount(String localcreditamount) {
this.localcreditamount = localcreditamount;
}
public String getLocaldebitamount() {
return localdebitamount;
}
public void setLocaldebitamount(String localdebitamount) {
this.localdebitamount = localdebitamount;
}
public String getPk_accsubj() {
return pk_accsubj;
}
public void setPk_accsubj(String pk_accsubj) {
this.pk_accsubj = pk_accsubj;
}
public String getPk_currtype() {
return pk_currtype;
}
public void setPk_currtype(String pk_currtype) {
this.pk_currtype = pk_currtype;
}
public String getDebitquantity() {
return debitquantity;
}
public void setDebitquantity(String debitquantity) {
this.debitquantity = debitquantity;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.bip.v3.v2207.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.bip.v3.v2207.entity.BipTokenVo;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
public interface IBipPzService extends IBaseService<BipTokenVo,String>{
SysExtensionApiEntity getPz(SysExtensionApiEntity entity);
}

View File

@ -0,0 +1,31 @@
package com.hzya.frame.bip.v3.v2207.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.bip.v3.v2207.entity.BipTokenVo;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
public interface IBipSsoService extends IBaseService<BipTokenVo,String>{
/**
*
* @content Bip单点统一认证接口
* @author laborer
* @date 2024/5/30 0030 13:45
*
*/
String erpSso(HttpServletRequest request, String ticket)throws Exception;
/**
*
* @content 此方法获取sso动态加密heade参数动态传入
* @author laborer
* @date 2024/5/27 0027 11:38
*
*/
SysExtensionApiEntity ssoEncrypt(SysExtensionApiEntity entity);
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.bip.v3.v2207.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.bip.v3.v2207.entity.BipTokenVo;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
public interface IBipV32207BillService extends IBaseService<BipTokenVo,String>{
/**
*
* @content 此方法获取BIPtokenheade参数动态传入
* @author laborer
* @date 2024/5/27 0027 11:38
*
*/
SysExtensionApiEntity getBipBill(SysExtensionApiEntity entity);
SysExtensionApiEntity getBipBillYs(SysExtensionApiEntity entity);
}

View File

@ -0,0 +1,49 @@
package com.hzya.frame.bip.v3.v2207.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface IBipV32207Service extends IBaseService<BipSupplierEntity,String>{
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Description 获取token
**/
JsonResultEntity thirdInterfaceGetToken(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Description 获取供应商
**/
@DS("oracle91")
JsonResultEntity thirdInterfaceGetSupplier(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Description 新增供应商
**/
JsonResultEntity thirdInterfaceSaveSupplier(JSONObject jsonObject);
/**
* 供应商传递OA
* @param jsonObject
* @return
*/
JsonResultEntity thirdInterfaceSendOa(JSONObject jsonObject) throws Exception;
/**
* 获取BIP组织数据
* @param jsonObject
* @return
*/
JsonResultEntity thirdInterfaceGetOrgs(JSONObject jsonObject);
}

View File

@ -0,0 +1,22 @@
package com.hzya.frame.bip.v3.v2207.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
import com.hzya.frame.bip.v3.v2207.entity.BipTokenVo;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface IBipV32207TokenService extends IBaseService<BipTokenVo,String>{
/**
*
* @content 此方法获取BIPtokenheade参数动态传入
* @author laborer
* @date 2024/5/27 0027 11:38
*
*/
SysExtensionApiEntity getBipToken(SysExtensionApiEntity entity);
}

View File

@ -0,0 +1,72 @@
package com.hzya.frame.bip.v3.v2207.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.bip.v3.v2207.dao.IBipArchivesDao;
import com.hzya.frame.bip.v3.v2207.entity.BipArchivesEntity;
import com.hzya.frame.bip.v3.v2207.entity.BipAss;
import com.hzya.frame.bip.v3.v2207.entity.BipTokenVo;
import com.hzya.frame.bip.v3.v2207.entity.BipVoucher;
import com.hzya.frame.bip.v3.v2207.entity.BipVoucherDetails;
import com.hzya.frame.bip.v3.v2207.service.IBipPzService;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.web.entity.BaseResult;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
@Service(value = "bipPzService")
public class BipPzServiceImpl extends BaseService<BipTokenVo, String> implements IBipPzService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource
private IBipArchivesDao bipArchivesDao;
/**
* @param entity
* @return com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity
* @Author lvleigang
* @Description 组装凭证数据
* @Date 10:52 上午 2024/11/5
**/
@Override
public SysExtensionApiEntity getPz(SysExtensionApiEntity entity) {
String bodys = entity.getBodys();
BipVoucher voucher = JSONObject.parseObject(bodys, BipVoucher.class);
List<String> fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01", "jobass", "93", "96", "22"});
if (voucher.getDetails() != null && voucher.getDetails().size() > 0) {
for (int a = 0; a < voucher.getDetails().size(); a++) {
BipVoucherDetails voucherDetails = voucher.getDetails().get(a);
if (voucherDetails.getAss() != null && voucherDetails.getAss().size() > 0) {
for (int b = 0; b < voucherDetails.getAss().size(); b++) {
BipAss ass = voucherDetails.getAss().get(b);
if (ass.getChecktypecode() != null && !"".equals(ass.getChecktypecode())) {
//存在需要转换的
if (fzhs.contains(ass.getChecktypecode())) {
BipArchivesEntity archivesEntity = new BipArchivesEntity();
archivesEntity.setArchivesType(ass.getChecktypecode());
archivesEntity.setLeftCode(ass.getCheckvaluecode());
archivesEntity.setLeftOrg(voucher.getPk_corp());
List<BipArchivesEntity> archivesEntities = bipArchivesDao.queryArchivesData(archivesEntity);
if (archivesEntities != null && archivesEntities.size() > 0) {
ass.setCheckvaluecode(archivesEntities.get(0).getRightCode());
}
}
}
}
}
}
}
bodys = JSON.toJSONString(voucher);
entity.setBodys(bodys);
return entity;
}
}

View File

@ -0,0 +1,114 @@
package com.hzya.frame.bip.v3.v2207.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpException;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.bip.v3.v2207.entity.BipTokenVo;
import com.hzya.frame.bip.v3.v2207.service.IBipSsoService;
import com.hzya.frame.iputil.IPUtil;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import nccloud.security.impl.SignatureTookKit;
import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
@Service(value = "BipSsoServiceImpl")
public class BipSsoServiceImpl extends BaseService<BipTokenVo, String> implements IBipSsoService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final String BASEURL = "http://192.168.2.237:8099/seeyon/thirdpartyController.do?ticket=";
private final String ESBURL = "http://127.0.0.1:9081/kangarooDataCenterV3/entranceController/externalCallInterface";
/**
*
* @content Bip单点统一认证接口
* @author laborer
* @date 2024/5/30 0030 13:45
*
*/
@Override
public String erpSso(HttpServletRequest request,String userCode)throws Exception {
logger.info("当前IP地址为"+ JSON.toJSONString(IPUtil.getIpAddress(request)));
String result = "";
boolean flag = true;
// logger.info("接收到致远OA认证参数的ticket{}",ticket);
//通过ticket获取OA用户信息
// String userCode = HttpUtil.get(BASEURL+ticket);
logger.info("获取到的OA用户信息{}",userCode);
String dsname = "ycjf";
String client_id = "OAREST";//第三方系统id
StringBuffer sb = new StringBuffer();
if(StrUtil.isNotEmpty(userCode)){
try {
logger.info("开始加密");
String security = genKey(userCode,userCode + (System.currentTimeMillis() + "").substring(0, 6));
logger.info("加密结束:{}",security);
sb.append("type=type_security&dsname="+dsname+"&usercode="+userCode+"&client_id="+client_id+"&security="+security);
String baseUrl = "http://10.75.51.78:8899/service/genThirdPartyAccessToken?"+sb.toString();
logger.info("请求BIPtokenbaseUrl{}",baseUrl);
result = HttpRequest.post(baseUrl)
.header("Content-Type", "application/x-www-form-urlencoded")//头信息多个头信息多次调用此方法即可
.header("Content-Length", "10000")//头信息多个头信息多次调用此方法即可
.header("userid", "admin")//头信息多个头信息多次调用此方法即可
.body("{}")//表单内容
.timeout(20000)//超时毫秒
.execute().body();
logger.info("获取到的BIPtoken信息{}",result);
} catch (HttpException e) {
flag=false;
e.printStackTrace();
}
}
if(flag){
String indexUR = "http://10.75.51.78:8899/nccloud/resources/uap/rbac/thirdpartylogin/main/index.html?accesstoken="+result+"&redirect_uri=http://10.75.51.78:8899/nccloud/resources/workbench/public/common/main/index.html#";
logger.info(indexUR);
return indexUR;
}else{
return "http://10.75.51.78:8899/nccloud/resources/uap/rbac/login/main/index.html";
}
}
/**
*
* @content 此方法获取sso动态加密heade参数动态传入
* @author laborer
* @date 2024/5/27 0027 11:38
*
*/
@Override
public SysExtensionApiEntity ssoEncrypt(SysExtensionApiEntity entity) {
try {
Map<String, String> headers = entity.getHeaders();
String userCode = headers.get("usercode");//用户编码
String dsname = headers.get("dsname");//数据源
String client_id = headers.get("client_id");//第三方系统id
StringBuffer sb = new StringBuffer();
String security = genKey(userCode,userCode + (System.currentTimeMillis() + "").substring(0, 6));
StringBuffer querys = new StringBuffer();
querys.append("type=type_security");
querys.append("&dsname="+dsname);
querys.append("&usercode="+userCode);
querys.append("&client_id="+client_id);
querys.append("&security="+security);
entity.setQuerys(querys.toString());
headers.put("Content-Type", "application/x-www-form-urlencoded");
headers.put("userid", "admin");
entity.setHeaders(headers);
} catch (Exception e) {
e.printStackTrace();
}
return entity;
}
/**获取NCC的key*/
private static String genKey(String userid, String key) throws Exception {
return new Base64().encodeToString(SignatureTookKit.digestSign(userid.getBytes(), key.getBytes()));
}
}

View File

@ -0,0 +1,134 @@
package com.hzya.frame.bip.v3.v2207.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.bip.v3.v2207.dao.IBipArchivesDao;
import com.hzya.frame.bip.v3.v2207.entity.BipArchivesEntity;
import com.hzya.frame.bip.v3.v2207.entity.BipAss;
import com.hzya.frame.bip.v3.v2207.entity.BipTokenVo;
import com.hzya.frame.bip.v3.v2207.entity.BipVoucher;
import com.hzya.frame.bip.v3.v2207.entity.BipVoucherDetails;
import com.hzya.frame.bip.v3.v2207.service.IBipV32207BillService;
import com.hzya.frame.bip.v3.v2207.service.IBipV32207TokenService;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.util.bipV3.Encryption;
import com.hzya.frame.util.bipV3.SHA256Util;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.net.URLEncoder;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service(value = "BipV32207BillServiceImpl")
public class BipV32207BillServiceImpl extends BaseService<BipTokenVo, String> implements IBipV32207BillService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource
private IBipArchivesDao bipArchivesDao;
/**
*
* @content 此方法获取拼接单据动态加密heade参数动态传入
* @author laborer
* @date 2024/5/27 0027 11:38
*
*/
@Override
public SysExtensionApiEntity getBipBill(SysExtensionApiEntity entity) {
try {
Map<String, String> headers = entity.getHeaders();
String client_id = headers.get("client_id");
//token信息
String access_token = headers.get("access_token");
//公钥
String pubKey = headers.get("pubKey");
StringBuffer sb = new StringBuffer();
sb.append(client_id);
String parm = entity.getBodys();
if (StringUtils.isNotBlank(parm)) {
sb.append(parm);
}
sb.append(pubKey);
// 签名
String sign = SHA256Util.getSHA256(sb.toString(), pubKey);
StringBuffer querys = new StringBuffer();
querys.append("access_token="+access_token);
querys.append("&signature="+sign);
querys.append("&client_id="+client_id);
entity.setQuerys(querys.toString());
headers.put("signature",sign);
// headers.put("content-type","application/x-www-form-urlencoded");
} catch (Exception e) {
e.printStackTrace();
}
return entity;
}
@Override
public SysExtensionApiEntity getBipBillYs(SysExtensionApiEntity entity) {
try {
String bodys = entity.getBodys();
BipVoucher voucher = JSONObject.parseObject(bodys, BipVoucher.class);
List<String> fzhs = Arrays.asList(new String[]{"0012", "0006", "0004"});
if (voucher.getDetails() != null && voucher.getDetails().size() > 0) {
for (int a = 0; a < voucher.getDetails().size(); a++) {
BipVoucherDetails voucherDetails = voucher.getDetails().get(a);
if (voucherDetails.getAss() != null && voucherDetails.getAss().size() > 0) {
for (int b = 0; b < voucherDetails.getAss().size(); b++) {
BipAss ass = voucherDetails.getAss().get(b);
if (ass.getChecktypecode() != null && !"".equals(ass.getChecktypecode())) {
//存在需要转换的
if (fzhs.contains(ass.getChecktypecode())) {
BipArchivesEntity archivesEntity = new BipArchivesEntity();
archivesEntity.setArchivesType(ass.getChecktypecode());
archivesEntity.setLeftCode(ass.getCheckvaluecode());
archivesEntity.setLeftOrg(voucher.getPk_corp());
List<BipArchivesEntity> archivesEntities = bipArchivesDao.queryArchivesData(archivesEntity);
if (archivesEntities != null && archivesEntities.size() > 0) {
ass.setCheckvaluecode(archivesEntities.get(0).getRightCode());
}
}
}
}
}
}
}
bodys = JSON.toJSONString(voucher);
entity.setBodys(bodys);
Map<String, String> headers = entity.getHeaders();
String client_id = headers.get("client_id");
//token信息
String access_token = headers.get("access_token");
//公钥
String pubKey = headers.get("pubKey");
StringBuffer sb = new StringBuffer();
sb.append(client_id);
String parm = entity.getBodys();
if (StringUtils.isNotBlank(parm)) {
sb.append(parm);
}
sb.append(pubKey);
// 签名
String sign = SHA256Util.getSHA256(sb.toString(), pubKey);
StringBuffer querys = new StringBuffer();
querys.append("access_token="+access_token);
querys.append("&signature="+sign);
querys.append("&client_id="+client_id);
entity.setQuerys(querys.toString());
headers.put("signature",sign);
// headers.put("content-type","application/x-www-form-urlencoded");
} catch (Exception e) {
e.printStackTrace();
}
return entity;
}
}

View File

@ -0,0 +1,480 @@
package com.hzya.frame.bip.v3.v2207.service.impl;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.google.gson.Gson;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDetailsDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDetailsDao;
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity;
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity;
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
import com.hzya.frame.bip.v3.v2207.service.IBipV32207Service;
import com.hzya.frame.dateutil.DateUtil;
import com.hzya.frame.util.PluginUtils;
import com.hzya.frame.util.bipV3.Encryption;
import com.hzya.frame.util.bipV3.SHA256Util;
import com.hzya.frame.util.oldNcc.CompressUtil;
import com.hzya.frame.util.oldNcc.Decryption;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URLEncoder;
import java.util.*;
@Service(value = "bipV32207Service")
public class BipV32207ServiceImpl extends BaseService<BipSupplierEntity, String> implements IBipV32207Service {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
//定义项目开始同步日期
private String ts = "2023-09-30 15:47:08";
//组织的同步日期
private String orgsts = "2023-09-30 15:47:08";
@Autowired
private IBipSupplierDao bipSupplierDao;
@Autowired
private IBipSupplierDetailsDao bipSupplierDetailsDao;
@Autowired
private IBipOrgsDao bipOrgsDao;
@Autowired
private IBipOrgsDetailsDao bipOrgsDetailsDao;
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Description 获取token
**/
@Override
public JsonResultEntity thirdInterfaceGetToken(JSONObject object) {
JSONObject jsonObject = getstrObj("jsonStr", object);
String client_id = jsonObject.getString("client_id");
String pubKey = jsonObject.getString("pubKey");
String client_secret = jsonObject.getString("client_secret");
String username = jsonObject.getString("username");
String pwd = jsonObject.getString("pwd");
String busi_center = jsonObject.getString("busi_center");
String dsname = jsonObject.getString("dsname");
String baseUrl = jsonObject.getString("baseUrl");
Map<String, String> paramMap = new HashMap<String, String>();
// 密码模式认证
paramMap.put("grant_type", "password");
// 第三方应用id
paramMap.put("client_id", client_id);
// 第三方应用secret 公钥加密
try {
paramMap.put("client_secret", URLEncoder.encode(Encryption.pubEncrypt(pubKey, client_secret), "utf-8"));
} catch (Exception e) {
e.printStackTrace();
}
// ncc用户名
paramMap.put("username", username);
// 密码 公钥加密
try {
paramMap.put("password", URLEncoder.encode(Encryption.pubEncrypt(pubKey, pwd), "utf-8"));
} catch (Exception e) {
return BaseResult.getFailureMessageEntity("获取token失败");
}
// 账套编码
paramMap.put("biz_center", busi_center);
// 签名
String sign = SHA256Util.getSHA256(client_id + client_secret + username + pwd + pubKey, pubKey);
paramMap.put("signature", sign);
paramMap.put("dsname", dsname);
String url = baseUrl + "/nccloud/opm/accesstoken";
String mediaType = "application/x-www-form-urlencoded";
String token = null;
try {
token = doPostHutool(url, paramMap, mediaType, null, "", "token");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity("获取token失败");
}
if (JSONUtil.isTypeJSON(token)) {
JSONObject jsonObject1 = JSONObject.parseObject(token);
return BaseResult.getSuccessMessageEntity("获取token成功", jsonObject1);
} else {
return BaseResult.getSuccessMessageEntity("获取token成功", token);
}
}
/**
* 发送post请求
*
* @param baseUrl
* @param paramMap
* @param mediaType
* @param headers
* @param json
* @return
*/
private String doPostHutool(String baseUrl, Map<String, String> paramMap, String mediaType, Map<String, String> headers, String json, String type) {
String result = null;
try {
StringBuffer sb = new StringBuffer();
sb.append(baseUrl);
if (paramMap != null) {
sb.append("?");
for (Map.Entry<String, String> entry : paramMap.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
sb.append(key + "=" + value).append("&");
}
}
if ("bill".equals(type)) {
sb.append("?");
for (Map.Entry<String, String> entry : headers.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
sb.append(key + "=" + value).append("&");
}
}
baseUrl = sb.toString().substring(0, sb.toString().length() - 1);
HttpRequest re = HttpRequest.post(baseUrl);
re.addHeaders(headers);
result = re.body(json)
.timeout(2000000)//超时毫秒
.execute().body();
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
/**
* @param key
* @param object
* @return com.alibaba.fastjson.JSONObject
* @Author lvleigang
* @Description 获取对象转换成jsonobj
* @Date 11:51 下午 2023/7/10
**/
public JSONObject getstrObj(String key, JSONObject object) {
if (checkStr(object.getString(key))) {
return object.getJSONObject(key);
}
return new JSONObject();
}
/**
* @param str
* @return void
* @Author lvleigang
* @Description 校验字符串
* @Date 11:41 上午 2022/12/7
**/
protected Boolean checkStr(String str) {
Boolean flag = true;
if (str == null || "".equals(str)) {
flag = false;
}
return flag;
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Description 获取供应商
**/
@Override
public JsonResultEntity thirdInterfaceGetSupplier(JSONObject jsonObject) {
BipSupplierEntity bipSupplierEntity = getData("jsonStr", jsonObject, BipSupplierEntity.class);
//设置查询区间
bipSupplierEntity.setTs(ts);
logger.info("查询供应商数据当前TS"+ts);
List<BipSupplierEntity> bipSupplierEntities = bipSupplierDao.thirdInterfaceGetSupplier(bipSupplierEntity);
//更新TS时间
ts = DateUtil.dateToString(new Date(),"yyyy-MM-dd HH:mm:ss");
logger.info("TS已更新"+ts);
//System.out.println("查询供应商明细");
logger.info("查询供应商明细"+JSON.toJSONString(bipSupplierEntities));
List<JSONObject> jsonObjectList=new ArrayList<>();
//[{"code":"SL20231101727","dataSourceCode":"master","name":"无锡恒君安管理咨询有限公司","taxpayerid":"91320205MAD2HAQN6Q","tripartiteId":"0001A31000000002M3TS","ts":"2023-11-16 14:05:10"}]
List<BipSupplierDetailsEntity> bipSupplierDetails = null;
for (BipSupplierEntity supplierEntity : bipSupplierEntities) {
List<JSONObject> list=new ArrayList<>();
JSONObject jsonObjectResult=new JSONObject();
jsonObjectResult.put("code",supplierEntity.getCode());
jsonObjectResult.put("name",supplierEntity.getName());
jsonObjectResult.put("taxpayerid",supplierEntity.getTaxpayerid());
jsonObjectResult.put("def1",supplierEntity.getDef1());
jsonObjectResult.put("def2",supplierEntity.getDef2());
jsonObjectResult.put("def3",supplierEntity.getDef3());
jsonObjectResult.put("tripartiteId",supplierEntity.getTripartiteId());
//根据供应商编码和名称查询明细
String code = supplierEntity.getCode();
String name = supplierEntity.getName();
//System.out.println("根据供应处名称编码获取明细数据code:"+code +"name:"+name);
logger.info("根据供应处名称编码获取明细数据code:"+code +"name:"+name);
BipSupplierDetailsEntity bipSupplierDetailsEntity = new BipSupplierDetailsEntity();
bipSupplierDetailsEntity.setCode(code);
bipSupplierDetailsEntity.setName(name);
logger.info("根据供应商编码,名称查询银行档案 {}",JSON.toJSONString(bipSupplierDetailsEntity));
List<BipSupplierDetailsEntity> bipSupplierDetailsEntities = queryBipSupplierDetails(bipSupplierDetailsEntity) ;
// /bipSupplierDetails.stream().filter(that-> code.equalsIgnoreCase(that.getCode() ) && name.equalsIgnoreCase(that.getName() ) ).collect(Collectors.toList());
logger.info("根据供应处名称,编码获取明细数据 bipSupplierDetailsEntities值{}",JSON.toJSONString(bipSupplierDetailsEntities));
if (bipSupplierDetailsEntities.size()>0 && null!=bipSupplierDetailsEntities){
bipSupplierDetailsEntities.get(0).setIsdefault("-8073674727882144390");
for (BipSupplierDetailsEntity supplierDetailsEntity : bipSupplierDetailsEntities) {
JSONObject jsonObjectDetails=new JSONObject();
jsonObjectDetails.put("splitbank",supplierDetailsEntity.getSplitbank());
jsonObjectDetails.put("bankaccno",supplierDetailsEntity.getBankaccno());
jsonObjectDetails.put("combinno",supplierDetailsEntity.getCombinno());
jsonObjectDetails.put("isdefault",supplierDetailsEntity.getIsdefault());
list.add(jsonObjectDetails);
}
}
jsonObjectResult.put("details",list);
jsonObjectList.add(jsonObjectResult);
}
return BaseResult.getSuccessMessageEntity("查询成功",jsonObjectList);
}
@DS("oracle91")
private List<BipSupplierDetailsEntity> queryBipSupplierDetails(BipSupplierDetailsEntity bipSupplierDetailsEntity){
// BipSupplierDetailsEntity bipSupplierDetailsEntity=new BipSupplierDetailsEntity();
// bipSupplierDetailsEntity.setCode(supplierEntity.getCode());
// bipSupplierDetailsEntity.setName(supplierEntity.getName());
List<BipSupplierDetailsEntity> bipSupplierDetailsEntities = bipSupplierDetailsDao.thirdInterfaceGetSupplierDetails(bipSupplierDetailsEntity);
return bipSupplierDetailsEntities;
}
/**
* 获取BIP组织数据
* @param jsonObject
* @return
*/
@Override
public JsonResultEntity thirdInterfaceGetOrgs(JSONObject jsonObject) {
BipOrgsEntity bipOrgsEntity = getData("jsonStr", jsonObject, BipOrgsEntity.class);
//设置查询区间
bipOrgsEntity.setOrgsts(orgsts);
logger.info("查询组织数据当前TS" + orgsts);
List<BipOrgsEntity> bipOrgsEntities = bipOrgsDao.thirdInterfaceGetOrgs(bipOrgsEntity);
//更新TS时间
orgsts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
logger.info("组织TS已更新" + orgsts);
logger.info("查询组织明细" + JSON.toJSONString(bipOrgsEntities));
List<JSONObject> jsonObjectList = new ArrayList<>();
if (null != bipOrgsEntities && bipOrgsEntities.size() > 0) {
for (BipOrgsEntity orgsEntity : bipOrgsEntities) {
List<JSONObject> list = new ArrayList<>();
JSONObject jsonObjectResult = new JSONObject();
jsonObjectResult.put("code", orgsEntity.getCode());//单位编码
jsonObjectResult.put("name", orgsEntity.getName());//单位名称
jsonObjectResult.put("tripartiteId", orgsEntity.getTripartiteId());//BIPID
//根据组织主键查询明细
String tripartiteId = orgsEntity.getTripartiteId();
//System.out.println("根据供应处名称编码获取明细数据code:"+code +"name:"+name);
logger.info("根据组织主键获取明细数据pk_financeorg:{}", tripartiteId);
BipOrgsDetailsEntity bipOrgsDetailsEntity = new BipOrgsDetailsEntity();
bipOrgsDetailsEntity.setControlorg(tripartiteId);
List<BipOrgsDetailsEntity> bipOrgsDetailsEntities = queryBipOrgsDetails(bipOrgsDetailsEntity);
if (bipOrgsDetailsEntities.size() > 0 && null != bipOrgsDetailsEntities) {
for (BipOrgsDetailsEntity orgsDetailsEntity : bipOrgsDetailsEntities) {
JSONObject jsonObjectDetails = new JSONObject();
jsonObjectDetails.put("bankCode", orgsDetailsEntity.getBankCode());//开户行编码
jsonObjectDetails.put("bankName", orgsDetailsEntity.getBankName());//开户行名称
jsonObjectDetails.put("accnum", orgsDetailsEntity.getAccnum());//账户
jsonObjectDetails.put("cnapsCode", orgsDetailsEntity.getCnapsCode());//联行号
list.add(jsonObjectDetails);
}
}
jsonObjectResult.put("details", list);
jsonObjectList.add(jsonObjectResult);
}
}
return BaseResult.getSuccessMessageEntity("查询成功", jsonObjectList);
}
private List<BipOrgsDetailsEntity> queryBipOrgsDetails(BipOrgsDetailsEntity bipOrgsDetailsEntity){
List<BipOrgsDetailsEntity> bipOrgsDetailsEntities = bipOrgsDetailsDao.thirdInterfaceGetOrgsDetails(bipOrgsDetailsEntity);
return bipOrgsDetailsEntities;
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Description 新增供应商
**/
@Override
public JsonResultEntity thirdInterfaceSaveSupplier(JSONObject object) {
JSONObject jsonObject = getstrObj("jsonStr", object);
//认证access_token
String access_token = jsonObject.getString("access_token");
//认证security_key
String security_key = jsonObject.getString("security_key");
//服务器ipport
String baseUrl = jsonObject.getString("baseUrl");
//api方法
String apiUrl = jsonObject.getString("apiUrl");
//发送的数据
String sendData =jsonObject.getString("sendData");
//对应于在第三方应用注册当中的app_id
String client_id = jsonObject.getString("client_id");
//公钥
String pubKey = jsonObject.getString("pubKey");
//接口调用业务标识
String busi_id = jsonObject.getString("busi_id");
//重复调用检查
String repeat_check = jsonObject.getString("repeat_check");
//返回值压缩加密级别
String secret_level = jsonObject.getString("secret_level") == null ? "L0": jsonObject.getString("secret_level") ;
try {
String returnStr = sendApi(access_token, security_key, baseUrl,apiUrl,sendData,client_id,pubKey,busi_id,repeat_check,secret_level);
if(JSONUtil.isTypeJSON(returnStr)){
JSONObject jsonObject1 = JSONObject.parseObject(returnStr);
return BaseResult.getSuccessMessageEntity("发送数据成功",jsonObject1);
}else {
return BaseResult.getSuccessMessageEntity("发送数据成功",returnStr);
}
} catch (Exception e) {
return BaseResult.getFailureMessageEntity("发送数据错误");
}
}
/**
* 供应商传递OA
* @param jsonObject
* @return
*/
@Override
public JsonResultEntity thirdInterfaceSendOa(JSONObject jsonObject) throws Exception {
JSONObject jsonObjectStr = getstrObj("jsonStr", jsonObject);
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(jsonObjectStr.getString("plug_id"));
JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObjectStr);
return BaseResult.getSuccessMessageEntity("传递成功");
}
/**
* @param access_token 认证access_token
* @param security_key 认证security_key
* @param baseUrl 服务器ipport
* @param apiUrl api方法
* @param putParameter 发送的数据
* @param client_id 对应于在第三方应用注册当中的app_id
* @param pubKey 公钥
* @param busi_id 接口调用业务标识
* @param repeat_check 重复调用检查
* @param secret_level 返回值压缩加密级别
* @return java.lang.String
* @Author lvleigang
* @Description 发起api接口
* @Date 9:52 上午 2023/8/22
**/
private String sendApi(String access_token, String security_key, String baseUrl, String apiUrl, String putParameter, String client_id, String pubKey, String busi_id, String repeat_check, String secret_level) throws Exception{
// header 参数
Map<String, String> headermap = new HashMap<>();
headermap.put("access_token", access_token);
headermap.put("client_id", client_id);
StringBuffer sb = new StringBuffer();
sb.append(client_id);
if (StringUtils.isNotBlank(putParameter)) {
sb.append(putParameter);
}
sb.append(pubKey);
String sign = SHA256Util.getSHA256(sb.toString(), pubKey);
headermap.put("signature", sign);
if (StringUtils.isNotBlank(busi_id)) {
headermap.put("busi_id", busi_id);
}
if (StringUtils.isNotBlank(repeat_check)) {
headermap.put("repeat_check", repeat_check);
}
String mediaType = "application/json;charset=utf-8";
// 表体数据json
// 根据安全级别选择加密或压缩请求表体参数
String json = dealRequestBody(putParameter, security_key, secret_level);
// 返回值
String sendUrl = baseUrl + apiUrl;
String result = doPostHutool(sendUrl, null, mediaType, headermap, json, "bill");
String changeData = dealResponseBody(result, security_key, secret_level);
return changeData;
}
// 返回值进行过加密和压缩对返回值进行解压和解密
private static String dealResponseBody(String source, String security_key, String level) throws Exception {
String result = null;
if (StringUtils.isEmpty(level) || SecretConst.LEVEL0.equals(level)) {
result = source;
} else if (SecretConst.LEVEL1.equals(level)) {
result = Decryption.symDecrypt(security_key, source);
} else if (SecretConst.LEVEL2.equals(level)) {
result = CompressUtil.gzipDecompress(source);
} else if (SecretConst.LEVEL3.equals(level)) {
result = CompressUtil.gzipDecompress(Decryption.symDecrypt(security_key, source));
} else if (SecretConst.LEVEL4.equals(level)) {
result = Decryption.symDecrypt(security_key, CompressUtil.gzipDecompress(source));
} else {
throw new Exception("无效的安全等级");
}
return result;
}
// 根据安全级别设置表体是否加密或压缩
private static String dealRequestBody(String source, String security_key, String level) throws Exception {
String result = null;
if (StringUtils.isEmpty(level) || SecretConst.LEVEL0.equals(level)) {
result = source;
} else if (SecretConst.LEVEL1.equals(level)) {
result = Encryption.symEncrypt(security_key, source);
} else if (SecretConst.LEVEL2.equals(level)) {
result = CompressUtil.gzipCompress(source);
} else if (SecretConst.LEVEL3.equals(level)) {
result = Encryption.symEncrypt(security_key, CompressUtil.gzipCompress(source));
} else if (SecretConst.LEVEL4.equals(level)) {
result = CompressUtil.gzipCompress(Encryption.symEncrypt(security_key, source));
} else {
throw new Exception("无效的安全等级");
}
return result;
}
class SecretConst {
/**
* LEVEL0 不压缩不加密
*/
public static final String LEVEL0 = "L0";
/**
* LEVEL1 只加密不压缩
*/
public static final String LEVEL1 = "L1";
/**
* LEVEL2 只压缩不加密
*/
public static final String LEVEL2 = "L2";
/**
* LEVEL3 先压缩后加密
*/
public static final String LEVEL3 = "L3";
/**
* LEVEL4 先加密后压缩
*/
public static final String LEVEL4 = "L4";
}
}

View File

@ -0,0 +1,92 @@
package com.hzya.frame.bip.v3.v2207.service.impl;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDetailsDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDetailsDao;
import com.hzya.frame.bip.v3.v2207.entity.*;
import com.hzya.frame.bip.v3.v2207.service.IBipV32207Service;
import com.hzya.frame.bip.v3.v2207.service.IBipV32207TokenService;
import com.hzya.frame.dateutil.DateUtil;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.util.PluginUtils;
import com.hzya.frame.util.bipV3.Encryption;
import com.hzya.frame.util.bipV3.SHA256Util;
import com.hzya.frame.util.oldNcc.CompressUtil;
import com.hzya.frame.util.oldNcc.Decryption;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.net.URLEncoder;
import java.util.*;
@Service(value = "bipV32207TokenService")
public class BipV32207TokenServiceImpl extends BaseService<BipTokenVo, String> implements IBipV32207TokenService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
*
* @content 此方法获取BIPtokenheade参数动态传入
* @author laborer
* @date 2024/5/27 0027 11:38
*
*/
@Override
public SysExtensionApiEntity getBipToken(SysExtensionApiEntity entity) {
try {
Map<String, String> headers = entity.getHeaders();
String client_id = headers.get("client_id");
Map<String, String> paramMap = new HashMap<String, String>();
// 密码模式认证
paramMap.put("grant_type", "client_credentials");
// 第三方应用id
paramMap.put("client_id", client_id);
// 第三方应用secret]
String client_secret = headers.get("client_secret");
// 账套编码
String busi_center = headers.get("busi_center");
//用户编码
String usercode = headers.get("usercode");
//数据库编码
String dsname = headers.get("dsname");
String pubKey = headers.get("pubKey");
// 第三方应用secret 公钥加密]
paramMap.put("client_secret", URLEncoder.encode(Encryption.pubEncrypt(pubKey, client_secret), "utf-8"));
// 账套编码
paramMap.put("biz_center", busi_center);
// // TODO 传递数据源和ncc登录用户
paramMap.put("dsname", dsname);
paramMap.put("usercode", usercode);
// 签名
String sign = SHA256Util.getSHA256(client_id + client_secret + pubKey,pubKey);
paramMap.put("signature", sign);
StringBuffer querys = new StringBuffer();
querys.append("biz_center="+busi_center);
querys.append("&grant_type="+"client_credentials");
querys.append("&signature="+sign);
querys.append("&dsname="+dsname);
querys.append("&client_secret="+URLEncoder.encode(Encryption.pubEncrypt(pubKey, client_secret), "utf-8"));
querys.append("&usercode="+usercode);
querys.append("&client_id="+client_id);
entity.setQuerys(querys.toString());
headers.put("content-type","application/x-www-form-urlencoded");
} catch (Exception e) {
e.printStackTrace();
}
return entity;
}
}

View File

@ -0,0 +1,65 @@
package com.hzya.frame.bip.v3.v2207.util;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
/**
* com.hzya.frame.bip.v3.v2207.util
*
* @author makejava
* @date 2024-05 -30 14:20
*/
public class BipUtil {
/**
*
* @content 发送单据到BIP系统
* @author laborer
* @date 2024/6/21 0021 10:51
*
*/
public static String sendU9cTOBipEsb(String parm, String apiCode,String token){
String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl)
.header("appId", "800023")//头信息多个头信息多次调用此方法即可
.header("access_token", token)//头信息多个头信息多次调用此方法即可
.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 getBipToken(String userCode, String apiCode){
String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
String result = HttpRequest.post(baseUrl)
.header("appId", "800023")//头信息多个头信息多次调用此方法即可
.header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可
.header("usercode", userCode)//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body("")//表单内容
.timeout(20000)//超时毫秒
.execute().body();
System.out.println("返回参数"+result);
if(StrUtil.isNotEmpty(result)){
JSONObject obj = JSON.parseObject( analytic(result));
JSONObject data = obj.getJSONObject("data");
return data.getString("access_token");
}
return null;
}
public static String analytic(String parm){
JSONObject main = JSON.parseObject(parm);
return main.getString("attribute");
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

View File

@ -0,0 +1,31 @@
package com.hzya.frame.dd;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
/***
* 对接钉钉相关功能接口实现类用于内部应用调用返回指定格式数据
* @content:
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-29 9:38
* @param
* @return
**/
public interface IDDInterfaceService {
/***
* 推送钉钉方法
* @content:
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-29 9:46
* @param
* @return void
**/
String senddd(JSONObject requestJson);
}

View File

@ -0,0 +1,165 @@
package com.hzya.frame.dd.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.dd.IDDInterfaceService;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
/**
* @author 👻👻👻👻👻👻👻👻👻👻 gjh
* @version 1.0
* @content
* @date 2023-08-29 9:48
*/
@Service(value = "ddInterfaceService")
public class DdInterfaceServiceImpl implements IDDInterfaceService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
//TODO 此处参数暂时使用变量使用后续应该使用应用参数动态设置
private final String appSecret = "DuRw6EEEvhGXfr6Q8wN_x4025qKjrffIGCXF9KeCKKIID-LVSsR6_8KWMei6sug1";
private final String appKey = "dingxewtjaserj292ggu";
//TODO 此处参数暂时使用变量使用后续应该使用应用参数动态设置
@Override
public String senddd(JSONObject requestJson) {
JSONObject jsonStrObj = requestJson.getJSONObject("jsonStr");
if(ObjectUtils.isEmpty(jsonStrObj)){
throw new BaseSystemException("请传入jsonStr参数");
}
String code = jsonStrObj.getString("code");
if(StringUtils.isEmpty(code)){
throw new BaseSystemException("请传入接口编号参数:code");
}
String url = getDdUrlByType(code);
String accessTokenCode = "0001";
//如果请求的是token接口不需要拼接access_token参数
String result = null;
//如果是单据接口需要增加access_token参数在此处定义变量赋值
String access_token = getToken();
if(accessTokenCode.equalsIgnoreCase(code)){
url+= "?appkey="+appKey+"&appsecret="+appSecret;
result = HttpUtil.get(url);
JSONObject jsonObject = analysisDDResult(result);
access_token = jsonObject.getString("access_token");
}else{
url+= "?access_token="+access_token;
JSONObject data = jsonStrObj.getJSONObject("data");
if("0004".equals(code) || "0003".equals(code)|| "0005".equals(code)){
logger.info("调用钉钉请求前参数:{}",data.toString());
if("0003".equals(code)){
String formInstanceId = data.getString("formInstanceId");
//如果表单ID不等于空走编辑动作
if(StrUtil.isNotEmpty(formInstanceId)){
result = HttpRequest.put(url).header("x-acs-dingtalk-access-token",access_token).body(data.toString()).execute().body();
}else{
result = HttpRequest.post(url).header("x-acs-dingtalk-access-token",access_token).body(data.toString()).execute().body();
}
}
logger.info("调用钉钉返回参数:{}",result);
}else{
result = HttpRequest.post(url).header("access_token",access_token).body(data.toJSONString()).execute().body();
}
}
return result;
}
/*****
* 暂时写个固定获取token方法
* @content:
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-29 14:52
* @param
* @return java.lang.String
**/
private String getToken(){
String url = getDdUrlByType("0001");
url+= "?appkey="+appKey+"&appsecret="+appSecret;
String result = HttpUtil.get(url);
JSONObject jsonObject = analysisDDResult(result);
String access_token = jsonObject.getString("access_token");
return access_token;
}
/****
* 解析钉钉接口返回的数据转换成json对象
* @content:
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-29 11:55
* @param
* @return com.alibaba.fastjson.JSONObject
**/
private JSONObject analysisDDResult(String result){
//解析result
JSONObject jsonObject = JSON.parseObject(result);
//定义钉钉返回成功的标记
String okCode = "0";
//钉钉返回的接口成功标记
String errorCode = jsonObject.getString("errcode");
//钉钉接口返回的提示信息
String errmsg = jsonObject.getString("errmsg");
//钉钉Result
String ddResult = jsonObject.getString("result");
//如果返回值是0则表示调用成功了
if(okCode.equalsIgnoreCase(errorCode)){
return jsonObject;
}else{
throw new BaseSystemException("调用钉钉接口失败!错误代码:"+errorCode+"错误信息:"+errmsg);
}
}
/*****
* 把所有做过的钉钉接口在此处做备注通过给外部系统的编号获取
* @content:
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-29 9:54
* @param
* @return java.lang.String
**/
private String getDdUrlByType(String code){
StringBuffer urlBuffer = null;
if("0003".equals(code)|| "0004".equals(code)|| "0005".equals(code)){
urlBuffer = new StringBuffer("https://api.dingtalk.com");
}else{
urlBuffer = new StringBuffer("https://oapi.dingtalk.com");
}
switch (code){
case "0001":
//获取钉钉tokenURL
urlBuffer.append("/gettoken") ;
break;
//通知审批通过URL
case "0002":
urlBuffer.append("/topapi/attendance/approve/finish") ;
break;
//销售合同URL,无流程表单统一Url
case "0003":
urlBuffer.append("/v1.0/yida/forms/instances") ;
break;
case "0004":
urlBuffer.append("/v1.0/yida/forms/instances/search") ;
break;
case "0005":
urlBuffer.append("/v1.0/yida/forms/instances") ;
// urlBuffer.append("/v1.0/yida/processes/instances/start") ;
break;
default:
throw new BaseSystemException("获取钉钉URL错误请确认URL编号");
}
return urlBuffer.toString();
}
}

View File

@ -0,0 +1,48 @@
package com.hzya.frame.dingtalk.enums;
/**
* @Description 通讯录事件类型
* @Author xiangerlin
* @Date 2024/8/27 15:58
**/
public enum OrgEventEnum {
USER_ADD_ORG("user_add_org","通讯录用户新增"),
USER_MODIFY_ORG("user_modify_org","通讯录用户更改"),
USER_LEAVE_ORG("user_leave_org","通讯录用户离职"),
USER_ACTIVE_ORG("user_active_org","加入企业后用户激活"),
ORG_DEPT_CREATE("org_dept_create","通讯录企业部门创建"),
ORG_DEPT_MODIFY("org_dept_modify","通讯录企业部门更改"),
ORG_DEPT_REMOVE("org_dept_remove","通讯录企业部门删除"),
;
private String code;
private String explain;
OrgEventEnum(String code, String explain) {
this.code = code;
this.explain = explain;
}
public String getCode() {
return code;
}
public String getExplain() {
return explain;
}
/**
* 根据code获取事件类型
* @param code
* @return
*/
public static OrgEventEnum getByCode(String code){
for (OrgEventEnum org : OrgEventEnum.values()) {
if (org.getCode().equals(code)){
return org;
}
}
return null;
}
}

View File

@ -0,0 +1,32 @@
package com.hzya.frame.dingtalk.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
/**
* @Description 钉钉集成扩展类
* @Author xiangerlin
* @Date 2024/8/28 14:25
**/
public interface IDingTalkExtService {
/**
* 调用这个方法初始化钉钉参数
* @param entity
* @return
*/
SysExtensionApiEntity init(SysExtensionApiEntity entity);
/**
* 查询配置在应用上的钉钉参数
* @param sysApplication
* @return
*/
JSONObject getDingTalkConfig(SysApplicationEntity sysApplication);
/**
* 清空配置缓存
*/
void clearDingTalkConfigCatch();
}

View File

@ -0,0 +1,66 @@
package com.hzya.frame.dingtalk.service;
import com.dingtalk.api.request.OapiV2UserListRequest;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserListResponse;
import java.util.List;
/**
* @Description 钉钉service
* @Author xiangerlin
* @Date 2024/8/27 16:17
**/
public interface IDingTalkService {
/**
* 根据userid获取用户详情
* @param userId 钉钉userid
* @param appKey
* @param appSecret
* @return
*/
OapiV2UserGetResponse.UserGetResponse getUserById(String userId, String appKey, String appSecret);
/**
* 根据userid获取用户详情
* @param userId
* @return
*/
OapiV2UserGetResponse.UserGetResponse getUserById(String userId);
/**
* 获取部门用户列表
* @param req 请求参数
* @param appKey
* @param appSecret
* @return
*/
OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret);
/**
* 根据部门id获取部门详情
* @param deptId 钉钉部门id
* @param appKey
* @param appSecret
* @return
*/
OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId, String appKey, String appSecret);
/**
* 根据部门id获取部门详情
* @param deptId
* @return
*/
OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId);
/**
* 获取部门列表此接口只会返回下一级部门信息
* @param deptId 部门id如果不传则查询一级部门
* @param appKey
* @param appSecret
* @return
*/
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(Long deptId, String appKey, String appSecret);
}

View File

@ -0,0 +1,100 @@
package com.hzya.frame.dingtalk.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.dingtalk.service.IDingTalkExtService;
import com.hzya.frame.dingtalk.util.DingTalkAccessToken;
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity;
import com.hzya.frame.sysnew.application.apiPara.dao.ISysApplicationApiParaDao;
import com.hzya.frame.sysnew.application.apiPara.entity.SysApplicationApiParaEntity;
import com.hzya.frame.sysnew.application.apiPara.service.ISysApplicationApiParaService;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Description 钉钉集成扩展类
* @Author xiangerlin
* @Date 2024/8/28 14:25
**/
@Service(value = "dingTalkExtService")
public class DingTalkExtServiceImpl implements IDingTalkExtService {
@Resource
private ISysApplicationApiParaDao sysApplicationApiParaDao;
private final ConcurrentHashMap<String, JSONObject> dingTalkMap = new ConcurrentHashMap<>();
/**
* 调用这个方法初始化钉钉参数
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity init(SysExtensionApiEntity entity) {
Map<String, String> headers = entity.getHeaders();
if (null == headers){
headers = new HashMap<>();
}
SysApplicationEntity receiveApp = entity.getReceiveApp();
//查询应用上配置的参数
JSONObject dingTalkConfig = getDingTalkConfig(receiveApp);
//给token赋值
entity.setQuerys("access_token="+DingTalkAccessToken.getAccessToken(dingTalkConfig.getString("appKey"),dingTalkConfig.getString("appSecret")));
return entity;
}
/**
* 查询配置在应用上的钉钉参数
*
* @param sysApplication
* @return
*/
@Override
public JSONObject getDingTalkConfig(SysApplicationEntity sysApplication) {
if (null != sysApplication && StrUtil.isNotEmpty(sysApplication.getId()) && null != sysApplication.getAppId()){
JSONObject jsonObject = new JSONObject();
String key = sysApplication.getAppId()+"dingTalk";
if (null != dingTalkMap.get(key)){
return dingTalkMap.get(key);
}else {
//查询应用上配置的参数
SysApplicationApiParaEntity paraEntity = new SysApplicationApiParaEntity();
paraEntity.setAppId(sysApplication.getId());
List<SysApplicationApiParaEntity> paraList = sysApplicationApiParaDao.query(paraEntity);
if (CollectionUtils.isNotEmpty(paraList)) {
List<SysApplicationApiParaEntity> appKeyList = paraList.stream().filter(p -> p.getInterfaceKey().equals("appKey")).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(appKeyList)) {
jsonObject.put("appKey", appKeyList.get(0).getInterfaceValue());
}
List<SysApplicationApiParaEntity> appSecretList = paraList.stream().filter(p -> p.getInterfaceKey().equals("appSecret")).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(appSecretList)) {
jsonObject.put("appSecret", appSecretList.get(0).getInterfaceValue());
}
dingTalkMap.put(key,jsonObject);
return dingTalkMap.get(key);
}
}
}
return null;
}
/**
* 清空配置缓存
*/
@Override
public void clearDingTalkConfigCatch() {
dingTalkMap.clear();
}
}

View File

@ -0,0 +1,164 @@
package com.hzya.frame.dingtalk.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiV2DepartmentGetRequest;
import com.dingtalk.api.request.OapiV2DepartmentListsubRequest;
import com.dingtalk.api.request.OapiV2UserGetRequest;
import com.dingtalk.api.request.OapiV2UserListRequest;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserListResponse;
import com.hzya.frame.dingtalk.service.IDingTalkService;
import com.hzya.frame.dingtalk.util.DingTalkAccessToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description 钉钉service
* @Author xiangerlin
* @Date 2024/8/27 16:17
**/
@Service
public class DingTalkServiceImpl implements IDingTalkService {
Logger logger = LoggerFactory.getLogger(getClass());
@Value("${dingtalk.appKey:}")
private String dAppKey;
@Value("${dingtalk.appSecret:}")
private String dAppSecret;
/**
* 根据userid获取用户详情
*
* @param userId 钉钉userid
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2UserGetResponse.UserGetResponse getUserById(String userId, String appKey, String appSecret) {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/get");
OapiV2UserGetRequest req = new OapiV2UserGetRequest();
req.setUserid(userId);
req.setLanguage("zh_CN");
try {
OapiV2UserGetResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
OapiV2UserGetResponse.UserGetResponse result = rsp.getResult();
String s = JSONObject.toJSONString(result);
logger.info("人员详情信息:{}",s);
return result;
}
}catch (Exception e){
logger.error("根据部门id获取钉钉用户详情出错{}",e);
}
return null;
}
/**
* 根据userid获取用户详情
*
* @param userId
* @return
*/
@Override
public OapiV2UserGetResponse.UserGetResponse getUserById(String userId) {
return getUserById(userId,dAppKey,dAppSecret);
}
/**
* 获取部门用户列表
*
* @param req 请求参数
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/list");
req.setSize(100L);//每页最大只能查100条
req.setOrderField("modify_desc");
req.setContainAccessLimit(false);
req.setLanguage("zh_CN");
OapiV2UserListResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
OapiV2UserListResponse.PageResult result = rsp.getResult();
return result;
}catch (Exception e){
e.printStackTrace();
}
return null;
}
/**
* 根据部门id获取部门详情
*
* @param deptId 钉钉部门id
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId, String appKey, String appSecret) {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/get");
OapiV2DepartmentGetRequest req = new OapiV2DepartmentGetRequest();
req.setDeptId(deptId);
req.setLanguage("zh_CN");
try {
OapiV2DepartmentGetResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
OapiV2DepartmentGetResponse.DeptGetResponse result = rsp.getResult();
String s = JSONObject.toJSONString(result);
logger.info("部门详情信息:{}",s);
return result;
}
}catch(Exception e){
logger.error("根据部门id获取钉钉部门出错{}",e);
}
return null;
}
/**
* 根据部门id获取部门详情
*
* @param deptId
* @return
*/
@Override
public OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId) {
return getDeptById(deptId,dAppKey,dAppSecret);
}
/**
* 获取部门列表此接口只会返回下一级部门信息
* @param deptId 部门id如果不传则查询一级部门
* @param appKey
* @param appSecret
* @return
*/
@Override
public List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(Long deptId,String appKey,String appSecret) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsub");
OapiV2DepartmentListsubRequest req = new OapiV2DepartmentListsubRequest();
req.setDeptId(deptId);
req.setLanguage("zh_CN");
OapiV2DepartmentListsubResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> result = rsp.getResult();
return result;
}
}catch (Exception e){
logger.error("获取部门列表接口出错:{}",e);
}
return null;
}
}

View File

@ -0,0 +1,103 @@
package com.hzya.frame.dingtalk.util;
import cn.hutool.core.util.StrUtil;
import com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenResponse;
import com.aliyun.tea.TeaException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import java.time.Instant;
/**
* @Description 钉钉获取accessToken
* @Author xiangerlin
* @Date 2024/8/27 14:05
**/
public class DingTalkAccessToken {
static Logger logger = LoggerFactory.getLogger(DingTalkAccessToken.class);
//token
private static String accessToken;
//过期时间
private static Instant expireTime;
private static final Long CACHE_EXPIRY_TIME = 7000L; // 缓存有效时间
//应用key
private static String appKey;
//应用密钥
private static String appSecret;
@Value("${dingtalk.appKey:}")
public static void setAppKey(String appKey) {
DingTalkAccessToken.appKey = appKey;
}
@Value("${dingtalk.appSecret:}")
public static void setAppSecret(String appSecret) {
DingTalkAccessToken.appSecret = appSecret;
}
/**
* 获取token
* @return
*/
public static String getAccessToken(){
return getAccessToken(appKey,appSecret);
}
/**
* 获取accessToken
*
* @param appKey
* @param appSecret
* @return
*/
public static String getAccessToken(String appKey,String appSecret) {
//判断是否过期 如果没过期直接返回
if (null != accessToken && expireTime != null && Instant.now().isBefore(expireTime)) {
return accessToken;
}
//获取新的accessToken
accessToken = fetchNewAccessToken(appKey,appSecret);
//过期时间设置成当前事件+7000s预留200s的时间
expireTime = Instant.now().plusSeconds(CACHE_EXPIRY_TIME);
return accessToken;
}
/**
* 获取新的accessToken
*
* @return
*/
private static String fetchNewAccessToken(String appKey,String appSecret) {
try {
//查询应用上配置的钉钉信息
if (StrUtil.isNotEmpty(appKey) && StrUtil.isNotEmpty(appSecret)) {
//查询应用上的信息
com.aliyun.dingtalkoauth2_1_0.Client client = DingTalkAccessToken.createClient();
com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenRequest getAccessTokenRequest = new com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenRequest()
.setAppKey(appKey)
.setAppSecret(appSecret);
GetAccessTokenResponse accessToken = client.getAccessToken(getAccessTokenRequest);
String accessToken1 = accessToken.getBody().getAccessToken();
return accessToken1;
}
} catch (Exception _err) {
TeaException err = new TeaException(_err.getMessage(), _err);
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code message 属性可帮助开发定位问题
}
logger.error("获取钉钉token出错:{}", _err);
}
return null;
}
/**
* 使用 Token 初始化账号Client
*
* @return Client
* @throws Exception
*/
private static com.aliyun.dingtalkoauth2_1_0.Client createClient() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
return new com.aliyun.dingtalkoauth2_1_0.Client(config);
}
}

View File

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

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

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

View File

@ -0,0 +1,19 @@
package com.hzya.frame.grpU8.acctVouchInfo.dao;
import com.hzya.frame.grpU8.acctVouchInfo.entity.AcctVouchInfoEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.grpU8.acctVouchInfo.entity.AcctVouchInfoEntityVo;
import java.util.List;
/**
* 子表(acct_vouch_info: table)表数据库访问层
*
* @author makejava
* @since 2024-07-09 11:25:15
*/
public interface IAcctVouchInfoDao extends IBaseDao<AcctVouchInfoEntity, String> {
List<AcctVouchInfoEntityVo> queryData(AcctVouchInfoEntity entity);
}

View File

@ -0,0 +1,31 @@
package com.hzya.frame.grpU8.acctVouchInfo.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.grpU8.acctVouchInfo.entity.AcctVouchInfoEntity;
import com.hzya.frame.grpU8.acctVouchInfo.dao.IAcctVouchInfoDao;
import com.hzya.frame.grpU8.acctVouchInfo.entity.AcctVouchInfoEntityVo;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* 子表(AcctVouchInfo)表数据库访问层
*
* @author makejava
* @since 2024-07-09 11:25:15
*/
@Repository(value = "AcctVouchInfoDaoImpl")
public class AcctVouchInfoDaoImpl extends MybatisGenericDao<AcctVouchInfoEntity, String> implements IAcctVouchInfoDao {
@DS("#entity.dataSourceCode")
@Override
public List<AcctVouchInfoEntityVo> queryData(AcctVouchInfoEntity entity) {
List<AcctVouchInfoEntityVo> o = (List<AcctVouchInfoEntityVo>) super.selectList(getSqlIdPrifx() + "queryData", entity);
return o;
}
}

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