From 600097ae2823af76eaa14c3c79dcad61e7cc5413 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 30 May 2022 15:55:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=A1=B9=E7=9B=AE=E8=AF=A6?= =?UTF-8?q?=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/ServiceProjectListFormDTO.java | 6 ++++++ .../controller/IcServiceProjectController.java | 13 +++++++++++++ .../epmet/service/IcServiceProjectService.java | 9 +++++++++ .../service/impl/IcServiceProjectServiceImpl.java | 15 +++++++++++++++ .../main/resources/mapper/IcServiceProjectDao.xml | 7 ++++++- 5 files changed, 49 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java index 19ecf87d87..ff265a8a44 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -15,6 +16,8 @@ public class ServiceProjectListFormDTO extends PageFormDTO implements Serializab private static final long serialVersionUID = -6508966695564469253L; + public interface ServiceProjectDetail{} + private String serviceCategoryKey; private String serviceName; private String serviceContent; @@ -23,4 +26,7 @@ public class ServiceProjectListFormDTO extends PageFormDTO implements Serializab private String userId; private String agencyId; + @NotBlank(message = "serviceProjectId不能为空",groups = ServiceProjectDetail.class) + private String serviceProjectId; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java index 1a3b87b4f6..4a0ef50363 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java @@ -15,6 +15,7 @@ import com.epmet.dto.form.IcServiceEditFormDTO; import com.epmet.dto.form.ServiceProjectFormDTO; import com.epmet.dto.form.ServiceProjectListFormDTO; import com.epmet.dto.result.IcServiceRecDetailRes; +import com.epmet.dto.result.ServiceProjectListResultDTO; import com.epmet.service.IcServiceProjectService; import com.epmet.service.IcServiceRecordService; import org.springframework.beans.factory.annotation.Autowired; @@ -107,6 +108,18 @@ public class IcServiceProjectController { return new Result().ok(icServiceProjectService.serviceProjectList(formDTO)); } + /** + * Desc: 服务项目详情 + * @param formDTO + * @author zxc + * @date 2022/5/30 15:46 + */ + @PostMapping("serviceProjectDetail") + public Result serviceProjectDetail(@RequestBody ServiceProjectListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ServiceProjectListFormDTO.ServiceProjectDetail.class); + return new Result().ok(icServiceProjectService.serviceProjectDetail(formDTO)); + } + /** * Desc: 修改【服务项目】 * @param formDTO diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java index d81be7f0f2..aa02487cab 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcServiceProjectDTO; import com.epmet.dto.form.ServiceProjectFormDTO; import com.epmet.dto.form.ServiceProjectListFormDTO; +import com.epmet.dto.result.ServiceProjectListResultDTO; import com.epmet.entity.IcServiceProjectEntity; import java.util.List; @@ -94,6 +95,14 @@ public interface IcServiceProjectService extends BaseService serviceProjectList = baseDao.getServiceProjectList(formDTO); + if (CollectionUtils.isNotEmpty(serviceProjectList)){ + return serviceProjectList.get(NumConstant.ZERO); + } + return new ServiceProjectListResultDTO(); + } + /** * Desc: 修改【服务项目】 * @param formDTO diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml index 0a7e0183fb..f702b0c98a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml @@ -37,7 +37,12 @@ FROM ic_service_project WHERE DEL_FLAG = 0 AND ENABLED = 0 - AND AGENCY_ID = #{agencyId} + + AND ID = #{serviceProjectId} + + + AND AGENCY_ID = #{agencyId} + AND SERVICE_CATEGORY_KEY = #{serviceCategoryKey}