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"> <if test="smartBeamFieldMakeBeamPedestalId != null">
smart_beam_field_make_beam_pedestal_id = #{smartBeamFieldMakeBeamPedestalId,jdbcType=BIGINT}, smart_beam_field_make_beam_pedestal_id = #{smartBeamFieldMakeBeamPedestalId,jdbcType=BIGINT},
</if> </if>
<if test="status != null">
status = #{status},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>

View File

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