|
@@ -11,6 +11,7 @@ import com.boman.common.core.utils.sql.SqlUtil;
|
|
|
import com.boman.common.core.web.page.PageDomain;
|
|
|
import com.boman.common.core.web.page.TableSupport;
|
|
|
import com.boman.domain.SysDept;
|
|
|
+import com.boman.domain.SysRole;
|
|
|
import com.boman.domain.dto.AjaxResult;
|
|
|
import com.boman.system.api.RemoteDeptService;
|
|
|
import com.boman.system.api.RemoteDictDataService;
|
|
@@ -33,6 +34,8 @@ import org.springframework.transaction.annotation.Isolation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import javax.validation.constraints.NotBlank;
|
|
|
+import javax.validation.constraints.Size;
|
|
|
import java.sql.Timestamp;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -115,6 +118,16 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
|
|
|
Long deptId = vaccineInfoOperation.getDeptId();
|
|
|
if (deptId == null) {
|
|
|
deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
|
|
|
+ //判断是否是管理员
|
|
|
+ List<SysRole> roles = AuthUtils.getLoginUser().getSysUser().getRoles();
|
|
|
+ if (roles.size() > 0) {
|
|
|
+ for (SysRole role : roles) {
|
|
|
+ String roleKey = role.getRoleKey();
|
|
|
+ if ("admin".equals(roleKey) || "city".equals(roleKey)) {
|
|
|
+ deptId = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
Map<String, Object> params = vaccineInfoOperation.getParams();
|
|
|
if (params != null) {
|
|
@@ -155,15 +168,18 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
|
|
|
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
|
|
PageHelper.startPage(pageNum, pageSize, orderBy);
|
|
|
}
|
|
|
- List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(deptId);
|
|
|
- List<Long> deptIdList = new ArrayList<>();
|
|
|
- if (sysDepts != null && sysDepts.size() > 0) {
|
|
|
- for (SysDept sysDept : sysDepts) {
|
|
|
- Long id = sysDept.getId();
|
|
|
- deptIdList.add(id);
|
|
|
+
|
|
|
+ if (deptId != null){
|
|
|
+ List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(deptId);
|
|
|
+ List<Long> deptIdList = new ArrayList<>();
|
|
|
+ if (sysDepts != null && sysDepts.size() > 0) {
|
|
|
+ for (SysDept sysDept : sysDepts) {
|
|
|
+ Long id = sysDept.getId();
|
|
|
+ deptIdList.add(id);
|
|
|
+ }
|
|
|
}
|
|
|
+ vaccineInfoOperation.setDeptIdList(deptIdList);
|
|
|
}
|
|
|
- vaccineInfoOperation.setDeptIdList(deptIdList);
|
|
|
LOGGER.info("查询开始");
|
|
|
vaccineInfoOperations = vaccineInfoMapper.selectVaccineInfoList(vaccineInfoOperation);
|
|
|
LOGGER.info("查询结束");
|