库存调整记录调整人改为存名字;

This commit is contained in:
王奎兴
2026-03-03 13:37:54 +08:00
parent d90d905ca3
commit 2248325be0
3 changed files with 15 additions and 21 deletions
@@ -3,6 +3,7 @@ package com.mhd.wms.domain.handoverTaskOrder.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.exception.ServiceException; import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.OrderSequence; import com.mhd.common.core.utils.OrderSequence;
import com.mhd.common.core.utils.bean.BeanUtils; import com.mhd.common.core.utils.bean.BeanUtils;
@@ -271,7 +272,8 @@ public class HandoverTaskOrderDomainService {
inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId()); inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId()); inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname()); UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date()); inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventoryPO.getAllocationQuantity()); inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventoryPO.getAllocationQuantity());
inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventoryPO.getAllocationQuantity()); inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventoryPO.getAllocationQuantity());
@@ -279,9 +281,6 @@ public class HandoverTaskOrderDomainService {
inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity); inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(oldInventoryQuantity); inventoryAdjustmentRecord.setInventoryBeforeQuantity(oldInventoryQuantity);
inventoryAdjustmentRecord.setInventoryAfterQuantity(newInventoryQuantity); inventoryAdjustmentRecord.setInventoryAfterQuantity(newInventoryQuantity);
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord); inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
} }
} }
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mhd.common.core.constant.SnowFlakeConstants; import com.mhd.common.core.constant.SnowFlakeConstants;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.exception.ServiceException; import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.IgnoreNullUtil; import com.mhd.common.core.utils.IgnoreNullUtil;
import com.mhd.common.core.utils.StringUtils; import com.mhd.common.core.utils.StringUtils;
@@ -484,7 +485,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId()); inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId()); inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname()); UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date()); inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity); inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity);
inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity); inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity);
@@ -492,9 +494,6 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity); inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventoryPO.getInventoryQuantity()); inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryPO.getInventoryQuantity()); inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord); inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
} }
/*Long uniqueId = outMaterialDetail.getUniqueId(); /*Long uniqueId = outMaterialDetail.getUniqueId();
@@ -569,7 +568,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId()); inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId()); inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname()); UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date()); inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity); inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity);
inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity); inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity);
@@ -804,7 +804,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId()); inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId()); inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname()); UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date()); inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity); inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity);
inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity); inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity);
@@ -812,9 +813,6 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity); inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventoryPO.getInventoryQuantity()); inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryPO.getInventoryQuantity()); inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord); inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
} }
@@ -880,7 +878,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId()); inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId()); inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname()); UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date()); inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity); inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity);
inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity); inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity);
@@ -888,9 +887,6 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity); inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventoryPO.getInventoryQuantity()); inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryPO.getInventoryQuantity()); inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord); inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
} }
} }
@@ -8,6 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mhd.common.core.constant.SnowFlakeConstants; import com.mhd.common.core.constant.SnowFlakeConstants;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.exception.ServiceException; import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.OrderSequence; import com.mhd.common.core.utils.OrderSequence;
import com.mhd.common.core.utils.StringUtils; import com.mhd.common.core.utils.StringUtils;
@@ -729,7 +730,8 @@ public class StockShelfOrderDomainService {
inventoryAdjustmentRecord.setStorageSectionId(materialInventory.getStorageSectionId()); inventoryAdjustmentRecord.setStorageSectionId(materialInventory.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId()); inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname()); UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date()); inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity()); inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity());
inventoryAdjustmentRecord.setAllocationBeforeQuantity(BigDecimal.ZERO); inventoryAdjustmentRecord.setAllocationBeforeQuantity(BigDecimal.ZERO);
@@ -737,9 +739,6 @@ public class StockShelfOrderDomainService {
inventoryAdjustmentRecord.setFreezeAfterQuantity(BigDecimal.ZERO); inventoryAdjustmentRecord.setFreezeAfterQuantity(BigDecimal.ZERO);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO); inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO);
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity()); inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord); inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
} else if (materialInventoryPOS.size() == 1) { } else if (materialInventoryPOS.size() == 1) {
MaterialInventory materialInventory = new MaterialInventory(); MaterialInventory materialInventory = new MaterialInventory();