|
|
@@ -214,9 +214,12 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
|
|
// 先判断该对象有无父级ID,有则意味着不是最高级,否则意味着是最高级
|
|
|
// 获取父级ID
|
|
|
String parentId = sysDepart.getParentId();
|
|
|
- if(!departMapper.selectList(Wrappers.<SysDepart>lambdaQuery()
|
|
|
- .eq(SysDepart::getParentId, sysDepart.getParentId())).isEmpty()){
|
|
|
+ if(sysDepart.getOrgCategory().equals("10")){
|
|
|
sysDepart.setSystemType(1);
|
|
|
+ }else if(sysDepart.getOrgCategory().equals("20")){
|
|
|
+ sysDepart.setSystemType(2);
|
|
|
+ }else if(sysDepart.getOrgCategory().equals("30")){
|
|
|
+ sysDepart.setSystemType(2);
|
|
|
}
|
|
|
//update-begin--Author:baihailong Date:20191209 for:部门编码规则生成器做成公用配置
|
|
|
JSONObject formData = new JSONObject();
|
|
|
@@ -484,6 +487,14 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean updateDepartDataById(SysDepart sysDepart, String username) {
|
|
|
if (sysDepart != null && username != null) {
|
|
|
+ if (oConvertUtils.isEmpty(sysDepart.getParentId())) {
|
|
|
+ sysDepart.setParentId("");
|
|
|
+ sysDepart.setSystemType(0);
|
|
|
+ }
|
|
|
+ switch (sysDepart.getOrgCategory()) {
|
|
|
+ case "10" -> sysDepart.setSystemType(1);
|
|
|
+ case "20", "30" -> sysDepart.setSystemType(2);
|
|
|
+ }
|
|
|
sysDepart.setUpdateTime(new Date());
|
|
|
sysDepart.setUpdateBy(username);
|
|
|
this.updateById(sysDepart);
|