Commit 940dcba0 authored by suhuiguang's avatar suhuiguang

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

1.启用停用管道增加检索条件
parent cbdbde69
...@@ -45,6 +45,7 @@ public class MetaHandler implements MetaObjectHandler { ...@@ -45,6 +45,7 @@ public class MetaHandler implements MetaObjectHandler {
autoFillPipeLength(clazz.getAnnotation(PipeLengthField.class), metaObject); autoFillPipeLength(clazz.getAnnotation(PipeLengthField.class), metaObject);
fillRecUserName(clazz.getAnnotation(RecUserNameFilling.class), metaObject); fillRecUserName(clazz.getAnnotation(RecUserNameFilling.class), metaObject);
this.setFieldValByName("createDate", currentDate, metaObject); this.setFieldValByName("createDate", currentDate, metaObject);
this.setFieldValByName("createUserId", RequestContext.getExeUserId(), metaObject);
} }
private void fillRecUserName(RecUserNameFilling annotation, MetaObject metaObject) { private void fillRecUserName(RecUserNameFilling annotation, MetaObject metaObject) {
......
package com.yeejoin.amos.boot.module.jg.api.entity; package com.yeejoin.amos.boot.module.jg.api.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
...@@ -73,7 +74,7 @@ public class JgEnableDisable extends BaseEntity { ...@@ -73,7 +74,7 @@ public class JgEnableDisable extends BaseEntity {
/** /**
* 创建人ID * 创建人ID
*/ */
@TableField("create_user_id") @TableField(value = "create_user_id", fill = FieldFill.INSERT)
private String createUserId; private String createUserId;
/** /**
......
...@@ -42,7 +42,7 @@ public interface JgEnableDisableMapper extends BaseMapper<JgEnableDisable> { ...@@ -42,7 +42,7 @@ 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); 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);
......
...@@ -182,6 +182,7 @@ ...@@ -182,6 +182,7 @@
#{projectContraptionId} #{projectContraptionId}
</foreach> </foreach>
</if> </if>
order by pc.sequence_nbr Desc
</select> </select>
<sql id="page-list-pipeline"> <sql id="page-list-pipeline">
SELECT SELECT
...@@ -249,6 +250,12 @@ ...@@ -249,6 +250,12 @@
and ui.EQU_STATE = '2' and ui.EQU_STATE = '2'
</otherwise> </otherwise>
</choose> </choose>
<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 ORDER BY REC_DATE DESC
</select> </select>
......
...@@ -149,11 +149,12 @@ public class JgEnableDisableController extends BaseController { ...@@ -149,11 +149,12 @@ public class JgEnableDisableController extends BaseController {
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
@RequestParam String projectContraptionId, @RequestParam String projectContraptionId,
@RequestParam String applyType) { @RequestParam String applyType,
@RequestParam Map<String, Object> filters) {
Page<Map<String, Object>> page = new Page<>(); Page<Map<String, Object>> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
IPage<Map<String, Object>> re = jgEnableDisableServiceImpl.findPipeLinePage(page, projectContraptionId, applyType); IPage<Map<String, Object>> re = jgEnableDisableServiceImpl.findPipeLinePage(page, projectContraptionId, applyType, filters);
return ResponseHelper.buildResponse(re); return ResponseHelper.buildResponse(re);
} }
......
...@@ -144,7 +144,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -144,7 +144,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
public List<JgEnableDisable> saveOrUpdate(JSONObject map, ReginParams reginParams) { public List<JgEnableDisable> saveOrUpdate(JSONObject map, ReginParams reginParams) {
try { try {
JgEnableDisable jgEnableDisable = new JgEnableDisable(); JgEnableDisable jgEnableDisable = new JgEnableDisable();
if (!"null".equals(String.valueOf(map.get("sequenceNbr")))) { if (org.apache.commons.lang3.StringUtils.isNotEmpty(map.getString("sequenceNbr"))) {
jgEnableDisable = this.baseMapper.selectById(String.valueOf(map.get("sequenceNbr"))); jgEnableDisable = this.baseMapper.selectById(String.valueOf(map.get("sequenceNbr")));
jgEnableDisable.setRemark(map.get("remark").toString()); jgEnableDisable.setRemark(map.get("remark").toString());
} else { } else {
...@@ -682,20 +682,38 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -682,20 +682,38 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
} }
private void createResume(JgEnableDisable jgEnableDisable, String routePath) { private void createResume(JgEnableDisable jgEnableDisable, String routePath) {
LambdaQueryWrapper<JgEnableDisableEq> queryWrapper = new LambdaQueryWrapper<>(); if(!jgEnableDisable.getEquListCode().equals(EquipmentClassifityEnum.YLGD.getCode())){ // 非压力管道按照设备记录履历
queryWrapper.eq(JgEnableDisableEq::getEnableDisableApplyId, jgEnableDisable.getSequenceNbr()); LambdaQueryWrapper<JgEnableDisableEq> queryWrapper = new LambdaQueryWrapper<>();
List<JgEnableDisableEq> enableDisableEqs = jgEnableDisableEqService.list(queryWrapper); queryWrapper.eq(JgEnableDisableEq::getEnableDisableApplyId, jgEnableDisable.getSequenceNbr());
jgResumeInfoService.saveBatchResume(enableDisableEqs.stream().map(eq -> JgResumeInfoDto.builder().applyNo(jgEnableDisable.getApplyNo()) List<JgEnableDisableEq> enableDisableEqs = jgEnableDisableEqService.list(queryWrapper);
.businessType(getRegistrationClass(jgEnableDisable)) jgResumeInfoService.saveBatchResume(enableDisableEqs.stream().map(eq -> JgResumeInfoDto.builder().applyNo(jgEnableDisable.getApplyNo())
.businessId(String.valueOf(jgEnableDisable.getSequenceNbr())) .businessType(getRegistrationClass(jgEnableDisable))
.equId(eq.getEquId()) .businessId(String.valueOf(jgEnableDisable.getSequenceNbr()))
.approvalUnit(jgEnableDisable.getReceiveOrgName()) .equId(eq.getEquId())
.approvalUnitCode(jgEnableDisable.getReceiveCompanyCode()) .approvalUnit(jgEnableDisable.getReceiveOrgName())
.status("正常") .approvalUnitCode(jgEnableDisable.getReceiveCompanyCode())
.changeContent(getRegistrationClass(jgEnableDisable) + "业务办理") .status("正常")
.routePath(routePath) .createUserId(jgEnableDisable.getCreateUserId())
.build()).collect(Collectors.toList()) .createUserName(jgEnableDisable.getCreateUserName())
); .changeContent(getRegistrationClass(jgEnableDisable) + "业务办理")
.routePath(routePath)
.build()).collect(Collectors.toList())
);
} else { // 压力管道按照装置记录履历
jgResumeInfoService.saveBatchResume(Collections.singletonList(JgResumeInfoDto.builder().applyNo(jgEnableDisable.getApplyNo())
.businessType(getRegistrationClass(jgEnableDisable))
.businessId(String.valueOf(jgEnableDisable.getSequenceNbr()))
.equId(jgEnableDisable.getProjectContraptionId())
.approvalUnit(jgEnableDisable.getReceiveOrgName())
.approvalUnitCode(jgEnableDisable.getReceiveCompanyCode())
.status("正常")
.createUserId(jgEnableDisable.getCreateUserId())
.createUserName(jgEnableDisable.getCreateUserName())
.changeContent(getRegistrationClass(jgEnableDisable) + "业务办理")
.routePath(routePath)
.build())
);
}
} }
private void sendDataRefreshMsg(JgEnableDisable jgEnableDisable) { private void sendDataRefreshMsg(JgEnableDisable jgEnableDisable) {
...@@ -1006,8 +1024,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -1006,8 +1024,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
return dto; return dto;
} }
public IPage<Map<String, Object>> findPipeLinePage(Page<Map<String, Object>> page, String projectContraptionId, String applyType) { public IPage<Map<String, Object>> findPipeLinePage(Page<Map<String, Object>> page, String projectContraptionId, String applyType, Map<String, Object> filters) {
IPage<Map<String, Object>> re = this.getBaseMapper().selectPipeLinePage(page, projectContraptionId, applyType); IPage<Map<String, Object>> re = this.getBaseMapper().selectPipeLinePage(page, projectContraptionId, applyType, filters);
re.getRecords().forEach(item -> item.put("inspectReport", Optional.ofNullable(item.get("inspectReport")).map(r->JSON.parse(r.toString())).orElse(null))); re.getRecords().forEach(item -> item.put("inspectReport", Optional.ofNullable(item.get("inspectReport")).map(r->JSON.parse(r.toString())).orElse(null)));
return re; return re;
} }
......
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