|
@@ -7,18 +7,22 @@ import cn.cslg.pas.common.dto.business.FollowUpDTO;
|
|
import cn.cslg.pas.common.model.cronModel.Personnel;
|
|
import cn.cslg.pas.common.model.cronModel.Personnel;
|
|
import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
import cn.cslg.pas.common.model.cronModel.Records;
|
|
import cn.cslg.pas.common.model.cronModel.Records;
|
|
|
|
+import cn.cslg.pas.common.model.cronModel.SystemFile;
|
|
import cn.cslg.pas.common.model.request.GroupRequest;
|
|
import cn.cslg.pas.common.model.request.GroupRequest;
|
|
import cn.cslg.pas.common.model.request.QueryRequest;
|
|
import cn.cslg.pas.common.model.request.QueryRequest;
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
import cn.cslg.pas.common.utils.LoginUtils;
|
|
import cn.cslg.pas.common.utils.LoginUtils;
|
|
import cn.cslg.pas.common.vo.business.FollowUpVO;
|
|
import cn.cslg.pas.common.vo.business.FollowUpVO;
|
|
import cn.cslg.pas.common.vo.business.ReportProjectVO;
|
|
import cn.cslg.pas.common.vo.business.ReportProjectVO;
|
|
|
|
+import cn.cslg.pas.domain.business.AssoEventFile;
|
|
|
|
+import cn.cslg.pas.domain.business.AssoFollowUpFile;
|
|
import cn.cslg.pas.domain.business.FollowUp;
|
|
import cn.cslg.pas.domain.business.FollowUp;
|
|
import cn.cslg.pas.domain.business.RdProject;
|
|
import cn.cslg.pas.domain.business.RdProject;
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
import cn.cslg.pas.factorys.businessFactory.Business;
|
|
import cn.cslg.pas.factorys.businessFactory.Business;
|
|
import cn.cslg.pas.mapper.FollowUpMapper;
|
|
import cn.cslg.pas.mapper.FollowUpMapper;
|
|
import cn.cslg.pas.mapper.RdProjectMapper;
|
|
import cn.cslg.pas.mapper.RdProjectMapper;
|
|
|
|
+import cn.cslg.pas.service.common.FileManagerService;
|
|
import cn.cslg.pas.service.permissions.PermissionService;
|
|
import cn.cslg.pas.service.permissions.PermissionService;
|
|
import cn.cslg.pas.service.query.FormatQueryService;
|
|
import cn.cslg.pas.service.query.FormatQueryService;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -51,6 +55,10 @@ public class FollowUpService extends ServiceImpl<FollowUpMapper, FollowUp> {
|
|
private CacheUtils cacheUtils;
|
|
private CacheUtils cacheUtils;
|
|
@Autowired
|
|
@Autowired
|
|
private LoginUtils loginUtils;
|
|
private LoginUtils loginUtils;
|
|
|
|
+ @Autowired
|
|
|
|
+ private AssoFollowUpFileService assoFollowUpFileService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private FileManagerService fileManagerService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 新增后续事项
|
|
* 新增后续事项
|
|
@@ -95,7 +103,15 @@ public class FollowUpService extends ServiceImpl<FollowUpMapper, FollowUp> {
|
|
BeanUtils.copyProperties(followUpUpdateDTO, followUp);
|
|
BeanUtils.copyProperties(followUpUpdateDTO, followUp);
|
|
//根据id修改后续事项表数据
|
|
//根据id修改后续事项表数据
|
|
followUp.updateById();
|
|
followUp.updateById();
|
|
|
|
+
|
|
|
|
+ LambdaQueryWrapper<AssoFollowUpFile> removeWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ removeWrapper.eq(AssoFollowUpFile::getFollowUpId, followUp.getId());
|
|
|
|
+ assoFollowUpFileService.remove(removeWrapper);
|
|
|
|
+ //新增文件
|
|
|
|
+ assoFollowUpFileService.addBatch(followUp.getId(), followUpUpdateDTO.getFileGuids());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -143,8 +159,11 @@ public class FollowUpService extends ServiceImpl<FollowUpMapper, FollowUp> {
|
|
private List<FollowUpVO> loadFollowUps(List<FollowUp> followUps) {
|
|
private List<FollowUpVO> loadFollowUps(List<FollowUp> followUps) {
|
|
List<FollowUpVO> followUpVOS = new ArrayList<>();
|
|
List<FollowUpVO> followUpVOS = new ArrayList<>();
|
|
List<String> createIds = followUps.stream().map(FollowUp::getCreateId).collect(Collectors.toList());
|
|
List<String> createIds = followUps.stream().map(FollowUp::getCreateId).collect(Collectors.toList());
|
|
-
|
|
|
|
|
|
+ List<Integer> ids = followUps.stream().map(FollowUp::getId).collect(Collectors.toList());
|
|
List<Personnel> personnels = new ArrayList<>();
|
|
List<Personnel> personnels = new ArrayList<>();
|
|
|
|
+ List<AssoFollowUpFile> assoFollowUpFiles = new ArrayList<>();
|
|
|
|
+ List<String> guids = new ArrayList<>();
|
|
|
|
+ List<SystemFile> systemFiles = new ArrayList<>();
|
|
//查询创建人名称
|
|
//查询创建人名称
|
|
if (createIds.size() != 0) {
|
|
if (createIds.size() != 0) {
|
|
try {
|
|
try {
|
|
@@ -155,16 +174,55 @@ public class FollowUpService extends ServiceImpl<FollowUpMapper, FollowUp> {
|
|
throw new XiaoShiException("装载错误");
|
|
throw new XiaoShiException("装载错误");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (ids.size() != 0) {
|
|
|
|
+ //根据事件id获得事件文件关联表
|
|
|
|
+ LambdaQueryWrapper<AssoFollowUpFile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.in(AssoFollowUpFile::getFollowUpId, ids);
|
|
|
|
+ assoFollowUpFiles = assoFollowUpFileService.list(queryWrapper);
|
|
|
|
+ guids = assoFollowUpFiles.stream().map(AssoFollowUpFile::getFileGuid).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //查询文件
|
|
|
|
+ if (guids.size() != 0) {
|
|
|
|
+ try {
|
|
|
|
+ String res = fileManagerService.getSystemFileFromFMS(guids);
|
|
|
|
+ if (res != null && !res.trim().equals("")) {
|
|
|
|
+ systemFiles = JSONObject.parseArray(res, SystemFile.class);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new XiaoShiException("装载错误");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
for (FollowUp followUp : followUps) {
|
|
for (FollowUp followUp : followUps) {
|
|
FollowUpVO followUpVO = new FollowUpVO();
|
|
FollowUpVO followUpVO = new FollowUpVO();
|
|
BeanUtils.copyProperties(followUp, followUpVO);
|
|
BeanUtils.copyProperties(followUp, followUpVO);
|
|
|
|
+
|
|
|
|
+ //装载创建人
|
|
Personnel personnel = personnels.stream().filter(item -> item.getId().equals(followUp.getCreateId())).findFirst().orElse(null);
|
|
Personnel personnel = personnels.stream().filter(item -> item.getId().equals(followUp.getCreateId())).findFirst().orElse(null);
|
|
if (personnel != null) {
|
|
if (personnel != null) {
|
|
followUpVO.setCreateName(personnel.getPersonnelName());
|
|
followUpVO.setCreateName(personnel.getPersonnelName());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //装载状态
|
|
if (followUp.getStatus().equals(0)) {
|
|
if (followUp.getStatus().equals(0)) {
|
|
followUpVO.setStatusStr("进行中");
|
|
followUpVO.setStatusStr("进行中");
|
|
|
|
+ } else if (followUp.getStatus().equals(1)) {
|
|
|
|
+ followUpVO.setStatusStr("完成");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //装载文件信息
|
|
|
|
+ List<AssoFollowUpFile> assoFollowUpFilesTemp = assoFollowUpFiles.stream().filter(item -> item.getFollowUpId().equals(followUp.getId())).collect(Collectors.toList());
|
|
|
|
+ if (assoFollowUpFilesTemp.size() != 0) {
|
|
|
|
+ List<String> guidTemp = assoFollowUpFilesTemp.stream().map(AssoFollowUpFile::getFileGuid).collect(Collectors.toList());
|
|
|
|
+ if (guidTemp.size() != 0) {
|
|
|
|
+ List<SystemFile> systemFileTemp = systemFiles.stream().filter(item -> guidTemp.contains(item.getGuid())).collect(Collectors.toList());
|
|
|
|
+ if (systemFileTemp.size() != 0) {
|
|
|
|
+ followUpVO.setSystemFileList(systemFileTemp);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
followUpVOS.add(followUpVO);
|
|
followUpVOS.add(followUpVO);
|
|
}
|
|
}
|
|
return followUpVOS;
|
|
return followUpVOS;
|
|
@@ -175,38 +233,34 @@ public class FollowUpService extends ServiceImpl<FollowUpMapper, FollowUp> {
|
|
* 登记结果
|
|
* 登记结果
|
|
*
|
|
*
|
|
* @param register
|
|
* @param register
|
|
- * @param files
|
|
|
|
*/
|
|
*/
|
|
- public void register(RegisterDTO register, List<MultipartFile> files) throws ParseException {
|
|
|
|
|
|
+ public Integer register(RegisterDTO register) throws ParseException {
|
|
//获取当前时间
|
|
//获取当前时间
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
|
|
String date = dateFormat.format(new Date());//date为当前时间 是String类型的时间
|
|
String date = dateFormat.format(new Date());//date为当前时间 是String类型的时间
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Date finishTime = simpleDateFormat.parse(date);//转换为Date类型
|
|
Date finishTime = simpleDateFormat.parse(date);//转换为Date类型
|
|
- System.out.println("等级结果当前完成时间" + finishTime);
|
|
|
|
-
|
|
|
|
- FollowUp followUp = new FollowUp();
|
|
|
|
|
|
+ Integer followUpId = register.getFollowUpId();
|
|
|
|
+ //更新操作 将conclusion更新进入表
|
|
|
|
+ FollowUp followUp = this.getById(followUpId);
|
|
//从registerDTO中取出后续事项id进行对应的操作
|
|
//从registerDTO中取出后续事项id进行对应的操作
|
|
followUp.setId(register.getFollowUpId());
|
|
followUp.setId(register.getFollowUpId());
|
|
followUp.setStatus(1);
|
|
followUp.setStatus(1);
|
|
followUp.setConclusion(register.getConclusion());
|
|
followUp.setConclusion(register.getConclusion());
|
|
followUp.setFinishTime(finishTime);
|
|
followUp.setFinishTime(finishTime);
|
|
- //更新操作 将conclusion更新进入表
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //删除
|
|
|
|
-
|
|
|
|
- //简化定义后续事项id
|
|
|
|
- int followUpId = register.getFollowUpId();
|
|
|
|
|
|
+ followUp.updateById();
|
|
|
|
+ List<String> guids = register.getFileGuids();
|
|
//根据后续事项id查询关联表找出所有fileId
|
|
//根据后续事项id查询关联表找出所有fileId
|
|
-
|
|
|
|
|
|
+ LambdaQueryWrapper<AssoFollowUpFile> removeWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ removeWrapper.eq(AssoFollowUpFile::getFollowUpId, followUpId);
|
|
|
|
+ assoFollowUpFileService.remove(removeWrapper);
|
|
//新增文件
|
|
//新增文件
|
|
-
|
|
|
|
- //上传附件 进行关联绑定
|
|
|
|
|
|
+ assoFollowUpFileService.addBatch(followUpId, guids);
|
|
|
|
|
|
//批量新增后续事项
|
|
//批量新增后续事项
|
|
if (register.getFollowUps() != null && register.getFollowUps().size() > 0) {
|
|
if (register.getFollowUps() != null && register.getFollowUps().size() > 0) {
|
|
this.add(register.getFollowUps());
|
|
this.add(register.getFollowUps());
|
|
}
|
|
}
|
|
|
|
+ return followUpId;
|
|
}
|
|
}
|
|
}
|
|
}
|