|
@@ -15,9 +15,11 @@ import com.jeeplus.sys.utils.UserUtils;
|
|
|
import com.jeeplus.test.mould.service.SerialnumTplService;
|
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
|
import com.jeeplus.test.oss.mapper.OssServiceMapper;
|
|
|
+import com.jeeplus.test.oss.service.OssService;
|
|
|
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.ProgramArchiveWrapper;
|
|
|
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;
|
|
@@ -46,7 +48,8 @@ public class ProjectListService {
|
|
|
private WorkContractInfoMapper workContractInfoMapper;
|
|
|
@Resource
|
|
|
private OssServiceMapper ossServiceMapper;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private OssService ossService;
|
|
|
@Resource
|
|
|
private SerialnumTplService serialnumTplService;
|
|
|
@Resource
|
|
@@ -57,6 +60,8 @@ public class ProjectListService {
|
|
|
private ProgramReportNoMapper programReportNoMapper;
|
|
|
@Resource
|
|
|
private ProgramAuditAssessPeopleMapper programAuditAssessPeopleMapper;
|
|
|
+ @Resource
|
|
|
+ private ProgramArchiveMapper programArchiveMapper;
|
|
|
|
|
|
public String save(ProjectListDto dto) throws Exception{
|
|
|
if (StringUtils.isNotEmpty(dto.getId())) {
|
|
@@ -131,9 +136,31 @@ public class ProjectListService {
|
|
|
programAudit3.setProgramId(info.getId());
|
|
|
programAudit3.setStatus("0");
|
|
|
programAuditMapper.insert(programAudit3);
|
|
|
+ // 项目归档添加
|
|
|
+ ProgramArchive programArchive = new ProgramArchive();
|
|
|
+ programArchive.setProgramId(info.getId());
|
|
|
+ programArchive.setStatus("0");
|
|
|
+ programArchiveMapper.insert(programArchive);
|
|
|
return id;
|
|
|
}
|
|
|
|
|
|
+ public String saveFormArchive(ProgramArchiveDto programArchiveDto) {
|
|
|
+ ProgramArchive programArchive = ProgramArchiveWrapper.INSTANCE.toEntity(programArchiveDto);
|
|
|
+ if (StringUtils.isNotBlank(programArchive.getId())){
|
|
|
+ programArchiveMapper.updateById(programArchive);
|
|
|
+ }else{
|
|
|
+ programArchiveMapper.insert(programArchive);
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(programArchiveDto)) {
|
|
|
+ ossService.saveOrUpdateFileListFlag(programArchiveDto.getReportFileList(),programArchive.getId(),"report");
|
|
|
+ ossService.saveOrUpdateFileListFlag(programArchiveDto.getDetailFileList(),programArchive.getId(),"detail");
|
|
|
+ ossService.saveOrUpdateFileListFlag(programArchiveDto.getExplainFileList(),programArchive.getId(),"explain");
|
|
|
+ ossService.saveOrUpdateFileListFlag(programArchiveDto.getPapersFileList(),programArchive.getId(),"papers");
|
|
|
+ ossService.saveOrUpdateFileListFlag(programArchiveDto.getOtherFileList(),programArchive.getId(),"other");
|
|
|
+ }
|
|
|
+ return programArchive.getId();
|
|
|
+ }
|
|
|
+
|
|
|
public String saveFormThree(ProgramAuditDto programAuditDto) {
|
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
ProgramAudit programAudit = ProgramAuditWrapper.INSTANCE.toEntity(programAuditDto);
|
|
@@ -144,33 +171,7 @@ public class ProjectListService {
|
|
|
}
|
|
|
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()));
|
|
|
- }
|
|
|
+ ossService.saveOrUpdateFileList(programAuditDto.getWorkAttachmentDtoList(),programAudit.getId(),"program");
|
|
|
//专业评估人员
|
|
|
if (CollectionUtil.isNotEmpty(programAuditDto.getProgramAuditAssessPeopleDtoList())) {
|
|
|
programAuditAssessPeopleMapper.delete(new QueryWrapper<ProgramAuditAssessPeople>().lambda().eq(ProgramAuditAssessPeople::getAuditId,programAudit.getId()));
|
|
@@ -275,6 +276,58 @@ public class ProjectListService {
|
|
|
return byIdAudit;
|
|
|
}
|
|
|
|
|
|
+ public ProgramArchiveDto findByIdArchive(String id){
|
|
|
+ ProgramArchiveDto programArchiveDto = programArchiveMapper.findByIdArchive(id);
|
|
|
+
|
|
|
+ // 查询附件信息 - 评估报告
|
|
|
+ List<WorkAttachmentDto> reportFileList = workContractInfoMapper.findByAttachmentIdAndFlag(id, "report");
|
|
|
+ if (CollectionUtils.isNotEmpty(reportFileList)) {
|
|
|
+ for (WorkAttachmentDto i : reportFileList) {
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ }
|
|
|
+ programArchiveDto.setReportFileList(reportFileList);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询附件信息 - 评估说明
|
|
|
+ List<WorkAttachmentDto> explainFileList = workContractInfoMapper.findByAttachmentIdAndFlag(id, "explain");
|
|
|
+ if (CollectionUtils.isNotEmpty(explainFileList)) {
|
|
|
+ for (WorkAttachmentDto i : explainFileList) {
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ }
|
|
|
+ programArchiveDto.setExplainFileList(explainFileList);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询附件信息 - 评估明细表
|
|
|
+ List<WorkAttachmentDto> detailFileList = workContractInfoMapper.findByAttachmentIdAndFlag(id, "detail");
|
|
|
+ if (CollectionUtils.isNotEmpty(detailFileList)) {
|
|
|
+ for (WorkAttachmentDto i : detailFileList) {
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ }
|
|
|
+ programArchiveDto.setDetailFileList(detailFileList);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询附件信息 - 评估操作计算底稿
|
|
|
+ List<WorkAttachmentDto> papersFileList = workContractInfoMapper.findByAttachmentIdAndFlag(id, "papers");
|
|
|
+ if (CollectionUtils.isNotEmpty(papersFileList)) {
|
|
|
+ for (WorkAttachmentDto i : papersFileList) {
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ }
|
|
|
+ programArchiveDto.setPapersFileList(papersFileList);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询附件信息 - 其他
|
|
|
+ List<WorkAttachmentDto> otherFileList = workContractInfoMapper.findByAttachmentIdAndFlag(id, "other");
|
|
|
+ if (CollectionUtils.isNotEmpty(otherFileList)) {
|
|
|
+ for (WorkAttachmentDto i : otherFileList) {
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ }
|
|
|
+ programArchiveDto.setOtherFileList(otherFileList);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return programArchiveDto;
|
|
|
+ }
|
|
|
+
|
|
|
public String deleteById(String id) {
|
|
|
projectListMapper.deleteById(id);
|
|
|
projectLinkMapper.deleteByInfoId(id);
|
|
@@ -303,6 +356,14 @@ public class ProjectListService {
|
|
|
return "操作成功";
|
|
|
}
|
|
|
|
|
|
+ public String updateStatusByArchiveId(ProjectListDto dto) {
|
|
|
+ ProgramArchive programArchive = new ProgramArchive();
|
|
|
+ programArchive.setId(dto.getId());
|
|
|
+ programArchive.setStatus(dto.getStatus());
|
|
|
+ programArchiveMapper.update(programArchive,new QueryWrapper<ProgramArchive>().lambda().eq(ProgramArchive::getId,programArchive.getId()));
|
|
|
+ return "操作成功";
|
|
|
+ }
|
|
|
+
|
|
|
public IPage<ProgramProjectListInfo> list(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info) throws Exception{
|
|
|
QueryWrapper<ProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ProgramProjectListInfo.class);
|
|
|
wrapper.eq("a.del_flag", "0");
|