Ver código fonte

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

csx 4 anos atrás
pai
commit
d177a68a09

+ 7 - 1
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go Ver arquivo

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

+ 1 - 1
service/orginfo_service.go Ver arquivo

@@ -154,7 +154,7 @@ func createOrgApp(tx *gorm.DB, superAdminRole *models.Role, userName string, app
154 154
 		UserName:    userName,
155 155
 		Intro:       "",
156 156
 		UserType:    1,
157
-		UserTitle:   1,
157
+		UserTitle:   0,
158 158
 		Status:      1,
159 159
 		CreateTime:  now,
160 160
 		ModifyTime:  now,

+ 12 - 3
service/patientmanage_service.go Ver arquivo

@@ -432,7 +432,10 @@ func FindPatientByDialysisNoOne(orgID int64, dialysisNo string, id int64) (patie
432 432
 }
433 433
 
434 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 439
 	return
437 440
 }
438 441
 
@@ -1315,6 +1318,12 @@ func GetPositionName(adminid int64, orgid int64, appid int64) (models.App_Role,
1315 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 1327
 func GetPosition(id int64) (models.SgjUserAdminRole, error) {
1319 1328
 	roles := models.SgjUserAdminRole{}
1320 1329
 	err = UserReadDB().Model(&roles).Where("id=? and status = 1", id).Find(&roles).Error
@@ -1328,9 +1337,9 @@ func GetPositionOne(id int64) (models.SgjUserAdmin, error) {
1328 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 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 1343
 	return admin, err
1335 1344
 }
1336 1345