bug修复

This commit is contained in:
guo 2023-12-11 14:57:04 +08:00
parent 55a2be9cde
commit 197786c48b
2 changed files with 12 additions and 6 deletions

View File

@ -57,6 +57,9 @@
<if test="smartBeamFieldMakeBeamPedestalId != null">
smart_beam_field_make_beam_pedestal_id = #{smartBeamFieldMakeBeamPedestalId,jdbcType=BIGINT},
</if>
<if test="status != null">
status = #{status},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>

View File

@ -69,21 +69,24 @@ public class SmartBeamFieldBeamToProcessServiceImpl extends ServiceImpl<SmartBea
smartBeamFieldBeamToProcess.setId(null);
smartBeamFieldBeamToProcess.setStatus(getStatus(smartBeamFieldBeamToProcess));
baseMapper.insert(smartBeamFieldBeamToProcess);
setDoneIf(smartBeamFieldBeamToProcess);
setBeamStatus(smartBeamFieldBeamToProcess);
}
private void setDoneIf(SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess) {
private void setBeamStatus(SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess) {
//判断梁是否完成
Long smartBeamFieldBeamId = smartBeamFieldBeamToProcess.getSmartBeamFieldBeamId();
List<SmartBeamFieldBeamToProcess> smartBeamFieldBeamToProcesses = smartBeamFieldBeamToProcessMapper.selectList(new LambdaQueryWrapper<SmartBeamFieldBeamToProcess>()
.eq(SmartBeamFieldBeamToProcess::getSmartBeamFieldBeamId, smartBeamFieldBeamId)
.in(SmartBeamFieldBeamToProcess::getStatus, Stream.of(1, 2).collect(Collectors.toList()))
);
int status;
if (CollUtil.isEmpty(smartBeamFieldBeamToProcesses)) {
smartBeamFieldBeamMapper.update(null, new LambdaUpdateWrapper<SmartBeamFieldBeam>().set(SmartBeamFieldBeam::getBeamMakeStatus, 3)
.eq(SmartBeamFieldBeam::getId, smartBeamFieldBeamId));
status = 3;
} else {
status = 2;
}
smartBeamFieldBeamMapper.update(null, new LambdaUpdateWrapper<SmartBeamFieldBeam>().set(SmartBeamFieldBeam::getBeamMakeStatus, status)
.eq(SmartBeamFieldBeam::getId, smartBeamFieldBeamId));
}
private Integer getStatus(SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess) {
@ -100,7 +103,7 @@ public class SmartBeamFieldBeamToProcessServiceImpl extends ServiceImpl<SmartBea
public void edit(SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess) {
smartBeamFieldBeamToProcess.setStatus(getStatus(smartBeamFieldBeamToProcess));
baseMapper.updateByPrimaryKeyCustom(smartBeamFieldBeamToProcess);
setDoneIf(smartBeamFieldBeamToProcess);
setBeamStatus(smartBeamFieldBeamToProcess);
}
@Override