|
@@ -1,5 +1,6 @@
|
|
package com.jeeplus.test.program.configuration.projectList.service;
|
|
package com.jeeplus.test.program.configuration.projectList.service;
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -14,18 +15,11 @@ import com.jeeplus.sys.utils.UserUtils;
|
|
import com.jeeplus.test.mould.service.SerialnumTplService;
|
|
import com.jeeplus.test.mould.service.SerialnumTplService;
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
import com.jeeplus.test.oss.mapper.OssServiceMapper;
|
|
import com.jeeplus.test.oss.mapper.OssServiceMapper;
|
|
-import com.jeeplus.test.program.configuration.projectList.domain.ProgramProjectListInfo;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.domain.ProgramProjectListLink;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.domain.ProgramProjectListMember;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.domain.ProgramReportNo;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.mapper.ProgramReportNoMapper;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.mapper.ProjectLinkMapper;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.mapper.ProjectListMapper;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.mapper.ProjectMemberMapper;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.service.dto.ContractDto;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.service.dto.ExportFileDto;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.service.dto.ProgramReportNoDto;
|
|
|
|
-import com.jeeplus.test.program.configuration.projectList.service.dto.ProjectListDto;
|
|
|
|
|
|
+import com.jeeplus.test.program.configuration.projectList.domain.*;
|
|
|
|
+import com.jeeplus.test.program.configuration.projectList.mapper.*;
|
|
|
|
+import com.jeeplus.test.program.configuration.projectList.service.dto.*;
|
|
|
|
+import com.jeeplus.test.program.configuration.projectList.service.mapstruct.ProgramAuditAssessPeopleWrapper;
|
|
|
|
+import com.jeeplus.test.program.configuration.projectList.service.mapstruct.ProgramAuditWrapper;
|
|
import com.jeeplus.test.workContract.domain.WorkContractInfo;
|
|
import com.jeeplus.test.workContract.domain.WorkContractInfo;
|
|
import com.jeeplus.test.workContract.mapper.WorkContractInfoMapper;
|
|
import com.jeeplus.test.workContract.mapper.WorkContractInfoMapper;
|
|
import com.jeeplus.test.workContract.service.WorkContractService;
|
|
import com.jeeplus.test.workContract.service.WorkContractService;
|
|
@@ -37,6 +31,7 @@ import javax.annotation.Resource;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class ProjectListService {
|
|
public class ProjectListService {
|
|
@@ -56,9 +51,12 @@ public class ProjectListService {
|
|
private SerialnumTplService serialnumTplService;
|
|
private SerialnumTplService serialnumTplService;
|
|
@Resource
|
|
@Resource
|
|
private WorkContractService workContractService;
|
|
private WorkContractService workContractService;
|
|
-
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private ProgramAuditMapper programAuditMapper;
|
|
@Resource
|
|
@Resource
|
|
private ProgramReportNoMapper programReportNoMapper;
|
|
private ProgramReportNoMapper programReportNoMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ private ProgramAuditAssessPeopleMapper programAuditAssessPeopleMapper;
|
|
|
|
|
|
public String save(ProjectListDto dto) throws Exception{
|
|
public String save(ProjectListDto dto) throws Exception{
|
|
if (StringUtils.isNotEmpty(dto.getId())) {
|
|
if (StringUtils.isNotEmpty(dto.getId())) {
|
|
@@ -117,9 +115,76 @@ public class ProjectListService {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
workContractService.saveFiles(dto.getFiles(), userDTO, id);
|
|
workContractService.saveFiles(dto.getFiles(), userDTO, id);
|
|
}
|
|
}
|
|
|
|
+ // 三级校审添加
|
|
|
|
+ ProgramAudit programAudit1 = new ProgramAudit();
|
|
|
|
+ programAudit1.setAuditLevel("1");
|
|
|
|
+ programAudit1.setProgramId(info.getId());
|
|
|
|
+ programAudit1.setStatus("0");
|
|
|
|
+ programAuditMapper.insert(programAudit1);
|
|
|
|
+ ProgramAudit programAudit2 = new ProgramAudit();
|
|
|
|
+ programAudit2.setAuditLevel("2");
|
|
|
|
+ programAudit2.setProgramId(info.getId());
|
|
|
|
+ programAudit2.setStatus("0");
|
|
|
|
+ programAuditMapper.insert(programAudit2);
|
|
|
|
+ ProgramAudit programAudit3 = new ProgramAudit();
|
|
|
|
+ programAudit3.setAuditLevel("3");
|
|
|
|
+ programAudit3.setProgramId(info.getId());
|
|
|
|
+ programAudit3.setStatus("0");
|
|
|
|
+ programAuditMapper.insert(programAudit3);
|
|
return id;
|
|
return id;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public String saveFormThree(ProgramAuditDto programAuditDto) {
|
|
|
|
+ UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
|
+ ProgramAudit programAudit = ProgramAuditWrapper.INSTANCE.toEntity(programAuditDto);
|
|
|
|
+ if (StringUtils.isNotBlank(programAudit.getId())){
|
|
|
|
+ programAuditMapper.updateById(programAudit);
|
|
|
|
+ }else{
|
|
|
|
+ programAuditMapper.insert(programAudit);
|
|
|
|
+ }
|
|
|
|
+ if (ObjectUtil.isNotEmpty(programAuditDto)) {
|
|
|
|
+ //附件
|
|
|
|
+ if (CollectionUtil.isNotEmpty(programAuditDto.getWorkAttachmentDtoList())) {
|
|
|
|
+ List<String> ids = programAuditDto.getWorkAttachmentDtoList().stream().filter(item -> {
|
|
|
|
+ if (StringUtils.isNotBlank(item.getId())) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }).map(WorkAttachmentDto::getId).collect(Collectors.toList());
|
|
|
|
+ if(CollectionUtil.isNotEmpty(ids)){
|
|
|
|
+ ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
|
|
|
|
+ .eq(WorkAttachment::getAttachmentId, programAudit.getId())
|
|
|
|
+ .notIn(WorkAttachment::getId,ids));
|
|
|
|
+ }else{
|
|
|
|
+ ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
|
|
|
|
+ .eq(WorkAttachment::getAttachmentId, programAudit.getId()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<WorkAttachmentDto> dtoList = programAuditDto.getWorkAttachmentDtoList().stream().filter(item -> {
|
|
|
|
+ if (StringUtils.isNotBlank(item.getId())) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ workContractService.saveFilesNew(dtoList, userDTO, programAudit.getId(),"program");
|
|
|
|
+ } else {
|
|
|
|
+ ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda().eq(WorkAttachment::getAttachmentId, programAudit.getId()));
|
|
|
|
+ }
|
|
|
|
+ //专业评估人员
|
|
|
|
+ if (CollectionUtil.isNotEmpty(programAuditDto.getProgramAuditAssessPeopleDtoList())) {
|
|
|
|
+ programAuditAssessPeopleMapper.delete(new QueryWrapper<ProgramAuditAssessPeople>().lambda().eq(ProgramAuditAssessPeople::getAuditId,programAudit.getId()));
|
|
|
|
+ programAuditDto.getProgramAuditAssessPeopleDtoList().stream().forEach(item->{
|
|
|
|
+ ProgramAuditAssessPeople programAuditAssessPeople = ProgramAuditAssessPeopleWrapper.INSTANCE.toEntity(item);
|
|
|
|
+ programAuditAssessPeopleMapper.insert(programAuditAssessPeople);
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ programAuditAssessPeopleMapper.delete(new QueryWrapper<ProgramAuditAssessPeople>().lambda().eq(ProgramAuditAssessPeople::getAuditId,programAudit.getId()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return programAudit.getId();
|
|
|
|
+ }
|
|
|
|
+
|
|
public String update(ProjectListDto dto) {
|
|
public String update(ProjectListDto dto) {
|
|
//获取当前登录人信息
|
|
//获取当前登录人信息
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
@@ -197,6 +262,19 @@ public class ProjectListService {
|
|
return dto;
|
|
return dto;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public ProgramAuditDto findByIdAudit(String id){
|
|
|
|
+ ProgramAuditDto byIdAudit = programAuditMapper.findByIdAudit(id);
|
|
|
|
+ // 查询附件信息
|
|
|
|
+ List<WorkAttachmentDto> files = workContractInfoMapper.findDtos(id);
|
|
|
|
+ if (CollectionUtils.isNotEmpty(files)) {
|
|
|
|
+ for (WorkAttachmentDto i : files) {
|
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
|
+ }
|
|
|
|
+ byIdAudit.setWorkAttachmentDtoList(files);
|
|
|
|
+ }
|
|
|
|
+ return byIdAudit;
|
|
|
|
+ }
|
|
|
|
+
|
|
public String deleteById(String id) {
|
|
public String deleteById(String id) {
|
|
projectListMapper.deleteById(id);
|
|
projectListMapper.deleteById(id);
|
|
projectLinkMapper.deleteByInfoId(id);
|
|
projectLinkMapper.deleteByInfoId(id);
|
|
@@ -217,6 +295,14 @@ public class ProjectListService {
|
|
return "操作成功";
|
|
return "操作成功";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public String updateStatusByAuditId(ProjectListDto dto) {
|
|
|
|
+ ProgramAudit programAudit = new ProgramAudit();
|
|
|
|
+ programAudit.setId(dto.getId());
|
|
|
|
+ programAudit.setStatus(dto.getStatus());
|
|
|
|
+ programAuditMapper.update(programAudit,new QueryWrapper<ProgramAudit>().lambda().eq(ProgramAudit::getId,programAudit.getId()));
|
|
|
|
+ return "操作成功";
|
|
|
|
+ }
|
|
|
|
+
|
|
public IPage<ProgramProjectListInfo> list(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info) throws Exception{
|
|
public IPage<ProgramProjectListInfo> list(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info) throws Exception{
|
|
QueryWrapper<ProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ProgramProjectListInfo.class);
|
|
QueryWrapper<ProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ProgramProjectListInfo.class);
|
|
wrapper.eq("a.del_flag", "0");
|
|
wrapper.eq("a.del_flag", "0");
|