XMLWAN il y a 4 ans
Parent
révision
fa8b28d9e0

+ 4 - 0
controllers/his_api_controller.go Voir le fichier

@@ -625,6 +625,8 @@ func (c *HisApiController) CreateHisPatientCaseHistory() {
625 625
 	remark := c.GetString("remark")
626 626
 	breathingfloat, _ := strconv.ParseFloat(breathing, 64)
627 627
 	fmt.Println("breathingfloat", breathingfloat)
628
+	sick, _ := c.GetInt64("sick")
629
+	diagnose, _ := c.GetInt64("diagnose")
628 630
 	timeLayout := "2006-01-02"
629 631
 	loc, _ := time.LoadLocation("Local")
630 632
 	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
@@ -671,6 +673,8 @@ func (c *HisApiController) CreateHisPatientCaseHistory() {
671 673
 		Breathing:               breathingfloat,
672 674
 		DoctorAdvice:            doctor_advice,
673 675
 		Remark:                  remark,
676
+		Sick:                    sick,
677
+		Diagnose:                diagnose,
674 678
 	}
675 679
 
676 680
 	err = service.SaveHisPatientCaseHistory(&caseHistory)

+ 6 - 0
controllers/stock_good_api_controller.go Voir le fichier

@@ -37,6 +37,8 @@ func StockGoodApiRegistRouters() {
37 37
 func (c *StockGoodApiController) CreateGoodType() {
38 38
 	type_name := c.GetString("type_name")
39 39
 	remark := c.GetString("remark")
40
+	out_stock := c.GetString("out_stock")
41
+	outStockInt, _ := strconv.ParseInt(out_stock, 10, 64)
40 42
 	adminUserInfo := c.GetAdminUserInfo()
41 43
 	totals := service.FindGoodTypeByName(type_name, adminUserInfo.CurrentOrgId)
42 44
 	if totals > 0 {
@@ -56,6 +58,7 @@ func (c *StockGoodApiController) CreateGoodType() {
56 58
 		OrgId:    adminUserInfo.CurrentOrgId,
57 59
 		Creater:  adminUserInfo.AdminUser.Id,
58 60
 		Status:   1,
61
+		OutStock: outStockInt,
59 62
 	}
60 63
 	err, types := service.AddSigleGoodType(&goodType)
61 64
 	if err == nil {
@@ -72,6 +75,8 @@ func (c *StockGoodApiController) ModifyGoodType() {
72 75
 	type_name := c.GetString("type_name")
73 76
 	remark := c.GetString("remark")
74 77
 	good_type_code := c.GetString("type_code")
78
+	out_stock := c.GetString("out_stock")
79
+	outStockInt, _ := strconv.ParseInt(out_stock, 10, 64)
75 80
 	adminUserInfo := c.GetAdminUserInfo()
76 81
 
77 82
 	//totals := service.FindGoodTypeByName(type_name, adminUserInfo.CurrentOrgId)
@@ -90,6 +95,7 @@ func (c *StockGoodApiController) ModifyGoodType() {
90 95
 		OrgId:    adminUserInfo.CurrentOrgId,
91 96
 		Modifier: adminUserInfo.AdminUser.Id,
92 97
 		Status:   1,
98
+		OutStock: outStockInt,
93 99
 	}
94 100
 	err, types := service.ModifyGoodType(&goodType)
95 101
 	if err == nil {

+ 1 - 0
models/good_models.go Voir le fichier

@@ -13,6 +13,7 @@ type GoodsType struct {
13 13
 	Status   int64  `gorm:"column:status" json:"status"`
14 14
 	Type     int64  `gorm:"column:type" json:"type"`
15 15
 	Number   int64  `gorm:"column:number" json:"number"`
16
+	OutStock int64  `gorm:"column:out_stock" json:"out_stock" form:"out_stock"`
16 17
 }
17 18
 
18 19
 func (GoodsType) TableName() string {

+ 2 - 0
models/his_models.go Voir le fichier

@@ -259,6 +259,8 @@ type HisPatientCaseHistory struct {
259 259
 	Breathing               float64 `gorm:"column:breathing" json:"breathing" form:"breathing"`
260 260
 	DoctorAdvice            string  `gorm:"column:doctor_advice" json:"doctor_advice" form:"doctor_advice"`
261 261
 	Remark                  string  `gorm:"column:remark" json:"remark" form:"remark"`
262
+	Sick                    int64   `gorm:"column:sick" json:"sick" form:"sick"`
263
+	Diagnose                int64   `gorm:"column:diagnose" json:"diagnose" form:"diagnose"`
262 264
 }
263 265
 
264 266
 func (HisPatientCaseHistory) TableName() string {

+ 2 - 1
service/stock_service.go Voir le fichier

@@ -133,6 +133,7 @@ func ModifyGoodType(goodType *models.GoodsType) (error, *models.GoodsType) {
133 133
 		"mtime":     time.Now().Unix(),
134 134
 		"remark":    goodType.Remark,
135 135
 		"type_name": goodType.TypeName,
136
+		"out_stock": goodType.OutStock,
136 137
 	}).Error
137 138
 	return err, goodType
138 139
 
@@ -279,7 +280,7 @@ func FindGoodInfoById(id int64) (*models.GoodInfo, error) {
279 280
 }
280 281
 
281 282
 func FindAllGoodType(org_id int64) (goodType []*models.GoodsType, err error) {
282
-	err = readDb.Model(&models.GoodsType{}).Where("org_id = ? AND status = 1", org_id).Find(&goodType).Error
283
+	err = readDb.Model(&models.GoodsType{}).Where("org_id = ? AND status = 1 and out_stock = 1", org_id).Find(&goodType).Error
283 284
 	return goodType, err
284 285
 }
285 286