提交代码

yy_dev
胡锐 1 year ago
parent 705444a764
commit 7c2a771eb1
  1. 8
      open-api/src/main/java/com/api/controller/v1/MerController.java
  2. 95
      open-api/src/main/resources/prod-9606/application.yml
  3. 11
      open-api/src/main/resources/prod-9606/config.properties
  4. 178
      open-api/src/main/resources/prod-9606/logback.xml
  5. 9
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaConfigService.java
  6. 12
      service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java
  7. 40
      service/src/main/resources/prod-9606/commonConfig.properties

@ -34,13 +34,14 @@ public class MerController {
@ResponseBody @ResponseBody
@ApiOperation(value = "wechatParamConf") @ApiOperation(value = "wechatParamConf")
public ResponseData wechatParamConf(@RequestParam(value = "merCupNo" , required = true) String merCupNo, public ResponseData wechatParamConf(@RequestParam(value = "merCupNo" , required = true) String merCupNo,
@RequestParam(value = "channlId" , required = true) String channlId,
@RequestParam(value = "subMchId" , required = true) String subMchId, @RequestParam(value = "subMchId" , required = true) String subMchId,
@RequestParam(value = "subAppid" , required = false) String subAppid, @RequestParam(value = "subAppid" , required = false) String subAppid,
@RequestParam(value = "jsapiPath" , required = false) String jsapiPath, @RequestParam(value = "jsapiPath" , required = false) String jsapiPath,
@RequestParam(value = "confType" , required = true) String confType) { @RequestParam(value = "confType" , required = true) String confType) {
try { try {
// return ResponseMsgUtil.success(laKaLaConfigService.wechatParamConf("822690053111ERC", "569999133","wxf30043187dc90829", "http://api2.ctpark.cn/")); // return ResponseMsgUtil.success(laKaLaConfigService.wechatParamConf("822690053111ERC", "569999133","wxf30043187dc90829", "http://api2.ctpark.cn/"));
return ResponseMsgUtil.success(laKaLaConfigService.wechatParamConf(merCupNo, subMchId,subAppid, jsapiPath,confType)); return ResponseMsgUtil.success(laKaLaConfigService.wechatParamConf(merCupNo, channlId, subMchId,subAppid, jsapiPath,confType));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
@ -51,10 +52,11 @@ public class MerController {
@RequestMapping(value="/querySubMerInfo",method = RequestMethod.GET) @RequestMapping(value="/querySubMerInfo",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "querySubMerInfo") @ApiOperation(value = "querySubMerInfo")
public ResponseData querySubMerInfo(@RequestParam(value = "merCupNo" , required = true) String merCupNo) { public ResponseData querySubMerInfo(@RequestParam(value = "channlId" , required = true) String channlId,
@RequestParam(value = "merCupNo" , required = true) String merCupNo) {
try { try {
return ResponseMsgUtil.success(laKaLaConfigService.querySubMerInfo(merCupNo)); return ResponseMsgUtil.success(laKaLaConfigService.querySubMerInfo(channlId,merCupNo));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);

@ -0,0 +1,95 @@
server:
port: 9606
servlet:
context-path: /openApi
#配置是否为debug模式,debug模式下,不开启权限校验
debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://192.168.0.63:21100/gratia_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: gratia_pay
password: HUfukeji123456!@#
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat
maxActive: 10
initialSize: 5
maxWait: 60000
minIdle: 5
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
redis:
database: 2
host: 127.0.0.1
port: 36379
password: HF123456.Redis
timeout: 1000
jedis:
pool:
max-active: 20
max-wait: -1
max-idle: 10
min-idle: 0
#配置日期返回至前台为时间戳
jackson:
serialization:
write-dates-as-timestamps: true
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://140.210.192.36:8083/mqtt
#用户名
username: printer_provider
#密码
password: abcd123!
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
jetcache:
statIntervalMinutes: 15
areaInCacheName: false
local:
default:
type: linkedhashmap
keyConvertor: fastjson
remote:
default:
type: redis
host: 127.0.0.1
port: 36379
password: HF123456.Redis
database: 2
keyConvertor: fastjson
broadcastChannel: projectA
valueEncoder: java
valueDecoder: java
poolConfig:
minIdle: 5
maxIdle: 20
maxTotal: 50
mybatis:
mapperLocations:
- classpath*:sqlmap*/*.xml
type-aliases-package:
org.springboot.sample.entity
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql

@ -0,0 +1,11 @@
fileUrl=/home/project/gratia-pay/filesystem
cmsPath=/home/project/gratia-pay/filesystem/cmsPath
wxAppId=wxa075e8509802f826
wxAppSecret=0e606fc1378d35e359fcf3f15570b2c5
// WeChat service provider
wxUnifiedOrderUrl=https://api.mch.weixin.qq.com/pay/unifiedorder
wxMchAppId=wx637bd6f7314daa46
wxApiKey=Skufk5oi85wDFGl888i6wsRSTkdd5df5
wxMchId=1289663601

@ -0,0 +1,178 @@
<configuration>
<!-- %m输出的信息,%p日志级别,%t线程名,%d日期,%c类的全名,,,, -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %p (%file:%line\)- %m%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<appender name="baselog"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/base.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/base.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<appender name="daolog"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/dao.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/dao.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<appender name="errorlog"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/error.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/error.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
<logger name="com.hfkj" level="DEBUG">
<appender-ref ref="baselog" />
</logger>
<logger name="com.hfkj.dao" level="DEBUG">
<appender-ref ref="daolog" />
</logger>
<logger name="com.hfkj" level="ERROR">
<appender-ref ref="errorlog" />
</logger>
<appender name="alipaylog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/alipay/alipaylog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/alipay.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<logger name="com.hfkj.channel.alipay" level="INFO">
<appender-ref ref="alipaylog" />
</logger>
<appender name="hsglog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/hsg.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/hsg/hsg.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<logger name="com.hfkj.channel.hsg" level="INFO">
<appender-ref ref="hsglog" />
</logger>
<appender name="requestV1log" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/requestV1.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/requestV1/requestV1.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<logger name="com.api.controller.v1" level="INFO">
<appender-ref ref="requestV1log" />
</logger>
<appender name="laklalog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/laklalog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/laklalog/laklalog.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<logger name="com.hfkj.channel.lakala" level="INFO">
<appender-ref ref="laklalog" />
</logger>
<appender name="lklTradeNotify" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/lklTradeNotify.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/lklTradeNotify/lklTradeNotify.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<logger name="com.api.controller.v1.NotifyController" level="INFO">
<appender-ref ref="lklTradeNotify" />
</logger>
</configuration>

@ -29,7 +29,7 @@ public class LaKaLaConfigService {
* @param confType 配置类型 配置类型 类型=SUB_APPID时subAppid必传, 类型=SUBSCRIBE_APPID时subscribeAppid必传 ,类型=UNION时subAppid和subscribeAppid必传 类型=JSAPI_PATH时jsapiPath必传 * @param confType 配置类型 配置类型 类型=SUB_APPID时subAppid必传, 类型=SUBSCRIBE_APPID时subscribeAppid必传 ,类型=UNION时subAppid和subscribeAppid必传 类型=JSAPI_PATH时jsapiPath必传
* @return * @return
*/ */
public JSONObject wechatParamConf(String merCupNo,String subMchId,String subAppid,String jsapiPath,String confType) { public JSONObject wechatParamConf(String merCupNo,String channlId,String subMchId,String subAppid,String jsapiPath,String confType) {
// 请求参数 // 请求参数
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("timestamp", new Date().getTime()); param.put("timestamp", new Date().getTime());
@ -39,8 +39,7 @@ public class LaKaLaConfigService {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("merCupNo", merCupNo); map.put("merCupNo", merCupNo);
// map.put("channlId", "24006513"); // 微信渠道号 (仅支持拉卡拉渠道配置) map.put("channlId", channlId); // 微信渠道号 (仅支持拉卡拉渠道配置)
map.put("channlId", "167048649"); // 微信渠道号 (仅支持拉卡拉渠道配置)
map.put("subMchId", subMchId); map.put("subMchId", subMchId);
map.put("subAppid", subAppid); map.put("subAppid", subAppid);
map.put("jsapiPath", jsapiPath); map.put("jsapiPath", jsapiPath);
@ -70,7 +69,7 @@ public class LaKaLaConfigService {
* @param merCupNo * @param merCupNo
* @return * @return
*/ */
public JSONObject querySubMerInfo(String merCupNo) { public JSONObject querySubMerInfo(String channlId,String merCupNo) {
// 请求参数 // 请求参数
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("timestamp", new Date().getTime()); param.put("timestamp", new Date().getTime());
@ -81,7 +80,7 @@ public class LaKaLaConfigService {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("version", "1.0"); map.put("version", "1.0");
map.put("orderNo", new Date().getTime()); map.put("orderNo", new Date().getTime());
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code()); map.put("orgCode", channlId);
map.put("merCupNo", merCupNo); map.put("merCupNo", merCupNo);
map.put("registerStatus", "SUCCESS"); map.put("registerStatus", "SUCCESS");
param.put("reqData", map); param.put("reqData", map);

@ -82,10 +82,16 @@ public class SignatureUtil {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String paramStr = "{\n" + String paramStr = "{\n" +
" \"merchantNo\": \"2023030909414450700\",\n" + " \"merchantNo\": \"2023053014484290706\",\n" +
" \"outSeparateNo\": \"1530202304261720503943170005\"" + " \"outTradeNo\": \"ZF1130202305051459532538971005\",\n" +
" \"payMode\": \"WECHAT\",\n" +
" \"totalAmount\": 0.01,\n" +
" \"transType\": \"JSAPI\",\n" +
" \"subAppid\":\"wxc1d482cb439d570d\",\n" +
" \"userId\": \"o4Jwb42CBpXgAZJaF985MViTBIaI\",\n" +
" \"profitSharing\": 0\n" +
"}"; "}";
String sign = createSign(JSONObject.parseObject(paramStr), "LRL9uflTQGeyp9yVWDD6orhBp2VhYDvP"); String sign = createSign(JSONObject.parseObject(paramStr), "2sKRbwGqRoejsqn9HFJL9p5T0GqDOONp");
System.out.println(sign); System.out.println(sign);
} }
} }

@ -0,0 +1,40 @@
obs_bucket_name=gratia-pay
obs_end_point=https://obs.cn-southwest-2.myhuaweicloud.com
obs_url=https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com
qr_code_data_url=https://pay.dctpay.com/scanPay
qr_code_url=https://pay.dctpay.com/filesystem/payQrCode/
lkl_request_url=https://s2.lakala.com
lkl_org_code=965644
lkl_v3_appid=OP00000622
lkl_v3_serial_no=01752b7386f8
lkl_v3_private_key=/home/project/gratia-pay/cert/lakala/v3/prod_private.text
lkl_v2_appid=OP00000622
lkl_v2_serial_no=01752b7386f8
lkl_v2_private_key=/home/project/gratia-pay/cert/lakala/v2/prod_private.text
lkl_mer_contract_ret_url=https://pay.dctpay.com/brest/laKaLaNotify/merContract
lkl_micro_pay_ret_url=https://pay.dctpay.com/crest/laKaLaNotify/microPay
lkl_open_api_pay_notify_url=https://pay.dctpay.com/openApi/v1/payNotify/lakala
lkl_saas_client_id=huifu
lkl_saas_client_secret=f65VVjqJfLtc177F
lkl_saas_activity_id=12
lkl_saas_user_no=22206482
lkl_saas_request_url=https://tkapi.lakala.com/
lkl_saas_request_mer_registration_token_url=https://tkapi.lakala.com/auth/oauth/token
lkl_saas_request_mer_registration_url=https://htkactvi.lakala.com/registration/merchant/
lkl_saas_request_mer_update_url=https://htkapi.lakala.com/api/
lkl_saas_request_mer_registration_common_url=https://htkactvi.lakala.com/registration/
lkl_saas_request_mer_url=https://tkapi.lakala.com/htkmerchants/
lkl_saas_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDAUkzRA+4GOS5OzYqxD/UJwM6p9to1dPvetL/7RbMa93o46qToPlPtaW61EvblOldHcBEHo7AGXXKmIYr7t2Up1PZC0g7UMpno/b5WkT6ieJ601Xreuj8hhyf2/xoej5vpi4/+lAr9YF+5GcyaVf4gfzTNJrmKj9PfvX5B3rUH2QIDAQAB
lkl_saas_private_key=MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMBSTNED7gY5Lk7NirEP9QnAzqn22jV0+960v/tFsxr3ejjqpOg+U+1pbrUS9uU6V0dwEQejsAZdcqYhivu3ZSnU9kLSDtQymej9vlaRPqJ4nrTVet66PyGHJ/b/Gh6Pm+mLj/6UCv1gX7kZzJpV/iB/NM0muYqP09+9fkHetQfZAgMBAAECgYB42D3kaC+8QVnTsluffoNeKYSyT6Y1SNiqy7CGVvl/zFlEQkx0khVybHlf1hbFWq9U+Bn7TuNgXH+Z3CHUoRwy4Ap/kMx637iRatoC8F/kcPaiB7JFQfdrxhgK858dSyHCQ2OXXQDJgJdth+oF9FylVsrDu5Sw3ha4OuzrmufuwQJBAPnPPSeFr1wu7kH6I+A5E49fMbAm7EU+3TYVzxNH1lr3X/LWuK9pi/LVPrSR4eNgAypyQWREIqdpBIiJ9bOnwa0CQQDFFl0zTQTVTWf5r/hwgCUMo4gHr2y/q7XMNe6n5fh4SQuQ+o4gW+BGHzDrT97G5hFGPL+w5niGuEBHWSo5/9xdAkEAnrxdM7vzDjSUGUCFg3lBQJ1QyYoyIF4t2qxJBQtk3jDKu1hNysjasNdoHP2F+CGOYW5wtvHEw3Qr+UcQ5bP3kQJABPAcga6KUnXQBxd7mAX956UpQVgJ13uL4IPxaM+APDNIUOeWLAVhRyB870hfAoi9Ig9fliUQG//9zEvVnQJmGQJBAOb8Z0mGMEbEeAyEKjqoNiQkkIcoBdmPKNFUoUJ6ohcBNOoMfklvNsf2+BPfuhs26tvhYDBRgCAfOVhqTQcGj6I=
wechat_pay_notify_url=https://pay.dctpay.com/crest/weiXinNotify/jsapiPay
file_url=/home/project/gratia-pay/file
filesystem=/home/project/gratia-pay/filesystem
domainName=https://pay.dctpay.com
hsg_domain_name=https://hsg.dctpay.com/
Loading…
Cancel
Save