From 0dc66e9f8b14907878ed6c004f00dab4f62b8a03 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 5 Jul 2023 17:33:08 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E5=B7=A1=E6=A3=80=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/OperationalConstants.java | 2 +- .../obj/entity/ContentDefinitionEntity.java | 2 ++ hzims-service/inspect/pom.xml | 5 ++++ .../inspect/obj/feign/ContentDefinitionClient.java | 1 + .../obj/services/IContentDefinitionService.java | 14 +++++++++++ .../obj/web/ContentDefinitionController.java | 16 +++++++++--- .../station/service/IStationPushConfigService.java | 29 ++++++++++++++++++++++ 7 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationPushConfigService.java diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java index 93810fc..22a4998 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java @@ -4,7 +4,7 @@ import lombok.Getter; public class OperationalConstants { - public final static String APP_NAME = "hzims-operational"; + public final static String APP_NAME = "hzims-operational-hx"; diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java index aada419..7dbba17 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java @@ -26,10 +26,12 @@ import java.io.Serializable; public class ContentDefinitionEntity extends TenantEntity implements Serializable { @ApiModelProperty(value = "内容编码") + @QueryField(condition = SqlCondition.EQUAL) private String code; @ApiModelProperty(value = "内容名称,长度必须为1到128") @Size(min=1,max = 128,message ="内容名称长度必须为1到128") + @QueryField(condition = SqlCondition.LIKE) private String name; @ApiModelProperty(value = "内容描述,长度必须为0到512") diff --git a/hzims-service/inspect/pom.xml b/hzims-service/inspect/pom.xml index dd981a8..f3610b8 100644 --- a/hzims-service/inspect/pom.xml +++ b/hzims-service/inspect/pom.xml @@ -137,6 +137,11 @@ 6.0.7 + org.springblade + blade-starter-oss-minio + 2.7.3.RELEASE + + com.hnac.hzims message-api ${hzims.project.version} diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java index 4c75758..f26b2e6 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java @@ -63,3 +63,4 @@ public class ContentDefinitionClient implements IContentDefinitionClient { } } + diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java index 710d624..5d6a014 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java @@ -1,9 +1,14 @@ package com.hnac.hzinfo.inspect.obj.services; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.hnac.hzinfo.inspect.obj.dto.ContentDefinitionDTO; import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; import com.hnac.hzinfo.inspect.obj.vo.ContentDefinitionVO; import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; import java.util.List; @@ -16,4 +21,13 @@ public interface IContentDefinitionService extends BaseService list(ContentDefinitionDTO request); + default LambdaQueryWrapper getQueryWrapper(ContentDefinitionEntity entity) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(entity); + LambdaQueryWrapper lambda = queryWrapper.lambda() + .eq(Func.isNotEmpty(entity.getCreateDept()), ContentDefinitionEntity::getCreateDept, entity.getCreateDept()) + .eq(Func.isNotEmpty(entity.getCreateUser()), ContentDefinitionEntity::getCreateUser, entity.getCreateUser()) + .eq(Func.isNotEmpty(entity.getStatus()), ContentDefinitionEntity::getStatus, entity.getStatus()); + return lambda; + } + } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentDefinitionController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentDefinitionController.java index fc28f45..40ba6a0 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentDefinitionController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentDefinitionController.java @@ -1,5 +1,6 @@ package com.hnac.hzinfo.inspect.obj.web; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; @@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * @ClassName ContentDefinitionController * @description: 巡检内容定义controller @@ -40,12 +43,17 @@ public class ContentDefinitionController extends BladeController { @ApiOperation("分页查询") @ApiOperationSupport(order = 1) public R> page(ContentDefinitionDTO content, Query query) { - QueryWrapper queryWrapper = Condition.getQueryWrapper(BeanUtil.copy(content, ContentDefinitionEntity.class)); - queryWrapper.lambda().eq(Func.isEmpty(content.getCreateDept()),ContentDefinitionEntity::getCreateDept,content.getCreateDept()) - .eq(Func.isEmpty(content.getCreateUser()),ContentDefinitionEntity::getCreateUser,content.getCreateUser()); - IPage page = contentDefinitionService.page(Condition.getPage(query), queryWrapper); + IPage page = contentDefinitionService.page(Condition.getPage(query), contentDefinitionService.getQueryWrapper(BeanUtil.copy(content,ContentDefinitionEntity.class))); page.setRecords(ContentDefinitionWrapper.build().listVO(page.getRecords())); return R.data(page); } + @GetMapping("/list") + @ApiOperation("查询,最多查询五十条") + @ApiOperationSupport(order = 2) + public R> list(ContentDefinitionDTO content) { + LambdaQueryWrapper lambda = contentDefinitionService.getQueryWrapper(BeanUtil.copy(content, ContentDefinitionEntity.class)); + lambda.last("limit 1,50;"); + return R.data(ContentDefinitionWrapper.build().listVO(contentDefinitionService.list(lambda))); + } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationPushConfigService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationPushConfigService.java new file mode 100644 index 0000000..2189b6c --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationPushConfigService.java @@ -0,0 +1,29 @@ +package com.hnac.hzims.operational.station.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.operational.station.dto.StationPushConfigDTO; +import com.hnac.hzims.operational.station.entity.StationPushConfigEntity; +import com.hnac.hzims.operational.station.vo.StationPushConfigVO; +import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.support.Query; + +import java.util.List; + +public interface IStationPushConfigService extends BaseService { + + /** + * 查询列表 + * @param request 查询条件 + * @return + */ + List list(StationPushConfigDTO request); + + /** + * 分页查询 + * @param query 分页条件 + * @param request 查询条件 + * @return + */ + IPage listPage(Query query,StationPushConfigDTO request); + +}