Bläddra i källkod

// test

release_toaliyun_real
xhxu 3 år sedan
förälder
incheckning
e3f05f6096
4 ändrade filer med 44 tillägg och 34 borttagningar
  1. +4
    -1
      mallinkSchedule/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java
  2. +2
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxScreenAdMapper.java
  3. +24
    -21
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  4. +14
    -11
      mallinkService/src/main/java/com/iformall/service/pay/service/share/douyin/TtPayShareService.java

+ 4
- 1
mallinkSchedule/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java Visa fil

@@ -151,7 +151,10 @@ public class CouponExpiringSchedule {
@Scheduled(cron = "0 15 0 * * ?") // 每天凌晨00:15 下架券广告
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void screenAdExpiringSchedule() {
wxScreenAdMapper.offScreeAdByCouponChannelStatus();
List<WxMall> malls = getMalls();
for (WxMall mall : malls) {
wxScreenAdMapper.offScreeAdByCouponChannelStatus(mall);
}
}

@Async


+ 2
- 1
mallinkService/src/main/java/com/iformall/mapper/WxScreenAdMapper.java Visa fil

@@ -2,6 +2,7 @@ package com.iformall.mapper;

import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxScreenAd;
import com.iformall.domain.po.base.TenantEntity;


import java.util.List;
@@ -10,7 +11,7 @@ public interface WxScreenAdMapper extends CommonMapper<WxScreenAd, Long> {

List<WxScreenAd> findList(WxScreenAd wxScreenAd);

void offScreeAdByCouponChannelStatus();
void offScreeAdByCouponChannelStatus(TenantEntity tenantEntity);
void updateStatusByCouponChannelId(WxScreenAd wxScreenAd);

}

+ 24
- 21
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Visa fil

@@ -31,6 +31,8 @@ import com.iformall.service.excel.WxCardDataExporter;
import com.iformall.service.excel.WxCouponDataExporter;
import com.iformall.service.excel.WxPressDataExporter;

import com.iformall.service.pay.PayServiceFactory;
import com.iformall.service.pay.service.share.PayShareAdapterService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@@ -136,6 +138,9 @@ public class WxCouponServiceImpl implements WxCouponService {
@Autowired
private MqBaseProducer mqBaseProducer;

@Autowired
PayServiceFactory payServiceFactory;

@Override
public ResultData list(TenantEntity tenantEntity,WxCoupon wxCoupon, Integer pageNum, Integer pageSize) {
if (null == wxCoupon) wxCoupon = new WxCoupon();
@@ -643,6 +648,11 @@ public class WxCouponServiceImpl implements WxCouponService {
if (platEnum != null) {
plat = platEnum;
}
EnumPayWay payWay = EnumPayWay.PAY_WAY_WECHAT;
if(EnumAppPlat.TOUTIAO.equals(plat)){
payWay = EnumPayWay.PAY_WAY_TT;
}

WxPayAccount payAccount = payAccountMapper.selectById(cAppInfo.getPayId());
if (payAccount == null) {
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
@@ -663,6 +673,8 @@ public class WxCouponServiceImpl implements WxCouponService {
}
}

PayShareAdapterService payShareServie = payServiceFactory.getPayShareAdapterService(payWay.getCode(),payAccount.getPayVersion());

if (EnumPayMchType.DIRECT.equals(payMchType)) {
Long merchantId = null;
if (merchantParamList.size() > 1) {
@@ -687,34 +699,25 @@ public class WxCouponServiceImpl implements WxCouponService {
record.setMerchantType(EnumCouponMerchantType.ONE_MERCHANT.getCode());
merchantId = merchantParamList.get(0).getLong("id");
}
WxProfitSharingReceiver psReceiverQ = new WxProfitSharingReceiver();
psReceiverQ.updateTenantInfo(record);
psReceiverQ.setMerchantId(merchantId);
psReceiverQ.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode());
psReceiverQ.setPlat(plat.getCode());
WxProfitSharingReceiver one = wxProfitSharingReceiverMapper.findOne(psReceiverQ);
if (one == null) {
WxProfitSharingReceiver receiver = payShareServie.getReceiver(payAccount, merchantId, null, payMchTypeEnum.getCode());

if (receiver == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "对应门店至少进件一种支付模式");
}
if (EnumAppPlat.TOUTIAO.equals(plat)) {
if (!MerchantImportStatus.improt_success.getCode().equals(one.getWxImportStatus())
&& !MerchantImportStatus.improt_success.getCode().equals(one.getAlipayImportStatus())
&& !MerchantImportStatus.improt_success.getCode().equals(one.getHzImportStatus())) {
if (!MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus())
&& !MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus())
&& !MerchantImportStatus.improt_success.getCode().equals(receiver.getHzImportStatus())) {
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "对应门店至少进件一种支付模式");
}
}
} else if (EnumPayShare.YES.equals(isShare)) {
for (int i = 0, size = merchantParamList.size(); i < size; i++) {
JSONObject jsonObject = merchantParamList.get(i);
Long id = jsonObject.getLong("id");
WxProfitSharingReceiver psReceiverQ = new WxProfitSharingReceiver();
psReceiverQ.updateTenantInfo(record);
psReceiverQ.setMerchantId(id);
psReceiverQ.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode());
psReceiverQ.setPlat(plat.getCode());
WxProfitSharingReceiver one = wxProfitSharingReceiverMapper.findOne(psReceiverQ);
Long merchantId = jsonObject.getLong("id");
WxProfitSharingReceiver receiver = payShareServie.getReceiver(payAccount, merchantId, null, payMchTypeEnum.getCode());
int n = i + 1;
if (one == null) {
if (receiver == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "第(" + n + ")个商户还未配置分账账户或未进件");
}
if (EnumAppPlat.TOUTIAO.equals(plat)) {
@@ -725,15 +728,15 @@ public class WxCouponServiceImpl implements WxCouponService {
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "分账模式未设置开通支付渠道");
}
if(EnumYesOrNo.YES.getCode().equals(openPayResult.getAlipay())
&& !MerchantImportStatus.improt_success.getCode().equals(one.getAlipayImportStatus())){
&& !MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus())){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "第(" + n + ")个商户未进件支付宝");
}
if(EnumYesOrNo.YES.getCode().equals(openPayResult.getWx())
&& !MerchantImportStatus.improt_success.getCode().equals(one.getWxImportStatus())){
&& !MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus())){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "第(" + n + ")个商户未进件微信");
}
if(EnumYesOrNo.YES.getCode().equals(openPayResult.getHz())
&& !MerchantImportStatus.improt_success.getCode().equals(one.getHzImportStatus())){
&& !MerchantImportStatus.improt_success.getCode().equals(receiver.getHzImportStatus())){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "第(" + n + ")个商户未进件抖音");
}
}


