Просмотр исходного кода

Merge branch 'release_toaliyun_real_202302' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_202302

release_toaliyun_real
lin 3 лет назад
Родитель
Сommit
f344ff4bb7
7 измененных файлов: 92 добавлений и 85 удалений
  1. +0
    -1
      mallinkService/src/main/java/com/iformall/domain/vo/WxProfitSharingOrderDetailsVo.java
  2. +37
    -37
      mallinkService/src/main/java/com/iformall/enums/EnumProfitSharingReceiverType.java
  3. +32
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitPaymentReceiverServiceImpl.java
  4. +20
    -12
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java
  5. +0
    -13
      mallinkService/src/main/java/com/iformall/service/pay/service/cashout/CashOutAdapterService.java
  6. +0
    -8
      mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareAdapterService.java
  7. +3
    -14
      mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareBaseAdapterService.java

+ 0
- 1
mallinkService/src/main/java/com/iformall/domain/vo/WxProfitSharingOrderDetailsVo.java Просмотреть файл

@@ -3,7 +3,6 @@ package com.iformall.domain.vo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumProfitSharingReceiverType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;


+ 37
- 37
mallinkService/src/main/java/com/iformall/enums/EnumProfitSharingReceiverType.java Просмотреть файл

@@ -1,37 +1,37 @@
package com.iformall.enums;
/**
* Created by Stormeye on 2018/08/09.
*/
public enum EnumProfitSharingReceiverType {
PROFIT_SHARING_RECEIVER_MERCHANT_ID(0, "MERCHANT_ID"),//v2,v3
PROFIT_SHARING_RECEIVER_PERSONAL_WECHATID(1, "PERSONAL_WECHATID"),
PROFIT_SHARING_RECEIVER_PERSONAL_OPENID(2, "PERSONAL_OPENID"),//v2,v3
PROFIT_SHARING_RECEIVER_PERSONAL_SUB_OPENID(3, "PERSONAL_SUB_OPENID"),
;
public static EnumProfitSharingReceiverType getEnum(Integer code) {
for (EnumProfitSharingReceiverType value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}
private Integer code;
private String message;
EnumProfitSharingReceiverType(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
}
//package com.iformall.enums;
//
///**
// * Created by Stormeye on 2018/08/09.
// */
//public enum EnumProfitSharingReceiverType {
// PROFIT_SHARING_RECEIVER_MERCHANT_ID(0, "MERCHANT_ID"),//v2,v3
// PROFIT_SHARING_RECEIVER_PERSONAL_WECHATID(1, "PERSONAL_WECHATID"),
// PROFIT_SHARING_RECEIVER_PERSONAL_OPENID(2, "PERSONAL_OPENID"),//v2,v3
// PROFIT_SHARING_RECEIVER_PERSONAL_SUB_OPENID(3, "PERSONAL_SUB_OPENID"),
// ;
//
// public static EnumProfitSharingReceiverType getEnum(Integer code) {
// for (EnumProfitSharingReceiverType value : values()) {
// if (value.getCode().equals(code)) {
// return value;
// }
// }
// return null;
// }
//
// private Integer code;
// private String message;
//
// EnumProfitSharingReceiverType(Integer code, String message) {
// this.code = code;
// this.message = message;
// }
//
// public Integer getCode() {
// return code;
// }
//
// public String getMessage() {
// return message;
// }
//}

+ 32
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxProfitPaymentReceiverServiceImpl.java Просмотреть файл

@@ -21,6 +21,7 @@ import com.iformall.douyin.pay.preOrder.AppAddSubMerchantResult;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxProfitPaymentReceiverMapper;
import com.iformall.mapper.WxProfitSharingReceiverMapper;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.*;
import com.iformall.service.pay.PayServiceFactory;
@@ -66,6 +67,9 @@ public class WxProfitPaymentReceiverServiceImpl implements WxProfitPaymentReceiv
@Autowired
PayServiceFactory payServiceFactory;

@Autowired
WxProfitSharingReceiverMapper wxProfitSharingReceiverMapper;

@Autowired
@Qualifier("objectCommonRedisTemplate")
RedisTemplate<String, Object> paymentReceicerRedisTemplate;
@@ -95,6 +99,34 @@ public class WxProfitPaymentReceiverServiceImpl implements WxProfitPaymentReceiv
wxProfitPaymentReceiverMapper.updateById(record);
this.deleteRedis(record.getId());
}
//抖音的进件商户同步到 分账账户表
//微信因为需要同步微信所以分开处理
if(EnumAppPlat.TOUTIAO.getCode().equals(record.getPlat())
&& EnumProfitPaymentReceiverType.tt_merchant_number.getCode().equals(record.getReceiverType())){
WxProfitSharingReceiver sharingReceiver = wxProfitSharingReceiverMapper.selectById(record);
boolean isCreate = false;
if(sharingReceiver == null){
sharingReceiver = new WxProfitSharingReceiver();
isCreate = true;
}
sharingReceiver.setId(record.getId());
sharingReceiver.updateTenantInfo(record);
sharingReceiver.setReceiverType(record.getReceiverType());
sharingReceiver.setReceiverAccount(record.getReceiverAccount());
sharingReceiver.setReceiverComments(record.getReceiverComments());
sharingReceiver.setCreateTime(record.getCreateTime());
sharingReceiver.setUpdateTime(record.getUpdateTime());
sharingReceiver.setStatus(record.getStatus());
sharingReceiver.setPlat(record.getPlat());
sharingReceiver.setTtImportStatus(record.getTtImportStatus());
sharingReceiver.setTtImportUrl(record.getTtImportUrl());
sharingReceiver.setTtBalanceUrl(record.getTtBalanceUrl());
if(isCreate){
wxProfitSharingReceiverMapper.insert(sharingReceiver);
}else{
wxProfitSharingReceiverMapper.updateById(sharingReceiver);
}
}
}

