|
@@ -30,12 +30,12 @@ public class SysAsyncTaskServiceImpl extends ServiceImpl<SysAsyncTaskMapper, Sys
|
|
private final ISysConfigService sysConfigService;
|
|
private final ISysConfigService sysConfigService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Long getId(String userId, String userName, String funcType) {
|
|
|
|
|
|
+ public Long getId(String userName, String funcType) {
|
|
int limit = Integer.parseInt(sysConfigService.selectConfigByKey("sys.async.operationLimit"));
|
|
int limit = Integer.parseInt(sysConfigService.selectConfigByKey("sys.async.operationLimit"));
|
|
Calendar c = Calendar.getInstance();
|
|
Calendar c = Calendar.getInstance();
|
|
c.setTime(new Date());
|
|
c.setTime(new Date());
|
|
c.add(Calendar.HOUR, -1);
|
|
c.add(Calendar.HOUR, -1);
|
|
- Integer count = baseMapper.getCountByUserIdAndFuncTypeAndCreateTime(userId, funcType, c.getTime());
|
|
|
|
|
|
+ Integer count = baseMapper.getCountByUserIdAndFuncTypeAndCreateTime(userName, funcType, c.getTime());
|
|
if (count != null && count >= limit) {
|
|
if (count != null && count >= limit) {
|
|
throw new CustomException("暂时无法开启异步任务");
|
|
throw new CustomException("暂时无法开启异步任务");
|
|
}
|
|
}
|