diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCUserBasicInfoVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCUserBasicInfoVo.java new file mode 100644 index 000000000..d4aa75f03 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCUserBasicInfoVo.java @@ -0,0 +1,18 @@ +package com.iformall.domain.vo; + +import com.iformall.domain.po.WxCUserBasicInfo; + +public class WxCUserBasicInfoVo extends WxCUserBasicInfo { + + /**用户tags*/ + @io.swagger.annotations.ApiModelProperty(value="用户tags",name="tags") + private String tags; + + public String getTags() { + return tags; + } + + public void setTags(String tags) { + this.tags = tags; + } +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java index aa7919bea..c43646aee 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java @@ -4,6 +4,7 @@ import com.iformall.common.CommonMapper; import com.iformall.domain.dto.WxCUserBasicInfoDto; import com.iformall.domain.po.WxCUserBasicInfo; import com.iformall.domain.vo.CUserBaseVo; +import com.iformall.domain.vo.WxCUserBasicInfoVo; import java.util.List; @@ -22,4 +23,6 @@ public interface WxCUserBasicInfoMapper extends CommonMapper findVoList(WxCUserBasicInfo wxCUserBasicInfo); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java index ab046fef4..54dfa6512 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java @@ -18,6 +18,7 @@ import com.iformall.domain.po.WxTags; import com.iformall.domain.vo.CUserBaseInfoT; import com.iformall.domain.vo.CUserBaseVo; import com.iformall.domain.vo.CUserTagVo; +import com.iformall.domain.vo.WxCUserBasicInfoVo; import com.iformall.enums.EnumAssignTagsTrigger; import com.iformall.enums.EnumScoreType; import com.iformall.mapper.WxCUserBasicInfoMapper; @@ -155,7 +156,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { public void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId) { WxCUserBasicInfo basicInfoQ = new WxCUserBasicInfo(); basicInfoQ.setTenantId(tenantId); - List memberlist = wxCUserBasicInfoMapper.findList(basicInfoQ); + List memberlist = wxCUserBasicInfoMapper.findVoList(basicInfoQ); XSSFWorkbook workbook; String filepath = Constant.fileDirectory; @@ -168,6 +169,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + WxTags wxTagsQ = new WxTags(); + List tagList = wxTagsMapper.findList(wxTagsQ); + try { File file = new File(filepath); workbook = new XSSFWorkbook(); @@ -211,7 +215,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { tagCellTwo = rowtwo.createCell(9); scoreCellTwo = rowtwo.createCell(10); - WxCUserBasicInfo entity = memberlist.get(i); + WxCUserBasicInfoVo entity = memberlist.get(i); String sexStr = "保密"; if (entity.getSex() == 1) @@ -229,21 +233,22 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { updateDateCellTwo.setCellValue(sdf.format(entity.getUpdateDate())); createDateCellTwo.setCellValue(sdf.format(entity.getCreateDate())); if (entity != null) { - if (entity.getTagId() != null) { - WxCUserTags uTag = wxCUserTagsMapper.selectByPrimaryKey(entity.getTagId()); - if (uTag != null && StringUtils.isNotBlank(uTag.getTags())) { - List ids = JSONObject.parseArray(uTag.getTags(), Long.class); + if (entity.getTagId() != null && entity.getTags() != null) { + if (StringUtils.isNotBlank(entity.getTags())) { + List ids = JSONObject.parseArray(entity.getTags(), Long.class); if (!ids.isEmpty()) { - WxTags wxTagsQ = new WxTags(); - wxTagsQ.setIds(ids); - List tagList = wxTagsMapper.findList(wxTagsQ); String tagNames = ""; String tagIds = ""; List tagIdList = new ArrayList<>(); - for (WxTags wt : tagList) { - tagNames += wt.getName() + "/"; - tagIds += wt.getId() + ","; - tagIdList.add(wt.getId()); + for(Long id: ids) { + for(WxTags tag: tagList) { + if(id.equals(tag.getId())) { + tagNames += tag.getName() + "/"; + tagIds += tag.getId() + ","; + tagIdList.add(tag.getId()); + break; + } + } } if (StringUtils.isNotBlank(tagNames)) { entity.setTagNames(tagNames.substring(0, tagNames.length() - 1)); diff --git a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml index 18f151397..c7288dda2 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml @@ -194,4 +194,104 @@ + + + + + + + + + + + + + + + + + + + + + + cu.`id`,cu.`phone`,cu.`birthdate`,cu.`education`,cu.`sex`,cu.`email`,cu.`address`,cu.`poins`,cu.`tag_id`, + cu.`create_date`,cu.`update_date`,cu.`tenant_id`,cu.`name`,cu.`level`,cu.`nick_name`, + cut.`tags` + + + + where 1 = 1 + + + and cu.`id` = #{id} + + + + and cu.`tenant_id` = #{tenantId} + + + + and cu.`phone` like concat('%', #{phone},'%') + + + + and cu.`birthdate` = #{birthdate} + + + + and cu.`education` like concat('%', #{education},'%') + + + + and cu.`sex` = #{sex} + + + + and cu.`email` like concat('%', #{email},'%') + + + + and cu.`address` like concat('%', #{address},'%') + + + + and cu.`poins` = #{poins} + + + + and cu.`tag_id` = #{tagId} + + + + and cu.`create_date` = #{createDate} + + + + and cu.`update_date` = #{updateDate} + + + + and `name` like concat('%', #{name},'%') + + + and cu.`create_date` between #{startTime} and #{endTime} + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + +