| | |
| | | } else { |
| | | // 过程检验/出厂检验:通过关联关系查询销售台账的客户 |
| | | customerValue = inspect.getCustomer(); // 默认使用直接存储的客户 |
| | | Long workOrderId = inspect.getWorkOrderId(); |
| | | if (inspect.getProductMainId() != null) { |
| | | // 通过报工ID查询工单 |
| | | ProductionProductMain productMain = productionProductMainMapper.selectById(inspect.getProductMainId()); |
| | | if (productMain != null && productMain.getWorkOrderId() != null) { |
| | | ProductWorkOrder workOrder = productWorkOrderMapper.selectById(productMain.getWorkOrderId()); |
| | | if (productMain != null) { |
| | | workOrderId = productMain.getWorkOrderId(); |
| | | } |
| | | } |
| | | if (workOrderId != null) { |
| | | ProductWorkOrder workOrder = productWorkOrderMapper.selectById(workOrderId); |
| | | if (workOrder != null && workOrder.getProductOrderId() != null) { |
| | | ProductOrder productOrder = productOrderMapper.selectById(workOrder.getProductOrderId()); |
| | | if (productOrder != null && productOrder.getSalesLedgerId() != null) { |
| | | SalesLedger salesLedger = salesLedgerMapper.selectById(productOrder.getSalesLedgerId()); |
| | | if (salesLedger != null && salesLedger.getCustomerName() != null) { |
| | | customerValue = salesLedger.getCustomerName(); |
| | | } |
| | | } |
| | | } |
| | | } |