| | |
| | | package com.vci.ubcs.omd.service.impl; |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | 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; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Wrapper; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | |
| | | @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); |
| | | } |
| | | |
| | |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 替换前缀和后缀 |
| | | * @param ruleValue 当前版本的值 |
| | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param baseQueryObject 查询对象 |
| | | * @param condition 查询对象 |
| | | * @param query 分页对象 |
| | | * @return 查询结果 |
| | | * @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))); |
| | | } |
| | | |
| | | /** |
| | | * 根据id获取版本规则 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public RevisionRuleVO getReversionRuleById(String id) { |
| | | LambdaQueryWrapper<RevisionRule> wrapper = Wrappers.<RevisionRule>query() |
| | | .lambda().eq(RevisionRule::getId, id) |
| | | .last("limit 1"); |
| | | RevisionRule revisionRule = baseMapper.selectOne(wrapper); |
| | | return RevisionRuleWrapper.build().entityVO(revisionRule); |
| | | } |
| | | |
| | | } |