Compare commits

..

17 Commits

43 changed files with 1891 additions and 0 deletions

View File

@ -0,0 +1,4 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "automatic"
}

View File

@ -0,0 +1,4 @@
# Cpicxim-XMNHSA-Repeater
惠厦保相关项目。
宸汐-》厦门太保-》厦门医保局 数据转发。

View File

@ -0,0 +1,162 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>cpicxim.com.cn</groupId>
<artifactId>Cpicxim-XMNHSA-Repeater</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Cpicxim-XMNHSA-Repeater Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<spring.version>6.2.3</spring.version>
<log4j2.version>2.20.0</log4j2.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<!--jackson-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.13.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.13.4</version>
</dependency>
<!-- log-4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.20.0</version>
</dependency>
<!-- POI -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<!-- mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.19</version>
</dependency>
</dependencies>
<build>
<finalName>Cpicxim-XMNHSA-Repeater</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.prorerties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.4.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -0,0 +1,86 @@
/*
* @Author: Kane
* @Date: 2025-03-06 14:33:27
* @LastEditors: Kane
* @FilePath: /Cpicxim-XMNHSA-Repeater/src/main/java/com/cpicxim/huixiabao/data/pojo/HmbListItem.java
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpicxim.huixiabao.data.pojo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude( JsonInclude.Include.NON_EMPTY )
@JsonPropertyOrder( alphabetic = true )
public class HmbListItem
{
public String getPsnName()
{
return psnName;
}
public void setPsnName( String psnName )
{
this.psnName = psnName;
}
public String getCertNo()
{
return certNo;
}
public void setCertNo( String certNo )
{
this.certNo = certNo;
}
public String getServiceId()
{
return serviceId;
}
public void setServiceId( String serviceId )
{
this.serviceId = serviceId;
}
public String getStatus()
{
return status;
}
public void setStatus( String status )
{
this.status = status;
}
public String getXyxNo()
{
return xyxNo;
}
public void setXyxNo( String xyxNo )
{
this.xyxNo = xyxNo;
}
@JsonProperty("psnName")
private String psnName;
@JsonProperty("certno")
private String certNo;
@JsonProperty("serviceId")
private String serviceId;
@JsonProperty("status")
private String status;
@JsonProperty("xyxNo")
private String xyxNo;
}

View File

@ -0,0 +1,59 @@
/*
* @Author: Kane
* @Date: 2025-03-06 14:27:05
* @LastEditors: Kane
* @FilePath: /Cpicxim-XMNHSA-Repeater/src/main/java/com/cpicxim/huixiabao/data/pojo/HmbXyxInfoRequest.java
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpicxim.huixiabao.data.pojo;
import java.util.Vector;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude( JsonInclude.Include.NON_EMPTY )
@JsonPropertyOrder( alphabetic = true )
public class HmbXyxInfoRequest
{
public HmbXyxInfoRequest()
{
this.topic = "hmbXyxInfo";
this.hmbList = new Vector<>();
}
public HmbXyxInfoRequest( String topic, Vector<HmbListItem> hmbList )
{
this.topic = topic;
this.topic = "hmbXyxInfo";
this.hmbList = hmbList;
}
public String getTopic()
{
return topic;
}
public void setTopic( String topic )
{
this.topic = topic;
}
public Vector<HmbListItem> getHmbList()
{
return hmbList;
}
public void setHmbList( Vector<HmbListItem> hmbList )
{
this.hmbList = hmbList;
}
@JsonProperty("topic")
private String topic; // 业务类型
@JsonProperty("hmbList")
private Vector<HmbListItem> hmbList;
}

View File

@ -0,0 +1,82 @@
/*
* @Author: Kane
* @Date: 2025-03-06 14:17:24
* @LastEditors: Kane
* @FilePath: /Cpicxim-XMNHSA-Repeater/src/main/java/com/cpicxim/huixiabao/data/pojo/NHACommenRequestBody.java
* @Description: 易联众请求共通报文结构
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpicxim.huixiabao.data.pojo;
import com.fasterxml.jackson.annotation.JsonProperty;
public class NHACommenRequestBody
{
public String getChs_fjs_appid()
{
return chs_fjs_appid;
}
public void setChs_fjs_appid( String chs_fjs_appid )
{
this.chs_fjs_appid = chs_fjs_appid;
}
public String getChs_fjs_appsecret()
{
return chs_fjs_appsecret;
}
public void setChs_fjs_appsecret( String chs_fjs_appsecret )
{
this.chs_fjs_appsecret = chs_fjs_appsecret;
}
public String getChs_fjs_token()
{
return chs_fjs_token;
}
public void setChs_fjs_token( String chs_fjs_token )
{
this.chs_fjs_token = chs_fjs_token;
}
public String getChs_fjs_funid()
{
return chs_fjs_funid;
}
public void setChs_fjs_funid( String chs_fjs_funid )
{
this.chs_fjs_funid = chs_fjs_funid;
}
public String getChs_fjs_encdata()
{
return chs_fjs_encdata;
}
public void setChs_fjs_encdata( String chs_fjs_encdata )
{
this.chs_fjs_encdata = chs_fjs_encdata;
}
public String getChs_fjs_sign()
{
return chs_fjs_sign;
}
public void setChs_fjs_sign( String chs_fjs_sign )
{
this.chs_fjs_sign = chs_fjs_sign;
}
public int getChs_fjs_timestamp()
{
return chs_fjs_timestamp;
}
public void setChs_fjs_timestamp( int chs_fjs_timestamp )
{
this.chs_fjs_timestamp = chs_fjs_timestamp;
}
private String chs_fjs_appid; // 渠道id
private String chs_fjs_appsecret; // 渠道私钥
private String chs_fjs_token; // 请求时携带的动态令牌
private String chs_fjs_funid; // 服务编号
private String chs_fjs_encdata; // 加密后的数据
private String chs_fjs_sign; // 签名数据串
private String data; // 未加密的数据
private int chs_fjs_timestamp; // 时间戳
}

View File

@ -0,0 +1,22 @@
/*
* @Author: Kane
* @Date: 2025-02-20 09:56:32
* @LastEditors: Kane
* @FilePath: /Cpicxim-XMNHSA-Repeater/src/main/java/com/cpicxim/huixiabao/web/controllers/MediCover/MediCoverToCpicxim.java
* @Description: 接收宸汐数据的controller
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpicxim.huixiabao.web.controllers.MediCover;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class MediCoverToCpicxim
{
}

View File

@ -0,0 +1,15 @@
/*
* @Author: Kane
* @Date: 2025-02-18 19:03:23
* @LastEditors: Kane
* @FilePath: /Cpicxim-XMNHSA-Repeater/src/main/java/com/cpicxim/huixiabao/web/controllers/NHSA/CpicximToNHSARepeater.java
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpicxim.huixiabao.web.controllers.NHSA;
public class CpicximToNHSARepeater
{
}

View File

@ -0,0 +1,37 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">
<context:component-scan base-package="com.cpic.xim" />
<mvc:annotation-driven />
<mvc:default-servlet-handler />
<!-- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property
name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean> -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="UTF-8" />
<property name="maxUploadSize" value="-1" />
</bean>
</beans>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<xml-body>
<web-app
version="4.0"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:javaee="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
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">
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
</xml-body>

View File

@ -0,0 +1,5 @@
<html>
<body>
<h2><%= "Hello World!" %></h2>
</body>
</html>

8
code/cpicxim-XMNHSA-repeater/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="cpicxim-XMNHSA-repeater" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="cpicxim-XMNHSA-repeater" options="-extdirs D:\develop\cpicxim\cpicxim-huixiabao\code\cpicxim-XMNHSA-repeater\lib" />
</option>
</component>
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
</component>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="22 (2)" project-jdk-type="JavaSDK" />
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
}

View File

@ -0,0 +1,200 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.cpic.xim</groupId>
<artifactId>cpicxim-XMNHSA-repeater</artifactId>
<version>1.0-SNAPSHOT</version>
<name>cpicxim-XMNHSA-repeater</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compile.source>18</maven.compile.source>
<maven.compile.target>18</maven.compile.target>
<maven.compiler.release>18</maven.compiler.release>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.11.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<!-- Optionally: parameterized tests support -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<!--jackson-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.13.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.13.4</version>
</dependency>
<!-- log-4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.20.0</version>
</dependency>
<!-- POI -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<!-- mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.19</version>
</dependency>
<dependency>
<groupId> cn.hsa.zephyr</groupId>
<artifactId>zephyr-api-sdk</artifactId>
<version>2.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/zephyr-api-sdk.jar</systemPath>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<!-- <version>1.2.83</version> -->
<version>2.0.56</version>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>9.2.0</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.80</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.3.5</version>
</dependency>
</dependencies>
<build>
<defaultGoal>compile</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<compilerArguments>
<extdirs>${project.basedir}/lib</extdirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.cpic.xim.huixiabao.AppMain</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.4.3</version>
<configuration>
<mainClass>com.cpic.xim.huixiabao.AppMain</mainClass>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,55 @@
/*
* @Author: Kane
*
* @Date: 2025-03-11 09:27:40
*
* @LastEditors: Kane
*
* @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/AppMain.java
*
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.huixiabao;
import java.util.Vector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cpic.xim.huixiabao.data.config.HuixiabaoConfig;
import com.cpic.xim.huixiabao.data.pojo.HmbXyxInfo;
import com.cpic.xim.huixiabao.nhs.CpicximToXMNHS;
public class AppMain
{
private static Logger logger = LoggerFactory.getLogger( AppMain.class );
public static void main( String[] args )
{
doPostXyxInfo();
System.out.println( "Hello World!" );
}
private static void doPostXyxInfo()
{
while ( true )
{
Vector<HmbXyxInfo> xyxInfo = CpicximToXMNHS.getNeverTransHmbList();
// 发送
CpicximToXMNHS.postHmbList( xyxInfo );
try
{
Thread.sleep( HuixiabaoConfig.getSleepSeconds() * 1000 );
}
catch ( InterruptedException error )
{
logger.error( "sleep时出错" + error.getMessage() );
}
}
}
}

View File

@ -0,0 +1,62 @@
/*
* @Author: Kane
*
* @Date: 2025-03-11 09:30:38
*
* @LastEditors: Kane
*
* @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/config/HuixiabaoConfig.java
*
* @Description: 存放惠厦保相关的配置文件以后要改成json文件存放
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.huixiabao.data.config;
public class HuixiabaoConfig
{
public static String getAppid()
{
return appid;
}
public static String getAppSecret()
{
return appSecret;
}
public static String getSignKey()
{
return signKey;
}
public static String getEncKey()
{
return encKey;
}
public static int getMAX_COUNT_PER_REQUEST()
{
return MAX_COUNT_PER_REQUEST;
}
public static String getUrl()
{
return url;
}
public static int getSleepSeconds()
{
return SLEEP_SECONDS;
}
private static final int MAX_COUNT_PER_REQUEST = 500;
private static final int SLEEP_SECONDS = 10;
private static final String url = "https://172.18.1.150:9040";
private static final String appid = "hxb-tb";
private static final String appSecret = "60F468FB46170DD4CF6CBECE215DBFC0";
private static final String signKey = "1A2F447BD0F930798D8031B137EC6E25";
private static final String encKey = "08307695B1668EB9FD6210250FED874F";
}

View File

@ -0,0 +1,109 @@
/*
* @Author: Kane
*
* @Date: 2025-03-06 14:33:27
*
* @LastEditors: Kane
*
* @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/pojo/HmbXyxInfo.java
*
* @Description: 小药箱接口参数描述
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.huixiabao.data.pojo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude( JsonInclude.Include.NON_EMPTY )
@JsonPropertyOrder( alphabetic = true )
public class HmbXyxInfo
{
public HmbXyxInfo( String psnName,
String certNo,
String serviceId,
String status,
String xyxNo )
{
this.psnName = psnName;
this.certNo = certNo;
this.serviceId = serviceId;
this.status = status;
this.xyxNo = xyxNo;
}
public String getPsnName()
{
return psnName;
}
public void setPsnName( String psnName )
{
this.psnName = psnName;
}
public String getCertNo()
{
return certNo;
}
public void setCertNo( String certNo )
{
this.certNo = certNo;
}
public String getServiceId()
{
return serviceId;
}
public void setServiceId( String serviceId )
{
this.serviceId = serviceId;
}
public String getStatus()
{
return status;
}
public void setStatus( String status )
{
this.status = status;
}
public String getXyxNo()
{
return xyxNo;
}
public void setXyxNo( String xyxNo )
{
this.xyxNo = xyxNo;
}
@Override
public String toString()
{
return "HmbXyxInfo [psnName=" + psnName + ", certNo=" + certNo + ", serviceId=" + serviceId + ", status=" + status + ", xyxNo=" + xyxNo + "]";
}
@JsonProperty( "psnName" )
private String psnName;
@JsonProperty( "certno" )
private String certNo;
@JsonProperty( "serviceId" )
private String serviceId;
@JsonProperty( "status" )
private String status;
@JsonProperty( "xyxNo" )
private String xyxNo;
}

View File

@ -0,0 +1,59 @@
/*
* @Author: Kane
* @Date: 2025-03-06 14:27:05
* @LastEditors: Kane
* @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/pojo/HmbXyxInfoRequest.java
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.huixiabao.data.pojo;
import java.util.Vector;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude( JsonInclude.Include.NON_EMPTY )
@JsonPropertyOrder( alphabetic = true )
public class HmbXyxInfoRequest
{
public HmbXyxInfoRequest()
{
this.topic = "hmbXyxInfo";
this.hmbList = new Vector<>();
}
public HmbXyxInfoRequest( String topic, Vector<HmbXyxInfo> hmbList )
{
this.topic = topic;
this.topic = "hmbXyxInfo";
this.hmbList = hmbList;
}
public String getTopic()
{
return topic;
}
public void setTopic( String topic )
{
this.topic = topic;
}
public Vector<HmbXyxInfo> getHmbList()
{
return hmbList;
}
public void setHmbList( Vector<HmbXyxInfo> hmbList )
{
this.hmbList = hmbList;
}
@JsonProperty("topic")
private String topic; // 业务类型
@JsonProperty("hmbList")
private Vector<HmbXyxInfo> hmbList;
}

View File

@ -0,0 +1,82 @@
/*
* @Author: Kane
* @Date: 2025-03-06 14:17:24
* @LastEditors: Kane
* @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/pojo/NHACommenRequestBody.java
* @Description: 易联众请求共通报文结构
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.huixiabao.data.pojo;
import com.fasterxml.jackson.annotation.JsonProperty;
public class NHACommenRequestBody
{
public String getChs_fjs_appid()
{
return chs_fjs_appid;
}
public void setChs_fjs_appid( String chs_fjs_appid )
{
this.chs_fjs_appid = chs_fjs_appid;
}
public String getChs_fjs_appsecret()
{
return chs_fjs_appsecret;
}
public void setChs_fjs_appsecret( String chs_fjs_appsecret )
{
this.chs_fjs_appsecret = chs_fjs_appsecret;
}
public String getChs_fjs_token()
{
return chs_fjs_token;
}
public void setChs_fjs_token( String chs_fjs_token )
{
this.chs_fjs_token = chs_fjs_token;
}
public String getChs_fjs_funid()
{
return chs_fjs_funid;
}
public void setChs_fjs_funid( String chs_fjs_funid )
{
this.chs_fjs_funid = chs_fjs_funid;
}
public String getChs_fjs_encdata()
{
return chs_fjs_encdata;
}
public void setChs_fjs_encdata( String chs_fjs_encdata )
{
this.chs_fjs_encdata = chs_fjs_encdata;
}
public String getChs_fjs_sign()
{
return chs_fjs_sign;
}
public void setChs_fjs_sign( String chs_fjs_sign )
{
this.chs_fjs_sign = chs_fjs_sign;
}
public int getChs_fjs_timestamp()
{
return chs_fjs_timestamp;
}
public void setChs_fjs_timestamp( int chs_fjs_timestamp )
{
this.chs_fjs_timestamp = chs_fjs_timestamp;
}
private String chs_fjs_appid; // 渠道id
private String chs_fjs_appsecret; // 渠道私钥
private String chs_fjs_token; // 请求时携带的动态令牌
private String chs_fjs_funid; // 服务编号
private String chs_fjs_encdata; // 加密后的数据
private String chs_fjs_sign; // 签名数据串
private String data; // 未加密的数据
private int chs_fjs_timestamp; // 时间戳
}

View File

@ -0,0 +1,316 @@
/*
* @Author: Kane
*
* @Date: 2025-03-12 09:01:59
*
* @LastEditors: Kane
*
* @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/nhs/CpicximToXMNHS.java
*
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.huixiabao.nhs;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.SQLException;
import java.util.Vector;
import com.cpic.xim.huixiabao.data.pojo.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import cn.hsa.zephyr.apisdk.DefaultZephyrClient;
import cn.hsa.zephyr.apisdk.internal.exception.ZephyrApiException;
import cn.hsa.zephyr.apisdk.internal.util.encrypt.EncryptionModeEnum;
import cn.hsa.zephyr.apisdk.internal.util.encrypt.SignTypeEnum;
import cn.hsa.zephyr.apisdk.request.DefaultZephyrRequest;
import cn.hsa.zephyr.apisdk.response.DefaultZephyrResponse;
import com.cpic.xim.huixiabao.data.config.HuixiabaoConfig;
@SuppressWarnings(
"unused"
)
public class CpicximToXMNHS
{
private static Logger logger = LoggerFactory.getLogger( CpicximToXMNHS.class );
private static String driverName = "com.mysql.cj.jdbc.Driver";
private static String url = "jdbc:mysql://10.39.0.85:3306/huixiabao?useUnicode=true&characterEncoding=utf8&useSSL=true";
private static String userName = "huixiabao";
private static String password = "Kane@1981";
/**
* 从数据库中获取未发送过的小药箱数据
*
* @return
*/
public static Vector<HmbXyxInfo> getNeverTransHmbList()
{
Vector<HmbXyxInfo> items = new Vector<HmbXyxInfo>();
HmbXyxInfo item = null;
Connection connection = null;
Statement statement = null;
ResultSet result = null;
try
{
Class.forName( "com.mysql.cj.jdbc.Driver" );
String url = CpicximToXMNHS.url;
String userName = CpicximToXMNHS.userName;
String password = CpicximToXMNHS.password;
String sql = """
select info.psnName, info.certNo, info.serviceId, info.status, info.xyxNo
from HmbXyxInfo info,
HmbXyxInfo_Update u
where info.xyxNo = u.xyxNo """;
connection = DriverManager.getConnection( url, userName, password );
statement = connection.createStatement();
result = statement.executeQuery( sql.trim() );
while ( result.next() )
{
item = new HmbXyxInfo( result.getString( "psnName" ),
result.getString( "certno" ),
result.getString( "serviceId" ),
result.getString( "status" ),
result.getString( "xyxNo" ) );
items.add( item );
}
}
catch ( SQLException error )
{
error.printStackTrace();
}
catch ( ClassNotFoundException error )
{
logger.error( "加载sql驱动错误" + error.getMessage() );
}
finally
{
if ( result != null )
{
try
{
result.close();
}
catch ( SQLException error )
{
}
}
if ( statement != null )
{
try
{
statement.close();
}
catch ( SQLException error )
{
}
}
if ( connection != null )
{
try
{
connection.close();
}
catch ( SQLException error )
{
}
}
}
return items;
}
public static void removePostedHmbXyxInfo( Vector<HmbXyxInfo> postedItems )
{
Vector<HmbXyxInfo> items = new Vector<HmbXyxInfo>();
HmbXyxInfo item = null;
Connection connection = null;
PreparedStatement statement = null;
ResultSet result = null;
try
{
Class.forName( "com.mysql.cj.jdbc.Driver" );
String url = CpicximToXMNHS.url;
String userName = CpicximToXMNHS.userName;
String password = CpicximToXMNHS.password;
String sql = """
delete from HmbXyxInfo_Update where xyxNo = ?""";
connection = DriverManager.getConnection( url, userName, password );
statement = connection.prepareStatement( sql.trim() );
for ( HmbXyxInfo info : postedItems )
{
statement.setString( 1, info.getXyxNo() );
statement.execute();
}
connection.commit();
}
catch ( SQLException error )
{
try
{
connection.rollback();
}
catch ( SQLException e )
{
}
logger.error( "清理已发送数据失败:" + error.getMessage() );
}
catch ( ClassNotFoundException error )
{
}
finally
{
if ( result != null )
{
try
{
result.close();
}
catch ( SQLException error )
{
}
}
if ( statement != null )
{
try
{
statement.close();
}
catch ( SQLException error )
{
logger.error( "加载sql驱动错误" + error.getMessage() );
}
}
if ( connection != null )
{
try
{
connection.close();
}
catch ( SQLException error )
{
}
}
}
}
public static void postHmbList( Vector<HmbXyxInfo> items )
{
String url = HuixiabaoConfig.getUrl();
String appId = HuixiabaoConfig.getAppid();
String appSecret = HuixiabaoConfig.getAppSecret();
String funId = "xxx";
String encKey = HuixiabaoConfig.getEncKey();
String signKey = HuixiabaoConfig.getSignKey();
SignTypeEnum signType = SignTypeEnum.SM3;
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
// 发送用工具对象
DefaultZephyrClient client = new DefaultZephyrClient( url,
funId,
appId,
appSecret,
signType,
signKey,
encType,
encKey );
DefaultZephyrRequest req = new DefaultZephyrRequest();
DefaultZephyrResponse resp = null;
// 数据
JSONObject requestObject = new JSONObject();
JSONObject xyxInfo = null;
JSONArray xyxInfoList = new JSONArray();
Vector<HmbXyxInfo> postedInfo = new Vector<HmbXyxInfo>(); // 存放已经送出的数据
requestObject.put( "topic", "hmbXyxInfo" );
int request_count = 0; // 计数每个请求不能超过500条
int total_count = 0;
for ( HmbXyxInfo info : items )
{
xyxInfo = new JSONObject();
xyxInfo.put( "psnName", info.getPsnName() );
xyxInfo.put( "cerno", info.getCertNo() );
xyxInfo.put( "serviceId", info.getServiceId() );
xyxInfo.put( "status", info.getStatus() );
xyxInfo.put( "xyxNo", info.getXyxNo() );
xyxInfoList.add( xyxInfo );
postedInfo.add( info );
request_count++;
total_count++;
logger.info( "准备数据:" + xyxInfo.toJSONString() );
if ( request_count >= HuixiabaoConfig.getMAX_COUNT_PER_REQUEST() - 1 || total_count == items.size() )
{
// 达到上限或者记录已经全部处理将当前生成的数据送出
requestObject.remove( "hmbList" );
requestObject.put( "hmbList", xyxInfoList );
try
{
req.setData( requestObject );
resp = client.execute( req );
logger.info( "发送成功,返回消息:" + resp.getData() );
// 将已发送的数据从update表中清理掉
removePostedHmbXyxInfo( postedInfo );
}
catch ( ZephyrApiException error )
{
// 发送不成功记录日志
// 失败的数据就留在update表中待以后重新发送
logger.error( error.getMessage() );
}
finally
{
// 清理清单重置计数
// 如果发送失败在HmbXyxInfo_update表中保留发送失败的记录待下次发送
xyxInfoList.clear();
postedInfo.clear();
request_count = 0;
}
}
}
}
}

