资产领用
这篇解决什么
入库建卡和领用出库各改哪张表、哪条流程 key。读完能分开 asset_receive 和 asset_allocate_receive,不要把 /asset/receive 当成领用人接口。
示意图:入库通过后才有闲置卡。领用 / 借用 / 归还共用 asset_allocate,靠 allocateType 分 key。
从哪改
| 名称 | 说明 | 仓库路径 |
|---|---|---|
| 入库 | /asset/receive,key asset_receive | ruoyi-office/yudao-module-asset/.../AssetReceiveController.java |
| 领用借用归还 | /asset/allocate | AssetAllocateController.java |
| 表 | 入库头行 / 分配头行 | asset_receive、asset_receive_item、asset_allocate、asset_allocate_item |
| 前端入库 | receive/list + receive/info | ruoyi-office-vben/apps/web-antd/src/views/asset/receive/ |
| 前端领用 | allocate/list + allocate/info | views/asset/allocate/ |
| 前端归还 | return/list + return/info | views/asset/return/ |
allocateType:1 领用 → asset_allocate_receive(702);2 借用 → asset_allocate_borrow(703);3 归还 → asset_allocate_return(309)。移动创建页 allocateType 写在 query 上。
入库审批通过走 onProcessApproved → AssetReceiveCardGenerator。建卡和合同回写拆开,避免合同未生效把卡片整单回滚。缺口可调补偿接口,只允许已通过的单。
领用通过后卡片变使用中。归还要求卡已是使用中,并填 sourceAllocateId 指回原借用 / 领用单。借用要填 expectedReturnDate。
日期是 LocalDate。移动入库权限 asset:receive:submit,领用 / 借用 asset:allocate:submit。
用品转固不走本篇入库页,走 OA 台账转固客户端,来源类型 6。
字段
| 名称 | 说明 | 仓库路径 |
|---|---|---|
receiveDate / totalCount | 入库日期与件数 | AssetReceiveDO |
defaultLocationId | 头上默认位置,下发明细 | 同上 |
allocateType | 1 领用 2 借用 3 归还 | AssetAllocateDO |
returnStatus | 待归还 / 已归还 / 逾期 | 同上 |
英文 receive 是入库
接口 /asset/receive、表 asset_receive、流程 key asset_receive 都是入库。领用人改 /asset/allocate。模型绑错 key,通过后不会改使用人。
归还不是第四张头表
归还行仍在 asset_allocate。views/asset/return 只是筛选 allocateType = 3 的页面。
@RequestMapping("/asset/receive")
public class AssetReceiveController { }
@RequestMapping("/asset/allocate")
public class AssetAllocateController { }配置与操作
入库走 资产 → 资产入库 的 list / info,填分类、位置、明细后提交 asset_receive。通过后才有闲置卡。
领用人走 资产领用(allocateType=1),借用 =2,归还走归还页(仍是 asset_allocate,allocateType=3)。模型不要和入库共用 asset_receive。

本系统截图:资产入库列表。英文 receive 是入库。

本系统截图:入库 info。通过后 AssetReceiveCardGenerator 建卡。
