| | |
| | | "wms/opa" |
| | | "wms/pkg/logx" |
| | | "wms/pkg/structx" |
| | | "wms/proto/client" |
| | | "wms/proto/product_inventory" |
| | | "wms/proto/purchase_wms" |
| | | "wms/proto/supplier" |
| | | "wms/request" |
| | | "wms/service" |
| | | "wms/utils/http" |
| | | "wms/utils/upload" |
| | | ) |
| | |
| | | OperationTypeId: operation.OperationTypeId, |
| | | OperationTypeName: operation.OperationTypeName, |
| | | OperationId: operation.Id, |
| | | ProductId: v.ProductId, |
| | | ProductName: v.Product.Name, |
| | | Amount: v.Amount, |
| | | Unit: v.Product.Unit, |
| | |
| | | } |
| | | if err := db.Model(&models.MoveHistory{}).Create(&histories).Error; err != nil { |
| | | return err |
| | | } |
| | | for _, history := range histories { |
| | | service.AddNewHistoryReportRecord(history.Id) |
| | | } |
| | | return nil |
| | | } |
| | |
| | | } |
| | | util.ResponseFormat(c, code.Success, resp.List) |
| | | } |
| | | |
| | | // GetClientList |
| | | // @Tags 入库/出库 |
| | | // @Summary 获取物流公司列表 |
| | | // @Produce application/json |
| | | // |
| | | // @Success 200 {object} util.Response "成功" |
| | | // |
| | | // @Router /api-wms/v1/operation/getClientList [get] |
| | | func (slf OperationController) GetClientList(c *gin.Context) { |
| | | cli := client.NewClientServiceClient(client.ClientConn) |
| | | resp, err := cli.GetClientList(c, &client.ClientListRequest{}) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "grpc调用失败:"+err.Error()) |
| | | return |
| | | } |
| | | util.ResponseFormat(c, code.Success, resp.List) |
| | | } |