Browse Source

feat(rfid): 完善RFID盘点功能并添加处理步骤文档

- 在RfidCountHeaderService中添加handling_unit更新逻辑说明
- 在RfidCountHeaderServiceImpl中补充盘点标记更新的注释文档
- 添加详细的处理步骤说明包括标签查询、详情获取、批量保存等流程
- 实现handling_unit表的count_flag和last_count_date字段更新
- 添加盘点标记更新的日志记录功能
master
常熟吴彦祖 2 days ago
parent
commit
5b70032017
  1. 1
      src/main/java/com/gaotao/modules/check/service/RfidCountHeaderService.java
  2. 25
      src/main/java/com/gaotao/modules/check/service/impl/RfidCountHeaderServiceImpl.java

1
src/main/java/com/gaotao/modules/check/service/RfidCountHeaderService.java

@ -30,6 +30,7 @@ public interface RfidCountHeaderService extends IService<RfidCountHeader> {
* - 从pallet_detail查询标签列表site+pallet_id * - 从pallet_detail查询标签列表site+pallet_id
* - 从handling_unit查询标签详细信息 * - 从handling_unit查询标签详细信息
* - 批量保存到rfid_count_detail * - 批量保存到rfid_count_detail
* - 更新handling_unitcount_flag='Y'last_count_date=盘点时间
* - 更新或新增到rfid_count_snapshot * - 更新或新增到rfid_count_snapshot
* - 更新rfid_count_headerlabel_count=标签数量is_used='Y' * - 更新rfid_count_headerlabel_count=标签数量is_used='Y'
* 3. 事务处理每条主表记录独立事务 * 3. 事务处理每条主表记录独立事务

25
src/main/java/com/gaotao/modules/check/service/impl/RfidCountHeaderServiceImpl.java

@ -109,6 +109,7 @@ public class RfidCountHeaderServiceImpl extends ServiceImpl<RfidCountHeaderMappe
* - 从pallet_detail查询标签列表 * - 从pallet_detail查询标签列表
* - 从handling_unit查询标签详细信息 * - 从handling_unit查询标签详细信息
* - 批量保存到rfid_count_detail * - 批量保存到rfid_count_detail
* - 更新handling_unitcount_flag='Y'last_count_date=盘点时间
* - 更新或新增到rfid_count_snapshot * - 更新或新增到rfid_count_snapshot
* - 更新rfid_count_headerlabel_count=标签数量is_used='Y' * - 更新rfid_count_headerlabel_count=标签数量is_used='Y'
* 3. 每条主表记录独立事务处理 * 3. 每条主表记录独立事务处理
@ -161,6 +162,17 @@ public class RfidCountHeaderServiceImpl extends ServiceImpl<RfidCountHeaderMappe
/** /**
* @Description 处理单条主表记录独立事务- rqrq * @Description 处理单条主表记录独立事务- rqrq
*
* <p><b>处理步骤</b></p>
* <pre>
* 1. 从pallet_detail查询标签列表
* 2. 从handling_unit查询标签详细信息
* 3. 批量保存到rfid_count_detail
* 4. 更新handling_unit的盘点标记count_flag='Y'last_count_date
* 5. 更新或新增到rfid_count_snapshot有则累加count_times无则新增
* 6. 更新主表label_count=标签数量is_used='Y'
* </pre>
*
* @param header 主表记录 * @param header 主表记录
* @author rqrq * @author rqrq
* @date 2026/03/04 * @date 2026/03/04
@ -245,6 +257,19 @@ public class RfidCountHeaderServiceImpl extends ServiceImpl<RfidCountHeaderMappe
log.info("保存{}条明细记录 - rqrq,palletId={}", detailList.size(), header.getPalletId()); log.info("保存{}条明细记录 - rqrq,palletId={}", detailList.size(), header.getPalletId());
} }
// 5.5 更新handling_unit的盘点标记和盘点时间 - rqrq
if (!detailList.isEmpty()) {
for (RfidCountDetail detail : detailList) {
handlingUnitService.lambdaUpdate()
.eq(HandlingUnit::getSite, detail.getSite())
.eq(HandlingUnit::getUnitId, detail.getUnitId())
.set(HandlingUnit::getCountFlag, "Y")
.set(HandlingUnit::getLastCountDate, header.getCountTime())
.update();
}
log.info("更新{}个标签的盘点标记 - rqrq,palletId={}", detailList.size(), header.getPalletId());
}
// 6. 更新或新增快照联合主键需要用LambdaUpdateWrapper- rqrq // 6. 更新或新增快照联合主键需要用LambdaUpdateWrapper- rqrq
if (!snapshotList.isEmpty()) { if (!snapshotList.isEmpty()) {
for (RfidCountSnapshot snapshot : snapshotList) { for (RfidCountSnapshot snapshot : snapshotList) {

Loading…
Cancel
Save