| | |
| | | import com.vci.model.SmPasswordStrategyForPlatform1; |
| | | import com.vci.omd.utils.ObjectTool; |
| | | import com.vci.pagemodel.SmPasswordStrategyVO; |
| | | import com.vci.starter.web.enumpck.VciFieldTypeEnum; |
| | | import com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.web.service.SmUserQueryServiceI; |
| | | import com.vci.starter.web.constant.QueryOptionConstant; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public DataGrid<SmPasswordStrategyVO> refDataGrid(Map<String, String> conditionMap, PageHelper pageHelper) throws PLException { |
| | | public DataGrid<SmPasswordStrategyVO> refDataGrid(Map<String, String> conditionMap, PageHelper pageHelper) throws Exception { |
| | | if(pageHelper == null){ |
| | | pageHelper = new PageHelper(-1); |
| | | } |
| | |
| | | * @param smPasswordStrategyForPlatform1s 原平台的密码策略 |
| | | * @return |
| | | */ |
| | | private List<SmPasswordStrategyVO> pltPwdStrategy2SmPwdStrategyVOs(List<SmPasswordStrategyForPlatform1> smPasswordStrategyForPlatform1s) throws PLException{ |
| | | private List<SmPasswordStrategyVO> pltPwdStrategy2SmPwdStrategyVOs(List<SmPasswordStrategyForPlatform1> smPasswordStrategyForPlatform1s) throws Exception{ |
| | | List<SmPasswordStrategyVO> smPasswordStrategyVOList = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(smPasswordStrategyForPlatform1s)){ |
| | | smPasswordStrategyForPlatform1s.stream().forEach(s -> { |
| | | try { |
| | | smPasswordStrategyVOList.add(pltPwdStrategy2SmPwdStrategyVO(s)); |
| | | } catch (PLException e) { |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "Platform1对象转VO对象时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | |
| | | * @param strategyForPlatform1 原平台的密码策略 |
| | | * @return 新的密码策略对象 |
| | | */ |
| | | private SmPasswordStrategyVO pltPwdStrategy2SmPwdStrategyVO(SmPasswordStrategyForPlatform1 strategyForPlatform1) throws PLException { |
| | | private SmPasswordStrategyVO pltPwdStrategy2SmPwdStrategyVO(SmPasswordStrategyForPlatform1 strategyForPlatform1) throws PLException, ParseException { |
| | | SmPasswordStrategyVO strategyVO = new SmPasswordStrategyVO(); |
| | | strategyVO.setOid(strategyForPlatform1.getPluid()); |
| | | strategyVO.setId(""); |
| | |
| | | strategyVO.setLockTime(strategyForPlatform1.getPlocktime()); |
| | | strategyVO.setDefaultFlag(strategyForPlatform1.getPlisdefault() == 1); |
| | | strategyVO.setDescription(strategyForPlatform1.getPldesc()); |
| | | strategyVO.setCreateTime(new Date(strategyForPlatform1.getPlcreatetime())); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); |
| | | if(Func.isNotEmpty(strategyForPlatform1.getPlcreatetime())){ |
| | | strategyVO.setCreateTime(sdf.parse(strategyForPlatform1.getPlcreatetime())); |
| | | } |
| | | strategyVO.setCreator(strategyForPlatform1.getPlcreateuser()); |
| | | strategyVO.setLastModifyTime(new Date(strategyForPlatform1.getPlupdatetime())); |
| | | if(Func.isNotEmpty(strategyForPlatform1.getPlupdatetime())){ |
| | | strategyVO.setLastModifyTime(sdf.parse(strategyForPlatform1.getPlupdatetime())); |
| | | } |
| | | strategyVO.setLastModifier(strategyForPlatform1.getPlupdateuser()); |
| | | strategyVO.setLicensors(strategyForPlatform1.getPllicensors()); |
| | | strategyVO.setRequireCharCount(strategyForPlatform1.getPlrequiredtype()); |
| | |
| | | * @param conditionMap |
| | | * @return |
| | | */ |
| | | private List<SmPasswordStrategyVO> getPwdStrategyByCondition(Map<String,String> conditionMap) throws PLException { |
| | | private List<SmPasswordStrategyVO> getPwdStrategyByCondition(Map<String,String> conditionMap) throws Exception { |
| | | if(Func.isEmpty(conditionMap)){ |
| | | conditionMap = new HashMap(); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addPasswordStrateg(SmPasswordStrategyDTO spsDto) throws PLException { |
| | | public boolean addPasswordStrateg(SmPasswordStrategyDTO spsDto) throws Exception { |
| | | VciBaseUtil.alertNotNull( |
| | | spsDto,"新增的密码策略对象", |
| | | spsDto.getName(),"策略名称", |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updatePasswordStrateg(SmPasswordStrategyDTO spsDto) throws PLException { |
| | | public boolean updatePasswordStrateg(SmPasswordStrategyDTO spsDto) throws Exception { |
| | | VciBaseUtil.alertNotNull( |
| | | spsDto,"新增的密码策略对象", |
| | | spsDto.getOid(),"策略主键", |