// @Override


+ 20
- 12
mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java Просмотреть файл

@@ -249,7 +249,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
WxProfitSharingReceiver receiver = getByMerchantAdmin(sharingOrder,payShareAdapterService,wxComposeChildOrderShare.getMerchantId(),EnumMerchantAdmin.PRIVATE_SELL,payOrder.getTtPayWay(), payOrder.getMchType());
if(receiver != null){
JSONObject jo = new JSONObject();
jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage());
jo.put("type",EnumProfitPaymentReceiverType.getEnum(receiver.getReceiverType()).getMessage());
jo.put("account",receiver.getReceiverAccount());
jo.put("amount", sellerAmount);
jo.put("merchantId",receiver.getMerchantId());
@@ -273,7 +273,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
WxProfitSharingReceiver receiver = getByMerchantAdmin(sharingOrder,payShareAdapterService,wxComposeChildOrderShare.getMerchantId(),EnumMerchantAdmin.PRIVATE_SYSTEM,payOrder.getTtPayWay(), payOrder.getMchType());
if(receiver != null){
JSONObject jo = new JSONObject();
jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage());
jo.put("type",EnumProfitPaymentReceiverType.getEnum(receiver.getReceiverType()).getMessage());
jo.put("account",receiver.getReceiverAccount());
jo.put("amount", systemAmount);
jo.put("merchantId",receiver.getMerchantId());
@@ -299,7 +299,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
WxProfitSharingReceiver receiver = getByMerchantAdmin(sharingOrder,payShareAdapterService,wxComposeChildOrderShare.getMerchantId(),EnumMerchantAdmin.PUBLIC_ADMIN,payOrder.getTtPayWay(), payOrder.getMchType());
if(receiver != null){
JSONObject jo = new JSONObject();
jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage());
jo.put("type",EnumProfitPaymentReceiverType.getEnum(receiver.getReceiverType()).getMessage());
jo.put("account",receiver.getReceiverAccount());
jo.put("amount", mallAmount);
jo.put("merchantId",receiver.getMerchantId());
@@ -336,7 +336,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
if(EnumPayMchType.TOTAL.getCode().equals(payOrder.getMchType()) && EnumPayShare.YES.getCode().equals(payOrder.getShare())){
//总分 分账 抖音不支持 不支持开通
JSONObject jo = new JSONObject();
jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage());
jo.put("type",EnumProfitPaymentReceiverType.getEnum(receiver.getReceiverType()).getMessage());
jo.put("account",receiver.getReceiverAccount());
jo.put("amount", shareAmount);
jo.put("merchantId",receiver.getMerchantId());
@@ -349,7 +349,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
&& EnumTtPayChannel.ALI_PAY.getCode().equals(payOrder.getTtPayWay())){
//抖音 直连 多商户 支付宝支付 进件支付宝 分账 否则记账
JSONObject jo = new JSONObject();
jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage());
jo.put("type",EnumProfitPaymentReceiverType.getEnum(receiver.getReceiverType()).getMessage());
jo.put("account",receiver.getReceiverAccount());
jo.put("amount", shareAmount);
jo.put("merchantId",receiver.getMerchantId());
@@ -427,7 +427,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
if(EnumPayMchType.TOTAL.getCode().equals(payOrder.getMchType())){
//解冻给收款方(广场)
JSONObject jo = new JSONObject();
jo.put("type",EnumProfitPaymentReceiverType.wx_special_merchant_number.getMessage());
// jo.put("type",EnumProfitPaymentReceiverType.wx_special_merchant_number.getMessage());
jo.put("account",payAccount.getSubMchId());
jo.put("amount", shareAmount);
jo.put("merchantId",0);
@@ -438,12 +438,20 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
WxProfitPaymentReceiver receiver = payShareAdapterService.getPaymantReceiver(sharingOrder,wxComposeChildOrderShare.getMerchantId());
//解冻给收款方(门店)
JSONObject jo = new JSONObject();
jo.put("type",payShareAdapterService.getShareAccount(receiver.getReceiverType()).getMessage());
jo.put("account",receiver.getReceiverAccount());
jo.put("amount", shareAmount);
jo.put("merchantId",receiver.getMerchantId());
jo.put("bTenantId",receiver.getTenantId());
jo.put("description",receiver.getId());
if(receiver != null && receiver.getReceiverAccount().equals(wxComposeChildOrderShare.getMerchantUid())){
jo.put("type",EnumProfitPaymentReceiverType.getEnum(receiver.getReceiverType()).getMessage());
jo.put("account",receiver.getReceiverAccount());
jo.put("amount", shareAmount);
jo.put("merchantId",receiver.getMerchantId());
jo.put("bTenantId",receiver.getTenantId());
jo.put("description",receiver.getId());
}else{
jo.put("account",wxComposeChildOrderShare.getMerchantUid());
jo.put("amount", shareAmount);
jo.put("merchantId",wxComposeChildOrderShare.getMerchantId());
jo.put("bTenantId",payOrder.getTenantId());
jo.put("description",0);
}
receivers.add(jo);
}
}