View File

@ -0,0 +1,40 @@
<Configuration status="WARN" monitorInterval="300">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} ### %msg%n" />
<ThresholdFilter level="trace" onMatch="ACCEPT" onMismatch="DENY" />
</Console>
<RollingFile name="rolling_file_win"
filePattern="./logs/huixiabao/$${date:yyyy-MM}/huixiabao-%d{MM-dd-yyyy}-%i.log.gz">
<PatternLayout>
<Pattern>[%t][%level][%d{HH:mm:ss.SSS}][%logger.%M{36}#%L] %msg%n</Pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" />
<SizeBasedTriggeringPolicy size="20MB" />
<DefaultRolloverStrategy max="20" />
</Policies>
</RollingFile>
<RollingFile name="rolling_file_linux"
filePattern="/logs/huixiabao/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
<PatternLayout>
<Pattern>[%t][%level][%d{HH:mm:ss.SSS}][%logger.%M{36}#%L] %msg%n</Pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" />
<SizeBasedTriggeringPolicy size="20MB" />
<DefaultRolloverStrategy max="20" />
</Policies>
</RollingFile>
</Appenders>
<Loggers>
<!-- <Logger name="mylog" level="info">
<AppenderRef ref="rolling_file" />
</Logger> -->
<Root level="debug">
<AppenderRef ref="rolling_file_linux" />
<AppenderRef ref="rolling_file_win" />
<AppenderRef ref="Console" />
</Root>
</Loggers>
</Configuration>

View File

@ -0,0 +1,140 @@
/*
* @Author: Kane
*
* @Date: 2025-03-11 09:27:40
*
* @LastEditors: Kane
*
* @FilePath: /cpicxim-XMNHSA-repeater/src/test/java/com/cpic/xim/huixiabao/AppTest.java
*
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.huixiabao;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.sql.*;
import java.util.Vector;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cpic.xim.huixiabao.data.pojo.HmbXyxInfo;
import com.cpic.xim.huixiabao.nhs.CpicximToXMNHS;
import cn.hsa.zephyr.apisdk.DefaultZephyrClient;
import cn.hsa.zephyr.apisdk.internal.exception.ZephyrApiException;
import cn.hsa.zephyr.apisdk.internal.util.encrypt.EncryptionModeEnum;
import cn.hsa.zephyr.apisdk.internal.util.encrypt.SignTypeEnum;
import cn.hsa.zephyr.apisdk.request.DefaultZephyrRequest;
import cn.hsa.zephyr.apisdk.response.DefaultZephyrResponse;
/**
* Unit test for simple App.
*/
public class AppTest
{
private Logger logger = LoggerFactory.getLogger( AppTest.class );
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
@Test
public void testLog()
{
for (
int i = 0;
i < 10000;
i++
)
{
// System.out.print("test!");
logger.error( "test!!!!" );
}
}
@Test
public void nhsTest()
{
String url = "172.18.1.150:9040";
String appId = "待定";
String appSecret = "待定";
String funId = "xxx";
String encKey = "A5B6E00DA599G56C41ABFE23A74E6E60";
String signKey = "待定";
SignTypeEnum signType = SignTypeEnum.SM3;
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
try
{
DefaultZephyrClient client = new DefaultZephyrClient( url,
funId,
appId,
appSecret,
signType,
signKey,
encType,
encKey );
DefaultZephyrRequest req = new DefaultZephyrRequest();
JSONObject jsonObject1 = new JSONObject();
DefaultZephyrResponse resp = null;
jsonObject1.put( "code", "XXXXXXXXXXXXXXXXXX" );
jsonObject1.put( "scene_code", "XXX" );
req.setData( jsonObject1 );
resp = client.execute( req );
System.out.println( resp.getData() );
}
catch ( ZephyrApiException e )
{
e.printStackTrace();
}
}
@Test
public void jsonTest()
{
JSONObject requestObject = new JSONObject();
JSONObject item = new JSONObject();
JSONArray hmbList = new JSONArray();
requestObject.put( "topic", "hmbXyxInfo" );
requestObject.put( "hmbList", hmbList );
item.put( "psnName", "王炜" );
item.put( "cerno", "350402198106130016" );
item.put( "serviceId", "100007" );
item.put( "status", "1" );
item.put( "xyxNo", "1234567" );
hmbList.add( item );
String json = requestObject.toJSONString();
System.out.println( json );
}
@Test
public void testMysql()
{
Vector<HmbXyxInfo> items = CpicximToXMNHS.getNeverTransHmbList();
System.out.println( items.toString() );
assert( items.size() > 0 );
}
}

117
code/nginx配置/nginx.conf Normal file
View File

@ -0,0 +1,117 @@
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}

34
code/sql/HmbXyxInfo.sql Normal file
View File

@ -0,0 +1,34 @@
/*
Navicat Premium Data Transfer
Source Server : mysql - 10.39.0.85
Source Server Type : MySQL
Source Server Version : 90200
Source Host : 10.39.0.85:3306
Source Schema : huixiabao
Target Server Type : MySQL
Target Server Version : 90200
File Encoding : 65001
Date: 12/03/2025 09:14:18
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for HmbXyxInfo
-- ----------------------------
DROP TABLE IF EXISTS `HmbXyxInfo`;
CREATE TABLE `HmbXyxInfo` (
`hmbListIndex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'hmbList的索引由timestamp和hmbList的hash值组成。',
`psnName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '姓名',
`certno` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '证件号',
`serviceId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '服务id',
`status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '订单状态',
`xyxNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键id',
PRIMARY KEY (`xyxNo`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'HmbXyxInfo的子表。\r\n保存hmbList集合的元素。' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;

24
code/sql/触发器.txt Normal file
View File

@ -0,0 +1,24 @@
drop TRIGGER xyxinfo_insert;
CREATE TRIGGER xyxinfo_insert after INSERT ON huixiabao.HmbXyxInfo FOR EACH ROW
BEGIN
delete from huixiabao.HmbXyxInfo_Update u where u.xyxNo = NEW.xyxNo;
INSERT INTO huixiabao.HmbXyxInfo_Update ( xyxNo, update_time )
VALUES
(
new.xyxNo,
SYSDATE());
END;
drop trigger xyxinfo_update;
create trigger xyxinfo_update after update on huixiabao.HmbXyxInfo FOR EACH ROW
BEGIN
delete from huixiabao.HmbXyxInfo_Update u where u.xyxNo = NEW.xyxNo;
INSERT INTO huixiabao.HmbXyxInfo_Update ( xyxNo, update_time )
VALUES
(
new.xyxNo,
SYSDATE());
END;

9
文档/request.json Normal file
View File

@ -0,0 +1,9 @@
{
"chs_fjs_appid": "",
"chs_fjs_appsecret": "",
"chs_fjs_token": "",
"chs_fjs_funid": "",
"chs_fjs_timestamp": "",
"chs_fjs_encdata": "",
"chs_fjs_sign": ""
}

33
文档/sm2_expl.json Normal file
View File

@ -0,0 +1,33 @@
{
"appId": "43AF047BBA47FC8A1AE8EFB232BDBBCB",
"data": {
"appId": "43AF047BBA47FC8A1AE8EFB232BDBBCB",
"appUserId": "o8z4C5avQXqC0aWFPf1Mzu6D7WCQ_bd",
"idNo": "350181199011193519",
"idType": "01",
"phoneNumber": "13763873033",
"userName": "测试"
},
"encType": "SM4",
"signData": "URVQNdVNn5mz2EhKZhLTlXNwAWTSncFoSe8Ilx7jhn81eABJ46sdRRN1ZiAiQjPUTixG9bwqEhiJupHRGmyO5w==",
"signType": "SM2",
"timestamp": "20200207175759",
"transType": "ec.gen.index",
"version": "1.0.0"
}
appId=43AF047BBA47FC8A1AE8EFB232BDBBCB&data=
{
"appId":"43AF047BBA47FC8A1AE8EFB232BDBBCB",
"appUserId":"o8z4C5avQXqC0aWFPf1Mzu6D7WCQ_bd",
"idNo":"350181199011193519",
"idType":"01",
"phoneNumber":"13763873033",
"userName":"测试"
}
&encType=SM4
&signType=SM2
&timestamp=20200207175759
&transType=ec.gen.index
&version=1.0.0
&key=4117E877F5FA0A0188891283E4B617D5

BIN
文档/地址.xlsx Normal file

Binary file not shown.

View File

@ -0,0 +1,23 @@
public static void main(String[] args) {
String url = "";
String appId = "待定";
String appSecret = "待定";
String funId = "xxx";
SignTypeEnum signType = SignTypeEnum.SM3;
String signKey = "待定";
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
String encKey = "A5B6E00DA599G56C41ABFE23A74E6E60";
try {
DefaultZephyrClient client = new DefaultZephyrClient(url, funId, appId, appSecret,
signType, signKey, encType, encKey);
DefaultZephyrRequest req = new DefaultZephyrRequest();
JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("code", "XXXXXXXXXXXXXXXXXX");
jsonObject1.put("scene_code", "XXX");
req.setData(jsonObject1);
DefaultZephyrResponse resp = client.execute(req);
System.out.println(resp.getData());
} catch (ZephyrApiException e) {
e.printStackTrace();
}
}

View File

@ -0,0 +1,6 @@
appid:hxb-tb
appSecret:60F468FB46170DD4CF6CBECE215DBFC0
signKey:1A2F447BD0F930798D8031B137EC6E25
encKey:08307695B1668EB9FD6210250FED874F

Binary file not shown.

Binary file not shown.