From 3fa020f26f0cfe21d4f769593d19d4cb2a657ae0 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 28 八月 2023 21:41:46 +0800 Subject: [PATCH] 提交采购单单调用aps接口创建质检单 --- api/v1/purchase/purchase.go | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-) diff --git a/api/v1/purchase/purchase.go b/api/v1/purchase/purchase.go index 4151621..c2b7c52 100644 --- a/api/v1/purchase/purchase.go +++ b/api/v1/purchase/purchase.go @@ -130,12 +130,12 @@ // GetPurchaseList // @Tags Purchase -// @Summary 鍒嗛〉鑾峰彇鏉冮檺閲囪喘鍗曞垪琛� +// @Summary 鍒嗛〉鑾峰彇閲囪喘鍗曞垪琛� // @Security ApiKeyAuth // @accept application/json // @Produce application/json // @Param data query request.PageInfo true "椤电爜, 姣忛〉澶у皬" -// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "鍒嗛〉鑾峰彇鏉冮檺閲囪喘鍗曞垪琛�,杩斿洖鍖呮嫭鍒楄〃,鎬绘暟,椤电爜,姣忛〉鏁伴噺" +// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "鍒嗛〉鑾峰彇閲囪喘鍗曞垪琛�,杩斿洖鍖呮嫭鍒楄〃,鎬绘暟,椤电爜,姣忛〉鏁伴噺" // @Router /purchase/purchaseList [get] func (e *PurchaseApi) GetPurchaseList(c *gin.Context) { var pageInfo request.PageInfo @@ -162,3 +162,27 @@ PageSize: pageInfo.PageSize, }, "鑾峰彇鎴愬姛", c) } + +// Submit +// @Tags Purchase +// @Summary 鎻愪氦閲囪喘鍗� +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param id path int true "閲囪喘鍗旾D" +// @Success 200 {object} response.Response{msg=string} "鎻愪氦閲囪喘鍗�" +// @Router /purchase/submit/{id} [post] +func (e *PurchaseApi) Submit(c *gin.Context) { + id, _ := strconv.Atoi(c.Param("id")) + if id == 0 { + response.FailWithMessage("鍙傛暟缂哄け", c) + return + } + err := service.NewPurchaseService().Submit(uint(id)) + if err != nil { + global.GVA_LOG.Error("鏇存柊澶辫触!", zap.Error(err)) + response.FailWithMessage("鏇存柊澶辫触", c) + return + } + response.OkWithMessage("鏇存柊鎴愬姛", c) +} -- Gitblit v1.8.0