From 57eaea76885a5d0554fdac70bf88c03f2cdaa5a4 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 25 Jul 2022 17:41:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EserviceCategoryKey=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E5=8F=91=E8=B5=B7=E6=9C=8D=E5=8A=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=9F=A5=E8=AF=A2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java | 5 ++++- .../com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java | 3 +++ .../java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java | 6 ++++++ .../com/epmet/controller/IcServiceRecordV2Controller.java | 1 + .../main/java/com/epmet/entity/IcServiceRecordV2Entity.java | 2 ++ .../db/migration/V0.0.26__add_service_v2_category.sql | 1 + .../src/main/resources/mapper/IcServiceRecordV2Dao.xml | 1 + 7 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java index d86138657e..be41f030b1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceRecordV2DTO.java @@ -1,8 +1,9 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -109,4 +110,6 @@ public class IcServiceRecordV2DTO implements Serializable { */ private String policyId; + private String serviceCategoryKey; + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java index fff02eb997..0de6bc737f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceRecordV2AddEditFormDTO.java @@ -37,6 +37,9 @@ public class IcServiceRecordV2AddEditFormDTO implements Serializable { */ @NotBlank(message = "服务名称不能为空", groups = {AddGroup.class}) private String serviceOrgType; + + @NotBlank(message = "serviceCategoryKey不能为空", groups = {AddGroup.class}) + private String serviceCategoryKey; /** * 服务组织Id */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java index 675bd575b4..a9eea1aa2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceRecordV2ListFormDTO.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,11 +16,16 @@ public class ServiceRecordV2ListFormDTO extends PageFormDTO implements Serializa private static final long serialVersionUID = 88592831607216246L; + public interface ServiceRecordV2ListForm{} + /** * 服务名称 */ private String serviceName; + @NotBlank(message = "serviceCategoryKey不能为空",groups = ServiceRecordV2ListForm.class) + private String serviceCategoryKey; + /** * 服务组织ID */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java index f451fafc81..9449689fc2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceRecordV2Controller.java @@ -92,6 +92,7 @@ public class IcServiceRecordV2Controller { */ @PostMapping("list") public Result serviceRecordV2List(@LoginUser TokenDto tokenDto, @RequestBody ServiceRecordV2ListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ServiceRecordV2ListFormDTO.ServiceRecordV2ListForm.class); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); return new Result().ok(icServiceRecordV2Service.serviceRecordV2List(formDTO)); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java index e18eda964e..7f32333f2e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordV2Entity.java @@ -79,4 +79,6 @@ public class IcServiceRecordV2Entity extends BaseEpmetEntity { */ private String policyId; + private String serviceCategoryKey; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql new file mode 100644 index 0000000000..d09a7eca73 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.26__add_service_v2_category.sql @@ -0,0 +1 @@ +alter table ic_service_record_v2 add COLUMN SERVICE_CATEGORY_KEY VARCHAR(64) comment '服务类别KEY' AFTER remark; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml index 7a7b4f1a68..89f8764a30 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml @@ -19,6 +19,7 @@ left JOIN ic_service_feedback_v2 sf ON sf.SERVICE_RECORD_ID = sr.ID AND sf.DEL_FLAG = 0 INNER JOIN ic_service_scope_v2 ss ON ss.SERVICE_RECORD_ID = sr.ID AND ss.DEL_FLAG = '0' WHERE sr.DEL_FLAG = '0' + AND sr.SERVICE_CATEGORY_KEY = #{serviceCategoryKey} AND ss.OBJECT_ID_PATH LIKE concat('%',#{orgId},'%') AND sr.CUSTOMER_ID = #{customerId}