加入post代码。

This commit is contained in:
2025-03-12 01:09:23 +08:00
parent a823e3f963
commit 95047193eb
11 changed files with 162 additions and 53 deletions

View File

@@ -1,11 +1,15 @@
/*
* @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.
* @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;
@@ -17,9 +21,9 @@ public class AppMain
{
public static void main( String[] args )
{
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
SignTypeEnum signType = SignTypeEnum.SM3;
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
SignTypeEnum signType = SignTypeEnum.SM3;
System.out.println( "Hello World!" );
}
}

View File

@@ -1,11 +1,15 @@
/*
* @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.
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.huixiabao.data.config;
@@ -43,9 +47,10 @@ public class HuixiabaoConfig
}
private static final int MAX_COUNT_PER_REQUEST = 500;
private static final String url = "https://172.18.1.150:9040";
private static final String appid = "hxb-tb";
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";
private static final String signKey = "1A2F447BD0F930798D8031B137EC6E25";
private static final String encKey = "08307695B1668EB9FD6210250FED874F";
}

View File

@@ -1,11 +1,15 @@
/*
* @Author: Kane
* @Date: 2025-03-11 11:10:09
* @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.
* @Date: 2025-03-11 11:10:09
*
* @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;
@@ -29,6 +33,7 @@ public class CpicximToXMNHS
/**
* 从数据库中获取未发送过的小药箱数据。
*
* @return
*/
public Vector<HmbXyxInfo> getNeverTransHmbList()
@@ -41,26 +46,32 @@ public class CpicximToXMNHS
public void postHmbList( Vector<HmbXyxInfo> items )
{
String url = HuixiabaoConfig.getUrl();
String appId = HuixiabaoConfig.getAppid();
String url = HuixiabaoConfig.getUrl();
String appId = HuixiabaoConfig.getAppid();
String appSecret = HuixiabaoConfig.getAppSecret();
String funId = "xxx";
String encKey = HuixiabaoConfig.getEncKey();
String signKey = HuixiabaoConfig.getSignKey();
String funId = "xxx";
String encKey = HuixiabaoConfig.getEncKey();
String signKey = HuixiabaoConfig.getSignKey();
SignTypeEnum signType = SignTypeEnum.SM3;
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
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;
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 = new JSONObject();
JSONArray xyxInfoList = new JSONArray();
JSONObject xyxInfo = new JSONObject();
JSONArray xyxInfoList = new JSONArray();
requestObject.put( "topic", "hmbXyxInfo" );
requestObject.put( "hmbList", xyxInfoList );

View File

@@ -1,11 +1,15 @@
/*
* @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.
* @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;
@@ -42,7 +46,9 @@ public class AppTest
@Test
public void testLog()
{
for ( int i = 0; i < 10000; i++ )
for (
int i = 0; i < 10000; i++
)
{
// System.out.print("test!");
logger.error( "test!!!!" );
@@ -52,23 +58,30 @@ public class AppTest
@Test
public void nhsTest()
{
String url = "172.18.1.150:9040";
String appId = "待定";
String url = "172.18.1.150:9040";
String appId = "待定";
String appSecret = "待定";
String funId = "xxx";
String encKey = "A5B6E00DA599G56C41ABFE23A74E6E60";
String signKey = "待定";
String funId = "xxx";
String encKey = "A5B6E00DA599G56C41ABFE23A74E6E60";
String signKey = "待定";
SignTypeEnum signType = SignTypeEnum.SM3;
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
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;
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" );
@@ -88,18 +101,18 @@ public class AppTest
public void jsonTest()
{
JSONObject requestObject = new JSONObject();
JSONObject item = new JSONObject();
JSONArray hmbList = new JSONArray();
JSONObject item = new JSONObject();
JSONArray hmbList = new JSONArray();
requestObject.put( "topic", "hmbXyxInfo" );
requestObject.put("hmbList", hmbList );
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();