|
@@ -10,22 +10,26 @@ import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
import com.fs.company.service.impl.CompanyDeptServiceImpl;
|
|
import com.fs.company.service.impl.CompanyDeptServiceImpl;
|
|
|
|
|
+import com.fs.company.service.impl.CompanyUserServiceImpl;
|
|
|
|
|
+import com.fs.company.vo.DocCompanyUserVO;
|
|
|
import com.fs.framework.security.LoginUser;
|
|
import com.fs.framework.security.LoginUser;
|
|
|
import com.fs.framework.service.TokenService;
|
|
import com.fs.framework.service.TokenService;
|
|
|
|
|
+import com.fs.qw.service.IQwUserService;
|
|
|
import com.fs.qw.vo.SortDayVo;
|
|
import com.fs.qw.vo.SortDayVo;
|
|
|
|
|
+import com.fs.sop.domain.QwSop;
|
|
|
import com.fs.sop.domain.QwSopTemp;
|
|
import com.fs.sop.domain.QwSopTemp;
|
|
|
import com.fs.sop.domain.QwSopTempDay;
|
|
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,10 +47,16 @@ public class QwSopTempController extends BaseController
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IQwUserService iQwUserService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CompanyDeptServiceImpl companyDeptService;
|
|
private CompanyDeptServiceImpl companyDeptService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CompanyUserServiceImpl companyUserService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询sop模板列表
|
|
* 查询sop模板列表
|
|
|
*/
|
|
*/
|
|
@@ -58,8 +68,37 @@ public class QwSopTempController extends BaseController
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
qwSopTemp.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
qwSopTemp.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
|
|
|
-// 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(StringUtil::strIsNullOrEmpty)
|
|
|
|
|
+ .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);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -90,7 +129,6 @@ public class QwSopTempController extends BaseController
|
|
|
qwSopTemp.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
qwSopTemp.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
qwSopTemp.setCreateBy(String.valueOf(loginUser.getUser().getUserId()));
|
|
qwSopTemp.setCreateBy(String.valueOf(loginUser.getUser().getUserId()));
|
|
|
startPage();
|
|
startPage();
|
|
|
-// List<QwSopTemp> list = qwSopTempService.selectQwSopTempList(qwSopTemp);
|
|
|
|
|
List<QwSopTemp> list = qwSopTempService.selectQwSopTempListNew(qwSopTemp);
|
|
List<QwSopTemp> list = qwSopTempService.selectQwSopTempListNew(qwSopTemp);
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
|
}
|
|
}
|
|
@@ -118,7 +156,13 @@ public class QwSopTempController extends BaseController
|
|
|
if (!deptList.isEmpty()){
|
|
if (!deptList.isEmpty()){
|
|
|
combinedDpetList.addAll(deptList);
|
|
combinedDpetList.addAll(deptList);
|
|
|
}
|
|
}
|
|
|
- qwSopTemp.setCuDeptIdList(combinedDpetList);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ List<Long> userIds = companyUserService.selectCompanyQwUserByDept(combinedDpetList, loginUser.getUser().getUserType());
|
|
|
|
|
+ if (userIds.isEmpty()){
|
|
|
|
|
+ return getDataTable(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ qwSopTemp.setUserIds(userIds);
|
|
|
|
|
|
|
|
startPage();
|
|
startPage();
|
|
|
// List<QwSopTemp> list = qwSopTempService.selectQwSopTempList(qwSopTemp);
|
|
// List<QwSopTemp> list = qwSopTempService.selectQwSopTempList(qwSopTemp);
|
|
@@ -236,6 +280,8 @@ public class QwSopTempController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('qw:sopTemp:edit') or @ss.hasPermi('qw:sopTemp:myEdit') or @ss.hasPermi('qw:sopTemp:deptEdit')")
|
|
@PreAuthorize("@ss.hasPermi('qw:sopTemp:edit') or @ss.hasPermi('qw:sopTemp:myEdit') or @ss.hasPermi('qw:sopTemp:deptEdit')")
|
|
|
@PostMapping("/copyTemplate")
|
|
@PostMapping("/copyTemplate")
|
|
|
public AjaxResult copyTemplate(@RequestBody QwSopTemp qwSopTemp){
|
|
public AjaxResult copyTemplate(@RequestBody QwSopTemp qwSopTemp){
|
|
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
+ qwSopTemp.setCreateBy(loginUser.getUser().getUserId().toString());
|
|
|
qwSopTempService.copyTemplate(qwSopTemp);
|
|
qwSopTempService.copyTemplate(qwSopTemp);
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
|
}
|
|
}
|