Commit 7e7e2322 authored by suhuiguang's avatar suhuiguang

feat(jg): 压力管道后续业务

1.维修告知适配及问题修改 2.装置编辑
parent 156ec05e
...@@ -42,9 +42,9 @@ public interface JgEnableDisableMapper extends BaseMapper<JgEnableDisable> { ...@@ -42,9 +42,9 @@ public interface JgEnableDisableMapper extends BaseMapper<JgEnableDisable> {
IPage<IdxBizJgProjectContraption> queryJgProjectContraptionPage(@Param("page") Page<IdxBizJgProjectContraption> page, @Param("useUnitCreditCode") String useUnitCreditCode, @Param("proIds") Set<String> proIds); IPage<IdxBizJgProjectContraption> queryJgProjectContraptionPage(@Param("page") Page<IdxBizJgProjectContraption> page, @Param("useUnitCreditCode") String useUnitCreditCode, @Param("proIds") Set<String> proIds);
IPage<Map<String, Object>> selectPipeLinePage(@Param("page") Page<Map<String, Object>> page, @Param("projectContraptionId") String projectContraptionId, @Param("applyType") String applyType, @Param("filters") Map<String, Object> filters);
List<Map<String, Object>> selectPipeLineByRecords(@Param("records") List<String> records); List<Map<String, Object>> selectPipeLineByRecords(@Param("records") List<String> records);
IPage<Map<String, Object>> selectPipeLinePage(@Param("page") Page<Map<String, Object>> page, @Param("projectContraptionId") String projectContraptionId, @Param("applyType") String applyType, @Param("filters") Map<String, Object> filters);
} }
package com.yeejoin.amos.boot.module.jg.api.mapper; package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.mapper.CustomBaseMapper; import com.yeejoin.amos.boot.module.common.api.mapper.CustomBaseMapper;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto; import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
...@@ -46,9 +47,12 @@ public interface JgMaintainNoticeMapper extends CustomBaseMapper<JgMaintainNotic ...@@ -46,9 +47,12 @@ public interface JgMaintainNoticeMapper extends CustomBaseMapper<JgMaintainNotic
void updatePromoter(@Param("id")Long id); void updatePromoter(@Param("id")Long id);
Map<String, Object> getEquipInfoByRecord(String record);
List<CompanyEquipCountDto> queryForFlowingEquipList(); List<CompanyEquipCountDto> queryForFlowingEquipList();
List<MaintainVo> queryMaintainInIds(@Param("ids") List<String> ids); List<MaintainVo> queryMaintainInIds(@Param("ids") List<String> ids);
IPage<Map<String, Object>> selectPipeLinePage(@Param("page") Page<Map<String, Object>> page, @Param("projectContraptionId") String projectContraptionId, @Param("filters") Map<String, Object> filters);
List<Map<String, Object>> selectPipeLineByRecords(@Param("records") List<String> records);
} }
package com.yeejoin.amos.boot.module.jg.api.service; package com.yeejoin.amos.boot.module.jg.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
...@@ -70,4 +71,7 @@ public interface IJgMaintainNoticeService extends IService<JgMaintainNotice> { ...@@ -70,4 +71,7 @@ public interface IJgMaintainNoticeService extends IService<JgMaintainNotice> {
* @return JgInstallationNoticeDto * @return JgInstallationNoticeDto
*/ */
JgMaintainNotice cancelApplication(Long sequenceNbr, String cancelReason); JgMaintainNotice cancelApplication(Long sequenceNbr, String cancelReason);
IPage<Map<String, Object>> findPipeLinePage(Page<Map<String, Object>> page, String sequenceNbr, Map<String, Object> filters);
} }
...@@ -300,4 +300,82 @@ ...@@ -300,4 +300,82 @@
ORDER BY ORDER BY
isn.create_date DESC, isn.apply_no DESC isn.create_date DESC, isn.apply_no DESC
</select> </select>
<sql id="page-list-pipeline">
SELECT
ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
ui."PROJECT_CONTRAPTION_ID" as projectContraptionId,
to_char(ui."USE_DATE", 'YYYY-MM') useDate,
(SELECT DESIGN_UNIT_NAME from idx_biz_jg_design_info where "RECORD" = ui."RECORD") designUnitName,
(SELECT USC_UNIT_NAME from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE DESC limit 1) uscUnitName,
to_char((SELECT USC_DATE from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE DESC limit 1), 'YYYY-MM') uscDate,
ui."RECORD" AS record,
ui."RECORD" AS SEQUENCE_NBR,
ui.IS_INTO_MANAGEMENT as isIntoManagement,
ri."EQU_CODE" equCode,
ri."EQU_LIST" equList,
(select name from tz_equipment_category where code = ri."EQU_LIST") equListName,
ri."EQU_CATEGORY" equCategory,
(select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName,
ri."EQU_DEFINE" equDefine,
(select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName,
pp."PIPE_NAME" as productName,
ri."BRAND_NAME" brandName,
ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
ri."USE_ORG_CODE" useOrgCode,
pp."DEVICE_NAME" deviceName,
(select name from cb_data_dictionary where code = pp."DEVICE_LEVEL" and type in ('GYGDHIS','8100','8200','8300')) deviceLevel,
pp."PIPE_NAME" pipeName,
pp."PIPELINE_NUMBER" pipelineNumber,
pp."NOMINAL_DIAMETER" nominalDiameter,
pp."WALL_THICKNESS" wallThickness,
pp."PIPE_LENGTH" pipeLength,
pp."PIPE_LENGTH_TEXT" AS pipeLengthText,
pp."PRESSURE" pressure,
pp."TEMPERATURE" temperature,
pp."MEDIUM" medium,
pp."REMARKS" remarks,
pp."WORK_PRESSURE" AS workPressure,
pp."WORK_TEMPERATURE" AS workTemperature,
pp."WORK_MEDIUM" AS workMedium,
ui."EQU_STATE" as equState,
ui."REC_DATE",
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName,
(select name from cb_data_dictionary where type = 'JYJL' and code = (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1)) inspectConclusion,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1), 'YYYY-MM-DD') nextInspectDate,
(select INSPECT_REPORT from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectReport
FROM
idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD"
LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD"
</sql>
<select id="selectPipeLinePage" resultType="java.util.Map">
select * from (
<include refid="page-list-pipeline"/>
WHERE
ui."PROJECT_CONTRAPTION_ID" = #{projectContraptionId}
and (ui."EQU_STATE" is null or ui."EQU_STATE" <![CDATA[ <> ]]> '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="selectPipeLineByRecords" resultType="java.util.Map">
select * from (
<include refid="page-list-pipeline"/>
WHERE
ui."RECORD" = ANY(ARRAY[
<foreach collection="records" item="record" separator=",">
#{record}
</foreach>
]) )
ORDER BY REC_DATE DESC
</select>
</mapper> </mapper>
...@@ -35,19 +35,6 @@ public class JgMaintainByWorkFlowController { ...@@ -35,19 +35,6 @@ public class JgMaintainByWorkFlowController {
JgMaintainNoticeServiceImpl jgMaintainNoticeServiceImpl; JgMaintainNoticeServiceImpl jgMaintainNoticeServiceImpl;
private static final String TABLE_PAGE_ID = "maintainInfo"; private static final String TABLE_PAGE_ID = "maintainInfo";
// /**
// * 提交
// *
// * @return
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @PostMapping(value = "/submit")
// @ApiOperation(httpMethod = "POST", value = "维修告知提交", notes = "维修告知提交")
// public ResponseModel<JgMaintainNoticeDto> submit(@RequestBody JgMaintainNoticeDto model, String op) {
// // TODO 发起维修告知流程
// // jgMaintainNoticeServiceImpl.submit(model, op);
// return ResponseHelper.buildResponse(model);
// }
/** /**
* 撤销 * 撤销
......
package com.yeejoin.amos.boot.module.jg.biz.controller; package com.yeejoin.amos.boot.module.jg.biz.controller;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
...@@ -11,6 +12,8 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService; ...@@ -11,6 +12,8 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -153,4 +156,20 @@ public class JgMaintainNoticeController extends BaseController { ...@@ -153,4 +156,20 @@ public class JgMaintainNoticeController extends BaseController {
JgMaintainNotice result = iJgMaintainNoticeService.cancelApplication(dto.getSequenceNbr(), dto.getCancelReason()); JgMaintainNotice result = iJgMaintainNoticeService.cancelApplication(dto.getSequenceNbr(), dto.getCancelReason());
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@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("projectContraptionId") 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 = iJgMaintainNoticeService.findPipeLinePage(page, projectContraptionId, filters);
return ResponseHelper.buildResponse(re);
}
} }
...@@ -38,6 +38,7 @@ import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher; ...@@ -38,6 +38,7 @@ import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgProjectContraptionService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgProjectContraptionService;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto; import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.*; import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
...@@ -598,7 +599,7 @@ public class IdxBizJgProjectContraptionServiceImplService extends BaseEntityServ ...@@ -598,7 +599,7 @@ public class IdxBizJgProjectContraptionServiceImplService extends BaseEntityServ
.map(map -> { .map(map -> {
commonService.convertStringToJsonobject(map, jsonFields); commonService.convertStringToJsonobject(map, jsonFields);
map.put("unitType", company.getCompanyType()); map.put("unitType", company.getCompanyType());
map.put("pipelineList", baseMapper.selectEquipList((String) map.get("SEQUENCE_NBR"))); map.put("pipelineList", this.getPipelineList(sequenceNbr));
return map; return map;
}) })
.orElse(Collections.emptyMap()); .orElse(Collections.emptyMap());
...@@ -607,6 +608,28 @@ public class IdxBizJgProjectContraptionServiceImplService extends BaseEntityServ ...@@ -607,6 +608,28 @@ public class IdxBizJgProjectContraptionServiceImplService extends BaseEntityServ
return resultMap; return resultMap;
} }
private List<Map<String, Object>> getPipelineList(String sequenceNbr) {
List<Map<String, Object>> pipelineList = baseMapper.selectEquipList(sequenceNbr);
pipelineList.forEach(p -> {
try {
p.put("equStateName",
Optional.ofNullable(p.get("equState"))
.map(Object::toString)
.filter(org.apache.commons.lang3.StringUtils::isNotEmpty)
.map(Integer::parseInt)
.map(EquipmentEnum.getName::get)
.orElse("待用")
);
} catch (NumberFormatException e) {
p.put("equStateName", "待用");
}
});
return pipelineList;
}
public Page<Map<String, Object>> techParamsPipelinePage(String sequenceNbr,int current, int size) { public Page<Map<String, Object>> techParamsPipelinePage(String sequenceNbr,int current, int size) {
Page<Map<String, Object>> page=new Page<>(); Page<Map<String, Object>> page=new Page<>();
page.setCurrent(current); page.setCurrent(current);
......
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
ibjdi."DESIGN_UNIT_NAME" AS designUnitName, ibjdi."DESIGN_UNIT_NAME" AS designUnitName,
ibjui."USE_DATE" AS useDate, ibjui."USE_DATE" AS useDate,
ibjui."RECORD" AS record, ibjui."RECORD" AS record,
ibjui."EQU_STATE" as equState,
ibjui.project_contraption_id AS projectContraptionId ibjui.project_contraption_id AS projectContraptionId
FROM idx_biz_jg_use_info ibjui FROM idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
......
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