Răsfoiți Sursa

单点登入接口调整恢复域名访问,增加更详细的log

wy 9 luni în urmă
părinte
comite
17181e9460

+ 1 - 2
ibps-oauth-root/modules/oauth-server2-default/src/main/java/com/lc/ibps/cloud/oauth/server/util/CustomerSingle.java

@@ -6,8 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 public enum CustomerSingle {
     //各家单点登入验证的的枚举
     //ZLYY("1001","深圳肿瘤","https://10.128.6.22:9074");
-    //ZLYY("1001","深圳肿瘤","https://ysh.szch-cn.com:9074"); //公网域名
-      ZLYY("1001","深圳肿瘤","https://10.128.6.22:9074");
+    ZLYY("1001","深圳肿瘤","https://ysh.szch-cn.com:9074"); //公网域名
 
     private String code;
 

+ 52 - 9
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/business/service/impl/ReformServiceImpl.java

@@ -17,6 +17,9 @@ import lombok.extern.log4j.Log4j2;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -182,14 +185,24 @@ public class ReformServiceImpl implements ReformService {
 
         // 部门权限文件
         // shi_fou_guo_shen_ in ('有效','使用')
-        String buMenSql = sql + " where wj.shi_fou_guo_shen_ in ('有效','使用') and  FIND_IN_SET(wj.quan_xian_xin_xi_ ,'%s') and FIND_IN_SET (wj.xi_lei_id_,'%s') ";
+        String buMenSql = sql + " where wj.shi_fou_guo_shen_ in ('有效','使用') and  qqwweerr and FIND_IN_SET (wj.xi_lei_id_,'%s') ";
         IPartyPositionService partyPositionService = AppUtil.getBean(IPartyPositionService.class);
         APIResult<List<PartyPositionPo>> result1 = partyPositionService.findByUserId(userId);
         if (result1.isFailed() || Collections.isEmpty(result1.getData())) {
             throw new IllegalArgumentException("buMen not match!");
         }
         String currBuMen = result1.getData().stream().map(PartyPositionTbl::getId).collect(Collectors.joining(","));
-        buMenSql = String.format(buMenSql , currBuMen , bmIds);
+        String[] split = currBuMen.split(",");
+        String buMenAtr = "";
+        for (String bu: split ) {
+            if(buMenAtr.length()<1){
+                buMenAtr = " wj.quan_xian_xin_xi_ like '%" + bu +"%' ";
+            }else{
+                buMenAtr = buMenAtr + " OR wj.quan_xian_xin_xi_ like '%" + bu +"%' ";
+            }
+        }
+        buMenSql = buMenSql.replace("qqwweerr"," (" + buMenAtr + ")");
+        buMenSql = String.format(buMenSql , bmIds);
         buMenSql = buMenSql + conditions + sorts;
         List<Map<String, Object>> buMenList = (List<Map<String, Object>>) commonDao.query(buMenSql);
 
@@ -201,17 +214,21 @@ public class ReformServiceImpl implements ReformService {
         String sxsql = "select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,wj.shu_ju_lai_yuan_ AS shu_ju_lai_yuan_,file.ext_ AS ext_,file.FILE_PATH_ AS file_path_," +
                 "  CONCAT(file.file_name_, '.', file.ext_, '(',CASE WHEN file.total_bytes_ >= 1024 * 1024 THEN CONCAT(ROUND(file.total_bytes_ / (1024.0 * 1024), 2), ' M') " +
                 "  WHEN file.total_bytes_ >= 1024 THEN CONCAT(ROUND(file.total_bytes_ / 1024.0, 2), ' K') ELSE CONCAT(file.total_bytes_, 'B') END , ')') as file_info_," +
-                "  wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,sq.cha_yue_jie_zhi_s, " +
-                "  wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,'' AS cha_yue_jie_zhi_s, " +
+                "  wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,sq.cha_yue_jie_zhi_s, " +
+                "  wj.fa_bu_shi_jian_ as fa_fang_shi_jian_, " +
                 "  wj.shi_fou_guo_shen_ AS shi_fou_guo_shen_, wj.bian_zhi_bu_men_ AS bian_zhi_bu_men_, " +
                 "  wj.bian_zhi_ren_ AS bian_zhi_ren_, " +
                 "  wj.bian_zhi_shi_jian AS bian_zhi_shi_jian, " +
                 "  wj.wen_jian_lei_xing AS wen_jian_lei_xing, " +
                 "  wj.quan_xian_lei_xin AS quan_xian_lei_xin, " +
-                "  wj.fa_bu_shi_jian_ AS fa_bu_shi_jian_,  " +
                 "  wj.poct_shi_yong_ AS shi_yong_bu_men_ " +
-                " FROM t_wjxxb wj " +
-                "  LEFT JOIN (SELECT * FROM t_skwjcysqsqzb WHERE parent_id_ in (SELECT id_ from t_skwjcysqsq WHERE shi_fou_guo_shen_='已完成' and bian_zhi_ren_='%s')) sq ON wj.id_ = sq.wen_jian_id_ " +
+                "  FROM t_wjxxb wj " +
+                "  LEFT JOIN (" +
+                "  SELECT a.* FROM t_skwjcysqsqzb a INNER JOIN ( SELECT wen_jian_id_, MAX(cha_yue_jie_zhi_s) as max_time FROM t_skwjcysqsqzb " +
+                "  WHERE parent_id_ IN ( SELECT id_ FROM t_skwjcysqsq WHERE shi_fou_guo_shen_ = '已完成' AND bian_zhi_ren_ = '%s' ) " +
+                "  GROUP BY wen_jian_id_  ) b ON a.wen_jian_id_ = b.wen_jian_id_ AND a.cha_yue_jie_zhi_s = b.max_time " +
+                "  WHERE a.parent_id_ IN (  SELECT id_ FROM t_skwjcysqsq WHERE shi_fou_guo_shen_ = '已完成' AND bian_zhi_ren_ = '%s' ) " +
+                "  ) sq ON wj.id_ = sq.wen_jian_id_ " +
                 "  left join (select id_,parent_id_ from t_wjcyjl group by parent_id_) cy on cy.parent_id_ = wj.id_ " +
                 "  left join (select id_,parent_id_ from t_wjscjl group by parent_id_) sc on sc.parent_id_ = wj.id_ " +
                 "  left join ibps_file_attachment file on file.id_ = wj.wen_jian_fu_jian_ WHERE wj.shi_fou_guo_shen_ = '有效' AND (%s OR %s " +
@@ -220,10 +237,36 @@ public class ReformServiceImpl implements ReformService {
                 "  IF( wjxdzb.zhu_shen_he_ren_ != '', wjxdzb.zhu_shen_he_ren_, NULL ), " +
                 "  IF( wjxdzb.zhu_shen_pi_ren_ != '', wjxdzb.zhu_shen_pi_ren_, NULL ) " +
                 "  ) LIKE '%%%s%%' ))  and FIND_IN_SET (wj.xi_lei_id_,'%s') ";
-        sxsql = String.format(sxsql, userId, ContextUtil.isSuper() , BeanUtils.isNotEmpty(roleMap) , userId , kzIds);
+        sxsql = String.format(sxsql, userId, userId, ContextUtil.isSuper() , BeanUtils.isNotEmpty(roleMap) , userId , kzIds);
         sxsql = sxsql + conditions + sorts;
         List<Map<String, Object>> limitLists = (List<Map<String, Object>>) commonDao.query(sxsql);
-        List<Map<String, Object>> mergedList = Stream.concat(Stream.concat(limitLists.stream(), buMenList.stream()),comList.stream()).collect(Collectors.toList());
+       // List<Map<String, Object>> mergedList = Stream.concat(Stream.concat(limitLists.stream(), buMenList.stream()),comList.stream()).collect(Collectors.toList());
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+        Comparator<Map<String, Object>> dateComparator = Comparator.comparing(
+                map -> {
+                    try {
+                        String dateStr = (String) map.get("bian_zhi_shi_jian");
+                        return dateStr != null ? sdf.parse(dateStr) : null;
+                    } catch (ParseException e) {
+                        throw new RuntimeException("日期解析失败: " + map.get("bian_zhi_shi_jian"), e);
+                    }
+                },
+                Comparator.nullsLast(Comparator.naturalOrder())
+        );
+        List<Map<String, Object>> mergedList = Stream.concat(
+                        Stream.concat(limitLists.stream(), buMenList.stream()),
+                        comList.stream()
+                )
+                .filter(map -> map.get("id") != null)
+                .collect(Collectors.groupingBy(
+                        map -> map.get("id"),
+                        Collectors.maxBy(dateComparator)  // 使用自定义的比较器
+                ))
+                .values()
+                .stream()
+                .filter(Optional::isPresent)
+                .map(Optional::get)
+                .collect(Collectors.toList());
         Map<String, Object> map = paginate(mergedList, pageNo , limit);
         result.setVariables(map);
         return result;