| | |
| | | import com.vci.ubcs.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.WebUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | VciBaseUtil.alertNotNull(codeRuleDTO, "需要添加的数据对象"); |
| | | //将DTO转换为DO |
| | | CodeRule codeRule = Objects.requireNonNull(BeanUtil.copy(codeRuleDTO, CodeRule.class)); |
| | | String userId = AuthUtil.getUserId().toString(); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(codeRule, MdmBtmTypeConstant.CODE_RULE); |
| | | codeRule.setLctid(CODE_RULE_LC); |
| | | codeRule.setLcStatus(FRAMEWORK_RELEASE_EDITING); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 主键批量获取主数据编码规则 |
| | | * |
| | | * @param oidCollections 主键集合,但是受性能影响,建议一次查询不超过10000个 |
| | | * @param hasSec 是否包含码段 |
| | | * @return 主数据编码规则显示对象 |
| | | * @throws VciBaseException 查询出现异常时会抛出 |
| | | */ |
| | | @Override |
| | | public Collection<CodeRuleVO> listCodeRuleByIds(Collection<String> oidCollections, boolean hasSec) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oidCollections, "数据对象主键集合"); |
| | | List<CodeRule> codeRuleDOList = listCodeRuleDOByOidCollections(oidCollections); |
| | | return codeRuleDO2VOs(codeRuleDOList, true); |
| | | } |
| | | |
| | | /** |
| | | * 使用主键集合查询数据对象 |
| | | * |
| | | * @param oidCollections 主键的集合 |
| | |
| | | return R.data(exFlag&&exFlag1); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 使用主键获取编码规则的内容 |
| | | * |
| | |
| | | } |
| | | |
| | | /** |
| | | * 批量数据对象转换为显示对象 |
| | | * |
| | | * @param codeRules 数据对象列表 |
| | | * @param hasSec 是否包含码段 |
| | | * @return 显示对象 |
| | | * @throws VciBaseException 参数为空或者不存在的时候会抛出异常 |
| | | */ |
| | | public List<CodeRuleVO> codeRuleDO2VOs(Collection<CodeRule> codeRules, boolean hasSec) throws VciBaseException { |
| | | List<CodeRuleVO> voList = new ArrayList<CodeRuleVO>(); |
| | | if (!CollectionUtils.isEmpty(codeRules)) { |
| | | for (CodeRule s : codeRules) { |
| | | CodeRuleVO vo = codeRuleDO2VO(s,true); |
| | | if (vo != null) { |
| | | voList.add(vo); |
| | | } |
| | | } |
| | | } |
| | | return voList; |
| | | } |
| | | |
| | | /** |
| | | * 数据对象转换为显示对象 |
| | | * |
| | | * @param codeRuleDO 规则的数据对象 |