From 6cb70e73051433e7d14a80c9bc6dec4e84bf1e6b Mon Sep 17 00:00:00 2001 From: "jingwei.tao" <1249074319@qq.com> Date: Thu, 15 Jun 2023 21:12:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=B7=A5=E4=BD=9C=E6=97=A5?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/ecologyutil/timeutil/TimeUtil.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/main/java/aiyh/utils/ecologyutil/timeutil/TimeUtil.java diff --git a/src/main/java/aiyh/utils/ecologyutil/timeutil/TimeUtil.java b/src/main/java/aiyh/utils/ecologyutil/timeutil/TimeUtil.java new file mode 100644 index 0000000..840d0e2 --- /dev/null +++ b/src/main/java/aiyh/utils/ecologyutil/timeutil/TimeUtil.java @@ -0,0 +1,68 @@ +package aiyh.utils.ecologyutil.rightutil; + +import aiyh.utils.Util; +import aiyh.utils.httpUtil.cushttpclasses.CusHttpServletRequest; +import aiyh.utils.httpUtil.cushttpclasses.CusHttpSession; +import com.alibaba.fastjson.JSONObject; +import com.engine.hrm.cmd.permissiontoadjust.ProcessDataCmd; +import org.apache.log4j.Logger; +import weaver.hrm.User; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import java.util.HashMap; +import java.util.Map; + + +/** + * ecology权限相关方法 + * + */ +public class RightMoveUtil { + + private static Logger logger = Util.getLogger(); + + /** + * 触发标准权限转移 转移待办已办等信息 + * @param param 入参按需填写如下等参数 + * fromid + * toid + * T133All + * T133AllNum + * @return + */ + public static JSONObject moveRight(JSONObject param){ + JSONObject result = new JSONObject(); + try{ + logger.info("RightMoveUtil moveRight begin;param:" + param.toJSONString()); + Map params = new HashMap<>(); + for(Object key : param.keySet()){ + params.put(key.toString(),param.get(key)); + } + HttpServletRequest request = new CusHttpServletRequest(){ + @Override + public String getParameter(String s) { + return param.getString(s); + } + @Override + public HttpSession getSession(boolean b) { + HttpSession session = new CusHttpSession(){ + @Override + public Object getAttribute(String s) { + return new User(1); + } + }; + return session; + } + }; + ProcessDataCmd cmd = new ProcessDataCmd(params,request,new User(1)); + Map execute = cmd.execute(null); + result = new JSONObject(execute); + logger.info("RightMoveUtil moveRight end;result:" + execute.toString()); + return result; + }catch (Throwable e){ + logger.error("RightMoveUtil moveRight error;message:" + e.getMessage()); + return result; + } + } + +} \ No newline at end of file