XMLWAN 4 年 前
コミット
5b5d5988da

+ 1 - 1
conf/app.conf ファイルの表示

1
 appname = 血透
1
 appname = 血透
2
-httpport = 9531
2
+httpport = 9529
3
 runmode = dev
3
 runmode = dev
4
 
4
 
5
 
5
 

+ 29 - 7
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go ファイルの表示

1496
 	})
1496
 	})
1497
 }
1497
 }
1498
 
1498
 
1499
+func (this *NewDialysisApiController) GetAllProjectName() {
1500
+	id := this.GetString("date")
1501
+	fmt.Println("id是", id)
1502
+	ids, _ := strconv.ParseInt(id, 10, 64)
1503
+	patientid := this.GetString("patientid")
1504
+	fmt.Println("patient", patientid)
1505
+	paientids, _ := strconv.ParseInt(patientid, 10, 64)
1506
+	patient, _ := service.GetNewPatient(paientids)
1507
+	orgid := this.GetMobileAdminUserInfo().Org.Id
1508
+	projectName, err := service.GetAllProjectName(ids, orgid, patient.BloodId)
1509
+	fmt.Println("projectname----------------------------------", err)
1510
+	if err != nil {
1511
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1512
+		return
1513
+	}
1514
+	this.ServeSuccessJSON(map[string]interface{}{
1515
+		"projectName": projectName,
1516
+	})
1517
+}
1518
+
1499
 func (this *NewDialysisApiController) GetAllInspection() {
1519
 func (this *NewDialysisApiController) GetAllInspection() {
1500
 
1520
 
1501
 	//查询该机构是否存在检验检测项目
1521
 	//查询该机构是否存在检验检测项目
1704
 	orgid, _ := this.GetInt64("orgid")
1724
 	orgid, _ := this.GetInt64("orgid")
1705
 	role := models.SgjUserAdminRole{
1725
 	role := models.SgjUserAdminRole{
1706
 		Message: message,
1726
 		Message: message,
1707
-		OrgId:   orgid,
1708
 	}
1727
 	}
1709
-	err := service.SaveMessage(id, &role)
1728
+	err := service.SaveMessage(id, orgid, &role)
1710
 	if err != nil {
1729
 	if err != nil {
1711
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1730
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1712
 		return
1731
 		return
2232
 	orgid := adminUserInfo.Org.Id
2251
 	orgid := adminUserInfo.Org.Id
2233
 	//跟剧机构ID获取创建者ID
2252
 	//跟剧机构ID获取创建者ID
2234
 	fmt.Println("orgid", orgid)
2253
 	fmt.Println("orgid", orgid)
2235
-	OrgId, _ := service.GetCreatByOrgId(orgid)
2236
-	fmt.Println("创建者ID", OrgId.Creator)
2237
-
2254
+	//OrgId, _ := service.GetCreatByOrgId(orgid)
2255
+	//fmt.Println("创建者ID", OrgId.Creator)
2256
+	creatId := adminUserInfo.AdminUser.Id
2257
+	fmt.Println("creatid-----------------------------", creatId)
2238
 	fmt.Println("当前机构ID信息---------------------", orgid)
2258
 	fmt.Println("当前机构ID信息---------------------", orgid)
2239
-	Username, err := service.GetMyOrgInformationFour(OrgId.Creator, orgid)
2259
+	Username, err := service.GetMyOrgInformationFour(creatId, orgid)
2240
 	if err != nil {
2260
 	if err != nil {
2241
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2261
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2242
 		return
2262
 		return
2365
 func (this *NewDialysisApiController) SaveNameTwo() {
2385
 func (this *NewDialysisApiController) SaveNameTwo() {
2366
 	id, _ := this.GetInt64("id")
2386
 	id, _ := this.GetInt64("id")
2367
 	name := this.GetString("name")
2387
 	name := this.GetString("name")
2388
+	orgid, _ := this.GetInt64("orgid")
2368
 	fmt.Println("name------------------", name)
2389
 	fmt.Println("name------------------", name)
2369
 	role := models.SgjUserAdminRole{
2390
 	role := models.SgjUserAdminRole{
2370
 		UserName: name,
2391
 		UserName: name,
2371
 	}
2392
 	}
2372
-	err := service.SaveNameTwo(id, &role)
2393
+	err := service.SaveNameTwo(id, orgid, &role)
2394
+	fmt.Println("err----------------------------------", err)
2373
 	if err != nil {
2395
 	if err != nil {
2374
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2396
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2375
 		return
2397
 		return

+ 1 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go ファイルの表示

101
 	beego.Router("/m/api/patient/deletemanagement", &NewDialysisApiController{}, "Delete:DeleteManagement")
101
 	beego.Router("/m/api/patient/deletemanagement", &NewDialysisApiController{}, "Delete:DeleteManagement")
102
 	beego.Router("/m/api/patient/updatedpatient", &NewDialysisApiController{}, "Post:UpdatedPatient")
102
 	beego.Router("/m/api/patient/updatedpatient", &NewDialysisApiController{}, "Post:UpdatedPatient")
103
 	beego.Router("/m/api/patient/getalldoctor", &NewDialysisApiController{}, "Get:GetAllDoctor")
103
 	beego.Router("/m/api/patient/getalldoctor", &NewDialysisApiController{}, "Get:GetAllDoctor")
104
+	beego.Router("/m/api/patient/getallprojectname", &NewDialysisApiController{}, "Get:GetAllProjectName")
104
 	beego.Router("/m/api/patient/getallinspection", &NewDialysisApiController{}, "Get:GetAllInspection")
105
 	beego.Router("/m/api/patient/getallinspection", &NewDialysisApiController{}, "Get:GetAllInspection")
105
 	beego.Router("/m/api/patient/getinspection", &NewDialysisApiController{}, "Get:GetInspection")
106
 	beego.Router("/m/api/patient/getinspection", &NewDialysisApiController{}, "Get:GetInspection")
106
 	beego.Router("/m/api/patient/getmyinformation", &NewDialysisApiController{}, "Get:GetMyInformation")
107
 	beego.Router("/m/api/patient/getmyinformation", &NewDialysisApiController{}, "Get:GetMyInformation")

+ 11 - 4
service/patientmanage_service.go ファイルの表示

983
 
983
 
984
 }
984
 }
985
 
985
 
986
+func GetAllProjectName(date int64, orgid int64, patientid int64) (inspection []*models.XtInspection, err error) {
987
+
988
+	err = XTReadDB().Model(&inspection).Where("inspect_date = ? and org_id = ? and patient_id = ? and status = 1", date, orgid, patientid).Group("project_name").Find(&inspection).Error
989
+
990
+	return inspection, err
991
+}
992
+
986
 func GetAllInspection(orgid int64) (inspection []*models.XtInspectionReference, err error) {
993
 func GetAllInspection(orgid int64) (inspection []*models.XtInspectionReference, err error) {
987
 
994
 
988
 	err = XTReadDB().Model(&inspection).Where("org_id = ? and status = 1", orgid).Group("project_name").Find(&inspection).Error
995
 	err = XTReadDB().Model(&inspection).Where("org_id = ? and status = 1", orgid).Group("project_name").Find(&inspection).Error
1053
 	return err
1060
 	return err
1054
 }
1061
 }
1055
 
1062
 
1056
-func SaveMessage(id int64, role *models.SgjUserAdminRole) error {
1063
+func SaveMessage(id int64, orgid int64, role *models.SgjUserAdminRole) error {
1057
 
1064
 
1058
-	err := UserWriteDB().Model(models.SgjUserAdminRole{}).Where("admin_user_id = ?", id).Update(map[string]interface{}{"message": role.Message, "mtime": time.Now().Unix()}).Error
1065
+	err := UserWriteDB().Model(models.SgjUserAdminRole{}).Where("admin_user_id = ? and org_id = ?", id, orgid).Update(map[string]interface{}{"message": role.Message, "mtime": time.Now().Unix()}).Error
1059
 	return err
1066
 	return err
1060
 }
1067
 }
1061
 
1068
 
1367
 	return admin, err
1374
 	return admin, err
1368
 }
1375
 }
1369
 
1376
 
1370
-func SaveNameTwo(id int64, role *models.SgjUserAdminRole) error {
1377
+func SaveNameTwo(id int64, orgid int64, role *models.SgjUserAdminRole) error {
1371
 
1378
 
1372
-	err := UserWriteDB().Model(models.SgjUserAdminRole{}).Where("admin_user_id =?", id).Update(map[string]interface{}{"user_name": role.UserName, "mtime": time.Now().Unix()}).Error
1379
+	err := UserWriteDB().Model(models.SgjUserAdminRole{}).Where("admin_user_id =? and org_id = ?", id, orgid).Update(map[string]interface{}{"user_name": role.UserName, "mtime": time.Now().Unix()}).Error
1373
 	return err
1380
 	return err
1374
 }
1381
 }