Преглед изворни кода

Merge branch 'master' of http://git.shengws.com/csx/XT_New

csx пре 5 година
родитељ
комит
d177a68a09

+ 7 - 1
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go Прегледај датотеку

1315
 		//查询号透析号是否相同
1315
 		//查询号透析号是否相同
1316
 		thisPatientother, _ := service.FindPatientByDialysisNoOne(orgid, dialysis, id)
1316
 		thisPatientother, _ := service.FindPatientByDialysisNoOne(orgid, dialysis, id)
1317
 		if thisPatientother.ID > 0 && thisPatientother.ID != patient.BloodId {
1317
 		if thisPatientother.ID > 0 && thisPatientother.ID != patient.BloodId {
1318
+			fmt.Println("进来没有---------------------------------")
1318
 			returnData := make(map[string]interface{}, 0)
1319
 			returnData := make(map[string]interface{}, 0)
1319
 			returnData["msg"] = "透析号码已存在"
1320
 			returnData["msg"] = "透析号码已存在"
1320
 			this.ServeSuccessJSON(returnData)
1321
 			this.ServeSuccessJSON(returnData)
1777
 	appid := this.GetMobileAdminUserInfo().App.Id
1778
 	appid := this.GetMobileAdminUserInfo().App.Id
1778
 	fmt.Println("appid", appid)
1779
 	fmt.Println("appid", appid)
1779
 	name, err := service.GetRoleName(id, orgid, appid)
1780
 	name, err := service.GetRoleName(id, orgid, appid)
1781
+	//获取管理员
1782
+	admin, err := service.GetAdmin(id)
1780
 	positionName, err := service.GetPositionName(id, orgid, appid)
1783
 	positionName, err := service.GetPositionName(id, orgid, appid)
1781
 	if err != nil {
1784
 	if err != nil {
1782
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1785
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1785
 	this.ServeSuccessJSON(map[string]interface{}{
1788
 	this.ServeSuccessJSON(map[string]interface{}{
1786
 		"name":         name,
1789
 		"name":         name,
1787
 		"positionName": positionName,
1790
 		"positionName": positionName,
1791
+		"admin":        admin,
1788
 	})
1792
 	})
1789
 }
1793
 }
1790
 
1794
 
2309
 func (this *NewDialysisApiController) GetMyOrgInformation() {
2313
 func (this *NewDialysisApiController) GetMyOrgInformation() {
2310
 	creator, _ := this.GetInt64("creator")
2314
 	creator, _ := this.GetInt64("creator")
2311
 	fmt.Println("cretor", creator)
2315
 	fmt.Println("cretor", creator)
2312
-	information, err := service.GetMyOrgInformation(creator)
2316
+	adminInfo := this.GetMobileAdminUserInfo()
2317
+	appId := adminInfo.App.Id
2318
+	information, err := service.GetMyOrgInformation(creator, appId)
2313
 	if err != nil {
2319
 	if err != nil {
2314
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2320
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2315
 		return
2321
 		return

+ 1 - 1
service/orginfo_service.go Прегледај датотеку

154
 		UserName:    userName,
154
 		UserName:    userName,
155
 		Intro:       "",
155
 		Intro:       "",
156
 		UserType:    1,
156
 		UserType:    1,
157
-		UserTitle:   1,
157
+		UserTitle:   0,
158
 		Status:      1,
158
 		Status:      1,
159
 		CreateTime:  now,
159
 		CreateTime:  now,
160
 		ModifyTime:  now,
160
 		ModifyTime:  now,

+ 12 - 3
service/patientmanage_service.go Прегледај датотеку

432
 }
432
 }
433
 
433
 
434
 func FindPatientByMobileOne(mobile string, orgID int64, id int64) (patient models.XtPatientsNew, err error) {
434
 func FindPatientByMobileOne(mobile string, orgID int64, id int64) (patient models.XtPatientsNew, err error) {
435
-	err = readDb.Model(&models.Patients{}).Where("phone=? and user_org_id=? and status=1 and id<>?", mobile, orgID, id).First(&patient).Error
435
+	//err = readDb.Model(&models.Patients{}).Where(" status=1 and user_org_id=? and   phone=? and id<>?", orgID, mobile, id).First(&patient).Error
436
+	//return
437
+	db := readDb.Table("xt_patients_new as x")
438
+	err = db.Not("phone = ?", mobile).Where("user_org_id = ? and id = ? and status =1", orgID, id).Find(&patient).Error
436
 	return
439
 	return
437
 }
440
 }
438
 
441
 
1315
 	return role, err
1318
 	return role, err
1316
 }
1319
 }
1317
 
1320
 
1321
+func GetAdmin(id int64) (models.SgjUserAdmin, error) {
1322
+	admin := models.SgjUserAdmin{}
1323
+	err := UserReadDB().Model(&admin).Where("id=? and status =1", id).Find(&admin).Error
1324
+	return admin, err
1325
+}
1326
+
1318
 func GetPosition(id int64) (models.SgjUserAdminRole, error) {
1327
 func GetPosition(id int64) (models.SgjUserAdminRole, error) {
1319
 	roles := models.SgjUserAdminRole{}
1328
 	roles := models.SgjUserAdminRole{}
1320
 	err = UserReadDB().Model(&roles).Where("id=? and status = 1", id).Find(&roles).Error
1329
 	err = UserReadDB().Model(&roles).Where("id=? and status = 1", id).Find(&roles).Error
1328
 	return admin, err
1337
 	return admin, err
1329
 }
1338
 }
1330
 
1339
 
1331
-func GetMyOrgInformation(id int64) (models.SgjUserAdminRole, error) {
1340
+func GetMyOrgInformation(id int64, appid int64) (models.SgjUserAdminRole, error) {
1332
 	admin := models.SgjUserAdminRole{}
1341
 	admin := models.SgjUserAdminRole{}
1333
-	err := UserReadDB().Model(&admin).Where("admin_user_id=? and status = 1", id).Find(&admin).Error
1342
+	err := UserReadDB().Model(&admin).Where("admin_user_id=? and  app_id = ? and status = 1", id, appid).First(&admin).Error
1334
 	return admin, err
1343
 	return admin, err
1335
 }
1344
 }
1336
 
1345