Commit 599a92bb authored by suhuiguang's avatar suhuiguang

1.历史数据处理----安装告知审批完成但是装置是否纳管状态不正确的数据

parent e62e2a43
......@@ -86,4 +86,12 @@ public class DataHandlerController extends BaseController {
return ResponseHelper.buildResponse(true);
}
@ApiOperation(httpMethod = "PUT", value = "由于前期设备纳管状态不对,导致的1220上线时 创建的装置纳管状态不对,刷库", notes = "历史数据处理")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/v2/projectContraption/info")
public ResponseModel<Boolean> projectContraptionInfoUpdateV2(){
dataHandlerService.projectContraptionInfoUpdateV2();
return ResponseHelper.buildResponse(true);
}
}
......@@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
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.TzsBaseEntity;
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.dto.ESEquipmentCategoryDto;
......@@ -21,10 +22,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectConstructionMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectInspectionMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -116,6 +114,8 @@ public class DataHandlerServiceImpl {
@Resource
IIdxBizJgInspectionDetectionInfoService iIdxBizJgInspectionDetectionInfoService;
@Autowired
private IdxBizJgProjectContraptionMapper idxBizJgProjectContraptionMapper;
/**
......@@ -829,4 +829,26 @@ public class DataHandlerServiceImpl {
.isNull(JgUseRegistration::getProjectContraptionId)
.select(BaseEntity::getSequenceNbr, JgUseRegistration::getProjectContraption, JgUseRegistration::getUseRegistrationCode, JgUseRegistration::getStatus, JgUseRegistration::getAuditPassDate));
}
/**
* 处理管道-安装告知审批完成但是装置是否纳管状态不正确的数据
*/
@Transactional(rollbackFor = Exception.class)
public void projectContraptionInfoUpdateV2() {
List<IdxBizJgProjectContraption> projectConstructions = idxBizJgProjectContraptionMapper.selectErrorManagementProject();
log.info("处理前:安装告知审批完成但是装置是否纳管状态不正确的数据量:{}", projectConstructions.size());
projectConstructions.parallelStream().forEach(p->{
LambdaUpdateWrapper<IdxBizJgProjectContraption> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(BaseEntity::getSequenceNbr, p.getSequenceNbr());
updateWrapper.set(IdxBizJgProjectContraption::getUscUnitName, p.getUscUnitName());
updateWrapper.set(IdxBizJgProjectContraption::getUscUnitCreditCode, p.getUscUnitCreditCode());
updateWrapper.set(IdxBizJgProjectContraption::getUseUnitName, p.getUseUnitName());
updateWrapper.set(IdxBizJgProjectContraption::getUseUnitCreditCode, p.getUseUnitCreditCode());
updateWrapper.set(BaseEntity::getRecDate, p.getRecDate());
updateWrapper.set(IdxBizJgProjectContraption::getIsIntoManagement, true);
projectContraptionService.update(null, updateWrapper);
});
List<IdxBizJgProjectContraption> projectConstructionsAfter = idxBizJgProjectContraptionMapper.selectErrorManagementProject();
log.info("处理后:安装告知审批完成但是装置是否纳管状态不正确的数据量:{}", projectConstructionsAfter.size());
}
}
package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectConstruction;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import org.apache.ibatis.annotations.Param;
......@@ -33,4 +34,6 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
* @return 被引用次数 > 0 则设备不可删除
*/
Integer countContraptionInUseTimesForDelete(@Param("projectContraptionId") Long projectContraptionId);
List<IdxBizJgProjectContraption> selectErrorManagementProject();
}
......@@ -123,4 +123,21 @@
AND (a.notice_status <![CDATA[ <> ]]> '6617')
)
</select>
<select id="selectErrorManagementProject"
resultType="com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption">
select
p.sequence_nbr,
n.install_unit_name as usc_unit_name,
n.install_unit_credit_code as usc_unit_credit_code,
n.use_unit_credit_code,
n.use_unit_name
from
tzs_jg_installation_notice n,
idx_biz_jg_project_contraption p
where
n.project_contraption_id = p.sequence_nbr
and n.notice_status='6616'
and p.is_into_management = false
and n.is_delete = false
</select>
</mapper>
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