Commit 721e118d authored by tianbo's avatar tianbo

feat(jg): 添加装置和管道查询功能并优化报废流程

- 在 JgScrapCancelController 中添加查询装置下非报废管道的接口 - 新增查询可用装置列表的分页接口 - 在 JgScrapCancelMapper 中添加 selectPipeLinePage 和 queryJgProjectContraptionPage 方法 - 实现 SQL 查询语句支持装置和管道数据过滤 - 优化报废流程中的设备重复使用检查逻辑 - 区分压力管道和普通气瓶的重复检查策略
parent dff7c98e
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
......@@ -9,10 +10,12 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgScrapCancelDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancel;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.ScrapCancelVo;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 设备报废注销 Mapper 接口
......@@ -55,4 +58,8 @@ public interface JgScrapCancelMapper extends BaseMapper<JgScrapCancel> {
List<Map<String, Object>> getScrappedDeviceCount(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto);
List<CompanyEquipCountDto> queryForFlowingEquipList();
IPage<Map<String, Object>> selectPipeLinePage(@Param("page") Page<Map<String, Object>> page, @Param("projectContraptionId") String projectContraptionId, @Param("filters") Map<String, Object> filters);
IPage<IdxBizJgProjectContraptionDto> queryJgProjectContraptionPage(Page<IdxBizJgProjectContraptionDto> page, String useUnitCreditCode, Set<String> proIds, @Param("filters") Map<String, Object> filters);
}
......@@ -309,4 +309,64 @@
and a.audit_status in ('三级待受理', '二级待受理', '一级待受理')
GROUP BY a.use_unit_code
</select>
<select id="selectPipeLinePage" resultType="java.util.Map">
select * from (
<include refid="com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper.page-list-pipeline"/>
WHERE
ui."PROJECT_CONTRAPTION_ID" = #{projectContraptionId}
and ui."EQU_STATE" != '3'
<if test="filters != null and filters.pipelineNumber != null and filters.pipelineNumber != ''">
and pp."PIPELINE_NUMBER" like concat('%', #{filters.pipelineNumber},'%')
</if>
<if test="filters != null and filters.productName != null and filters.productName != ''">
and pp."PIPE_NAME" like concat('%', #{filters.productName},'%')
</if>
)
ORDER BY REC_DATE DESC
</select>
<select id="queryJgProjectContraptionPage"
resultType="com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto">
select
pc.sequence_nbr,
pc.project_contraption,
pc.project_contraption_no,
pc.address,
pc.supervisory_code,
pc.use_registration_code,
pc.province_name,
pc.city_name,
pc.county_name,
pc.street_name,
m.use_registration_code
from
idx_biz_jg_project_contraption pc,
tzs_jg_use_registration_manage m
where
pc.is_into_management = true
and pc.use_registration_code = m.use_registration_code
and m.is_delete = '0'
and pc.use_unit_credit_code=#{useUnitCreditCode}
and (pc.project_contraption_parent_id is null or pc.project_contraption_parent_id = '')
and pc.equ_category = '8300'
<if test="proIds != null and proIds.size() > 0">
and pc.sequence_nbr not in
<foreach collection="proIds" item="projectContraptionId" open="(" close=")" separator=",">
#{projectContraptionId}
</foreach>
</if>
<if test="filters != null">
<if test="filters.projectContraption != null and filters.projectContraption != ''">
and pc.project_contraption like concat('%', #{filters.projectContraption},'%')
</if>
<if test="filters.projectContraptionNo != null and filters.projectContraptionNo != ''">
and pc.project_contraption_no like concat('%', #{filters.projectContraptionNo},'%')
</if>
<if test="filters.useRegistrationCode != null and filters.useRegistrationCode != ''">
and m.use_registration_code like concat('%', #{filters.useRegistrationCode},'%')
</if>
</if>
order by pc.sequence_nbr Desc
</select>
</mapper>
......@@ -2,12 +2,15 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.dto.JgScrapCancelDto;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEnableDisableServiceImpl;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgScrapCancelServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......@@ -38,6 +41,9 @@ public class JgScrapCancelController extends BaseController {
@Autowired
IJgInstallationNoticeService iJgInstallationNoticeService;
@Autowired
JgEnableDisableServiceImpl jgEnableDisableServiceImpl;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
......@@ -174,4 +180,46 @@ public class JgScrapCancelController extends BaseController {
jgScrapCancelService.handleScrapCancelWrongData(applyNo);
return ResponseHelper.buildResponse("ok");
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/pipeline/page")
@ApiOperation(value = "查询装置下非报废的管道", notes = "查询装置下非报废的管道")
public ResponseModel<IPage<Map<String, Object>>> findPipeLinePage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam String projectContraptionId,
@RequestParam Map<String, Object> filters) {
Page<Map<String, Object>> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
IPage<Map<String, Object>> re = jgScrapCancelService.findPipeLinePage(page, projectContraptionId, filters);
return ResponseHelper.buildResponse(re);
}
/**
* 查询可用装置列表
*
* @param current 当前页
* @param size 每页数
* @return page
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/projectContraptionPage")
@ApiOperation(value = "查询可用装置列表", notes = "查询可用装置列表")
public ResponseModel<IPage<IdxBizJgProjectContraptionDto>> getProjectContraptionPage(@RequestParam(required = false) String sequenceNbr,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(required = false, value = "useRegistrationCode") String useRegistrationCode,
@RequestParam(required = false, value = "projectContraption") String projectContraption,
@RequestParam(required = false, value = "projectContraptionNo") String projectContraptionNo) {
Page<IdxBizJgProjectContraptionDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
Map<String, Object> filters = new HashMap<>();
filters.put("useRegistrationCode", useRegistrationCode);
filters.put("projectContraption", projectContraption);
filters.put("projectContraptionNo", projectContraptionNo);
IPage<IdxBizJgProjectContraptionDto> re = jgScrapCancelService.getJgProjectContraptionPage(getSelectedOrgInfo().getCompany().getCompanyCode(), page, sequenceNbr, filters);
return ResponseHelper.buildResponse(re);
}
}
package com.yeejoin.amos.boot.module.ymt.api.dto;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment