| | |
| | | * @return 执行结果 |
| | | * @throws VciBaseException 参数为空,唯一项,必输项不通过时会抛出异常 |
| | | */ |
| | | @Override |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addSave(CodeBasicSecDTO codeBasicSecDTO) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO, "需要添加的数据对象",codeBasicSecDTO.getPkCodeRule(),"编码规则的主键"); |
| | |
| | | //引用码段的时候,需要判断参照的信息是否正确 |
| | | 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); |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean editSave(CodeBasicSecDTO codeBasicSecDTO) throws VciBaseException { |
| | | public boolean editSave(CodeBasicSecDTO codeBasicSecDTO) throws ServerException { |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO, "需要添加的数据对象"); |
| | | KeyValue attrKv = checkAttrNullableBySecType(codeBasicSecDTO); |
| | | if (! "success".equals(attrKv.getKey())){ |
| | | if (!"success".equals(attrKv.getKey())){ |
| | | throw new VciBaseException(attrKv.getValue() + "不能为空"); |
| | | } |
| | | //将DTO转换为DO |
| | |
| | | codeReferConfigService.insert(codeReferConfigVO); |
| | | } |
| | | } |
| | | |
| | | // revisionModelUtil.copyFromDTOIgnore(codeBasicSecDTO, codeBasicSecDO);//此处的拷贝会把referValueInfo的值给覆盖掉,需要重新赋值 |
| | | // revisionModelUtil.copyFromDTOIgnore(codeBasicSecDTO, codeBasicSecDO);//此处的拷贝会把referValueInfo的值给覆盖掉,需要重新赋值 |
| | | BaseModel tempModel = new BaseModel(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeBasicSecDO, tempModel); |
| | | BeanUtil.copyProperties(codeBasicSecDTO, codeBasicSecDO,"referValueInfo"); |
| | |
| | | codeBasicSecDO.setDescription(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField("description", codeBasicSecDTO))); |
| | | |
| | | resBoolean = codeBasicSecMapper.updateById(codeBasicSecDO)>0; |
| | | // 从分类码段或固定码段改为其他码段时,判断用户是否选择了清空码值 |
| | | if(codeBasicSecDTO.getIsClearValue()){ |
| | | // 分类码值清空 |
| | | if(codeBasicSecDTO.getSecType().equals(CodeSecTypeEnum.CODE_CLASSIFY_SEC.getValue())){ |
| | | codeClassifyValueService.deleteClassifyValueBySecOid(codeBasicSecDTO.getOid()); |
| | | }else { |
| | | //固定码值清空 |
| | | fixedValueService.deleteFixedValueBySecOid(codeBasicSecDTO.getOid()); |
| | | } |
| | | } |
| | | //SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | if(StringUtils.isNotBlank(codeBasicSecDO.getCodeFillSeparator())){ |
| | | DictBiz dictBiz = new DictBiz(); |
| | |
| | | wrapper = Wrappers.<CodeBasicSec>query().lambda() |
| | | .eq(CodeBasicSec::getPkCodeRule,codeRuleVO.getOid()) |
| | | .eq(CodeBasicSec::getSerialDependFlag,"true") |
| | | .orderByAsc(CodeBasicSec::getSerialDependOrder); |
| | | .orderByAsc(CodeBasicSec::getOrderNum); |
| | | //.orderByAsc(CodeBasicSec::getSerialDependOrder); |
| | | List<CodeBasicSec> codeBasicSecList = this.list(wrapper); |
| | | if(!CollectionUtils.isEmpty(codeBasicSecList)){ |
| | | List<CodeBasicSecVO> codeBasicSecVOS = codeBasicSecDO2VOs(codeBasicSecList); |
| | |
| | | .eq(CodeBasicSec::getPkCodeRule,codeRuleOid) |
| | | .in(CodeBasicSec::getOid,codeBasicSecOidList) |
| | | .eq(CodeBasicSec::getSerialDependFlag,"true") |
| | | .orderByAsc(CodeBasicSec::getSerialDependOrder); |
| | | //TODO: SerialDependOrder本来是用来流水排序的,但是现在的逻辑是按照orderuNum排序的 |
| | | .orderByAsc(CodeBasicSec::getOrderNum); //.orderByAsc(CodeBasicSec::getSerialDependOrder); |
| | | List<CodeBasicSec> codeBasicSecList = this.list(wrapper); |
| | | |
| | | //按流水依赖顺序,处理流水依赖码段的值 |
| | |
| | | .eq(CodeBasicSec::getPkCodeRule,codeRuleOid) |
| | | .in(CodeBasicSec::getOid,codeBasicSecOidList) |
| | | .eq(CodeBasicSec::getSerialDependFlag,"true") |
| | | .orderByAsc(CodeBasicSec::getSerialDependOrder); |
| | | .orderByAsc(CodeBasicSec::getOrderNum); //.orderByAsc(CodeBasicSec::getSerialDependOrder); |
| | | |
| | | List<CodeBasicSec> codeBasicSecList = this.list(wrapper); |
| | | //按流水依赖顺序,处理流水依赖码段的值 |
| | | List<String> serialDependValueList = new ArrayList<>(); |