diff --git a/mailbox-common/src/main/java/com/biutag/entity/system/Dept.java b/mailbox-common/src/main/java/com/biutag/entity/system/Dept.java index 87581cb..171dae5 100644 --- a/mailbox-common/src/main/java/com/biutag/entity/system/Dept.java +++ b/mailbox-common/src/main/java/com/biutag/entity/system/Dept.java @@ -27,8 +27,9 @@ public class Dept implements Serializable { @ApiModelProperty("部门全称") private String fullName; - @ApiModelProperty("负责人名") - private String duty; + + @ApiModelProperty("唯一id") + private String uuid; @ApiModelProperty("联系电话") private String mobile; @@ -41,7 +42,7 @@ public class Dept implements Serializable { private String category; @ApiModelProperty("层级") - private String level; + private Integer level; @ApiModelProperty("部门路径") private String pathTrace; diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java index 8fd0237..e1255ba 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java @@ -18,6 +18,7 @@ import com.biutag.mapper.system.DeptMapper; import com.biutag.util.ListUtils; import com.biutag.util.StringUtils; import com.biutag.util.TimeUtils; +import com.biutag.util.ToolUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -157,18 +158,41 @@ class DeptServiceImpl implements IDeptService { Assert.isNull(Dept, "顶级部门只允许有一个"); } - + Dept pDept = deptMapper.selectOne( + new QueryWrapper() + .select("id,pid,name,level,path_trace") + .eq("id", createValidate.getPid()) + .eq("is_delete", 0) + .last("limit 1")); + Assert.notNull(pDept, "上级部门不存在"); Dept model = new Dept(); model.setPid(createValidate.getPid()); model.setName(createValidate.getName()); - //model.setDuty(createValidate.getDuty()); + model.setLevel(pDept.getLevel()+1); + String uuid=ToolUtils.makeUUID(); + model.setUuid(uuid); model.setMobile(createValidate.getMobile()); model.setCategory(createValidate.getCategory()); model.setSort(createValidate.getSort()); model.setIsStop(createValidate.getIsStop()); model.setCreateTime(System.currentTimeMillis() / 1000); model.setUpdateTime(System.currentTimeMillis() / 1000); + if(model.getLevel()>=2){ + model.setFullName(pDept.getName()+createValidate.getName()); + }else { + model.setFullName(createValidate.getName()); + } deptMapper.insert(model); + Dept insertDept = deptMapper.selectOne( + new QueryWrapper() + .select(Dept.class, info -> + !info.getColumn().equals("is_delete") && + !info.getColumn().equals("delete_time")) + .eq("uuid",uuid) + .eq("is_delete", 0) + .last("limit 1")); + insertDept.setPathTrace(pDept.getPathTrace()+","+insertDept.getId()); + deptMapper.updateById(insertDept); } /** @@ -189,9 +213,22 @@ class DeptServiceImpl implements IDeptService { .last("limit 1")); Assert.notNull(model, "部门不存在"); + Dept pDept = deptMapper.selectOne( + new QueryWrapper() + .select("id,pid,name,level,path_trace") + .eq("id", updateValidate.getPid()) + .eq("is_delete", 0) + .last("limit 1")); + Assert.notNull(pDept, "上级部门不存在"); Assert.isFalse((model.getPid().equals(0) && updateValidate.getPid()>0), "顶级部门不能修改上级"); Assert.isFalse(updateValidate.getId().equals(updateValidate.getPid()), "上级部门不能是自己"); - + model.setLevel(pDept.getLevel()+1); + if(model.getLevel()>=2){ + model.setFullName(pDept.getName()+updateValidate.getName()); + }else { + model.setFullName(updateValidate.getName()); + } + model.setPathTrace(pDept.getPathTrace()+","+updateValidate.getId()); model.setPid(updateValidate.getPid()); model.setName(updateValidate.getName()); model.setCategory(updateValidate.getCategory()); @@ -231,7 +268,7 @@ class DeptServiceImpl implements IDeptService { PoliceUser PoliceUser = policeUserMapper.selectOne(new QueryWrapper() .select("id,nickname") - .eq("dept_id", id) + .eq("dept_ids", id) .eq("is_delete", 0) .last("limit 1")); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/IndexServiceImpl.java b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/IndexServiceImpl.java index 025f9d7..d82f682 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/IndexServiceImpl.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/IndexServiceImpl.java @@ -25,34 +25,20 @@ public class IndexServiceImpl implements IIndexService { // 版本信息 Map version = new LinkedHashMap<>(); - version.put("name", ConfigUtils.get("website", "name", "oumyye-Java")); version.put("version", GlobalConfig.version); - version.put("website", "www.oumyye.cn"); - version.put("based", "Vue3.x、ElementUI、MySQL"); + Map channel = new LinkedHashMap<>(); - channel.put("gitee", "https://gitee.com/oumyye/oumyye_java"); - channel.put("website", "https://www.oumyye.cn"); version.put("channel", channel); console.put("version", version); // 今日数据 Map today = new LinkedHashMap<>(); today.put("time", "2022-08-11 15:08:29"); - today.put("todayVisits", 10); // 访问量(人) - today.put("totalVisits", 100); // 总访问量 - today.put("todaySales", 30); // 销售额(元) - today.put("totalSales", 65); // 总销售额 - today.put("todayOrder", 12); // 订单量(笔) - today.put("totalOrder", 255); // 总订单量 - today.put("todayUsers", 120); // 新增用户 - today.put("totalUsers", 360); // 总访用户 console.put("today", today); // 访客图表 Map visitor = new LinkedHashMap<>(); - visitor.put("date", TimeUtils.daysAgoDate(15)); - visitor.put("list", Arrays.asList(12,13,11,5,8,22,14,9,456,62,78,12,18,22,46)); - console.put("visitor", visitor); + return console; } @@ -79,10 +65,10 @@ public class IndexServiceImpl implements IIndexService { map.put("ossDomain", UrlUtils.domain()); map.put("copyright", ListUtils.stringToListAsMapStr(copyright)); map.put("webName", "局长信箱后台管理"); - map.put("webLogo", "http://localhost:8082/api/static/backend_logo.png"); - map.put("webFavicon", "http://localhost:8082/api/static/backend_favicon.ico"); + map.put("webLogo", ""); +/* map.put("webFavicon", "http://localhost:8082/api/static/backend_favicon.ico"); map.put("webBackdrop", "http://localhost:8082/api/static/backend_backdrop.png"); - map.put("ossDomain", "http://localhost:8080/"); + map.put("ossDomain", "http://localhost:8080/");*/ // "webName": "oumyye开源后台", // "webLogo": , diff --git a/mailbox-lan/src/main/java/com/biutag/lan/vo/system/DeptVo.java b/mailbox-lan/src/main/java/com/biutag/lan/vo/system/DeptVo.java index 8e7a2a2..fed746f 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/vo/system/DeptVo.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/vo/system/DeptVo.java @@ -24,8 +24,8 @@ public class DeptVo implements Serializable { @ApiModelProperty(value = "部门全称") private String fullName; - @ApiModelProperty(value = "负责人") - private String duty; + @ApiModelProperty(value = "随机id") + private String uuid; @ApiModelProperty(value = "联系电话") private String mobile;