소스 검색

库存调拨修改

28169 2 년 전
부모
커밋
d86dbc110a
2개의 변경된 파일15개의 추가작업 그리고 9개의 파일을 삭제
  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 파일 보기

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

+ 7 - 0
service/inspection_service.go 파일 보기

39
 	return advice, err
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
 func CreatePatientInspection(inspectins []models.Inspection) (err error) {
49
 func CreatePatientInspection(inspectins []models.Inspection) (err error) {
43
 	if len(inspectins) == 0 {
50
 	if len(inspectins) == 0 {
44
 		err = errors.New("Inspections Cant be nil.")
51
 		err = errors.New("Inspections Cant be nil.")