| | |
| | | private void validateProductSalesSaveData(Long id, MesWmProductSalesSaveReqVO reqVO) { |
| | | // 校验编码唯一 |
| | | validateCodeUnique(id, reqVO.getCode()); |
| | | // 校验客户存在 |
| | | customerApi.validateCustomer(reqVO.getClientId()); |
| | | // 校验客户存在(仅关联客户档案时;手工填写客户名称不校验) |
| | | if (reqVO.getClientId() != null) { |
| | | customerApi.validateCustomer(reqVO.getClientId()); |
| | | } |
| | | // 校验发货通知单 |
| | | if (reqVO.getNoticeId() != null) { |
| | | MesWmSalesNoticeDO notice = salesNoticeService.validateSalesNoticeExists(reqVO.getNoticeId()); |
| | | if (ObjUtil.notEqual(notice.getStatus(), MesWmSalesNoticeStatusEnum.APPROVED.getStatus())) { |
| | | throw exception(WM_SALES_NOTICE_STATUS_NOT_APPROVED); |
| | | } |
| | | if (ObjUtil.notEqual(notice.getClientId(), reqVO.getClientId())) { |
| | | if (reqVO.getClientId() != null && ObjUtil.notEqual(notice.getClientId(), reqVO.getClientId())) { |
| | | throw exception(WM_SALES_NOTICE_CLIENT_MISMATCH); |
| | | } |
| | | } |