|
@@ -12,6 +12,8 @@ import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.common.utils.TimeUtils;
|
|
import com.fs.common.utils.TimeUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
|
|
+import com.fs.company.service.impl.CompanyUserServiceImpl;
|
|
|
|
|
+import com.fs.company.vo.DocCompanyUserVO;
|
|
|
import com.fs.framework.web.service.TokenService;
|
|
import com.fs.framework.web.service.TokenService;
|
|
|
import com.fs.qw.vo.SortDayVo;
|
|
import com.fs.qw.vo.SortDayVo;
|
|
|
import com.fs.sop.domain.QwSopTemp;
|
|
import com.fs.sop.domain.QwSopTemp;
|
|
@@ -19,14 +21,14 @@ import com.fs.sop.domain.QwSopTempDay;
|
|
|
import com.fs.sop.params.QwSopShareTempParam;
|
|
import com.fs.sop.params.QwSopShareTempParam;
|
|
|
import com.fs.sop.service.IQwSopTempService;
|
|
import com.fs.sop.service.IQwSopTempService;
|
|
|
import com.fs.sop.vo.UpdateRedVo;
|
|
import com.fs.sop.vo.UpdateRedVo;
|
|
|
|
|
+import com.fs.voice.utils.StringUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
-import java.util.Date;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -43,6 +45,8 @@ public class QwSopTempController extends BaseController
|
|
|
private IQwSopTempService qwSopTempService;
|
|
private IQwSopTempService qwSopTempService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CompanyUserServiceImpl companyUserService;
|
|
|
/**
|
|
/**
|
|
|
* 查询sop模板列表
|
|
* 查询sop模板列表
|
|
|
*/
|
|
*/
|
|
@@ -53,6 +57,34 @@ public class QwSopTempController extends BaseController
|
|
|
startPage();
|
|
startPage();
|
|
|
// List<QwSopTemp> list = qwSopTempService.selectQwSopTempList(qwSopTemp);
|
|
// List<QwSopTemp> list = qwSopTempService.selectQwSopTempList(qwSopTemp);
|
|
|
List<QwSopTemp> list = qwSopTempService.selectQwSopTempListNew(qwSopTemp);
|
|
List<QwSopTemp> list = qwSopTempService.selectQwSopTempListNew(qwSopTemp);
|
|
|
|
|
+ // 收集所有需要查询的用户ID
|
|
|
|
|
+ Set<Long> userIds = list.stream()
|
|
|
|
|
+ .map(QwSopTemp::getCreateBy)
|
|
|
|
|
+ .filter(str -> !StringUtil.strIsNullOrEmpty(str)) // 取反,保留非空值
|
|
|
|
|
+ .map(Long::valueOf)
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
|
|
+
|
|
|
|
|
+ if (!userIds.isEmpty()){
|
|
|
|
|
+ // 批量查询用户信息
|
|
|
|
|
+ Map<Long, DocCompanyUserVO> userMap = companyUserService
|
|
|
|
|
+ .selectDocCompanyUserListByUserIds(userIds)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .collect(Collectors.toMap(DocCompanyUserVO::getUserId, Function.identity()));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ list.forEach(item->{
|
|
|
|
|
+
|
|
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(item.getCreateBy())) {
|
|
|
|
|
+ DocCompanyUserVO user = userMap.get(Long.valueOf(item.getCreateBy()));
|
|
|
|
|
+ if (user != null) {
|
|
|
|
|
+ item.setCreateByName(user.getNickName());
|
|
|
|
|
+ item.setCreateByDeptName(user.getDeptName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
|
}
|
|
}
|
|
|
|
|
|