XMLWAN 4 年之前
父節點
當前提交
37084355a7

+ 2 - 2
controllers/base_api_controller.go 查看文件

81
 		//userAdmin.ModifyTime = 1530786071
81
 		//userAdmin.ModifyTime = 1530786071
82
 		//var subscibe models.ServeSubscibe
82
 		//var subscibe models.ServeSubscibe
83
 		//subscibe.ID = 1
83
 		//subscibe.ID = 1
84
-		//subscibe.OrgId = 7957
84
+		//subscibe.OrgId = 3877
85
 		//subscibe.PeriodStart = 1538035409
85
 		//subscibe.PeriodStart = 1538035409
86
 		//subscibe.PeriodEnd = 1569571409
86
 		//subscibe.PeriodEnd = 1569571409
87
 		//subscibe.State = 1
87
 		//subscibe.State = 1
91
 		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
91
 		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
92
 		//subscibes[4] = &subscibe
92
 		//subscibes[4] = &subscibe
93
 		//var adminUserInfo service.AdminUserInfo
93
 		//var adminUserInfo service.AdminUserInfo
94
-		//adminUserInfo.CurrentOrgId = 7957
94
+		//adminUserInfo.CurrentOrgId = 3877
95
 		//adminUserInfo.CurrentAppId = 18
95
 		//adminUserInfo.CurrentAppId = 18
96
 		//adminUserInfo.AdminUser = &userAdmin
96
 		//adminUserInfo.AdminUser = &userAdmin
97
 		//adminUserInfo.Subscibes = subscibes
97
 		//adminUserInfo.Subscibes = subscibes

+ 0 - 1
controllers/mobile_api_controllers/admin_user_api_controller.go 查看文件

73
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBUpdate)
73
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBUpdate)
74
 		return
74
 		return
75
 	}
75
 	}
76
-
77
 	c.ServeSuccessJSON(map[string]interface{}{
76
 	c.ServeSuccessJSON(map[string]interface{}{
78
 		"electronic_signature": es,
77
 		"electronic_signature": es,
79
 	})
78
 	})

+ 2 - 2
controllers/mobile_api_controllers/login_api_controller.go 查看文件

32
 	}
32
 	}
33
 	ip := utils.GetIP(this.Ctx.Request)
33
 	ip := utils.GetIP(this.Ctx.Request)
34
 
34
 
35
-	//ssoDomain := beego.AppConfig.String("sso_domain")
36
-	ssoDomain := "http://localhost:8091"
35
+	ssoDomain := beego.AppConfig.String("sso_domain")
36
+	//ssoDomain := "http://localhost:8091"
37
 	api := ssoDomain + "/m/login/pwd"
37
 	api := ssoDomain + "/m/login/pwd"
38
 	values := make(url.Values)
38
 	values := make(url.Values)
39
 	values.Set("mobile", mobile)
39
 	values.Set("mobile", mobile)

+ 0 - 1
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go 查看文件

2674
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBUpdate)
2674
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBUpdate)
2675
 		return
2675
 		return
2676
 	}
2676
 	}
2677
-	fmt.Println("esss-================", es)
2678
 	this.ServeSuccessJSON(map[string]interface{}{
2677
 	this.ServeSuccessJSON(map[string]interface{}{
2679
 		"electronic_signature": es,
2678
 		"electronic_signature": es,
2680
 	})
2679
 	})

+ 2 - 0
models/common_models.go 查看文件

16
 	Unit            string `gorm:"column:unit" json:"unit" form:"unit"`
16
 	Unit            string `gorm:"column:unit" json:"unit" form:"unit"`
17
 	ProjectName     string `gorm:"column:project_name" json:"project_name" form:"project_name"`
17
 	ProjectName     string `gorm:"column:project_name" json:"project_name" form:"project_name"`
18
 	ItemName        string `gorm:"column:item_name" json:"item_name" form:"item_name"`
18
 	ItemName        string `gorm:"column:item_name" json:"item_name" form:"item_name"`
19
+	IsStatus        int64  `gorm:"column:is_status" json:"is_status" form:"is_status"`
19
 }
20
 }
20
 
21
 
21
 type XtQualityControlStandard struct {
22
 type XtQualityControlStandard struct {
31
 	LargeRange      string `gorm:"column:large_range" json:"large_range" form:"large_range"`
32
 	LargeRange      string `gorm:"column:large_range" json:"large_range" form:"large_range"`
32
 	RangeType       int64  `gorm:"column:range_type" json:"range_type" form:"range_type"`
33
 	RangeType       int64  `gorm:"column:range_type" json:"range_type" form:"range_type"`
33
 	RangeValue      string `gorm:"column:range_value" json:"range_value" form:"range_value"`
34
 	RangeValue      string `gorm:"column:range_value" json:"range_value" form:"range_value"`
35
+	IsStatus        int64  `gorm:"column:is_status" json:"is_status" form:"is_status"`
34
 }
36
 }
35
 
37
 
