|
|
|
|
@ -4,63 +4,62 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
|
import com.alibaba.excel.ExcelWriter; |
|
|
|
|
import com.alibaba.excel.write.metadata.WriteSheet; |
|
|
|
|
import com.alibaba.excel.write.metadata.fill.FillConfig; |
|
|
|
|
import com.alibaba.excel.write.metadata.fill.FillWrapper; |
|
|
|
|
import com.alibaba.excel.util.StringUtils; |
|
|
|
|
import com.alibaba.fastjson2.JSON; |
|
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
|
|
|
|
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.service.impl.ServiceImpl; |
|
|
|
|
import com.biutag.supervision.common.UserContextHolder; |
|
|
|
|
import com.biutag.supervision.constants.AppConstants; |
|
|
|
|
import com.biutag.supervision.constants.enums.RoleCodeEnum; |
|
|
|
|
import com.biutag.supervision.mapper.InformMessageMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Invest.InvertRecordMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Report.ReportFileMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Report.ReportFlowMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Report.ReportProjectMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Report.ReportReviewMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Warning.WarningContentMapper; |
|
|
|
|
import com.biutag.supervision.mapper.Warning.WarningRecordMapper; |
|
|
|
|
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.ReportFlow; |
|
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportProject; |
|
|
|
|
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.FlowStateEnum; |
|
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
|
import com.biutag.supervision.pojo.param.Report.ReportDeleteParam; |
|
|
|
|
import com.biutag.supervision.pojo.param.Report.ReportProjectQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.param.Work.ProjectWorkQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.param.entryWindow.EntryWindowQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.vo.FileVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.excel.ExcelControlPriceVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.report.ReportFileVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.report.ReportHomeVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.report.ReportProjectVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.statement.ConditionVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.work.ProjectTabWorkVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.work.ProjectWorkVo; |
|
|
|
|
import io.swagger.v3.core.util.Json; |
|
|
|
|
import jakarta.servlet.ServletOutputStream; |
|
|
|
|
import jakarta.servlet.http.HttpServletResponse; |
|
|
|
|
import jakarta.annotation.Resource; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import org.apache.poi.util.IOUtils; |
|
|
|
|
import org.springframework.core.io.ClassPathResource; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
import java.net.URLEncoder; |
|
|
|
|
import java.net.http.HttpResponse; |
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.function.Function; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
@ -78,45 +77,66 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
|
|
|
|
|
|
|
|
|
|
private final ReportFlowService reportFlowService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private ReportReviewMapper reviewMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private ReportFileMapper reportFileMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private ReportFlowMapper reportFlowMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private InformMessageMapper informMessageMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private WarningContentMapper warningContentMapper; |
|
|
|
|
|
|
|
|
|
public Page<EntryWindowVo> getPage(Page<ReportProject> page, QueryWrapper<ReportProject> lambdaQueryWrapper){ |
|
|
|
|
return baseMapper.queryPage(page,lambdaQueryWrapper); |
|
|
|
|
@Resource |
|
|
|
|
private WarningRecordMapper warningRecordMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private InvertRecordMapper invertRecordMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Page<EntryWindowVo> getPage(Page<ReportProject> page, QueryWrapper<ReportProject> lambdaQueryWrapper) { |
|
|
|
|
return baseMapper.queryPage(page, lambdaQueryWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Page<EntryWindowVo> getPageWarning(Page<ReportProject> page, QueryWrapper<ReportProject> lambdaQueryWrapper,String warningState){ |
|
|
|
|
return baseMapper.queryPageWarning(page,lambdaQueryWrapper,warningState); |
|
|
|
|
public Page<EntryWindowVo> getPageWarning(Page<ReportProject> page, QueryWrapper<ReportProject> lambdaQueryWrapper, String warningState) { |
|
|
|
|
return baseMapper.queryPageWarning(page, lambdaQueryWrapper, warningState); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取数据 |
|
|
|
|
* */ |
|
|
|
|
public Page<ConditionVo> getConditionPage(Page<ReportProject> page,QueryWrapper<ReportProject> lambdaQueryWrapper){ |
|
|
|
|
return baseMapper.queryPageCondition(page,lambdaQueryWrapper); |
|
|
|
|
*/ |
|
|
|
|
public Page<ConditionVo> getConditionPage(Page<ReportProject> page, QueryWrapper<ReportProject> lambdaQueryWrapper) { |
|
|
|
|
return baseMapper.queryPageCondition(page, lambdaQueryWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取数据详情 |
|
|
|
|
* */ |
|
|
|
|
public List<ReportProject> getProjectList(ReportProjectQueryParam queryParam){ |
|
|
|
|
*/ |
|
|
|
|
public List<ReportProject> getProjectList(ReportProjectQueryParam queryParam) { |
|
|
|
|
UserAuth user = UserContextHolder.getCurrentUser(); |
|
|
|
|
LambdaQueryWrapper<ReportProject> queryWrapper=new LambdaQueryWrapper<ReportProject>() |
|
|
|
|
.like(StrUtil.isNotBlank(queryParam.getName()),ReportProject::getReportName,queryParam.getName()).last("limit 100") |
|
|
|
|
LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<ReportProject>() |
|
|
|
|
.like(StrUtil.isNotBlank(queryParam.getName()), ReportProject::getReportName, queryParam.getName()).last("limit 100") |
|
|
|
|
.orderByDesc(ReportProject::getCrtTime); |
|
|
|
|
// 权限
|
|
|
|
|
if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { |
|
|
|
|
queryWrapper.eq(ReportProject::getApplicantId,user.getUserName()); |
|
|
|
|
queryWrapper.eq(ReportProject::getApplicantId, user.getUserName()); |
|
|
|
|
} |
|
|
|
|
return baseMapper.selectList(queryWrapper); |
|
|
|
|
return baseMapper.selectList(queryWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取报审项目详情 |
|
|
|
|
* */ |
|
|
|
|
public ReportProjectVo getDetail(String id){ |
|
|
|
|
ReportProjectVo vo =new ReportProjectVo(); |
|
|
|
|
*/ |
|
|
|
|
public ReportProjectVo getDetail(String id) { |
|
|
|
|
ReportProjectVo vo = new ReportProjectVo(); |
|
|
|
|
//项目信息
|
|
|
|
|
ReportProject 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<>(); |
|
|
|
|
dateTimes.add(project.getServiceStartTime()); |
|
|
|
|
dateTimes.add(project.getServiceEndTime()); |
|
|
|
|
@ -124,45 +144,45 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
|
|
|
|
|
} |
|
|
|
|
vo.setProject(project); |
|
|
|
|
//审核信息
|
|
|
|
|
ReportReview review = reportReviewService.getOne(new LambdaQueryWrapper<ReportReview>().eq(ReportReview::getReportId,id)); |
|
|
|
|
if(ObjectUtil.isNotEmpty(review)){ |
|
|
|
|
ReportReview review = reportReviewService.getOne(new LambdaQueryWrapper<ReportReview>().eq(ReportReview::getReportId, id)); |
|
|
|
|
if (ObjectUtil.isNotEmpty(review)) { |
|
|
|
|
vo.setReview(review); |
|
|
|
|
}else{ |
|
|
|
|
review =new ReportReview(); |
|
|
|
|
} else { |
|
|
|
|
review = new ReportReview(); |
|
|
|
|
vo.setReview(review); |
|
|
|
|
} |
|
|
|
|
//项目附件
|
|
|
|
|
List<ReportFile> reportFiles = fileService.list(new LambdaQueryWrapper<ReportFile>().eq(ReportFile::getReportId,id)); |
|
|
|
|
List<ReportFileVo> reportFileVos = reportFiles.stream().map(s->{ |
|
|
|
|
List<ReportFile> reportFiles = fileService.list(new LambdaQueryWrapper<ReportFile>().eq(ReportFile::getReportId, id)); |
|
|
|
|
List<ReportFileVo> reportFileVos = reportFiles.stream().map(s -> { |
|
|
|
|
ReportFileVo vos = new ReportFileVo(); |
|
|
|
|
BeanUtil.copyProperties(s,vos); |
|
|
|
|
vos.setFileData(JSON.parseArray(s.getFiles(),FileVo.class)); |
|
|
|
|
BeanUtil.copyProperties(s, vos); |
|
|
|
|
vos.setFileData(JSON.parseArray(s.getFiles(), FileVo.class)); |
|
|
|
|
return vos; |
|
|
|
|
}).toList(); |
|
|
|
|
//判断有无附件
|
|
|
|
|
if(CollectionUtil.isNotEmpty(reportFileVos)){ |
|
|
|
|
Map<String,List<ReportFileVo>> reportFileMap= reportFileVos.stream() |
|
|
|
|
if (CollectionUtil.isNotEmpty(reportFileVos)) { |
|
|
|
|
Map<String, List<ReportFileVo>> reportFileMap = reportFileVos.stream() |
|
|
|
|
.collect(Collectors.groupingBy(ReportFileVo::getFileNode)); |
|
|
|
|
vo.setFiles(reportFileMap); |
|
|
|
|
}else{ |
|
|
|
|
Map<String,List<ReportFileVo>> reportFileMap =new HashMap<>(); |
|
|
|
|
} else { |
|
|
|
|
Map<String, List<ReportFileVo>> reportFileMap = new HashMap<>(); |
|
|
|
|
vo.setFiles(reportFileMap); |
|
|
|
|
} |
|
|
|
|
//
|
|
|
|
|
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())) |
|
|
|
|
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())) |
|
|
|
|
.collect(Collectors.toMap( |
|
|
|
|
ReportFlow::getReportCode, |
|
|
|
|
Function.identity(), |
|
|
|
|
(existing, replacement) -> existing |
|
|
|
|
)).values().stream().toList(); |
|
|
|
|
if(CollectionUtil.isNotEmpty(flows)){ |
|
|
|
|
if (CollectionUtil.isNotEmpty(flows)) { |
|
|
|
|
vo.setFlows(flows); |
|
|
|
|
} |
|
|
|
|
return vo; |
|
|
|
|
return vo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<String> isFileFlow(String node){ |
|
|
|
|
public List<String> isFileFlow(String node) { |
|
|
|
|
return switch (node) { |
|
|
|
|
case "review" -> List.of("initial"); |
|
|
|
|
case "first" -> List.of("review", "initial"); |
|
|
|
|
@ -170,25 +190,25 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
|
|
|
|
|
case "third" -> List.of("second", "review", "initial", "first"); |
|
|
|
|
case "Lead" -> List.of("second", "review", "initial", "first", "third"); |
|
|
|
|
case "original" -> List.of("second", "review", "initial", "first", "third", "Lead"); |
|
|
|
|
case "audit" -> List.of( "original", "second", "review", "initial", "first", "third", "Lead"); |
|
|
|
|
case "audit" -> List.of("original", "second", "review", "initial", "first", "third", "Lead"); |
|
|
|
|
case "end" -> List.of("audit", "original", "second", "review", "initial", "first", "third", "Lead"); |
|
|
|
|
default -> new ArrayList<>(); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public ReportHomeVo getReportHomeVo(String id){ |
|
|
|
|
ReportHomeVo vo=new ReportHomeVo(); |
|
|
|
|
ReportProject project=baseMapper.selectOne(new LambdaQueryWrapper<ReportProject>().eq(ReportProject::getId,id).orderByDesc(ReportProject::getCrtTime)); |
|
|
|
|
BeanUtil.copyProperties(project,vo); |
|
|
|
|
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())) |
|
|
|
|
public ReportHomeVo getReportHomeVo(String id) { |
|
|
|
|
ReportHomeVo vo = new ReportHomeVo(); |
|
|
|
|
ReportProject project = baseMapper.selectOne(new LambdaQueryWrapper<ReportProject>().eq(ReportProject::getId, id).orderByDesc(ReportProject::getCrtTime)); |
|
|
|
|
BeanUtil.copyProperties(project, vo); |
|
|
|
|
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())) |
|
|
|
|
.collect(Collectors.toMap( |
|
|
|
|
ReportFlow::getReportCode, |
|
|
|
|
Function.identity(), |
|
|
|
|
(existing, replacement) -> existing |
|
|
|
|
)).values().stream().toList(); |
|
|
|
|
|
|
|
|
|
if(CollectionUtil.isNotEmpty(flows)){ |
|
|
|
|
if (CollectionUtil.isNotEmpty(flows)) { |
|
|
|
|
vo.setFlows(flows); |
|
|
|
|
} |
|
|
|
|
return vo; |
|
|
|
|
@ -196,16 +216,16 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 新增或修改 |
|
|
|
|
* */ |
|
|
|
|
*/ |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public ReportProjectVo addOrUpdate(ReportProjectQueryParam queryParam){ |
|
|
|
|
public ReportProjectVo addOrUpdate(ReportProjectQueryParam queryParam) { |
|
|
|
|
UserAuth user = UserContextHolder.getCurrentUser(); |
|
|
|
|
if(CollectionUtil.isNotEmpty(queryParam.getProject().getServiceTime())){ |
|
|
|
|
if (CollectionUtil.isNotEmpty(queryParam.getProject().getServiceTime())) { |
|
|
|
|
List<LocalDateTime> serviceTime = queryParam.getProject().getServiceTime(); |
|
|
|
|
queryParam.getProject().setServiceStartTime(serviceTime.get(0)); |
|
|
|
|
queryParam.getProject().setServiceEndTime(serviceTime.get(1)); |
|
|
|
|
} |
|
|
|
|
if(!StrUtil.isNotEmpty(queryParam.getProject().getId()) ){ |
|
|
|
|
if (!StrUtil.isNotEmpty(queryParam.getProject().getId())) { |
|
|
|
|
baseMapper.insertOrUpdate(queryParam.getProject()); |
|
|
|
|
ReportFlow flow = new ReportFlow(); |
|
|
|
|
flow.setReportId(queryParam.getProject().getId()); |
|
|
|
|
@ -218,30 +238,30 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
|
|
|
|
|
flow.setType("report"); |
|
|
|
|
flow.setIsInit("1"); |
|
|
|
|
reportFlowService.save(flow); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
queryParam.getProject().setCrtTime(LocalDateTime.now()); |
|
|
|
|
baseMapper.insertOrUpdate(queryParam.getProject()); |
|
|
|
|
} |
|
|
|
|
List<ReportFile> reportFiles =fileService.list(new LambdaQueryWrapper<ReportFile>().eq(ReportFile::getReportId,queryParam.getProject().getId())); |
|
|
|
|
if(CollectionUtil.isNotEmpty(reportFiles)){ |
|
|
|
|
List<ReportFile> reportFiles = fileService.list(new LambdaQueryWrapper<ReportFile>().eq(ReportFile::getReportId, queryParam.getProject().getId())); |
|
|
|
|
if (CollectionUtil.isNotEmpty(reportFiles)) { |
|
|
|
|
fileService.removeBatchByIds(reportFiles.stream().map(ReportFile::getId).toList()); |
|
|
|
|
} |
|
|
|
|
if(ObjectUtil.isNotEmpty(queryParam.getReview())){ |
|
|
|
|
if (ObjectUtil.isNotEmpty(queryParam.getReview())) { |
|
|
|
|
queryParam.getReview().setReportId(queryParam.getProject().getId()); |
|
|
|
|
reportReviewService.saveOrUpdate(queryParam.getReview()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(CollectionUtil.isNotEmpty(queryParam.getFiles())){ |
|
|
|
|
if (CollectionUtil.isNotEmpty(queryParam.getFiles())) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (String key : queryParam.getFiles().keySet()){ |
|
|
|
|
List<ReportFile> files =new ArrayList<>(); |
|
|
|
|
queryParam.getFiles().get(key).forEach(s->{ |
|
|
|
|
ReportFile file =new ReportFile(); |
|
|
|
|
for (String key : queryParam.getFiles().keySet()) { |
|
|
|
|
List<ReportFile> files = new ArrayList<>(); |
|
|
|
|
queryParam.getFiles().get(key).forEach(s -> { |
|
|
|
|
ReportFile file = new ReportFile(); |
|
|
|
|
s.setFileNode(key); |
|
|
|
|
s.setReportId(queryParam.getProject().getId()); |
|
|
|
|
BeanUtil.copyProperties(s,file); |
|
|
|
|
BeanUtil.copyProperties(s, file); |
|
|
|
|
file.setFiles(JSONObject.toJSONString(s.getFileData())); |
|
|
|
|
files.add(file); |
|
|
|
|
}); |
|
|
|
|
@ -251,36 +271,62 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
|
|
|
|
|
} |
|
|
|
|
return getDetail(queryParam.getProject().getId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 删除报审项目 |
|
|
|
|
* */ |
|
|
|
|
public Boolean delData(ReportProjectQueryParam queryParam){ |
|
|
|
|
if(CollectionUtil.isNotEmpty(queryParam.getFiles())){ |
|
|
|
|
for (String key : queryParam.getFiles().keySet()){ |
|
|
|
|
*/ |
|
|
|
|
public Boolean delData(ReportProjectQueryParam queryParam) { |
|
|
|
|
if (CollectionUtil.isNotEmpty(queryParam.getFiles())) { |
|
|
|
|
for (String key : queryParam.getFiles().keySet()) { |
|
|
|
|
fileService.removeBatchByIds(queryParam.getFiles().get(key)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return baseMapper.deleteById(queryParam.getId()) > 0; |
|
|
|
|
return baseMapper.deleteById(queryParam.getId()) > 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<ProjectWorkVo> getProjectWork(ProjectWorkQueryParam queryParam){ |
|
|
|
|
public List<ProjectWorkVo> getProjectWork(ProjectWorkQueryParam queryParam) { |
|
|
|
|
return baseMapper.getProjectWorkVoList(queryParam); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public ProjectTabWorkVo getProjectTabWorkVo(ProjectWorkQueryParam queryParam){ |
|
|
|
|
public ProjectTabWorkVo getProjectTabWorkVo(ProjectWorkQueryParam queryParam) { |
|
|
|
|
return baseMapper.getProjectTabWorkVo(queryParam); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean upFinalizationPath(ReportProjectQueryParam queryParam) { |
|
|
|
|
|
|
|
|
|
return reportReviewService.update(new LambdaUpdateWrapper<ReportReview>() |
|
|
|
|
.set(ReportReview::getFinalizationPath, queryParam.getReview().getFinalizationPath()) |
|
|
|
|
.eq(ReportReview::getId, queryParam.getReview().getId()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
public boolean upFinalizationPath(ReportProjectQueryParam queryParam){ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return reportReviewService.update(new LambdaUpdateWrapper<ReportReview>() |
|
|
|
|
.set(ReportReview::getFinalizationPath,queryParam.getReview().getFinalizationPath()) |
|
|
|
|
.eq(ReportReview::getId,queryParam.getReview().getId()) |
|
|
|
|
) ; |
|
|
|
|
|
|
|
|
|
@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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|