| | |
| | | package com.vci.ubcs.omd.service.impl; |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.omd.constant.BtmTypeConstant; |
| | | import com.vci.ubcs.omd.entity.Status; |
| | | import com.vci.ubcs.omd.mapper.StatusMapper; |
| | | import com.vci.ubcs.omd.entity.*; |
| | | import com.vci.ubcs.omd.mapper.*; |
| | | import com.vci.ubcs.omd.service.IStatusService; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.StatusVO; |
| | | import com.vci.ubcs.omd.wrapper.BtmTypeWrapper; |
| | | import com.vci.ubcs.omd.wrapper.LifeCycleRuleWrapper; |
| | | import com.vci.ubcs.omd.wrapper.StatusWrapper; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.util.BeanUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import io.undertow.servlet.core.Lifecycle; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | |
| | | public class StatusServiceImpl extends ServiceImpl<StatusMapper, Status> implements IStatusService { |
| | | |
| | | private final String REGEXP = "^[A-Za-z]+$"; |
| | | |
| | | @Resource |
| | | private BtmTypeMapper btmTypeMapper; |
| | | @Resource |
| | | private LifeCycleNodeMapper lifeCycleNodeMapper; |
| | | @Resource |
| | | private LifeCycleMapper lifeCycleMapper; |
| | | /** |
| | | * 获取状态列表 |
| | | * |
| | |
| | | Collection<Collection<String>> idCollections = VciBaseUtil.switchCollectionForOracleIn(idCollection); |
| | | if(!CollectionUtils.isEmpty(idCollections)) { |
| | | idCollections.forEach(s -> { |
| | | List<Status> queryResult = baseMapper.selectByIdIgnoreCase(s); |
| | | QueryWrapper<Status> wrapper = new QueryWrapper<>(); |
| | | wrapper.in("id",s); |
| | | List<Status> queryResult = baseMapper.selectList(wrapper); |
| | | |
| | | if(!CollectionUtils.isEmpty(queryResult)){ |
| | | statusDOList.addAll(queryResult); |
| | | } |
| | |
| | | public boolean checkStatusUsed(String pkStatus) throws VciBaseException { |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 查看应用范围 |
| | | * |
| | | * @param id id |
| | | * @return 执行结果 |
| | | */ |
| | | @Override |
| | | public List<BtmTypeVO> getApplyRange(String id) { |
| | | List<BtmTypeVO> btmTypeVOS=new ArrayList<>(); |
| | | VciBaseUtil.alertNotNull(id,"状态英文名称"); |
| | | List<LifeCycleNode> selectList = lifeCycleNodeMapper.selectList(Wrappers.<LifeCycleNode>query().lambda().eq(LifeCycleNode::getId,id)); |
| | | List<String>lifeCycleOidList = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(selectList)){ |
| | | lifeCycleOidList = selectList.stream().map(LifeCycleNode::getLifeCycleOid).collect(Collectors.toList()); |
| | | List<LifeCycleRule>LifeCycleRuleList = lifeCycleMapper.selectList(Wrappers.<LifeCycleRule>query().lambda().in(LifeCycleRule::getOid,lifeCycleOidList)); |
| | | List<String>lifeCycleRuleIdList = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(LifeCycleRuleList)) { |
| | | lifeCycleRuleIdList = LifeCycleRuleList.stream().map(LifeCycleRule::getId).collect(Collectors.toList()); |
| | | btmTypeVOS= BtmTypeWrapper.build().listEntityVO(btmTypeMapper.selectList(Wrappers.<BtmType>query().lambda().in(BtmType::getLifeCycleId, lifeCycleRuleIdList))); |
| | | } |
| | | } |
| | | |
| | | return btmTypeVOS; |
| | | } |
| | | } |