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);
......
...@@ -5,12 +5,13 @@ import com.alibaba.fastjson.JSON; ...@@ -5,12 +5,13 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.annotation.ResultFieldMapping; import com.yeejoin.amos.boot.biz.common.annotation.ResultFieldMapping;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
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.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
...@@ -19,6 +20,7 @@ import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil; ...@@ -19,6 +20,7 @@ import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.enums.ConstructionTypeEnum; import com.yeejoin.amos.boot.module.common.api.enums.ConstructionTypeEnum;
import com.yeejoin.amos.boot.module.common.api.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.*; import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
...@@ -36,12 +38,11 @@ import com.yeejoin.amos.boot.module.jg.biz.edit.typeHandler.EquipCategoryTypeHan ...@@ -36,12 +38,11 @@ import com.yeejoin.amos.boot.module.jg.biz.edit.typeHandler.EquipCategoryTypeHan
import com.yeejoin.amos.boot.module.jg.biz.event.CancellationEvent; import com.yeejoin.amos.boot.module.jg.biz.event.CancellationEvent;
import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher; import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.common.api.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService;
import com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil; import com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil;
import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils; import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
...@@ -103,9 +104,6 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -103,9 +104,6 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
EventPublisher eventPublisher; EventPublisher eventPublisher;
@Autowired @Autowired
private ICmWorkflowService iCmWorkflowService;
@Autowired
JgMaintainNoticeEqMapper jgMaintainNoticeEqMapper; JgMaintainNoticeEqMapper jgMaintainNoticeEqMapper;
@Autowired @Autowired
...@@ -127,10 +125,6 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -127,10 +125,6 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
@Autowired @Autowired
private SnowflakeIdUtil sequence; private SnowflakeIdUtil sequence;
@Autowired
IDataDictionaryService dataDictionaryService;
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
...@@ -161,14 +155,16 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -161,14 +155,16 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
private JgCertificateChangeRecordServiceImpl certificateChangeRecordService; private JgCertificateChangeRecordServiceImpl certificateChangeRecordService;
@Autowired @Autowired
private JgCertificateChangeRecordEqServiceImpl jgCertificateChangeRecordEqServiceImpl; private JgCertificateChangeRecordEqServiceImpl jgCertificateChangeRecordEqServiceImpl;
@Autowired
private IdxBizJgProjectContraptionMapper idxBizJgProjectContraptionMapper;
@Autowired @Autowired
private CodeUtil codeUtil; private CodeUtil codeUtil;
@Autowired @Autowired
private EquipCategoryTypeHandler equipCategoryTypeHandler; private EquipCategoryTypeHandler equipCategoryTypeHandler;
@Autowired
private IdxBizJgProjectContraptionMapper idxBizJgProjectContraptionMapper;
@Autowired
private IdxBizJgProjectContraptionServiceImplService idxBizJgProjectContraptionServiceImplService;
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
...@@ -224,7 +220,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -224,7 +220,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
// 兼容老数据 // 兼容老数据
if (hisData == null || ObjectUtils.isEmpty(hisData.get("deviceList"))) { if (hisData == null || ObjectUtils.isEmpty(hisData.get("deviceList"))) {
// 老数据逻辑 // 老数据逻辑
setNewEquipInfo(sequenceNbr, maintainInfo); setNewEquipInfo(sequenceNbr, maintainInfo, notice);
new FillingEditPermForCurrentUser(new JSONObject(maintainInfo), companyBo, BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION).getData(); new FillingEditPermForCurrentUser(new JSONObject(maintainInfo), companyBo, BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION).getData();
return new HashMap<String, Map<String, Object>>() {{ return new HashMap<String, Map<String, Object>>() {{
put(TABLE_PAGE_ID, maintainInfo); put(TABLE_PAGE_ID, maintainInfo);
...@@ -233,15 +229,13 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -233,15 +229,13 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
// 新数据逻辑 // 新数据逻辑
hisData.putAll(maintainInfo); hisData.putAll(maintainInfo);
CommonServiceImpl.formatTime2StrDateForEquip(hisData); CommonServiceImpl.formatTime2StrDateForEquip(hisData);
// setNewEquipInfo(sequenceNbr, maintainInfo);
// hisData.put("deviceList", maintainInfo.get("deviceList"));
new FillingEditPermForCurrentUser(hisData, companyBo, BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION).getData(); new FillingEditPermForCurrentUser(hisData, companyBo, BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION).getData();
return new HashMap<String, Map<String, Object>>() {{ return new HashMap<String, Map<String, Object>>() {{
this.put(TABLE_PAGE_ID, hisData); this.put(TABLE_PAGE_ID, hisData);
}}; }};
} }
} else { } else {
setNewEquipInfo(sequenceNbr, maintainInfo); setNewEquipInfo(sequenceNbr, maintainInfo, notice);
new FillingEditPermForCurrentUser(new JSONObject(maintainInfo), companyBo, BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION).getData(); new FillingEditPermForCurrentUser(new JSONObject(maintainInfo), companyBo, BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION).getData();
return new HashMap<String, Map<String, Object>>() {{ return new HashMap<String, Map<String, Object>>() {{
put(TABLE_PAGE_ID, maintainInfo); put(TABLE_PAGE_ID, maintainInfo);
...@@ -287,23 +281,29 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -287,23 +281,29 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
}); });
} }
private void setNewEquipInfo(Long sequenceNbr, Map<String, Object> maintainInfo) { private void setNewEquipInfo(Long sequenceNbr, Map<String, Object> maintainInfo, JgMaintainNotice notice) {
List<String> equIds = jgMaintainNoticeEqMapper.selectList( List<String> equIds = jgMaintainNoticeEqMapper.selectList(
new LambdaQueryWrapper<JgMaintainNoticeEq>() new LambdaQueryWrapper<JgMaintainNoticeEq>()
.eq(JgMaintainNoticeEq::getEquipTransferId, sequenceNbr)) .eq(JgMaintainNoticeEq::getEquipTransferId, sequenceNbr))
.stream() .stream()
.map(JgMaintainNoticeEq::getEquId) .map(JgMaintainNoticeEq::getEquId)
.collect(Collectors.toList()); .collect(Collectors.toList());
String equListCode = String.valueOf(maintainInfo.get("EQU_LIST_CODE")); List<Map<String, Object>> deviceList;
List<Map<String, Object>> deviceList = EquipmentClassifityEnum.YLGD.getCode().equals(equListCode) deviceList = getDeviceList(notice, equIds);
? idxBizJgProjectContraptionMapper.selectPipelineList(equIds)
: getEquipListMaps(esEquipmentCategory.findAllById(equIds));
deviceList.forEach(item->{
item.replaceAll((k, v) -> v == null ? "" : v);
});
maintainInfo.put("deviceList", deviceList); maintainInfo.put("deviceList", deviceList);
} }
private List<Map<String, Object>> getDeviceList(JgMaintainNotice notice, List<String> equIds) {
List<Map<String, Object>> deviceList;
if (!notice.getEquListCode().equals(EquipmentClassifityEnum.YLGD.getCode())) {
deviceList = getEquipListMaps(esEquipmentCategory.findAllById(equIds));
} else {
deviceList = getBaseMapper().selectPipeLineByRecords(equIds);
}
deviceList.forEach(item -> item.replaceAll((k, v) -> v == null ? "" : v));
return deviceList;
}
private List<Map<String, Object>> getEquipListMaps(Iterable<ESEquipmentCategoryDto> equips) { private List<Map<String, Object>> getEquipListMaps(Iterable<ESEquipmentCategoryDto> equips) {
List<Map<String, Object>> arrayList = new ArrayList<>(); List<Map<String, Object>> arrayList = new ArrayList<>();
equips.forEach(equip -> { equips.forEach(equip -> {
...@@ -455,16 +455,16 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -455,16 +455,16 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
BeanUtils.copyProperties(noticeDto, bean); BeanUtils.copyProperties(noticeDto, bean);
jgMaintainNoticeMapper.updateById(bean); jgMaintainNoticeMapper.updateById(bean);
} }
LambdaQueryWrapper<JgMaintainNoticeEq> lambdaQueryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<JgMaintainNoticeEq> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(JgMaintainNoticeEq::getEquipTransferId, noticeDto.getSequenceNbr()); lambdaQueryWrapper.eq(JgMaintainNoticeEq::getEquipTransferId, noticeDto.getSequenceNbr());
jgMaintainNoticeEqMapper.delete(lambdaQueryWrapper); jgMaintainNoticeEqMapper.delete(lambdaQueryWrapper);
List<JgMaintainNoticeEq> equipList = new ArrayList<>(); List<JgMaintainNoticeEq> equipList = new ArrayList<>();
if (!CollectionUtils.isEmpty(deviceList)){ if (!CollectionUtils.isEmpty(deviceList)) {
deviceList.forEach(obj -> { deviceList.forEach(obj -> {
JgMaintainNoticeEq jgRelationEquip = new JgMaintainNoticeEq(); JgMaintainNoticeEq jgRelationEquip = new JgMaintainNoticeEq();
jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR"))); jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR")));
jgRelationEquip.setEquipTransferId(noticeDto.getSequenceNbr().toString()); jgRelationEquip.setEquipTransferId(noticeDto.getSequenceNbr().toString());
jgRelationEquip.setEquCode(ObjectUtils.isEmpty(obj.get("EQU_CODE"))?null:String.valueOf(obj.get("EQU_CODE"))); jgRelationEquip.setEquCode(ObjectUtils.isEmpty(obj.get("EQU_CODE")) ? null : String.valueOf(obj.get("EQU_CODE")));
jgRelationEquip.setEquListCode(String.valueOf(obj.get("EQU_LIST_CODE"))); jgRelationEquip.setEquListCode(String.valueOf(obj.get("EQU_LIST_CODE")));
jgRelationEquip.setEquCategoryCode(String.valueOf(obj.get("EQU_CATEGORY_CODE"))); jgRelationEquip.setEquCategoryCode(String.valueOf(obj.get("EQU_CATEGORY_CODE")));
equipList.add(jgRelationEquip); equipList.add(jgRelationEquip);
...@@ -504,7 +504,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -504,7 +504,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
String type = "jgLook".equals(client) ? null : reginParams.getCompany().getLevel(); String type = "jgLook".equals(client) ? null : reginParams.getCompany().getLevel();
String orgCode = "jgLook".equals(client) ? reginParams.getCompany().getOrgCode() : null; String orgCode = "jgLook".equals(client) ? reginParams.getCompany().getOrgCode() : null;
SortVo sortMap = commonService.sortFieldConversion(sort); SortVo sortMap = commonService.sortFieldConversion(sort);
List<DataDictionary> dictionaries = dataDictionaryService.getByType("WXLX"); List<DataDictionary> dictionaries = iDataDictionaryService.getByType("WXLX");
Page<Map<String, Object>> noticePage = jgMaintainNoticeMapper.queryForPage(page, sortMap, model, type, companyCode, userId, orgCode); Page<Map<String, Object>> noticePage = jgMaintainNoticeMapper.queryForPage(page, sortMap, model, type, companyCode, userId, orgCode);
List<Map<String, Object>> mappedRecords = noticePage.getRecords().stream().peek(notice -> { List<Map<String, Object>> mappedRecords = noticePage.getRecords().stream().peek(notice -> {
...@@ -524,7 +524,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -524,7 +524,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
* 列表查询-导出用 * 列表查询-导出用
*/ */
public List<MaintainVo> queryMaintainInIds(List<String> ids) { public List<MaintainVo> queryMaintainInIds(List<String> ids) {
List<DataDictionary> dictionaries = dataDictionaryService.getByType("WXLX"); List<DataDictionary> dictionaries = iDataDictionaryService.getByType("WXLX");
List<MaintainVo> maintainVos = jgMaintainNoticeMapper.queryMaintainInIds(ids); List<MaintainVo> maintainVos = jgMaintainNoticeMapper.queryMaintainInIds(ids);
return maintainVos.stream().peek(notice -> { return maintainVos.stream().peek(notice -> {
Optional.ofNullable(notice.getNoticeStatus()).ifPresent(status -> notice.setNoticeStatus(FlowStatusEnum.getNameByType(Long.valueOf(status)))); Optional.ofNullable(notice.getNoticeStatus()).ifPresent(status -> notice.setNoticeStatus(FlowStatusEnum.getNameByType(Long.valueOf(status))));
...@@ -551,7 +551,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -551,7 +551,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
List<JgMaintainNoticeEq> list = jgMaintainNoticeEqService.lambdaQuery().eq(JgMaintainNoticeEq::getEquipTransferId, sequenceNbr).list(); List<JgMaintainNoticeEq> list = jgMaintainNoticeEqService.lambdaQuery().eq(JgMaintainNoticeEq::getEquipTransferId, sequenceNbr).list();
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
List<Map<String, Object>> placeholderList = new ArrayList<>(); List<Map<String, Object>> placeholderList = new ArrayList<>();
if(!CollectionUtils.isEmpty(list)){ if (!CollectionUtils.isEmpty(list)) {
for (JgMaintainNoticeEq jgMaintainNoticeEq : list) { for (JgMaintainNoticeEq jgMaintainNoticeEq : list) {
List<Map<String, Object>> informationList = jgMaintainNoticeMapper.queryEquipInformation(jgMaintainNoticeEq.getSequenceNbr()); List<Map<String, Object>> informationList = jgMaintainNoticeMapper.queryEquipInformation(jgMaintainNoticeEq.getSequenceNbr());
if (Objects.isNull(JgMaintainNotice) || CollectionUtils.isEmpty(informationList)) { if (Objects.isNull(JgMaintainNotice) || CollectionUtils.isEmpty(informationList)) {
...@@ -610,7 +610,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -610,7 +610,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
this.repeatUsedEquipCheck(deviceList, reginParams.getCompany().getCompanyCode()); this.repeatUsedEquipCheck(deviceList, reginParams.getCompany().getCompanyCode());
} }
String applyNo; String applyNo;
if (ValidationUtil.isEmpty(model.getApplyNo())){ if (ValidationUtil.isEmpty(model.getApplyNo())) {
// 获取告知单号 // 获取告知单号
ResponseModel<List<String>> applyNoResult = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.WXGZ.getCode(), 1); ResponseModel<List<String>> applyNoResult = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.WXGZ.getCode(), 1);
if (CollectionUtils.isEmpty(applyNoResult.getResult())) { if (CollectionUtils.isEmpty(applyNoResult.getResult())) {
...@@ -618,7 +618,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -618,7 +618,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
throw new RuntimeException(); throw new RuntimeException();
} }
applyNo = applyNoResult.getResult().get(0); applyNo = applyNoResult.getResult().get(0);
}else{ } else {
applyNo = model.getApplyNo(); applyNo = model.getApplyNo();
} }
...@@ -651,8 +651,8 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -651,8 +651,8 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
if (SUBMIT_TYPE_TEMP.equals(submitType)) { if (SUBMIT_TYPE_TEMP.equals(submitType)) {
notice.setIsTemporaryStatus("1"); notice.setIsTemporaryStatus("1");
} }
notice.setEquListCode(Objects.toString(tableData.get(EQU_LIST_CODE),"")); notice.setEquListCode(Objects.toString(tableData.get(EQU_LIST_CODE), ""));
notice.setEquCategory(Objects.toString(tableData.get(EQU_CATEGORY_CODE),"")); notice.setEquCategory(Objects.toString(tableData.get(EQU_CATEGORY_CODE), ""));
notice.setEquCategoryDesc(equipCategoryTypeHandler.handle(notice.getEquCategory())); notice.setEquCategoryDesc(equipCategoryTypeHandler.handle(notice.getEquCategory()));
notice.setInstallUnitName(reginParams.getCompany().getCompanyName()); notice.setInstallUnitName(reginParams.getCompany().getCompanyName());
notice.setInstallUnitCreditCode(reginParams.getCompany().getCompanyCode()); notice.setInstallUnitCreditCode(reginParams.getCompany().getCompanyCode());
...@@ -661,12 +661,12 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -661,12 +661,12 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
DataDictionary dictionary = iDataDictionaryService.getByCode(notice.getMaintainType(), "WXLX"); DataDictionary dictionary = iDataDictionaryService.getByCode(notice.getMaintainType(), "WXLX");
notice.setMaintainTypeDesc(dictionary.getName()); notice.setMaintainTypeDesc(dictionary.getName());
notice.setFullAddress(notice.getProvinceName() + notice.getCityName() + notice.getCountyName() + notice.getStreetName() + notice.getAddress()); notice.setFullAddress(notice.getProvinceName() + notice.getCityName() + notice.getCountyName() + notice.getStreetName() + notice.getAddress());
if (!CollectionUtils.isEmpty(deviceList)){ if (!CollectionUtils.isEmpty(deviceList)) {
deviceList.forEach(obj -> { deviceList.forEach(obj -> {
JgMaintainNoticeEq jgRelationEquip = new JgMaintainNoticeEq(); JgMaintainNoticeEq jgRelationEquip = new JgMaintainNoticeEq();
jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR"))); jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR")));
jgRelationEquip.setEquipTransferId(applyNo); jgRelationEquip.setEquipTransferId(applyNo);
jgRelationEquip.setEquCode(ObjectUtils.isEmpty(obj.get("EQU_CODE"))?null:String.valueOf(obj.get("EQU_CODE"))); jgRelationEquip.setEquCode(ObjectUtils.isEmpty(obj.get("EQU_CODE")) ? null : String.valueOf(obj.get("EQU_CODE")));
jgRelationEquip.setEquListCode(String.valueOf(obj.get("EQU_LIST_CODE"))); jgRelationEquip.setEquListCode(String.valueOf(obj.get("EQU_LIST_CODE")));
jgRelationEquip.setEquCategoryCode(String.valueOf(obj.get("EQU_CATEGORY_CODE"))); jgRelationEquip.setEquCategoryCode(String.valueOf(obj.get("EQU_CATEGORY_CODE")));
equipList.add(jgRelationEquip); equipList.add(jgRelationEquip);
...@@ -680,7 +680,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -680,7 +680,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
// 暂存任务 // 暂存任务
buildTaskDraft(notice); buildTaskDraft(notice);
} }
if (!CollectionUtils.isEmpty(deviceList)){ if (!CollectionUtils.isEmpty(deviceList)) {
if (!ValidationUtil.isEmpty(model.getSequenceNbr())) { if (!ValidationUtil.isEmpty(model.getSequenceNbr())) {
LambdaQueryWrapper<JgMaintainNoticeEq> lambda = new QueryWrapper<JgMaintainNoticeEq>().lambda(); LambdaQueryWrapper<JgMaintainNoticeEq> lambda = new QueryWrapper<JgMaintainNoticeEq>().lambda();
lambda.eq(JgMaintainNoticeEq::getEquipTransferId, model.getSequenceNbr()); lambda.eq(JgMaintainNoticeEq::getEquipTransferId, model.getSequenceNbr());
...@@ -707,7 +707,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -707,7 +707,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
} }
private void updateRedisBatch(JgMaintainNotice jgMaintainNotice) { private void updateRedisBatch(JgMaintainNotice jgMaintainNotice) {
if (!ObjectUtils.isEmpty(jgMaintainNotice.getInstanceId())){ if (!ObjectUtils.isEmpty(jgMaintainNotice.getInstanceId())) {
commonService.saveExecuteFlowData2Redis(jgMaintainNotice.getInstanceId(), this.buildInstanceRuntimeData(jgMaintainNotice)); commonService.saveExecuteFlowData2Redis(jgMaintainNotice.getInstanceId(), this.buildInstanceRuntimeData(jgMaintainNotice));
} }
} }
...@@ -727,7 +727,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -727,7 +727,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
taskMessageDto.setNextTaskId(maintainNotice.getNextTaskId()); taskMessageDto.setNextTaskId(maintainNotice.getNextTaskId());
dto.setModel(taskMessageDto); dto.setModel(taskMessageDto);
//摘要 按原有规则组装 //摘要 按原有规则组装
dto.setTaskContent(String.format("来自%s的业务办理,【申请单号%s】",equipCategoryTypeHandler.handle(maintainNotice.getEquListCode()), maintainNotice.getApplyNo())); dto.setTaskContent(String.format("来自%s的业务办理,【申请单号%s】", equipCategoryTypeHandler.handle(maintainNotice.getEquListCode()), maintainNotice.getApplyNo()));
//申请单号 //申请单号
dto.setTaskCode(maintainNotice.getApplyNo()); dto.setTaskCode(maintainNotice.getApplyNo());
//业务类型枚举code值 //业务类型枚举code值
...@@ -779,18 +779,18 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -779,18 +779,18 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
} }
private List<WorkflowResultDto> workFlowInfo(String submitType,String receiveCompanyCode) { private List<WorkflowResultDto> workFlowInfo(String submitType, String receiveCompanyCode) {
if (SUBMIT_TYPE_FLOW.equals(submitType)) { if (SUBMIT_TYPE_FLOW.equals(submitType)) {
// 发起流程 // 发起流程
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO(); ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
List<ActWorkflowStartDTO> list = new ArrayList<>(); List<ActWorkflowStartDTO> list = new ArrayList<>();
ActWorkflowStartDTO dto = new ActWorkflowStartDTO(); ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY); dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
//下一节点执行人单位(下节点接收机构code) //下一节点执行人单位(下节点接收机构code)
dto.setNextExecuteUserCompanyCode(receiveCompanyCode); dto.setNextExecuteUserCompanyCode(receiveCompanyCode);
dto.setCompleteFirstTask(Boolean.TRUE); dto.setCompleteFirstTask(Boolean.TRUE);
list.add(dto); list.add(dto);
actWorkflowBatchDTO.setProcess(list); actWorkflowBatchDTO.setProcess(list);
List<ProcessTaskDTO> processTaskDTOS = cmWorkflowService.startBatch(actWorkflowBatchDTO); List<ProcessTaskDTO> processTaskDTOS = cmWorkflowService.startBatch(actWorkflowBatchDTO);
...@@ -882,14 +882,12 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -882,14 +882,12 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
model.setInspectionUnitName(inspectUnitIdList[1]); model.setInspectionUnitName(inspectUnitIdList[1]);
} }
} }
String projectContraption = model.getProjectContraption(); model.setProjectContraption(this.getProjectContraptionName(model.getProjectContraptionId()));
if (!ObjectUtils.isEmpty(projectContraption)) { }
String[] projectContraptionList = projectContraption.split("_");
if (projectContraptionList.length > 1) { private String getProjectContraptionName(String projectContraptionId) {
model.setProjectContraptionId(projectContraptionList[0]); IdxBizJgProjectContraption projectContraption = idxBizJgProjectContraptionServiceImplService.lambdaQuery().eq(BaseEntity::getSequenceNbr, projectContraptionId).select(BaseEntity::getSequenceNbr, IdxBizJgProjectContraption::getProjectContraption).one();
model.setProjectContraption(projectContraptionList[1]); return Optional.ofNullable(projectContraption).map(IdxBizJgProjectContraption::getProjectContraption).orElse(null);
}
}
} }
public boolean submit(JgMaintainNotice notice, String op, String opinion) { public boolean submit(JgMaintainNotice notice, String op, String opinion) {
...@@ -975,7 +973,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -975,7 +973,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@GlobalTransactional(rollbackFor = Exception.class) @GlobalTransactional(rollbackFor = Exception.class)
public void accept(JgMaintainNoticeDto dto, String op, String opinion,Map<String, Object> model) { public void accept(JgMaintainNoticeDto dto, String op, String opinion, Map<String, Object> model) {
String instanceId = dto.getInstanceId(); String instanceId = dto.getInstanceId();
String nextTaskId = dto.getNextTaskId(); String nextTaskId = dto.getNextTaskId();
String lockKey = CommonServiceImpl.buildJgExecuteLockKey(instanceId); String lockKey = CommonServiceImpl.buildJgExecuteLockKey(instanceId);
...@@ -1126,7 +1124,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -1126,7 +1124,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
} }
private void createResume(List<JgMaintainNoticeEq> jgRelationEquips, JgMaintainNotice notice, String routePath) { private void createResume(List<JgMaintainNoticeEq> jgRelationEquips, JgMaintainNotice notice, String routePath) {
if(StringUtils.hasText(notice.getProjectContraptionId())){ if (StringUtils.hasText(notice.getProjectContraptionId())) {
jgResumeInfoService.saveBatchResume(Collections.singletonList( jgResumeInfoService.saveBatchResume(Collections.singletonList(
JgResumeInfoDto.builder() JgResumeInfoDto.builder()
.applyNo(notice.getApplyNo()) .applyNo(notice.getApplyNo())
...@@ -1142,7 +1140,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -1142,7 +1140,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
) )
); );
} else { } else {
jgResumeInfoService.saveBatchResume(jgRelationEquips.stream().map(eq-> JgResumeInfoDto.builder().applyNo(notice.getApplyNo()) jgResumeInfoService.saveBatchResume(jgRelationEquips.stream().map(eq -> JgResumeInfoDto.builder().applyNo(notice.getApplyNo())
.businessType(BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION.getName()) .businessType(BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION.getName())
.businessId(String.valueOf(notice.getSequenceNbr())) .businessId(String.valueOf(notice.getSequenceNbr()))
.equId(eq.getEquId()) .equId(eq.getEquId())
...@@ -1160,7 +1158,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -1160,7 +1158,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
FeignClientResult<AgencyUserModel> agencyUserModelFeignClientResult = Privilege.agencyUserClient.queryByUserId(jgMaintainNotice.getCreateUserId()); FeignClientResult<AgencyUserModel> agencyUserModelFeignClientResult = Privilege.agencyUserClient.queryByUserId(jgMaintainNotice.getCreateUserId());
String content =jgMaintainNotice.getUseUnitName()+"的"+agencyUserModelFeignClientResult.getResult().getRealName() + "办理了【维修告知】" + String content = jgMaintainNotice.getUseUnitName() + "的" + agencyUserModelFeignClientResult.getResult().getRealName() + "办理了【维修告知】" +
"单号【" + jgMaintainNotice.getApplyNo() + "】,办理日期" + DateUtils.getDateNowShortStr(); "单号【" + jgMaintainNotice.getApplyNo() + "】,办理日期" + DateUtils.getDateNowShortStr();
List<JgCertificateChangeRecord> certificateChangeRecords = new ArrayList<>(); List<JgCertificateChangeRecord> certificateChangeRecords = new ArrayList<>();
List<JgCertificateChangeRecordEq> changeRecordEqList = new ArrayList<>(); List<JgCertificateChangeRecordEq> changeRecordEqList = new ArrayList<>();
...@@ -1211,7 +1209,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -1211,7 +1209,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
} }
private void createConstruction2Db(JgMaintainNotice jgMaintainNotice, List<JgMaintainNoticeEq> jgMaintainNoticeEqs) { private void createConstruction2Db(JgMaintainNotice jgMaintainNotice, List<JgMaintainNoticeEq> jgMaintainNoticeEqs) {
List<IdxBizJgConstructionInfo> constructionInfoList = jgMaintainNoticeEqs.stream().map(e->{ List<IdxBizJgConstructionInfo> constructionInfoList = jgMaintainNoticeEqs.stream().map(e -> {
IdxBizJgConstructionInfo idxBizJgConstructionInfo = new IdxBizJgConstructionInfo(); IdxBizJgConstructionInfo idxBizJgConstructionInfo = new IdxBizJgConstructionInfo();
idxBizJgConstructionInfo.setUscUnitCreditCode(jgMaintainNotice.getInstallUnitCreditCode()); idxBizJgConstructionInfo.setUscUnitCreditCode(jgMaintainNotice.getInstallUnitCreditCode());
idxBizJgConstructionInfo.setUscUnitName(jgMaintainNotice.getInstallUnitName()); idxBizJgConstructionInfo.setUscUnitName(jgMaintainNotice.getInstallUnitName());
...@@ -1266,6 +1264,13 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -1266,6 +1264,13 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
return maintainNotice; return maintainNotice;
} }
@Override
public IPage<Map<String, Object>> findPipeLinePage(Page<Map<String, Object>> page, String projectContraptionId, Map<String, Object> filters) {
IPage<Map<String, Object>> re = this.getBaseMapper().selectPipeLinePage(page, projectContraptionId, filters);
re.getRecords().forEach(item -> item.put("inspectReport", Optional.ofNullable(item.get("inspectReport")).map(r -> JSON.parse(r.toString())).orElse(null)));
return re;
}
private List<String> getEquList(JgMaintainNotice jgMaintainNotice) { private List<String> getEquList(JgMaintainNotice jgMaintainNotice) {
LambdaQueryWrapper<JgMaintainNoticeEq> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JgMaintainNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgMaintainNoticeEq::getEquipTransferId, jgMaintainNotice.getSequenceNbr()); queryWrapper.eq(JgMaintainNoticeEq::getEquipTransferId, jgMaintainNotice.getSequenceNbr());
...@@ -1288,7 +1293,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -1288,7 +1293,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
// 1.待办任务更新为已完成 // 1.待办任务更新为已完成
this.finishedTask(maintainNotice); this.finishedTask(maintainNotice);
// 2.终止流程-工作流报错暂时注释掉 // 2.终止流程-工作流报错暂时注释掉
iCmWorkflowService.stopProcess(maintainNotice.getInstanceId(), maintainNotice.getCancelReason()); cmWorkflowService.stopProcess(maintainNotice.getInstanceId(), maintainNotice.getCancelReason());
// 3.清空redis(缓存的流程中及已完成安装告知的设备) // 3.清空redis(缓存的流程中及已完成安装告知的设备)
this.delRepeatUseEquipData(maintainNotice); this.delRepeatUseEquipData(maintainNotice);
} }
...@@ -1309,7 +1314,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -1309,7 +1314,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
@Override @Override
public boolean beforeCheck(JgMaintainNotice jgMaintainNotice) { public boolean beforeCheck(JgMaintainNotice jgMaintainNotice) {
return jgMaintainNotice.getInstanceId() != null && !jgMaintainNotice.getNoticeStatus().equals(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode())) &&!jgMaintainNotice.getNoticeStatus().equals(String.valueOf(FlowStatusEnum.TO_BE_DISCARD.getCode())); return jgMaintainNotice.getInstanceId() != null && !jgMaintainNotice.getNoticeStatus().equals(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode())) && !jgMaintainNotice.getNoticeStatus().equals(String.valueOf(FlowStatusEnum.TO_BE_DISCARD.getCode()));
} }
@Override @Override
......
...@@ -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