Browse Source

[成长值导入导出][修改]

release_toaliyun_real
Stormeye Wu 7 years ago
parent
commit
9ae7224a1b
2 changed files with 27 additions and 1 deletions
  1. +12
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/CUserBaseInfoT.java
  2. +15
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java

+ 12
- 0
mallinkService/src/main/java/com/iformall/domain/vo/CUserBaseInfoT.java View File

@@ -51,6 +51,10 @@ public class CUserBaseInfoT implements Serializable {
@Excel(name="标签",width = 20,orderNum = "10") @Excel(name="标签",width = 20,orderNum = "10")
private String tagNames; private String tagNames;


@Transient
@Excel(name="成长值",width = 20,orderNum = "11")
private Integer poins;

public String getName() { public String getName() {
return name; return name;
} }
@@ -130,4 +134,12 @@ public class CUserBaseInfoT implements Serializable {
public void setTagNames(String tagNames) { public void setTagNames(String tagNames) {
this.tagNames = tagNames; this.tagNames = tagNames;
} }

public Integer getPoins() {
return poins;
}

public void setPoins(Integer poins) {
this.poins = poins;
}
} }

+ 15
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java View File

@@ -179,6 +179,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
Cell updateDateCellTwo = rowtwo.createCell(7); Cell updateDateCellTwo = rowtwo.createCell(7);
Cell createDateCellTwo = rowtwo.createCell(8); Cell createDateCellTwo = rowtwo.createCell(8);
Cell tagCellTwo = rowtwo.createCell(9); Cell tagCellTwo = rowtwo.createCell(9);
Cell scoreCellTwo = rowtwo.createCell(10);


nameCellTwo.setCellValue("姓名"); nameCellTwo.setCellValue("姓名");
sexCellTwo.setCellValue("性别"); sexCellTwo.setCellValue("性别");
@@ -190,6 +191,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
updateDateCellTwo.setCellValue("上次活跃时间"); updateDateCellTwo.setCellValue("上次活跃时间");
createDateCellTwo.setCellValue("注册时间"); createDateCellTwo.setCellValue("注册时间");
tagCellTwo.setCellValue("标签"); tagCellTwo.setCellValue("标签");
scoreCellTwo.setCellValue("成长值");


for (int i = 0; i < memberlist.size(); i++) { for (int i = 0; i < memberlist.size(); i++) {
rowtwo = sheetTwo.createRow(i + 1); rowtwo = sheetTwo.createRow(i + 1);
@@ -203,6 +205,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
updateDateCellTwo = rowtwo.createCell(7); updateDateCellTwo = rowtwo.createCell(7);
createDateCellTwo = rowtwo.createCell(8); createDateCellTwo = rowtwo.createCell(8);
tagCellTwo = rowtwo.createCell(9); tagCellTwo = rowtwo.createCell(9);
scoreCellTwo = rowtwo.createCell(10);


WxCUserBasicInfo entity = memberlist.get(i); WxCUserBasicInfo entity = memberlist.get(i);


@@ -249,6 +252,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
} }
} }
} }
// 成长值
scoreCellTwo.setCellValue(entity.getPoins());
} }




@@ -322,6 +327,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
Cell updateDateCellTwo = rowtwo.createCell(7); Cell updateDateCellTwo = rowtwo.createCell(7);
Cell createDateCellTwo = rowtwo.createCell(8); Cell createDateCellTwo = rowtwo.createCell(8);
Cell tagCellTwo = rowtwo.createCell(9); Cell tagCellTwo = rowtwo.createCell(9);
Cell scoreCellTwo = rowtwo.createCell(10);


