jiangshuai
2023-11-03 015c07410b59bafd606bd4f567a61355c4f15958
controllers/report_forms_controller.go
@@ -132,7 +132,7 @@
   if params.PageInfo.Check() {
      detailsSearch.SetPage(params.Page, params.PageSize)
   }
   details, err := detailsSearch.SetProductId(params.ProduceId).FindNotTotal()
   details, total, err := detailsSearch.SetProductId(params.ProduceId).Find()
   if err != nil {
      util.ResponseFormat(c, code.RequestParamError, "查询操作详情失败")
      return
@@ -142,8 +142,8 @@
      operationIds = append(operationIds, detail.OperationID)
   }
   //获取已完成的操作记录
   operations, total, err := models.NewOperationSearch().SetIds(operationIds).SetBaseOperationType(params.BaseOperationType).
      SetStatus(constvar.OperationStatus_Finish).Find()
   operations, err := models.NewOperationSearch().SetIds(operationIds).SetBaseOperationType(params.BaseOperationType).
      SetStatus(constvar.OperationStatus_Finish).FindNotTotal()
   if err != nil {
      util.ResponseFormat(c, code.RequestParamError, "查询操作记录失败")
      return
@@ -152,8 +152,8 @@
   for _, detail := range details {
      var resp response.InventoryHistory
      resp.Amount = detail.Amount
      resp.Unit = params.Unit
      resp.ProductName = params.ProductName
      resp.Unit = detail.Product.Unit
      resp.ProductName = detail.Product.Name
      for _, operation := range operations {
         if detail.OperationID == operation.Id {
            resp.Number = operation.Number
@@ -162,6 +162,7 @@
            resp.ContactedName = operation.ContacterName
            resp.FromLocation = operation.FromLocation.Name
            resp.ToLocation = operation.ToLocation.Name
            resp.BaseOperationType = operation.BaseOperationType
            result = append(result, resp)
            break
         }