| | |
| | | private void validateItemReceiptSaveData(MesWmItemReceiptSaveReqVO reqVO) { |
| | | // 校验编码唯一 |
| | | validateCodeUnique(reqVO.getId(), reqVO.getCode()); |
| | | // 校验供应商存在(采购入库使用 ERP 供应商) |
| | | // 校验供应商存在(采购入库使用 ERP 供应商);供应商已改为可选,允许手工填写名称,此时不校验主数据 |
| | | if (reqVO.getVendorId() != null) { |
| | | srmSupplierApi.getSupplier(reqVO.getVendorId()); |
| | | } |
| | | // 校验到货通知单存在 |
| | | if (reqVO.getNoticeId() != null) { |
| | | MesWmArrivalNoticeDO notice = arrivalNoticeService.validateArrivalNoticeReadyForReceipt(reqVO.getNoticeId()); |
| | | if (ObjUtil.notEqual(notice.getVendorId(), reqVO.getVendorId())) { |
| | | // 仅在选择了供应商主数据时才比对与到货通知单的一致性;手填供应商名称时跳过 |
| | | if (reqVO.getVendorId() != null && ObjUtil.notEqual(notice.getVendorId(), reqVO.getVendorId())) { |
| | | throw exception(WM_ARRIVAL_NOTICE_VENDOR_MISMATCH); |
| | | } |
| | | } |