| | |
| | | throw new ServiceException("存在重复的出库单"); |
| | | } |
| | | } |
| | | // 油品出库按客户拆成多条绑定行,与出库单是两个独立的 id 空间,必须分开判重 |
| | | String stockOutBindingIds = accountInvoiceApplication.getStockOutBindingIds(); |
| | | if (stockOutBindingIds != null && !stockOutBindingIds.isEmpty()) { |
| | | List<Long> bindingIds = Arrays.stream(stockOutBindingIds.split(",")) |
| | | .map(Long::valueOf) |
| | | .toList(); |
| | | if (accountInvoiceApplicationMapper.existsByStockOutBindingId(bindingIds)){ |
| | | throw new ServiceException("存在重复的出库单"); |
| | | } |
| | | } |
| | | return save(accountInvoiceApplication); |
| | | } |
| | | |
| | |
| | | return removeBatchByIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<AccountInvoiceApplicationVo> getAccountInvoiceApplicationList(Integer customerId) { |
| | | return accountInvoiceApplicationMapper.selectAccountInvoiceApplicationList(customerId); |
| | | } |
| | | |
| | | private String genInvoiceApplicationNo() { |
| | | return "KP" + LocalDateTime.now().format(CODE_TIME_FORMATTER) + new Random().nextInt(10); |
| | | } |