+ 0
- 13
mallinkService/src/main/java/com/iformall/service/pay/service/cashout/CashOutAdapterService.java Просмотреть файл

@@ -1,22 +1,9 @@
package com.iformall.service.pay.service.cashout;

import java.util.Map;

import com.alibaba.fastjson.JSONArray;
import com.iformall.domain.po.WxAppinfo;
import com.iformall.domain.po.WxCashOut;
import com.iformall.domain.po.WxPayAccount;
import com.iformall.domain.po.WxProfitSharingOrder;
import com.iformall.domain.po.WxProfitSharingReceiver;
import com.iformall.enums.EnumPayWay;
import com.iformall.enums.EnumProfitSharingOrderType;
import com.iformall.enums.EnumProfitSharingReceiverType;
import com.iformall.exception.MallinkException;
import com.iformall.service.pay.service.share.entity.ShareAccountResult;
import com.iformall.service.pay.service.cashout.entity.CashOutAdapterResult;
import com.iformall.service.pay.service.share.entity.PayShareQueryResult;
import com.iformall.service.pay.service.share.entity.PayShareResult;
import com.iformall.service.pay.service.share.entity.ShareNotifyAdapterResult;

/**
* 零钱接口


+ 0
- 8
mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareAdapterService.java Просмотреть файл

@@ -90,14 +90,6 @@ public interface PayShareAdapterService {
*/
public PayShareQueryResult shareQuery(WxAppinfo appInfo,WxPayAccount payAccount,WxProfitSharingOrder record) throws MallinkException;
/**
* 获取分账账号类型
* @param accountType
* @return
*/
public EnumProfitSharingReceiverType getShareAccount(Integer accountType);
/**
* 分账异步通知接收
* @param paramMap


+ 3
- 14
mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareBaseAdapterService.java Просмотреть файл

@@ -10,34 +10,23 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
import com.iformall.common.ErrorCode;
import com.iformall.domain.dto.WxSharingOrderDto;
import com.iformall.domain.po.WxAppinfo;
import com.iformall.domain.po.WxPayAccount;
import com.iformall.domain.po.WxProfitSharingOrder;
import com.iformall.domain.po.WxProfitSharingReceiver;
import com.iformall.enums.EnumProfitPaymentReceiverType;
import com.iformall.enums.EnumProfitSharingReceiverStatus;
import com.iformall.enums.EnumProfitSharingReceiverType;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxProfitSharingOrderMapper;
import com.iformall.mapper.WxProfitSharingReceiverMapper;
import com.iformall.pay.WxPayment;
import com.iformall.pay.WxProfitSharing;
import com.iformall.pay.WxProfitSharingReceiverP;
import com.iformall.service.WxProfitSharingReceiverService;
import com.iformall.service.pay.service.share.entity.PayShareQueryResultReceivers;
import com.iformall.service.pay.service.share.entity.ShareAccountResult;
import com.iformall.service.pay.service.share.wx.v2.WxPayShareService;
import com.iformall.utils.BeanUtils;
import com.iformall.utils.Utility;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public abstract class PayShareBaseAdapterService implements PayShareAdapterService{

@Override
public EnumProfitSharingReceiverType getShareAccount(Integer accountType) {
return EnumProfitSharingReceiverType.getEnum(accountType);
}
protected List<PayShareQueryResultReceivers> getReceivers(String response) {
if (StringUtils.isBlank(response)) {
@@ -154,7 +143,7 @@ public abstract class PayShareBaseAdapterService implements PayShareAdapterServi


JSONObject receiverJSON = new JSONObject();
receiverJSON.put("type", EnumProfitSharingReceiverType.getEnum(receiver.getReceiverType()).getMessage());
receiverJSON.put("type", EnumProfitPaymentReceiverType.getEnum(receiver.getReceiverType()).getMessage());
receiverJSON.put("account", receiver.getReceiverAccount());
receiverJSON.put("name", receiver.getTrueName());

@@ -205,7 +194,7 @@ public abstract class PayShareBaseAdapterService implements PayShareAdapterServi
wxProfitSharingReceiverP.setSign_type("HMAC-SHA256");

JSONObject receiverJSON = new JSONObject();
receiverJSON.put("type", EnumProfitSharingReceiverType.getEnum(receiver.getReceiverType()).getMessage());
receiverJSON.put("type", EnumProfitPaymentReceiverType.getEnum(receiver.getReceiverType()).getMessage());
receiverJSON.put("account", receiver.getReceiverAccount());

wxProfitSharingReceiverP.setReceiver(receiverJSON.toJSONString());


Загрузка…
Отмена
Сохранить