盘库查询逻辑修改,不再联查物料基表

This commit is contained in:
Ledo 2025-07-06 11:26:54 +08:00
parent 4ffb6db0a2
commit 5bd4cd1d16
4 changed files with 16 additions and 7 deletions

View File

@ -177,7 +177,12 @@ public class StorageCheckServiceImpl implements StorageCheckService {
BigDecimal bigDecimal = new BigDecimal(storageMatDO.getOnemoney());
storageInventoryDO.setPrice(bigDecimal);
}
storageInventoryMapper.insertOrUpdate(storageInventoryDO);
if (storageInventoryDO.getId() != null){
storageInventoryMapper.updateById(storageInventoryDO);
}else{
storageInventoryMapper.insert(storageInventoryDO);
}
} else {
//不然就是出库
LambdaQueryWrapper<StorageInventoryDO> wrapper = new LambdaQueryWrapper<>();
@ -194,7 +199,7 @@ public class StorageCheckServiceImpl implements StorageCheckService {
BigDecimal bigDecimal = new BigDecimal(storageMatDO.getOnemoney());
storageInventoryDO.setPrice(bigDecimal);
}
storageInventoryMapper.insertOrUpdate(storageInventoryDO);
storageInventoryMapper.updateById(storageInventoryDO);
}
// 插入库存日志表

View File

@ -83,11 +83,12 @@ public class StorageInventoryServiceImpl implements StorageInventoryService {
public List<StorageInventoryDO> getStorageNowList(StorageInventoryPageReqVO queryReqVO) {
if(queryReqVO.getNoZero().equals(1)){
// 根据仓库id排除库存为o的物料
return storageInventoryMapper.selectNoZero(queryReqVO);
return storageInventoryMapper.selectNowList(queryReqVO);
}else{
// 筛选全部的实时库存数据包含未分配仓库的物料信息和已分配仓库的物料信息
if(queryReqVO.getSelectAll() == 1){
return storageInventoryMapper.selectNowListAll(queryReqVO);
// return storageInventoryMapper.selectNowListAll(queryReqVO);
return storageInventoryMapper.selectNowList(queryReqVO);
}else{
return storageInventoryMapper.selectNowList(queryReqVO);
}

View File

@ -65,6 +65,9 @@
<if test="matSpec != null and matSpec != ''">
AND gh.mat_spec LIKE CONCAT('%', #{matSpec}, '%')
</if>
<if test="noZero == 1 ">
AND gh.mat_rest != 0
</if>
</where>
ORDER BY gh.mat_code
</select>

View File

@ -131,7 +131,7 @@
</template>
</el-table-column>
<el-table-column prop="matRest" label="库存数量" min-width="120" align="center" />
<el-table-column prop="storageOkQty" min-width="120" align="center">
<el-table-column prop="storageOkQty" align="center" min-width="180" >
<template #header> <span class="hl-table_header">*</span>盘点数量</template>
<template #default="scope">
<el-form-item :prop="`${scope.$index}.storageOkQty`" :rules="subFormRules.storageOkQty" class="mb-0px!">
@ -148,7 +148,7 @@
</el-form-item>
</template>
</el-table-column> -->
<el-table-column prop="onemoney" label="单价" min-width="120" align="center">
<el-table-column prop="onemoney" label="单价" align="center" min-width="180" >
<template #default="scope">
<el-form-item :prop="`${scope.$index}.onemoney`" class="mb-0px!">
<el-input-number v-model="scope.row.onemoney" :min="0" :disabled="ctrView || ctrSave"/>