generated from dxfeng/secondev-chapanda-feishu
非标包文件提交
This commit is contained in:
parent
0a85d7d6e0
commit
7c94f7c0fa
|
|
@ -0,0 +1,54 @@
|
|||
package com.api.recruit.listener;
|
||||
|
||||
|
||||
import com.sun.jersey.api.model.AbstractResourceModelContext;
|
||||
import com.sun.jersey.api.model.AbstractResourceModelListener;
|
||||
import com.weaver.upgrade.FunctionUpgradeUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.system.License;
|
||||
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
@Provider
|
||||
public class InitListener implements AbstractResourceModelListener {
|
||||
@Override
|
||||
public void onLoaded(AbstractResourceModelContext abstractResourceModelContext) {
|
||||
int menuid = 100188;
|
||||
BaseBean bb = new BaseBean();
|
||||
String cId = new License().getCId();
|
||||
if(cId.length() > 7) {
|
||||
cId = cId.substring(cId.length() - 7);
|
||||
}
|
||||
String defaultCloseNonStandard151 = bb.getPropValue("jclRecruit", "defaultCloseNonStandard163");
|
||||
if(StringUtils.isNotBlank(cId) && "true".equals(defaultCloseNonStandard151)) {
|
||||
int cid = Integer.parseInt(cId);
|
||||
if(!hasMenuInfo(cid, "left", menuid)) {
|
||||
bb.writeLog("163招聘管理 添加默认菜单控制");
|
||||
insertMenuInfo(cid, "left", menuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void insertMenuInfo(int cid,String type,int id){
|
||||
RecordSet rs = new RecordSet();
|
||||
BaseBean bb = new BaseBean();
|
||||
bb.writeLog("FunctionUpgradeUtil.getMenuId(cid,id):" + FunctionUpgradeUtil.getMenuId(cid,id));
|
||||
String sql ="INSERT INTO menucontrollist (type,menuid,isopen) VALUES('"+type+"','"+FunctionUpgradeUtil.getMenuId(cid,id)+"','"+FunctionUpgradeUtil.getMenuStatus(id,-1,cid)+"')";
|
||||
rs.execute(sql);
|
||||
}
|
||||
|
||||
private boolean hasMenuInfo(int cid, String type, int id) {
|
||||
RecordSet rs = new RecordSet();
|
||||
String sql = "select count(1) as count from menucontrollist where type = ? and menuid = ?";
|
||||
rs.executeQuery(sql,type, FunctionUpgradeUtil.getMenuId(cid,id));
|
||||
if(rs.next()) {
|
||||
int count = rs.getInt("count");
|
||||
if(count > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Loading…
Reference in New Issue