diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IProjectClient.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IProjectClient.java index c7306b5..2f9131c 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IProjectClient.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IProjectClient.java @@ -4,10 +4,13 @@ import com.hnac.hzinfo.inspect.Constants; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; +import com.hnac.hzinfo.inspect.obj.request.ProjectContentRequest; import com.hnac.hzinfo.inspect.obj.vo.ProjectVO; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.cloud.openfeign.SpringQueryMap; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -34,12 +37,12 @@ public interface IProjectClient { /** * - * @param emCode 设备名称 + * @param emCode 设备编号 * @param content name、recordType、checkType - * @param query 分页 + * @param query 分页参数 * @return */ - @GetMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE) - R getProjectAndContentByEmCode(@NotNull @Valid String emCode, ContentDTO content, Query query); + @PostMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE) + R getProjectAndContentByEmCode(@RequestBody ProjectContentRequest request); } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/request/ProjectContentRequest.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/request/ProjectContentRequest.java new file mode 100644 index 0000000..e504194 --- /dev/null +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/request/ProjectContentRequest.java @@ -0,0 +1,35 @@ +package com.hnac.hzinfo.inspect.obj.request; + +import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @ClassName ProjectContentRequest + * @description: + * @author: hx + * @create: 2023-07-10 15:53 + * @Version 4.0 + **/ +@Data +@ApiModel("巡检项目-巡检内容feign接口查询对象") +@EqualsAndHashCode +public class ProjectContentRequest implements Serializable { + + @ApiModelProperty("设备编号") + private String emCode; + + @ApiModelProperty("巡检内容查询条件") + private ContentDTO contentDTO; + + @ApiModelProperty("当前页") + private int current; + + @ApiModelProperty("当前页条数,-1为查询所有") + private int size; + +} diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ProjectVO.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ProjectVO.java index 8d50281..8012269 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ProjectVO.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ProjectVO.java @@ -1,6 +1,7 @@ package com.hnac.hzinfo.inspect.obj.vo; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; import io.swagger.annotations.ApiModel; @@ -8,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import java.io.Serializable; import java.util.List; /** @@ -20,9 +22,9 @@ import java.util.List; @ApiModel("项目VO对象") @Data @EqualsAndHashCode -public class ProjectVO extends ProjectEntity { +public class ProjectVO extends ProjectEntity implements Serializable { @ApiModelProperty("巡检内容列表") - private IPage contentList; + private List contentList; } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java index 585ff00..83b0650 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java @@ -3,6 +3,7 @@ package com.hnac.hzinfo.inspect.obj.feign; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; +import com.hnac.hzinfo.inspect.obj.request.ProjectContentRequest; import com.hnac.hzinfo.inspect.obj.services.ProjectService; import com.hnac.hzinfo.inspect.obj.vo.ProjectVO; import io.swagger.annotations.ApiOperation; @@ -41,9 +42,12 @@ public class ProjectClient extends BladeController implements IProjectClient { } @Override - @GetMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE) - public R getProjectAndContentByEmCode(@NotNull @Valid String emCode, ContentDTO content, Query query) { - return R.data(projectService.getProjectAndContentByEmCode(emCode,content,query)); + @PostMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE) + public R getProjectAndContentByEmCode(@RequestBody ProjectContentRequest request) { + Query query = new Query(); + query.setSize(request.getSize()); + query.setCurrent(request.getCurrent()); + return R.data(projectService.getProjectAndContentByEmCode(request.getEmCode(), request.getContentDTO(), query)); } } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java index 5cd8fec..d2ecc0c 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java @@ -123,8 +123,7 @@ public class ProjectServiceImpl extends BaseServiceImpl wrapper = Condition.getQueryWrapper(BeanUtil.copy(content,ContentEntity.class)).lambda(); wrapper.in(CollectionUtil.isNotEmpty(contentIdList),ContentEntity::getId, contentIdList); IPage page = contentService.page(Condition.getPage(query), wrapper); - page.setRecords(ContentWrapper.build().listVO(page.getRecords())); - projectVO.setContentList(page); + projectVO.setContentList(ContentWrapper.build().listVO(page.getRecords())); } return projectVO; } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java index c22f3c9..7a95a9b 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java @@ -154,7 +154,7 @@ public class ProjectController { @GetMapping("/getProjectAndContentByEmCode") @ApiOperation(value = "根据设备编号获取项目以及内容列表(分页展示)") @ApiOperationSupport(order = 7) - public R getProjectAndContentByEmCode(@NotNull @Valid String emCode, ContentDTO content, Query query) { + public R getProjectAndContentByEmCode(String emCode, ContentDTO content, Query query) { return R.data(projectService.getProjectAndContentByEmCode(emCode,content,query)); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml index b876795..bd4b72a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml @@ -48,48 +48,46 @@