Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mini-wms
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
周海峰
mini-wms
Commits
97c6ee74
Commit
97c6ee74
authored
Dec 05, 2025
by
chuishuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
盘点计划主表——完成
parent
1f269b05
全部展开
显示空白字符变更
内嵌
并排
正在显示
47 个修改的文件
包含
2538 行增加
和
26 行删除
+2538
-26
ruoyi-admin-vue/src/api/inventory/stocktakes.js
+44
-0
ruoyi-admin-vue/src/api/inventory/stocktakes_items.js
+44
-0
ruoyi-admin-vue/src/components/CommonDictSelect.vue
+119
-0
ruoyi-admin-vue/src/utils/dictUtil.js
+39
-0
ruoyi-admin-vue/src/views/inventory/stocktake_items/index.vue
+0
-0
ruoyi-admin-vue/src/views/inventory/stocktakes/index.vue
+0
-0
ruoyi-admin-vue/src/views/inventory/stocktakes/stocktakeItemsTable.vue
+0
-0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/InventoryTransactionsController.java
+104
-0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/MaterialsController.java
+21
-8
ruoyi-inventory/pom.xml
+6
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/StocktakeItemsController.java
+104
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/StocktakesController.java
+106
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/StorageLocationsController.java
+20
-8
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/WarehousesController.java
+20
-8
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Inventory.java
+11
-1
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/InventoryTransactions.java
+308
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/StocktakeItems.java
+394
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Stocktakes.java
+238
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/TO/StocktakesTO.java
+29
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryMapper.java
+9
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryTransactionsMapper.java
+61
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/MaterialsMapper.java
+11
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/StocktakeItemsMapper.java
+61
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/StocktakesMapper.java
+87
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/StorageLocationsMapper.java
+10
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/WarehousesMapper.java
+10
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryService.java
+9
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryTransactionsService.java
+61
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IMaterialsService.java
+9
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IStocktakeItemsService.java
+61
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IStocktakesService.java
+62
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IStorageLocationsService.java
+13
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IWarehousesService.java
+13
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
+11
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryTransactionsServiceImpl.java
+100
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/MaterialsServiceImpl.java
+12
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StocktakeItemsServiceImpl.java
+96
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StocktakesServiceImpl.java
+0
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
+16
-0
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/WarehousesServiceImpl.java
+12
-0
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
+37
-1
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryTransactionsMapper.xml
+156
-0
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsMapper.xml
+4
-0
ruoyi-inventory/src/main/resources/mapper/inventory/StocktakeItemsMapper.xml
+0
-0
ruoyi-inventory/src/main/resources/mapper/inventory/StocktakesMapper.xml
+0
-0
ruoyi-inventory/src/main/resources/mapper/inventory/StorageLocationsMapper.xml
+6
-0
ruoyi-inventory/src/main/resources/mapper/inventory/WarehousesMapper.xml
+4
-0
没有找到文件。
ruoyi-admin-vue/src/api/inventory/stocktakes.js
0 → 100644
View file @
97c6ee74
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'
})
}
ruoyi-admin-vue/src/api/inventory/stocktakes_items.js
0 → 100644
View file @
97c6ee74
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'
})
}
ruoyi-admin-vue/src/components/CommonDictSelect.vue
0 → 100644
View file @
97c6ee74
<
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
>
ruoyi-admin-vue/src/utils/dictUtil.js
0 → 100644
View file @
97c6ee74
/**
* 通用加载字典数据方法(支持动态参数)
* @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
}
ruoyi-admin-vue/src/views/inventory/stocktake_items/index.vue
0 → 100644
View file @
97c6ee74
差异被折叠。
点击展开。
ruoyi-admin-vue/src/views/inventory/stocktakes/index.vue
0 → 100644
View file @
97c6ee74
差异被折叠。
点击展开。
ruoyi-admin-vue/src/views/inventory/stocktakes/stocktakeItemsTable.vue
0 → 100644
View file @
97c6ee74
差异被折叠。
点击展开。
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/InventoryTransactionsController.java
0 → 100644
View file @
97c6ee74
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
));
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/inventory/MaterialsController.java
View file @
97c6ee74
package
com
.
ruoyi
.
web
.
controller
.
inventory
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
javax.servlet.http.HttpServletResponse
;
import
com.ruoyi.common.core.domain.entity.Materials
;
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
org.springframework.web.bind.annotation.*
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
...
...
@@ -136,4 +131,22 @@ public class MaterialsController extends BaseController
String
message
=
materialsService
.
importMaterials
(
materialsList
,
updateSupport
,
operName
);
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<>(),更高效
}
}
}
ruoyi-inventory/pom.xml
View file @
97c6ee74
...
...
@@ -22,6 +22,11 @@
<groupId>
com.ruoyi
</groupId>
<artifactId>
ruoyi-common
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<scope>
provided
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/StocktakeItemsController.java
0 → 100644
View file @
97c6ee74
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
));
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/StocktakesController.java
0 → 100644
View file @
97c6ee74
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
));
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/StorageLocationsController.java
View file @
97c6ee74
package
com
.
ruoyi
.
inventory
.
controller
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
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
org.springframework.web.bind.annotation.*
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
...
...
@@ -101,4 +96,21 @@ public class StorageLocationsController extends BaseController
{
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<>(),更高效
}
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/controller/WarehousesController.java
View file @
97c6ee74
package
com
.
ruoyi
.
inventory
.
controller
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
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
org.springframework.web.bind.annotation.*
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
...
...
@@ -101,4 +96,21 @@ public class WarehousesController extends BaseController
{
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<>(),更高效
}
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Inventory.java
View file @
97c6ee74
...
...
@@ -35,7 +35,9 @@ public class Inventory extends BaseEntity
/** 批次ID 检索条件 */
@Excel
(
name
=
"批次ID 检索条件"
)
private
String
batchId
;
/** 批次ID 检索条件 */
@Excel
(
name
=
"仓库ID "
)
private
String
warehousesId
;
/** 库位ID 检索条件 */
@Excel
(
name
=
"库位ID 检索条件"
)
private
String
locationId
;
...
...
@@ -104,6 +106,14 @@ public class Inventory extends BaseEntity
@Excel
(
name
=
"排序号"
)
private
String
updateUserCode
;
public
String
getWarehousesId
()
{
return
warehousesId
;
}
public
void
setWarehousesId
(
String
warehousesId
)
{
this
.
warehousesId
=
warehousesId
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
...
...
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/InventoryTransactions.java
0 → 100644
View file @
97c6ee74
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
();
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/StocktakeItems.java
0 → 100644
View file @
97c6ee74
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
();
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Stocktakes.java
0 → 100644
View file @
97c6ee74
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
();
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/TO/StocktakesTO.java
0 → 100644
View file @
97c6ee74
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
;
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryMapper.java
View file @
97c6ee74
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.inventory.domain.Inventory
;
import
com.ruoyi.inventory.domain.StocktakeItems
;
/**
* 库存Mapper接口
...
...
@@ -69,4 +70,12 @@ public interface InventoryMapper
public
int
deleteInventoryByIds
(
String
[]
ids
);
public
List
<
Inventory
>
listByMatreialId
(
String
materialId
);
/**
* @description: 获取库存盘点详细信息
* @author cs
* @date 2025/12/3
* @version 1.0
*/
List
<
StocktakeItems
>
selectstocktakeItemsList
();
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/InventoryTransactionsMapper.java
0 → 100644
View file @
97c6ee74
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
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/MaterialsMapper.java
View file @
97c6ee74
package
com
.
ruoyi
.
inventory
.
mapper
;
import
java.util.List
;
import
java.util.Map
;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Mapper
;
/**
...
...
@@ -85,4 +87,13 @@ public interface MaterialsMapper
*/
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
();
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/StocktakeItemsMapper.java
0 → 100644
View file @
97c6ee74
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
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/StocktakesMapper.java
0 → 100644
View file @
97c6ee74
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
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/StorageLocationsMapper.java
View file @
97c6ee74
package
com
.
ruoyi
.
inventory
.
mapper
;
import
java.util.List
;
import
java.util.Map
;
import
com.ruoyi.inventory.domain.StorageLocations
;
import
org.apache.ibatis.annotations.Update
;
...
...
@@ -79,4 +81,12 @@ public interface StorageLocationsMapper
@Update
(
"update storage_locations set is_enabled = 0 where warehouses_code=#{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
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/mapper/WarehousesMapper.java
View file @
97c6ee74
package
com
.
ruoyi
.
inventory
.
mapper
;
import
java.util.List
;
import
java.util.Map
;
import
com.ruoyi.inventory.domain.Warehouses
;
import
org.apache.ibatis.annotations.Update
;
...
...
@@ -69,4 +71,12 @@ public interface WarehousesMapper
@Update
(
"update warehouses set is_enabled = 0 where id=#{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
();
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryService.java
View file @
97c6ee74
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.inventory.domain.Inventory
;
import
com.ruoyi.inventory.domain.StocktakeItems
;
/**
* 库存Service接口
...
...
@@ -71,4 +72,12 @@ public interface IInventoryService
public
int
deleteInventoryById
(
String
id
);
public
List
<
Inventory
>
listByMatreialId
(
String
materialId
);
/**
* @description: 获取库存盘点详细信息
* @author cs
* @date 2025/12/3
* @version 1.0
*/
public
List
<
StocktakeItems
>
selectstocktakeItemsList
();
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IInventoryTransactionsService.java
0 → 100644
View file @
97c6ee74
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
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IMaterialsService.java
View file @
97c6ee74
...
...
@@ -3,6 +3,7 @@ package com.ruoyi.inventory.service;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
java.util.List
;
import
java.util.Map
;
/**
* 物料Service接口
...
...
@@ -64,4 +65,12 @@ public interface IMaterialsService
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
();
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IStocktakeItemsService.java
0 → 100644
View file @
97c6ee74
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
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IStocktakesService.java
0 → 100644
View file @
97c6ee74
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
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IStorageLocationsService.java
View file @
97c6ee74
package
com
.
ruoyi
.
inventory
.
service
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
com.ruoyi.inventory.domain.StorageLocations
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
* 库位Service接口
...
...
@@ -76,4 +81,12 @@ public interface IStorageLocationsService
public
int
deleteStorageLocationsById
(
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
);
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/IWarehousesService.java
View file @
97c6ee74
package
com
.
ruoyi
.
inventory
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.ruoyi.inventory.domain.Warehouses
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
* 仓库Service接口
...
...
@@ -60,4 +64,13 @@ public interface IWarehousesService
* @return 结果
*/
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
();
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryServiceImpl.java
View file @
97c6ee74
...
...
@@ -5,6 +5,7 @@ import java.util.UUID;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.inventory.domain.OutboundOrderLog
;
import
com.ruoyi.inventory.domain.StocktakeItems
;
import
com.ruoyi.inventory.mapper.OutboundOrderLogMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -128,4 +129,14 @@ public class InventoryServiceImpl implements IInventoryService
public
List
<
Inventory
>
listByMatreialId
(
String
materialId
)
{
return
inventoryMapper
.
listByMatreialId
(
materialId
);
}
/**
* @description: 获取库存盘点详细信息
* @author cs
* @date 2025/12/3
* @version 1.0
*/
public
List
<
StocktakeItems
>
selectstocktakeItemsList
(){
return
inventoryMapper
.
selectstocktakeItemsList
();
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/InventoryTransactionsServiceImpl.java
0 → 100644
View file @
97c6ee74
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
);
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/MaterialsServiceImpl.java
View file @
97c6ee74
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.inventory.service.impl;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
com.ruoyi.common.core.domain.entity.Materials
;
...
...
@@ -164,4 +165,15 @@ public class MaterialsServiceImpl implements IMaterialsService
}
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
();
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StocktakeItemsServiceImpl.java
0 → 100644
View file @
97c6ee74
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
);
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StocktakesServiceImpl.java
0 → 100644
View file @
97c6ee74
差异被折叠。
点击展开。
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/StorageLocationsServiceImpl.java
View file @
97c6ee74
package
com
.
ruoyi
.
inventory
.
service
.
impl
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
com.ruoyi.common.core.domain.entity.Materials
;
import
com.ruoyi.common.core.domain.entity.MaterialsCategory
;
...
...
@@ -17,6 +19,8 @@ import org.springframework.stereotype.Service;
import
com.ruoyi.inventory.mapper.StorageLocationsMapper
;
import
com.ruoyi.inventory.domain.StorageLocations
;
import
com.ruoyi.inventory.service.IStorageLocationsService
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
* 库位Service业务层处理
...
...
@@ -189,4 +193,16 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategoryMapper
.
updateStorageLocationsCategoryStatus
(
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
);
}
}
ruoyi-inventory/src/main/java/com/ruoyi/inventory/service/impl/WarehousesServiceImpl.java
View file @
97c6ee74
package
com
.
ruoyi
.
inventory
.
service
.
impl
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
com.ruoyi.common.utils.DateUtils
;
...
...
@@ -121,4 +122,15 @@ public class WarehousesServiceImpl implements IWarehousesService
}
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
();
}
}
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryMapper.xml
View file @
97c6ee74
...
...
@@ -28,10 +28,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"createUserCode"
column=
"create_user_code"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<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>
<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>
<select
id=
"selectInventoryList"
parameterType=
"Inventory"
resultMap=
"InventoryResult"
>
...
...
@@ -57,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
<if
test=
"warehousesId != null "
>
and warehouses_id = #{warehousesId}
</if>
</where>
</select>
...
...
@@ -83,9 +108,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
<if
test=
"warehousesId != null and warehousesId != ''"
>
and warehouses_id = #{warehousesId}
</if>
</where>
</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"
>
<include
refid=
"selectInventoryVo"
/>
where id = #{id}
...
...
@@ -120,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createUserCode != null"
>
create_user_code,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"updateUserCode != null"
>
update_user_code,
</if>
<if
test=
"warehousesId != null"
>
warehouses_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id},
</if>
...
...
@@ -145,6 +179,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createUserCode != null"
>
#{createUserCode},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"updateUserCode != null"
>
#{updateUserCode},
</if>
<if
test=
"warehousesId != null"
>
#{warehousesId},
</if>
</trim>
</insert>
...
...
@@ -173,6 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
<if
test=
"warehousesId != null"
>
warehouses_id = #{warehousesId},
</if>
</trim>
where id = #{id}
</update>
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/InventoryTransactionsMapper.xml
0 → 100644
View file @
97c6ee74
<?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
ruoyi-inventory/src/main/resources/mapper/inventory/MaterialsMapper.xml
View file @
97c6ee74
...
...
@@ -86,6 +86,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where category_code = #{id}
order by sort_no asc
</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 into materials
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/StocktakeItemsMapper.xml
0 → 100644
View file @
97c6ee74
差异被折叠。
点击展开。
ruoyi-inventory/src/main/resources/mapper/inventory/StocktakesMapper.xml
0 → 100644
View file @
97c6ee74
差异被折叠。
点击展开。
ruoyi-inventory/src/main/resources/mapper/inventory/StorageLocationsMapper.xml
View file @
97c6ee74
...
...
@@ -70,6 +70,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{warehousesCodes}
</foreach>
</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 into storage_locations
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
ruoyi-inventory/src/main/resources/mapper/inventory/WarehousesMapper.xml
View file @
97c6ee74
...
...
@@ -50,6 +50,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include
refid=
"selectWarehousesVo"
/>
where id = #{id}
</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 into warehouses
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论