| | |
| | | operation.ReceiverPhone = req.Phone |
| | | operation.ReceiverAddr = req.Address |
| | | operation.Source = req.Source |
| | | operation.OperationSource = constvar.OperationSource(req.OperationSource) |
| | | operation.CompanyID = int(req.ClientId) |
| | | operation.CompanyName = req.ClientName |
| | | if req.DeliverType == 1 { |
| | |
| | | } |
| | | |
| | | func (s *Server) OrderProductOutput(ctx context.Context, req *OrderProductOutputRequest) (resp *OrderProductOutputResponse, err error) { |
| | | resp = new(OrderProductOutputResponse) |
| | | if req.OrderNumber == "" || len(req.Products) == 0 { |
| | | return nil, errors.New("参数缺失") |
| | | } |
| | |
| | | productHasSendAmount[productNumber] = productHasSendAmount[productNumber].Add(locationSendAmount) |
| | | } |
| | | outputInfoList = append(outputInfoList, &service.OutputInfo{ |
| | | LocationID: int(locationID), |
| | | WarehouseID: int(LocationIDWarehouseIDMap[locationID]), |
| | | Products: productInfoList, |
| | | OperationID: 0, |
| | | SourceNumber: req.OrderNumber, |
| | | LocationID: int(locationID), |
| | | WarehouseID: int(LocationIDWarehouseIDMap[locationID]), |
| | | Products: productInfoList, |
| | | OperationID: 0, |
| | | SourceNumber: req.OrderNumber, |
| | | SaleDetailsNumber: req.OrderNumber, |
| | | }) |
| | | } |
| | | |
| | | err = service.AddOutputOperations(outputInfoList) |
| | | |
| | | if err != nil { |
| | | logx.Errorf("OrderProductOutput AddOutputOperations err:%v", err) |
| | | return nil, err |
| | | } |
| | | |
| | | resp.Code = 1 |
| | | resp.Msg = "success" |
| | | return nil, nil |
| | | return resp, nil |
| | | } |