| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.vci.ubcs.omd.constant.BtmTypeConstant; |
| | | import com.vci.ubcs.omd.dto.RevisionRuleDTO; |
| | | import com.vci.ubcs.omd.entity.BtmType; |
| | | import com.vci.ubcs.omd.entity.RevisionRule; |
| | |
| | | import com.vci.ubcs.omd.wrapper.BtmTypeWrapper; |
| | | import com.vci.ubcs.omd.wrapper.RevisionRuleWrapper; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.util.Map2MPJLambdaUtil; |
| | | import com.vci.ubcs.starter.util.MybatisParameterUtil; |
| | | import com.vci.ubcs.starter.util.UBCSCondition; |
| | | import com.vci.ubcs.starter.web.constant.RegExpConstant; |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.PageHelper; |
| | | import com.vci.ubcs.starter.web.util.BeanUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | @Override |
| | | public List<RevisionRuleVO> listRevisionRuleByIdCollection(Collection<String> revisionRuleIdCollection) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(revisionRuleIdCollection,"英文名称集合"); |
| | | // return RevisionRuleWrapper.build().listVO(list(MybatisParameterUtil.cutInParameter(Wrappers.<RevisionRule>query().lambda(),RevisionRule::getId, Collections.singletonList(revisionRuleIdCollection)))); |
| | | List<RevisionRule> list = baseMapper.selectList(Wrappers.<RevisionRule>query().lambda().in(RevisionRule::getId, revisionRuleIdCollection)); |
| | | List<RevisionRule> list = baseMapper.selectByIdIgnoreCase(revisionRuleIdCollection); |
| | | return RevisionRuleWrapper.build().listVO(list); |
| | | } |
| | | |
| | |
| | | Set<String> idSet = new HashSet<>(); |
| | | String creator = AuthUtil.getUserAccount(); |
| | | Date now = new Date(); |
| | | String btmName = "revision-rule"; |
| | | List<RevisionRule> revisionRuleList = new ArrayList<>(); |
| | | revisionRuleDTOList.forEach(s -> { |
| | | //判断为空 |
| | |
| | | ruleDO.setCreator(creator); |
| | | ruleDO.setCreateTime(now); |
| | | ruleDO.setOwner(creator); |
| | | ruleDO.setBtmName(btmName); |
| | | ruleDO.setBtmName(BtmTypeConstant.REVISION_RULE); |
| | | ruleDO.setTs(now); |
| | | ruleDO.setLastModifier(creator); |
| | | ruleDO.setLastModifyTime(now); |
| | |
| | | //检查业务类型 |
| | | Collection<Collection<String>> oidCollections = VciBaseUtil.switchCollectionForOracleIn(oidCollection); |
| | | for(Collection<String> oids : oidCollections) { |
| | | MPJLambdaWrapper<BtmType> join = Map2MPJLambdaUtil.getMPJLambdaWrapper(new BtmType()) |
| | | MPJLambdaWrapper<BtmType> join = UBCSCondition.getMPJLambdaWrapper(new BtmType()) |
| | | .join("join", RevisionRule.class, RevisionRule::getId, BtmType::getRevisionRuleId) |
| | | .in(RevisionRule::getOid, oids); |
| | | Long count = btmTypeMapper.selectCount(join); |
| | |
| | | public List<BtmTypeVO> listRevisionRuleUsedInfo(String pkRevisionRule) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(pkRevisionRule,"版本规则对象的主键"); |
| | | List<BtmType> result = btmTypeMapper.selectList( |
| | | Map2MPJLambdaUtil.getMPJLambdaWrapper(new BtmType()) |
| | | UBCSCondition.getMPJLambdaWrapper(new BtmType()) |
| | | .join("join", RevisionRule.class, RevisionRule::getId, BtmType::getRevisionRuleId) |
| | | .eq(RevisionRule::getOid, pkRevisionRule)); |
| | | return BtmTypeWrapper.build().listEntityVO(result); |
| | |
| | | * @throws VciBaseException 查询出错时抛出异常 |
| | | */ |
| | | @Override |
| | | public IPage<RevisionRuleVO> pageQueryVO(BaseQueryObject baseQueryObject) throws VciBaseException { |
| | | Map<String, String> conditionMap = baseQueryObject.getConditionMap(); |
| | | if (conditionMap == null){ |
| | | conditionMap = new HashMap<>(); |
| | | } |
| | | PageHelper pageHelper = baseQueryObject.getPageHelper(); |
| | | Query query = new Query(); |
| | | query.setCurrent(pageHelper.getPage()); |
| | | query.setSize(pageHelper.getLimit()); |
| | | query.setAscs(pageHelper.getSort()); |
| | | RevisionRule queryConditionObj = new RevisionRule(); |
| | | BeanMap beanMap = BeanMap.create(queryConditionObj); |
| | | beanMap.putAll(conditionMap); |
| | | return RevisionRuleWrapper.build().pageVO(baseMapper.selectPage(Condition.getPage(query),Condition.getQueryWrapper(queryConditionObj).lambda().orderByAsc(RevisionRule::getId))); |
| | | public IPage<RevisionRuleVO> pageQueryVO(Map<String, Object> condition, Query query) throws VciBaseException { |
| | | return RevisionRuleWrapper.build().pageVO(baseMapper.selectPage(Condition.getPage(query),Condition.getQueryWrapper(condition,RevisionRule.class).lambda().orderByAsc(RevisionRule::getId))); |
| | | } |
| | | |
| | | /** |
| | | * 查看应用范围 |
| | | * |
| | | * @param id id |
| | | * @return 执行结果 |
| | | */ |
| | | @Override |
| | | public List<BtmTypeVO> getApplyRange(String id) { |
| | | VciBaseUtil.alertNotNull(id,"版本规则英文名称"); |
| | | return BtmTypeWrapper.build().listEntityVO(btmTypeMapper.selectList(Wrappers.<BtmType>query().lambda().eq(BtmType::getRevisionRuleId,id))); |
| | | } |
| | | } |