|
|
|
@ -4,15 +4,11 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.excel.util.StringUtils; |
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON; |
|
|
|
import com.alibaba.fastjson2.JSON; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
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; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.biutag.supervision.common.UserContextHolder; |
|
|
|
import com.biutag.supervision.common.UserContextHolder; |
|
|
|
@ -27,20 +23,18 @@ import com.biutag.supervision.mapper.Report.ReportReviewMapper; |
|
|
|
import com.biutag.supervision.mapper.Warning.WarningContentMapper; |
|
|
|
import com.biutag.supervision.mapper.Warning.WarningContentMapper; |
|
|
|
import com.biutag.supervision.mapper.Warning.WarningRecordMapper; |
|
|
|
import com.biutag.supervision.mapper.Warning.WarningRecordMapper; |
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
import com.biutag.supervision.pojo.entity.InformMessage; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.InvertRecord; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportFile; |
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportFile; |
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportFlow; |
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportFlow; |
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportProject; |
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportProject; |
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportReview; |
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportReview; |
|
|
|
import com.biutag.supervision.pojo.entity.warning.WarningContent; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.warning.WarningRecord; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.enums.FlowEnum; |
|
|
|
import com.biutag.supervision.pojo.enums.FlowEnum; |
|
|
|
import com.biutag.supervision.pojo.enums.FlowStateEnum; |
|
|
|
import com.biutag.supervision.pojo.enums.FlowStateEnum; |
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
import com.biutag.supervision.pojo.param.Report.ReportDeleteParam; |
|
|
|
import com.biutag.supervision.pojo.param.Report.ReportDeleteParam; |
|
|
|
import com.biutag.supervision.pojo.param.Report.ReportProjectQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.Report.ReportProjectQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.Work.ProjectWorkQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.Work.ProjectWorkQueryParam; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.request.reportProject.ReportProjectDeleteRequest; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.transfer.ProjectTransfer; |
|
|
|
import com.biutag.supervision.pojo.vo.FileVo; |
|
|
|
import com.biutag.supervision.pojo.vo.FileVo; |
|
|
|
import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; |
|
|
|
import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; |
|
|
|
import com.biutag.supervision.pojo.vo.report.ReportFileVo; |
|
|
|
import com.biutag.supervision.pojo.vo.report.ReportFileVo; |
|
|
|
@ -135,7 +129,12 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor |
|
|
|
public ReportProjectVo getDetail(String id) { |
|
|
|
public ReportProjectVo getDetail(String id) { |
|
|
|
ReportProjectVo vo = new ReportProjectVo(); |
|
|
|
ReportProjectVo vo = new ReportProjectVo(); |
|
|
|
//项目信息
|
|
|
|
//项目信息
|
|
|
|
ReportProject project = baseMapper.selectById(id); |
|
|
|
ReportProject project = null; |
|
|
|
|
|
|
|
if (UserContextHolder.isSuperUser()){ |
|
|
|
|
|
|
|
project = baseMapper.selectByIdIncludeDeleted(id); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
project = baseMapper.selectById(id); |
|
|
|
|
|
|
|
} |
|
|
|
if (ObjectUtil.isNotEmpty(project.getServiceStartTime()) && ObjectUtil.isNotEmpty(project.getServiceEndTime())) { |
|
|
|
if (ObjectUtil.isNotEmpty(project.getServiceStartTime()) && ObjectUtil.isNotEmpty(project.getServiceEndTime())) { |
|
|
|
List<LocalDateTime> dateTimes = new ArrayList<>(); |
|
|
|
List<LocalDateTime> dateTimes = new ArrayList<>(); |
|
|
|
dateTimes.add(project.getServiceStartTime()); |
|
|
|
dateTimes.add(project.getServiceStartTime()); |
|
|
|
@ -169,8 +168,9 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor |
|
|
|
vo.setFiles(reportFileMap); |
|
|
|
vo.setFiles(reportFileMap); |
|
|
|
} |
|
|
|
} |
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
ReportProject finalReport = project; |
|
|
|
List<ReportFlow> flows = reportFlowService.list(new LambdaQueryWrapper<ReportFlow>().eq(ReportFlow::getReportId, id).eq(ReportFlow::getType, "report")); |
|
|
|
List<ReportFlow> flows = reportFlowService.list(new LambdaQueryWrapper<ReportFlow>().eq(ReportFlow::getReportId, id).eq(ReportFlow::getType, "report")); |
|
|
|
flows = flows.stream().filter(s -> !s.getApproverState().equals(FlowStateEnum.Reject.getLabel()) && isFileFlow(project.getNode()).contains(s.getReportLink())) |
|
|
|
flows = flows.stream().filter(s -> !s.getApproverState().equals(FlowStateEnum.Reject.getLabel()) && isFileFlow(finalReport.getNode()).contains(s.getReportLink())) |
|
|
|
.collect(Collectors.toMap( |
|
|
|
.collect(Collectors.toMap( |
|
|
|
ReportFlow::getReportCode, |
|
|
|
ReportFlow::getReportCode, |
|
|
|
Function.identity(), |
|
|
|
Function.identity(), |
|
|
|
@ -303,30 +303,43 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
// public Result<Void> delete(ReportDeleteParam reportDeleteParam) {
|
|
|
|
|
|
|
|
// String id = reportDeleteParam.getId();
|
|
|
|
|
|
|
|
// if (StringUtils.isBlank(id)) {
|
|
|
|
|
|
|
|
// return Result.failed("项目id不能为空");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// this.removeById(id);
|
|
|
|
|
|
|
|
// deleteByColumn(reviewMapper, ReportReview::getReportId, id);
|
|
|
|
|
|
|
|
// deleteByColumn(reportFileMapper, ReportFile::getReportId, id);
|
|
|
|
|
|
|
|
// deleteByColumn(reportFlowMapper, ReportFlow::getReportId, id);
|
|
|
|
|
|
|
|
// deleteByColumn(informMessageMapper, InformMessage::getReportId, id);
|
|
|
|
|
|
|
|
// deleteByColumn(warningContentMapper, WarningContent::getWarningId, id);
|
|
|
|
|
|
|
|
// deleteByColumn(warningRecordMapper, WarningRecord::getReportId, id);
|
|
|
|
|
|
|
|
// deleteByColumn(invertRecordMapper, InvertRecord::getReportId, id);
|
|
|
|
|
|
|
|
// return Result.success();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// private <T> void deleteByColumn (BaseMapper<T> mapper, SFunction<T, ?> column, String id ){
|
|
|
|
|
|
|
|
// LambdaQueryWrapper<T> wrapper = Wrappers.<T>lambdaQuery().eq(column, id);
|
|
|
|
|
|
|
|
// mapper.delete(wrapper);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result<Void> delete(ReportDeleteParam reportDeleteParam) { |
|
|
|
public Result<Void> deleteReportProject(ReportProjectDeleteRequest request) { |
|
|
|
String id = reportDeleteParam.getId(); |
|
|
|
ReportDeleteParam reportDeleteParam = ProjectTransfer.INSTANCE.delRequestToDelParam(request); |
|
|
|
if (StringUtils.isBlank(id)) { |
|
|
|
ReportProject reportProject = this.getById(reportDeleteParam.getId()); |
|
|
|
return Result.failed("项目id不能为空"); |
|
|
|
if (ObjectUtil.isNull(reportProject)){ |
|
|
|
|
|
|
|
throw new RuntimeException("项目数据不存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
this.removeById(id); |
|
|
|
reportProject.setDeleteReason(reportDeleteParam.getDeleteReason()); |
|
|
|
deleteByColumn(reviewMapper, ReportReview::getReportId, id); |
|
|
|
this.updateById(reportProject); |
|
|
|
deleteByColumn(reportFileMapper, ReportFile::getReportId, id); |
|
|
|
this.removeById(reportProject); |
|
|
|
deleteByColumn(reportFlowMapper, ReportFlow::getReportId, id); |
|
|
|
|
|
|
|
deleteByColumn(informMessageMapper, InformMessage::getReportId, id); |
|
|
|
|
|
|
|
deleteByColumn(warningContentMapper, WarningContent::getWarningId, id); |
|
|
|
|
|
|
|
deleteByColumn(warningRecordMapper, WarningRecord::getReportId, id); |
|
|
|
|
|
|
|
deleteByColumn(invertRecordMapper, InvertRecord::getReportId, id); |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private <T> void deleteByColumn (BaseMapper<T> mapper, SFunction<T, ?> column, String id ){ |
|
|
|
|
|
|
|
LambdaQueryWrapper<T> wrapper = Wrappers.<T>lambdaQuery().eq(column, id); |
|
|
|
|
|
|
|
mapper.delete(wrapper); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|