1.西海岸-已申请列表查询

2.token过期时间改为可配置
3.亚伟通知消息bug修复
This commit is contained in:
dinggang 2022-11-21 17:58:19 +08:00
parent 8573da35eb
commit ffa2e6d93e
8 changed files with 48 additions and 30 deletions

View File

@ -19,6 +19,7 @@ import io.renren.modules.resourceBrowse.service.ResourceBrowseService;
import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.enums.SuperAdminEnum;
import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysUserService;
import io.swagger.annotations.Api;
@ -75,6 +76,8 @@ public class CensusController {
@Value("${census.applyType}")
private String[] censusApplyTypes; // 需要进行申请统计的资源类型
@Value("${big_date.name}")
private String bigDataDeptName;
/**
* 获取各类资源数目
@ -479,19 +482,18 @@ public class CensusController {
})
public Result selectCensusResourceTable(@RequestParam Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
if (user.getDeptId() != null) {
SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId());
//2022-11-21 修改为只有大数据局部门和admin账号能查看所有
if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) {
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
}
// else if (SuperAdminEnum.YES.value() == user.getSuperAdmin()) { // 超级管理员
//
// }
return new Result().ok(resourceService.selectCensusResourceTable(params));
}
@GetMapping("/exportSelectCensusResourceTable")
@ApiOperation("查询部门上架资源及审批结果详细信息")
@LogOperation("查询部门上架资源及审批结果详细信息")
@ApiOperation("导出部门上架资源及审批结果详细信息")
@LogOperation("导出部门上架资源及审批结果详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
@ -501,8 +503,10 @@ public class CensusController {
})
public void exportSelectCensusResourceTable(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException {
UserDetail user = SecurityUser.getUser();
if (user.getDeptId() != null) {
SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId());
//2022-11-21 修改为只有大数据局部门和admin账号能查看所有
if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) {
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
}
ArrayList<Map> resultList = (ArrayList<Map>) resourceDao.selectCensusResourceTable(params);
@ -560,13 +564,12 @@ public class CensusController {
})
public Result selectCensusApplyTable(@RequestParam Map<String, Object> params) {
UserDetail user = SecurityUser.getUser();
if (user.getDeptId() != null) {
SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId());
//2022-11-21 修改为只有大数据局部门和admin账号能查看所有
if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) {
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
}
// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员
//
// }
return new Result().ok(resourceService.selectCensusApplyTable(params));
}
@ -582,13 +585,12 @@ public class CensusController {
})
public void exportSelectCensusApplyTable(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException {
UserDetail user = SecurityUser.getUser();
if (user.getDeptId() != null) {
SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId());
//2022-11-21 修改为只有大数据局部门和admin账号能查看所有
if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) {
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
}
// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员
//
// }
ArrayList<Map> resultList = (ArrayList<Map>) resourceDao.selectCensusApplyTable(params);
List<List<Object>> date = resultList.stream().map(index -> {
List<Object> data = new ArrayList<>();

View File

@ -271,12 +271,17 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
exchangeCodes.append(ywMobile + ";");
}
}
if (userNames.charAt(userNames.length() - 1) == ';') {
userNames.deleteCharAt(userNames.length() - 1);
if (userGuids.length() <= 0 || userNames.length() <= 0) {
logger.info("未找到亚伟用户guid用户为{}", userNames);
return;
}
if (userGuids.charAt(userGuids.length() - 1) == ';') {
userGuids.deleteCharAt(userGuids.length() - 1);
}
if (userNames.charAt(userNames.length() - 1) == ';') {
userNames.deleteCharAt(userNames.length() - 1);
}
if (exchangeCodes.charAt(exchangeCodes.length() - 1) == ';') {
exchangeCodes.deleteCharAt(exchangeCodes.length() - 1);
}

View File

@ -460,7 +460,7 @@ public class TAbilityApplicationController {
return new Result().ok(tAbilityApplicationService.getApplyCameraList());
}
@GetMapping("/delApplyCamera")
@PostMapping("/delApplyCamera")
@ApiOperation("/西海岸-用户删除已申请摄像头")
@LogOperation("/西海岸-用户删除已申请摄像头")
public Result delApplyCamera(@RequestBody List<Long> ids) {

View File

@ -13,8 +13,10 @@ import io.renren.modules.security.user.UserDetail;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -29,6 +31,8 @@ import java.util.stream.Collectors;
@Service
public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityApplicationDao, TAbilityApplicationEntity, TAbilityApplicationDTO> implements TAbilityApplicationService {
private static final Logger logger = LoggerFactory.getLogger(TAbilityApplicationServiceImpl.class);
@Autowired
private TAbilityApplicationDao abilityApplicationDao;
@Override
@ -145,7 +149,8 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityAppl
public Object getApplyCameraList() {
UserDetail userDetail = SecurityUser.getUser();
String currentTime = DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN);
return abilityApplicationDao.getApplyCameraList(userDetail.getId(), currentTime);
List<Map> cameraList = abilityApplicationDao.getApplyCameraList(userDetail.getId(), currentTime);
return cameraList.isEmpty() ? new ArrayList<>() : cameraList;
}
@Override

View File

@ -159,6 +159,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Value("${zsk.catalogIds}")
private String[] catalogIds;
@Value("${big_date.name}")
private String bigDataDeptName;
@Autowired
private ResourceDao resourceDao;
@ -2129,10 +2132,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override
public Object selectApplyDeptDetailTypeCountList(Map params) {
UserDetail user = SecurityUser.getUser();
if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) {
SysDeptDTO sysDeptDTO = deptService.get(user.getDeptId());
if (user.getSuperAdmin() == SuperAdminEnum.YES.value() || bigDataDeptName.equals(sysDeptDTO.getName())) {
logger.info("管理员区域");
} else if (user.getDeptId() != null) {
SysDeptDTO sysDeptDTO = deptService.get(user.getDeptId());
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
logger.error("区域管理员只出本部门区域:{}", sysDeptDTO.getDistrict());
}
@ -2314,10 +2317,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override
public Object selectDeptDetailTypeCountList(Map params) {
UserDetail user = SecurityUser.getUser();
if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) {
SysDeptDTO sysDeptDTO = deptService.get(user.getDeptId());
if (user.getSuperAdmin() == SuperAdminEnum.YES.value() || bigDataDeptName.equals(sysDeptDTO.getName())) {
logger.info("管理员区域");
} else if (user.getDeptId() != null) {
SysDeptDTO sysDeptDTO = deptService.get(user.getDeptId());
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
logger.error("区域管理员只出本部门区域:{}", sysDeptDTO.getDistrict());
}

View File

@ -27,7 +27,8 @@ public class SysUserTokenServiceImpl extends BaseServiceImpl<SysUserTokenDao, Sy
/**
* 12小时后过期
*/
private final static int EXPIRE = 3600 * 12;
@Value("${system.tokenExpireTime}")
private int EXPIRE;
@Value("${system.allowSimultaneousLogin}")
private int allowSimultaneousLogin;
@ -99,7 +100,7 @@ public class SysUserTokenServiceImpl extends BaseServiceImpl<SysUserTokenDao, Sy
//当前时间
Date now = new Date();
//过期时间
Date expireTime = new Date(now.getTime() + EXPIRE * 1000);
Date expireTime = new Date(now.getTime() + EXPIRE * 3600000);
//判断是否生成过token
SysUserTokenEntity tokenEntity = baseDao.getByUserId(userId);

View File

@ -125,6 +125,8 @@ system:
resumeLogonTime: 2
#允许账号多地同时登录: 0(不允许), 1(允许)
allowSimultaneousLogin: 1
#token过期时间单位小时
tokenExpireTime: 12
yawei:
enable: true

View File

@ -326,7 +326,7 @@
</select>
<select id="getApplyCameraList" resultType="java.util.Map">
SELECT id, camera_list AS "cameraInfo", approve_status AS "approveStatus"
SELECT id, camera_list AS "cameraInfo", approve_status AS "approveStatus", instance_id AS "instanceId"
FROM t_ability_application taa
WHERE 1 = 1
AND del_flag = 0