From ce11e17a6951c61c604374136163b958ab5a804a Mon Sep 17 00:00:00 2001 From: xhxu Date: Fri, 15 Jan 2021 13:49:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/iformall/domain/po/WxCUserFrom.java | 8 +++----- .../com/iformall/service/impl/WxCUserFromServiceImpl.java | 8 ++++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java index 18e4b3bc7..e829d0877 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java @@ -3,7 +3,6 @@ package com.iformall.domain.po; import cn.afterturn.easypoi.excel.annotation.Excel; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.iformall.domain.po.base.TenantEntity; import com.iformall.enums.EnumCUserFrom; import com.iformall.enums.EnumUserType; @@ -15,7 +14,6 @@ import lombok.ToString; import java.util.Date; @TableName(value = "wx_c_user_from") -@JsonIgnoreProperties(ignoreUnknown = true) @Data @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) @@ -25,12 +23,12 @@ public class WxCUserFrom extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="cUserId",name="cUserId") protected Long cUserId; - @Excel(name = "用户昵称", width = 20, orderNum = "2") @TableField(exist = false) + @Excel(name = "用户昵称", width = 20, orderNum = "2") @io.swagger.annotations.ApiModelProperty(value="cUserNickName",name="cUserNickName") protected String cUserNickName; - @Excel(name = "用户电话", width = 20, orderNum = "3") @TableField(exist = false) + @Excel(name = "用户电话", width = 20, orderNum = "3") @io.swagger.annotations.ApiModelProperty(value="cUserPhone",name="cUserPhone") protected String cUserPhone; @@ -46,8 +44,8 @@ public class WxCUserFrom extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="EnumCUserFrom",name="fromType") private Integer fromType; - @Excel(name = "来源", width = 20, orderNum = "1") @TableField(exist = false) + @Excel(name = "来源", width = 20, orderNum = "1") @io.swagger.annotations.ApiModelProperty(value="fromType描述",name="fromTypeDesc") private String fromTypeDesc; public String getFromTypeDesc(){ diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java index cb2b59f98..dd796ddbf 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java @@ -62,10 +62,14 @@ public class WxCUserFromServiceImpl implements WxCUserFromService, IExcelExportS String sheetName = "门店/用户分享明细"; if(record.getFromType().equals(EnumCUserFrom.FROM_C_USER_BASIC_INFO.getCode())){ WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(record.getFromId(), record.getFinalTenantId()); - sheetName = "用户["+wxCUserBasicInfo.getPhone()+"]分享明细"; + if(wxCUserBasicInfo != null){ + sheetName = "用户["+wxCUserBasicInfo.getPhone()+"]分享明细"; + } }else if(record.getFromType().equals(EnumCUserFrom.FROM_MERCHANT.getCode())){ WxMerchant wxMerchant = wxMerchantMapper.selectById(record.getFromId()); - sheetName = "门店["+wxMerchant.getName()+"]分享明细"; + if(wxMerchant != null){ + sheetName = "门店["+wxMerchant.getName()+"]分享明细"; + } } String fileName = sheetName + ".xlsx"; excelService.exportBigExcel(this,record, null, sheetName, WxCUserFrom.class, fileName, response, false);