更新配置

This commit is contained in:
萧道子 2025-06-19 10:04:55 +08:00
parent 5071814758
commit 5e3c75d227
7 changed files with 66 additions and 97 deletions

12
pom.xml
View File

@ -170,10 +170,10 @@
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/**</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
@ -278,14 +278,20 @@
<profiles>
<profile>
<id>dev</id>
<activation>
<!--默认激活配置-->
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!--测试环境-->
<profile.name>dev</profile.name>
</properties>
</profile>
<profile>
<id>pro</id>
<properties>
<!--正式环境-->
<profile.name>pro</profile.name>
</properties>
</profile>
</profiles>

View File

@ -1,20 +1,8 @@
package com.dpkj.modules.chs.controller;
import cn.hutool.core.lang.Console;
import com.alibaba.fastjson.JSONObject;
import com.dpkj.common.config.ChsConfig;
import com.dpkj.common.constant.ChsConst;
import com.dpkj.common.vo.Result;
import com.dpkj.modules.chs.dll.AlipayDll;
import com.dpkj.modules.chs.entity.AlipayEcRequestData;
import com.dpkj.modules.chs.service.IAlipayService;
import com.sun.jna.Memory;
import com.sun.jna.Pointer;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
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.RestController;
@ -28,54 +16,6 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/chs/alipay")
public class AlipayController {
private final IAlipayService alipayService;
private final ChsConfig charsConfig;
@GetMapping("test")
public Result<?> test() {
try {
AlipayDll.Dll dll = AlipayDll.instance();
// Native.load("libeay32", AlipayDll.Dll.class);
// Native.load("ssleay32", AlipayDll.Dll.class);
JSONObject data = new JSONObject();
AlipayEcRequestData alipayEcRequestData = new AlipayEcRequestData()
.setOrgId(charsConfig.getOrgcode())
.setTransType(ChsConst.APITYPE_DECODE)
.setData(data);
String dataJson = JSONObject.toJSONString(alipayEcRequestData);
Pointer resultStr = new Memory(1024 * 10);
String rs = dll.NationEcTrans(
"http://172.16.11.13:5946/api/chs/qrCodeQuery",
dataJson,
resultStr
);
String rsStrString = resultStr.getString(0, "GB18030");
Console.log(rsStrString);
Console.log(rs);
return Result.ok("成功", rsStrString);
} catch (Exception e) {
e.printStackTrace();
return Result.error("失败");
}
}
@PostMapping("qrCodeQuery")
public Result<?> qrCodeQuery(@RequestBody JSONObject data) {
try {
Console.log(data);
return Result.ok("成功", null);
} catch (Exception e) {
e.printStackTrace();
return Result.error("失败");
}
}
}

View File

@ -1,6 +1,5 @@
package com.dpkj.modules.chs.service.impl;
import cn.hutool.core.lang.Console;
import com.dpkj.modules.chs.dll.AlipayDll;
import com.dpkj.modules.chs.service.IAlipayService;
import lombok.extern.slf4j.Slf4j;
@ -17,22 +16,22 @@ import javax.annotation.PostConstruct;
@Service
public class AlipayServiceImpl implements IAlipayService {
private AlipayDll.Dll dll = AlipayDll.instance();
private AlipayDll.Dll dll;
public AlipayServiceImpl() throws AlipayDll.DllRegistrationException {
}
@PostConstruct
public void postConstruct() {
log.info("[AlipayServiceImpl][postConstruct][医保DLL] 初始化动态链接库");
try {
dll = AlipayDll.instance();
} catch (AlipayDll.DllRegistrationException e) {
// TODO 萧道子 2025/6/19 :
}
initPrinter();
}
private void initPrinter() {
Console.log(dll);
}
}

View File

@ -1,5 +1,29 @@
server:
port: 5948
servlet:
context-path: /api
tomcat:
max-swallow-size: -1
error:
include-exception: true
include-stacktrace: ALWAYS
include-message: ALWAYS
compression:
enabled: true
min-response-size: 1024
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
logging:
level:
com.dpkj: debug
spring:
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
resource:
static-locations: classpath:/static/,classpath:/public/
dpkj:
#后端项目访问地址 #https://yinyitong.yzqingyan.cn/ http://172.16.11.13:15946/ ttps://yinyitong.yzqingyan.cn

View File

@ -1,5 +1,29 @@
server:
port: 5946
servlet:
context-path: /api
tomcat:
max-swallow-size: -1
error:
include-exception: true
include-stacktrace: ALWAYS
include-message: ALWAYS
compression:
enabled: true
min-response-size: 1024
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
logging:
level:
com.dpkj: debug
spring:
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
resource:
static-locations: classpath:/static/,classpath:/public/
dpkj:
#后端项目访问地址

View File

@ -1,29 +1,5 @@
server:
servlet:
context-path: /api
tomcat:
max-swallow-size: -1
error:
include-exception: true
include-stacktrace: ALWAYS
include-message: ALWAYS
compression:
enabled: true
min-response-size: 1024
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
logging:
level:
com.dpkj: debug
spring:
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
resource:
static-locations: classpath:/static/,classpath:/public/
application:
name: ems-express-bridge
name: yinyitong-zhongyuyuan-dll-stand
profiles:
active: pro
active: '@profile.name@'