库存表新增字段以及存值

This commit is contained in:
2026-02-25 16:53:28 +08:00
parent 2183528894
commit d29b336252
3 changed files with 45 additions and 2 deletions

View File

@@ -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() {

View File

@@ -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());

View File

@@ -67,13 +67,18 @@
<result property="fycde2" column="fycde_2"/>
<result property="isUpdate" column="is_update"/>
<result property="scene" column="scene"/>
<result property="sceneName" column="sceneName"/>
</resultMap>
<!-- ========================= 公共查询 SQL联表完整版 ========================= -->
<sql id="selectRkInfoVo">
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 @@
<if test="remark != null and remark != ''">
AND ri.remark LIKE CONCAT('%', #{remark}, '%')
</if>
<if test="scene != null and scene != ''">
AND ri.scene LIKE CONCAT('%', #{scene}, '%')
</if>
<if test="isDelete != null and isDelete != ''">
AND ri.is_delete = #{isDelete}
</if>
@@ -241,6 +248,9 @@
<if test="wlMs != null and wlMs != ''">
AND ri.wl_ms LIKE CONCAT('%', #{wlMs}, '%')
</if>
<if test="scene != null and scene != ''">
AND ri.scene LIKE CONCAT('%', #{scene}, '%')
</if>
<if test="gysMc != null and gysMc != ''">
AND ri.gys_mc LIKE CONCAT('%', #{gysMc}, '%')
</if>
@@ -373,6 +383,7 @@
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="scene != null">scene = #{scene}</if>
</trim>
WHERE id = #{id}
</update>