* '2.0-dev' of http://139.159.177.244:3000/hurui/hai-server:
  提交代码
  提交代码
dev-discount
袁野 2 years ago
commit 27a49b5b1a
  1. 100
      hai-bweb/src/main/java/com/bweb/config/msg/MerStoreAccountChgHandler.java
  2. 22
      hai-bweb/src/main/resources/prod/logback.xml
  3. 22
      hai-order/src/main/resources/dev/logback.xml
  4. 22
      hai-order/src/main/resources/prod/logback.xml
  5. 9
      hai-service/src/main/java/com/hai/config/WxOrderConfig.java

@ -33,55 +33,55 @@ public class MerStoreAccountChgHandler {
@PostConstruct @PostConstruct
public void init() { public void init() {
// new Thread(() -> { new Thread(() -> {
// { {
// //消息处理 //消息处理
// while (true){ while (true){
// try { try {
// //构建的队列为左进右出 //构建的队列为左进右出
// Object o = redisTemplate.opsForList().rightPop(MsgTopic.MerStoreAccount.getName()); Object o = redisTemplate.opsForList().rightPop(MsgTopic.MerStoreAccount.getName());
// if (o != null) { if (o != null) {
// //处理消息 //处理消息
// logger.info("消息通道:"+o); logger.info("消息通道:"+o);
//
// Map<String, Object> param = (Map<String, Object>) o; Map<String, Object> param = (Map<String, Object>) o;
//
// if (MapUtils.getInteger(param, "businessType").equals(MerStoreAmountTypeEnum.type1.getType())) { if (MapUtils.getInteger(param, "businessType").equals(MerStoreAmountTypeEnum.type1.getType())) {
// Map<String, Object> otherParam = new HashMap<>(); Map<String, Object> otherParam = new HashMap<>();
// otherParam.put("sourceType", MapUtils.getString(param, "sourceType")); otherParam.put("sourceType", MapUtils.getString(param, "sourceType"));
// otherParam.put("sourceId", MapUtils.getString(param, "sourceId")); otherParam.put("sourceId", MapUtils.getString(param, "sourceId"));
// otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent")); otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent"));
// otherParam.put("opUserId", MapUtils.getLong(param, "opUserId")); otherParam.put("opUserId", MapUtils.getLong(param, "opUserId"));
// otherParam.put("opUserName", MapUtils.getString(param, "opUserName")); otherParam.put("opUserName", MapUtils.getString(param, "opUserName"));
//
// merchantStoreAccountService.recharge( merchantStoreAccountService.recharge(
// MapUtils.getLong(param, "storeId"), MapUtils.getLong(param, "storeId"),
// new BigDecimal(MapUtils.getString(param, "price")), new BigDecimal(MapUtils.getString(param, "price")),
// otherParam); otherParam);
// } }
//
// if (MapUtils.getInteger(param, "businessType").equals(MerStoreAmountTypeEnum.type2.getType())) { if (MapUtils.getInteger(param, "businessType").equals(MerStoreAmountTypeEnum.type2.getType())) {
// Map<String, Object> otherParam = new HashMap<>(); Map<String, Object> otherParam = new HashMap<>();
// otherParam.put("sourceType", MapUtils.getString(param, "sourceType")); otherParam.put("sourceType", MapUtils.getString(param, "sourceType"));
// otherParam.put("sourceId", MapUtils.getString(param, "sourceId")); otherParam.put("sourceId", MapUtils.getString(param, "sourceId"));
// otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent")); otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent"));
// otherParam.put("opUserId", MapUtils.getLong(param, "opUserId")); otherParam.put("opUserId", MapUtils.getLong(param, "opUserId"));
// otherParam.put("opUserName", MapUtils.getString(param, "opUserName")); otherParam.put("opUserName", MapUtils.getString(param, "opUserName"));
//
// merchantStoreAccountService.consume( merchantStoreAccountService.consume(
// MapUtils.getLong(param, "storeId"), MapUtils.getLong(param, "storeId"),
// new BigDecimal(MapUtils.getString(param, "price")), new BigDecimal(MapUtils.getString(param, "price")),
// otherParam); otherParam);
// } }
//
// } else { } else {
// Thread.sleep(1000); Thread.sleep(1000);
// } }
// }catch (Exception e){ }catch (Exception e){
// logger.error("监听订单状态变更错误",e); logger.error("监听订单状态变更错误",e);
// } }
// } }
// } }
// }).start(); }).start();
} }
} }

@ -57,6 +57,24 @@
<charset>UTF-8</charset> <!-- 此处设置字符集 --> <charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder> </encoder>
</appender> </appender>
<appender name="wechatPayLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/wechatPay.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/wechatPayLog/wechatPayLog.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"> <root level="DEBUG">
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT" />
</root> </root>
@ -69,4 +87,8 @@
<logger name="com.hai" level="ERROR"> <logger name="com.hai" level="ERROR">
<appender-ref ref="errorlog" /> <appender-ref ref="errorlog" />
</logger> </logger>
<logger name="com.hai.config.WxOrderConfig" level="INFO">
<appender-ref ref="wechatPayLog" />
</logger>
</configuration> </configuration>

@ -125,6 +125,25 @@
<charset>UTF-8</charset> <!-- 此处设置字符集 --> <charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder> </encoder>
</appender> </appender>
<appender name="wechatPayLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/wechatPay.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/wechatPayLog/wechatPayLog.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"> <root level="DEBUG">
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT" />
</root> </root>
@ -152,5 +171,8 @@
<logger name="com.hai.service.impl.OutRechargeOrderServiceImpl" level="INFO"> <logger name="com.hai.service.impl.OutRechargeOrderServiceImpl" level="INFO">
<appender-ref ref="RechargeLog" /> <appender-ref ref="RechargeLog" />
</logger> </logger>
<logger name="com.hai.config.WxOrderConfig" level="INFO">
<appender-ref ref="wechatPayLog" />
</logger>
</configuration> </configuration>

@ -125,6 +125,25 @@
<charset>UTF-8</charset> <!-- 此处设置字符集 --> <charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder> </encoder>
</appender> </appender>
<appender name="wechatPayLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/wechatPay.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/wechatPayLog/wechatPayLog.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"> <root level="DEBUG">
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT" />
</root> </root>
@ -152,5 +171,8 @@
<logger name="com.hai.service.impl.OutRechargeOrderServiceImpl" level="INFO"> <logger name="com.hai.service.impl.OutRechargeOrderServiceImpl" level="INFO">
<appender-ref ref="RechargeLog" /> <appender-ref ref="RechargeLog" />
</logger> </logger>
<logger name="com.hai.config.WxOrderConfig" level="INFO">
<appender-ref ref="wechatPayLog" />
</logger>
</configuration> </configuration>

@ -115,7 +115,14 @@ public class WxOrderConfig {
param.put("sign_type", "HMAC-SHA256"); param.put("sign_type", "HMAC-SHA256");
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
param.put("sign", signStr); param.put("sign", signStr);
String resultXmL = doSSLRequest(param.get("mch_id"), "https://api.mch.weixin.qq.com/secapi/pay/refund", WxUtils.mapToXml(param));
String paramXml = WxUtils.mapToXml(param);
log.info("==========退款START=========");
log.info("订单号:" + paySerialNo);
log.info("请求参数:" + paramXml);
String resultXmL = doSSLRequest(param.get("mch_id"), "https://api.mch.weixin.qq.com/secapi/pay/refund", paramXml);
log.info("响应参数:" + resultXmL);
log.info("==========退款END=========");
return XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class); return XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class);
} }

Loading…
Cancel
Save