|
|
|
@@ -29,6 +29,7 @@ import org.springframework.web.multipart.MultipartFile; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.*; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
@@ -117,40 +118,62 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { |
|
|
|
} |
|
|
|
String filename = UUID.randomUUID() + ".xlsx"; |
|
|
|
filepath = filepath + filename; |
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
|
|
try { |
|
|
|
File file = new File(filepath); |
|
|
|
workbook = new XSSFWorkbook(); |
|
|
|
XSSFSheet sheetTwo = workbook.createSheet("会员信息"); |
|
|
|
Row rowtwo = sheetTwo.createRow(0); |
|
|
|
Cell nameCellTwo = rowtwo.createCell(0); |
|
|
|
Cell phoneCellTwo = rowtwo.createCell(1); |
|
|
|
Cell sexCellTwo = rowtwo.createCell(2); |
|
|
|
Cell birthdateCellTwo = rowtwo.createCell(3); |
|
|
|
Cell sexCellTwo = rowtwo.createCell(1); |
|
|
|
Cell phoneCellTwo = rowtwo.createCell(2); |
|
|
|
Cell nickNameCellTwo = rowtwo.createCell(3); |
|
|
|
Cell educationCellTwo = rowtwo.createCell(4); |
|
|
|
|
|
|
|
Cell birthdateCellTwo = rowtwo.createCell(5); |
|
|
|
Cell addrCellTwo = rowtwo.createCell(6); |
|
|
|
Cell updateDateCellTwo = rowtwo.createCell(7); |
|
|
|
Cell createDateCellTwo = rowtwo.createCell(8); |
|
|
|
|
|
|
|
nameCellTwo.setCellValue("姓名"); |
|
|
|
phoneCellTwo.setCellValue("手机"); |
|
|
|
sexCellTwo.setCellValue("性别"); |
|
|
|
birthdateCellTwo.setCellValue("生日"); |
|
|
|
phoneCellTwo.setCellValue("手机号"); |
|
|
|
nickNameCellTwo.setCellValue("微信昵称"); |
|
|
|
educationCellTwo.setCellValue("学历"); |
|
|
|
|
|
|
|
birthdateCellTwo.setCellValue("生日"); |
|
|
|
addrCellTwo.setCellValue("地址"); |
|
|
|
updateDateCellTwo.setCellValue("上次活跃时间"); |
|
|
|
createDateCellTwo.setCellValue("注册时间"); |
|
|
|
|
|
|
|
for (int i = 0; i < memberlist.size(); i++) { |
|
|
|
rowtwo = sheetTwo.createRow(i + 1); |
|
|
|
nameCellTwo = rowtwo.createCell(0); |
|
|
|
phoneCellTwo = rowtwo.createCell(1); |
|
|
|
sexCellTwo = rowtwo.createCell(2); |
|
|
|
birthdateCellTwo = rowtwo.createCell(3); |
|
|
|
sexCellTwo = rowtwo.createCell(1); |
|
|
|
phoneCellTwo = rowtwo.createCell(2); |
|
|
|
nickNameCellTwo = rowtwo.createCell(3); |
|
|
|
educationCellTwo = rowtwo.createCell(4); |
|
|
|
birthdateCellTwo = rowtwo.createCell(5); |
|
|
|
addrCellTwo = rowtwo.createCell(6); |
|
|
|
updateDateCellTwo = rowtwo.createCell(7); |
|
|
|
createDateCellTwo = rowtwo.createCell(8); |
|
|
|
|
|
|
|
WxCUserBasicInfo entity = memberlist.get(i); |
|
|
|
|
|
|
|
String sexStr = "保密"; |
|
|
|
if (entity.getSex() == 1) |
|
|
|
sexStr = "男"; |
|
|
|
else if (entity.getSex() == 2) |
|
|
|
sexStr = "女"; |
|
|
|
nameCellTwo.setCellValue(entity.getName()); |
|
|
|
sexCellTwo.setCellValue(sexStr); |
|
|
|
phoneCellTwo.setCellValue(entity.getPhone()); |
|
|
|
sexCellTwo.setCellValue(entity.getSex()); |
|
|
|
birthdateCellTwo.setCellValue(entity.getBirthdate()); |
|
|
|
nickNameCellTwo.setCellValue(entity.getNickName()); |
|
|
|
educationCellTwo.setCellValue(entity.getEducation()); |
|
|
|
birthdateCellTwo.setCellValue(entity.getBirthdate()); |
|
|
|
addrCellTwo.setCellValue(entity.getAddress()); |
|
|
|
updateDateCellTwo.setCellValue(sdf.format(entity.getUpdateDate())); |
|
|
|
createDateCellTwo.setCellValue(sdf.format(entity.getCreateDate())); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@@ -212,17 +235,26 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { |
|
|
|
|
|
|
|
XSSFSheet sheetTwo = workbook.createSheet("会员信息"); |
|
|
|
Row rowtwo = sheetTwo.createRow(0); |
|
|
|
|
|
|
|
Cell nameCellTwo = rowtwo.createCell(0); |
|
|
|
Cell phoneCellTwo = rowtwo.createCell(1); |
|
|
|
Cell sexCellTwo = rowtwo.createCell(2); |
|
|
|
Cell birthdateCellTwo = rowtwo.createCell(3); |
|
|
|
Cell sexCellTwo = rowtwo.createCell(1); |
|
|
|
Cell phoneCellTwo = rowtwo.createCell(2); |
|
|
|
Cell nickNameCellTwo = rowtwo.createCell(3); |
|
|
|
Cell educationCellTwo = rowtwo.createCell(4); |
|
|
|
Cell birthdateCellTwo = rowtwo.createCell(5); |
|
|
|
Cell addrCellTwo = rowtwo.createCell(6); |
|
|
|
Cell updateDateCellTwo = rowtwo.createCell(7); |
|
|
|
Cell createDateCellTwo = rowtwo.createCell(8); |
|
|
|
|
|
|
|
nameCellTwo.setCellValue("姓名"); |
|
|
|
phoneCellTwo.setCellValue("手机"); |
|
|
|
sexCellTwo.setCellValue("性别"); |
|
|
|
birthdateCellTwo.setCellValue("生日"); |
|
|
|
phoneCellTwo.setCellValue("手机号"); |
|
|
|
nickNameCellTwo.setCellValue("微信昵称"); |
|
|
|
educationCellTwo.setCellValue("学历"); |
|
|
|
birthdateCellTwo.setCellValue("生日"); |
|
|
|
addrCellTwo.setCellValue("地址"); |
|
|
|
updateDateCellTwo.setCellValue("上次活跃时间"); |
|
|
|
createDateCellTwo.setCellValue("注册时间"); |
|
|
|
|
|
|
|
FileOutputStream fileOut = new FileOutputStream(file); |
|
|
|
workbook.write(fileOut); |
|
|
|
@@ -260,16 +292,17 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { |
|
|
|
|
|
|
|
if (oldUserBase != null) { |
|
|
|
oldUserBase.setTenantId(tenantId); |
|
|
|
oldUserBase.setName(userBase.getName()); |
|
|
|
oldUserBase.setSex(userBase.getSex()); |
|
|
|
oldUserBase.setNickName(userBase.getNickName()); |
|
|
|
oldUserBase.setEducation(userBase.getEducation()); |
|
|
|
oldUserBase.setBirthdate(userBase.getBirthdate()); |
|
|
|
oldUserBase.setName(userBase.getName()); |
|
|
|
oldUserBase.setUpdateDate(curDate); |
|
|
|
oldUserBase.setAddress(userBase.getAddress()); |
|
|
|
oldUserBase.setUpdateDate(userBase.getUpdateDate()); |
|
|
|
oldUserBase.setCreateDate(userBase.getCreateDate()); |
|
|
|
} else { |
|
|
|
userBase.setId(idWorker.nextId()); |
|
|
|
userBase.setTenantId(tenantId); |
|
|
|
userBase.setCreateDate(curDate); |
|
|
|
userBase.setUpdateDate(curDate); |
|
|
|
} |
|
|
|
|
|
|
|
// update 昵称 |
|
|
|
|