From 4fa1a33359c0aa1618c77b367b39b3537e95552b Mon Sep 17 00:00:00 2001 From: xhxu Date: Tue, 25 Oct 2022 15:52:38 +0800 Subject: [PATCH] //merchant --- .../com/iformall/domain/po/WxMerchant.java | 46 +++++++++++++++++-- .../service/impl/WxMerchantServiceImpl.java | 4 ++ 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java index 0b0553303..1b76d5037 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java @@ -7,13 +7,12 @@ import com.google.gson.JsonObject; import com.iformall.common.SortColumn; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.vo.WxShopVo; -import com.iformall.enums.EnumBusiness; -import com.iformall.enums.EnumMerchantStatus; -import com.iformall.enums.EnumSubBusiness; +import com.iformall.enums.*; import com.iformall.utils.Constant; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; import java.util.Date; @@ -138,11 +137,15 @@ public class WxMerchant extends TenantEntity { @Excel(name = "管理员", width = 20, orderNum = "14") private String usersStr; - @Excel(name = "主谈人", width = 20, orderNum = "15") + @TableField(exist = false) + @Excel(name = "账户", width = 30, orderNum = "15") + private String receivers; + + @Excel(name = "主谈人", width = 20, orderNum = "16") @io.swagger.annotations.ApiModelProperty(value = "主谈人", name = "talkUserMain") private String talkUserMain; - @Excel(name = "辅谈人", width = 20, orderNum = "16") + @Excel(name = "辅谈人", width = 20, orderNum = "17") @io.swagger.annotations.ApiModelProperty(value = "辅谈人", name = "talkUserAux") private String talkUserAux; @@ -188,6 +191,39 @@ public class WxMerchant extends TenantEntity { } } + public String getReceivers() { + if (wxProfitSharingReceiver != null && wxProfitSharingReceiver.size() > 0) { + return String.join("\n", + wxProfitSharingReceiver.stream().map(r->{ + StringBuffer str = new StringBuffer(); + if(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT_v2.getCode().equals(r.getSharingType())){ + str.append("微信特约商户号:"); + }else if(EnumProfitSharingType.PROFIT_SHARING_TYPE_DOUYIN.getCode().equals(r.getSharingType())){ + str.append("抖音商户号:"); + }else if(EnumProfitSharingType.PROFIT_SHARING_TYPE_BANK.getCode().equals(r.getSharingType())){ + str.append("银行卡号:"); + }else if(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode().equals(r.getSharingType())){ + if(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_MERCHANT_ID.getCode().equals(r.getReceiverType())){ + str.append("微信商户号:"); + }else if(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_PERSONAL_WECHATID.getCode().equals(r.getReceiverType())){ + str.append("个人微信号(微信已停用):"); + }else if(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_PERSONAL_OPENID.getCode().equals(r.getReceiverType())){ + str.append("OPENID:"); + } else if(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_PERSONAL_SUB_OPENID.getCode().equals(r.getReceiverType())){ + str.append("OPENID:"); + } + } + str.append(r.getReceiverAccount()); + if(StringUtils.isNotBlank(r.getTrueName())){ + str.append("(").append(r.getTrueName()).append(")"); + } + return str.toString(); + }).collect(Collectors.toList())); + } else { + return null; + } + } + public String getBusinessName() { return EnumBusiness.getEnumMessage(businessId); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java index 07d0f9d18..c8e3533ed 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java @@ -930,6 +930,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { List list = wxMerchantMapper.findList(wxMerchant); list.stream().forEach(m->{ + + List receivers = wxProfitSharingReceiverService.findReceivers(m, m.getId()); + m.setWxProfitSharingReceiver(receivers); + //分账信息 可能有多个, 先干掉 // WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(m,EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT); // if (receiver != null) {