|
@@ -68,6 +68,9 @@ public class CwProjectReportReviewService extends ServiceImpl<CwProjectReportRev
|
|
|
@Resource
|
|
|
private TaskService taskService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private CwProjectReportReviewMapper cwProjectReportReviewMapper;
|
|
|
+
|
|
|
public CwProjectReportData queryByReportId(String id) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
|
|
|
CwProjectReportData data = mapper.selectByPortId(id);
|
|
|
//查询复核相关信息
|
|
@@ -200,6 +203,13 @@ public class CwProjectReportReviewService extends ServiceImpl<CwProjectReportRev
|
|
|
}
|
|
|
infoData.setReportId(review.getReportId());
|
|
|
infoData.setReportNo(documentNo);
|
|
|
+ // 如果数据已经生成报告文号,则不重复生成
|
|
|
+ CwProjectInfoData byReportId = infoMapper.getByReportId(review.getReportId());
|
|
|
+ if(ObjectUtil.isNotEmpty(byReportId)) {
|
|
|
+ if (StringUtils.isNotBlank(byReportId.getReportNo())) {
|
|
|
+ infoData.setReportNo(byReportId.getReportNo());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(reportData.getReportNumber())){
|
|
|
infoData.setReportNumber(reportData.getReportNumber());
|
|
@@ -355,4 +365,51 @@ public class CwProjectReportReviewService extends ServiceImpl<CwProjectReportRev
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public String getHaveReportNo(String reportId) {
|
|
|
+ // 根据报告id查询是否已生成报告文号
|
|
|
+ CwProjectInfoData byReportId = infoMapper.getByReportId(reportId);
|
|
|
+ if(ObjectUtil.isNotEmpty(byReportId)) {
|
|
|
+ if (StringUtils.isNotBlank(byReportId.getReportNo())) {
|
|
|
+ return "1"; // 已生成
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "0"; // 未生成
|
|
|
+ }
|
|
|
+
|
|
|
+ // 生成报告文号
|
|
|
+ public void saveReportNo(String reportId) {
|
|
|
+ String documentNo = "";
|
|
|
+ try {
|
|
|
+ // 根据reportId查询 new_line数据
|
|
|
+ CwProjectInfoData byReportId = infoMapper.getByReportId(reportId);
|
|
|
+ // 生成报告文号
|
|
|
+ documentNo = serialnumTplService.genSerialNumNoSort(UserUtils.getCurrentUserDTO().getCompanyDTO().getId(), CwProjectInfoData.BIZ_CODE);
|
|
|
+ if(documentNo.contains("{replacement}")){
|
|
|
+ if(StringUtils.isNotBlank(byReportId.getReportType())){
|
|
|
+ switch (byReportId.getReportType()){
|
|
|
+ case "1":
|
|
|
+ documentNo = documentNo.replace("{replacement}","基");
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ documentNo = documentNo.replace("{replacement}","咨");
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ documentNo = documentNo.replace("{replacement}","审");
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ documentNo = documentNo.replace("{replacement}","验");
|
|
|
+ break;
|
|
|
+ case "5":
|
|
|
+ documentNo = documentNo.replace("{replacement}","特");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ // 保存报告文号
|
|
|
+ infoMapper.updateReportNoByReportId(reportId,documentNo);
|
|
|
+ }
|
|
|
}
|