|
|
@@ -2,7 +2,9 @@ package com.qdport.controller;
|
|
|
|
|
|
import com.qdport.entity.PolicyStrive;
|
|
|
import com.qdport.enums.QDPortEnum;
|
|
|
+import com.qdport.modules.system.entity.SysDept;
|
|
|
import com.qdport.modules.system.entity.SysUser;
|
|
|
+import com.qdport.modules.system.service.SysDeptService;
|
|
|
import com.qdport.modules.system.service.TSysUserService;
|
|
|
import com.qdport.service.PolicyFileService;
|
|
|
import com.qdport.service.PolicyStriveService;
|
|
|
@@ -46,15 +48,13 @@ public class PolicyCaseController extends QdportController {
|
|
|
@Resource
|
|
|
private PolicyCaseService policyCaseService;
|
|
|
@Resource
|
|
|
- private TSysUserService sysUserService;
|
|
|
- @Resource
|
|
|
- private PolicySystemService policySystemService;
|
|
|
- @Resource
|
|
|
private PolicyFileService policyFileService;
|
|
|
@Resource
|
|
|
private PolicyTodoService policyTodoService;
|
|
|
@Resource
|
|
|
private PolicyStriveService policyStriveService;
|
|
|
+ @Resource
|
|
|
+ private SysDeptService sysDeptService;
|
|
|
|
|
|
/**
|
|
|
* 分页
|
|
|
@@ -65,10 +65,6 @@ public class PolicyCaseController extends QdportController {
|
|
|
IPage<PolicyCaseVO> page = policyCaseService.page(query);
|
|
|
List<PolicyCaseVO> records = page.getRecords();
|
|
|
for (PolicyCaseVO model : records) {
|
|
|
- SysUser createUser = sysUserService.getById(model.getCreateId());
|
|
|
- Map<String, String> resultMap = policySystemService.getDeptNameAndCompanyName(createUser.getDeptId());
|
|
|
- model.setDeptName(resultMap.get("deptName"));
|
|
|
- model.setCompanyName(resultMap.get("companyName"));
|
|
|
|
|
|
List<PolicyFileVO> fileList = policyFileService.getFileList(model.getId().toString(), QDPortEnum.POLICY_FILE_REFTYPE_POLICY_STRIVE.getValue());
|
|
|
model.setFileList(fileList);
|
|
|
@@ -77,10 +73,11 @@ public class PolicyCaseController extends QdportController {
|
|
|
if (StringUtil.isNotEmpty(strive)) {
|
|
|
PolicyStriveVO striveVO = new PolicyStriveVO();
|
|
|
BeanUtils.copyProperties(strive, striveVO);
|
|
|
- createUser = sysUserService.getById(strive.getCreateId());
|
|
|
- resultMap = policySystemService.getDeptNameAndCompanyName(createUser.getDeptId());
|
|
|
- striveVO.setDeptName(resultMap.get("deptName"));
|
|
|
- striveVO.setCompanyName(resultMap.get("companyName"));
|
|
|
+ SysDept dept = sysDeptService.getById(striveVO.getDeptId());
|
|
|
+ striveVO.setDeptName(dept.getName());
|
|
|
+ SysDept company = sysDeptService.getById(striveVO.getCompanyId());
|
|
|
+ striveVO.setCompanyName(company.getName());
|
|
|
+
|
|
|
model.setPolicyStrive(striveVO);
|
|
|
}
|
|
|
}
|
|
|
@@ -97,21 +94,15 @@ public class PolicyCaseController extends QdportController {
|
|
|
PolicyCase entity = policyCaseService.getById(id);
|
|
|
PolicyCaseVO vo = PolicyCaseWrapper.build().entityVO(entity);
|
|
|
|
|
|
- SysUser createUser = sysUserService.getById(entity.getCreateId());
|
|
|
- Map<String, String> resultMap = policySystemService.getDeptNameAndCompanyName(createUser.getDeptId());
|
|
|
- vo.setDeptName(resultMap.get("deptName"));
|
|
|
- vo.setCompanyName(resultMap.get("companyName"));
|
|
|
-
|
|
|
PolicyStrive strive = policyStriveService.getById(entity.getStriveId());
|
|
|
PolicyStriveVO striveVO = new PolicyStriveVO();
|
|
|
BeanUtils.copyProperties(strive, striveVO);
|
|
|
- createUser = sysUserService.getById(strive.getCreateId());
|
|
|
- resultMap = policySystemService.getDeptNameAndCompanyName(createUser.getDeptId());
|
|
|
- striveVO.setDeptName(resultMap.get("deptName"));
|
|
|
- striveVO.setCompanyName(resultMap.get("companyName"));
|
|
|
-
|
|
|
+ SysDept dept = sysDeptService.getById(striveVO.getDeptId());
|
|
|
+ striveVO.setDeptName(dept.getName());
|
|
|
+ SysDept company = sysDeptService.getById(striveVO.getCompanyId());
|
|
|
+ striveVO.setCompanyName(company.getName());
|
|
|
|
|
|
- List<PolicyFileVO> fileList = policyFileService.getFileList(strive.getId().toString(), QDPortEnum.POLICY_FILE_REFTYPE_POLICY_STRIVE.getValue());
|
|
|
+ List<PolicyFileVO> fileList = policyFileService.getFileList(strive.getId(), QDPortEnum.POLICY_FILE_REFTYPE_POLICY_STRIVE.getValue());
|
|
|
striveVO.setFileList(fileList);
|
|
|
vo.setPolicyStrive(striveVO);
|
|
|
return R.data(vo);
|