Browse Source

//add sharing

release_toaliyun_real
xhxu 4 years ago
parent
commit
88d297d035
4 changed files with 20 additions and 6 deletions
  1. +14
    -1
      mallinkBApi/src/main/java/com/iformall/controller/WxMerchantController.java
  2. +2
    -1
      mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverService.java
  3. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  4. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverServiceImpl.java

+ 14
- 1
mallinkBApi/src/main/java/com/iformall/controller/WxMerchantController.java View File

@@ -5,6 +5,7 @@ import com.iformall.common.ResultData;
import com.iformall.domain.po.*; import com.iformall.domain.po.*;
import com.iformall.enums.EnumMsgSend; import com.iformall.enums.EnumMsgSend;
import com.iformall.enums.EnumPayWay; import com.iformall.enums.EnumPayWay;
import com.iformall.enums.EnumProfitSharingType;
import com.iformall.service.WxCUserService; import com.iformall.service.WxCUserService;
import com.iformall.service.WxMerchantService; import com.iformall.service.WxMerchantService;
import com.iformall.service.WxProfitSharingReceiverService; import com.iformall.service.WxProfitSharingReceiverService;
@@ -47,7 +48,19 @@ public class WxMerchantController extends BaseController {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户ID不能为空"); return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户ID不能为空");
} }
wxMerchant.updateTenantInfo(getTenantInfo()); wxMerchant.updateTenantInfo(getTenantInfo());
return new ResultData(wxProfitSharingReceiverService.findReceiver(wxMerchant));
return new ResultData(wxProfitSharingReceiverService.findReceiver(wxMerchant, EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT));
}

@ApiOperation("查询账户信息")
@GetMapping("/findTtAccountById")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData findTtAccountById(@ModelAttribute WxMerchant wxMerchant) {
log.debug("[" + getIpAddr() + "] WxMerchantController::findTtAccountById");
if (wxMerchant.getId() == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户ID不能为空");
}
wxMerchant.updateTenantInfo(getTenantInfo());
return new ResultData(wxProfitSharingReceiverService.findReceiver(wxMerchant,EnumProfitSharingType.PROFIT_SHARING_TYPE_DOUYIN));
} }


@ApiOperation("更新收款账户信息:必填项 id(商户ID) name(商户名称) accountId(账号ID) accountTypeValue(账号类型) accountName(账号名称)") @ApiOperation("更新收款账户信息:必填项 id(商户ID) name(商户名称) accountId(账号ID) accountTypeValue(账号类型) accountName(账号名称)")


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

@@ -6,6 +6,7 @@ import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxProfitSharingReceiver; import com.iformall.domain.po.WxProfitSharingReceiver;
import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumPayWay; import com.iformall.enums.EnumPayWay;
import com.iformall.enums.EnumProfitSharingType;


import java.util.List; import java.util.List;


@@ -43,7 +44,7 @@ public interface WxProfitSharingReceiverService {
*/ */
void deleteById(Long id); void deleteById(Long id);


WxProfitSharingReceiver findReceiver(WxMerchant merchant);
WxProfitSharingReceiver findReceiver(WxMerchant merchant, EnumProfitSharingType sharingType);


ResultData addReceiver(WxMerchant merchant, WxProfitSharingReceiver receiver, List<WxProfitSharingReceiver> delList,EnumPayWay payWay); ResultData addReceiver(WxMerchant merchant, WxProfitSharingReceiver receiver, List<WxProfitSharingReceiver> delList,EnumPayWay payWay);




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

@@ -317,7 +317,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {
wxMerchant.setUsers(userList); wxMerchant.setUsers(userList);


//分账信息 //分账信息
WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(wxMerchant);
WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(wxMerchant,EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT);
if (receiver != null) { if (receiver != null) {
wxMerchant.setWxProfitSharingReceiver(receiver); wxMerchant.setWxProfitSharingReceiver(receiver);
wxMerchant.setAccountId(receiver.getReceiverAccount()); wxMerchant.setAccountId(receiver.getReceiverAccount());
@@ -872,7 +872,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {


list.stream().forEach(m->{ list.stream().forEach(m->{
//分账信息 //分账信息
WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(m);
WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(m,EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT);
if (receiver != null) { if (receiver != null) {
m.setAccountId(receiver.getReceiverAccount()); m.setAccountId(receiver.getReceiverAccount());
m.setAccountName(receiver.getTrueName()); m.setAccountName(receiver.getTrueName());


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

@@ -115,11 +115,11 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv


//todo 微信和抖音分账可能存在两个分账信息 //todo 微信和抖音分账可能存在两个分账信息
@Override @Override
public WxProfitSharingReceiver findReceiver(WxMerchant merchant) {
public WxProfitSharingReceiver findReceiver(WxMerchant merchant, EnumProfitSharingType sharingType) {
WxProfitSharingReceiver receiver = new WxProfitSharingReceiver(); WxProfitSharingReceiver receiver = new WxProfitSharingReceiver();
receiver.updateTenantInfo(merchant); receiver.updateTenantInfo(merchant);
receiver.setMerchantId(merchant.getId()); receiver.setMerchantId(merchant.getId());
// receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode());
receiver.setSharingType(sharingType.getCode());
receiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode()); receiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode());
List<WxProfitSharingReceiver> list = wxProfitSharingReceiverMapper.findList(receiver); List<WxProfitSharingReceiver> list = wxProfitSharingReceiverMapper.findList(receiver);
if(list != null && list.size() > 0){ if(list != null && list.size() > 0){


Loading…
Cancel
Save