| | |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | operationResp := make([]*OperationResponse, 0) |
| | | for _, list := range req.List { |
| | | var operation models.Operation |
| | | var details []*models.OperationDetails |
| | | var or OperationResponse |
| | | operation.SourceNumber = list.SourceNumber |
| | | operation.OperationDate = timex.TimeToString2(time.Now()) |
| | | operation.Number = strconv.FormatInt(time.Now().Unix(), 10) |
| | |
| | | operation.FromLocationID = fromLocation.Id |
| | | operation.ToLocationID = toLocation.Id |
| | | operation.BaseOperationType = constvar.BaseOperationTypeOutgoing |
| | | operation.Source = req.Source |
| | | or.WorkOrderId = operation.SourceNumber |
| | | or.Number = operation.Number |
| | | operationResp = append(operationResp, &or) |
| | | if req.OperationType == 1 { |
| | | operation.BaseOperationType = constvar.BaseOperationTypeIncoming |
| | | } |
| | |
| | | } |
| | | err = models.NewOperationSearch().CreateBatch(operations) |
| | | resp := new(CreateOperationListResponse) |
| | | resp.List = operationResp |
| | | return resp, err |
| | | } |