|
@@ -17,6 +17,7 @@ import com.google.common.collect.Maps;
|
|
|
import com.jeeplus.common.TokenProvider;
|
|
|
import com.jeeplus.common.constant.CacheNames;
|
|
|
import com.jeeplus.common.redis.RedisUtils;
|
|
|
+import com.jeeplus.common.utils.ResponseUtil;
|
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
import com.jeeplus.finance.common.flowable.dto.CommitParamDTO;
|
|
|
import com.jeeplus.finance.invoice.util.SignaturePostUtil;
|
|
@@ -147,6 +148,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
if (report != null){
|
|
|
reportData.setCreateBy(reportData.getCreateBy());
|
|
|
reportData.setProcInsReview(report.getProcInsReview());
|
|
|
+ reportData.setReviewStatus(report.getReviewStatus());
|
|
|
return update(reportData);
|
|
|
}
|
|
|
}
|
|
@@ -180,7 +182,6 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
infoData.setUpdateTime(new Date());
|
|
|
infoMapper.updateCwProjectInfoDataById(infoData);
|
|
|
|
|
|
- createSignatureContractId(reportData);
|
|
|
|
|
|
//对上传的文件数据进行持久化操作
|
|
|
List<ProjectReportWorkAttachmentDTO> cwFileInfoList = report.getCwFileInfoList();
|
|
@@ -2393,6 +2394,27 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
return cwProjectReportSignature.getId();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 将签章表中的流程状态调整为已完成状态
|
|
|
+ * @param cwProjectReportData
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String modifySignatureStatus (CwProjectReportData cwProjectReportData,String status){
|
|
|
+ String signatureType = cwProjectReportData.getSignatureType();
|
|
|
+ CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectOne(new QueryWrapper<CwProjectReportSignature>().lambda()
|
|
|
+ .eq(CwProjectReportSignature::getReportId, cwProjectReportData.getId())
|
|
|
+ .eq(CwProjectReportSignature::getType, signatureType)
|
|
|
+ );
|
|
|
+ cwProjectReportSignature.setStatus(status);
|
|
|
+ if("4".equals(status)){
|
|
|
+ cwProjectReportSignature.setSealAdminStatus("0");
|
|
|
+ cwProjectReportSignature.setSignatureAnnotator1Status("0");
|
|
|
+ cwProjectReportSignature.setSignatureAnnotator2Status("0");
|
|
|
+ }
|
|
|
+ cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
|
|
|
+ return cwProjectReportSignature.getId();
|
|
|
+ }
|
|
|
+
|
|
|
public CwProjectReportData queryByContractId(String contractId){
|
|
|
CwProjectReportData reportData = reportMapper.queryByContractId(contractId);
|
|
|
return reportData;
|
|
@@ -2614,6 +2636,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
map.put("signatureType", reportSignatureInfo.getSignatureAnnotator2Status());
|
|
|
break;
|
|
|
case "签章管理员审核":
|
|
|
+ case "三级复核及签章":
|
|
|
map.put("signatureType", reportSignatureInfo.getSealAdminStatus());
|
|
|
break;
|
|
|
}
|
|
@@ -2770,6 +2793,52 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 根据报告id,撤回复核签章
|
|
|
+ * @param reportId
|
|
|
+ */
|
|
|
+ public void rebackReviewSign (String reportId) {
|
|
|
+ // 通过报告id获取签章数据
|
|
|
+ List<CwProjectReportSignature> signList = cwProjectReportSignatureMapper.selectList(new QueryWrapper<CwProjectReportSignature>().lambda().eq(CwProjectReportSignature::getReportId, reportId));
|
|
|
+ // 将签章数据的状态改为初始值
|
|
|
+ if (CollectionUtil.isNotEmpty(signList)) {
|
|
|
+ signList.stream().forEach(item -> {
|
|
|
+ item.setStatus("0"); // 签章流程的状态改为:未发起
|
|
|
+ item.setSignatureAnnotator1Status("0"); // 签字注师1签章状态改为:未签章
|
|
|
+ item.setSignatureAnnotator2Status("0"); // 签字注师2签章状态改为:未签章
|
|
|
+ item.setSealAdminStatus("0"); // 盖章管理员签章状态改为:未签章
|
|
|
+ cwProjectReportSignatureMapper.updateById(item); // 将修改的数据保存
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 删除已盖章的附件
|
|
|
+ // 1. 查询到当前报告的附件
|
|
|
+// List<WorkAttachmentInfo> workAttachments = ossServiceMapper.selectList(new LambdaQueryWrapper<WorkAttachmentInfo>().eq(WorkAttachmentInfo::getAttachmentId, reportId));
|
|
|
+ List<WorkAttachmentInfo> workAttachments = SpringUtil.getBean(IWorkAttachmentApi.class).selectListByAttachmentId(reportId);
|
|
|
+ // 2. 查询哪些附件是已盖章的
|
|
|
+ List<String> delIds = new ArrayList<>();
|
|
|
+ workAttachments.stream().forEach(item -> {
|
|
|
+ int i = reportMapper.checkIsSign(item.getId());
|
|
|
+ if (i != 0) {
|
|
|
+ delIds.add(item.getId());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 3. 删除已盖章的附件(报告签章附件关联表 cw_project_report_file)
|
|
|
+ workAttachments.stream().forEach(item -> {
|
|
|
+ reportMapper.deleteIsSign(item.getId()); // 物理删除
|
|
|
+ });
|
|
|
+ // 4. 删除已盖章的附件(附件表 work_attachment)
|
|
|
+ if (CollectionUtil.isNotEmpty(delIds)) {
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByIds(JSON.toJSONString(delIds));
|
|
|
+// ossServiceMapper.deleteBatchIds(delIds); // 逻辑删除
|
|
|
+ }
|
|
|
+ // 5. 根据报告id删除报告归档信息 // 逻辑删除
|
|
|
+ cwProjectReportArchiveMapper.delete(new LambdaQueryWrapper<CwProjectReportArchive>().eq(CwProjectReportArchive::getReportId, reportId));
|
|
|
+
|
|
|
+ //6.修改质量复核流程信息
|
|
|
+ mapper.updateReviewStatusByReportId("0",reportId);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 根据报告id修改签字注师1、2,所属行业以及业务对象的值
|
|
|
* @param cwProjectReport
|
|
|
*/
|