| | |
| | | package com.vci.frameworkcore.compatibility.impl; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.common.data.UserEntityInfo; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.frameworkcore.compatibility.SmPwdStrategyQueryServiceI; |
| | | import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; |
| | | import com.vci.frameworkcore.model.OrgDeptForPlatform1; |
| | | import com.vci.frameworkcore.pagemodel.OrgDepartmentVO; |
| | | import com.vci.frameworkcore.model.SmPasswordStrategyDO; |
| | | import com.vci.frameworkcore.pagemodel.SmPasswordStrategyVO; |
| | | import com.vci.frameworkcore.pagemodel.SmRoleVO; |
| | | import com.vci.frameworkcore.pagemodel.SmUserVO; |
| | | import com.vci.omd.utils.ObjectTool; |
| | | import com.vci.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.util.BeanUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.web.model.SmPasswordStrategyDO; |
| | | import com.vci.web.service.WebBoServiceI; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.frameworkcore.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST; |
| | | |
| | | /** |
| | |
| | | private SmUserQueryServiceI smUserQueryService; |
| | | |
| | | /** |
| | | * 平台调用客户端 |
| | | */ |
| | | @Autowired |
| | | private PlatformClientUtil platformClientUtil; |
| | | |
| | | /** |
| | | * 获取默认密码策略 |
| | | * @return |
| | | */ |
| | |
| | | return pwdStrategyDO2VO(passwordStrategyDO); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 密码策略分页查询 |
| | | * @param conditionMap |
| | | * @param pageHelper |
| | | * @return |
| | | */ |
| | | @Override |
| | | public DataGrid<SmPasswordStrategyVO> refDataGrid(Map<String, String> conditionMap, PageHelper pageHelper) { |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 保存用户关联密码策略 |
| | | * @param userIds |
| | | * @param passwordStrategId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean saveUserPasswordStrateg(String[] userIds, String passwordStrategId) throws PLException { |
| | | VciBaseUtil.alertNotNull(userIds,"用户主键",passwordStrategId,"密码安全策略主键"); |
| | | //TODO:这里没有做查重处理,明天记得验证一下这儿是不是会自动做saveOrUpdate的处理 |
| | | return platformClientUtil.getFrameworkService().saveUserPasswordStrateg(userIds,passwordStrategId,new UserEntityInfo()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public SmPasswordStrategyVO getPasswordStrategyVOByUserOid(String userOid) throws PLException { |
| | | WebUtil.alertNotNull(userOid,"用户的主键"); |
| | | if(smUserQueryService.checkUserExist(null,userOid)){ |
| | | if(!smUserQueryService.checkUserExist(null,userOid)){ |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | | } |
| | | String sql = "select plpasswordstrategyuid,pluseruid from pluserpasswordstrategy where pluseruid = '"+ userOid +"')"; |
| | | String sql = "select plpasswordstrategyuid,pluseruid from pluserpasswordstrategy where pluseruid = '"+ userOid +"'"; |
| | | List<BusinessObject> cbos = boService.queryBySql(sql, null); |
| | | if(Func.isNotEmpty(cbos)){ |
| | | return getPasswordStrategyVOByOid(ObjectTool.getNewBOAttributeValue(cbos.get(0), "plpasswordstrategyuid")); |