From d4874ef05f8b17659cc63d6a9c4f0452ab9e54cd Mon Sep 17 00:00:00 2001 From: zhanghan11 Date: Wed, 19 Jun 2024 09:00:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E5=8F=B7=E7=94=9F=E6=88=90=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=83=A8=E9=97=A8=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspur/spareparts/mapper/IpcSparePartsInboundMapper.java | 2 +- .../com/inspur/spareparts/mapper/IpcSparePartsInfoMapper.java | 2 +- .../spareparts/mapper/IpcSparePartsInventoryMapper.java | 2 +- .../inspur/spareparts/mapper/IpcSparePartsOutboundMapper.java | 2 +- .../inspur/spareparts/mapper/IpcSparePartsStockMapper.java | 4 ++-- .../service/impl/IpcSparePartsInboundServiceImpl.java | 4 ++-- .../spareparts/service/impl/IpcSparePartsInfoServiceImpl.java | 4 ++-- .../service/impl/IpcSparePartsInventoryServiceImpl.java | 2 +- .../service/impl/IpcSparePartsOutboundServiceImpl.java | 4 ++-- .../service/impl/IpcSparePartsStockServiceImpl.java | 4 ++-- .../mapper/spareparts/IpcSparePartsInboundMapper.xml | 1 + .../resources/mapper/spareparts/IpcSparePartsInfoMapper.xml | 1 + .../mapper/spareparts/IpcSparePartsInventoryMapper.xml | 1 + .../mapper/spareparts/IpcSparePartsOutboundMapper.xml | 1 + .../resources/mapper/spareparts/IpcSparePartsStockMapper.xml | 1 + 15 files changed, 20 insertions(+), 15 deletions(-) diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInboundMapper.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInboundMapper.java index 8557d16..e002433 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInboundMapper.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInboundMapper.java @@ -73,7 +73,7 @@ public interface IpcSparePartsInboundMapper * 获取最新入库单号 * @return */ - public int getInboundNum(); + public int getInboundNum(Long deptId); /** * 批量新增备件入库明细 diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInfoMapper.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInfoMapper.java index 7e9c626..702d6d1 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInfoMapper.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInfoMapper.java @@ -73,5 +73,5 @@ public interface IpcSparePartsInfoMapper * * @return 结果 */ - public int getPartsNum(); + public int getPartsNum(Long deptId); } diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInventoryMapper.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInventoryMapper.java index f5fe0c3..424ec6b 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInventoryMapper.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsInventoryMapper.java @@ -64,5 +64,5 @@ public interface IpcSparePartsInventoryMapper * * @return 结果 */ - public int getInventoryNum(); + public int getInventoryNum(Long deptId); } diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsOutboundMapper.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsOutboundMapper.java index ff811ae..b5db15f 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsOutboundMapper.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsOutboundMapper.java @@ -74,7 +74,7 @@ public interface IpcSparePartsOutboundMapper * 获取最新出库单号 * @return */ - public int getOutboundNum(); + public int getOutboundNum(Long deptId); /** * 批量新增备件出库明细 diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsStockMapper.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsStockMapper.java index 0db64c8..ac823f6 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsStockMapper.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/mapper/IpcSparePartsStockMapper.java @@ -50,7 +50,7 @@ public interface IpcSparePartsStockMapper * @return 结果 */ public int updateIpcSparePartsStockSafeQuantityBySparepartsId(IpcSparePartsStock ipcSparePartsStock); - + /** * 删除备件库存 * @@ -81,7 +81,7 @@ public interface IpcSparePartsStockMapper * * @return 结果 */ - public int getStockNum(); + public int getStockNum(Long deptId); /** * 库存更新 */ diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInboundServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInboundServiceImpl.java index 82e2456..0226b63 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInboundServiceImpl.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInboundServiceImpl.java @@ -86,7 +86,7 @@ public class IpcSparePartsInboundServiceImpl implements IIpcSparePartsInboundSer @Transactional public int insertIpcSparePartsInbound(IpcSparePartsInbound ipcSparePartsInbound) { ipcSparePartsInbound.setId(IdUtils.fastSimpleUUID()); - ipcSparePartsInbound.setSparePartsInboundNum(StringUtils.getNextNum(Constants.SPARE_PART_INBOUND_PREFIX, SecurityUtils.getDeptId(), ipcSparePartsInboundMapper.getInboundNum())); + ipcSparePartsInbound.setSparePartsInboundNum(StringUtils.getNextNum(Constants.SPARE_PART_INBOUND_PREFIX, SecurityUtils.getDeptId(), getInboundNum())); ipcSparePartsInbound.setSubmitTime(new Date()); ipcSparePartsInbound.setOperatorId(SecurityUtils.getUserId()); insertIpcSparePartsInboundDetail(ipcSparePartsInbound); @@ -166,7 +166,7 @@ public class IpcSparePartsInboundServiceImpl implements IIpcSparePartsInboundSer */ @Override public int getInboundNum() { - return ipcSparePartsInboundMapper.getInboundNum(); + return ipcSparePartsInboundMapper.getInboundNum(SecurityUtils.getDeptId()); } diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInfoServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInfoServiceImpl.java index 28b2f5d..f46e832 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInfoServiceImpl.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInfoServiceImpl.java @@ -60,7 +60,7 @@ public class IpcSparePartsInfoServiceImpl implements IIpcSparePartsInfoService { @Transactional public int insertIpcSparePartsInfo(IpcSparePartsInfo ipcSparePartsInfo) { ipcSparePartsInfo.setId(IdUtils.fastSimpleUUID()); - ipcSparePartsInfo.setPartsNum(StringUtils.getNextNum(Constants.SPARE_PART_NUM_PREFIX, SecurityUtils.getDeptId(), ipcSparePartsInfoMapper.getPartsNum())); + ipcSparePartsInfo.setPartsNum(StringUtils.getNextNum(Constants.SPARE_PART_NUM_PREFIX, SecurityUtils.getDeptId(), getPartsNum())); ipcSparePartsInfo.setStatus(Constants.SPARE_PART_STATUS_NORMAL); ipcSparePartsInfo.setCreateTime(DateUtils.getNowDate()); ipcSparePartsInfo.getIpcSparePartsStock().setSparePartsId(ipcSparePartsInfo.getId()); @@ -112,7 +112,7 @@ public class IpcSparePartsInfoServiceImpl implements IIpcSparePartsInfoService { */ @Override public int getPartsNum(){ - return ipcSparePartsInfoMapper.getPartsNum(); + return ipcSparePartsInfoMapper.getPartsNum(SecurityUtils.getDeptId()); } /** diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInventoryServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInventoryServiceImpl.java index e5cf8f9..84dd7ad 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInventoryServiceImpl.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsInventoryServiceImpl.java @@ -126,7 +126,7 @@ public class IpcSparePartsInventoryServiceImpl implements IIpcSparePartsInventor */ @Override public int getInventoryNum() { - return ipcSparePartsInventoryMapper.getInventoryNum(); + return ipcSparePartsInventoryMapper.getInventoryNum(SecurityUtils.getDeptId()); } /** diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsOutboundServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsOutboundServiceImpl.java index ad920e8..b9e4ff0 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsOutboundServiceImpl.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsOutboundServiceImpl.java @@ -84,7 +84,7 @@ public class IpcSparePartsOutboundServiceImpl implements IIpcSparePartsOutboundS @Transactional public int insertIpcSparePartsOutbound(IpcSparePartsOutbound ipcSparePartsOutbound) { ipcSparePartsOutbound.setId(IdUtils.fastSimpleUUID()); - ipcSparePartsOutbound.setSparePartsOutboundNum(StringUtils.getNextNum(Constants.SPARE_PART_OUTBOUND_PREFIX, SecurityUtils.getDeptId(), ipcSparePartsOutboundMapper.getOutboundNum())); + ipcSparePartsOutbound.setSparePartsOutboundNum(StringUtils.getNextNum(Constants.SPARE_PART_OUTBOUND_PREFIX, SecurityUtils.getDeptId(), getOutboundNum())); ipcSparePartsOutbound.setSubmitTime(new Date()); ipcSparePartsOutbound.setOperatorId(SecurityUtils.getUserId()); insertIpcSparePartsOutboundDetail(ipcSparePartsOutbound); @@ -165,7 +165,7 @@ public class IpcSparePartsOutboundServiceImpl implements IIpcSparePartsOutboundS */ @Override public int getOutboundNum() { - return ipcSparePartsOutboundMapper.getOutboundNum(); + return ipcSparePartsOutboundMapper.getOutboundNum(SecurityUtils.getDeptId()); } /** diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsStockServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsStockServiceImpl.java index 3ab9523..b26e1cc 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsStockServiceImpl.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/spareparts/service/impl/IpcSparePartsStockServiceImpl.java @@ -58,7 +58,7 @@ public class IpcSparePartsStockServiceImpl implements IIpcSparePartsStockService public int insertIpcSparePartsStock(IpcSparePartsStock ipcSparePartsStock) { ipcSparePartsStock.setId(IdUtils.fastSimpleUUID()); - ipcSparePartsStock.setStockNum(StringUtils.getNextNum(Constants.SPARE_PART_STOCK_PREFIX, SecurityUtils.getDeptId(), ipcSparePartsStockMapper.getStockNum())); + ipcSparePartsStock.setStockNum(StringUtils.getNextNum(Constants.SPARE_PART_STOCK_PREFIX, SecurityUtils.getDeptId(), getStockNum())); return ipcSparePartsStockMapper.insertIpcSparePartsStock(ipcSparePartsStock); } @@ -125,7 +125,7 @@ public class IpcSparePartsStockServiceImpl implements IIpcSparePartsStockService */ @Override public int getStockNum(){ - return ipcSparePartsStockMapper.getStockNum(); + return ipcSparePartsStockMapper.getStockNum(SecurityUtils.getDeptId()); } /** * 库存更新 diff --git a/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsInboundMapper.xml b/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsInboundMapper.xml index ddaafe4..edafb45 100644 --- a/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsInboundMapper.xml +++ b/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsInboundMapper.xml @@ -197,6 +197,7 @@ SELECT IFNULL(MAX(RIGHT (spare_parts_inbound_num, 4)), 0) + 0 FROM ipc_spare_parts_inbound WHERE DATE (SYSDATE()) = DATE (submit_time) + AND dept_id = #{deptId} diff --git a/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsInfoMapper.xml b/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsInfoMapper.xml index c82164c..7e4f941 100644 --- a/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsInfoMapper.xml +++ b/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsInfoMapper.xml @@ -190,6 +190,7 @@ FROM ipc_spare_parts_info WHERE status <> '2' AND DATE (SYSDATE()) = DATE (create_time) + AND dept_id = #{deptId} diff --git a/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsStockMapper.xml b/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsStockMapper.xml index 0035eca..dbf2456 100644 --- a/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsStockMapper.xml +++ b/zfipc-server/zfipc-system/src/main/resources/mapper/spareparts/IpcSparePartsStockMapper.xml @@ -103,6 +103,7 @@ inner join ipc_spare_parts_stock s on i.id = s.spare_parts_id WHERE i.status <> '2' AND DATE (SYSDATE()) = DATE (i.create_time) + AND s.dept_id = #{deptId} update ipc_spare_parts_stock