提交代码

yy_dev
胡锐 1 year ago
parent bfc682837d
commit 0c47196664
  1. 59
      open-api/src/main/java/com/api/controller/v1/BsTradeController.java
  2. 45
      open-api/src/main/resources/dev/application.yml
  3. 13
      open-api/src/main/resources/dev/config.properties
  4. 43
      open-api/src/main/resources/dev/logback.xml
  5. 4
      open-api/src/main/resources/pre/application.yml
  6. 7
      open-api/src/main/resources/pre/config.properties
  7. 48
      open-api/src/main/resources/prod/application.yml
  8. 13
      open-api/src/main/resources/prod/config.properties
  9. 42
      open-api/src/main/resources/prod/logback.xml
  10. 16
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaLedgerService.java
  11. 15
      service/src/main/java/com/hfkj/openapi/v1/model/TradePreorderModel.java
  12. 31
      service/src/main/java/com/hfkj/openapi/v1/utils/MD5Util.java
  13. 9
      service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java

@ -0,0 +1,59 @@
package com.api.controller.v1;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.hsg.UserDiscountService;
import com.hfkj.entity.*;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserDiscount;
import com.hfkj.model.UserInfoModel;
import com.hfkj.openapi.v1.model.TradePreorderModel;
import com.hfkj.service.*;
import com.hfkj.sysenum.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
@Controller
@Api(value = "交易订单")
@RequestMapping(value = "/v1/trade")
public class BsTradeController {
private static Logger log = LoggerFactory.getLogger(BsTradeController.class);
@RequestMapping(value="/preorder",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "聚合主扫")
public ResponseData preorder(@RequestBody TradePreorderModel body, HttpServletRequest request) {
try {
if (body == null) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 创建交易订单
return ResponseMsgUtil.success(null);
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -1,5 +1,5 @@
server:
port: 9504
port: 9605
servlet:
context-path: /openApi
@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.9.154.68:3306/xuan_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.9.154.68:3306/gratia_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
@ -28,7 +28,7 @@ spring:
poolPreparedStatements: true
maxOpenPreparedStatements: 20
redis:
database: 4
database: 6
host: 139.9.154.68
port: 36379
password: HF123456.Redis
@ -43,9 +43,46 @@ spring:
jackson:
serialization:
write-dates-as-timestamps: true
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.9.154.68:8083/mqtt
#用户名
username: printer_provider
#密码
password: 123654
#客户端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: 139.9.154.68
port: 36379
password: HF123456.Redis
database: 6
keyConvertor: fastjson
broadcastChannel: projectA
valueEncoder: java
valueDecoder: java
poolConfig:
minIdle: 5
maxIdle: 20
maxTotal: 50
mybatis:
mapperLocations:
- classpath*:sqlmap*/*.xml
- classpath*:sqlmap*/*.xml
type-aliases-package:
org.springboot.sample.entity

@ -1,2 +1,11 @@
fileUrl=/home/project/hsg/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath
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

@ -69,4 +69,47 @@
<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>
</configuration>

@ -1,5 +1,5 @@
server:
port: 9554
port: 9605
servlet:
context-path: /openApi
@ -45,7 +45,7 @@ spring:
write-dates-as-timestamps: true
mybatis:
mapperLocations:
- classpath*:sqlmap*/*.xml
- classpath*:sqlmap*/*.xml
type-aliases-package:
org.springboot.sample.entity

@ -1,2 +1,5 @@
fileUrl=/home/project/hsg/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath
fileUrl=/home/project/xuan-pay/filesystem
cmsPath=/home/project/xuan-pay/filesystem/cmsPath
wxAppId=wxa075e8509802f826
wxAppSecret=0e606fc1378d35e359fcf3f15570b2c5

@ -1,5 +1,5 @@
server:
port: 9504
port: 9605
servlet:
context-path: /openApi
@ -9,9 +9,9 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/xuan_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: root
password: HF123456.
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
@ -27,6 +27,7 @@ spring:
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
redis:
database: 2
host: 127.0.0.1
@ -43,10 +44,47 @@ spring:
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
- classpath*:sqlmap*/*.xml
type-aliases-package:
org.springboot.sample.entity

@ -1,2 +1,11 @@
fileUrl=/home/project/hsg/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath
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

@ -69,4 +69,46 @@
<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>
</configuration>

@ -71,7 +71,7 @@ public class LaKaLaLedgerService {
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", orderNo);
map.put("orgCode", "1");
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code());
map.put("merCupNo", merLedger.getCupNo());
map.put("contactMobile", merDetail.getRegPhone());
map.put("splitLowestRatio", merLedger.getSplitLowestRatio());
@ -132,7 +132,7 @@ public class LaKaLaLedgerService {
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", orderNo);
map.put("orgCode", "1");
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code());
map.put("receiverNo", merLedger.getReceiverNo());
map.put("merCupNo", merLedger.getCupNo());
map.put("contactMobile", merDetail.getRegPhone());
@ -197,7 +197,7 @@ public class LaKaLaLedgerService {
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", orderNo);
map.put("orgCode", "1");
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code());
map.put("merCupNo", merLedger.getCupNo());
map.put("contactMobile", merDetail.getRegPhone());
map.put("splitLowestRatio", merLedger.getSplitLowestRatio());
@ -253,7 +253,7 @@ public class LaKaLaLedgerService {
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", orderNo);
map.put("orgCode", "1");
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code());
map.put("merCupNo", merCupNo);
commonParam.put("reqData", map);
@ -290,7 +290,7 @@ public class LaKaLaLedgerService {
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", System.currentTimeMillis()+"");
map.put("orgCode", "1");
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code());
map.put("receiverName", merDetail.getMerName());
map.put("contactMobile", merDetail.getRegPhone());
map.put("acctTypeCode", merDetail.getMerSettleAcct().getSettleType().equals(MerSettleType.status1.getNumber())?57:58);// 57:对公 58:对私
@ -370,7 +370,7 @@ public class LaKaLaLedgerService {
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", System.currentTimeMillis()+"");
map.put("orgCode", "1");
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code());
map.put("receiverNo", "1");
map.put("receiverName", merDetail.getMerName());
map.put("contactMobile", merDetail.getRegPhone());
@ -439,7 +439,7 @@ public class LaKaLaLedgerService {
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", System.currentTimeMillis()+"");
map.put("orgCode", "1");
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code());
map.put("merCupNo", merLedgerReceiver.getCupNo());
map.put("receiverNo", merLedgerReceiver.getReceiverNo());
@ -495,7 +495,7 @@ public class LaKaLaLedgerService {
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", System.currentTimeMillis()+"");
map.put("orgCode", "1");
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code());
map.put("merCupNo", merLedgerReceiver.getCupNo());
map.put("receiverNo", merLedgerReceiver.getReceiverNo());
String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + merLedgerReceiver.getRelieveEntrustFilePath());

@ -0,0 +1,15 @@
package com.hfkj.openapi.v1.model;
import lombok.Data;
/**
* 交易聚合主扫模型
* @className: TradePreorderModel
* @author: HuRui
* @date: 2023/5/23
**/
@Data
public class TradePreorderModel {
}

@ -0,0 +1,31 @@
package com.hfkj.openapi.v1.utils;
import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
import java.security.MessageDigest;
/**
* MD5 加密
*/
public class MD5Util {
/**
* 加密
* @param data
* @return
* @throws Exception
*/
public static String encode(byte[] data) throws Exception {
// 初始化MessageDigest
MessageDigest md = MessageDigest.getInstance("MD5");
// 执行摘要信息
byte[] digest = md.digest(data);
// 将摘要信息转换为32位的十六进制字符串
return new String(new HexBinaryAdapter().marshal(digest));
}
public static void main(String[] args) throws Exception {
String str = "123456";
System.out.println(MD5Util.encode(str.getBytes("UTF-8")));
//String ee = "29AD0E3FD3DB681FB9F8091C756313F7";
}
}

@ -2,28 +2,19 @@ package com.hfkj.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.lakala.config.LaKaLaConfig;
import com.hfkj.channel.saas.SaasMerService;
import com.hfkj.channel.saas.utils.SaasCommon;
import com.hfkj.channel.weixin.WeiXinMerService;
import com.hfkj.channel.weixin.utils.WeiXinUploadUtil;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.channel.weixin.utils.MD5Util;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.IDGenerator;
import com.hfkj.common.utils.ImageUtils;
import com.hfkj.config.CommonSysConst;
import com.hfkj.dao.BsMerMapper;
import com.hfkj.entity.*;
import com.hfkj.model.MerAccountModel;
import com.hfkj.model.MerBasisModel;
import com.hfkj.model.StoreModel;
import com.hfkj.obs.HuaWeiYunObs;
import com.hfkj.service.*;
import com.hfkj.sysenum.*;
import com.hfkj.sysenum.lakala.UploadFileTypeEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;

Loading…
Cancel
Save