计算工作日方法

dev
jingwei.tao 2023-06-15 21:12:47 +08:00
parent 3fe12ad347
commit 6cb70e7305
1 changed files with 68 additions and 0 deletions

View File

@ -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;
}
}
}