From 012184dfb4da0d4f2a12075ce6de9ea2c2ca39b8 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 23 Jul 2024 19:42:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E5=85=AC=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/system/service/impl/SysDeptServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysDeptServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysDeptServiceImpl.java index 868c2554..e19a3020 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysDeptServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysDeptServiceImpl.java @@ -203,14 +203,15 @@ public class SysDeptServiceImpl implements ISysDeptService { @Override public int insertCompanies(List list) { - int num = deptMapper.getMaxDeptId() + 1; - long nextMultiple = (int) Math.ceil((double) num / 100) * 100; + long num = deptMapper.getMaxDeptId()+1; for (SysDept dept : list) { dept.setCreateBy(SecurityUtils.getUsername()); dept.setParentId(0L); dept.setAncestors("0"); dept.setOrderNum(999); dept.setStatus("0"); + long nextMultiple = (int) Math.ceil((double) num / 100) * 100; + num = nextMultiple + 1; dept.setDeptId(nextMultiple); dept.setCompanyId(nextMultiple); }