Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage
This commit is contained in:
+3
-1
@@ -162,7 +162,9 @@ public class LawsMonthlyReportWriteEO implements Serializable {
|
|||||||
/**法规联系人*/
|
/**法规联系人*/
|
||||||
@Excel(name = "法规联系人", width = 15)
|
@Excel(name = "法规联系人", width = 15)
|
||||||
@ApiModelProperty(value = "法规联系人")
|
@ApiModelProperty(value = "法规联系人")
|
||||||
private java.lang.String lawsContact;
|
private java.lang.String lawsContact;//存id
|
||||||
|
@TableField(exist = false)
|
||||||
|
private java.lang.String lawsContactName;//存用户名
|
||||||
|
|
||||||
/**链接*/
|
/**链接*/
|
||||||
@Excel(name = "链接", width = 15)
|
@Excel(name = "链接", width = 15)
|
||||||
|
|||||||
+39
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.report.service.impl;
|
package com.jero.modules.report.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.ZipUtil;
|
import cn.hutool.core.util.ZipUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.aliyuncs.utils.IOUtils;
|
import com.aliyuncs.utils.IOUtils;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -289,6 +290,24 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
|||||||
Page<LawsMonthlyReportWriteEO> pageInfo = this.page(page, queryWrapper);
|
Page<LawsMonthlyReportWriteEO> pageInfo = this.page(page, queryWrapper);
|
||||||
//法规月报id
|
//法规月报id
|
||||||
List<String> lawsMonthlyReportIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getId).collect(Collectors.toList());
|
List<String> lawsMonthlyReportIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getId).collect(Collectors.toList());
|
||||||
|
List<String> userIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getLawsContact).collect(Collectors.toList());
|
||||||
|
List<String> userIds = new ArrayList<>();
|
||||||
|
for (String s : userIdList) {
|
||||||
|
if(StringUtils.isNotBlank(s)){
|
||||||
|
if(s.contains(",")){
|
||||||
|
userIds.addAll(Arrays.asList(s.split(",")));
|
||||||
|
}else{
|
||||||
|
userIds.add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<JSONObject> jsonObjects = sysBaseApi.queryUsersByIds(StringUtils.join(userIds, ","));
|
||||||
|
List<LoginUser> userList = new ArrayList<>();
|
||||||
|
for (JSONObject jsonObject : jsonObjects) {
|
||||||
|
LoginUser loginUser = JSONObject.parseObject(jsonObject.toJSONString(), LoginUser.class);
|
||||||
|
userList.add(loginUser);
|
||||||
|
}
|
||||||
|
|
||||||
//获取章节目录
|
//获取章节目录
|
||||||
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOList = lawsMonthlyReportTitleTemplateEOService.list();
|
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOList = lawsMonthlyReportTitleTemplateEOService.list();
|
||||||
|
|
||||||
@@ -311,6 +330,8 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
|||||||
|
|
||||||
|
|
||||||
for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : pageInfo.getRecords()) {
|
for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : pageInfo.getRecords()) {
|
||||||
|
//处理法规联系人
|
||||||
|
lawsContact(userList, lawsMonthlyReportWriteEO);
|
||||||
//处理章节目录
|
//处理章节目录
|
||||||
if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getMemoriesChapter())){
|
if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getMemoriesChapter())){
|
||||||
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOList.stream()
|
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOList.stream()
|
||||||
@@ -356,6 +377,24 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
|||||||
return pageInfo;
|
return pageInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void lawsContact(List<LoginUser> userList, LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) {
|
||||||
|
String lawsContact = lawsMonthlyReportWriteEO.getLawsContact();
|
||||||
|
if(StringUtils.isNotBlank(lawsContact)){
|
||||||
|
List<LoginUser> collect = userList.stream().filter(e -> lawsContact.contains(e.getId())).collect(Collectors.toList());
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (String s : lawsContact.split(",")) {
|
||||||
|
List<LoginUser> loginUserList = collect.stream().filter(e -> e.getId().equals(s)).collect(Collectors.toList());
|
||||||
|
if(loginUserList.size() != 0){
|
||||||
|
sb.append(loginUserList.get(0).getUsername()+",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(sb)){
|
||||||
|
String substring = sb.substring(0, sb.length() - 1);
|
||||||
|
lawsMonthlyReportWriteEO.setLawsContactName(substring);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exportMonthlyReport(HttpServletResponse response,
|
public void exportMonthlyReport(HttpServletResponse response,
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
|
|||||||
Reference in New Issue
Block a user