Просмотр исходного кода

oa单点sHR、发送oa待办代码更新

Heyuan 6 месяцев назад
Родитель
Сommit
bd38bfd811

+ 1 - 1
src/com/kingdee/eas/custom/messageWebService/OAMessageWebServiceDao.java

@@ -276,7 +276,7 @@ public class OAMessageWebServiceDao implements MessageWebServiceDao {
             url.append(URLEncoder.encode(redirectUrl.toString(), "UTF-8"));
             params.put("pcurl", url);//PC地址(相对路径/开头)
             params.put("appurl", url);//APP地址(相对路径/开头)
-            //params.put("nodename", message.get);//步骤名称(节点名称)
+            params.put("nodename", "sHR");//步骤名称(节点名称)
             params.put("isremark", isremark);//流程处理状态
             params.put("viewtype", viewtype);//流程查看状态
             params.put("creator", message.getSenderNumber());//创建人(原值)

+ 6 - 9
src/com/kingdee/eas/custom/sso/ExpiringMapCache.java

@@ -6,6 +6,12 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
+/**
+ * ´ø¹ýÆÚʱ¼äµÄMap
+ *
+ * @param <K>
+ * @param <V>
+ */
 public class ExpiringMapCache<K, V> {
     private final Map<K, CacheValue<V>> cache = new ConcurrentHashMap<>();
     private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
@@ -44,14 +50,5 @@ public class ExpiringMapCache<K, V> {
             this.expiryTime = expiryTime;
         }
     }
-
-    public static void main(String[] args) throws InterruptedException {
-        ExpiringMapCache<String,String> cache = new ExpiringMapCache<>();
-        cache.put("111","AAA",2000);
-        while(true){
-            System.out.println(cache.get("111"));
-            Thread.sleep(1000);
-        }
-    }
 }
 

+ 0 - 32
src/com/kingdee/eas/custom/sso/OAToSHR.java

@@ -37,8 +37,6 @@ public class OAToSHR extends HttpServlet {
     private Properties prop = new Properties();
     private String propPath = System.getProperty("EAS_HOME") + "/server/properties/scy/OASSOConfig.properties";
 
-    private final String SECRETKEY = "jOK7MpIonY+/56ulnl6RGQ==";
-
     @Override
     protected void doGet(HttpServletRequest req, HttpServletResponse resp)
             throws ServletException, IOException {
@@ -122,8 +120,6 @@ public class OAToSHR extends HttpServlet {
         String key = System.currentTimeMillis() + String.valueOf(random.nextInt(99999));
         redirectUrlCache.put(key, redirectUrl,300000);
         logger.error("callBack redirectUrl" + redirectUrl);
-        //String encrypt = encrypt(redirectUrl, SECRETKEY);
-        //logger.error("callBack encrypt" + encrypt);
         redirect_uri1 += "?redirect=" + key;
         Map params = new HashMap();
         params.put("client_id", client_id);
@@ -213,7 +209,6 @@ public class OAToSHR extends HttpServlet {
             redirectUrlStr.append(serverName).append("/shr/dynamic.do?uipk=shr.perself.homepage");
         } else {
             String redirectUrl = redirectUrlCache.get(redirectUrlKey);
-            //String decrpt = decrypt(redirectUrl, SECRETKEY);
             if (redirectUrl.contains(serverName)) {
                 redirectUrlStr.append(redirectUrl);
             } else {
@@ -332,7 +327,6 @@ public class OAToSHR extends HttpServlet {
         }
     }
 
-
     /**
      * 拼接地址参数
      */
@@ -348,30 +342,4 @@ public class OAToSHR extends HttpServlet {
         logger.error("拼接后的地址为:" + str);
         return str;
     }
-
-    // 使用 AES 加密
-    public static String encrypt(String plainText, String encodedKey) throws Exception {
-        // 将Base64字符串解码为字节数组
-        byte[] decodedKey = Base64.getDecoder().decode(encodedKey);
-        // 使用字节数组创建一个AES密钥
-        SecretKey secretKey = new SecretKeySpec(decodedKey, 0, decodedKey.length, "AES");
-        Cipher cipher = Cipher.getInstance("AES");
-        cipher.init(Cipher.ENCRYPT_MODE, secretKey);
-        byte[] encryptedBytes = cipher.doFinal(plainText.getBytes("UTF-8"));
-        return Base64.getEncoder().encodeToString(encryptedBytes);
-    }
-
-    // 使用 AES 解密
-    public static String decrypt(String encryptedText, String encodedKey) throws Exception {
-        // 将Base64字符串解码为字节数组
-        byte[] decodedKey = Base64.getDecoder().decode(encodedKey);
-        // 使用字节数组创建一个AES密钥
-        SecretKey secretKey = new SecretKeySpec(decodedKey, 0, decodedKey.length, "AES");
-        Cipher cipher = Cipher.getInstance("AES");
-        cipher.init(Cipher.DECRYPT_MODE, secretKey);
-        byte[] decodedBytes = Base64.getDecoder().decode(encryptedText);
-        byte[] decryptedBytes = cipher.doFinal(decodedBytes);
-        return new String(decryptedBytes, "UTF-8");
-    }
-
 }