建模工具方法提交

dev
jingwei.tao 2023-06-10 18:51:42 +08:00
parent f2c3c58303
commit a047818ae1
2 changed files with 65 additions and 4 deletions

View File

@ -0,0 +1,54 @@
package aiyh.utils.ecologyutil.modelutil;
import aiyh.utils.Util;
import aiyh.utils.httpUtil.cushttpclasses.CusHttpSession;
import com.alibaba.fastjson.JSONObject;
import com.api.taojw.common.CommonSqlUtil;
import com.api.taojw.common.DaoUtil;
import com.api.taojw.common.TjwHttpSession;
import com.api.taojw.common.logging.MyLogger;
import com.engine.common.util.ServiceUtil;
import com.engine.cube.service.ModeAppService;
import com.engine.cube.service.impl.ModeAppServiceImpl;
import org.apache.log4j.Logger;
import weaver.conn.RecordSet;
import weaver.formmode.data.ModeDataIdUpdate;
import weaver.formmode.setup.ModeRightInfo;
import weaver.general.TimeUtil;
import weaver.hrm.User;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
public class CusModelUtil {
private static Logger logger = Util.getLogger();
public static ModeAppService modeAppService = ServiceUtil.getService(ModeAppServiceImpl.class, new User(1));
/**
*
* @param modeId
*/
public static void rebuildRight(String modeId) {
try{
Map<String, Object> param = new HashMap<>();
param.put("rebulidFlag", "1");
param.put("righttype", "1");
param.put("modeid", modeId);
param.put("rebulidFlag", "1");
param.put("showProgress", "0");
param.put("operation", "resetAllRight");
param.put("session", new CusHttpSession());
Map<String, Object> stringObjectMap = modeAppService.saveModeRightList(param, new User(1));
logger.info("CusModelUtil.rebuildRight end;result:"+new JSONObject(stringObjectMap).toJSONString() + ";param:" + modeId);
}catch(Throwable e){
logger.error("CusModelUtil.rebuildRight error;message:" + e.getMessage());
}
}
}

View File

@ -5,6 +5,7 @@ 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;
@ -18,15 +19,21 @@ import java.util.Map;
*/
public class RightMoveUtil {
private static Logger logger = Util.getLogger();
/**
*
* @param param
* @param param
* fromid
* toid
* T133All
* T133AllNum
* @return
*/
public static JSONObject moveRight(JSONObject param){
JSONObject result = new JSONObject();
try{
Util.logStr("RightMoveUtil moveRight begin;param:[{}]", param.toJSONString());
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));
@ -50,10 +57,10 @@ public class RightMoveUtil {
ProcessDataCmd cmd = new ProcessDataCmd(params,request,new User(1));
Map<String, Object> execute = cmd.execute(null);
result = new JSONObject(execute);
Util.logStr("RightMoveUtil moveRight end;result:[{}]", execute.toString());
logger.info("RightMoveUtil moveRight end;result:" + execute.toString());
return result;
}catch (Throwable e){
Util.logStr("RightMoveUtil moveRight error;message:[{}]", e.getMessage());
logger.error("RightMoveUtil moveRight error;message:" + e.getMessage());
return result;
}
}