|
|
@@ -114,12 +114,6 @@ public class WorkContactEmployeeServiceImpl extends ServiceImpl<WorkContactEmplo
|
|
|
Integer total = mapperObj.getHubListTotal(obj);
|
|
|
Map<String, Object> resMap = new HashMap<String, Object>();
|
|
|
|
|
|
- //请求typer,匹配typer标签
|
|
|
- /*if (list.size() > 0) {
|
|
|
- list = getTyperTag(list);
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
resMap.put("list", list);
|
|
|
resMap.put("total", total);
|
|
|
|
|
|
@@ -313,6 +307,56 @@ public class WorkContactEmployeeServiceImpl extends ServiceImpl<WorkContactEmplo
|
|
|
return vos;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void exportNovel(Downfile downFile, HubWorkContactEmployeeHandle handle) {
|
|
|
+
|
|
|
+ String title = Downfile.NOVEL;
|
|
|
+ List<Object> tempObj;
|
|
|
+ QueryWrapper<WorkContactEmployeeVo> obj = getHubWrapper(handle);
|
|
|
+ Integer total = mapperObj.getHubListTotal(obj);
|
|
|
+ List<WorkContactEmployeeVo> list = mapperObj.getHubVoList(obj,0,total);
|
|
|
+
|
|
|
+ //实现下载
|
|
|
+ List<List<Object>> resList = new ArrayList<List<Object>>();
|
|
|
+ Object[] head = {"id", "客户名称", "状态(1正常 2删除 3拉黑)", "平台", "ghid", "appid", "标签", "客服名称", "所属公司","备注","创建时间"};
|
|
|
+ List<Object> headList = Arrays.asList(head);
|
|
|
+ resList.add(headList);
|
|
|
+
|
|
|
+ if (list.size() >= 1) {
|
|
|
+ for (WorkContactEmployeeVo o : list) {
|
|
|
+ tempObj = new ArrayList<Object>() {//这个大括号 就相当于我们 new 接口
|
|
|
+ {//这个大括号 就是 构造代码块 会在构造函数前 调用
|
|
|
+ this.add(o.getId());
|
|
|
+ this.add(o.getClientName());
|
|
|
+ this.add(o.getClientStatus());
|
|
|
+ this.add(o.getPlatform());
|
|
|
+ this.add(o.getGhId());
|
|
|
+ this.add(o.getAppId());
|
|
|
+ this.add(o.getTyperTag());
|
|
|
+ this.add(o.getEmployeeName());
|
|
|
+ this.add(o.getCompanyName());
|
|
|
+ this.add(o.getRemark());
|
|
|
+ this.add(o.getClientCreatedAt());
|
|
|
+ }
|
|
|
+ };
|
|
|
+ resList.add(tempObj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ StringBuffer content = OssFile.createCSV(resList);
|
|
|
+
|
|
|
+ /*上传到oss*/
|
|
|
+ Date currentTime = new Date();
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ String bom = new String(new byte[] { (byte) 0xEF, (byte) 0xBB,(byte) 0xBF });
|
|
|
+ String dateString = formatter.format(currentTime);
|
|
|
+ String filePath = OSSConfiguration.DOWN_DIR + dateString + "/" + downFile.getId().toString() + "_" + title;
|
|
|
+ PutObjectRequest putObjectRequest = new PutObjectRequest(ossConfiguration.getBucketName(), filePath, new ByteArrayInputStream((bom+content.toString()).getBytes()));
|
|
|
+ ossClient.putObject(putObjectRequest);
|
|
|
+ downFile.setDownUrl(ossConfiguration.getHost() + filePath);
|
|
|
+ downFile.setStatus(1);
|
|
|
+ downfileMapper.updateById(downFile);
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public void export(Downfile downFile, GetWorkContactEmployeeHandle handle) {
|