From 5b3b82a29282f9b2e89466d0448e34fa0bb9e072 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Fri, 9 Jan 2026 10:06:19 +0800 Subject: [PATCH] =?UTF-8?q?5=E5=8F=B7=E5=BA=93=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/material/ma/service/impl/TypeServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java index ecc536f4..2706020d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java @@ -238,6 +238,7 @@ public class TypeServiceImpl implements ITypeService { // 获取锁(公平锁会按线程等待请求顺序分配锁) lock.lock(); try { + Long deptId = getUserDeptId(); int result = 0; // 根据typeId查询物资名称和规格型号 Type info = typeMapper.selectTypeByTypeId(type.getTypeId()); @@ -267,6 +268,7 @@ public class TypeServiceImpl implements ITypeService { result = typeMapper.updateMaTypeStockNum(type); if (result > 0) { type.setStorageNum(type.getPreStoreNum().subtract(type.getOutNum())); + type.setCompanyId(deptId); typeMapper.insertStorageNumLog(type); } else { throw new RuntimeException("更新库存失败"); @@ -275,6 +277,7 @@ public class TypeServiceImpl implements ITypeService { result = typeMapper.updateStorageNum(type); if (result > 0) { type.setModelTitle("直接修改库存"); + type.setCompanyId(deptId); typeMapper.insertStorageNumLog(type); } else { throw new RuntimeException("更新库存失败"); @@ -283,6 +286,7 @@ public class TypeServiceImpl implements ITypeService { result = typeMapper.addStockNum(type); if (result > 0) { type.setStorageNum(type.getPreStoreNum().add(type.getInputNum())); + type.setCompanyId(deptId); typeMapper.insertStorageNumLog(type); } else { throw new RuntimeException("更新库存失败"); @@ -295,11 +299,13 @@ public class TypeServiceImpl implements ITypeService { }else{ type.setInputType(1); } + type.setCompanyId(deptId); typeMapper.insertBmStorageNumLog(type); } } catch (Exception e) { type.setResultMsg("操作失败"); type.setStatus(1); + type.setCompanyId(deptId); typeMapper.insertBmStorageNumLog(type); throw new RuntimeException("更新库存失败"); }