dev_xd
姜玉琦 2025-08-29 16:38:17 +08:00
commit be04af44ee
3 changed files with 83 additions and 23 deletions

View File

@ -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<SysDictData> 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<SysDictData> dictList = arrayCache.toList(SysDictData.class);
List<SysDictData> 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<SysDictData> dictList = arrayCache.toList(SysDictData.class);
List<SysDictData> 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;
}
}
}

View File

@ -21,8 +21,32 @@
<if test="startComName != null and startComName != ''"> and fa.startComName like concat('%', #{startComName}, '%')</if>
<if test="startProId != null and startProId != ''"> and fa.startProId = #{startProId}</if>
<if test="startProName != null and startProName != ''"> and fa.startProName like concat('%', #{startProName}, '%')</if>
<if test='activeTags == "await"'> and fa.finishTime is null</if>
<if test='activeTags == "finished"'> and fa.finishTime is not null</if>
<choose>
<when test='activeTags == "depts"'> and fa.category = '1'</when>
<when test='activeTags == "users"'> and fa.category in ('2','3','4','5','6','8')</when>
</choose>
<if test="groupIds != null and groupIds.size()>0">
and bus.sub_dept_group in
<foreach collection="groupIds" item="groupId" open="(" separator="," close=")">
#{groupId}
</foreach>
</if>
<if test="assigneeId != null and roleIds != null and roleIds.size()>0">
AND (fa.ASSIGNEE_ = #{assigneeId}
OR (
fa.ASSIGNEE_ IS NULL
AND (
fa.USER_ID_ = #{assigneeId}
OR (
fa.GROUP_ID_ IN
<foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
)
)
)
)
</if>
</where>
order by fa.createTime desc
</select>
@ -54,12 +78,16 @@
<!--查询我的代办任务-->
<select id="selectMyAwaitFlowTask" parameterType="FlowTaskEntity" resultType="Map">
select fa.*
<if test='activeTags == "depts"'>, sud.business_license_path as businessImg, bus.sub_dept_name as businessMk1, sdd.dict_label as businessMk2, sud.sub_dept_code as businessMk3</if>
<if test='activeTags == "users"'>, bus.user_picture as businessImg, bus.card_code as businessMk1, sdd.dict_label as businessMk2, bus.sub_dept_name as businessMk3</if>
from vw_flow_await fa
<if test='activeTags == "depts"'> left join pro_project_info_subdepts_users bus on bus.id = fa.businessKey left join pro_project_info_subdepts sud on sud.id = bus.sub_dept_id left join sys_dict_data sdd on sdd.dict_value = bus.sub_dept_type and sdd.dict_type='sub_dept_type' </if>
<if test='activeTags == "users" or (groupIds != null and groupIds.size()>0)'> left join pro_project_info_subdepts_users bus on bus.id = fa.businessKey left join sys_dict_data sdd on sdd.dict_value = bus.craft_post and sdd.dict_type='pro_craft_post'</if>
where
<choose>
<when test='activeTags == "depts"'>, sud.business_license_path as businessImg, bus.sub_dept_name as businessMk1, sdd.dict_label as businessMk2, sud.sub_dept_code as businessMk3</when>
<when test='activeTags == "users"'>, bus.user_picture as businessImg, bus.card_code as businessMk1, sdd.dict_label as businessMk2, bus.sub_dept_name as businessMk3</when>
</choose>
from vw_flow_await fa
<choose>
<when test='activeTags == "depts"'> left join pro_project_info_subdepts_users bus on bus.id = fa.businessKey left join pro_project_info_subdepts sud on sud.id = bus.sub_dept_id left join sys_dict_data sdd on sdd.dict_value = bus.sub_dept_type and sdd.dict_type='sub_dept_type' </when>
<when test='activeTags == "users" or (groupIds != null and groupIds.size()>0)'> left join pro_project_info_subdepts_users bus on bus.id = fa.businessKey left join sys_dict_data sdd on sdd.dict_value = bus.craft_post and sdd.dict_type='pro_craft_post'</when>
</choose>
where
fa.taskName != '申请人提交'
<if test="procDefName != null and procDefName != ''"> and fa.procDefName like concat('%', #{procDefName}, '%')</if>
<if test="businessKey != null and businessKey != ''"> and fa.businessKey = #{businessKey}</if>

View File

@ -1100,11 +1100,14 @@ public class AttendanceJgwTask {
* @return
*/
private String getPhoto(String appId, String token, String proPackage, String datePath, String photo) {
try {
MultipartFile multipartFile = FileUtils.downloadFileToMultipart("https://gymspic1.oss-cn-shanghai.aliyuncs.com/"+photo);
return remoteFileService.dirDatePathUploadFile(proPackage,"jgw",datePath, multipartFile).getData().getUrl();
}catch (Exception e){
e.printStackTrace();
String[] sits="https://gymspic1.oss-cn-shanghai.aliyuncs.com/,https://oss.gongyoumishu.com/".split(",");
for(String sit:sits) {
try {
MultipartFile multipartFile = FileUtils.downloadFileToMultipart(sit + photo);
return remoteFileService.dirDatePathUploadFile(proPackage, "jgw", datePath, multipartFile).getData().getUrl();
} catch (Exception e) {
e.printStackTrace();
}
}
/**try {
String path = "/webapi/dictInfo/getPhoyoAllPaths";