From 41e82056d13fd9cfa3f94cdd908482b428336211 Mon Sep 17 00:00:00 2001 From: guo Date: Mon, 11 Dec 2023 10:27:41 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SmartBeamFieldBeamToProcessMapper.java | 4 +- .../xml/SmartBeamFieldBeamToProcessMapper.xml | 39 +++++++++++++++++++ .../SmartBeamFieldSaveBeamPedestalMapper.xml | 2 +- .../impl/SmartBeamFieldBeamServiceImpl.java | 8 ++++ ...martBeamFieldBeamToProcessServiceImpl.java | 11 +++--- .../zhgd/xmgl/security/WebSecurityConfig.java | 2 + 6 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldBeamToProcessMapper.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldBeamToProcessMapper.java index d461f743a..02ab71636 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldBeamToProcessMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldBeamToProcessMapper.java @@ -1,13 +1,13 @@ package com.zhgd.xmgl.modules.smartbeamfield.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeamToProcess; import com.zhgd.xmgl.modules.smartbeamfield.entity.vo.CountDurationVo; import org.apache.ibatis.annotations.Mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -26,4 +26,6 @@ public interface SmartBeamFieldBeamToProcessMapper extends BaseMapper queryList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); CountDurationVo countDuration(String smartBeamFieldBeamId); + + int updateByPrimaryKeyCustom(SmartBeamFieldBeamToProcess smartBeamFieldBeamToProcess); } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldBeamToProcessMapper.xml b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldBeamToProcessMapper.xml index 6bc10b6bd..20f961a80 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldBeamToProcessMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldBeamToProcessMapper.xml @@ -21,4 +21,43 @@ from smart_beam_field_beam_to_process where smart_beam_field_beam_id = #{id} + + + update smart_beam_field_beam_to_process + + + smart_beam_field_beam_id = #{smartBeamFieldBeamId,jdbcType=BIGINT}, + + + smart_beam_field_process_id = #{smartBeamFieldProcessId,jdbcType=BIGINT}, + + + process_name = #{processName,jdbcType=VARCHAR}, + + planned_start_time = #{plannedStartTime,jdbcType=TIMESTAMP}, + planned_end_time = #{plannedEndTime,jdbcType=TIMESTAMP}, + actual_start_time = #{actualStartTime,jdbcType=TIMESTAMP}, + actual_end_time = #{actualEndTime,jdbcType=TIMESTAMP}, + + make_beam_pedestal_sn = #{makeBeamPedestalSn,jdbcType=VARCHAR}, + + + process_charge_person = #{processChargePerson,jdbcType=VARCHAR}, + + + project_sn = #{projectSn,jdbcType=VARCHAR}, + + + create_date = #{createDate,jdbcType=TIMESTAMP}, + + + update_date = #{updateDate,jdbcType=TIMESTAMP}, + + + smart_beam_field_make_beam_pedestal_id = #{smartBeamFieldMakeBeamPedestalId,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldSaveBeamPedestalMapper.xml b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldSaveBeamPedestalMapper.xml index 1fa4aad8c..5c2b1aa29 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldSaveBeamPedestalMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldSaveBeamPedestalMapper.xml @@ -15,7 +15,7 @@ select sbfsbp.*,if(count(sbfsbp.id) =2 ,1 ,0) bindByBeamTwice from smart_beam_field_save_beam_pedestal sbfsbp left join smart_beam_field_beam_to_save_beam_pedestal sbfbtsbp on sbfsbp.id = - sbfbtsbp.smart_beam_field_save_beam_pedestal_id + sbfbtsbp.smart_beam_field_save_beam_pedestal_id and sbfbtsbp.is_save_beam=1 ${ew.customSqlSegment} group by sbfsbp.id order by sbfsbp.id desc diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamServiceImpl.java index 6e3f70fd2..1e3b4fba7 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamServiceImpl.java @@ -6,6 +6,7 @@ import cn.hutool.core.util.IdUtil; import cn.hutool.extra.qrcode.QrCodeUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -164,6 +165,13 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl() + .set(SmartBeamFieldBeamToSaveBeamPedestal::getIsSaveBeam, 0) + .eq(SmartBeamFieldBeamToSaveBeamPedestal::getSmartBeamFieldBeamId, smartBeamFieldBeamId) + .eq(SmartBeamFieldBeamToSaveBeamPedestal::getIsSaveBeam, 1) + ); + SmartBeamFieldBeam beam = getById(smartBeamFieldBeamId); SmartBeamFieldBeamToSaveBeamPedestal saveBeamPedestalBeam = new SmartBeamFieldBeamToSaveBeamPedestal(); saveBeamPedestalBeam.setSmartBeamFieldSaveBeamPedestalId(smartBeamFieldSaveBeamPedestalId); diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamToProcessServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamToProcessServiceImpl.java index b12ca16a0..dfa93f29c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamToProcessServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldBeamToProcessServiceImpl.java @@ -1,7 +1,6 @@ package com.zhgd.xmgl.modules.smartbeamfield.service.impl; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; @@ -16,15 +15,15 @@ import com.zhgd.xmgl.modules.smartbeamfield.mapper.SmartBeamFieldBeamMapper; import com.zhgd.xmgl.modules.smartbeamfield.mapper.SmartBeamFieldBeamToProcessMapper; import com.zhgd.xmgl.modules.smartbeamfield.service.ISmartBeamFieldBeamToProcessService; import com.zhgd.xmgl.util.PageUtil; -import com.zhgd.xmgl.util.RefUtil; import com.zhgd.xmgl.util.TimeUtil; -import org.apache.commons.collections.MapUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.HashMap; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; /** * @Description: 智慧梁场-梁和工序中间表 @@ -78,7 +77,9 @@ public class SmartBeamFieldBeamToProcessServiceImpl extends ServiceImpl smartBeamFieldBeamToProcesses = smartBeamFieldBeamToProcessMapper.selectList(new LambdaQueryWrapper() - .eq(SmartBeamFieldBeamToProcess::getSmartBeamFieldBeamId, smartBeamFieldBeamId)); + .eq(SmartBeamFieldBeamToProcess::getSmartBeamFieldBeamId, smartBeamFieldBeamId) + .in(SmartBeamFieldBeamToProcess::getStatus, Stream.of(1, 2).collect(Collectors.toList())) + ); if (CollUtil.isEmpty(smartBeamFieldBeamToProcesses)) { smartBeamFieldBeamMapper.update(null, new LambdaUpdateWrapper().set(SmartBeamFieldBeam::getBeamMakeStatus, 3) .eq(SmartBeamFieldBeam::getId, smartBeamFieldBeamId)); @@ -98,7 +99,7 @@ public class SmartBeamFieldBeamToProcessServiceImpl extends ServiceImpl