| | |
| | | inputProductMap := make(map[string]*response.StoreInfo) |
| | | outputProductMap := make(map[string]*response.OutputSimpleInfo) |
| | | for _, v := range grpcOutputList { |
| | | if productMap[v.Number] == nil { |
| | | continue |
| | | } |
| | | if outputProductMap[v.Number] == nil { |
| | | simpleInfo := &response.OutputSimpleInfo{ |
| | | Number: v.Number, |
| | |
| | | } |
| | | } |
| | | for _, v := range grpcInputList { |
| | | if productMap[v.Number] == nil { |
| | | continue |
| | | } |
| | | if inputProductMap[v.Number] == nil { |
| | | storeInfo := &response.StoreInfo{ |
| | | Number: v.Number, |
| | |
| | | storeInfo := inputProductMap[product.Number] |
| | | if storeInfo == nil { //没有入库信息 |
| | | storeInfo = &response.StoreInfo{ |
| | | Name: product.Number, |
| | | Name: product.Name, |
| | | Number: product.Number, |
| | | OrderAmount: product.Amount, |
| | | FinishAmount: decimal.Decimal{}, |
| | |
| | | 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 发货明细 |