| | |
| | | package com.vci.frameworkcore.compatibility.impl; |
| | | |
| | | import com.vci.client.ClientSession; |
| | | import com.vci.client.common.excel.ExcelDocumentUtils; |
| | | import com.vci.common.exception.VciException; |
| | | import com.vci.common.utility.ObjectUtility; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.common.data.UserEntityInfo; |
| | | import com.vci.corba.framework.data.FuncOperationInfo; |
| | | import com.vci.corba.framework.data.FunctionInfo; |
| | | import com.vci.corba.framework.data.OperateInfo; |
| | | import com.vci.corba.framework.data.*; |
| | | import com.vci.frameworkcore.compatibility.SmHMSysModConfigServiceI; |
| | | import com.vci.pagemodel.MenuVO; |
| | | import com.vci.pagemodel.*; |
| | | import com.vci.starter.poi.bo.SheetDataSet; |
| | | import com.vci.starter.poi.bo.SheetRowData; |
| | | import com.vci.starter.poi.bo.WriteExcelData; |
| | | import com.vci.starter.poi.bo.WriteExcelOption; |
| | | import com.vci.starter.poi.util.ExcelUtil; |
| | | import com.vci.starter.web.constant.VConstant; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.SessionInfo; |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.util.WebThreadLocalUtil; |
| | | import com.vci.starter.web.redis.RedisService; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import org.slf4j.Logger; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 首页系统模块配置添加按钮、添加操作类型等接口服务 |
| | |
| | | |
| | | private int count = 0; |
| | | |
| | | /** |
| | | * 包含保存模块方法等操作类 |
| | | */ |
| | | private static FunctionOperateDelegate foDelegate; |
| | | |
| | | /** |
| | | * 初始化foDelegate |
| | | */ |
| | | { |
| | | if(Func.isEmpty(foDelegate)){ |
| | | foDelegate = new FunctionOperateDelegate(); |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private RedisService redisService; |
| | | |
| | | /** |
| | | * 日志 |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addOperationType(List<FuncOperationInfo> funcOperationInfoList) { |
| | | VciBaseUtil.alertNotNull(funcOperationInfoList,"添加操作类型的列表");//将操作类型组装成需要存储的对象 |
| | | public boolean addFuncOperationType(List<FuncOperationInfo> funcOperationInfoList) { |
| | | VciBaseUtil.alertNotNull(funcOperationInfoList,"添加的操作类型列表");//将操作类型组装成需要存储的对象 |
| | | List<FuncOperationInfo> objs = new ArrayList<>(); |
| | | funcOperationInfoList.stream().forEach(info -> { |
| | | if(Func.isBlank(info.funcId)){ |
| | |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 增加操作类型 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public OperateInfo addOperationType(OperateInfo operateInfo) throws VciBaseException { |
| | | try { |
| | | //校验 |
| | | this.checkItem(operateInfo); |
| | | String s = foDelegate.saveOperate(operateInfo); |
| | | /**返回1表示名称有重复,返回2表示标识有重复,返回3表示顺序有重复**/ |
| | | if (s.equals("1")) { |
| | | throw new VciBaseException("名称存在重复!"); |
| | | } else if (s.equals("2")) { |
| | | throw new VciBaseException("标识存在重复!"); |
| | | } else if (s.equals("3")) { |
| | | throw new VciBaseException("顺序存在重复!"); |
| | | } |
| | | operateInfo.id = s; |
| | | return operateInfo; |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改操作类型 |
| | | * @param operateInfo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public OperateInfo updateOperationType(OperateInfo operateInfo) throws VciBaseException { |
| | | try { |
| | | this.checkItem(operateInfo); |
| | | String res = foDelegate.updateOperate(operateInfo); |
| | | /**返回1表示名称有重复,返回2表示标识有重复,返回3表示顺序有重复**/ |
| | | if (res.equals("1")) { |
| | | throw new VciBaseException("名称存在重复!"); |
| | | } else if (res.equals("2")) { |
| | | throw new VciBaseException("标识存在重复!"); |
| | | } else if (res.equals("3")) { |
| | | throw new VciBaseException("顺序存在重复!"); |
| | | } |
| | | return operateInfo; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除操作类型 |
| | | * @param operateInfo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean delOperationType(OperateInfo operateInfo) throws VciBaseException { |
| | | try { |
| | | /**检查当前操作是否被引用,0表示无引用,1表示被模块引用,2表示已有权限信息**/ |
| | | int res = foDelegate.checkOperateIsReferenced(operateInfo.id); |
| | | if(res == 1){ |
| | | throw new VciBaseException("当前操作已被模块引用,删除该操作的同时会将其从模块下移除,确认执行删除吗?"); |
| | | }else if(res == 2){ |
| | | throw new VciBaseException("当前操作已经在权限模块被分配过权限,删除该操作的同时会将其从用户的权限中移除,确认执行删除吗?"); |
| | | } |
| | | return foDelegate.deleteOperate(operateInfo.id); |
| | | } catch (VciBaseException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 校验 |
| | | * @param operateInfo |
| | | * @return |
| | | */ |
| | | private void checkItem(OperateInfo operateInfo) { |
| | | if (Func.isBlank(operateInfo.name)) { |
| | | throw new VciBaseException("名称不能为空!"); |
| | | } |
| | | if (Func.isBlank(operateInfo.identify)) { |
| | | throw new VciBaseException("标识不能为空!"); |
| | | } |
| | | if (Func.isBlank(operateInfo.alias)) { |
| | | throw new VciBaseException("别名不能为空!"); |
| | | } |
| | | /*if (operateInfo.seq > -1){ |
| | | throw new VciBaseException("请输入正确的操作顺序值!"); |
| | | }*/ |
| | | /*long seq = operateInfo.seq; |
| | | Pattern pattern = Pattern.compile("[0-9]*"); |
| | | Matcher isNum = pattern.matcher(seq); |
| | | if( !isNum.matches() ){ |
| | | throw new VciBaseException("操作的顺序值只能是[0-9]之间的数字,并且必须是正整数.\n长度不允许输入小数或者负数!"); |
| | | }*/ |
| | | if (operateInfo.name.length() > 128) { |
| | | throw new VciBaseException("名称长度不能超过128!"); |
| | | } |
| | | if (operateInfo.desc.length() > 255) { |
| | | throw new VciBaseException("描述长度不能超过255!"); |
| | | } |
| | | if (operateInfo.alias.length() > 128) { |
| | | throw new VciBaseException("别名长度不能超过255!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | boolean isSuccess = collectionDatas(files); |
| | | logger.info("正在导入表单人员信息......"); |
| | | logger.info("count==="+count); |
| | | boolean resBoolean = false; |
| | | if(isSuccess == false){ |
| | | resBoolean = importExcelData(count); |
| | | isSuccess = importExcelData(count); |
| | | } |
| | | return resBoolean ? BaseResult.success("导入成功!"):BaseResult.fail("导入失败!"); |
| | | return isSuccess ? BaseResult.success("导入成功!"):BaseResult.fail("导入失败!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateAlias(MenuVO menuVO) throws VciException { |
| | | public boolean updateAlias(MenuVO menuVO) throws VciBaseException { |
| | | String alias = menuVO.getAlias(); |
| | | if ("".equals(alias)){ |
| | | throw new VciBaseException("请填写操作别名!"); |
| | |
| | | return foDelegate.updateFuncOperation(id , alias, isValid); |
| | | } |
| | | |
| | | /** |
| | | * 查询系统配置树 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Object> getSysConfTree() { |
| | | return null; |
| | | public List<AppConfigCategoryInfo> getAppConfigCategoryInfo() { |
| | | try { |
| | | AppConfigCategoryInfo[] appConfigCategorys = foDelegate.getAppConfigCategorys(); |
| | | return Arrays.asList(appConfigCategorys); |
| | | } catch (VciBaseException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据分类ID返回全部的 AppConfigDetail 对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addSysConf() { |
| | | public List<AppConfigDetailInfo> getAppConfigDetailsByID(String clsId) { |
| | | try { |
| | | AppConfigDetailInfo[] appConfigDetailInfos = foDelegate.getAppConfigDetailsByID(clsId); |
| | | return Arrays.asList(appConfigDetailInfos); |
| | | } catch (VciBaseException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 增加配置项分类或配置项 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addAppConf(AppConfigDetailInfo appConfigDetailInfo,boolean isConfCategorys/*是否为操作配置项分配*/) { |
| | | VciBaseUtil.alertNotNull(appConfigDetailInfo,"添加的操作类型"); |
| | | boolean rs = false; |
| | | try { |
| | | String id = ""; |
| | | if(isConfCategorys){ |
| | | AppConfigCategoryInfo appConfigCategoryInfo = new AppConfigCategoryInfo(); |
| | | appConfigCategoryInfo.name = appConfigDetailInfo.name; |
| | | appConfigCategoryInfo.desc = appConfigDetailInfo.desc; |
| | | this.checkConf(appConfigCategoryInfo); |
| | | id = foDelegate.saveAppConfigCategory(appConfigCategoryInfo); |
| | | }else{ |
| | | this.checkConfItem(appConfigDetailInfo); |
| | | id = foDelegate.saveAppConfigDetail(appConfigDetailInfo); |
| | | } |
| | | appConfigDetailInfo.id = id; |
| | | rs = true; |
| | | } catch (VciBaseException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | rs = false; |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | return rs; |
| | | } |
| | | |
| | | /** |
| | | * 修改配置项分类或配置项 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateAppConf(AppConfigDetailInfo appConfigDetailInfo,boolean isConfCategorys/*是否为操作配置项分配*/) { |
| | | VciBaseUtil.alertNotNull(appConfigDetailInfo,"添加的操作类型"); |
| | | boolean rs = false; |
| | | try { |
| | | if(isConfCategorys){ |
| | | AppConfigCategoryInfo appConfigCategoryInfo = new AppConfigCategoryInfo(); |
| | | appConfigCategoryInfo.id = appConfigDetailInfo.id; |
| | | appConfigCategoryInfo.name = appConfigDetailInfo.name; |
| | | appConfigCategoryInfo.desc = appConfigDetailInfo.desc; |
| | | this.checkConf(appConfigCategoryInfo); |
| | | rs = foDelegate.updateAppConfigCategory(appConfigCategoryInfo); |
| | | }else{ |
| | | this.checkConfItem(appConfigDetailInfo); |
| | | rs = foDelegate.updateAppConfigDetail(appConfigDetailInfo); |
| | | } |
| | | } catch (VciBaseException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | throw new VciBaseException(exceptionMessage); |
| | | } |
| | | return rs; |
| | | } |
| | | |
| | | /** |
| | | * 删除配置项分类或配置项 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean delAppConf(String[] ids,boolean isConfCategorys/*是否为操作配置项分配*/) { |
| | | VciBaseUtil.alertNotNull(ids,"待删除的主键列表"); |
| | | boolean res = false; |
| | | if(isConfCategorys){ |
| | | if (this.hasAppConfigDetail(ids)) { |
| | | throw new VciBaseException("删除的配置项分类下存在关联数据!"); |
| | | } |
| | | res = foDelegate.deleteAppConfigCategory(ids); |
| | | }else { |
| | | res = foDelegate.deleteAppConfigDetail(ids); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 检查是否存在引用关系 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | private boolean hasAppConfigDetail(final String[] ids){ |
| | | for (int i = 0; i < ids.length; i++) { |
| | | AppConfigDetailInfo[] appConfigDetailsByID = foDelegate.getAppConfigDetailsByID(ids[i]); |
| | | if(Func.isNotEmpty(appConfigDetailsByID)){ |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateSysConf() { |
| | | return false; |
| | | /** |
| | | * 配置项分类校验 |
| | | * @param obj |
| | | */ |
| | | private void checkConf(AppConfigCategoryInfo obj) { |
| | | if ("".equals(obj.name)) { |
| | | throw new VciBaseException("名称不能为空!"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean delSysConf() { |
| | | return false; |
| | | /** |
| | | * 配置项校验 |
| | | * @param obj |
| | | */ |
| | | private void checkConfItem(AppConfigDetailInfo obj) { |
| | | if ("".equals(obj.name)) { |
| | | throw new VciBaseException("名称不能为空!"); |
| | | } |
| | | /*AppConfigDetailInfo[] appConfigDetailInfoByName = foDelegate.getAppConfigDetailInfoByName(obj.name); |
| | | if(appConfigDetailInfoByName != null && appConfigDetailInfoByName.length > 0){ |
| | | throw new VciBaseException("配置项名称重复!"); |
| | | }*/ |
| | | if ("".equals(obj.key)){ |
| | | throw new VciBaseException("主键不能为空!"); |
| | | } |
| | | if ("".equals(obj.value)){ |
| | | throw new VciBaseException("键值不能为空!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导出系统配置 |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String exportSysConf(HttpServletResponse response) { |
| | | return null; |
| | | public String exportSysConf(ExpExcelConditionVO expExcelConditionVO, HttpServletResponse response) throws IOException { |
| | | //设置文件名和路径 |
| | | String expFileName = expExcelConditionVO.getExpFileName(); |
| | | if(Func.isNotBlank(expFileName) && expFileName.contains(".xls")){ |
| | | throw new VciBaseException("设置的文件名中未设置文件后缀,或后缀设置有误,当前仅支持导出.xls格式!"); |
| | | } |
| | | expFileName = Func.isBlank(expFileName) ? "appConfig.xls":expFileName; |
| | | String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); |
| | | //写excel |
| | | String excelPath = defaultTempFolder + File.separator + expFileName; |
| | | //先判断是全部导出还是选择数据导出 |
| | | Map<String, Object> conditionMap = expExcelConditionVO.getConditionMap(); |
| | | if (Func.isEmpty(conditionMap)) { |
| | | throw new VciBaseException("缺少必要导出条件!"); |
| | | } |
| | | //指定导出的属性名 |
| | | List<String> expAttrNames = expExcelConditionVO.getExpAttrNames(); |
| | | if(Func.isEmpty(expAttrNames)){ |
| | | throw new VciBaseException("请选择您要导出的属性!"); |
| | | } |
| | | //先区分是导出的配置项分类还是配置项详情 |
| | | boolean isExpAppConfDetail = (boolean) conditionMap.get("isExpAppConfDetail"); |
| | | //因为AppConfigDetailInfo中的属性包含了AppConfigCategoryInfo中的属性所以先通用了 |
| | | List<AppConfigDetailInfo> appConfigDetailInfos = new ArrayList<>(); |
| | | //选中导出数据的唯一标识 |
| | | List<String> selectDataIdentify = expExcelConditionVO.getSelectDataIdentify(); |
| | | //当前界面导出逻辑,只存在全部和选择导出 |
| | | String expType = expExcelConditionVO.getExpType(); |
| | | if(!isExpAppConfDetail){ |
| | | AppConfigCategoryInfo[] appConfigCategorys = foDelegate.getAppConfigCategorys(); |
| | | List<AppConfigCategoryInfo> filterAppConfigInfo = null; |
| | | if("select".equals(expType)){ |
| | | filterAppConfigInfo = Arrays.stream(appConfigCategorys).filter(item -> { |
| | | if (selectDataIdentify.contains(item.id)) { |
| | | return true; |
| | | } |
| | | return false; |
| | | }).collect(Collectors.toList()); |
| | | }else{ |
| | | filterAppConfigInfo = new ArrayList<>(Arrays.asList(appConfigCategorys)); |
| | | } |
| | | if (Func.isNotEmpty(filterAppConfigInfo)) { |
| | | filterAppConfigInfo.stream().forEach(item->{ |
| | | AppConfigDetailInfo appConfigDetailInfo = new AppConfigDetailInfo(); |
| | | appConfigDetailInfo.id = item.id; |
| | | appConfigDetailInfo.name = item.name; |
| | | appConfigDetailInfo.desc = item.desc; |
| | | appConfigDetailInfos.add(appConfigDetailInfo); |
| | | }); |
| | | } |
| | | }else{ |
| | | String clsId = (String)conditionMap.get("clsId"); |
| | | if(Func.isBlank(clsId)){ |
| | | throw new VciBaseException("未获取到查询配置项的配置项分类主键"); |
| | | } |
| | | AppConfigDetailInfo[] configDetailInfos = foDelegate.getAppConfigDetailsByID(clsId); |
| | | List<AppConfigDetailInfo> filterAppConfigInfo = null; |
| | | if("select".equals(expType)){ |
| | | filterAppConfigInfo = Arrays.stream(configDetailInfos).filter(item -> { |
| | | if (selectDataIdentify.contains(item.id)) { |
| | | return true; |
| | | } |
| | | return false; |
| | | }).collect(Collectors.toList()); |
| | | }else{ |
| | | filterAppConfigInfo = new ArrayList<>(Arrays.asList(configDetailInfos)); |
| | | } |
| | | if (Func.isNotEmpty(filterAppConfigInfo)) { |
| | | appConfigDetailInfos.addAll(filterAppConfigInfo); |
| | | } |
| | | } |
| | | //设置列名 |
| | | List<String> columns = new ArrayList<>(); |
| | | //根据导出列设置列名 |
| | | Map<String,Integer> colAttrMap = new HashMap<>(); //导出的列和属性映射 |
| | | for (int i = 0; i < expAttrNames.size(); i++) { |
| | | String attrName = expAttrNames.get(i); |
| | | switch (attrName){ |
| | | case "name": |
| | | columns.add("名称"); |
| | | break; |
| | | case "key": |
| | | columns.add("key"); |
| | | break; |
| | | case "value": |
| | | columns.add("value"); |
| | | break; |
| | | case "desc": |
| | | columns.add("描述"); |
| | | break; |
| | | } |
| | | colAttrMap.put(attrName,i); |
| | | } |
| | | |
| | | new File(excelPath).createNewFile(); |
| | | //设置列 |
| | | List<WriteExcelData> excelDataList = new ArrayList<>(); |
| | | //设置列头 |
| | | for (int index = 0; index < columns.size(); index++) { |
| | | excelDataList.add(new WriteExcelData(0,index, columns.get(index))); |
| | | } |
| | | //处理数据导出 |
| | | if(Func.isEmpty(appConfigDetailInfos)){ |
| | | excelDataList.add(new WriteExcelData(1,1, "未获取到要导出的数据,请刷新后尝试重新导出!")); |
| | | }else{ |
| | | for (int i = 0; i < appConfigDetailInfos.size(); i++) { |
| | | AppConfigDetailInfo appConfigDetailInfo = appConfigDetailInfos.get(i); |
| | | int row = i+1; |
| | | if(Func.isNotEmpty(colAttrMap.get("name"))){ |
| | | excelDataList.add(new WriteExcelData(row,colAttrMap.get("name"), appConfigDetailInfo.name)); |
| | | } |
| | | if(Func.isNotEmpty(colAttrMap.get("key"))){ |
| | | excelDataList.add(new WriteExcelData(row,colAttrMap.get("key"), appConfigDetailInfo.key)); |
| | | } |
| | | if(Func.isNotEmpty(colAttrMap.get("value"))){ |
| | | excelDataList.add(new WriteExcelData(row,colAttrMap.get("value"), appConfigDetailInfo.value)); |
| | | } |
| | | if(Func.isNotEmpty(colAttrMap.get("desc"))){ |
| | | excelDataList.add(new WriteExcelData(row,colAttrMap.get("desc"), appConfigDetailInfo.desc)); |
| | | } |
| | | } |
| | | } |
| | | WriteExcelOption excelOption = new WriteExcelOption(excelDataList); |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | | return excelPath; |
| | | } |
| | | |
| | | /** |
| | | * 获取当前在线人数 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public long getOnlineUsersNum() { |
| | | long currentLoggedUserCount = redisService.getCurrentOnlineUserCount(VConstant.CURRENT_LOGGED_USERS_KEY); |
| | | return currentLoggedUserCount; |
| | | } |
| | | |
| | | /** |
| | |
| | | if(oneData.get(14).equals("1")) { |
| | | try { |
| | | onebl = foDelegate.firstLevel(plName); |
| | | } catch (VciException e) { |
| | | } catch (VciBaseException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | try { |
| | | fParentId = foDelegate.changeFirstLevel(funObj,plName); |
| | | pd[2]=fParentId; |
| | | } catch (VciException e) { |
| | | } catch (VciBaseException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | funObj.id = fParentId; |
| | | fileFunctionDatas.add(funObj); |
| | | first=true; |
| | | |
| | | |
| | | } else { |
| | | funObj.id = id; |
| | |
| | | pd[jibie]=""; |
| | | } |
| | | twobl=foDelegate.secondLevel(plName,pd[jibie]); |
| | | } catch (VciException e) { |
| | | } catch (VciBaseException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | try { |
| | | OperateInfo operObj = foDelegate.fetchOperateTypeByName(oneData.get(18)); |
| | | foObj.operId = operObj.id; |
| | | } catch (VciException e) { |
| | | } catch (VciBaseException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | foObj.isValid = Integer.parseInt(oneData.get(17)) != 0; |
| | | try { |
| | | foDelegate.saveFuncOperation2(foObj); |
| | | } catch (VciException e) { |
| | | } catch (VciBaseException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | foObj.isValid = Integer.parseInt(oneData.get(17)) != 0; |
| | | try { |
| | | foDelegate.updateOperation(foObj,dataOperName,plFuncOid); |
| | | } catch (VciException e) { |
| | | } catch (VciBaseException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | * @return |
| | | * @throws VciException |
| | | */ |
| | | public boolean firstLevel(String plName) throws VciException{ |
| | | public boolean firstLevel(String plName) throws VciBaseException{ |
| | | try{ |
| | | return platformClientUtil.getFrameworkService().firstLevel(plName); |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciException(String.valueOf(e.code), e.messages); |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | |
| | | * 覆盖重名的第一级数据 |
| | | * add by caill |
| | | * */ |
| | | public String changeFirstLevel(FunctionInfo functionInfo,String plName) throws VciException{ |
| | | public String changeFirstLevel(FunctionInfo functionInfo,String plName) throws VciBaseException{ |
| | | String fParentId=""; |
| | | try { |
| | | fParentId= platformClientUtil.getFrameworkService().changeFirstLevel(functionInfo, plName); |
| | |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return fParentId; |
| | | } |
| | | |
| | |
| | | * 判断第二级数据有没有重名的 |
| | | * add by caill |
| | | * */ |
| | | public boolean secondLevel(String plName,String fParentId) throws VciException{ |
| | | public boolean secondLevel(String plName,String fParentId) throws VciBaseException{ |
| | | try{ |
| | | return platformClientUtil.getFrameworkService().secondLevel(plName,fParentId); |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciException(String.valueOf(e.code), e.messages); |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | |
| | | //info.suffixB = object.getSuffixB() == null ? "" : object.getSuffixB(); |
| | | info.desc = object.getRemark() == null ? "" : object.getRemark(); |
| | | info.seq = object.getSort(); |
| | | info.image = object.getSource() == null ? "" : object.getSource(); |
| | | info.icon = object.getSource() == null ? "" : object.getSource(); |
| | | info.isValid = object.getIsValid(); |
| | | info.aliasName = object.getAlias() == null ? "" : object.getAlias(); |
| | | info.resourceDotNet = object.getResourceDotNet() == null ? "" : object.getResourceDotNet(); |
| | |
| | | /*obj.suffixC = ""; |
| | | obj.suffixB = "";*/ |
| | | obj.seq = sequence; |
| | | obj.image = menuVO.getSource(); |
| | | obj.isValid = Func.isNotEmpty(menuVO.getValid()) ? menuVO.getValid():false; |
| | | obj.icon = menuVO.getSource(); |
| | | obj.isValid = Func.isNotEmpty(menuVO.getIsValid()) ? menuVO.getIsValid():false; |
| | | obj.aliasName = aliasName; |
| | | obj.resourceDotNet = resDotNet; |
| | | obj.resourceMobile = resMobile; |
| | |
| | | int len = funObject.length; |
| | | List<FunctionInfo> funInfoList = new ArrayList<FunctionInfo>(); |
| | | for(int i = count ; i<len ; i++){ |
| | | if(funObject[i].parentId!=null){ |
| | | if(Func.isNotBlank(funObject[i].parentId)){ |
| | | FunctionInfo funInfo = funObject[i]; |
| | | funInfoList.add(funInfo); |
| | | } |
| | |
| | | return same; |
| | | } |
| | | |
| | | public OperateInfo fetchOperateTypeByName(String name) throws VciException { |
| | | public OperateInfo fetchOperateTypeByName(String name) throws VciBaseException { |
| | | try{ |
| | | OperateInfo info = platformClientUtil.getFrameworkService().fetchOperateTypeByName(name); |
| | | return info; |
| | |
| | | * 保存操作类型 |
| | | * add by caill |
| | | * */ |
| | | public boolean saveFuncOperation2(FuncOperationInfo funcOperationInfo) throws VciException{ |
| | | public boolean saveFuncOperation2(FuncOperationInfo funcOperationInfo) throws VciBaseException{ |
| | | try { |
| | | platformClientUtil.getFrameworkService().saveFuncOperation2(funcOperationInfo,this.getUserEntityInfo()); |
| | | } catch (PLException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | * 覆盖操作类型 |
| | | * add by caill |
| | | * */ |
| | | public String updateOperation(FuncOperationInfo funcOperationInfo,String dataOperName,String plFuncOid) throws VciException{ |
| | | public String updateOperation(FuncOperationInfo funcOperationInfo,String dataOperName,String plFuncOid) throws VciBaseException{ |
| | | try { |
| | | platformClientUtil.getFrameworkService().updateOperation(funcOperationInfo,this.getUserEntityInfo(),dataOperName,plFuncOid); |
| | | } catch (PLException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public boolean updateFuncOperation(String id , String alias, boolean isSelected) throws VciException { |
| | | public boolean updateFuncOperation(String id , String alias, boolean isSelected) throws VciBaseException { |
| | | boolean res = false; |
| | | try{ |
| | | res = platformClientUtil.getFrameworkService().updateFuncOperation(id, alias, isSelected, this.getUserEntityInfo()); |
| | | }catch(PLException e){ |
| | | throw new VciException(String.valueOf(e.code), e.messages); |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 保存操作类型 |
| | | * |
| | | * @param operateInfo |
| | | * @return |
| | | * @throws VciException |
| | | */ |
| | | public String saveOperate(OperateInfo operateInfo) throws VciBaseException { |
| | | String res = ""; |
| | | try{ |
| | | res = platformClientUtil.getFrameworkService().saveOperate(operateInfo,this.getUserEntityInfo()); |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 修改操作类型 |
| | | * |
| | | * @param operateInfo |
| | | * @return |
| | | * @throws VciException |
| | | */ |
| | | public String updateOperate(OperateInfo operateInfo) throws VciBaseException { |
| | | String res = ""; |
| | | try{ |
| | | res = platformClientUtil.getFrameworkService().updateOperate(operateInfo,this.getUserEntityInfo()); |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 删除操作类型 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws VciException |
| | | */ |
| | | public boolean deleteOperate(String id) throws VciBaseException { |
| | | boolean res = true; |
| | | try{ |
| | | res = platformClientUtil.getFrameworkService().deleteOperate(id,this.getUserEntityInfo()); |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 检查操作是否被引用 |
| | | * @param operateId |
| | | * @return 0表示无引用,1表示被模块引用,2表示有权限信息 |
| | | * @throws VciException |
| | | */ |
| | | public int checkOperateIsReferenced(String operateId) throws VciBaseException { |
| | | try{ |
| | | return (int)platformClientUtil.getFrameworkService().checkOperateIsReferenced(operateId); |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(String.valueOf(e.code),e.messages); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 返回全部的 AppConfigCategory 对象 |
| | | * @return |
| | | * @throws VciException |
| | | */ |
| | | public AppConfigCategoryInfo[] getAppConfigCategorys() throws VciBaseException{ |
| | | try{ |
| | | AppConfigCategoryInfo[] infos = platformClientUtil.getFrameworkService().getAppConfigCategorys(this.getUserEntityInfo()); |
| | | return infos; |
| | | }catch(PLException e){ |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据分类ID返回全部的 AppConfigDetail 对象 |
| | | */ |
| | | public AppConfigDetailInfo[] getAppConfigDetailsByID(String clsfId) throws VciBaseException{ |
| | | try{ |
| | | AppConfigDetailInfo[] infos = platformClientUtil.getFrameworkService().getAppConfigDetailsByCatId(clsfId, this.getUserEntityInfo()); |
| | | return infos; |
| | | }catch(PLException e){ |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加、保存 AppConfigCategory 对象 |
| | | * @param object AppConfigCategoryInfo 对象 |
| | | */ |
| | | public String saveAppConfigCategory(AppConfigCategoryInfo object) throws VciBaseException{ |
| | | try{ |
| | | return platformClientUtil.getFrameworkService().saveAppConfigCategory(object, this.getUserEntityInfo()); |
| | | }catch(PLException e){ |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改、更新 AppConfigCategory 对象 |
| | | * @param object AppConfigCategoryInfo 对象 |
| | | */ |
| | | public boolean updateAppConfigCategory(AppConfigCategoryInfo object) throws VciBaseException{ |
| | | try{ |
| | | return platformClientUtil.getFrameworkService().updateAppConfigCategory(object, this.getUserEntityInfo()); |
| | | }catch(PLException e){ |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据名称查询配置项 |
| | | * @param name |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | public AppConfigDetailInfo[] getAppConfigDetailInfoByName(String name) throws VciBaseException{ |
| | | try{ |
| | | AppConfigDetailInfo[] appConfigDetailsByName = platformClientUtil.getFrameworkService().getAppConfigDetailsByName(name, this.getUserEntityInfo()); |
| | | return appConfigDetailsByName; |
| | | }catch(PLException e){ |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据 ID 删除 AppConfigCategory 对象(批量) |
| | | * @param ids AppConfigCategory 对象的 ID 列表 |
| | | */ |
| | | public boolean deleteAppConfigCategory(String[] ids) throws VciBaseException{ |
| | | try{ |
| | | return platformClientUtil.getFrameworkService().deleteAppConfigCategory(ids, this.getUserEntityInfo()); |
| | | }catch(PLException e){ |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | | /** 添加、保存 AppConfigDetail 对象 |
| | | * @param info AppConfigDetailInfo 对象 |
| | | */ |
| | | public String saveAppConfigDetail(AppConfigDetailInfo info) throws VciBaseException{ |
| | | try{ |
| | | return platformClientUtil.getFrameworkService().saveAppConfigDetail(info, this.getUserEntityInfo()); |
| | | }catch(PLException e){ |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改、更新 AppConfigDetail 对象 |
| | | * @param info AppConfigDetailInfo 对象 |
| | | */ |
| | | public boolean updateAppConfigDetail(AppConfigDetailInfo info) throws VciBaseException{ |
| | | try{ |
| | | return platformClientUtil.getFrameworkService().updateAppConfigDetail(info, this.getUserEntityInfo()); |
| | | }catch(PLException e){ |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据 ID 删除 AppConfigDetail 对象(批量) |
| | | * @param ids AppConfigDetail 对象的 ID 列表 |
| | | */ |
| | | public boolean deleteAppConfigDetail(String[] ids) throws VciBaseException{ |
| | | try{ |
| | | return platformClientUtil.getFrameworkService().deleteAppConfigDetail(ids, this.getUserEntityInfo()); |
| | | }catch(PLException e){ |
| | | throw new VciBaseException(String.valueOf(e.code), e.messages); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |