|
|
|
@ -2,13 +2,15 @@ package com.ruoyi.tc.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.ruoyi.common.core.domain.TreeSelect;
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
|
import com.ruoyi.common.utils.PasswordGenerator;
|
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
|
import com.ruoyi.tc.entity.AssetTask;
|
|
|
|
|
import com.ruoyi.tc.entity.Unit;
|
|
|
|
|
import com.ruoyi.tc.entity.request.GeneralQueryRequest;
|
|
|
|
|
import com.ruoyi.tc.entity.request.UnitRequest;
|
|
|
|
@ -17,6 +19,7 @@ import com.ruoyi.tc.service.UnitService;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -28,9 +31,13 @@ import java.util.List;
|
|
|
|
|
@Service
|
|
|
|
|
public class UnitServiceImpl extends ServiceImpl<UnitMapper, Unit> implements UnitService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ISysUserService userService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ISysDeptService iSysDeptService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页条件查询所有单位列表
|
|
|
|
|
*
|
|
|
|
@ -144,4 +151,32 @@ public class UnitServiceImpl extends ServiceImpl<UnitMapper, Unit> implements Un
|
|
|
|
|
return baseMapper.findBydwmc(part);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据资产类型返回组织架构
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<TreeSelect> getSchema(String type) {
|
|
|
|
|
List<SysDept> appSchema = new ArrayList<>();
|
|
|
|
|
switch (type) {
|
|
|
|
|
case "0":
|
|
|
|
|
appSchema = baseMapper.getWebSchema();
|
|
|
|
|
break;
|
|
|
|
|
case "1":
|
|
|
|
|
appSchema = baseMapper.getMiniSchema();
|
|
|
|
|
break;
|
|
|
|
|
case "2":
|
|
|
|
|
appSchema = baseMapper.getGzpSchema();
|
|
|
|
|
break;
|
|
|
|
|
case "3":
|
|
|
|
|
appSchema = baseMapper.getEmailSchema();
|
|
|
|
|
break;
|
|
|
|
|
case "4":
|
|
|
|
|
appSchema = baseMapper.getAppSchema();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return iSysDeptService.buildDeptTreeSelect(appSchema);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|