ソースを参照

[需求][新增]:解决会员导出标签问题

release_toaliyun_real
hupeng 7年前
コミット
e9cd5c0024
5個のファイルの変更18行の追加4行の削除
  1. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxTagsMapper.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  4. +11
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java
  5. +3
    -0
      mallinkService/src/main/resources/mapper/WxTagsMapper.xml

+ 1
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java ファイルの表示

@@ -116,7 +116,7 @@ public class WxCUserBasicInfo implements Serializable {




@Transient @Transient
@Excel(name="标签",width = 20,orderNum = "10")
@Excel(name="标签",width = 50,orderNum = "10")
private String tagNames; private String tagNames;






+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxTagsMapper.java ファイルの表示

@@ -4,9 +4,11 @@ import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxTags; import com.iformall.domain.po.WxTags;


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


public interface WxTagsMapper extends CommonMapper<WxTags, String> { public interface WxTagsMapper extends CommonMapper<WxTags, String> {


List<WxTags> findList(WxTags wxTags); List<WxTags> findList(WxTags wxTags);
List<WxTags> findListAll();
List<WxTags> getByName(String name); List<WxTags> getByName(String name);
} }

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java ファイルの表示

@@ -207,7 +207,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
WxBillAllVo first = ((List<WxBillAllVo>)(entry.getValue())).get(0); WxBillAllVo first = ((List<WxBillAllVo>)(entry.getValue())).get(0);
deptExportParams.setSheetName(first.getMerchantName()); deptExportParams.setSheetName(first.getMerchantName());
deptExportParams.setTitle(first.getMerchantName() deptExportParams.setTitle(first.getMerchantName()
+ "("
+ " ("
+ EnumRentShopType.getEnum((Integer)first.getRentShopType()).getMessage() + EnumRentShopType.getEnum((Integer)first.getRentShopType()).getMessage()
+ "-"+first.getShopNumber() + "-"+first.getShopNumber()
+ ")"); + ")");


+ 11
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java ファイルの表示

@@ -1,5 +1,6 @@
package com.iformall.service.impl; package com.iformall.service.impl;


import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;


@@ -33,6 +34,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;


@Service @Service
public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
@@ -148,6 +150,14 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {


public void exportData(WxCUserBasicInfo basicInfo, HttpServletRequest request, HttpServletResponse response) { public void exportData(WxCUserBasicInfo basicInfo, HttpServletRequest request, HttpServletResponse response) {
List<WxCUserBasicInfoVo> list = wxCUserBasicInfoMapper.findVoList(basicInfo); List<WxCUserBasicInfoVo> list = wxCUserBasicInfoMapper.findVoList(basicInfo);
List<WxTags> tagList = wxTagsMapper.findListAll();
Map<Long, String> tagMap = tagList.stream().collect(Collectors.toMap(WxTags::getId, WxTags::getName));
list.stream().filter(u->u.getTags()!=null).forEach(u->{
logger.debug("$$$$$ID:" + u.getId().toString());
List<Long> ids = JSONObject.parseArray(u.getTags(), Long.class);
String tagNames = StringUtils.join(ids.stream().map(id->tagMap.get(id)).collect(Collectors.toList()),"/");
u.setTagNames(tagNames);
});
excelService.exportExcel(list,null,"会员信息",WxCUserBasicInfoVo.class,"会员信息数据.xls",response); excelService.exportExcel(list,null,"会员信息",WxCUserBasicInfoVo.class,"会员信息数据.xls",response);
} }
/* /*
@@ -166,8 +176,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {


SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");


WxTags wxTagsQ = new WxTags();
List<WxTags> tagList = wxTagsMapper.findList(wxTagsQ);



List<Long> tagIdList = new ArrayList<Long>(); List<Long> tagIdList = new ArrayList<Long>();




+ 3
- 0
mallinkService/src/main/resources/mapper/WxTagsMapper.xml ファイルの表示

@@ -64,4 +64,7 @@
and `name` = #{name} and `name` = #{name}
</if> </if>
</select> </select>
<select id="findListAll" resultMap="BaseResultMap">
select id,name from wx_tags
</select>
</mapper> </mapper>

読み込み中…
キャンセル
保存