Commit 97c6ee74 by chuishuo

盘点计划主表——完成

parent 1f269b05
import request from '@/utils/request'
// 查询盘点单主列表
export function listStocktakes(query) {
return request({
url: '/inventory/stocktakes/list',
method: 'get',
params: query
})
}
// 查询盘点单主详细
export function getStocktakes(id) {
return request({
url: '/inventory/stocktakes/' + id,
method: 'get'
})
}
// 新增盘点单主
export function addStocktakes(data) {
return request({
url: '/inventory/stocktakes',
method: 'post',
data: data
})
}
// 修改盘点单主
export function updateStocktakes(data) {
return request({
url: '/inventory/stocktakes',
method: 'put',
data: data
})
}
// 删除盘点单主
export function delStocktakes(id) {
return request({
url: '/inventory/stocktakes/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询盘点单明细列表
export function listItems(query) {
return request({
url: '/inventory/items/list',
method: 'get',
params: query
})
}
// 查询盘点单明细详细
export function getItems(id) {
return request({
url: '/inventory/items/' + id,
method: 'get'
})
}
// 新增盘点单明细
export function addItems(data) {
return request({
url: '/inventory/items',
method: 'post',
data: data
})
}
// 修改盘点单明细
export function updateItems(data) {
return request({
url: '/inventory/items',
method: 'put',
data: data
})
}
// 删除盘点单明细
export function delItems(id) {
return request({
url: '/inventory/items/' + id,
method: 'delete'
})
}
<template>
<el-select
v-if="dictData.length > 0"
v-model="innerValue"
:placeholder="placeholder"
:clearable="clearable"
:filterable="filterable"
:disabled="disabled"
@change="handleChange"
@clear="handleClear"
>
<el-option
v-for="(item, index) in dictData"
:key="`${componentId}-${index}-${item[valueKey]}`"
:label="item[labelKey]"
:value="item[valueKey]"
/>
</el-select>
</template>
<script>
import request from '@/utils/request'
import { loadDictData } from '@/utils/dictUtil'
let componentIdCounter = 0
export default {
name: 'CommonDictSelect',
props: {
value: { type: [String, Number], default: '' },
dictUrl: { type: String, required: true },
// 新增:动态参数(用于联动,如仓库ID)
dictParams: {
type: Object,
default: () => ({})
},
valueKey: { type: String, default: 'id' },
labelKey: { type: String, default: 'name' },
placeholder: { type: String, default: '请选择' },
clearable: { type: Boolean, default: true },
filterable: { type: Boolean, default: true },
disabled: { type: Boolean, default: false },
loadingText: { type: String, default: '加载中...' }
},
data() {
return {
dictData: [],
componentId: `dict-select-${componentIdCounter++}`,
innerValue: this.value
}
},
watch: {
value: {
handler(newVal) {
this.innerValue = newVal
},
immediate: true
},
innerValue(newVal) {
this.$emit('input', newVal)
},
// 监听联动参数变化,重新加载字典
dictParams: {
handler() {
this.loadDict()
},
deep: true, // 深度监听对象变化
immediate: true
}
},
async created() {
this.loadDict()
},
methods: {
// 封装加载字典方法(支持动态参数)
async loadDict() {
const rawData = await loadDictData(
this.dictUrl,
request,
this.dictParams // 传递联动参数
)
this.dictData = this.uniqueDictData(rawData, this.valueKey)
this.$emit('loaded', this.dictData)
},
// 对外暴露:手动更新字典数据(可选)
updateDictData(params) {
this.dictParams = params
this.innerValue = '' // 清空当前选择
this.$emit('input', '') // 同步到父组件
},
uniqueDictData(data, key) {
if (!Array.isArray(data)) return []
const valueMap = new Map()
return data.filter(item => {
if (!item || item[key] === undefined || item[key] === null) return false
const valueStr = String(item[key]).trim()
if (!valueMap.has(valueStr)) {
valueMap.set(valueStr, true)
return true
}
return false
})
},
handleChange(val) {
this.$emit('change', val)
},
handleClear() {
this.$emit('clear')
this.$emit('input', '')
}
}
}
</script>
<style scoped>
:deep(.el-select) {
width: 100%;
}
</style>
/**
* 通用加载字典数据方法(支持动态参数)
* @param {String} url 字典接口地址
* @param {Object} request axios实例
* @param {Object} params 请求参数(联动用)
* @returns {Array} 字典数据
*/
export async function loadDictData(url, request, params = {}) {
try {
const res = await request({
url,
method: 'get',
params // 新增:传递动态参数
})
return res?.data || res || []
} catch (error) {
console.error(`加载字典[${url}]失败:`, error)
return []
}
}
/**
* 通用字典值转标签方法
* @param {Array} dictData 字典数组
* @param {String/Number} value 要匹配的值
* @param {String} valueKey 字典值字段
* @param {String} labelKey 字典标签字段
* @returns {String} 匹配到的标签
*/
export function getDictLabel(dictData, value, valueKey = 'id', labelKey = 'name') {
if (!value || !dictData || !Array.isArray(dictData) || dictData.length === 0) {
return String(value || '')
}
const targetValue = String(value).trim()
const matchItem = dictData.find(item => {
return String(item[valueKey] || '').trim() === targetValue
})
return matchItem ? matchItem[labelKey] : targetValue
}
package com.ruoyi.web.controller.inventory;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.inventory.domain.InventoryTransactions;
import com.ruoyi.inventory.service.IInventoryTransactionsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 库存事务Controller
*
* @author ruoyi
* @date 2025-12-02
*/
@RestController
@RequestMapping("/inventory/transactions")
public class InventoryTransactionsController extends BaseController
{
@Autowired
private IInventoryTransactionsService inventoryTransactionsService;
/**
* 查询库存事务列表
*/
@PreAuthorize("@ss.hasPermi('inventory:transactions:list')")
@GetMapping("/list")
public TableDataInfo list(InventoryTransactions inventoryTransactions)
{
startPage();
List<InventoryTransactions> list = inventoryTransactionsService.selectInventoryTransactionsList(inventoryTransactions);
return getDataTable(list);
}
/**
* 导出库存事务列表
*/
@PreAuthorize("@ss.hasPermi('inventory:transactions:export')")
@Log(title = "库存事务", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InventoryTransactions inventoryTransactions)
{
List<InventoryTransactions> list = inventoryTransactionsService.selectInventoryTransactionsList(inventoryTransactions);
ExcelUtil<InventoryTransactions> util = new ExcelUtil<InventoryTransactions>(InventoryTransactions.class);
util.exportExcel(response, list, "库存事务数据");
}
/**
* 获取库存事务详细信息
*/
@PreAuthorize("@ss.hasPermi('inventory:transactions:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(inventoryTransactionsService.selectInventoryTransactionsById(id));
}
/**
* 新增库存事务
*/
@PreAuthorize("@ss.hasPermi('inventory:transactions:add')")
@Log(title = "库存事务", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody InventoryTransactions inventoryTransactions)
{
return toAjax(inventoryTransactionsService.insertInventoryTransactions(inventoryTransactions));
}
/**
* 修改库存事务
*/
@PreAuthorize("@ss.hasPermi('inventory:transactions:edit')")
@Log(title = "库存事务", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody InventoryTransactions inventoryTransactions)
{
return toAjax(inventoryTransactionsService.updateInventoryTransactions(inventoryTransactions));
}
/**
* 删除库存事务
*/
@PreAuthorize("@ss.hasPermi('inventory:transactions:remove')")
@Log(title = "库存事务", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(inventoryTransactionsService.deleteInventoryTransactionsByIds(ids));
}
}
package com.ruoyi.web.controller.inventory; package com.ruoyi.web.controller.inventory;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.entity.Materials; import com.ruoyi.common.core.domain.entity.Materials;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
...@@ -26,7 +21,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -26,7 +21,7 @@ import org.springframework.web.multipart.MultipartFile;
/** /**
* 物料Controller * 物料Controller
* *
* @author ruoyi * @author ruoyi
* @date 2025-11-28 * @date 2025-11-28
*/ */
...@@ -136,4 +131,22 @@ public class MaterialsController extends BaseController ...@@ -136,4 +131,22 @@ public class MaterialsController extends BaseController
String message = materialsService.importMaterials(materialsList, updateSupport, operName); String message = materialsService.importMaterials(materialsList, updateSupport, operName);
return success(message); return success(message);
} }
/**
* @description: 获取物料 的 sap_no Name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
@GetMapping(value = "/getMapList")
@ResponseBody
public List<Map<String, Object>> getMapList()
{
try {
return materialsService.getMapList();
} catch (Exception e) {
return Collections.emptyList(); // 替代new ArrayList<>(),更高效
}
}
} }
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId> <artifactId>ruoyi-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
package com.ruoyi.inventory.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.inventory.domain.StocktakeItems;
import com.ruoyi.inventory.service.IStocktakeItemsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 盘点单明细Controller
*
* @author ruoyi
* @date 2025-12-02
*/
@RestController
@RequestMapping("/inventory/stocktakeItems")
public class StocktakeItemsController extends BaseController
{
@Autowired
private IStocktakeItemsService stocktakeItemsService;
/**
* 查询盘点单明细列表
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakeItems:list')")
@GetMapping("/list")
public TableDataInfo list(StocktakeItems stocktakeItems)
{
startPage();
List<StocktakeItems> list = stocktakeItemsService.selectStocktakeItemsList(stocktakeItems);
return getDataTable(list);
}
/**
* 导出盘点单明细列表
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakeItems:export')")
@Log(title = "盘点单明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StocktakeItems stocktakeItems)
{
List<StocktakeItems> list = stocktakeItemsService.selectStocktakeItemsList(stocktakeItems);
ExcelUtil<StocktakeItems> util = new ExcelUtil<StocktakeItems>(StocktakeItems.class);
util.exportExcel(response, list, "盘点单明细数据");
}
/**
* 获取盘点单明细详细信息
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakeItems:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(stocktakeItemsService.selectStocktakeItemsById(id));
}
/**
* 新增盘点单明细
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakeItems:add')")
@Log(title = "盘点单明细", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody StocktakeItems stocktakeItems)
{
return toAjax(stocktakeItemsService.insertStocktakeItems(stocktakeItems));
}
/**
* 修改盘点单明细
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakeItems:edit')")
@Log(title = "盘点单明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody StocktakeItems stocktakeItems)
{
return toAjax(stocktakeItemsService.updateStocktakeItems(stocktakeItems));
}
/**
* 删除盘点单明细
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakeItems:remove')")
@Log(title = "盘点单明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(stocktakeItemsService.deleteStocktakeItemsByIds(ids));
}
}
package com.ruoyi.inventory.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.inventory.domain.TO.StocktakesTO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.inventory.domain.Stocktakes;
import com.ruoyi.inventory.service.IStocktakesService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 库存盘点Controller
*
* @author ruoyi
* @date 2025-12-02
*/
@RestController
@RequestMapping("/inventory/stocktakes")
public class StocktakesController extends BaseController
{
@Autowired
private IStocktakesService stocktakesService;
/**
* 查询库存盘点列表
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakes:list')")
@GetMapping("/list")
public TableDataInfo list(Stocktakes stocktakes)
{
startPage();
List<Stocktakes> list = stocktakesService.selectStocktakesList(stocktakes);
return getDataTable(list);
}
/**
* 导出库存盘点列表
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakes:export')")
@Log(title = "库存盘点", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Stocktakes stocktakes)
{
List<Stocktakes> list = stocktakesService.selectStocktakesList(stocktakes);
ExcelUtil<Stocktakes> util = new ExcelUtil<Stocktakes>(Stocktakes.class);
util.exportExcel(response, list, "库存盘点数据");
}
/**
* 获取库存盘点详细信息
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakes:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(stocktakesService.selectStocktakesById(id));
}
/**
* 新增库存盘点
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakes:add')")
@Log(title = "库存盘点", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Stocktakes stocktakes)
{
return toAjax(stocktakesService.insertStocktakes(stocktakes));
}
/**
* 修改库存盘点
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakes:edit')")
@Log(title = "库存盘点", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody StocktakesTO stocktakes)
{
return toAjax(stocktakesService.updateStocktakes(stocktakes));
}
/**
* 删除库存盘点
*/
@PreAuthorize("@ss.hasPermi('inventory:stocktakes:remove')")
@Log(title = "库存盘点", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(stocktakesService.deleteStocktakesByIds(ids));
}
}
package com.ruoyi.inventory.controller; package com.ruoyi.inventory.controller;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
...@@ -23,7 +18,7 @@ import com.ruoyi.common.core.page.TableDataInfo; ...@@ -23,7 +18,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
/** /**
* 库位Controller * 库位Controller
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-01 * @date 2025-12-01
*/ */
...@@ -101,4 +96,21 @@ public class StorageLocationsController extends BaseController ...@@ -101,4 +96,21 @@ public class StorageLocationsController extends BaseController
{ {
return toAjax(storageLocationsService.deleteStorageLocationsByIds(ids)); return toAjax(storageLocationsService.deleteStorageLocationsByIds(ids));
} }
/**
* @description: 获取库位表 的 location_code 编码 location_name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
@GetMapping(value = "/getMapList")
@ResponseBody
public List<Map<String, Object>> getMapList(StorageLocations storageLocations)
{
try {
return storageLocationsService.getMapList(storageLocations);
} catch (Exception e) {
return Collections.emptyList(); // 替代new ArrayList<>(),更高效
}
}
} }
package com.ruoyi.inventory.controller; package com.ruoyi.inventory.controller;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
...@@ -23,7 +18,7 @@ import com.ruoyi.common.core.page.TableDataInfo; ...@@ -23,7 +18,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
/** /**
* 仓库Controller * 仓库Controller
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-01 * @date 2025-12-01
*/ */
...@@ -101,4 +96,21 @@ public class WarehousesController extends BaseController ...@@ -101,4 +96,21 @@ public class WarehousesController extends BaseController
{ {
return toAjax(warehousesService.deleteWarehousesByIds(ids)); return toAjax(warehousesService.deleteWarehousesByIds(ids));
} }
/**
* @description: 获取仓库 的 warehouses_code 仓库编码 warehouses_name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
@GetMapping(value = "/getMapList")
@ResponseBody
public List<Map<String, Object>> getMapList()
{
try {
return warehousesService.getMapList();
} catch (Exception e) {
return Collections.emptyList(); // 替代new ArrayList<>(),更高效
}
}
} }
...@@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity; ...@@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* 库存对象 inventory * 库存对象 inventory
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-03 * @date 2025-12-03
*/ */
...@@ -35,7 +35,9 @@ public class Inventory extends BaseEntity ...@@ -35,7 +35,9 @@ public class Inventory extends BaseEntity
/** 批次ID 检索条件 */ /** 批次ID 检索条件 */
@Excel(name = "批次ID 检索条件") @Excel(name = "批次ID 检索条件")
private String batchId; private String batchId;
/** 批次ID 检索条件 */
@Excel(name = "仓库ID ")
private String warehousesId;
/** 库位ID 检索条件 */ /** 库位ID 检索条件 */
@Excel(name = "库位ID 检索条件") @Excel(name = "库位ID 检索条件")
private String locationId; private String locationId;
...@@ -104,212 +106,220 @@ public class Inventory extends BaseEntity ...@@ -104,212 +106,220 @@ public class Inventory extends BaseEntity
@Excel(name = "排序号") @Excel(name = "排序号")
private String updateUserCode; private String updateUserCode;
public void setId(String id) public String getWarehousesId() {
return warehousesId;
}
public void setWarehousesId(String warehousesId) {
this.warehousesId = warehousesId;
}
public void setId(String id)
{ {
this.id = id; this.id = id;
} }
public String getId() public String getId()
{ {
return id; return id;
} }
public void setInventoryType(Long inventoryType) public void setInventoryType(Long inventoryType)
{ {
this.inventoryType = inventoryType; this.inventoryType = inventoryType;
} }
public Long getInventoryType() public Long getInventoryType()
{ {
return inventoryType; return inventoryType;
} }
public void setOrderId(String orderId) public void setOrderId(String orderId)
{ {
this.orderId = orderId; this.orderId = orderId;
} }
public String getOrderId() public String getOrderId()
{ {
return orderId; return orderId;
} }
public void setMaterialId(String materialId) public void setMaterialId(String materialId)
{ {
this.materialId = materialId; this.materialId = materialId;
} }
public String getMaterialId() public String getMaterialId()
{ {
return materialId; return materialId;
} }
public void setBatchId(String batchId) public void setBatchId(String batchId)
{ {
this.batchId = batchId; this.batchId = batchId;
} }
public String getBatchId() public String getBatchId()
{ {
return batchId; return batchId;
} }
public void setLocationId(String locationId) public void setLocationId(String locationId)
{ {
this.locationId = locationId; this.locationId = locationId;
} }
public String getLocationId() public String getLocationId()
{ {
return locationId; return locationId;
} }
public void setOwnerId(String ownerId) public void setOwnerId(String ownerId)
{ {
this.ownerId = ownerId; this.ownerId = ownerId;
} }
public String getOwnerId() public String getOwnerId()
{ {
return ownerId; return ownerId;
} }
public void setQuantity(Long quantity) public void setQuantity(Long quantity)
{ {
this.quantity = quantity; this.quantity = quantity;
} }
public Long getQuantity() public Long getQuantity()
{ {
return quantity; return quantity;
} }
public void setLockedQuantity(Long lockedQuantity) public void setLockedQuantity(Long lockedQuantity)
{ {
this.lockedQuantity = lockedQuantity; this.lockedQuantity = lockedQuantity;
} }
public Long getLockedQuantity() public Long getLockedQuantity()
{ {
return lockedQuantity; return lockedQuantity;
} }
public void setUnitWeight(Long unitWeight) public void setUnitWeight(Long unitWeight)
{ {
this.unitWeight = unitWeight; this.unitWeight = unitWeight;
} }
public Long getUnitWeight() public Long getUnitWeight()
{ {
return unitWeight; return unitWeight;
} }
public void setTotalWeight(Long totalWeight) public void setTotalWeight(Long totalWeight)
{ {
this.totalWeight = totalWeight; this.totalWeight = totalWeight;
} }
public Long getTotalWeight() public Long getTotalWeight()
{ {
return totalWeight; return totalWeight;
} }
public void setTotalVolume(Long totalVolume) public void setTotalVolume(Long totalVolume)
{ {
this.totalVolume = totalVolume; this.totalVolume = totalVolume;
} }
public Long getTotalVolume() public Long getTotalVolume()
{ {
return totalVolume; return totalVolume;
} }
public void setProductionDate(Date productionDate) public void setProductionDate(Date productionDate)
{ {
this.productionDate = productionDate; this.productionDate = productionDate;
} }
public Date getProductionDate() public Date getProductionDate()
{ {
return productionDate; return productionDate;
} }
public void setExpirationDate(Date expirationDate) public void setExpirationDate(Date expirationDate)
{ {
this.expirationDate = expirationDate; this.expirationDate = expirationDate;
} }
public Date getExpirationDate() public Date getExpirationDate()
{ {
return expirationDate; return expirationDate;
} }
public void setInventoryStatus(Long inventoryStatus) public void setInventoryStatus(Long inventoryStatus)
{ {
this.inventoryStatus = inventoryStatus; this.inventoryStatus = inventoryStatus;
} }
public Long getInventoryStatus() public Long getInventoryStatus()
{ {
return inventoryStatus; return inventoryStatus;
} }
public void setLastInboundTime(Date lastInboundTime) public void setLastInboundTime(Date lastInboundTime)
{ {
this.lastInboundTime = lastInboundTime; this.lastInboundTime = lastInboundTime;
} }
public Date getLastInboundTime() public Date getLastInboundTime()
{ {
return lastInboundTime; return lastInboundTime;
} }
public void setLastOutboundTime(Date lastOutboundTime) public void setLastOutboundTime(Date lastOutboundTime)
{ {
this.lastOutboundTime = lastOutboundTime; this.lastOutboundTime = lastOutboundTime;
} }
public Date getLastOutboundTime() public Date getLastOutboundTime()
{ {
return lastOutboundTime; return lastOutboundTime;
} }
public void setIsUsed(Long isUsed) public void setIsUsed(Long isUsed)
{ {
this.isUsed = isUsed; this.isUsed = isUsed;
} }
public Long getIsUsed() public Long getIsUsed()
{ {
return isUsed; return isUsed;
} }
public void setSortNo(Long sortNo) public void setSortNo(Long sortNo)
{ {
this.sortNo = sortNo; this.sortNo = sortNo;
} }
public Long getSortNo() public Long getSortNo()
{ {
return sortNo; return sortNo;
} }
public void setCreateUserCode(String createUserCode) public void setCreateUserCode(String createUserCode)
{ {
this.createUserCode = createUserCode; this.createUserCode = createUserCode;
} }
public String getCreateUserCode() public String getCreateUserCode()
{ {
return createUserCode; return createUserCode;
} }
public void setUpdateUserCode(String updateUserCode) public void setUpdateUserCode(String updateUserCode)
{ {
this.updateUserCode = updateUserCode; this.updateUserCode = updateUserCode;
} }
public String getUpdateUserCode() public String getUpdateUserCode()
{ {
return updateUserCode; return updateUserCode;
} }
......
package com.ruoyi.inventory.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 库存事务对象 inventory_transactions
*
* @author ruoyi
* @date 2025-12-02
*/
public class InventoryTransactions extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 类型1-入库 2-出库 3-盘点调整 */
@Excel(name = "类型1-入库 2-出库 3-盘点调整")
private Long transactionType;
// 库存表id
private String inventoryId;
/** 关联单号,相当于主记录 */
@Excel(name = "关联单号,相当于主记录")
private String referenceId;
/** 子记录id */
@Excel(name = "子记录id")
private String referenceItemId;
/** 货物ID */
@Excel(name = "货物ID")
private String materialId;
/** 批次ID */
@Excel(name = "批次ID")
private String batchCode;
/** 仓库ID */
@Excel(name = "仓库ID")
private String warehouseId;
/** 库位ID */
@Excel(name = "库位ID")
private String locationId;
/** 货主ID */
@Excel(name = "货主ID")
private String ownerId;
/** 操作前数量 */
@Excel(name = "操作前数量")
private Long quantityBefore;
/** 操作数量 */
@Excel(name = "操作数量")
private Long quantityChange;
/** 操作后数量 */
@Excel(name = "操作后数量")
private Long quantityAfter;
/** 操作时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date transactionTime;
/** 操作人ID */
@Excel(name = "操作人ID")
private String operatedBy;
/** 应用数据1使用0删除 删除用 */
@Excel(name = "应用数据1使用0删除 删除用")
private Long isUsed;
/** 排序 */
@Excel(name = "排序")
private Long sortNo;
/** 创建日期 */
@Excel(name = "创建日期")
private String createUserCode;
/** 排序号 */
@Excel(name = "排序号")
private String updateUserCode;
public String getInventoryId() {
return inventoryId;
}
public void setInventoryId(String inventoryId) {
this.inventoryId = inventoryId;
}
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setTransactionType(Long transactionType)
{
this.transactionType = transactionType;
}
public Long getTransactionType()
{
return transactionType;
}
public void setReferenceId(String referenceId)
{
this.referenceId = referenceId;
}
public String getReferenceId()
{
return referenceId;
}
public void setReferenceItemId(String referenceItemId)
{
this.referenceItemId = referenceItemId;
}
public String getReferenceItemId()
{
return referenceItemId;
}
public void setMaterialId(String materialId)
{
this.materialId = materialId;
}
public String getMaterialId()
{
return materialId;
}
public void setBatchCode(String batchCode)
{
this.batchCode = batchCode;
}
public String getBatchCode()
{
return batchCode;
}
public void setWarehouseId(String warehouseId)
{
this.warehouseId = warehouseId;
}
public String getWarehouseId()
{
return warehouseId;
}
public void setLocationId(String locationId)
{
this.locationId = locationId;
}
public String getLocationId()
{
return locationId;
}
public void setOwnerId(String ownerId)
{
this.ownerId = ownerId;
}
public String getOwnerId()
{
return ownerId;
}
public void setQuantityBefore(Long quantityBefore)
{
this.quantityBefore = quantityBefore;
}
public Long getQuantityBefore()
{
return quantityBefore;
}
public void setQuantityChange(Long quantityChange)
{
this.quantityChange = quantityChange;
}
public Long getQuantityChange()
{
return quantityChange;
}
public void setQuantityAfter(Long quantityAfter)
{
this.quantityAfter = quantityAfter;
}
public Long getQuantityAfter()
{
return quantityAfter;
}
public void setTransactionTime(Date transactionTime)
{
this.transactionTime = transactionTime;
}
public Date getTransactionTime()
{
return transactionTime;
}
public void setOperatedBy(String operatedBy)
{
this.operatedBy = operatedBy;
}
public String getOperatedBy()
{
return operatedBy;
}
public void setIsUsed(Long isUsed)
{
this.isUsed = isUsed;
}
public Long getIsUsed()
{
return isUsed;
}
public void setSortNo(Long sortNo)
{
this.sortNo = sortNo;
}
public Long getSortNo()
{
return sortNo;
}
public void setCreateUserCode(String createUserCode)
{
this.createUserCode = createUserCode;
}
public String getCreateUserCode()
{
return createUserCode;
}
public void setUpdateUserCode(String updateUserCode)
{
this.updateUserCode = updateUserCode;
}
public String getUpdateUserCode()
{
return updateUserCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("transactionType", getTransactionType())
.append("referenceId", getReferenceId())
.append("referenceItemId", getReferenceItemId())
.append("materialId", getMaterialId())
.append("batchCode", getBatchCode())
.append("warehouseId", getWarehouseId())
.append("locationId", getLocationId())
.append("ownerId", getOwnerId())
.append("quantityBefore", getQuantityBefore())
.append("quantityChange", getQuantityChange())
.append("quantityAfter", getQuantityAfter())
.append("transactionTime", getTransactionTime())
.append("operatedBy", getOperatedBy())
.append("remark", getRemark())
.append("isUsed", getIsUsed())
.append("sortNo", getSortNo())
.append("createTime", getCreateTime())
.append("createUserCode", getCreateUserCode())
.append("updateTime", getUpdateTime())
.append("updateUserCode", getUpdateUserCode())
.toString();
}
}
package com.ruoyi.inventory.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 盘点单明细对象 stocktake_items
*
* @author ruoyi
* @date 2025-12-02
*/
public class StocktakeItems extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 盘点单号 检索条件 */
@Excel(name = "盘点单号 检索条件")
private String stocktakeId;
/** 库存表Id */
@Excel(name = "库存表Id")
private String inventoryId;
/** 货物ID 字典,检索条件 */
@Excel(name = "货物ID 字典,检索条件")
private String materialId;
/** 批次ID 检索条件 */
@Excel(name = "批次ID 检索条件")
private String batchCode;
/** 仓库ID 检索条件 */
@Excel(name = "仓库ID 检索条件")
private String warehouseId;
/** 库位ID 检索条件 */
@Excel(name = "库位ID 检索条件")
private String locationId;
/** 系统数量 */
@Excel(name = "系统数量")
private Long systemQuantity;
/** 实际数量 */
@Excel(name = "实际数量")
private Long actualQuantity;
/** 差异数量 */
@Excel(name = "差异数量")
private Long varianceQuantity;
/** 差异金额 */
@Excel(name = "差异金额")
private Long varianceAmount;
/** 盘点状态1-计划中 1-盘点中 2-已完成 字典,检索条件 */
@Excel(name = "盘点状态1-计划中 1-盘点中 2-已完成 字典,检索条件")
private String stocktakeStatus;
/** 盘点人 */
@Excel(name = "盘点人")
private String countedBy;
/** 盘点时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "盘点时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date countedAt;
/** 是否已调整0否1是 */
@Excel(name = "是否已调整0否1是")
private Long adjusted;
/** 调整原因 */
@Excel(name = "调整原因")
private String adjustmentReason;
/** 调整人 */
@Excel(name = "调整人")
private String adjustedBy;
/** 调整时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "调整时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date adjustedAt;
/** 开始时间 暂无用 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间 暂无用", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 结束时间 暂无用 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间 暂无用", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/** 盘点物料范围 暂无用 */
@Excel(name = "盘点物料范围 暂无用")
private String materialRange;
/** 盘点库位范围 暂无用 */
@Excel(name = "盘点库位范围 暂无用")
private String locationRange;
/** 应用数据1使用0删除 删除用 */
@Excel(name = "应用数据1使用0删除 删除用")
private Long isUsed;
/** 排序 */
@Excel(name = "排序")
private Long sortNo;
/** 创建日期 */
@Excel(name = "创建日期")
private String createUserCode;
/** 排序号 */
@Excel(name = "排序号")
private String updateUserCode;
public String getInventoryId() {
return inventoryId;
}
public void setInventoryId(String inventoryId) {
this.inventoryId = inventoryId;
}
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setStocktakeId(String stocktakeId)
{
this.stocktakeId = stocktakeId;
}
public String getStocktakeId()
{
return stocktakeId;
}
public void setMaterialId(String materialId)
{
this.materialId = materialId;
}
public String getMaterialId()
{
return materialId;
}
public void setBatchCode(String batchCode)
{
this.batchCode = batchCode;
}
public String getBatchCode()
{
return batchCode;
}
public void setWarehouseId(String warehouseId)
{
this.warehouseId = warehouseId;
}
public String getWarehouseId()
{
return warehouseId;
}
public void setLocationId(String locationId)
{
this.locationId = locationId;
}
public String getLocationId()
{
return locationId;
}
public void setSystemQuantity(Long systemQuantity)
{
this.systemQuantity = systemQuantity;
}
public Long getSystemQuantity()
{
return systemQuantity;
}
public void setActualQuantity(Long actualQuantity)
{
this.actualQuantity = actualQuantity;
}
public Long getActualQuantity()
{
return actualQuantity;
}
public void setVarianceQuantity(Long varianceQuantity)
{
this.varianceQuantity = varianceQuantity;
}
public Long getVarianceQuantity()
{
return varianceQuantity;
}
public void setVarianceAmount(Long varianceAmount)
{
this.varianceAmount = varianceAmount;
}
public Long getVarianceAmount()
{
return varianceAmount;
}
public void setStocktakeStatus(String stocktakeStatus)
{
this.stocktakeStatus = stocktakeStatus;
}
public String getStocktakeStatus()
{
return stocktakeStatus;
}
public void setCountedBy(String countedBy)
{
this.countedBy = countedBy;
}
public String getCountedBy()
{
return countedBy;
}
public void setCountedAt(Date countedAt)
{
this.countedAt = countedAt;
}
public Date getCountedAt()
{
return countedAt;
}
public void setAdjusted(Long adjusted)
{
this.adjusted = adjusted;
}
public Long getAdjusted()
{
return adjusted;
}
public void setAdjustmentReason(String adjustmentReason)
{
this.adjustmentReason = adjustmentReason;
}
public String getAdjustmentReason()
{
return adjustmentReason;
}
public void setAdjustedBy(String adjustedBy)
{
this.adjustedBy = adjustedBy;
}
public String getAdjustedBy()
{
return adjustedBy;
}
public void setAdjustedAt(Date adjustedAt)
{
this.adjustedAt = adjustedAt;
}
public Date getAdjustedAt()
{
return adjustedAt;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setMaterialRange(String materialRange)
{
this.materialRange = materialRange;
}
public String getMaterialRange()
{
return materialRange;
}
public void setLocationRange(String locationRange)
{
this.locationRange = locationRange;
}
public String getLocationRange()
{
return locationRange;
}
public void setIsUsed(Long isUsed)
{
this.isUsed = isUsed;
}
public Long getIsUsed()
{
return isUsed;
}
public void setSortNo(Long sortNo)
{
this.sortNo = sortNo;
}
public Long getSortNo()
{
return sortNo;
}
public void setCreateUserCode(String createUserCode)
{
this.createUserCode = createUserCode;
}
public String getCreateUserCode()
{
return createUserCode;
}
public void setUpdateUserCode(String updateUserCode)
{
this.updateUserCode = updateUserCode;
}
public String getUpdateUserCode()
{
return updateUserCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("stocktakeId", getStocktakeId())
.append("materialId", getMaterialId())
.append("batchCode", getBatchCode())
.append("warehouseId", getWarehouseId())
.append("locationId", getLocationId())
.append("systemQuantity", getSystemQuantity())
.append("actualQuantity", getActualQuantity())
.append("varianceQuantity", getVarianceQuantity())
.append("varianceAmount", getVarianceAmount())
.append("stocktakeStatus", getStocktakeStatus())
.append("countedBy", getCountedBy())
.append("countedAt", getCountedAt())
.append("adjusted", getAdjusted())
.append("adjustmentReason", getAdjustmentReason())
.append("adjustedBy", getAdjustedBy())
.append("adjustedAt", getAdjustedAt())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("materialRange", getMaterialRange())
.append("locationRange", getLocationRange())
.append("remark", getRemark())
.append("isUsed", getIsUsed())
.append("sortNo", getSortNo())
.append("createTime", getCreateTime())
.append("createUserCode", getCreateUserCode())
.append("updateTime", getUpdateTime())
.append("updateUserCode", getUpdateUserCode())
.toString();
}
}
package com.ruoyi.inventory.domain;
import java.util.List;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 库存盘点对象 stocktakes
*
* @author ruoyi
* @date 2025-12-02
*/
public class Stocktakes extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 盘点单号 隐藏,根据id同步生成值 */
@Excel(name = "盘点单号 隐藏,根据id同步生成值")
private String stocktakeId;
/** 盘点类型1-全面盘点 2-循环盘点 3-指定物料盘点 暂无用,默认1 */
@Excel(name = "盘点类型1-全面盘点 2-循环盘点 3-指定物料盘点 暂无用,默认1")
private String stocktakeType;
/** 仓库ID 暂无用 */
@Excel(name = "仓库ID 暂无用")
private String warehouseId;
/** 盘点状态1-盘点中 2-已完成 字典,检索条件 */
@Excel(name = "盘点状态1-盘点中 2-已完成 字典,检索条件")
private String stocktakeStatus;
/** 计划日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date plannedDate;
/** 盘点物料范围 暂时无用 */
@Excel(name = "盘点物料范围 暂时无用")
private String materialRange;
/** 盘点库位范围 暂时无用 */
@Excel(name = "盘点库位范围 暂时无用")
private String locationRange;
/** 总差异金额 暂时无用 */
@Excel(name = "总差异金额 暂时无用")
private Long totalVarianceAmount;
/** 应用数据1使用0删除 删除用 */
@Excel(name = "应用数据1使用0删除 删除用")
private Long isUsed;
/** 排序 */
@Excel(name = "排序")
private Long sortNo;
/** 创建日期 */
@Excel(name = "创建日期")
private String createUserCode;
/** 排序号 */
@Excel(name = "排序号")
private String updateUserCode;
/** 盘点单明细信息 */
private List<StocktakeItems> stocktakeItemsList;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setStocktakeId(String stocktakeId)
{
this.stocktakeId = stocktakeId;
}
public String getStocktakeId()
{
return stocktakeId;
}
public void setStocktakeType(String stocktakeType)
{
this.stocktakeType = stocktakeType;
}
public String getStocktakeType()
{
return stocktakeType;
}
public void setWarehouseId(String warehouseId)
{
this.warehouseId = warehouseId;
}
public String getWarehouseId()
{
return warehouseId;
}
public void setStocktakeStatus(String stocktakeStatus)
{
this.stocktakeStatus = stocktakeStatus;
}
public String getStocktakeStatus()
{
return stocktakeStatus;
}
public void setPlannedDate(Date plannedDate)
{
this.plannedDate = plannedDate;
}
public Date getPlannedDate()
{
return plannedDate;
}
public void setMaterialRange(String materialRange)
{
this.materialRange = materialRange;
}
public String getMaterialRange()
{
return materialRange;
}
public void setLocationRange(String locationRange)
{
this.locationRange = locationRange;
}
public String getLocationRange()
{
return locationRange;
}
public void setTotalVarianceAmount(Long totalVarianceAmount)
{
this.totalVarianceAmount = totalVarianceAmount;
}
public Long getTotalVarianceAmount()
{
return totalVarianceAmount;
}
public void setIsUsed(Long isUsed)
{
this.isUsed = isUsed;
}
public Long getIsUsed()
{
return isUsed;
}
public void setSortNo(Long sortNo)
{
this.sortNo = sortNo;
}
public Long getSortNo()
{
return sortNo;
}
public void setCreateUserCode(String createUserCode)
{
this.createUserCode = createUserCode;
}
public String getCreateUserCode()
{
return createUserCode;
}
public void setUpdateUserCode(String updateUserCode)
{
this.updateUserCode = updateUserCode;
}
public String getUpdateUserCode()
{
return updateUserCode;
}
public List<StocktakeItems> getStocktakeItemsList()
{
return stocktakeItemsList;
}
public void setStocktakeItemsList(List<StocktakeItems> stocktakeItemsList)
{
this.stocktakeItemsList = stocktakeItemsList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("stocktakeId", getStocktakeId())
.append("stocktakeType", getStocktakeType())
.append("warehouseId", getWarehouseId())
.append("stocktakeStatus", getStocktakeStatus())
.append("plannedDate", getPlannedDate())
.append("materialRange", getMaterialRange())
.append("locationRange", getLocationRange())
.append("totalVarianceAmount", getTotalVarianceAmount())
.append("remark", getRemark())
.append("isUsed", getIsUsed())
.append("sortNo", getSortNo())
.append("createTime", getCreateTime())
.append("createUserCode", getCreateUserCode())
.append("updateTime", getUpdateTime())
.append("updateUserCode", getUpdateUserCode())
.append("stocktakeItemsList", getStocktakeItemsList())
.toString();
}
}
package com.ruoyi.inventory.domain.TO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.inventory.domain.StocktakeItems;
import com.ruoyi.inventory.domain.Stocktakes;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* 库存盘点对象 stocktakes
*
* @author ruoyi
* @date 2025-12-02
*/
@Data
public class StocktakesTO extends Stocktakes
{
/** 提交按钮类型,check是盘点,confirm 是确认盘点 */
private String operationType;
}
...@@ -4,18 +4,19 @@ import java.util.List; ...@@ -4,18 +4,19 @@ import java.util.List;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.inventory.domain.Inventory; import com.ruoyi.inventory.domain.Inventory;
import com.ruoyi.inventory.domain.StocktakeItems;
/** /**
* 库存Mapper接口 * 库存Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-03 * @date 2025-12-03
*/ */
public interface InventoryMapper public interface InventoryMapper
{ {
/** /**
* 查询库存 * 查询库存
* *
* @param id 库存主键 * @param id 库存主键
* @return 库存 * @return 库存
*/ */
...@@ -30,7 +31,7 @@ public interface InventoryMapper ...@@ -30,7 +31,7 @@ public interface InventoryMapper
/** /**
* 查询库存列表 * 查询库存列表
* *
* @param inventory 库存 * @param inventory 库存
* @return 库存集合 * @return 库存集合
*/ */
...@@ -38,7 +39,7 @@ public interface InventoryMapper ...@@ -38,7 +39,7 @@ public interface InventoryMapper
/** /**
* 新增库存 * 新增库存
* *
* @param inventory 库存 * @param inventory 库存
* @return 结果 * @return 结果
*/ */
...@@ -46,7 +47,7 @@ public interface InventoryMapper ...@@ -46,7 +47,7 @@ public interface InventoryMapper
/** /**
* 修改库存 * 修改库存
* *
* @param inventory 库存 * @param inventory 库存
* @return 结果 * @return 结果
*/ */
...@@ -54,7 +55,7 @@ public interface InventoryMapper ...@@ -54,7 +55,7 @@ public interface InventoryMapper
/** /**
* 删除库存 * 删除库存
* *
* @param id 库存主键 * @param id 库存主键
* @return 结果 * @return 结果
*/ */
...@@ -62,11 +63,19 @@ public interface InventoryMapper ...@@ -62,11 +63,19 @@ public interface InventoryMapper
/** /**
* 批量删除库存 * 批量删除库存
* *
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteInventoryByIds(String[] ids); public int deleteInventoryByIds(String[] ids);
public List<Inventory> listByMatreialId(String materialId); public List<Inventory> listByMatreialId(String materialId);
/**
* @description: 获取库存盘点详细信息
* @author cs
* @date 2025/12/3
* @version 1.0
*/
List<StocktakeItems> selectstocktakeItemsList();
} }
package com.ruoyi.inventory.mapper;
import java.util.List;
import com.ruoyi.inventory.domain.InventoryTransactions;
/**
* 库存事务Mapper接口
*
* @author ruoyi
* @date 2025-12-02
*/
public interface InventoryTransactionsMapper
{
/**
* 查询库存事务
*
* @param id 库存事务主键
* @return 库存事务
*/
public InventoryTransactions selectInventoryTransactionsById(String id);
/**
* 查询库存事务列表
*
* @param inventoryTransactions 库存事务
* @return 库存事务集合
*/
public List<InventoryTransactions> selectInventoryTransactionsList(InventoryTransactions inventoryTransactions);
/**
* 新增库存事务
*
* @param inventoryTransactions 库存事务
* @return 结果
*/
public int insertInventoryTransactions(InventoryTransactions inventoryTransactions);
/**
* 修改库存事务
*
* @param inventoryTransactions 库存事务
* @return 结果
*/
public int updateInventoryTransactions(InventoryTransactions inventoryTransactions);
/**
* 删除库存事务
*
* @param id 库存事务主键
* @return 结果
*/
public int deleteInventoryTransactionsById(String id);
/**
* 批量删除库存事务
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteInventoryTransactionsByIds(String[] ids);
}
package com.ruoyi.inventory.mapper; package com.ruoyi.inventory.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.domain.entity.Materials; import com.ruoyi.common.core.domain.entity.Materials;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
* 物料Mapper接口 * 物料Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-11-28 * @date 2025-11-28
*/ */
@Mapper @Mapper
public interface MaterialsMapper public interface MaterialsMapper
{ {
/** /**
* 查询物料 * 查询物料
* *
* @param id 物料主键 * @param id 物料主键
* @return 物料 * @return 物料
*/ */
...@@ -32,7 +34,7 @@ public interface MaterialsMapper ...@@ -32,7 +34,7 @@ public interface MaterialsMapper
/** /**
* 查询物料列表 * 查询物料列表
* *
* @param materials 物料 * @param materials 物料
* @return 物料集合 * @return 物料集合
*/ */
...@@ -40,7 +42,7 @@ public interface MaterialsMapper ...@@ -40,7 +42,7 @@ public interface MaterialsMapper
/** /**
* 新增物料 * 新增物料
* *
* @param materials 物料 * @param materials 物料
* @return 结果 * @return 结果
*/ */
...@@ -48,7 +50,7 @@ public interface MaterialsMapper ...@@ -48,7 +50,7 @@ public interface MaterialsMapper
/** /**
* 修改物料 * 修改物料
* *
* @param materials 物料 * @param materials 物料
* @return 结果 * @return 结果
*/ */
...@@ -56,7 +58,7 @@ public interface MaterialsMapper ...@@ -56,7 +58,7 @@ public interface MaterialsMapper
/** /**
* 删除物料 * 删除物料
* *
* @param id 物料主键 * @param id 物料主键
* @return 结果 * @return 结果
*/ */
...@@ -64,7 +66,7 @@ public interface MaterialsMapper ...@@ -64,7 +66,7 @@ public interface MaterialsMapper
/** /**
* 批量删除物料 * 批量删除物料
* *
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
...@@ -85,4 +87,13 @@ public interface MaterialsMapper ...@@ -85,4 +87,13 @@ public interface MaterialsMapper
*/ */
public List<Materials> selectMaterialsByCategory(String id); public List<Materials> selectMaterialsByCategory(String id);
/**
* @description: 获取物料 的 sap_no Name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
@MapKey("sap_no")
public List<Map<String, Object>> getMapList();
} }
package com.ruoyi.inventory.mapper;
import java.util.List;
import com.ruoyi.inventory.domain.StocktakeItems;
/**
* 盘点单明细Mapper接口
*
* @author ruoyi
* @date 2025-12-02
*/
public interface StocktakeItemsMapper
{
/**
* 查询盘点单明细
*
* @param id 盘点单明细主键
* @return 盘点单明细
*/
public StocktakeItems selectStocktakeItemsById(String id);
/**
* 查询盘点单明细列表
*
* @param stocktakeItems 盘点单明细
* @return 盘点单明细集合
*/
public List<StocktakeItems> selectStocktakeItemsList(StocktakeItems stocktakeItems);
/**
* 新增盘点单明细
*
* @param stocktakeItems 盘点单明细
* @return 结果
*/
public int insertStocktakeItems(StocktakeItems stocktakeItems);
/**
* 修改盘点单明细
*
* @param stocktakeItems 盘点单明细
* @return 结果
*/
public int updateStocktakeItems(StocktakeItems stocktakeItems);
/**
* 删除盘点单明细
*
* @param id 盘点单明细主键
* @return 结果
*/
public int deleteStocktakeItemsById(String id);
/**
* 批量删除盘点单明细
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteStocktakeItemsByIds(String[] ids);
}
package com.ruoyi.inventory.mapper;
import java.util.List;
import com.ruoyi.inventory.domain.Stocktakes;
import com.ruoyi.inventory.domain.StocktakeItems;
/**
* 盘点单主Mapper接口
*
* @author ruoyi
* @date 2025-12-02
*/
public interface StocktakesMapper
{
/**
* 查询盘点单主
*
* @param id 盘点单主主键
* @return 盘点单主
*/
public Stocktakes selectStocktakesById(String id);
/**
* 查询盘点单主列表
*
* @param stocktakes 盘点单主
* @return 盘点单主集合
*/
public List<Stocktakes> selectStocktakesList(Stocktakes stocktakes);
/**
* 新增盘点单主
*
* @param stocktakes 盘点单主
* @return 结果
*/
public int insertStocktakes(Stocktakes stocktakes);
/**
* 修改盘点单主
*
* @param stocktakes 盘点单主
* @return 结果
*/
public int updateStocktakes(Stocktakes stocktakes);
/**
* 删除盘点单主
*
* @param id 盘点单主主键
* @return 结果
*/
public int deleteStocktakesById(String id);
/**
* 逻辑-批量删除盘点单主
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteStocktakesByIds(String[] ids);
/**
* 逻辑-批量删除盘点单明细
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteStocktakeItemsByStocktakeIds(String[] ids);
/**
* 批量新增盘点单明细
*
* @param stocktakeItemsList 盘点单明细列表
* @return 结果
*/
public int batchStocktakeItems(List<StocktakeItems> stocktakeItemsList);
/**
* 通过盘点单主主键删除盘点单明细信息
*
* @param id 盘点单主ID
* @return 结果
*/
public int deleteStocktakeItemsByStocktakeId(String id);
}
package com.ruoyi.inventory.mapper; package com.ruoyi.inventory.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.inventory.domain.StorageLocations; import com.ruoyi.inventory.domain.StorageLocations;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
/** /**
* 库位Mapper接口 * 库位Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-01 * @date 2025-12-01
*/ */
public interface StorageLocationsMapper public interface StorageLocationsMapper
{ {
/** /**
* 查询库位 * 查询库位
* *
* @param id 库位主键 * @param id 库位主键
* @return 库位 * @return 库位
*/ */
...@@ -22,7 +24,7 @@ public interface StorageLocationsMapper ...@@ -22,7 +24,7 @@ public interface StorageLocationsMapper
/** /**
* 查询库位列表 * 查询库位列表
* *
* @param storageLocations 库位 * @param storageLocations 库位
* @return 库位集合 * @return 库位集合
*/ */
...@@ -30,7 +32,7 @@ public interface StorageLocationsMapper ...@@ -30,7 +32,7 @@ public interface StorageLocationsMapper
/** /**
* 新增库位 * 新增库位
* *
* @param storageLocations 库位 * @param storageLocations 库位
* @return 结果 * @return 结果
*/ */
...@@ -38,7 +40,7 @@ public interface StorageLocationsMapper ...@@ -38,7 +40,7 @@ public interface StorageLocationsMapper
/** /**
* 修改库位 * 修改库位
* *
* @param storageLocations 库位 * @param storageLocations 库位
* @return 结果 * @return 结果
*/ */
...@@ -46,7 +48,7 @@ public interface StorageLocationsMapper ...@@ -46,7 +48,7 @@ public interface StorageLocationsMapper
/** /**
* 删除库位 * 删除库位
* *
* @param id 库位主键 * @param id 库位主键
* @return 结果 * @return 结果
*/ */
...@@ -54,7 +56,7 @@ public interface StorageLocationsMapper ...@@ -54,7 +56,7 @@ public interface StorageLocationsMapper
/** /**
* 批量删除库位 * 批量删除库位
* *
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
...@@ -79,4 +81,12 @@ public interface StorageLocationsMapper ...@@ -79,4 +81,12 @@ public interface StorageLocationsMapper
@Update("update storage_locations set is_enabled = 0 where warehouses_code=#{id}") @Update("update storage_locations set is_enabled = 0 where warehouses_code=#{id}")
public int updateStorageLocationsStatus(String id); public int updateStorageLocationsStatus(String id);
/**
* @description: 获取库位表 的 location_code 编码 location_name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
public List<Map<String, Object>> getMapList(StorageLocations storageLocations);
} }
package com.ruoyi.inventory.mapper; package com.ruoyi.inventory.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.inventory.domain.Warehouses; import com.ruoyi.inventory.domain.Warehouses;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
/** /**
* 仓库Mapper接口 * 仓库Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-01 * @date 2025-12-01
*/ */
public interface WarehousesMapper public interface WarehousesMapper
{ {
/** /**
* 查询仓库 * 查询仓库
* *
* @param id 仓库主键 * @param id 仓库主键
* @return 仓库 * @return 仓库
*/ */
...@@ -22,7 +24,7 @@ public interface WarehousesMapper ...@@ -22,7 +24,7 @@ public interface WarehousesMapper
/** /**
* 查询仓库列表 * 查询仓库列表
* *
* @param warehouses 仓库 * @param warehouses 仓库
* @return 仓库集合 * @return 仓库集合
*/ */
...@@ -30,7 +32,7 @@ public interface WarehousesMapper ...@@ -30,7 +32,7 @@ public interface WarehousesMapper
/** /**
* 新增仓库 * 新增仓库
* *
* @param warehouses 仓库 * @param warehouses 仓库
* @return 结果 * @return 结果
*/ */
...@@ -38,7 +40,7 @@ public interface WarehousesMapper ...@@ -38,7 +40,7 @@ public interface WarehousesMapper
/** /**
* 修改仓库 * 修改仓库
* *
* @param warehouses 仓库 * @param warehouses 仓库
* @return 结果 * @return 结果
*/ */
...@@ -46,7 +48,7 @@ public interface WarehousesMapper ...@@ -46,7 +48,7 @@ public interface WarehousesMapper
/** /**
* 删除仓库 * 删除仓库
* *
* @param id 仓库主键 * @param id 仓库主键
* @return 结果 * @return 结果
*/ */
...@@ -54,7 +56,7 @@ public interface WarehousesMapper ...@@ -54,7 +56,7 @@ public interface WarehousesMapper
/** /**
* 批量删除仓库 * 批量删除仓库
* *
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
...@@ -69,4 +71,12 @@ public interface WarehousesMapper ...@@ -69,4 +71,12 @@ public interface WarehousesMapper
@Update("update warehouses set is_enabled = 0 where id=#{id}") @Update("update warehouses set is_enabled = 0 where id=#{id}")
public int updateWarehouseStatus(String id); public int updateWarehouseStatus(String id);
/**
* @description: 获取仓库 的 warehouses_code 仓库编码 warehouses_name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
public List<Map<String, Object>> getMapList();
} }
...@@ -4,18 +4,19 @@ import java.util.List; ...@@ -4,18 +4,19 @@ import java.util.List;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.inventory.domain.Inventory; import com.ruoyi.inventory.domain.Inventory;
import com.ruoyi.inventory.domain.StocktakeItems;
/** /**
* 库存Service接口 * 库存Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-03 * @date 2025-12-03
*/ */
public interface IInventoryService public interface IInventoryService
{ {
/** /**
* 查询库存 * 查询库存
* *
* @param id 库存主键 * @param id 库存主键
* @return 库存 * @return 库存
*/ */
...@@ -23,7 +24,7 @@ public interface IInventoryService ...@@ -23,7 +24,7 @@ public interface IInventoryService
/** /**
* 查询库存列表 * 查询库存列表
* *
* @param inventory 库存 * @param inventory 库存
* @return 库存集合 * @return 库存集合
*/ */
...@@ -33,7 +34,7 @@ public interface IInventoryService ...@@ -33,7 +34,7 @@ public interface IInventoryService
/** /**
* 新增库存 * 新增库存
* *
* @param inventory 库存 * @param inventory 库存
* @return 结果 * @return 结果
*/ */
...@@ -48,7 +49,7 @@ public interface IInventoryService ...@@ -48,7 +49,7 @@ public interface IInventoryService
public int insertInventoryList(List<Inventory> inventoryList); public int insertInventoryList(List<Inventory> inventoryList);
/** /**
* 修改库存 * 修改库存
* *
* @param inventory 库存 * @param inventory 库存
* @return 结果 * @return 结果
*/ */
...@@ -56,7 +57,7 @@ public interface IInventoryService ...@@ -56,7 +57,7 @@ public interface IInventoryService
/** /**
* 批量删除库存 * 批量删除库存
* *
* @param ids 需要删除的库存主键集合 * @param ids 需要删除的库存主键集合
* @return 结果 * @return 结果
*/ */
...@@ -64,11 +65,19 @@ public interface IInventoryService ...@@ -64,11 +65,19 @@ public interface IInventoryService
/** /**
* 删除库存信息 * 删除库存信息
* *
* @param id 库存主键 * @param id 库存主键
* @return 结果 * @return 结果
*/ */
public int deleteInventoryById(String id); public int deleteInventoryById(String id);
public List<Inventory> listByMatreialId(String materialId); public List<Inventory> listByMatreialId(String materialId);
/**
* @description: 获取库存盘点详细信息
* @author cs
* @date 2025/12/3
* @version 1.0
*/
public List<StocktakeItems> selectstocktakeItemsList();
} }
package com.ruoyi.inventory.service;
import java.util.List;
import com.ruoyi.inventory.domain.InventoryTransactions;
/**
* 库存事务Service接口
*
* @author ruoyi
* @date 2025-12-02
*/
public interface IInventoryTransactionsService
{
/**
* 查询库存事务
*
* @param id 库存事务主键
* @return 库存事务
*/
public InventoryTransactions selectInventoryTransactionsById(String id);
/**
* 查询库存事务列表
*
* @param inventoryTransactions 库存事务
* @return 库存事务集合
*/
public List<InventoryTransactions> selectInventoryTransactionsList(InventoryTransactions inventoryTransactions);
/**
* 新增库存事务
*
* @param inventoryTransactions 库存事务
* @return 结果
*/
public int insertInventoryTransactions(InventoryTransactions inventoryTransactions);
/**
* 修改库存事务
*
* @param inventoryTransactions 库存事务
* @return 结果
*/
public int updateInventoryTransactions(InventoryTransactions inventoryTransactions);
/**
* 批量删除库存事务
*
* @param ids 需要删除的库存事务主键集合
* @return 结果
*/
public int deleteInventoryTransactionsByIds(String[] ids);
/**
* 删除库存事务信息
*
* @param id 库存事务主键
* @return 结果
*/
public int deleteInventoryTransactionsById(String id);
}
...@@ -3,18 +3,19 @@ package com.ruoyi.inventory.service; ...@@ -3,18 +3,19 @@ package com.ruoyi.inventory.service;
import com.ruoyi.common.core.domain.entity.Materials; import com.ruoyi.common.core.domain.entity.Materials;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 物料Service接口 * 物料Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-11-28 * @date 2025-11-28
*/ */
public interface IMaterialsService public interface IMaterialsService
{ {
/** /**
* 查询物料 * 查询物料
* *
* @param id 物料主键 * @param id 物料主键
* @return 物料 * @return 物料
*/ */
...@@ -22,7 +23,7 @@ public interface IMaterialsService ...@@ -22,7 +23,7 @@ public interface IMaterialsService
/** /**
* 查询物料列表 * 查询物料列表
* *
* @param materials 物料 * @param materials 物料
* @return 物料集合 * @return 物料集合
*/ */
...@@ -30,7 +31,7 @@ public interface IMaterialsService ...@@ -30,7 +31,7 @@ public interface IMaterialsService
/** /**
* 新增物料 * 新增物料
* *
* @param materials 物料 * @param materials 物料
* @return 结果 * @return 结果
*/ */
...@@ -38,7 +39,7 @@ public interface IMaterialsService ...@@ -38,7 +39,7 @@ public interface IMaterialsService
/** /**
* 修改物料 * 修改物料
* *
* @param materials 物料 * @param materials 物料
* @return 结果 * @return 结果
*/ */
...@@ -46,7 +47,7 @@ public interface IMaterialsService ...@@ -46,7 +47,7 @@ public interface IMaterialsService
/** /**
* 批量删除物料 * 批量删除物料
* *
* @param ids 需要删除的物料主键集合 * @param ids 需要删除的物料主键集合
* @return 结果 * @return 结果
*/ */
...@@ -54,7 +55,7 @@ public interface IMaterialsService ...@@ -54,7 +55,7 @@ public interface IMaterialsService
/** /**
* 删除物料信息 * 删除物料信息
* *
* @param id 物料主键 * @param id 物料主键
* @return 结果 * @return 结果
*/ */
...@@ -64,4 +65,12 @@ public interface IMaterialsService ...@@ -64,4 +65,12 @@ public interface IMaterialsService
public String importMaterials(List<Materials> materialsList, Boolean isUpdateSupport, String operName); public String importMaterials(List<Materials> materialsList, Boolean isUpdateSupport, String operName);
/**
* @description: 获取物料 的 sap_no Name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
public List<Map<String, Object>> getMapList();
} }
package com.ruoyi.inventory.service;
import java.util.List;
import com.ruoyi.inventory.domain.StocktakeItems;
/**
* 盘点单明细Service接口
*
* @author ruoyi
* @date 2025-12-02
*/
public interface IStocktakeItemsService
{
/**
* 查询盘点单明细
*
* @param id 盘点单明细主键
* @return 盘点单明细
*/
public StocktakeItems selectStocktakeItemsById(String id);
/**
* 查询盘点单明细列表
*
* @param stocktakeItems 盘点单明细
* @return 盘点单明细集合
*/
public List<StocktakeItems> selectStocktakeItemsList(StocktakeItems stocktakeItems);
/**
* 新增盘点单明细
*
* @param stocktakeItems 盘点单明细
* @return 结果
*/
public int insertStocktakeItems(StocktakeItems stocktakeItems);
/**
* 修改盘点单明细
*
* @param stocktakeItems 盘点单明细
* @return 结果
*/
public int updateStocktakeItems(StocktakeItems stocktakeItems);
/**
* 批量删除盘点单明细
*
* @param ids 需要删除的盘点单明细主键集合
* @return 结果
*/
public int deleteStocktakeItemsByIds(String[] ids);
/**
* 删除盘点单明细信息
*
* @param id 盘点单明细主键
* @return 结果
*/
public int deleteStocktakeItemsById(String id);
}
package com.ruoyi.inventory.service;
import java.util.List;
import com.ruoyi.inventory.domain.Stocktakes;
import com.ruoyi.inventory.domain.TO.StocktakesTO;
/**
* 库存盘点Service接口
*
* @author ruoyi
* @date 2025-12-02
*/
public interface IStocktakesService
{
/**
* 查询库存盘点
*
* @param id 库存盘点主键
* @return 库存盘点
*/
public Stocktakes selectStocktakesById(String id);
/**
* 查询库存盘点列表
*
* @param stocktakes 库存盘点
* @return 库存盘点集合
*/
public List<Stocktakes> selectStocktakesList(Stocktakes stocktakes);
/**
* 新增库存盘点
*
* @param stocktakes 库存盘点
* @return 结果
*/
public int insertStocktakes(Stocktakes stocktakes);
/**
* 修改库存盘点
*
* @param stocktakes 库存盘点
* @return 结果
*/
public int updateStocktakes(StocktakesTO stocktakes);
/**
* 批量删除库存盘点
*
* @param ids 需要删除的库存盘点主键集合
* @return 结果
*/
public int deleteStocktakesByIds(String[] ids);
/**
* 删除库存盘点信息
*
* @param id 库存盘点主键
* @return 结果
*/
public int deleteStocktakesById(String id);
}
package com.ruoyi.inventory.service; package com.ruoyi.inventory.service;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.inventory.domain.StorageLocations; import com.ruoyi.inventory.domain.StorageLocations;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/** /**
* 库位Service接口 * 库位Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-01 * @date 2025-12-01
*/ */
public interface IStorageLocationsService public interface IStorageLocationsService
{ {
/** /**
* 查询库位 * 查询库位
* *
* @param id 库位主键 * @param id 库位主键
* @return 库位 * @return 库位
*/ */
...@@ -37,7 +42,7 @@ public interface IStorageLocationsService ...@@ -37,7 +42,7 @@ public interface IStorageLocationsService
/** /**
* 查询库位列表 * 查询库位列表
* *
* @param storageLocations 库位 * @param storageLocations 库位
* @return 库位集合 * @return 库位集合
*/ */
...@@ -45,7 +50,7 @@ public interface IStorageLocationsService ...@@ -45,7 +50,7 @@ public interface IStorageLocationsService
/** /**
* 新增库位 * 新增库位
* *
* @param storageLocations 库位 * @param storageLocations 库位
* @return 结果 * @return 结果
*/ */
...@@ -53,7 +58,7 @@ public interface IStorageLocationsService ...@@ -53,7 +58,7 @@ public interface IStorageLocationsService
/** /**
* 修改库位 * 修改库位
* *
* @param storageLocations 库位 * @param storageLocations 库位
* @return 结果 * @return 结果
*/ */
...@@ -61,7 +66,7 @@ public interface IStorageLocationsService ...@@ -61,7 +66,7 @@ public interface IStorageLocationsService
/** /**
* 批量删除库位 * 批量删除库位
* *
* @param ids 需要删除的库位主键集合 * @param ids 需要删除的库位主键集合
* @return 结果 * @return 结果
*/ */
...@@ -69,11 +74,19 @@ public interface IStorageLocationsService ...@@ -69,11 +74,19 @@ public interface IStorageLocationsService
/** /**
* 删除库位信息 * 删除库位信息
* *
* @param id 库位主键 * @param id 库位主键
* @return 结果 * @return 结果
*/ */
public int deleteStorageLocationsById(String id); public int deleteStorageLocationsById(String id);
int updateLocationsCategoryStatus(String id); int updateLocationsCategoryStatus(String id);
/**
* @description: 获取库位表 的 location_code 编码 location_name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
public List<Map<String, Object>> getMapList(StorageLocations storageLocations);
} }
package com.ruoyi.inventory.service; package com.ruoyi.inventory.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.inventory.domain.Warehouses; import com.ruoyi.inventory.domain.Warehouses;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/** /**
* 仓库Service接口 * 仓库Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-01 * @date 2025-12-01
*/ */
public interface IWarehousesService public interface IWarehousesService
{ {
/** /**
* 查询仓库 * 查询仓库
* *
* @param id 仓库主键 * @param id 仓库主键
* @return 仓库 * @return 仓库
*/ */
...@@ -21,7 +25,7 @@ public interface IWarehousesService ...@@ -21,7 +25,7 @@ public interface IWarehousesService
/** /**
* 查询仓库列表 * 查询仓库列表
* *
* @param warehouses 仓库 * @param warehouses 仓库
* @return 仓库集合 * @return 仓库集合
*/ */
...@@ -29,7 +33,7 @@ public interface IWarehousesService ...@@ -29,7 +33,7 @@ public interface IWarehousesService
/** /**
* 新增仓库 * 新增仓库
* *
* @param warehouses 仓库 * @param warehouses 仓库
* @return 结果 * @return 结果
*/ */
...@@ -37,7 +41,7 @@ public interface IWarehousesService ...@@ -37,7 +41,7 @@ public interface IWarehousesService
/** /**
* 修改仓库 * 修改仓库
* *
* @param warehouses 仓库 * @param warehouses 仓库
* @return 结果 * @return 结果
*/ */
...@@ -47,7 +51,7 @@ public interface IWarehousesService ...@@ -47,7 +51,7 @@ public interface IWarehousesService
/** /**
* 批量删除仓库 * 批量删除仓库
* *
* @param ids 需要删除的仓库主键集合 * @param ids 需要删除的仓库主键集合
* @return 结果 * @return 结果
*/ */
...@@ -55,9 +59,18 @@ public interface IWarehousesService ...@@ -55,9 +59,18 @@ public interface IWarehousesService
/** /**
* 删除仓库信息 * 删除仓库信息
* *
* @param id 仓库主键 * @param id 仓库主键
* @return 结果 * @return 结果
*/ */
public int deleteWarehousesById(String id); public int deleteWarehousesById(String id);
/**
* @description: 获取仓库 的 warehouses_code 仓库编码 warehouses_name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
public List<Map<String, Object>> getMapList();
} }
...@@ -5,6 +5,7 @@ import java.util.UUID; ...@@ -5,6 +5,7 @@ import java.util.UUID;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.inventory.domain.OutboundOrderLog; import com.ruoyi.inventory.domain.OutboundOrderLog;
import com.ruoyi.inventory.domain.StocktakeItems;
import com.ruoyi.inventory.mapper.OutboundOrderLogMapper; import com.ruoyi.inventory.mapper.OutboundOrderLogMapper;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -15,12 +16,12 @@ import com.ruoyi.inventory.service.IInventoryService; ...@@ -15,12 +16,12 @@ import com.ruoyi.inventory.service.IInventoryService;
/** /**
* 库存Service业务层处理 * 库存Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-03 * @date 2025-12-03
*/ */
@Service @Service
public class InventoryServiceImpl implements IInventoryService public class InventoryServiceImpl implements IInventoryService
{ {
@Autowired @Autowired
private InventoryMapper inventoryMapper; private InventoryMapper inventoryMapper;
...@@ -29,7 +30,7 @@ public class InventoryServiceImpl implements IInventoryService ...@@ -29,7 +30,7 @@ public class InventoryServiceImpl implements IInventoryService
/** /**
* 查询库存 * 查询库存
* *
* @param id 库存主键 * @param id 库存主键
* @return 库存 * @return 库存
*/ */
...@@ -41,7 +42,7 @@ public class InventoryServiceImpl implements IInventoryService ...@@ -41,7 +42,7 @@ public class InventoryServiceImpl implements IInventoryService
/** /**
* 查询库存列表 * 查询库存列表
* *
* @param inventory 库存 * @param inventory 库存
* @return 库存 * @return 库存
*/ */
...@@ -63,7 +64,7 @@ public class InventoryServiceImpl implements IInventoryService ...@@ -63,7 +64,7 @@ public class InventoryServiceImpl implements IInventoryService
/** /**
* 新增库存 * 新增库存
* *
* @param inventory 库存 * @param inventory 库存
* @return 结果 * @return 结果
*/ */
...@@ -87,7 +88,7 @@ public class InventoryServiceImpl implements IInventoryService ...@@ -87,7 +88,7 @@ public class InventoryServiceImpl implements IInventoryService
/** /**
* 修改库存 * 修改库存
* *
* @param inventory 库存 * @param inventory 库存
* @return 结果 * @return 结果
*/ */
...@@ -102,7 +103,7 @@ public class InventoryServiceImpl implements IInventoryService ...@@ -102,7 +103,7 @@ public class InventoryServiceImpl implements IInventoryService
/** /**
* 批量删除库存 * 批量删除库存
* *
* @param ids 需要删除的库存主键 * @param ids 需要删除的库存主键
* @return 结果 * @return 结果
*/ */
...@@ -114,7 +115,7 @@ public class InventoryServiceImpl implements IInventoryService ...@@ -114,7 +115,7 @@ public class InventoryServiceImpl implements IInventoryService
/** /**
* 删除库存信息 * 删除库存信息
* *
* @param id 库存主键 * @param id 库存主键
* @return 结果 * @return 结果
*/ */
...@@ -128,4 +129,14 @@ public class InventoryServiceImpl implements IInventoryService ...@@ -128,4 +129,14 @@ public class InventoryServiceImpl implements IInventoryService
public List<Inventory> listByMatreialId(String materialId) { public List<Inventory> listByMatreialId(String materialId) {
return inventoryMapper.listByMatreialId(materialId); return inventoryMapper.listByMatreialId(materialId);
} }
/**
* @description: 获取库存盘点详细信息
* @author cs
* @date 2025/12/3
* @version 1.0
*/
public List<StocktakeItems> selectstocktakeItemsList(){
return inventoryMapper.selectstocktakeItemsList();
}
} }
package com.ruoyi.inventory.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.inventory.mapper.InventoryTransactionsMapper;
import com.ruoyi.inventory.domain.InventoryTransactions;
import com.ruoyi.inventory.service.IInventoryTransactionsService;
/**
* 库存事务Service业务层处理
*
* @author ruoyi
* @date 2025-12-02
*/
@Service
public class InventoryTransactionsServiceImpl implements IInventoryTransactionsService
{
@Autowired
private InventoryTransactionsMapper inventoryTransactionsMapper;
/**
* 查询库存事务
*
* @param id 库存事务主键
* @return 库存事务
*/
@Override
public InventoryTransactions selectInventoryTransactionsById(String id)
{
return inventoryTransactionsMapper.selectInventoryTransactionsById(id);
}
/**
* 查询库存事务列表
*
* @param inventoryTransactions 库存事务
* @return 库存事务
*/
@Override
public List<InventoryTransactions> selectInventoryTransactionsList(InventoryTransactions inventoryTransactions)
{
return inventoryTransactionsMapper.selectInventoryTransactionsList(inventoryTransactions);
}
/**
* 新增库存事务
*
* @param inventoryTransactions 库存事务
* @return 结果
*/
@Override
public int insertInventoryTransactions(InventoryTransactions inventoryTransactions)
{
String loginUserId = String.valueOf(SecurityUtils.getLoginUser().getUserId());//当前登录人
inventoryTransactions.setIsUsed(1L);
inventoryTransactions.setCreateUserCode(loginUserId);
inventoryTransactions.setCreateTime(DateUtils.getNowDate());
return inventoryTransactionsMapper.insertInventoryTransactions(inventoryTransactions);
}
/**
* 修改库存事务
*
* @param inventoryTransactions 库存事务
* @return 结果
*/
@Override
public int updateInventoryTransactions(InventoryTransactions inventoryTransactions)
{
inventoryTransactions.setUpdateTime(DateUtils.getNowDate());
return inventoryTransactionsMapper.updateInventoryTransactions(inventoryTransactions);
}
/**
* 批量删除库存事务
*
* @param ids 需要删除的库存事务主键
* @return 结果
*/
@Override
public int deleteInventoryTransactionsByIds(String[] ids)
{
return inventoryTransactionsMapper.deleteInventoryTransactionsByIds(ids);
}
/**
* 删除库存事务信息
*
* @param id 库存事务主键
* @return 结果
*/
@Override
public int deleteInventoryTransactionsById(String id)
{
return inventoryTransactionsMapper.deleteInventoryTransactionsById(id);
}
}
...@@ -2,6 +2,7 @@ package com.ruoyi.inventory.service.impl; ...@@ -2,6 +2,7 @@ package com.ruoyi.inventory.service.impl;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import com.ruoyi.common.core.domain.entity.Materials; import com.ruoyi.common.core.domain.entity.Materials;
...@@ -16,19 +17,19 @@ import com.ruoyi.inventory.service.IMaterialsService; ...@@ -16,19 +17,19 @@ import com.ruoyi.inventory.service.IMaterialsService;
/** /**
* 物料Service业务层处理 * 物料Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2025-11-28 * @date 2025-11-28
*/ */
@Service @Service
public class MaterialsServiceImpl implements IMaterialsService public class MaterialsServiceImpl implements IMaterialsService
{ {
@Autowired @Autowired
private MaterialsMapper materialsMapper; private MaterialsMapper materialsMapper;
/** /**
* 查询物料 * 查询物料
* *
* @param id 物料主键 * @param id 物料主键
* @return 物料 * @return 物料
*/ */
...@@ -40,7 +41,7 @@ public class MaterialsServiceImpl implements IMaterialsService ...@@ -40,7 +41,7 @@ public class MaterialsServiceImpl implements IMaterialsService
/** /**
* 查询物料列表 * 查询物料列表
* *
* @param materials 物料 * @param materials 物料
* @return 物料 * @return 物料
*/ */
...@@ -51,7 +52,7 @@ public class MaterialsServiceImpl implements IMaterialsService ...@@ -51,7 +52,7 @@ public class MaterialsServiceImpl implements IMaterialsService
/** /**
* 新增物料 * 新增物料
* *
* @param materials 物料 * @param materials 物料
* @return 结果 * @return 结果
*/ */
...@@ -64,7 +65,7 @@ public class MaterialsServiceImpl implements IMaterialsService ...@@ -64,7 +65,7 @@ public class MaterialsServiceImpl implements IMaterialsService
/** /**
* 修改物料 * 修改物料
* *
* @param materials 物料 * @param materials 物料
* @return 结果 * @return 结果
*/ */
...@@ -89,7 +90,7 @@ public class MaterialsServiceImpl implements IMaterialsService ...@@ -89,7 +90,7 @@ public class MaterialsServiceImpl implements IMaterialsService
/** /**
* 删除物料信息 * 删除物料信息
* *
* @param id 物料主键 * @param id 物料主键
* @return 结果 * @return 结果
*/ */
...@@ -164,4 +165,15 @@ public class MaterialsServiceImpl implements IMaterialsService ...@@ -164,4 +165,15 @@ public class MaterialsServiceImpl implements IMaterialsService
} }
return successMsg.toString(); return successMsg.toString();
} }
/**
* @description: 获取物料 的 sap_no Name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
@Override
public List<Map<String, Object>> getMapList(){
return materialsMapper.getMapList();
}
} }
package com.ruoyi.inventory.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.inventory.mapper.StocktakeItemsMapper;
import com.ruoyi.inventory.domain.StocktakeItems;
import com.ruoyi.inventory.service.IStocktakeItemsService;
/**
* 盘点单明细Service业务层处理
*
* @author ruoyi
* @date 2025-12-02
*/
@Service
public class StocktakeItemsServiceImpl implements IStocktakeItemsService
{
@Autowired
private StocktakeItemsMapper stocktakeItemsMapper;
/**
* 查询盘点单明细
*
* @param id 盘点单明细主键
* @return 盘点单明细
*/
@Override
public StocktakeItems selectStocktakeItemsById(String id)
{
return stocktakeItemsMapper.selectStocktakeItemsById(id);
}
/**
* 查询盘点单明细列表
*
* @param stocktakeItems 盘点单明细
* @return 盘点单明细
*/
@Override
public List<StocktakeItems> selectStocktakeItemsList(StocktakeItems stocktakeItems)
{
return stocktakeItemsMapper.selectStocktakeItemsList(stocktakeItems);
}
/**
* 新增盘点单明细
*
* @param stocktakeItems 盘点单明细
* @return 结果
*/
@Override
public int insertStocktakeItems(StocktakeItems stocktakeItems)
{
stocktakeItems.setCreateTime(DateUtils.getNowDate());
return stocktakeItemsMapper.insertStocktakeItems(stocktakeItems);
}
/**
* 修改盘点单明细
*
* @param stocktakeItems 盘点单明细
* @return 结果
*/
@Override
public int updateStocktakeItems(StocktakeItems stocktakeItems)
{
// stocktakeItems.setUpdateTime(DateUtils.getNowDate());
return stocktakeItemsMapper.updateStocktakeItems(stocktakeItems);
}
/**
* 批量删除盘点单明细
*
* @param ids 需要删除的盘点单明细主键
* @return 结果
*/
@Override
public int deleteStocktakeItemsByIds(String[] ids)
{
return stocktakeItemsMapper.deleteStocktakeItemsByIds(ids);
}
/**
* 删除盘点单明细信息
*
* @param id 盘点单明细主键
* @return 结果
*/
@Override
public int deleteStocktakeItemsById(String id)
{
return stocktakeItemsMapper.deleteStocktakeItemsById(id);
}
}
package com.ruoyi.inventory.service.impl; package com.ruoyi.inventory.service.impl;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.domain.entity.Materials; import com.ruoyi.common.core.domain.entity.Materials;
import com.ruoyi.common.core.domain.entity.MaterialsCategory; import com.ruoyi.common.core.domain.entity.MaterialsCategory;
...@@ -17,15 +19,17 @@ import org.springframework.stereotype.Service; ...@@ -17,15 +19,17 @@ import org.springframework.stereotype.Service;
import com.ruoyi.inventory.mapper.StorageLocationsMapper; import com.ruoyi.inventory.mapper.StorageLocationsMapper;
import com.ruoyi.inventory.domain.StorageLocations; import com.ruoyi.inventory.domain.StorageLocations;
import com.ruoyi.inventory.service.IStorageLocationsService; import com.ruoyi.inventory.service.IStorageLocationsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/** /**
* 库位Service业务层处理 * 库位Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-01 * @date 2025-12-01
*/ */
@Service @Service
public class StorageLocationsServiceImpl implements IStorageLocationsService public class StorageLocationsServiceImpl implements IStorageLocationsService
{ {
@Autowired @Autowired
private StorageLocationsMapper storageLocationsMapper; private StorageLocationsMapper storageLocationsMapper;
...@@ -36,7 +40,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -36,7 +40,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
/** /**
* 查询库位 * 查询库位
* *
* @param id 库位主键 * @param id 库位主键
* @return 库位 * @return 库位
*/ */
...@@ -58,7 +62,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -58,7 +62,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
/** /**
* 查询库位列表 * 查询库位列表
* *
* @param storageLocations 库位 * @param storageLocations 库位
* @return 库位 * @return 库位
*/ */
...@@ -89,7 +93,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -89,7 +93,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
/** /**
* 新增库位 * 新增库位
* *
* @param storageLocations 库位 * @param storageLocations 库位
* @return 结果 * @return 结果
*/ */
...@@ -123,7 +127,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -123,7 +127,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
/** /**
* 修改库位 * 修改库位
* *
* @param storageLocations 库位 * @param storageLocations 库位
* @return 结果 * @return 结果
*/ */
...@@ -160,7 +164,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -160,7 +164,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
/** /**
* 批量删除库位 * 批量删除库位
* *
* @param ids 需要删除的库位主键 * @param ids 需要删除的库位主键
* @return 结果 * @return 结果
*/ */
...@@ -172,7 +176,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -172,7 +176,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
/** /**
* 删除库位信息 * 删除库位信息
* *
* @param id 库位主键 * @param id 库位主键
* @return 结果 * @return 结果
*/ */
...@@ -189,4 +193,16 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -189,4 +193,16 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategoryMapper.updateStorageLocationsCategoryStatus(id); storageLocationsCategoryMapper.updateStorageLocationsCategoryStatus(id);
return storageLocationsMapper.updateStorageLocationsStatus(id); return storageLocationsMapper.updateStorageLocationsStatus(id);
} }
/**
* @description: 获取库位表 的 location_code 编码 location_name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
@Override
public List<Map<String, Object>> getMapList(StorageLocations storageLocations)
{
return storageLocationsMapper.getMapList(storageLocations);
}
} }
package com.ruoyi.inventory.service.impl; package com.ruoyi.inventory.service.impl;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
...@@ -14,7 +15,7 @@ import com.ruoyi.inventory.domain.Warehouses; ...@@ -14,7 +15,7 @@ import com.ruoyi.inventory.domain.Warehouses;
/** /**
* 仓库Service业务层处理 * 仓库Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-01 * @date 2025-12-01
*/ */
...@@ -28,7 +29,7 @@ public class WarehousesServiceImpl implements IWarehousesService ...@@ -28,7 +29,7 @@ public class WarehousesServiceImpl implements IWarehousesService
/** /**
* 查询仓库 * 查询仓库
* *
* @param id 仓库主键 * @param id 仓库主键
* @return 仓库 * @return 仓库
*/ */
...@@ -40,7 +41,7 @@ public class WarehousesServiceImpl implements IWarehousesService ...@@ -40,7 +41,7 @@ public class WarehousesServiceImpl implements IWarehousesService
/** /**
* 查询仓库列表 * 查询仓库列表
* *
* @param warehouses 仓库 * @param warehouses 仓库
* @return 仓库 * @return 仓库
*/ */
...@@ -52,7 +53,7 @@ public class WarehousesServiceImpl implements IWarehousesService ...@@ -52,7 +53,7 @@ public class WarehousesServiceImpl implements IWarehousesService
/** /**
* 新增仓库 * 新增仓库
* *
* @param warehouses 仓库 * @param warehouses 仓库
* @return 结果 * @return 结果
*/ */
...@@ -67,7 +68,7 @@ public class WarehousesServiceImpl implements IWarehousesService ...@@ -67,7 +68,7 @@ public class WarehousesServiceImpl implements IWarehousesService
/** /**
* 修改仓库 * 修改仓库
* *
* @param warehouses 仓库 * @param warehouses 仓库
* @return 结果 * @return 结果
*/ */
...@@ -91,7 +92,7 @@ public class WarehousesServiceImpl implements IWarehousesService ...@@ -91,7 +92,7 @@ public class WarehousesServiceImpl implements IWarehousesService
/** /**
* 批量删除仓库 * 批量删除仓库
* *
* @param ids 需要删除的仓库主键 * @param ids 需要删除的仓库主键
* @return 结果 * @return 结果
*/ */
...@@ -108,7 +109,7 @@ public class WarehousesServiceImpl implements IWarehousesService ...@@ -108,7 +109,7 @@ public class WarehousesServiceImpl implements IWarehousesService
/** /**
* 删除仓库信息 * 删除仓库信息
* *
* @param id 仓库主键 * @param id 仓库主键
* @return 结果 * @return 结果
*/ */
...@@ -121,4 +122,15 @@ public class WarehousesServiceImpl implements IWarehousesService ...@@ -121,4 +122,15 @@ public class WarehousesServiceImpl implements IWarehousesService
} }
return warehousesMapper.deleteWarehousesById(id); return warehousesMapper.deleteWarehousesById(id);
} }
/**
* @description: 获取仓库 的 warehouses_code 仓库编码 warehouses_name 做成字典
* @author cs
* @date 2025/12/4
* @version 1.0
*/
@Override
public List<Map<String, Object>> getMapList(){
return warehousesMapper.getMapList();
}
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.inventory.mapper.InventoryMapper"> <mapper namespace="com.ruoyi.inventory.mapper.InventoryMapper">
<resultMap type="Inventory" id="InventoryResult"> <resultMap type="Inventory" id="InventoryResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="inventoryType" column="inventory_type" /> <result property="inventoryType" column="inventory_type" />
...@@ -28,15 +28,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -28,15 +28,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createUserCode" column="create_user_code" /> <result property="createUserCode" column="create_user_code" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="updateUserCode" column="update_user_code" /> <result property="updateUserCode" column="update_user_code" />
<result property="warehousesId" column="warehouses_id" />
</resultMap>
<resultMap type="StocktakeItems" id="StocktakeItemsResult">
<result property="id" column="id" />
<result property="stocktakeId" column="stocktake_id" />
<result property="materialId" column="material_id" />
<result property="batchCode" column="batch_code" />
<result property="warehouseId" column="warehouse_id" />
<result property="locationId" column="location_id" />
<result property="systemQuantity" column="system_quantity" />
<result property="actualQuantity" column="actual_quantity" />
<result property="varianceQuantity" column="variance_quantity" />
<result property="varianceAmount" column="variance_amount" />
<result property="stocktakeStatus" column="stocktake_status" />
<result property="countedBy" column="counted_by" />
<result property="countedAt" column="counted_at" />
<result property="adjusted" column="adjusted" />
<result property="adjustmentReason" column="adjustment_reason" />
<result property="adjustedBy" column="adjusted_by" />
<result property="adjustedAt" column="adjusted_at" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
</resultMap> </resultMap>
<sql id="selectInventoryVo"> <sql id="selectInventoryVo">
select id, inventory_type, order_id, material_id, batch_id, location_id, owner_id, quantity, locked_quantity, unit_weight, total_weight, total_volume, production_date, expiration_date, inventory_status, last_inbound_time, last_outbound_time, is_used, sort_no, create_time, create_user_code, update_time, update_user_code from inventory select id, inventory_type,warehouses_id, order_id, material_id, batch_id, location_id, owner_id, quantity, locked_quantity, unit_weight, total_weight, total_volume, production_date, expiration_date, inventory_status, last_inbound_time, last_outbound_time, is_used, sort_no, create_time, create_user_code, update_time, update_user_code from inventory
</sql> </sql>
<select id="selectInventoryList" parameterType="Inventory" resultMap="InventoryResult"> <select id="selectInventoryList" parameterType="Inventory" resultMap="InventoryResult">
<include refid="selectInventoryVo"/> <include refid="selectInventoryVo"/>
<where> <where>
<if test="inventoryType != null "> and inventory_type = #{inventoryType}</if> <if test="inventoryType != null "> and inventory_type = #{inventoryType}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if> <if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="materialId != null and materialId != ''"> and material_id = #{materialId}</if> <if test="materialId != null and materialId != ''"> and material_id = #{materialId}</if>
...@@ -57,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -57,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sortNo != null "> and sort_no = #{sortNo}</if> <if test="sortNo != null "> and sort_no = #{sortNo}</if>
<if test="createUserCode != null and createUserCode != ''"> and create_user_code = #{createUserCode}</if> <if test="createUserCode != null and createUserCode != ''"> and create_user_code = #{createUserCode}</if>
<if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if> <if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if>
<if test="warehousesId != null "> and warehouses_id = #{warehousesId}</if>
</where> </where>
</select> </select>
...@@ -83,9 +108,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -83,9 +108,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sortNo != null "> and sort_no = #{sortNo}</if> <if test="sortNo != null "> and sort_no = #{sortNo}</if>
<if test="createUserCode != null and createUserCode != ''"> and create_user_code = #{createUserCode}</if> <if test="createUserCode != null and createUserCode != ''"> and create_user_code = #{createUserCode}</if>
<if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if> <if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if>
<if test="warehousesId != null and warehousesId != ''"> and warehouses_id = #{warehousesId}</if>
</where> </where>
</select> </select>
<select id="selectstocktakeItemsList" resultMap="StocktakeItemsResult">
select material_id, batch_id, location_id, warehouse_id, quantity as system_quantity
from inventory
where is_used = 1 and inventory_status = 1
order by warehouse_id,location_id,material_id
</select>
<select id="selectInventoryById" parameterType="String" resultMap="InventoryResult"> <select id="selectInventoryById" parameterType="String" resultMap="InventoryResult">
<include refid="selectInventoryVo"/> <include refid="selectInventoryVo"/>
where id = #{id} where id = #{id}
...@@ -120,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -120,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUserCode != null">create_user_code,</if> <if test="createUserCode != null">create_user_code,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="updateUserCode != null">update_user_code,</if> <if test="updateUserCode != null">update_user_code,</if>
<if test="warehousesId != null"> warehouses_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
...@@ -145,6 +179,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -145,6 +179,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUserCode != null">#{createUserCode},</if> <if test="createUserCode != null">#{createUserCode},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="updateUserCode != null">#{updateUserCode},</if> <if test="updateUserCode != null">#{updateUserCode},</if>
<if test="warehousesId != null"> #{warehousesId},</if>
</trim> </trim>
</insert> </insert>
...@@ -173,6 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -173,6 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUserCode != null">create_user_code = #{createUserCode},</if> <if test="createUserCode != null">create_user_code = #{createUserCode},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateUserCode != null">update_user_code = #{updateUserCode},</if> <if test="updateUserCode != null">update_user_code = #{updateUserCode},</if>
<if test="warehousesId != null"> warehouses_id = #{warehousesId},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
...@@ -182,7 +218,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -182,7 +218,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteInventoryByIds" parameterType="String"> <delete id="deleteInventoryByIds" parameterType="String">
delete from inventory where id in delete from inventory where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.inventory.mapper.InventoryTransactionsMapper">
<resultMap type="InventoryTransactions" id="InventoryTransactionsResult">
<result property="id" column="id" />
<result property="transactionType" column="transaction_type" />
<result property="referenceId" column="reference_id" />
<result property="referenceItemId" column="reference_item_id" />
<result property="materialId" column="material_id" />
<result property="batchCode" column="batch_code" />
<result property="warehouseId" column="warehouse_id" />
<result property="locationId" column="location_id" />
<result property="ownerId" column="owner_id" />
<result property="quantityBefore" column="quantity_before" />
<result property="quantityChange" column="quantity_change" />
<result property="quantityAfter" column="quantity_after" />
<result property="transactionTime" column="transaction_time" />
<result property="operatedBy" column="operated_by" />
<result property="remark" column="remark" />
<result property="isUsed" column="is_used" />
<result property="sortNo" column="sort_no" />
<result property="createTime" column="create_time" />
<result property="createUserCode" column="create_user_code" />
<result property="updateTime" column="update_time" />
<result property="updateUserCode" column="update_user_code" />
<result property="inventoryId" column="inventory_id" />
</resultMap>
<sql id="selectInventoryTransactionsVo">
select id, inventory_id, transaction_type, reference_id, reference_item_id, material_id, batch_code, warehouse_id, location_id, owner_id, quantity_before, quantity_change, quantity_after, transaction_time, operated_by, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code from inventory_transactions
</sql>
<select id="selectInventoryTransactionsList" parameterType="InventoryTransactions" resultMap="InventoryTransactionsResult">
<include refid="selectInventoryTransactionsVo"/>
<where>
<if test="transactionType != null "> and transaction_type = #{transactionType}</if>
<if test="referenceId != null and referenceId != ''"> and reference_id = #{referenceId}</if>
<if test="inventoryId != null and inventoryId != ''"> and inventory_id = #{inventoryId}</if>
<if test="referenceItemId != null and referenceItemId != ''"> and reference_item_id = #{referenceItemId}</if>
<if test="materialId != null and materialId != ''"> and material_id = #{materialId}</if>
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="locationId != null and locationId != ''"> and location_id = #{locationId}</if>
<if test="ownerId != null and ownerId != ''"> and owner_id = #{ownerId}</if>
<if test="quantityBefore != null "> and quantity_before = #{quantityBefore}</if>
<if test="quantityChange != null "> and quantity_change = #{quantityChange}</if>
<if test="quantityAfter != null "> and quantity_after = #{quantityAfter}</if>
<if test="transactionTime != null "> and transaction_time = #{transactionTime}</if>
<if test="operatedBy != null and operatedBy != ''"> and operated_by = #{operatedBy}</if>
<if test="isUsed != null "> and is_used = #{isUsed}</if>
<if test="sortNo != null "> and sort_no = #{sortNo}</if>
<if test="createUserCode != null and createUserCode != ''"> and create_user_code = #{createUserCode}</if>
<if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if>
</where>
</select>
<select id="selectInventoryTransactionsById" parameterType="String" resultMap="InventoryTransactionsResult">
<include refid="selectInventoryTransactionsVo"/>
where id = #{id}
</select>
<insert id="insertInventoryTransactions" parameterType="InventoryTransactions">
insert into inventory_transactions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="transactionType != null">transaction_type,</if>
<if test="inventoryId != null">inventory_id,</if>
<if test="referenceId != null">reference_id,</if>
<if test="referenceItemId != null">reference_item_id,</if>
<if test="materialId != null">material_id,</if>
<if test="batchCode != null">batch_code,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="locationId != null">location_id,</if>
<if test="ownerId != null">owner_id,</if>
<if test="quantityBefore != null">quantity_before,</if>
<if test="quantityChange != null">quantity_change,</if>
<if test="quantityAfter != null">quantity_after,</if>
<if test="transactionTime != null">transaction_time,</if>
<if test="operatedBy != null">operated_by,</if>
<if test="remark != null">remark,</if>
<if test="isUsed != null">is_used,</if>
<if test="sortNo != null">sort_no,</if>
<if test="createTime != null">create_time,</if>
<if test="createUserCode != null">create_user_code,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateUserCode != null">update_user_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="transactionType != null">#{transactionType},</if>
<if test="inventoryId != null">#{inventoryId},</if>
<if test="referenceId != null">#{referenceId},</if>
<if test="referenceItemId != null">#{referenceItemId},</if>
<if test="materialId != null">#{materialId},</if>
<if test="batchCode != null">#{batchCode},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="locationId != null">#{locationId},</if>
<if test="ownerId != null">#{ownerId},</if>
<if test="quantityBefore != null">#{quantityBefore},</if>
<if test="quantityChange != null">#{quantityChange},</if>
<if test="quantityAfter != null">#{quantityAfter},</if>
<if test="transactionTime != null">#{transactionTime},</if>
<if test="operatedBy != null">#{operatedBy},</if>
<if test="remark != null">#{remark},</if>
<if test="isUsed != null">#{isUsed},</if>
<if test="sortNo != null">#{sortNo},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createUserCode != null">#{createUserCode},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateUserCode != null">#{updateUserCode},</if>
</trim>
</insert>
<update id="updateInventoryTransactions" parameterType="InventoryTransactions">
update inventory_transactions
<trim prefix="SET" suffixOverrides=",">
<if test="transactionType != null">transaction_type = #{transactionType},</if>
<if test="inventoryId != null">inventory_id = #{inventoryId},</if>
<if test="referenceId != null">reference_id = #{referenceId},</if>
<if test="referenceItemId != null">reference_item_id = #{referenceItemId},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="batchCode != null">batch_code = #{batchCode},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="locationId != null">location_id = #{locationId},</if>
<if test="ownerId != null">owner_id = #{ownerId},</if>
<if test="quantityBefore != null">quantity_before = #{quantityBefore},</if>
<if test="quantityChange != null">quantity_change = #{quantityChange},</if>
<if test="quantityAfter != null">quantity_after = #{quantityAfter},</if>
<if test="transactionTime != null">transaction_time = #{transactionTime},</if>
<if test="operatedBy != null">operated_by = #{operatedBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="isUsed != null">is_used = #{isUsed},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createUserCode != null">create_user_code = #{createUserCode},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateUserCode != null">update_user_code = #{updateUserCode},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInventoryTransactionsById" parameterType="String">
delete from inventory_transactions where id = #{id}
</delete>
<delete id="deleteInventoryTransactionsByIds" parameterType="String">
delete from inventory_transactions where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.inventory.mapper.MaterialsMapper"> <mapper namespace="com.ruoyi.inventory.mapper.MaterialsMapper">
<resultMap type="Materials" id="MaterialsResult"> <resultMap type="Materials" id="MaterialsResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="materialCode" column="material_code" /> <result property="materialCode" column="material_code" />
...@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectMaterialsList" parameterType="Materials" resultMap="MaterialsResult"> <select id="selectMaterialsList" parameterType="Materials" resultMap="MaterialsResult">
<include refid="selectMaterialsVo"/> <include refid="selectMaterialsVo"/>
<where> <where>
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if> <if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> <if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="sapNo != null and sapNo != ''"> and sap_no like concat('%', #{sapNo}, '%')</if> <if test="sapNo != null and sapNo != ''"> and sap_no like concat('%', #{sapNo}, '%')</if>
...@@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by sort_no asc order by sort_no asc
</select> </select>
<select id="selectMaterialsById" parameterType="String" resultMap="MaterialsResult"> <select id="selectMaterialsById" parameterType="String" resultMap="MaterialsResult">
<include refid="selectMaterialsVo"/> <include refid="selectMaterialsVo"/>
where id = #{id} where id = #{id}
...@@ -86,6 +86,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -86,6 +86,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where category_code = #{id} where category_code = #{id}
order by sort_no asc order by sort_no asc
</select> </select>
<!-- 获取物料 的 sap_no Name 做成字典-->
<select id="getMapList" resultType="java.util.Map">
select sap_no, IFNULL(material_name, '') as material_name from materials where is_used = 1;
</select>
<insert id="insertMaterials" parameterType="Materials"> <insert id="insertMaterials" parameterType="Materials">
insert into materials insert into materials
...@@ -197,7 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -197,7 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteMaterialsByIds" parameterType="String"> <delete id="deleteMaterialsByIds" parameterType="String">
delete from materials where id in delete from materials where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.inventory.mapper.StorageLocationsMapper"> <mapper namespace="com.ruoyi.inventory.mapper.StorageLocationsMapper">
<resultMap type="StorageLocations" id="StorageLocationsResult"> <resultMap type="StorageLocations" id="StorageLocationsResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="locationCode" column="location_code" /> <result property="locationCode" column="location_code" />
...@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if> <if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if>
</select> </select>
<select id="selectStorageLocationsById" parameterType="String" resultMap="StorageLocationsResult"> <select id="selectStorageLocationsById" parameterType="String" resultMap="StorageLocationsResult">
<include refid="selectStorageLocationsVo"/> <include refid="selectStorageLocationsVo"/>
where id = #{id} where id = #{id}
...@@ -70,6 +70,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -70,6 +70,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{warehousesCodes} #{warehousesCodes}
</foreach> </foreach>
</select> </select>
<!-- 获取库位表 的 location_code 编码 location_name 做成字典-->
<select id="getMapList" parameterType="StorageLocations" resultType="java.util.Map">
select location_code, IFNULL(location_name, '') as location_name from storage_locations where is_used = 1
<if test="warehousesCode != null and warehousesCode != ''"> and warehouses_code = #{warehousesCode}</if>
</select>
<insert id="insertStorageLocations" parameterType="StorageLocations"> <insert id="insertStorageLocations" parameterType="StorageLocations">
insert into storage_locations insert into storage_locations
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.inventory.mapper.WarehousesMapper"> <mapper namespace="com.ruoyi.inventory.mapper.WarehousesMapper">
<resultMap type="Warehouses" id="WarehousesResult"> <resultMap type="Warehouses" id="WarehousesResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="warehousesCode" column="warehouses_code" /> <result property="warehousesCode" column="warehouses_code" />
...@@ -45,11 +45,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -45,11 +45,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if> <if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if>
</select> </select>
<select id="selectWarehousesById" parameterType="String" resultMap="WarehousesResult"> <select id="selectWarehousesById" parameterType="String" resultMap="WarehousesResult">
<include refid="selectWarehousesVo"/> <include refid="selectWarehousesVo"/>
where id = #{id} where id = #{id}
</select> </select>
<!-- 获取仓库 的 warehouses_code 仓库编码 warehouses_name 做成字典-->
<select id="getMapList" resultType="java.util.Map">
select warehouses_code, IFNULL(warehouses_name, '') as warehouses_name from warehouses where is_used = 1;
</select>
<insert id="insertWarehouses" parameterType="Warehouses"> <insert id="insertWarehouses" parameterType="Warehouses">
insert into warehouses insert into warehouses
...@@ -118,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -118,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteWarehousesByIds" parameterType="String"> <delete id="deleteWarehousesByIds" parameterType="String">
delete from warehouses where id in delete from warehouses where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论