| | |
| | | //检查明细部分 |
| | | for _, v := range params.Details { |
| | | if v.ProductId == "" { |
| | | return errors.New("productID为0") |
| | | return errors.New("productID为空") |
| | | } |
| | | if v.ProductName == "" { |
| | | return errors.New("产品名称异常") |
| | |
| | | // @Param object body request.UpdateOperation true "入库信息" |
| | | // @Param id path int true "入库信息id" |
| | | // @Success 200 {object} util.Response "成功" |
| | | // @Router /api-wms/v1/operation/operation/{id} [put] |
| | | // @Router /api-wms/v1/operation/operation/{id} [post] |
| | | func (slf OperationController) Update(c *gin.Context) { |
| | | id := cast.ToUint(c.Param("id")) |
| | | if id == 0 { |
| | |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | fmt.Printf("%+v\n", *reqParams.Details[0]) |
| | | fmt.Printf("%+v\n", *reqParams.Details[1]) |
| | | fmt.Println("===============================================") |
| | | fmt.Printf("%+v\n", *params.Details[0]) |
| | | fmt.Printf("%+v\n", *params.Details[1]) |
| | | if err := models.WithTransaction(func(tx *gorm.DB) error { |
| | | if err := models.NewOperationDetailsSearch().SetOrm(tx).SetOperationId(params.Id).Delete(); err != nil { |
| | | return err |