diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/security/utils/DictUtils.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/security/utils/DictUtils.java index a41e838b..51710824 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/security/utils/DictUtils.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/security/utils/DictUtils.java @@ -4,6 +4,7 @@ import java.util.Collection; import java.util.List; import java.util.Objects; +import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.yanzhu.api.domain.SysDictData; import com.yanzhu.common.core.constant.CacheConstants; @@ -37,10 +38,18 @@ public class DictUtils */ public static List getDictCache(String key) { - JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(getCacheKey(key)); - if (StringUtils.isNotNull(arrayCache)) + Object cacheObject = SpringUtils.getBean(RedisService.class).getCacheObject(getCacheKey(key)); + if (StringUtils.isNotNull(cacheObject)) { - return arrayCache.toList(SysDictData.class); + // 使用 FastJSON2 进行反序列化,避免 Jackson 序列化问题 + if (cacheObject instanceof JSONArray) { + return ((JSONArray) cacheObject).toList(SysDictData.class); + } else if (cacheObject instanceof String) { + return JSON.parseArray((String) cacheObject, SysDictData.class); + } else { + // 如果是其他类型,尝试直接转换 + return JSON.parseArray(JSON.toJSONString(cacheObject), SysDictData.class); + } } return null; } @@ -53,10 +62,20 @@ public class DictUtils */ public static SysDictData getDictCache(String key, String value) { - JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(getCacheKey(key)); - if (StringUtils.isNotNull(arrayCache)) + Object cacheObject = SpringUtils.getBean(RedisService.class).getCacheObject(getCacheKey(key)); + if (StringUtils.isNotNull(cacheObject)) { - List dictList = arrayCache.toList(SysDictData.class); + List dictList; + // 使用 FastJSON2 进行反序列化,避免 Jackson 序列化问题 + if (cacheObject instanceof JSONArray) { + dictList = ((JSONArray) cacheObject).toList(SysDictData.class); + } else if (cacheObject instanceof String) { + dictList = JSON.parseArray((String) cacheObject, SysDictData.class); + } else { + // 如果是其他类型,尝试直接转换 + dictList = JSON.parseArray(JSON.toJSONString(cacheObject), SysDictData.class); + } + for(SysDictData dictData:dictList){ if(Objects.equals(value,dictData.getDictValue())){ return dictData; @@ -74,10 +93,20 @@ public class DictUtils */ public static String getDictLabel(String key, String value) { - JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(getCacheKey(key)); - if (StringUtils.isNotNull(arrayCache)) + Object cacheObject = SpringUtils.getBean(RedisService.class).getCacheObject(getCacheKey(key)); + if (StringUtils.isNotNull(cacheObject)) { - List dictList = arrayCache.toList(SysDictData.class); + List dictList; + // 使用 FastJSON2 进行反序列化,避免 Jackson 序列化问题 + if (cacheObject instanceof JSONArray) { + dictList = ((JSONArray) cacheObject).toList(SysDictData.class); + } else if (cacheObject instanceof String) { + dictList = JSON.parseArray((String) cacheObject, SysDictData.class); + } else { + // 如果是其他类型,尝试直接转换 + dictList = JSON.parseArray(JSON.toJSONString(cacheObject), SysDictData.class); + } + for(SysDictData dictData:dictList){ if(Objects.equals(value,dictData.getDictValue())){ return dictData.getDictLabel(); @@ -116,4 +145,4 @@ public class DictUtils { return CacheConstants.SYS_DICT_KEY + configKey; } -} +} \ No newline at end of file diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml index a74e36f8..2c3ce1db 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml @@ -21,8 +21,32 @@ and fa.startComName like concat('%', #{startComName}, '%') and fa.startProId = #{startProId} and fa.startProName like concat('%', #{startProName}, '%') - and fa.finishTime is null - and fa.finishTime is not null + + and fa.category = '1' + and fa.category in ('2','3','4','5','6','8') + + + and bus.sub_dept_group in + + #{groupId} + + + + AND (fa.ASSIGNEE_ = #{assigneeId} + OR ( + fa.ASSIGNEE_ IS NULL + AND ( + fa.USER_ID_ = #{assigneeId} + OR ( + fa.GROUP_ID_ IN + + #{roleId} + + ) + ) + ) + ) + order by fa.createTime desc @@ -54,12 +78,16 @@