Commit 320099f9 authored by suhuiguang's avatar suhuiguang

fix(jg): 压力管道管道长度

1.改造变更登记后更新装置的管道长度
parent b556bb51
......@@ -12,7 +12,6 @@ import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dao.EsEquipmentDao;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo;
import com.yeejoin.amos.boot.module.jg.api.common.PipLenCalUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.biz.edit.constant.EditConstant;
import com.yeejoin.amos.boot.module.jg.biz.edit.typeHandler.CbDataDictTypeHandler;
......@@ -342,7 +341,6 @@ public class PieLineDataChangeServiceImpl {
wrapper.eq(BaseEntity::getSequenceNbr, projectContraptionId);
wrapper.set(IdxBizJgProjectContraption::getPipelineLength, this.calTotalPieLineLength(projectContraptionId));
idxBizJgProjectContraptionServiceImpl.update(wrapper);
}
private Double calTotalPieLineLength(String projectContraptionId) {
......@@ -352,7 +350,7 @@ public class PieLineDataChangeServiceImpl {
List<IdxBizJgTechParamsPipeline> techParamsPipelines = idxBizJgTechParamsPipelineService.list(new LambdaQueryWrapper<IdxBizJgTechParamsPipeline>().in(IdxBizJgTechParamsPipeline::getRecord, records).select(IdxBizJgTechParamsPipeline::getRecord, IdxBizJgTechParamsPipeline::getPipeLength));
return techParamsPipelines.stream().filter(i -> i.getPipeLength() != null).map(e -> new BigDecimal(e.getPipeLength()))
.reduce(BigDecimal.ZERO, BigDecimal::add)
.setScale(3, RoundingMode.HALF_UP).doubleValue();
.setScale(3, RoundingMode.HALF_UP).stripTrailingZeros().doubleValue();
}
public String calPipelineLength(Map<String, List<PipelineChangeItemDto>> pipelineChangeItemMap) {
......
......@@ -36,6 +36,7 @@ import com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
import com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext;
import com.yeejoin.amos.boot.module.jg.biz.edit.permission.FillingEditPermForCurrentUser;
import com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.changeRegistrationReform.ChangeRegisterReformBackupManager;
import com.yeejoin.amos.boot.module.jg.biz.edit.process.equip.PieLineDataChangeServiceImpl;
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.service.*;
......@@ -200,6 +201,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
@Autowired
JgResumeInfoServiceImpl jgResumeInfoService;
@Autowired
private PieLineDataChangeServiceImpl pieLineDataChangeService;
/***
* @deprecated 根据查询调教获取分页对象
* @param dto 查询的dto对象
......@@ -869,6 +873,8 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
useInfoLambdaUpdateWrapper.set(IdxBizJgUseInfo::getIsIntoManagement, true);
idxBizJgUseInfoService.update(useInfoLambdaUpdateWrapper);
}
// 更新装置的汇总的管道长度
pieLineDataChangeService.updatePipelineLength(jgChangeRegistrationReform.getProjectContraptionId());
return paramsPipelines;
}
......
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