| | |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciDateUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | if( distinctCodeAllCOdes.size() != addCodeDOs.size() ){ |
| | | throw new VciBaseException("编码数据重复,无法保存,请注意!"); |
| | | } |
| | | QueryWrapper<CodeAllCode> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("CREATECODEBTM",addCodeDOs.get(0).getCreateCodeBtm()); |
| | | wrapper.in("ID",addCodeDOs.stream().map(CodeAllCode::getId).collect(Collectors.toList())); |
| | | if(codeAllCodeService.count(wrapper)>0){ |
| | | throw new ServiceException("生成编码数据ID已有历史记录请确认!!"); |
| | | } |
| | | codeAllCodeService.saveBatch(addCodeDOs); |
| | | } |
| | | mdmEngineService.insertBatchByType(dataCBOList.get(0).getBtmname(),dataCBOList); |
| | |
| | | Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(CodeAllCode::getId))), |
| | | ArrayList::new)); |
| | | if( distinctCodeAllCOdes.size() != allCodeDOList.size() ){ |
| | | throw new VciBaseException("编码数据重复,无法保存,请注意!"); |
| | | throw new ServiceException("编码数据重复,无法保存,请注意!"); |
| | | } |
| | | QueryWrapper<CodeAllCode> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("CREATECODEBTM",allCodeDOList.get(0).getCreateCodeBtm()); |
| | | wrapper.in("ID",allCodeDOList.stream().map(CodeAllCode::getId).collect(Collectors.toList())); |
| | | if(codeAllCodeService.count(wrapper)>0){ |
| | | throw new ServiceException("生成编码数据ID已有历史记录请确认!!"); |
| | | } |
| | | codeAllCodeService.saveBatch(allCodeDOList); |
| | | // iCodeWupinService.saveBatch(dataCBOList); |