36
 func (XtQualityControlStandard) TableName() string {
38
 func (XtQualityControlStandard) TableName() string {

+ 22 - 4
service/common_service.go 查看文件

60
 
60
 
61
 	db := XTReadDB().Table("xt_quality_control_standard as x").Where("x.status =1")
61
 	db := XTReadDB().Table("xt_quality_control_standard as x").Where("x.status =1")
62
 	if orgid > 0 {
62
 	if orgid > 0 {
63
-		db = db.Where("x.user_org_id = ?", orgid)
63
+		db = db.Where("x.user_org_id = ? and x.is_status = 1", orgid)
64
 	}
64
 	}
65
 	table := XTReadDB().Table("xt_inspection_reference as s")
65
 	table := XTReadDB().Table("xt_inspection_reference as s")
66
 	fmt.Println(table)
66
 	fmt.Println(table)
67
 	offset := (page - 1) * limit
67
 	offset := (page - 1) * limit
68
-	err = db.Order("x.sort asc,x.created_time desc").Group("x.id").Select("x.id,x.inspection_major,x.inspection_minor,x.min_range,x.large_range,x.sort,x.user_org_id,x.range_value,x.range_type,s.unit,s.project_name,s.item_name").Count(&total).
68
+	err = db.Order("x.sort asc,x.created_time desc").Group("x.id").Select("x.id,x.inspection_major,x.inspection_minor,x.min_range,x.large_range,x.sort,x.user_org_id,x.range_value,x.range_type,s.unit,s.project_name,s.item_name,x.is_status").Count(&total).
69
 		Joins("left join xt_inspection_reference as s on s.id = x.inspection_minor").Offset(offset).Limit(limit).Scan(&standard).Error
69
 		Joins("left join xt_inspection_reference as s on s.id = x.inspection_minor").Offset(offset).Limit(limit).Scan(&standard).Error
70
 	return standard, total, err
70
 	return standard, total, err
71
 }
71
 }
72
 
72
 
73
+func GetDefaultBloodPressure(orgid int64) (standard []models.XtQualityControlStandard, err error) {
74
+	err = XTReadDB().Model(&standard).Where("user_org_id = ? and status = 1 and is_status = 0", orgid).Find(&standard).Error
75
+	return standard, err
76
+}
77
+
73
 func GetConfigurationListTwo(orgid int64, limit int64, page int64) (standard []*models.QualityControlStandard, total int64, err error) {
78
 func GetConfigurationListTwo(orgid int64, limit int64, page int64) (standard []*models.QualityControlStandard, total int64, err error) {
74
 	db := XTReadDB().Table("xt_quality_control_standard as x").Where("x.status =1")
79
 	db := XTReadDB().Table("xt_quality_control_standard as x").Where("x.status =1")
75
 	if orgid > 0 {
80
 	if orgid > 0 {
76
-		db = db.Where("x.user_org_id = ?", orgid)
81
+		db = db.Where("x.user_org_id = ? and x.is_status =1", orgid)
77
 	}
82
 	}
78
 	table := XTReadDB().Table("xt_inspection_reference as s")
83
 	table := XTReadDB().Table("xt_inspection_reference as s")
79
 	fmt.Println(table)
84
 	fmt.Println(table)
80
 	offset := (page - 1) * limit
85
 	offset := (page - 1) * limit
81
-	err = db.Order("x.sort asc,x.created_time desc").Group("x.id").Select("x.id,x.inspection_major,x.inspection_minor,x.min_range,x.large_range,x.sort,x.user_org_id,x.range_value,x.range_type,s.unit,s.project_name,s.item_name").Count(&total).
86
+	err = db.Order("x.sort asc,x.created_time desc").Group("x.id").Select("x.id,x.inspection_major,x.inspection_minor,x.min_range,x.large_range,x.sort,x.user_org_id,x.range_value,x.range_type,s.unit,s.project_name,s.item_name,x.is_status").Count(&total).
82
 		Joins("left join xt_inspection_reference as s on s.item_id = x.inspection_minor and s.project_id = x.inspection_major").Where("s.org_id = ? and s.status = 1", orgid).Offset(offset).Limit(limit).Scan(&standard).Error
87
 		Joins("left join xt_inspection_reference as s on s.item_id = x.inspection_minor and s.project_id = x.inspection_major").Where("s.org_id = ? and s.status = 1", orgid).Offset(offset).Limit(limit).Scan(&standard).Error
83
 	return standard, total, err
88
 	return standard, total, err
84
 }
89
 }
2704
 
2709
 
2705
 	return inspection, err
2710
 	return inspection, err
2706
 }
2711
 }
2712
+
2713
+func GetBloodPressureDetail(id int64) (models.XtQualityControlStandard, error) {
2714
+	standard := models.XtQualityControlStandard{}
2715
+	err := XTReadDB().Model(&standard).Where("id=? and status = 1", id).Find(&standard).Error
2716
+	return standard, err
2717
+}
2718
+
2719
+func UpdateBloodPressure(st *models.XtQualityControlStandard, id int64) error {
2720
+
2721
+	err := XTWriteDB().Model(&st).Where("id=?", id).Update(map[string]interface{}{"inspection_major": st.InspectionMajor, "inspection_minor": st.InspectionMinor, "min_range": st.MinRange, "large_range": st.LargeRange, "sort": st.Sort, "updated_time": st.UpdatedTime}).Error
2722
+	return err
2723
+
2724
+}

+ 1 - 1
service/data.go 查看文件

190
 
190
 
191
 func BatchInsertQualityControl(org_id int64) (err error) {
191
 func BatchInsertQualityControl(org_id int64) (err error) {
192
 
192
 
193
-	err = readDb.Exec("INSERT INTO xt_quality_control_standard(user_org_id,inspection_major,inspection_minor,min_range,large_range,sort,created_time,status,range_type,range_value) SELECT ?,inspection_major,inspection_minor,min_range,large_range,sort,created_time,status,range_type,range_value FROM xt_quality_control_standard where user_org_id = 0", org_id).Error
193
+	err = readDb.Exec("INSERT INTO xt_quality_control_standard(user_org_id,inspection_major,inspection_minor,min_range,large_range,sort,created_time,status,range_type,range_value,is_status) SELECT ?,inspection_major,inspection_minor,min_range,large_range,sort,created_time,status,range_type,range_value,is_status FROM xt_quality_control_standard where user_org_id = 0", org_id).Error
194
 	return
194
 	return
195
 }
195
 }
196
 
196