xiejun
2023-10-13 cd349488b2bcf439abfc42bb219e4e9bdce736f4
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/StatusServiceImpl.java
@@ -17,6 +17,7 @@
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;
@@ -44,6 +45,8 @@
   private BtmTypeMapper btmTypeMapper;
   @Resource
   private LifeCycleNodeMapper lifeCycleNodeMapper;
   @Resource
   private LifeCycleMapper lifeCycleMapper;
   /**
    * 获取状态列表
    *
@@ -469,12 +472,20 @@
    */
   @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 BtmTypeWrapper.build().listEntityVO(btmTypeMapper.selectList(Wrappers.<BtmType>query().lambda().in(BtmType::getOid,lifeCycleOidList)));
      return btmTypeVOS;
   }
}