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}