|
|
@@ -3,6 +3,7 @@ package com.ruoyi.project.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.enums.UserRolesType;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
@@ -23,6 +24,7 @@ import com.ruoyi.project.mapper.ProjectStaffMapper;
|
|
|
import com.ruoyi.project.mapper.ProjectStaffRecordMapper;
|
|
|
import com.ruoyi.project.mapper.ProjectTaskMapper;
|
|
|
import com.ruoyi.project.service.ProjectTaskService;
|
|
|
+import com.ruoyi.system.mapper.SysDeptMapper;
|
|
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
|
@@ -36,6 +38,7 @@ import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Validator;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
@@ -51,19 +54,21 @@ import static java.lang.Thread.sleep;
|
|
|
public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(ProjectTaskServiceImpl.class);
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ProjectTaskMapper projectTaskMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ProjectStaffMapper projectStaffMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ISysDeptService deptService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private Validator validator;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysUserMapper userMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ProjectStaffRecordMapper projectStaffRecordMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
+ private SysDeptMapper sysDeptMapper;
|
|
|
+ @Resource
|
|
|
private TianheService tianheService;
|
|
|
@Value("${ruoyi.profile}")
|
|
|
private String profile=null;
|
|
|
@@ -403,6 +408,8 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
public void saveRecordsText(Long id) throws InterruptedException {
|
|
|
ProjectStaffRecord projectStaffRecord = projectStaffRecordMapper.selectByPrimaryKey(Long.valueOf(id));
|
|
|
Map<String,Object> map=new HashMap<>();
|
|
|
@@ -549,4 +556,28 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
return address;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object getCompanyData(Integer deptId) {
|
|
|
+ //获取部门信息
|
|
|
+ SysDept sysDept = new SysDept();
|
|
|
+ sysDept.setAncestors(deptId.toString());
|
|
|
+ List<SysDept> sysDepts = sysDeptMapper.selectDeptList(sysDept);
|
|
|
+ sysDepts.stream().forEach(System.out::println);
|
|
|
+ //获取部门下的用户信息
|
|
|
+ List<SysUser> sysUsers = new ArrayList<>();
|
|
|
+ List<ProjectTask> projectTasks=new ArrayList<>();
|
|
|
+ sysDepts.stream().forEach(sysDept1 -> {
|
|
|
+ sysUsers.addAll(userMapper.selectByDeptId(sysDept1.getDeptId()));
|
|
|
+ });
|
|
|
+ sysUsers.stream().forEach(sysUser -> {
|
|
|
+ projectTasks.addAll(projectTaskMapper.selectByUserId(sysUser.getUserId()));
|
|
|
+ });
|
|
|
+ Map<String,Object> map=new HashMap();
|
|
|
+ map.put("projectTasks",projectTasks);
|
|
|
+ map.put("sysUsers",sysUsers);
|
|
|
+ map.put("sysDepts",sysDepts);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
}
|