| | |
| | | "outsourcing/extend/code" |
| | | "outsourcing/extend/util" |
| | | "outsourcing/models" |
| | | "outsourcing/pkg/logx" |
| | | "outsourcing/pkg/structx" |
| | | "outsourcing/request" |
| | | "outsourcing/service" |
| | | "outsourcing/service/outsourcing" |
| | | ) |
| | | |
| | | type OrderController struct{} |
| | |
| | | } |
| | | util.ResponseFormat(c, code.Success, list) |
| | | } |
| | | |
| | | // MaterialSearch |
| | | // @Tags 订单管理 |
| | | // @Summary 物料搜索 |
| | | // @Produce application/json |
| | | // @Param object body request.MaterialSearch true "参数" |
| | | // @Success 200 {object} util.ResponseList{[]models.OutsourcingOrderDeliveryDetails} "成功" |
| | | // @Router /api-outsourcing/v1/order/materialSearch [post] |
| | | func (slf *OrderController) MaterialSearch(c *gin.Context) { |
| | | var params request.MaterialSearch |
| | | if err := c.BindJSON(¶ms); err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误") |
| | | return |
| | | } |
| | | client := outsourcing.NewOutsourcingServiceClient(service.ApsServiceConn) |
| | | list, err := client.GetMaterialList(c, &outsourcing.GetMaterialListRequest{ |
| | | Page: int32(params.Page), |
| | | PageSize: int32(params.PageSize), |
| | | Keyword: params.Keyword, |
| | | }) |
| | | if err != nil { |
| | | logx.Errorf("grpc outsourcing GetProductList err:%v", err) |
| | | util.ResponseFormat(c, code.RequestParamError, "查询失败") |
| | | return |
| | | } |
| | | util.ResponseFormat(c, code.Success, list) |
| | | } |