|
|
|
@ -56,10 +56,12 @@ import io.renren.modules.security.user.UserDetail;
|
|
|
|
|
import io.renren.modules.sys.dao.SysDeptDao;
|
|
|
|
|
import io.renren.modules.sys.dao.SysRegionDao;
|
|
|
|
|
import io.renren.modules.sys.dto.SysDeptDTO;
|
|
|
|
|
import io.renren.modules.sys.dto.SysRoleDTO;
|
|
|
|
|
import io.renren.modules.sys.dto.SysUserDTO;
|
|
|
|
|
import io.renren.modules.sys.entity.SysDeptEntity;
|
|
|
|
|
import io.renren.modules.sys.enums.SuperAdminEnum;
|
|
|
|
|
import io.renren.modules.sys.service.SysDeptService;
|
|
|
|
|
import io.renren.modules.sys.service.SysRoleService;
|
|
|
|
|
import io.renren.modules.sys.service.SysUserService;
|
|
|
|
|
import lombok.SneakyThrows;
|
|
|
|
|
import okhttp3.*;
|
|
|
|
@ -167,6 +169,17 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|
|
|
|
@Value("${big_date.name}")
|
|
|
|
|
private String bigDataDeptName;
|
|
|
|
|
|
|
|
|
|
@Value("${big_date.assignee_role_name}")
|
|
|
|
|
private String roleName0; // 具备审批的角色名称(普通)
|
|
|
|
|
|
|
|
|
|
@Value("${big_date.assignee_district_role_name}")
|
|
|
|
|
private String roleName1; // 具备审批的角色名称(区县)
|
|
|
|
|
@Value("${big_date.assignee_city_role_name}")
|
|
|
|
|
private String roleName2; // 具备审批的角色名称(市区)
|
|
|
|
|
|
|
|
|
|
@Value("${big_date.assignee_meet_role_id}")
|
|
|
|
|
private String defaultAssigneeRoleId; // 会客厅审核人角色
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ResourceDao resourceDao;
|
|
|
|
|
|
|
|
|
@ -255,6 +268,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|
|
|
|
@Autowired
|
|
|
|
|
private TDemandDataDao tDemandDataDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private SysRoleService sysRoleService;
|
|
|
|
|
|
|
|
|
|
private JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate();
|
|
|
|
|
|
|
|
|
|
private static final String getAllsql = "SELECT " +
|
|
|
|
@ -290,13 +306,13 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|
|
|
|
wrapper.eq("type", params.get("type").toString());
|
|
|
|
|
break;
|
|
|
|
|
case "name":
|
|
|
|
|
wrapper.like(StringUtils.isNotBlank(params.get("name").toString()), "name", params.get("name").toString());
|
|
|
|
|
wrapper.like(org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("name").toString()), "name", params.get("name").toString());
|
|
|
|
|
break;
|
|
|
|
|
case "creator":
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(params.get("creator").toString()), "creator", params.get("creator").toString());
|
|
|
|
|
wrapper.eq(org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("creator").toString()), "creator", params.get("creator").toString());
|
|
|
|
|
break;
|
|
|
|
|
case "deptId":
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(params.get("deptId").toString()), "dept_id", Long.parseLong(params.get("deptId").toString()));
|
|
|
|
|
wrapper.eq(org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("deptId").toString()), "dept_id", Long.parseLong(params.get("deptId").toString()));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
@ -499,6 +515,22 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|
|
|
|
resourceDTO.setCreator(SecurityUser.getUser().getId());
|
|
|
|
|
Integer pageNum = jsonObject.getInteger("pageNum");
|
|
|
|
|
Integer pageSize = jsonObject.getInteger("pageSize");
|
|
|
|
|
// 2022.12.16 后台过滤只出所属区域资源
|
|
|
|
|
Boolean region = jsonObject.containsKey("region") ? jsonObject.getBooleanValue("region") : false; // 是否需要过滤只出用户所属区域资源
|
|
|
|
|
if (region) {
|
|
|
|
|
UserDetail user = SecurityUser.getUser(); // 当前用户
|
|
|
|
|
if (SuperAdminEnum.YES.value() != user.getSuperAdmin()) { // 非超级管理员
|
|
|
|
|
Optional<SysUserDTO> userDTOOptional = Optional.ofNullable(sysUserService.get(user.getId()));
|
|
|
|
|
SysRoleDTO roleDTO0 = sysRoleService.getByName(roleName0);
|
|
|
|
|
SysRoleDTO roleDTO1 = sysRoleService.getByName(roleName1);
|
|
|
|
|
SysRoleDTO roleDTO2 = sysRoleService.getByName(roleName2);
|
|
|
|
|
userDTOOptional.ifPresent(userDto -> {
|
|
|
|
|
if (userDto.getDeptId() != null) {
|
|
|
|
|
SysDeptEntity sysDeptEntity = sysDeptDao.getById(userDto.getDeptId());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Boolean nonChinese = jsonObject.containsKey("nonChinese") ? jsonObject.getBoolean("nonChinese") : Boolean.FALSE; // 不传默认为中文走全文索引
|
|
|
|
|
//默认按上架时间降序排列
|
|
|
|
|
String orderField;
|
|
|
|
|