Bladeren bron

库存调拨修改

28169 2 jaren geleden
bovenliggende
commit
d86dbc110a
2 gewijzigde bestanden met toevoegingen van 15 en 9 verwijderingen
  1. 8 9
      controllers/mobile_api_controllers/dialysis_api_controller.go
  2. 7 0
      service/inspection_service.go

+ 8 - 9
controllers/mobile_api_controllers/dialysis_api_controller.go Bestand weergeven

@@ -1,23 +1,22 @@
1 1
 package mobile_api_controllers
2 2
 
3 3
 import (
4
-	"encoding/json"
5
-	"errors"
6
-	"fmt"
7
-	"github.com/jinzhu/gorm"
8
-	"reflect"
9
-	"strconv"
10
-	"strings"
11
-	"time"
12
-
13 4
 	"XT_New/enums"
14 5
 	"XT_New/models"
15 6
 	"XT_New/service"
16 7
 	"XT_New/utils"
8
+	"encoding/json"
9
+	"errors"
10
+	"fmt"
17 11
 	"github.com/astaxie/beego"
12
+	"github.com/jinzhu/gorm"
18 13
 	"math"
19 14
 	"net/http"
20 15
 	"net/url"
16
+	"reflect"
17
+	"strconv"
18
+	"strings"
19
+	"time"
21 20
 )
22 21
 
23 22
 // type DialysisTestAPIController struct {

+ 7 - 0
service/inspection_service.go Bestand weergeven

@@ -39,6 +39,13 @@ func GetAdvicesByPrescription(orgid int64, patientid int64, recorddate int64) (m
39 39
 	return advice, err
40 40
 }
41 41
 
42
+func UpdateDoctorAdvieById(id int64, prescription_number float64) (models.DoctorAdvice, error) {
43
+
44
+	advice := models.DoctorAdvice{}
45
+	err := XTWriteDB().Model(&advice).Where("id=? and status= 1", id).Updates(map[string]interface{}{"prescribing_number": prescription_number}).Error
46
+	return advice, err
47
+}
48
+
42 49
 func CreatePatientInspection(inspectins []models.Inspection) (err error) {
43 50
 	if len(inspectins) == 0 {
44 51
 		err = errors.New("Inspections Cant be nil.")