| | |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | throw new VciBaseException("引用码段的时候,参照配置的内容的格式不正确,",new String[0],e); |
| | | } |
| | | // 判断是否为引用码段,如果是应用码段的话,为了适配前端组件,这里要对表进行处理一下,按照以前的参照格式进行转换 |
| | | codeBasicSecDO.setReferValueInfo(referConfigTOUIUiTable(codeReferConfigVO)); |
| | | codeBasicSecDO.setReferValueInfo(referConfigToUIUiTable(codeReferConfigVO)); |
| | | if(codeReferConfigVO.getIsPersistence()=="true"){ |
| | | codeReferConfigService.insert(codeReferConfigVO); |
| | | } |
| | |
| | | * @param codeReferConfig |
| | | * @return |
| | | */ |
| | | private String referConfigTOUIUiTable(CodeReferConfigVO codeReferConfig){ |
| | | private String referConfigToUIUiTable(CodeReferConfigVO codeReferConfig){ |
| | | // 拷贝为以前的老对象 |
| | | UIReferConfigFormVO uiFormReferVO = new UIReferConfigFormVO(); |
| | | BeanUtil.copy(codeReferConfig,uiFormReferVO); |
| | |
| | | && StringUtils.isBlank(codeBasicSecDO.getCodeFillSeparator())){ |
| | | throw new VciBaseException("当补位方式为左补位或者右补位的时候,补位字符不能为空"); |
| | | } |
| | | CodeReferConfigVO codeReferConfigVO = null; |
| | | //引用码段的时候,需要判断参照的信息是否正确 |
| | | if(CodeSecTypeEnum.CODE_REFER_SEC.getValue().equalsIgnoreCase(codeBasicSecDO.getSecType())){ |
| | | if(StringUtils.isBlank(codeBasicSecDO.getReferConfig())){ |
| | | throw new VciBaseException("引用码段的时候,需要填写 参照配置 的内容"); |
| | | throw new VciBaseException("引用码段的时候,需要填写参照配置的内容"); |
| | | } |
| | | try{ |
| | | JSONObject.parseObject(codeBasicSecDO.getReferConfig(), UIFormReferVO.class); |
| | | // JSONObject.parseObject(codeBasicSecDO.getReferConfig(), UIFormReferVO.class); |
| | | codeReferConfigVO = JSONObject.parseObject(codeBasicSecDO.getReferConfig(), CodeReferConfigVO.class); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("引用码段的时候,参照配置的内容的格式不正确,",new String[0],e); |
| | | } |
| | | // 判断是否为引用码段,如果是应用码段的话,为了适配前端组件,这里要对表进行处理一下,按照以前的参照格式进行转换 |
| | | codeBasicSecDO.setReferValueInfo(referConfigToUIUiTable(codeReferConfigVO)); |
| | | if(codeReferConfigVO.getIsPersistence()=="true"){ |
| | | codeReferConfigService.insert(codeReferConfigVO); |
| | | } |
| | | } |
| | | revisionModelUtil.copyFromDTOIgnore(codeBasicSecDTO, codeBasicSecDO); |
| | |
| | | /** |
| | | * 使用规则的主键获取对应的码段内容 |
| | | * |
| | | * @param conditionMap 规则的内容 |
| | | * @param ruleOid 规则的内容 |
| | | * @return 码段的内容 |
| | | */ |
| | | @Override |
| | | public List<CodeBasicSecVO> listCodeBasicSecByRuleOid(Map<String,Object> conditionMap)throws ServiceException { |
| | | if(Func.isBlank(conditionMap.getOrDefault("pkCodeRule","").toString())){ |
| | | public List<CodeBasicSecVO> listCodeBasicSecByRuleOid(String ruleOid)throws ServiceException { |
| | | if(StringUtils.isBlank(ruleOid)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | QueryWrapper<CodeBasicSec> wrapper = UBCSCondition.getQueryWrapper(conditionMap, CodeBasicSec.class); |
| | | wrapper.orderByAsc("orderNum"); |
| | | List<CodeBasicSec> secDOList = baseMapper.selectList(wrapper);//.selectByCondition(conditionMap, pageHelper); |
| | | LambdaQueryWrapper<CodeBasicSec> wrapper = Wrappers.<CodeBasicSec>query().lambda() |
| | | .eq(CodeBasicSec::getPkCodeRule, ruleOid) |
| | | .orderByAsc(CodeBasicSec::getOrderNum); |
| | | List<CodeBasicSec> secDOList = baseMapper.selectList(wrapper);// |
| | | return codeBasicSecDO2VOs(secDOList,true); |
| | | } |
| | | |