Browse Source

update

release_toaliyun_real
xiaohanzi 5 years ago
parent
commit
cccc332bed
6 changed files with 47 additions and 9 deletions
  1. +3
    -4
      mallinkService/src/main/java/com/iformall/domain/po/WxCUser.java
  2. +10
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java
  3. +22
    -0
      mallinkService/src/main/java/com/iformall/service/pay/entity/CreateCUser.java
  4. +2
    -1
      mallinkService/src/main/java/com/iformall/service/pay/service/CPassivePayService.java
  5. +3
    -2
      mallinkService/src/main/java/com/iformall/service/pay/service/miniApp/wx/maPay/WxMiniMaPayAdapterService.java
  6. +7
    -0
      mallinkService/src/main/java/com/iformall/utils/UserUtil.java

+ 3
- 4
mallinkService/src/main/java/com/iformall/domain/po/WxCUser.java View File

@@ -7,6 +7,8 @@ import com.iformall.domain.po.base.BaseEntity;
import com.iformall.domain.po.base.BaseTenantEntity;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.utils.Constant;
import com.iformall.utils.UserUtil;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@@ -161,9 +163,6 @@ public class WxCUser extends TenantEntity {
* @return
*/
public boolean isBasicInfo() {
if(null == this.getUserId()) {
return false;
}
return true;
return UserUtil.CuserIsBasicInfo(this.getUserId());
}
}

+ 10
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java View File

@@ -19,6 +19,7 @@ import com.iformall.pay.*;
import com.iformall.service.*;
import com.iformall.service.helper.WxPayOrderServiceHelper;
import com.iformall.service.pay.PayServiceFactory;
import com.iformall.service.pay.entity.CreateCUser;
import com.iformall.service.pay.entity.PayAdapterResult;
import com.iformall.service.pay.entity.PayExtraParam;
import com.iformall.service.pay.entity.PayQueryAdapterResult;
@@ -1096,13 +1097,20 @@ public class WxPayOrderServiceImpl implements WxPayOrderService {
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public void handleMicroOrderPaySuccess(Object result,String transcationId,EnumPayWay payWay, WxPayOrder record ,WxMerchantBUser user,WxAppinfo appInfo,PayExtraParam params) {
//B端操作,需要生成cUser
Long cUserId;
CreateCUser cUser = null;
try {
cUserId = payServiceFactory.getCPassivePayService(payWay.getCode()).createCUserAfterPay(result, appInfo);
cUser = payServiceFactory.getCPassivePayService(payWay.getCode()).createCUserAfterPay(result, appInfo);
} catch (Exception e1) {
logger.error("创建C端用户失败: " ,e1);
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "创建C端用户失败: " + e1.getMessage());
}
//如果用户是会员,则用会员ID, 如果没有,则用渠道用户ID(如wxCuser,支付宝user)
Long cUserId = null;
if (cUser.isBasicInfo()) {
cUserId = cUser.getBasicUserId();
}else {
cUserId = cUser.getCUserId();
}
WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy();
WxOrder order = proxy.handler(record,transcationId,cUserId);
if (null == order) {


+ 22
- 0
mallinkService/src/main/java/com/iformall/service/pay/entity/CreateCUser.java View File

@@ -0,0 +1,22 @@
package com.iformall.service.pay.entity;

import java.io.Serializable;

import com.iformall.utils.UserUtil;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class CreateCUser implements Serializable{

private static final long serialVersionUID = 877618734961866171L;

private Long cUserId;
private Long basicUserId;
public boolean isBasicInfo() {
return UserUtil.CuserIsBasicInfo(basicUserId);
}
}

+ 2
- 1
mallinkService/src/main/java/com/iformall/service/pay/service/CPassivePayService.java View File

@@ -7,6 +7,7 @@ import com.iformall.domain.po.WxOrder;
import com.iformall.domain.po.WxPayAccount;
import com.iformall.domain.po.WxPayOrder;
import com.iformall.enums.EnumPayShare;
import com.iformall.service.pay.entity.CreateCUser;
import com.iformall.service.pay.entity.PayAdapterResult;
import com.iformall.service.pay.entity.PayExtraParam;

@@ -28,6 +29,6 @@ public interface CPassivePayService extends PayAdapterService{
* @param params
* @throws Exception
*/
public Long createCUserAfterPay(Object result,WxAppinfo appInfo) throws Exception;
public CreateCUser createCUserAfterPay(Object result,WxAppinfo appInfo) throws Exception;

}

+ 3
- 2
mallinkService/src/main/java/com/iformall/service/pay/service/miniApp/wx/maPay/WxMiniMaPayAdapterService.java View File

@@ -22,6 +22,7 @@ import com.iformall.pay.WxMicroPayOrderSP;
import com.iformall.pay.WxPay;
import com.iformall.pay.WxPayment;
import com.iformall.service.WxCUserService;
import com.iformall.service.pay.entity.CreateCUser;
import com.iformall.service.pay.entity.PayAdapterResult;
import com.iformall.service.pay.entity.PayExtraParam;
import com.iformall.service.pay.entity.PayQueryAdapterResult;
@@ -195,7 +196,7 @@ public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implement
WxCUserService wxCUserService;
@Override
public Long createCUserAfterPay(Object result,WxAppinfo appInfo) throws Exception {
public CreateCUser createCUserAfterPay(Object result,WxAppinfo appInfo) throws Exception {
// add c_user, 收银台支付和券支付可能不是同一个人
Date curDate = new Date();
WxCUser userQ = new WxCUser();
@@ -225,7 +226,7 @@ public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implement
}
wxCUserService.saveOrUpdate(userQ);
}
return userQ.getId();
return new CreateCUser(userQ.getId(),userQ.getUserId());
}

@Override


+ 7
- 0
mallinkService/src/main/java/com/iformall/utils/UserUtil.java View File

@@ -35,4 +35,11 @@ public class UserUtil {
//}

}
public static boolean CuserIsBasicInfo(Long basicUserId) {
if(null == basicUserId) {
return false;
}
return true;
}
}

Loading…
Cancel
Save