| | |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.common.data.UserEntityInfo; |
| | | import com.vci.corba.framework.data.PasswordStrategyInfo; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.frameworkcore.compatibility.SmPwdStrategyQueryServiceI; |
| | | import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; |
| | | import com.vci.frameworkcore.constant.FrameWorkBtmTypeConstant; |
| | | import com.vci.frameworkcore.enumpck.RoleClassifyEnum; |
| | | import com.vci.frameworkcore.enumpck.RoleControlAreaEnum; |
| | | import com.vci.frameworkcore.model.SmPasswordStrategyDO; |
| | | import com.vci.frameworkcore.model.SmPasswordStrategyForPlatform1; |
| | | import com.vci.frameworkcore.model.SmRoleForPlatform1; |
| | | import com.vci.frameworkcore.pagemodel.SmPasswordStrategyVO; |
| | | import com.vci.frameworkcore.pagemodel.SmRoleVO; |
| | | import com.vci.omd.utils.ObjectTool; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public DataGrid<SmPasswordStrategyVO> refDataGrid(Map<String, String> conditionMap, PageHelper pageHelper) { |
| | | return null; |
| | | public DataGrid<SmPasswordStrategyVO> refDataGrid(Map<String, String> conditionMap, PageHelper pageHelper) throws PLException { |
| | | if(pageHelper == null){ |
| | | pageHelper = new PageHelper(-1); |
| | | } |
| | | pageHelper.addDefaultAsc("pname"); |
| | | VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(conditionMap, SmPasswordStrategyDO.class,pageHelper); |
| | | //queryWrapper.eq("pltype","2"); |
| | | platformClientUtil.getFrameworkService().fetchAllPasswordStrategy(); |
| | | //platformClientUtil.getFrameworkService().fetchpassword(); |
| | | List<SmPasswordStrategyForPlatform1> smPasswordStrategyForPlatform1s = boService.selectByQueryWrapper(queryWrapper, SmPasswordStrategyForPlatform1.class); |
| | | DataGrid<SmPasswordStrategyVO> dataGrid = new DataGrid<>(); |
| | | if(!CollectionUtils.isEmpty(smPasswordStrategyForPlatform1s)){ |
| | | dataGrid.setData(pltPwdStrategy2SmPwdStrategyVOs(smPasswordStrategyForPlatform1s)); |
| | | dataGrid.setTotal(boService.countByQueryWrapper(queryWrapper,SmPasswordStrategyForPlatform1.class)); |
| | | } |
| | | return dataGrid; |
| | | } |
| | | |
| | | /** |
| | | * 查询密码安全策略,下拉使用的接口 |
| | | * @param conditionMap |
| | | * @return key为密码策略name,value为密码策略的oid |
| | | * @throws VciBaseException |
| | | */ |
| | | @Override |
| | | public List<Map<String,String>> selectPwdStrategyMap(Map<String, String> conditionMap) throws PLException { |
| | | PageHelper pageHelper = new PageHelper(-1); |
| | | pageHelper.addDefaultAsc("plname"); |
| | | PasswordStrategyInfo[] passwordStrategyInfos = platformClientUtil.getFrameworkService().fetchAllPasswordStrategy(); |
| | | List<Map<String,String>> mapArrayList = new ArrayList<>(); |
| | | if(Func.isEmpty(passwordStrategyInfos)){ |
| | | return mapArrayList; |
| | | } |
| | | Arrays.stream(passwordStrategyInfos).forEach(item->{ |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("name",item.name); |
| | | map.put("id",item.id); |
| | | mapArrayList.add(map); |
| | | }); |
| | | return mapArrayList; |
| | | } |
| | | |
| | | /** |
| | | * 原平台密码策略转SmPasswordStrategyVOS对象 |
| | | * @param smPasswordStrategyForPlatform1s 原平台的密码策略 |
| | | * @return |
| | | */ |
| | | private List<SmPasswordStrategyVO> pltPwdStrategy2SmPwdStrategyVOs(List<SmPasswordStrategyForPlatform1> smPasswordStrategyForPlatform1s){ |
| | | List<SmPasswordStrategyVO> smPasswordStrategyVOList = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(smPasswordStrategyForPlatform1s)){ |
| | | smPasswordStrategyForPlatform1s.stream().forEach(s -> { |
| | | smPasswordStrategyVOList.add(pltPwdStrategy2SmPwdStrategyVO(s)); |
| | | }); |
| | | } |
| | | return smPasswordStrategyVOList; |
| | | } |
| | | |
| | | /** |
| | | * 原平台密码策略转SmPasswordStrategyVO对象 |
| | | * @param strategyForPlatform1 原平台的密码策略 |
| | | * @return 新的密码策略对象 |
| | | */ |
| | | private SmPasswordStrategyVO pltPwdStrategy2SmPwdStrategyVO(SmPasswordStrategyForPlatform1 strategyForPlatform1){ |
| | | SmPasswordStrategyVO strategyVO = new SmPasswordStrategyVO(); |
| | | strategyVO.setOid(strategyForPlatform1.getPluid()); |
| | | strategyVO.setId(""); |
| | | strategyVO.setName(strategyForPlatform1.getPname()); |
| | | strategyVO.setMaxLength(strategyForPlatform1.getPlmaxlength()); |
| | | strategyVO.setMinLength(strategyForPlatform1.getPlength()); |
| | | strategyVO.setValidDay(strategyForPlatform1.getPremindday()); |
| | | strategyVO.setRemindDay(strategyForPlatform1.getPremindday()); |
| | | strategyVO.setRetryTime(strategyForPlatform1.getPretrytime()); |
| | | strategyVO.setLockTime(strategyForPlatform1.getPlocktime()); |
| | | strategyVO.setDefaultFlag(strategyForPlatform1.getPlisdefault() == 1); |
| | | strategyVO.setDescription(strategyForPlatform1.getPldesc()); |
| | | strategyVO.setCreateTime(strategyForPlatform1.getPlcreatetime()); |
| | | strategyVO.setCreator(strategyForPlatform1.getPlcreateuser()); |
| | | strategyVO.setLastModifyTime(strategyForPlatform1.getPlupdatetime()); |
| | | strategyVO.setLastModifier(strategyForPlatform1.getPlupdateuser()); |
| | | strategyVO.getRequireCharType(strategyForPlatform1.getPcharspecies()); |
| | | strategyVO.setLicensors(strategyForPlatform1.getPllicensors()); |
| | | strategyVO.setRequireCharCount(strategyForPlatform1.getPlrequiredtype()); |
| | | return strategyVO; |
| | | } |
| | | |
| | | /** |