Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
段飞宇 1 year ago
parent
commit
7c9c6ffbd9
  1. 11
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IProjectClient.java
  2. 35
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/request/ProjectContentRequest.java
  3. 6
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ProjectVO.java
  4. 10
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java
  5. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java
  6. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java
  7. 32
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml
  8. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java

11
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.ContentDTO;
import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO;
import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; 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 com.hnac.hzinfo.inspect.obj.vo.ProjectVO;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient; 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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -34,12 +37,12 @@ public interface IProjectClient {
/** /**
* *
* @param emCode 设备名称 * @param emCode 设备编号
* @param content namerecordTypecheckType * @param content namerecordTypecheckType
* @param query 分页 * @param query 分页参数
* @return * @return
*/ */
@GetMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE) @PostMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE)
R<ProjectVO> getProjectAndContentByEmCode(@NotNull @Valid String emCode, ContentDTO content, Query query); R<ProjectVO> getProjectAndContentByEmCode(@RequestBody ProjectContentRequest request);
} }

35
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;
}

6
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; package com.hnac.hzinfo.inspect.obj.vo;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.dto.ProjectDTO;
import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
@ -8,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
@ -20,9 +22,9 @@ import java.util.List;
@ApiModel("项目VO对象") @ApiModel("项目VO对象")
@Data @Data
@EqualsAndHashCode @EqualsAndHashCode
public class ProjectVO extends ProjectEntity { public class ProjectVO extends ProjectEntity implements Serializable {
@ApiModelProperty("巡检内容列表") @ApiModelProperty("巡检内容列表")
private IPage<ContentVO> contentList; private List<ContentVO> contentList;
} }

10
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.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; 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.services.ProjectService;
import com.hnac.hzinfo.inspect.obj.vo.ProjectVO; import com.hnac.hzinfo.inspect.obj.vo.ProjectVO;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -41,9 +42,12 @@ public class ProjectClient extends BladeController implements IProjectClient {
} }
@Override @Override
@GetMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE) @PostMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE)
public R<ProjectVO> getProjectAndContentByEmCode(@NotNull @Valid String emCode, ContentDTO content, Query query) { public R<ProjectVO> getProjectAndContentByEmCode(@RequestBody ProjectContentRequest request) {
return R.data(projectService.getProjectAndContentByEmCode(emCode,content,query)); Query query = new Query();
query.setSize(request.getSize());
query.setCurrent(request.getCurrent());
return R.data(projectService.getProjectAndContentByEmCode(request.getEmCode(), request.getContentDTO(), query));
} }
} }

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java

@ -123,8 +123,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectMapper, ProjectEn
LambdaQueryWrapper<ContentEntity> wrapper = Condition.getQueryWrapper(BeanUtil.copy(content,ContentEntity.class)).lambda(); LambdaQueryWrapper<ContentEntity> wrapper = Condition.getQueryWrapper(BeanUtil.copy(content,ContentEntity.class)).lambda();
wrapper.in(CollectionUtil.isNotEmpty(contentIdList),ContentEntity::getId, contentIdList); wrapper.in(CollectionUtil.isNotEmpty(contentIdList),ContentEntity::getId, contentIdList);
IPage page = contentService.page(Condition.getPage(query), wrapper); IPage page = contentService.page(Condition.getPage(query), wrapper);
page.setRecords(ContentWrapper.build().listVO(page.getRecords())); projectVO.setContentList(ContentWrapper.build().listVO(page.getRecords()));
projectVO.setContentList(page);
} }
return projectVO; return projectVO;
} }

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java

@ -154,7 +154,7 @@ public class ProjectController {
@GetMapping("/getProjectAndContentByEmCode") @GetMapping("/getProjectAndContentByEmCode")
@ApiOperation(value = "根据设备编号获取项目以及内容列表(分页展示)") @ApiOperation(value = "根据设备编号获取项目以及内容列表(分页展示)")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
public R<ProjectVO> 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)); return R.data(projectService.getProjectAndContentByEmCode(emCode,content,query));
} }
} }

32
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml

