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