Merge branch 'dev'

This commit is contained in:
wangliwen 2022-12-10 15:46:12 +08:00
commit 1f72d75871
4 changed files with 23 additions and 3 deletions

View File

@ -99,12 +99,18 @@ public class ActTaskController {
})
// @RequiresPermissions("sys:task:all")
public Result<PageData<TaskDTO>> myToDoTaskPage(@ApiIgnore @RequestParam Map<String, Object> params) {
params.put("userId", SecurityUser.getUserId().toString());
String userId = SecurityUser.getUserId().toString();
params.put("userId", userId);
PageData<TaskDTO> page = actTaskService.page(params);
for (TaskDTO taskDTO : page.getList()) {
if (!StringUtils.isEmpty(taskDTO.getAssignee())) {
SysUserDTO userDTO = sysUserService.get(Long.valueOf(taskDTO.getAssignee()));
taskDTO.setAssigneeName(userDTO.getRealName());
if (userId.equals(taskDTO.getAssignee())) {
taskDTO.setSynergism(Boolean.FALSE);
} else {
taskDTO.setSynergism(Boolean.FALSE);
}
}
}

View File

@ -100,6 +100,8 @@ public class TaskDTO {
@ApiModelProperty(value = "提供部门")
private String provideDept;
@ApiModelProperty(value = "是否为审核组内协助任务")
private Boolean synergism;
@Override

View File

@ -1,6 +1,5 @@
package io.renren.modules.sys.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -28,12 +27,12 @@ import io.renren.modules.sys.enums.JhDeptsEnum;
import io.renren.modules.sys.enums.SuperAdminEnum;
import io.renren.modules.sys.service.*;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.ObjectUtils;
import org.h2.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -78,6 +77,8 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
@Value("${spring.datasource.druid.password}")
private String password;
static final String sysUserDTOByIdKey = "SysUserDTOById";
private static final Logger logger = LoggerFactory.getLogger(SysUserController.class);
@ -125,6 +126,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
}
@Override
@Cacheable(value = sysUserDTOByIdKey, key = "#p0")
public SysUserDTO get(Long id) {
SysUserEntity entity = baseDao.getById(id);

View File

@ -100,4 +100,14 @@
diskPersistent="true"
memoryStoreEvictionPolicy="LRU"/>
<!-- SysUserDTOById缓存 -->
<cache name="SysUserDTOById"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="6"
timeToLiveSeconds="30"
overflowToDisk="true"
diskPersistent="true"
memoryStoreEvictionPolicy="LRU"/>
</ehcache>