@ -48,48 +48,46 @@
</select> </select>
<select id="pageCondition" resultType="com.hnac.hzims.operational.access.vo.OperAccessTaskVO"> <select id="pageCondition" resultType="com.hnac.hzims.operational.access.vo.OperAccessTaskVO">
SELECT SELECT t.*,p.name as planName
t1.*, t3.`NAME` as planName FROM hzims_oper_access_task t
FROM left join hzims_oper_access_plan p
hzims_oper_access_task t1 LEFT JOIN hzims_oper_access_content t2 ON t1.ID = t2.ID on t.plan_id = p.id
AND t2.IS_DELETED = 0 LEFT JOIN hzims_oper_access_plan t3 ON t2.PLAN_ID = t3.ID
AND t3.IS_DELETED = 0
WHERE WHERE
t1.IS_DELETED =0 t1.IS_DELETED =0
<if test="req.id != null"> <if test="req.id != null">
and t1.id = #{req.id} and t.id = #{req.id}
</if> </if>
<if test="req.code != null and req.code != ''"> <if test="req.code != null and req.code != ''">
AND t1.`CODE` LIKE CONCAT('%',#{req.code},'%') AND t.`CODE` LIKE CONCAT('%',#{req.code},'%')
</if> </if>
<if test="req.handler != null"> <if test="req.handler != null">
AND t1.`HANDLER`=#{req.handler} AND t.`HANDLER`=#{req.handler}
</if> </if>
<if test="req.status != null"> <if test="req.status != null">
AND t1.`STATUS`=#{req.status} AND t.`STATUS`=#{req.status}
</if> </if>
<if test="req.planId != null"> <if test="req.planId != null">
AND t3.ID =#{req.planId} AND p.ID =#{req.planId}
</if> </if>
<if test="req.name != null and req.name != ''"> <if test="req.name != null and req.name != ''">
AND t1.`NAME` LIKE CONCAT('%',#{req.name},'%') AND t.`NAME` LIKE CONCAT('%',#{req.name},'%')
</if> </if>
<if test="req.excludeNullTicket != null and req.excludeNullTicket == 1"> <if test="req.excludeNullTicket != null and req.excludeNullTicket == 1">
and t1.`TICKET_ID` is null and t.`TICKET_ID` is null
</if> </if>
<if test="req.startTime != null and req.startTime != ''"> <if test="req.startTime != null and req.startTime != ''">
and t1.`PLAN_START_TIME` &gt; #{req.startTime} and t.`PLAN_START_TIME` &gt; #{req.startTime}
</if> </if>
<if test="req.endTime != null and req.startTime != '' "> <if test="req.endTime != null and req.startTime != '' ">
and t1.`PLAN_START_TIME` &lt; #{req.endTime} and t.`PLAN_START_TIME` &lt; #{req.endTime}
</if> </if>
<if test="req.deptIds != null"> <if test="req.deptIds != null">
and t1.create_dept in and t.create_dept in
<foreach collection="req.deptIds" item="item" index="index" open="(" close=")" separator=","> <foreach collection="req.deptIds" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
ORDER BY t1.ID DESC ORDER BY t.ID DESC
</select> </select>
<select id="selectByEmCode" resultType="com.hnac.hzims.operational.access.entity.OperAccessTaskEntity" parameterType="list"> <select id="selectByEmCode" resultType="com.hnac.hzims.operational.access.entity.OperAccessTaskEntity" parameterType="list">

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java

@ -112,6 +112,7 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{
eq(OperAccessMaterialEntity::getPlanId, entity.getId()); eq(OperAccessMaterialEntity::getPlanId, entity.getId());
eq(OperAccessMaterialEntity::getIsDeleted, 0L); eq(OperAccessMaterialEntity::getIsDeleted, 0L);
}}); }});
log.error("save_access_material : {}",materials);
if(CollectionUtil.isNotEmpty(materials)){ if(CollectionUtil.isNotEmpty(materials)){
materialService.deleteLogic(materials.stream().map(OperAccessMaterialEntity::getId).collect(Collectors.toList())); materialService.deleteLogic(materials.stream().map(OperAccessMaterialEntity::getId).collect(Collectors.toList()));
} }

Loading…
Cancel
Save