+ 14
- 11
mallinkService/src/main/java/com/iformall/service/pay/service/share/douyin/TtPayShareService.java Visa fil

@@ -408,18 +408,21 @@ public class TtPayShareService extends PayShareBaseAdapterService{
psReceiverQ.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode());
psReceiverQ.setPlat(EnumAppPlat.TOUTIAO.getCode());
String payMsg = "";
if(EnumTtPayChannel.WX_PAY.getCode().equals(ttPayWay)){
payMsg = EnumTtPayChannel.WX_PAY.getMessage();
psReceiverQ.setWxImportStatus(MerchantImportStatus.improt_success.getCode());
}else if(EnumTtPayChannel.ALI_PAY.getCode().equals(ttPayWay)){
payMsg = EnumTtPayChannel.ALI_PAY.getMessage();
psReceiverQ.setAlipayImportStatus(MerchantImportStatus.improt_success.getCode());
}else if(EnumTtPayChannel.HZ_PAY.getCode().equals(ttPayWay)){
payMsg = EnumTtPayChannel.HZ_PAY.getMessage();
psReceiverQ.setHzImportStatus(MerchantImportStatus.improt_success.getCode());
}else{
log.error("该订单支付方式异常{}");
if(ttPayWay != null){
if(EnumTtPayChannel.WX_PAY.getCode().equals(ttPayWay)){
payMsg = EnumTtPayChannel.WX_PAY.getMessage();
psReceiverQ.setWxImportStatus(MerchantImportStatus.improt_success.getCode());
}else if(EnumTtPayChannel.ALI_PAY.getCode().equals(ttPayWay)){
payMsg = EnumTtPayChannel.ALI_PAY.getMessage();
psReceiverQ.setAlipayImportStatus(MerchantImportStatus.improt_success.getCode());
}else if(EnumTtPayChannel.HZ_PAY.getCode().equals(ttPayWay)){
payMsg = EnumTtPayChannel.HZ_PAY.getMessage();
psReceiverQ.setHzImportStatus(MerchantImportStatus.improt_success.getCode());
}else{
log.error("该订单支付方式异常{}");
}
}

List<WxProfitSharingReceiver> list = wxProfitSharingReceiverMapper.findList(psReceiverQ);
if(list == null || list.isEmpty()){
throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该商户未未进件."+payMsg);


Laddar…
Avbryt
Spara