From d29b3362524fd36d39ca47b02e76a8cfa63e12f8 Mon Sep 17 00:00:00 2001 From: liuyuxin Date: Wed, 25 Feb 2026 16:53:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E8=A1=A8=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=BB=A5=E5=8F=8A=E5=AD=98=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zg/project/wisdom/domain/RkInfo.java | 12 +++++++++++ .../service/impl/RkRecordServiceImpl.java | 20 +++++++++++++++++++ .../resources/mybatis/wisdom/RkInfoMapper.xml | 15 ++++++++++++-- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zg/project/wisdom/domain/RkInfo.java b/src/main/java/com/zg/project/wisdom/domain/RkInfo.java index 0424460..d718837 100644 --- a/src/main/java/com/zg/project/wisdom/domain/RkInfo.java +++ b/src/main/java/com/zg/project/wisdom/domain/RkInfo.java @@ -254,6 +254,9 @@ public class RkInfo extends BaseEntity /** 场景 */ @Excel(name = "场景",readConverterExp = "HJ=货架,DC=堆场") private String scene; + + private String sceneName; + public void setId(Long id) { this.id = id; @@ -808,6 +811,15 @@ public class RkInfo extends BaseEntity { return scene; } + public void setSceneName(String sceneName) + { + this.sceneName = sceneName; + } + + public String getSceneName() + { + return sceneName; + } @Override public String toString() { diff --git a/src/main/java/com/zg/project/wisdom/service/impl/RkRecordServiceImpl.java b/src/main/java/com/zg/project/wisdom/service/impl/RkRecordServiceImpl.java index 898264c..efd5bb0 100644 --- a/src/main/java/com/zg/project/wisdom/service/impl/RkRecordServiceImpl.java +++ b/src/main/java/com/zg/project/wisdom/service/impl/RkRecordServiceImpl.java @@ -7,6 +7,8 @@ import java.util.stream.Collectors; import com.zg.common.exception.ServiceException; import com.zg.common.utils.DateUtils; import com.zg.common.utils.StringUtils; +import com.zg.project.information.domain.PcdeDetail; +import com.zg.project.information.mapper.PcdeDetailMapper; import com.zg.project.wisdom.domain.GysJh; import com.zg.project.wisdom.domain.RkInfo; import com.zg.project.wisdom.domain.vo.RecordStatisticVO; @@ -43,6 +45,8 @@ public class RkRecordServiceImpl implements IRkRecordService @Autowired private GysJhMapper gysJhMapper; + @Autowired + private PcdeDetailMapper pcdeDetailMapper; /** * 查询出入库记录 * @@ -199,6 +203,22 @@ public class RkRecordServiceImpl implements IRkRecordService } /* ---------- 同步库存(明确字段,禁止 BeanUtils) ---------- */ + String scene = ""; + // 库位校验 + if (StringUtils.isNotBlank(info.getPcode())) { + PcdeDetail pcde = pcdeDetailMapper.selectByPcodeAndWarehouse( + rkRecord.getPcode(), + rkRecord.getCangku() + ); + if (pcde == null) { + throw new RuntimeException("库位不存在:" + info.getPcode()); + } + info.setPcodeId(pcde.getEncodedId()); + if(StringUtils.isNotBlank(pcde.getScene())){ + scene = pcde.getScene(); + info.setScene(scene); + } + } info.setRealQty(newInQty); info.setWlNo(rkRecord.getWlNo()); info.setWlMs(rkRecord.getWlMs()); diff --git a/src/main/resources/mybatis/wisdom/RkInfoMapper.xml b/src/main/resources/mybatis/wisdom/RkInfoMapper.xml index fd13c23..e56e17f 100644 --- a/src/main/resources/mybatis/wisdom/RkInfoMapper.xml +++ b/src/main/resources/mybatis/wisdom/RkInfoMapper.xml @@ -67,13 +67,18 @@ + SELECT ri.*, - + CASE + WHEN ri.scene = 'HJ' THEN '货架' + WHEN ri.scene = 'DC' THEN '堆场' + ELSE ri.scene + END AS sceneName, /* ===== 新增:计算总金额 ===== */ ri.real_qty * ri.ht_dj AS total_amount, @@ -155,7 +160,9 @@ AND ri.remark LIKE CONCAT('%', #{remark}, '%') - + + AND ri.scene LIKE CONCAT('%', #{scene}, '%') + AND ri.is_delete = #{isDelete} @@ -241,6 +248,9 @@ AND ri.wl_ms LIKE CONCAT('%', #{wlMs}, '%') + + AND ri.scene LIKE CONCAT('%', #{scene}, '%') + AND ri.gys_mc LIKE CONCAT('%', #{gysMc}, '%') @@ -373,6 +383,7 @@ update_by = #{updateBy}, update_time = #{updateTime}, is_delete = #{isDelete}, + scene = #{scene} WHERE id = #{id}