From 9a8a4a431c61d22a334003b2e8a52571ea809920 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: Mon, 24 Mar 2025 13:15:34 +0800
Subject: [PATCH] 增加业务类别
---
assess-system/src/main/java/com/gkhy/assess/system/service/impl/AssWorkNotificationServiceImpl.java | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/assess-system/src/main/java/com/gkhy/assess/system/service/impl/AssWorkNotificationServiceImpl.java b/assess-system/src/main/java/com/gkhy/assess/system/service/impl/AssWorkNotificationServiceImpl.java
index b422bac..a3ba2d6 100644
--- a/assess-system/src/main/java/com/gkhy/assess/system/service/impl/AssWorkNotificationServiceImpl.java
+++ b/assess-system/src/main/java/com/gkhy/assess/system/service/impl/AssWorkNotificationServiceImpl.java
@@ -2,9 +2,12 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.assess.common.exception.ApiException;
+import com.gkhy.assess.system.domain.AssProject;
import com.gkhy.assess.system.domain.AssWorkNotification;
+import com.gkhy.assess.system.enums.AccessoryFileTypeEnum;
import com.gkhy.assess.system.enums.ReportProgressEnum;
import com.gkhy.assess.system.mapper.AssWorkNotificationMapper;
+import com.gkhy.assess.system.service.AssAccessoryFileService;
import com.gkhy.assess.system.service.AssProjectService;
import com.gkhy.assess.system.service.AssWorkNotificationService;
import com.gkhy.assess.system.utils.ShiroUtils;
@@ -24,13 +27,25 @@
public class AssWorkNotificationServiceImpl extends ServiceImpl<AssWorkNotificationMapper, AssWorkNotification> implements AssWorkNotificationService {
@Autowired
private AssProjectService projectService;
-
+ @Autowired
+ private AssAccessoryFileService accessoryFileService;
@Override
@Transactional(rollbackFor = RuntimeException.class)
public int addWorkNotification(AssWorkNotification workNotification) {
Long projectId=workNotification.getProjectId();
projectService.checkUserAllowed(projectId);
checkWorkNotificationCount(projectId);
+ AssProject projectById = projectService.getProjectById(projectId);
+ if (projectById==null){
+ throw new ApiException("项目不存在");
+ }
+ if(projectById.getEstimateType() != 33){
+ Integer fileCount=accessoryFileService.getAccessoryFileCountByProjectId(projectId,null, AccessoryFileTypeEnum.EMPLOYMENT_NOTICE.getCode());
+ if(fileCount==0){
+ throw new ApiException("未上传从业告知书");
+ }
+ }
+
//校验项目状态
projectService.checkReportProgress(projectId, ReportProgressEnum.ESTIMATE_PLAN);
workNotification.setCreateBy(ShiroUtils.getSysUser().getUsername());
--
Gitblit v1.9.2