diff --git a/src/main/java/aiyh/utils/ecologyutil/modelutil/CusModelUtil.java b/src/main/java/aiyh/utils/ecologyutil/modelutil/CusModelUtil.java new file mode 100644 index 0000000..ffd1f84 --- /dev/null +++ b/src/main/java/aiyh/utils/ecologyutil/modelutil/CusModelUtil.java @@ -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 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 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()); + } + + } + +} \ No newline at end of file diff --git a/src/main/java/aiyh/utils/ecologyutil/rightutil/RightMoveUtil.java b/src/main/java/aiyh/utils/ecologyutil/rightutil/RightMoveUtil.java index 6d80747..840d0e2 100644 --- a/src/main/java/aiyh/utils/ecologyutil/rightutil/RightMoveUtil.java +++ b/src/main/java/aiyh/utils/ecologyutil/rightutil/RightMoveUtil.java @@ -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 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 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; } }