|
|
@@ -102,6 +102,7 @@ import com.github.binarywang.wxpay.service.TransferService;
|
|
|
import com.github.binarywang.wxpay.service.WxPayService;
|
|
|
import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
|
|
|
import com.hc.openapi.tool.fastjson.JSON;
|
|
|
+import io.netty.util.internal.StringUtil;
|
|
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
|
|
|
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
|
|
@@ -1948,15 +1949,22 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
@Transactional
|
|
|
public R sendAppRedPacket(WxSendRedPacketParam param) {
|
|
|
//组合返回参数
|
|
|
+ String json;
|
|
|
R result = new R();
|
|
|
- String json = configService.selectConfigByKey("his.AppRedPacket");
|
|
|
+ json = redisCache.getCacheObject("sys_config:redPacket.config.new");
|
|
|
+ if (StringUtil.isNullOrEmpty(json) || json.isEmpty()) {
|
|
|
+ json = configService.selectConfigByKey("his.AppRedPacket");
|
|
|
+ }
|
|
|
+// String json = configService.selectConfigByKey("his.AppRedPacket");
|
|
|
AppRedPacketConfig config = JSONUtil.toBean(json, AppRedPacketConfig.class);
|
|
|
if (config.getIsNew() != null && config.getIsNew() == 1) {
|
|
|
result = sendRedPacketV3(param, config);
|
|
|
} else {
|
|
|
result= sendRedPacketLegacy(param, config);
|
|
|
}
|
|
|
-
|
|
|
+ if (result.getMsg().equals("商家余额不足") && param.getRedPacketMode() == 1) {
|
|
|
+ redisCache.incr("sys_config:redPacket.config.newCount",1L);
|
|
|
+ }
|
|
|
result.put("mchId", config.getMchId());
|
|
|
result.put("isNew",config.getIsNew());
|
|
|
logger.info("App提现返回:{}",result);
|