计算工作日方法
parent
3fe12ad347
commit
6cb70e7305
|
@ -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<String, Object> 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<String, Object> 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue