| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.client.common.providers.ServiceProvider; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.corba.omd.etm.EnumItem; |
| | | import com.vci.corba.omd.etm.EnumType; |
| | | import com.vci.omd.utils.ObjectTool; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.enumpck.UserSecretEnum; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | | import com.vci.web.constant.CacheKeyConstant; |
| | | import com.vci.web.constant.EnumIdConstant; |
| | | import com.vci.web.pageModel.KeyValue; |
| | | import com.vci.web.pageModel.OsEnumItemVO; |
| | | import com.vci.web.pageModel.OsEnumVO; |
| | | import com.vci.web.pageModel.OsStatusVO; |
| | | import com.vci.constant.EnumIdConstant; |
| | | import com.vci.pagemodel.KeyValue; |
| | | import com.vci.pagemodel.OsEnumItemVO; |
| | | import com.vci.pagemodel.OsEnumVO; |
| | | import com.vci.pagemodel.OsStatusVO; |
| | | import com.vci.web.service.OsEnumServiceI; |
| | | import com.vci.web.service.OsLifeCycleServiceI; |
| | | import com.vci.web.service.WebBoServiceI; |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.web.constant.CacheNameConstant.VCI_OBJECT_SERVICE; |
| | | import static com.vci.web.constant.EnumIdConstant.LC_STATUS_SUBFIX; |
| | | import static com.vci.constant.EnumIdConstant.LC_STATUS_SUBFIX; |
| | | |
| | | /** |
| | | * 枚举服务--已经调用平台底层了,不再提供dao层 |
| | |
| | | /** |
| | | * 平台调用客户端 |
| | | */ |
| | | //@Autowired |
| | | @Autowired |
| | | private PlatformClientUtil platformClientUtil; |
| | | |
| | | /** |
| | |
| | | public List<OsEnumVO> selectAllEnum() { |
| | | //后面两个参数居然完全没有作用 |
| | | try { |
| | | return enumDO2VOs(Arrays.stream(ServiceProvider.getOMDService().getEnumService().getEnumTypes("",1,1)).collect(Collectors.toList())); |
| | | return enumDO2VOs(Arrays.stream(platformClientUtil.getEnumService().getEnumTypes("",1,1)).collect(Collectors.toList())); |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | @VciUnLog |
| | | @Cacheable(value = VCI_OBJECT_SERVICE,key = CacheKeyConstant.ALL_ENUM,unless = "#result ==null") |
| | | public Map<String, OsEnumVO> selectAllEnumMap() { |
| | | return Optional.ofNullable(self.selectAllEnum()).orElseGet(()->new ArrayList<>()).stream().collect(Collectors.toMap(s->s.getId().toLowerCase(),t->t,(o1,o2)->o1)); |
| | | } |
| | |
| | | @Override |
| | | public List<KeyValue> getDataEnum(String oid, String btmname) { |
| | | VciBaseUtil.alertNotNull(oid,"业务数据的主键",btmname,"业务类型"); |
| | | com.vci.client.bof.ClientBusinessObject cbo = boService.selectCBOByOid(oid, btmname); |
| | | String secret = cbo.getAttributeValue("secretGrade"); |
| | | //secret = DataSecretEnum.SECRET.getValue() + ""; |
| | | BusinessObject cbo = boService.selectCBOByOid(oid, btmname); |
| | | String secret = ObjectTool.getBOAttributeValue(cbo,"secretGrade"); |
| | | if(StringUtils.isBlank(secret)){ |
| | | return new ArrayList<>(); |
| | | }else{ |
| | |
| | | if(!CollectionUtils.isEmpty(enumItemList)){ |
| | | enumItemList.stream().forEach(enumItem -> { |
| | | try { |
| | | ServiceProvider.getOMDService().getEnumService().addEnumType(enumItem); |
| | | platformClientUtil.getEnumService().addEnumType(enumItem); |
| | | } catch (PLException e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | |
| | | if(!CollectionUtils.isEmpty(enumItemList)){ |
| | | enumItemList.stream().forEach(enumItem -> { |
| | | try { |
| | | // ServiceProvider.getOMDService().getEnumService().modifyEmItem(enumItem); |
| | | ServiceProvider.getOMDService().getEnumService().modifyEnumType(enumItem); |
| | | platformClientUtil.getEnumService().modifyEnumType(enumItem); |
| | | } catch (PLException e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | |
| | | * 清除缓存 |
| | | */ |
| | | @Override |
| | | @CacheEvict(value = VCI_OBJECT_SERVICE,key = CacheKeyConstant.ALL_ENUM) |
| | | public void clearCache() { |
| | | |
| | | } |