| | |
| | | ctx.OkWithDetailed(nil) |
| | | } |
| | | |
| | | // confirmOutputOver |
| | | // @Tags SalesDetails |
| | | // @Summary 确认发货 |
| | | // @Produce application/json |
| | | // @Param object body request.ConfirmOutputOver true "明细编码" |
| | | // @Success 200 {object} response.ListResponse |
| | | // @Router /api/salesDetails/confirmOutputOver [post] |
| | | func (s *SalesDetailsApi) ConfirmOutputOver(c *gin.Context) { |
| | | var params request.ConfirmOutput |
| | | ctx, ok := contextx.NewContext(c, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.SaleDetailNumber == "" { |
| | | ctx.FailWithMsg(ecode.ParamsErr, "参数缺失") |
| | | return |
| | | } |
| | | |
| | | salesDetails, err := salesDetailsService.GetSalesDetailsByNumber(params.SaleDetailNumber) |
| | | if err == gorm.ErrRecordNotFound || salesDetails.Number != params.SaleDetailNumber { |
| | | ctx.FailWithMsg(ecode.ParamsErr, "销售订单不存在") |
| | | return |
| | | } |
| | | |
| | | err = model.NewSalesDetailsSearch().SetId(salesDetails.Id).UpdateByMap(map[string]interface{}{"status": constvar.OverOutbound}) |
| | | |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.DBErr, "修改失败") |
| | | return |
| | | } |
| | | |
| | | ctx.OkWithDetailed(nil) |
| | | } |
| | | |
| | | // GetDeliveryList |
| | | // @Tags SalesDetails |
| | | // @Summary 发货明细 |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api/salesDetails/confirmOutputOver": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "SalesDetails" |
| | | ], |
| | | "summary": "确认发货", |
| | | "parameters": [ |
| | | { |
| | | "description": "明细编码", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.ConfirmOutputOver" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "OK", |
| | | "schema": { |
| | | "$ref": "#/definitions/response.ListResponse" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api/salesDetails/delete": { |
| | | "delete": { |
| | | "produces": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.ConfirmOutputOver": { |
| | | "type": "object", |
| | | "properties": { |
| | | "saleDetailNumber": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.ConfirmOutputProducts": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api/salesDetails/confirmOutputOver": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "SalesDetails" |
| | | ], |
| | | "summary": "确认发货", |
| | | "parameters": [ |
| | | { |
| | | "description": "明细编码", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.ConfirmOutputOver" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "OK", |
| | | "schema": { |
| | | "$ref": "#/definitions/response.ListResponse" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api/salesDetails/delete": { |
| | | "delete": { |
| | | "produces": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.ConfirmOutputOver": { |
| | | "type": "object", |
| | | "properties": { |
| | | "saleDetailNumber": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.ConfirmOutputProducts": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | saleDetailNumber: |
| | | type: string |
| | | type: object |
| | | request.ConfirmOutputOver: |
| | | properties: |
| | | saleDetailNumber: |
| | | type: string |
| | | type: object |
| | | request.ConfirmOutputProducts: |
| | | properties: |
| | | number: |
| | |
| | | summary: 确认发货 |
| | | tags: |
| | | - SalesDetails |
| | | /api/salesDetails/confirmOutputOver: |
| | | post: |
| | | parameters: |
| | | - description: 明细编码 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.ConfirmOutputOver' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: OK |
| | | schema: |
| | | $ref: '#/definitions/response.ListResponse' |
| | | summary: 确认发货 |
| | | tags: |
| | | - SalesDetails |
| | | /api/salesDetails/delete: |
| | | delete: |
| | | parameters: |
| | |
| | | Products []ConfirmOutputProducts `json:"products"` |
| | | } |
| | | |
| | | // ConfirmOutputOver 确认发货完成 |
| | | type ConfirmOutputOver struct { |
| | | SaleDetailNumber string `json:"saleDetailNumber"` |
| | | } |
| | | |
| | | type ConfirmOutputProducts struct { |
| | | Number string `json:"number"` //产品编号 |
| | | OutputAmount decimal.Decimal `json:"outputAmount"` //本次发货数量 |
| | |
| | | salesDetailsRouter.POST("getDeliveryPrepareInfo", salesDetailsApi.GetDeliveryPrepareInfo) // 发货准备 |
| | | salesDetailsRouter.POST("getDeliveryList", salesDetailsApi.GetDeliveryList) // 发货明细 |
| | | salesDetailsRouter.POST("confirmOutput", salesDetailsApi.ConfirmOutput) // 确认发货 |
| | | salesDetailsRouter.POST("confirmOutputOver", salesDetailsApi.ConfirmOutputOver) // 发货完成 |
| | | |
| | | } |
| | | } |