Browse Source

# 巡检内容定义查询接口

zhongwei
haungxing 1 year ago
parent
commit
0dc66e9f8b
  1. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java
  2. 2
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java
  3. 5
      hzims-service/inspect/pom.xml
  4. 1
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java
  5. 14
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java
  6. 16
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentDefinitionController.java
  7. 29
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationPushConfigService.java

2
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";

2
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")

5
hzims-service/inspect/pom.xml

@ -137,6 +137,11 @@
<version>6.0.7</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-oss-minio</artifactId>
<version>2.7.3.RELEASE</version>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>message-api</artifactId>
<version>${hzims.project.version}</version>

1
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java

@ -63,3 +63,4 @@ public class ContentDefinitionClient implements IContentDefinitionClient {
}
}

14
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<ContentDefinition
*/
List<ContentDefinitionVO> list(ContentDefinitionDTO request);
default LambdaQueryWrapper<ContentDefinitionEntity> getQueryWrapper(ContentDefinitionEntity entity) {
QueryWrapper<ContentDefinitionEntity> queryWrapper = Condition.getQueryWrapper(entity);
LambdaQueryWrapper<ContentDefinitionEntity> 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;
}
}

16
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<IPage<ContentDefinitionVO>> page(ContentDefinitionDTO content, Query query) {
QueryWrapper<ContentDefinitionEntity> 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<ContentDefinitionVO>> list(ContentDefinitionDTO content) {
LambdaQueryWrapper<ContentDefinitionEntity> lambda = contentDefinitionService.getQueryWrapper(BeanUtil.copy(content, ContentDefinitionEntity.class));
lambda.last("limit 1,50;");
return R.data(ContentDefinitionWrapper.build().listVO(contentDefinitionService.list(lambda)));
}
}

29
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<StationPushConfigEntity> {
/**
* 查询列表
* @param request 查询条件
* @return
*/
List<StationPushConfigVO> list(StationPushConfigDTO request);
/**
* 分页查询
* @param query 分页条件
* @param request 查询条件
* @return
*/
IPage<StationPushConfigVO> listPage(Query query,StationPushConfigDTO request);
}
Loading…
Cancel
Save