nameCellTwo.setCellValue("姓名"); nameCellTwo.setCellValue("姓名");
sexCellTwo.setCellValue("性别"); sexCellTwo.setCellValue("性别");
@@ -333,6 +339,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
updateDateCellTwo.setCellValue("上次活跃时间"); updateDateCellTwo.setCellValue("上次活跃时间");
createDateCellTwo.setCellValue("注册时间"); createDateCellTwo.setCellValue("注册时间");
tagCellTwo.setCellValue("标签"); tagCellTwo.setCellValue("标签");
scoreCellTwo.setCellValue("成长值");
{ {
rowtwo = sheetTwo.createRow(1); rowtwo = sheetTwo.createRow(1);
nameCellTwo = rowtwo.createCell(0); nameCellTwo = rowtwo.createCell(0);
@@ -345,6 +352,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
updateDateCellTwo = rowtwo.createCell(7); updateDateCellTwo = rowtwo.createCell(7);
createDateCellTwo = rowtwo.createCell(8); createDateCellTwo = rowtwo.createCell(8);
tagCellTwo = rowtwo.createCell(9); tagCellTwo = rowtwo.createCell(9);
scoreCellTwo = rowtwo.createCell(10);
nameCellTwo.setCellValue("例子1"); nameCellTwo.setCellValue("例子1");
sexCellTwo.setCellValue("保密"); sexCellTwo.setCellValue("保密");
phoneCellTwo.setCellValue("13900010001"); phoneCellTwo.setCellValue("13900010001");
@@ -355,6 +363,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
updateDateCellTwo.setCellValue("2018-08-10"); updateDateCellTwo.setCellValue("2018-08-10");
createDateCellTwo.setCellValue("2018-08-10"); createDateCellTwo.setCellValue("2018-08-10");
tagCellTwo.setCellValue("附近住户"); tagCellTwo.setCellValue("附近住户");
scoreCellTwo.setCellValue(100);
} }
{ {
rowtwo = sheetTwo.createRow(2); rowtwo = sheetTwo.createRow(2);
@@ -378,6 +387,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
updateDateCellTwo.setCellValue("2018-08-10"); updateDateCellTwo.setCellValue("2018-08-10");
createDateCellTwo.setCellValue("2018-08-10"); createDateCellTwo.setCellValue("2018-08-10");
tagCellTwo.setCellValue("男/附近住户"); tagCellTwo.setCellValue("男/附近住户");
scoreCellTwo.setCellValue(200);
} }
{ {
rowtwo = sheetTwo.createRow(3); rowtwo = sheetTwo.createRow(3);
@@ -401,6 +411,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
updateDateCellTwo.setCellValue("2018-08-10"); updateDateCellTwo.setCellValue("2018-08-10");
createDateCellTwo.setCellValue("2018-08-10"); createDateCellTwo.setCellValue("2018-08-10");
tagCellTwo.setCellValue("女/附近住户"); tagCellTwo.setCellValue("女/附近住户");
scoreCellTwo.setCellValue(110);
} }


FileOutputStream fileOut = new FileOutputStream(file); FileOutputStream fileOut = new FileOutputStream(file);
@@ -485,6 +496,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {


userBase.setTagNames(uBase.getTagNames()); userBase.setTagNames(uBase.getTagNames());


userBase.setPoins(uBase.getPoins());

return userBase; return userBase;
} }


@@ -498,7 +511,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {


ImportParams params = new ImportParams(); ImportParams params = new ImportParams();
IExcelDataHandler<CUserBaseInfoT> handler = new UserExcelHandler(); IExcelDataHandler<CUserBaseInfoT> handler = new UserExcelHandler();
handler.setNeedHandlerFields(new String[]{"姓名", "性别", "手机号", "微信昵称", "学历", "生日", "地址", "上次活跃时间", "注册时间", "标签"});// 注意这里对应的是excel的列名。也就是对象上指定的列名。
handler.setNeedHandlerFields(new String[]{"姓名", "性别", "手机号", "微信昵称", "学历", "生日", "地址", "上次活跃时间", "注册时间", "标签", "成长值"});// 注意这里对应的是excel的列名。也就是对象上指定的列名。
params.setDataHandler(handler); params.setDataHandler(handler);
//params.setVerifyHandler(); //params.setVerifyHandler();
// 需要验证 // 需要验证
@@ -541,6 +554,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
oldUserBase.setBirthdate(userBase.getBirthdate()); oldUserBase.setBirthdate(userBase.getBirthdate());
oldUserBase.setAddress(userBase.getAddress()); oldUserBase.setAddress(userBase.getAddress());
oldUserBase.setUpdateDate(new Date()); oldUserBase.setUpdateDate(new Date());
oldUserBase.setPoins(userBase.getPoins());
oldUserBase.setCreateDate(userBase.getCreateDate()); oldUserBase.setCreateDate(userBase.getCreateDate());
} else { } else {
// check c_user 是否存在 // check c_user 是否存在


Loading…
Cancel
Save