From 6c5c4c933e4acf77694c0e1276805532b6946e2c Mon Sep 17 00:00:00 2001 From: hupeng Date: Fri, 9 Aug 2019 18:37:19 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=95=86=E6=88=B7][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E5=95=86=E6=88=B7=E5=AF=BC=E5=87=BA=E5=AD=97=E6=AE=B5=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/domain/po/WxMerchant.java | 182 +++++++++++------- .../com/iformall/mapper/WxShopMapper.java | 2 +- .../service/impl/WxMerchantServiceImpl.java | 10 +- 3 files changed, 125 insertions(+), 69 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 32f39ab9c..e488b3c49 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java @@ -1,9 +1,13 @@ package com.iformall.domain.po; import cn.afterturn.easypoi.excel.annotation.Excel; +import com.iformall.domain.vo.WxShopVo; +import com.iformall.enums.EnumBusiness; +import com.iformall.enums.EnumSubBusiness; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +import org.apache.commons.collections.ListUtils; import javax.persistence.Id; import javax.persistence.Table; @@ -12,6 +16,7 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @Table(name = "wx_merchant") @Data @@ -26,18 +31,35 @@ public class WxMerchant extends BaseEntity { @Transient private List userids; + @Transient private List shopids; @Transient private List shops; + @Transient + private List shopVos; + @Transient private List users; @Transient private Long rentContractId; + + @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") + @Excel(name="商户名",width = 20,orderNum = "1") + private String name; + + @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") + @Excel(name="联系人",width = 20,orderNum = "2") + private String linkPerson; + + @io.swagger.annotations.ApiModelProperty(value="联系方式",name="linkPhone") + @Excel(name="联系方式",width = 20,orderNum = "3") + private String linkPhone; + @Transient @Excel(name="租期开始时间",width = 20,format="yyyy-MM-dd",orderNum = "4") @io.swagger.annotations.ApiModelProperty(value="租期开始时间",name="rentalStartDate") @@ -48,139 +70,165 @@ public class WxMerchant extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value="租期结束时间",name="rentalEndDate") private Date rentalEndDate; - @Transient - @io.swagger.annotations.ApiModelProperty(value="单价",name="price") - private BigDecimal price; - - @Transient - private Integer receivePeriod; + @Excel(name="商户状态",width = 20,orderNum = "6",replace = {"停用_0","正常_1"}) + @io.swagger.annotations.ApiModelProperty(value="状态1可用0停用",name="status") + private Integer status; @Transient @Excel(name="账户类型",width = 20,orderNum = "7",replace = {"_null","商户号_0","微信号_1"}) - @io.swagger.annotations.ApiModelProperty(value="账户类型",name="accountTypeValue") + @io.swagger.annotations.ApiModelProperty(value="账户类型",name="accountTypeValue") private Integer accountTypeValue; @Transient @Excel(name="账户号",width = 20,orderNum = "8") - @io.swagger.annotations.ApiModelProperty(value="账户ID",name="accountId") + @io.swagger.annotations.ApiModelProperty(value="账户ID",name="accountId") private String accountId; @Transient @Excel(name="账户名",width = 20,orderNum = "9") - @io.swagger.annotations.ApiModelProperty(value="账户名",name="accountName") + @io.swagger.annotations.ApiModelProperty(value="账户名",name="accountName") private String accountName; + @Excel(name="创建时间",width = 20,format="yyyy-MM-dd",orderNum = "10") + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") + private Date createDate; + + @Excel(name="是否展示",width = 20,orderNum = "11",replace = {"否_0","是_1"}) + @io.swagger.annotations.ApiModelProperty(value = "是否显示在C端", name = "isPublic") + private Integer isPublic; + + @Excel(name = "待缴提醒", width = 20, orderNum = "12") + @io.swagger.annotations.ApiModelProperty(value = "待缴提醒", name = "billSetting") + private Integer billSetting; + + @Transient + @Excel(name = "业态", width = 20, orderNum = "13") + @io.swagger.annotations.ApiModelProperty(value="经营业态ID:参照wx_business表",name="businessId") + private String businessName; + + @Transient + @Excel(name = "子业态", width = 20, orderNum = "14") + @io.swagger.annotations.ApiModelProperty(value="子业态",name="subBusinessId") + private String subBusinessName; + + @Transient + @Excel(name = "商铺", width = 20, orderNum = "15") + private String shopsStr; + + @Transient + @Excel(name = "管理员", width = 20, orderNum = "16") + private String usersStr; + + @Excel(name = "主谈人", width = 20, orderNum = "17") + @io.swagger.annotations.ApiModelProperty(value = "主谈人", name = "talkUserMain") + private String talkUserMain; + + @Excel(name = "辅谈人", width = 20, orderNum = "18") + @io.swagger.annotations.ApiModelProperty(value = "辅谈人", name = "talkUserAux") + private String talkUserAux; + + public String getShopsStr() { + if (shopVos != null && shopVos.size() > 0) { + return String.join("\n", + shopVos.stream().map( + s->{return s.getBuildingName()+"-"+s.getFloorName()+"-"+s.getShopNumber();} + ).collect(Collectors.toList())); + } else { + return null; + } + } + + public String getUsersStr() { + if (users != null && users.size() > 0) { + return String.join("\n", + users.stream().map( + u->{return u.getName()+"-"+u.getPhone();} + ).collect(Collectors.toList())); + } else { + return null; + } + } + + public String getBusinessName() { + if (businessId != null) { + EnumBusiness e = EnumBusiness.getEnum(businessId); + if (e != null) return e.getMessage(); + else return null; + } else { + return null; + } + } + + public String getSubBusinessName() { + if (subBusinessId != null) { + EnumSubBusiness e = EnumSubBusiness.getEnum(subBusinessId); + if (e != null) return e.getMessage(); + else return null; + } else { + return null; + } + } + + @Transient + @io.swagger.annotations.ApiModelProperty(value="单价",name="price") + private BigDecimal price; + + @Transient + private Integer receivePeriod; + @Transient @io.swagger.annotations.ApiModelProperty(value="账户参数",name="accountParameter") private String accountParameter; - @Transient private List> shoplist; - @Transient private WxMerchantCorp wxMerchantCorp; - @Transient private WxMerchantTax wxMerchantTax; - @Transient private List levelConfigList; - @Transient private Integer rentShopType; - @Transient private Integer isUse; - @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") private String tenantId; @io.swagger.annotations.ApiModelProperty(value="商户图片",name="imgUrl") private String imgUrl; - - @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") - @Excel(name="商户名",width = 20,orderNum = "1") - private String name; - - @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") - @Excel(name="联系人",width = 20,orderNum = "2") - private String linkPerson; - - @io.swagger.annotations.ApiModelProperty(value="联系方式",name="linkPhone") - @Excel(name="联系方式",width = 20,orderNum = "3") - private String linkPhone; - - @Excel(name="创建时间",width = 20,format="yyyy-MM-dd",orderNum = "10") - @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") - private Date createDate; @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") private Date updateDate; @io.swagger.annotations.ApiModelProperty(value="停车厂商(1:ETCP)",name="carVendorType") private Integer carVendorType; @io.swagger.annotations.ApiModelProperty(value="停车厂商参数",name="carParams") private String carParams; - - @Excel(name="商户状态",width = 20,orderNum = "6",replace = {"停用_0","正常_1"}) - @io.swagger.annotations.ApiModelProperty(value="状态1可用0停用",name="status") - private Integer status; - @io.swagger.annotations.ApiModelProperty(value="经营业态ID:参照wx_business表",name="businessId") private Integer businessId; - @io.swagger.annotations.ApiModelProperty(value="子业态",name="subBusinessId") private Integer subBusinessId; - @io.swagger.annotations.ApiModelProperty(value="店铺类型:1直营店2加盟店3个体店4旗舰店",name="shopType") private Integer shopType; - @io.swagger.annotations.ApiModelProperty(value="品牌",name="brand") private Long brand; - @io.swagger.annotations.ApiModelProperty(value = "类型", name = "type") private Integer type; - - @Excel(name="是否展示",width = 20,orderNum = "11",replace = {"否_0","是_1"}) - @io.swagger.annotations.ApiModelProperty(value = "是否显示在C端", name = "isPublic") - private Integer isPublic; - @io.swagger.annotations.ApiModelProperty(value = "邮件", name = "email") private String email; - @io.swagger.annotations.ApiModelProperty(value = "副标题", name = "title") private String title; - @io.swagger.annotations.ApiModelProperty(value = "封面图", name = "coverPicture") private String coverPicture; - @io.swagger.annotations.ApiModelProperty(value="是否为商管商户 1是 0否",name="status") private Integer isAdmin; - - @Excel(name = "待缴提醒", width = 20, orderNum = "12") - @io.swagger.annotations.ApiModelProperty(value = "待缴提醒", name = "billSetting") - private Integer billSetting; - @io.swagger.annotations.ApiModelProperty(value = "置顶时间", name = "topTime") private Date topTime; - @io.swagger.annotations.ApiModelProperty(value="二维码地址",name="qrCode") private String qrCode; - @io.swagger.annotations.ApiModelProperty(value="简介",name="introduction") private String introduction; - @io.swagger.annotations.ApiModelProperty(value="优惠活动",name="actionDesc") private String actionDesc; - @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") private Integer isDel; - - @Excel(name = "主谈人", width = 20, orderNum = "13") - @io.swagger.annotations.ApiModelProperty(value = "主谈人", name = "talkUserMain") - private String talkUserMain; - - @Excel(name = "辅谈人", width = 20, orderNum = "14") - @io.swagger.annotations.ApiModelProperty(value = "辅谈人", name = "talkUserAux") - private String talkUserAux; - @io.swagger.annotations.ApiModelProperty(value = "客服电话", name = "linkLinePhone") private String linkLinePhone; diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java index 5617e1700..389811786 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java @@ -31,7 +31,7 @@ public interface WxShopMapper extends CommonMapper { List findListWithMerchantMap(WxShop record); - List findShopVoList(Map map); + List findShopVoList(@Param("merchantId") Long merchantId); Long getCountByWxShop(WxShop wxShop); 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 1b65e551d..2a6659c36 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java @@ -641,8 +641,16 @@ public class WxMerchantServiceImpl implements WxMerchantService { m.setRentalStartDate(lrc.get(0).getRentalStartDate()); m.setRentalEndDate(lrc.get(0).getRentalEndDate()); } - }); + //商铺信息 + m.setShopVos(wxShopMapper.findShopVoList(m.getId())); + + //店员信息 + WxMerchantBUser wxMerchantBUser = new WxMerchantBUser(); + wxMerchantBUser.setMerchantId(m.getId()); + wxMerchantBUser.setStatus(EnumMerchantBUserStatus.VALID.getCode()); + m.setUsers(wxMerchantBUserMapper.findList(wxMerchantBUser)); + }); excelService.exportExcel(list, null, "商户信息", WxMerchant.class, "商户信息数据.xlsx", response, false); }