28169 3 weeks ago
parent
commit
b4a0cf7084

BIN
XT_New.exe View File


+ 10 - 10
controllers/base_api_controller.go View File

72
 	this.BaseAPIController.Prepare()
72
 	this.BaseAPIController.Prepare()
73
 	if this.GetAdminUserInfo() == nil {
73
 	if this.GetAdminUserInfo() == nil {
74
 		var userAdmin models.AdminUser
74
 		var userAdmin models.AdminUser
75
-		userAdmin.Id = 3207
75
+		userAdmin.Id = 2301
76
 		userAdmin.Mobile = "13318599895"
76
 		userAdmin.Mobile = "13318599895"
77
 
77
 
78
-		userAdmin.Id = 3207 //4,809
78
+		userAdmin.Id = 2301 //4,809
79
 		userAdmin.Mobile = "12222222222"
79
 		userAdmin.Mobile = "12222222222"
80
 		userAdmin.IsSuperAdmin = true
80
 		userAdmin.IsSuperAdmin = true
81
 		userAdmin.Status = 1
81
 		userAdmin.Status = 1
83
 		userAdmin.ModifyTime = 1530786071
83
 		userAdmin.ModifyTime = 1530786071
84
 		var subscibe models.ServeSubscibe
84
 		var subscibe models.ServeSubscibe
85
 		subscibe.ID = 11
85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10751 //机构id
86
+		subscibe.OrgId = 10164 //机构id
87
 		subscibe.PeriodStart = 1547447814
87
 		subscibe.PeriodStart = 1547447814
88
 		subscibe.PeriodEnd = 1550039814
88
 		subscibe.PeriodEnd = 1550039814
89
 		subscibe.State = 1
89
 		subscibe.State = 1
93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94
 		subscibes[4] = &subscibe
94
 		subscibes[4] = &subscibe
95
 		var adminUserInfo service.AdminUserInfo
95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10751 //机构id小英9675或4
97
-		adminUserInfo.CurrentAppId = 18734 //4
96
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
97
+		adminUserInfo.CurrentAppId = 12123 //4
98
 		adminUserInfo.AdminUser = &userAdmin
98
 		adminUserInfo.AdminUser = &userAdmin
99
 		adminUserInfo.Subscibes = subscibes
99
 		adminUserInfo.Subscibes = subscibes
100
 		this.SetSession("admin_user_info", &adminUserInfo)
100
 		this.SetSession("admin_user_info", &adminUserInfo)
318
 	this.BaseAPIController.Prepare()
318
 	this.BaseAPIController.Prepare()
319
 	if this.GetAdminUserInfo() == nil {
319
 	if this.GetAdminUserInfo() == nil {
320
 		var userAdmin models.AdminUser
320
 		var userAdmin models.AdminUser
321
-		userAdmin.Id = 3207
321
+		userAdmin.Id = 2301
322
 		userAdmin.Mobile = "13318599895"
322
 		userAdmin.Mobile = "13318599895"
323
 
323
 
324
-		userAdmin.Id = 3207 //4,809
324
+		userAdmin.Id = 2301 //4,809
325
 		userAdmin.Mobile = "12222222222"
325
 		userAdmin.Mobile = "12222222222"
326
 		userAdmin.IsSuperAdmin = false
326
 		userAdmin.IsSuperAdmin = false
327
 		userAdmin.Status = 1
327
 		userAdmin.Status = 1
329
 		userAdmin.ModifyTime = 1530786071
329
 		userAdmin.ModifyTime = 1530786071
330
 		var subscibe models.ServeSubscibe
330
 		var subscibe models.ServeSubscibe
331
 		subscibe.ID = 11
331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10751 //机构id小英9675或4
332
+		subscibe.OrgId = 10164 //机构id小英9675或4
333
 		subscibe.PeriodStart = 1538035409
333
 		subscibe.PeriodStart = 1538035409
334
 		subscibe.PeriodEnd = 1569571409
334
 		subscibe.PeriodEnd = 1569571409
335
 		subscibe.State = 1
335
 		subscibe.State = 1
339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340
 		subscibes[4] = &subscibe
340
 		subscibes[4] = &subscibe
341
 		var adminUserInfo service.AdminUserInfo
341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10751 //机构id小英9675或4
343
-		adminUserInfo.CurrentAppId = 18734 //4
342
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
343
+		adminUserInfo.CurrentAppId = 12123 //4
344
 		adminUserInfo.AdminUser = &userAdmin
344
 		adminUserInfo.AdminUser = &userAdmin
345
 		adminUserInfo.Subscibes = subscibes
345
 		adminUserInfo.Subscibes = subscibes
346
 		this.SetSession("admin_user_info", &adminUserInfo)
346
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 23 - 7
controllers/his_project_api_controller.go View File

856
 
856
 
857
 	name := this.GetString("name")
857
 	name := this.GetString("name")
858
 	number := this.GetString("number")
858
 	number := this.GetString("number")
859
+	department_type := this.GetString("department_type")
860
+	lender := this.GetString("lender")
861
+	phone := this.GetString("phone")
862
+	start_time := this.GetString("start_time")
859
 	adminUserInfo := this.GetAdminUserInfo()
863
 	adminUserInfo := this.GetAdminUserInfo()
860
 	orgId := adminUserInfo.CurrentOrgId
864
 	orgId := adminUserInfo.CurrentOrgId
861
 	department := models.XtHisDepartment{
865
 	department := models.XtHisDepartment{
862
-		Name:        name,
863
-		Number:      number,
864
-		UserOrgId:   orgId,
865
-		CreatedTime: time.Now().Unix(),
866
-		Status:      1,
866
+		Name:           name,
867
+		Number:         number,
868
+		UserOrgId:      orgId,
869
+		CreatedTime:    time.Now().Unix(),
870
+		Status:         1,
871
+		DepartmentType: department_type,
872
+		Lender:         lender,
873
+		Phone:          phone,
874
+		StartTime:      start_time,
867
 	}
875
 	}
868
 	err := service.CreateDePartment(&department)
876
 	err := service.CreateDePartment(&department)
869
 	if err != nil {
877
 	if err != nil {
918
 	id, _ := this.GetInt64("id")
926
 	id, _ := this.GetInt64("id")
919
 	name := this.GetString("name")
927
 	name := this.GetString("name")
920
 	number := this.GetString("number")
928
 	number := this.GetString("number")
929
+	department_type := this.GetString("department_type")
930
+	lender := this.GetString("lender")
931
+	phone := this.GetString("phone")
932
+	start_time := this.GetString("start_time")
921
 	department := models.XtHisDepartment{
933
 	department := models.XtHisDepartment{
922
-		Name:   name,
923
-		Number: number,
934
+		Name:           name,
935
+		Number:         number,
936
+		DepartmentType: department_type,
937
+		Lender:         lender,
938
+		Phone:          phone,
939
+		StartTime:      start_time,
924
 	}
940
 	}
925
 	err := service.UpdatedDepartment(id, &department)
941
 	err := service.UpdatedDepartment(id, &department)
926
 	if err != nil {
942
 	if err != nil {

+ 9 - 0
controllers/manage_api_controller.go View File

252
 	treat_types := dataBody["treat_type"].([]interface{})
252
 	treat_types := dataBody["treat_type"].([]interface{})
253
 	revers := int64(dataBody["revers_mode"].(float64))
253
 	revers := int64(dataBody["revers_mode"].(float64))
254
 	zone_id := int64(dataBody["zone_id"].(float64))
254
 	zone_id := int64(dataBody["zone_id"].(float64))
255
+	home_address := dataBody["home_address"].(string)
256
+
257
+	home_setting := dataBody["home_setting"].(string)
255
 	ids := make([]int64, 0)
258
 	ids := make([]int64, 0)
256
 	for _, treat := range treat_types {
259
 	for _, treat := range treat_types {
257
 		id := int64(treat.(float64))
260
 		id := int64(treat.(float64))
295
 		Status:              1,
298
 		Status:              1,
296
 		Ctime:               time.Now().Unix(),
299
 		Ctime:               time.Now().Unix(),
297
 		UserOrgId:           orgid,
300
 		UserOrgId:           orgid,
301
+		HomeAddress:         home_address,
302
+		HomeSetting:         home_setting,
298
 	}
303
 	}
299
 	err = service.CreateMacher(addmacher)
304
 	err = service.CreateMacher(addmacher)
300
 	if err != nil {
305
 	if err != nil {
375
 	user_year := dataBody["user_year"].(string)
380
 	user_year := dataBody["user_year"].(string)
376
 	work_time := dataBody["work_time"].(string)
381
 	work_time := dataBody["work_time"].(string)
377
 	treat_types := dataBody["treat_type"].([]interface{})
382
 	treat_types := dataBody["treat_type"].([]interface{})
383
+	home_address := dataBody["home_address"].(string)
384
+	home_setting := dataBody["home_setting"].(string)
378
 	ids := make([]int64, 0)
385
 	ids := make([]int64, 0)
379
 	for _, treat := range treat_types {
386
 	for _, treat := range treat_types {
380
 		id := int64(treat.(float64))
387
 		id := int64(treat.(float64))
412
 		UserYear:            user_year,
419
 		UserYear:            user_year,
413
 		WorkTime:            work_time,
420
 		WorkTime:            work_time,
414
 		ZoneId:              zone_id,
421
 		ZoneId:              zone_id,
422
+		HomeAddress:         home_address,
423
+		HomeSetting:         home_setting,
415
 	}
424
 	}
416
 	err = service.UpdateMachine(id, orgid, &addmacher)
425
 	err = service.UpdateMachine(id, orgid, &addmacher)
417
 	errors := service.UpdateTreatMode(id, orgid, ids)
426
 	errors := service.UpdateTreatMode(id, orgid, ids)

+ 4 - 1
controllers/manager_center_api_controller.go View File

1614
 	good_id, _ := c.GetInt64("good_id", 0)
1614
 	good_id, _ := c.GetInt64("good_id", 0)
1615
 	specification_name := c.GetString("specification_name")
1615
 	specification_name := c.GetString("specification_name")
1616
 	register_number := c.GetString("register_number")
1616
 	register_number := c.GetString("register_number")
1617
-
1617
+	register_number_name := c.GetString("register_number_name")
1618
 	good_unit, _ := c.GetInt64("good_unit", -1)
1618
 	good_unit, _ := c.GetInt64("good_unit", -1)
1619
 	buy_price, _ := c.GetFloat("buy_price", 0)
1619
 	buy_price, _ := c.GetFloat("buy_price", 0)
1620
 	sell_price, _ := c.GetFloat("sell_price", 0)
1620
 	sell_price, _ := c.GetFloat("sell_price", 0)
1752
 		IsShow:                      is_show,
1752
 		IsShow:                      is_show,
1753
 		IsZeroFlag:                  is_zero_flag,
1753
 		IsZeroFlag:                  is_zero_flag,
1754
 		SplitOfNumber:               split_of_number,
1754
 		SplitOfNumber:               split_of_number,
1755
+		RegisterNumberName:          register_number_name,
1755
 	}
1756
 	}
1756
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1757
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1757
 	if err == nil {
1758
 	if err == nil {
1824
 	is_show, _ := c.GetInt64("is_show")
1825
 	is_show, _ := c.GetInt64("is_show")
1825
 	is_zero_flag, _ := c.GetInt64("is_zero_flag")
1826
 	is_zero_flag, _ := c.GetInt64("is_zero_flag")
1826
 	split_of_number, _ := c.GetInt64("split_of_number")
1827
 	split_of_number, _ := c.GetInt64("split_of_number")
1828
+	register_number_name := c.GetString("register_number_name")
1827
 	// 创建一个拼音转换器
1829
 	// 创建一个拼音转换器
1828
 	p := pinyin.NewArgs()
1830
 	p := pinyin.NewArgs()
1829
 
1831
 
1901
 		IsShow:                      is_show,
1903
 		IsShow:                      is_show,
1902
 		IsZeroFlag:                  is_zero_flag,
1904
 		IsZeroFlag:                  is_zero_flag,
1903
 		SplitOfNumber:               split_of_number,
1905
 		SplitOfNumber:               split_of_number,
1906
+		RegisterNumberName:          register_number_name,
1904
 	}
1907
 	}
1905
 
1908
 
1906
 	totals := service.FindGoodInfoByNameOne(specification_name, adminUserInfo.CurrentOrgId, good_id, id, good_name)
1909
 	totals := service.FindGoodInfoByNameOne(specification_name, adminUserInfo.CurrentOrgId, good_id, id, good_name)

+ 9 - 7
controllers/pharmacy_controller.go View File

1227
 
1227
 
1228
 	recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
1228
 	recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
1229
 
1229
 
1230
+	baseDrug, _ := service.GetBaseDrugMedical(drug_id)
1231
+
1230
 	//盘亏
1232
 	//盘亏
1231
 	if ord_total > new_total {
1233
 	if ord_total > new_total {
1232
 
1234
 
1266
 			StockMaxNumber:     stock_max_number,
1268
 			StockMaxNumber:     stock_max_number,
1267
 			StockMinNumber:     stock_min_number,
1269
 			StockMinNumber:     stock_min_number,
1268
 			MinCount:           0,
1270
 			MinCount:           0,
1269
-			MinUnit:            drugWarehouseInfoOne.MinUnit,
1271
+			MinUnit:            baseDrug.MinUnit,
1270
 			LastStockMaxNumber: last_stock_max_number,
1272
 			LastStockMaxNumber: last_stock_max_number,
1271
 			LastStockMinNumber: last_stock_min_number,
1273
 			LastStockMinNumber: last_stock_min_number,
1272
 			InventoryType:      11,
1274
 			InventoryType:      11,
1307
 			CancelOutDetailId:       0,
1309
 			CancelOutDetailId:       0,
1308
 			ExpireDate:              drugWarehouseInfoOne.ExpiryDate,
1310
 			ExpireDate:              drugWarehouseInfoOne.ExpiryDate,
1309
 			ProductDate:             0,
1311
 			ProductDate:             0,
1310
-			MaxUnit:                 drugWarehouseInfoOne.MaxUnit,
1311
-			MinUnit:                 drugWarehouseInfoOne.MinUnit,
1312
+			MaxUnit:                 baseDrug.MinUnit,
1313
+			MinUnit:                 baseDrug.MinUnit,
1312
 			StorehouseId:            storehouse_id,
1314
 			StorehouseId:            storehouse_id,
1313
 			OverCount:               sum_count,
1315
 			OverCount:               sum_count,
1314
 		}
1316
 		}
1327
 		inventory := models.XtDrugInventory{
1329
 		inventory := models.XtDrugInventory{
1328
 			DrugName:           base.DrugName,
1330
 			DrugName:           base.DrugName,
1329
 			SpecificationName:  specification_name,
1331
 			SpecificationName:  specification_name,
1330
-			WarehousingUnit:    drugWarehouseInfoOne.MaxUnit,
1332
+			WarehousingUnit:    drugWarehouseInfoOne.MinUnit,
1331
 			Count:              consumable_count,
1333
 			Count:              consumable_count,
1332
 			LastPrice:          drugWarehouseInfoOne.Price,
1334
 			LastPrice:          drugWarehouseInfoOne.Price,
1333
 			RetailPrice:        drugWarehouseInfoOne.RetailPrice,
1335
 			RetailPrice:        drugWarehouseInfoOne.RetailPrice,
1358
 			StockMaxNumber:     stock_max_number,
1360
 			StockMaxNumber:     stock_max_number,
1359
 			StockMinNumber:     stock_min_number,
1361
 			StockMinNumber:     stock_min_number,
1360
 			MinCount:           0,
1362
 			MinCount:           0,
1361
-			MinUnit:            drugWarehouseInfoOne.MinUnit,
1363
+			MinUnit:            baseDrug.MinUnit,
1362
 			LastStockMaxNumber: last_stock_max_number,
1364
 			LastStockMaxNumber: last_stock_max_number,
1363
 			LastStockMinNumber: last_stock_min_number,
1365
 			LastStockMinNumber: last_stock_min_number,
1364
 			InventoryType:      10,
1366
 			InventoryType:      10,
1399
 			CancelOutDetailId:       0,
1401
 			CancelOutDetailId:       0,
1400
 			ExpireDate:              drugWarehouseInfoOne.ExpiryDate,
1402
 			ExpireDate:              drugWarehouseInfoOne.ExpiryDate,
1401
 			ProductDate:             0,
1403
 			ProductDate:             0,
1402
-			MaxUnit:                 drugWarehouseInfoOne.MaxUnit,
1403
-			MinUnit:                 drugWarehouseInfoOne.MinUnit,
1404
+			MaxUnit:                 baseDrug.MinUnit,
1405
+			MinUnit:                 baseDrug.MinUnit,
1404
 			StorehouseId:            storehouse_id,
1406
 			StorehouseId:            storehouse_id,
1405
 			OverCount:               sum_count,
1407
 			OverCount:               sum_count,
1406
 		}
1408
 		}

+ 33 - 2
controllers/role_controller.go View File

2
 
2
 
3
 import (
3
 import (
4
 	"fmt"
4
 	"fmt"
5
-	"github.com/jinzhu/gorm"
6
 	"strconv"
5
 	"strconv"
7
 	"strings"
6
 	"strings"
8
 	"time"
7
 	"time"
9
 
8
 
9
+	"github.com/jinzhu/gorm"
10
+
10
 	"XT_New/enums"
11
 	"XT_New/enums"
11
 	"XT_New/models"
12
 	"XT_New/models"
12
 	"XT_New/service"
13
 	"XT_New/service"
1136
 	outpatient_illnessCategory := this.GetString("outpatient_illnessCategory")
1137
 	outpatient_illnessCategory := this.GetString("outpatient_illnessCategory")
1137
 	is_active, _ := this.GetInt64("is_active")
1138
 	is_active, _ := this.GetInt64("is_active")
1138
 	active_status, _ := this.GetInt64("active_status")
1139
 	active_status, _ := this.GetInt64("active_status")
1140
+
1141
+	birth := this.GetString("birth")
1142
+	theBirthTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", birth+" 00:00:00", loc)
1143
+
1144
+	work_address := this.GetString("work_address")
1145
+
1146
+	work_start_time := this.GetString("work_start_time")
1147
+	workStartTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", work_start_time+" 00:00:00", loc)
1148
+
1149
+	work_end_time := this.GetString("work_end_time")
1150
+	workEndTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", work_end_time+" 00:00:00", loc)
1139
 	fmt.Println("active_status", active_status)
1151
 	fmt.Println("active_status", active_status)
1140
 	if len(mobile) == 0 || len(name) == 0 || (userType != 2 && userType != 3 && userType != 4) || len(roleIds) <= 0 {
1152
 	if len(mobile) == 0 || len(name) == 0 || (userType != 2 && userType != 3 && userType != 4) || len(roleIds) <= 0 {
1141
 
1153
 
1150
 		return
1162
 		return
1151
 	} else {
1163
 	} else {
1152
 		if adminUser == nil { //新增账号和用户
1164
 		if adminUser == nil { //新增账号和用户
1153
-			_, password, createErr := service.CreateGeneralAdminUserOne(adminUserInfo.CurrentOrgId, adminUserInfo.CurrentAppId, mobile, name, user_title_name, roleIds, userType, userTitle, department_id, department, sex, age, nation, card_type, id_card, education, study_major_name, work_major_name, role_type, medical_code, doctor_code, licensing, job_number, prescription_qualification_identification, identification_outpatients, theStartTime.Unix(), medical_range_code, medical_level, medical_type_job, pharmacist_registration_number, doctor_range_code, doctor_level, doctor_type_job, doctor_number, outpatient_illnessCategory, is_active, active_status)
1165
+			_, password, createErr := service.CreateGeneralAdminUserOne(adminUserInfo.CurrentOrgId, adminUserInfo.CurrentAppId, mobile, name, user_title_name, roleIds, userType, userTitle, department_id, department, sex, age, nation, card_type, id_card, education, study_major_name, work_major_name, role_type, medical_code, doctor_code, licensing, job_number, prescription_qualification_identification, identification_outpatients, theStartTime.Unix(), medical_range_code, medical_level, medical_type_job, pharmacist_registration_number, doctor_range_code, doctor_level, doctor_type_job, doctor_number, outpatient_illnessCategory, is_active, active_status, work_address, theBirthTime.Unix(), workStartTime.Unix(), workEndTime.Unix())
1154
 			if createErr != nil {
1166
 			if createErr != nil {
1155
 				//beego.Error("创建管理员失败:", createErr)
1167
 				//beego.Error("创建管理员失败:", createErr)
1156
 				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBCreate)
1168
 				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBCreate)
1211
 					OutpatientIllnesscategory:               outpatient_illnessCategory,
1223
 					OutpatientIllnesscategory:               outpatient_illnessCategory,
1212
 					IsActive:                                is_active,
1224
 					IsActive:                                is_active,
1213
 					ActiveStatus:                            active_status,
1225
 					ActiveStatus:                            active_status,
1226
+					Birth:                                   theBirthTime.Unix(),
1227
+					WorkAddress:                             work_address,
1228
+					WorkStartTime:                           workStartTime.Unix(),
1229
+					WorkEndTime:                             workEndTime.Unix(),
1214
 				}
1230
 				}
1215
 				err := service.CreateUserRole(app_role)
1231
 				err := service.CreateUserRole(app_role)
1216
 				if err != nil {
1232
 				if err != nil {
1348
 	is_active, _ := this.GetInt64("is_active")
1364
 	is_active, _ := this.GetInt64("is_active")
1349
 	active_status, _ := this.GetInt64("active_status")
1365
 	active_status, _ := this.GetInt64("active_status")
1350
 
1366
 
1367
+	birth := this.GetString("birth")
1368
+	theBirthTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", birth+" 00:00:00", loc)
1369
+
1370
+	work_address := this.GetString("work_address")
1371
+
1372
+	work_start_time := this.GetString("work_start_time")
1373
+	workStartTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", work_start_time+" 00:00:00", loc)
1374
+
1375
+	work_end_time := this.GetString("work_end_time")
1376
+	workEndTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", work_end_time+" 00:00:00", loc)
1377
+
1351
 	_, titleExist := models.UserTitle[userTitle]
1378
 	_, titleExist := models.UserTitle[userTitle]
1352
 	fmt.Println(titleExist)
1379
 	fmt.Println(titleExist)
1353
 	if adminUserId <= 0 || len(name) == 0 || (userType != 2 && userType != 3 && userType != 4) || !titleExist || len(roleIds) <= 0 {
1380
 	if adminUserId <= 0 || len(name) == 0 || (userType != 2 && userType != 3 && userType != 4) || !titleExist || len(roleIds) <= 0 {
1405
 	appRole.IsActive = is_active
1432
 	appRole.IsActive = is_active
1406
 	appRole.ActiveStatus = active_status
1433
 	appRole.ActiveStatus = active_status
1407
 	appRole.Sex = sex
1434
 	appRole.Sex = sex
1435
+	appRole.Birth = theBirthTime.Unix()
1436
+	appRole.WorkStartTime = workStartTime.Unix()
1437
+	appRole.WorkEndTime = workEndTime.Unix()
1438
+	appRole.WorkAddress = work_address
1408
 	saveErr := service.SaveAppRole(appRole)
1439
 	saveErr := service.SaveAppRole(appRole)
1409
 	if saveErr != nil {
1440
 	if saveErr != nil {
1410
 		//beego.Error("修改App_Role失败:", saveErr)
1441
 		//beego.Error("修改App_Role失败:", saveErr)

+ 4 - 0
models/device_models.go View File

315
 	DeviceMode          string `gorm:"column:device_mode" json:"device_mode" form:"device_mode"`
315
 	DeviceMode          string `gorm:"column:device_mode" json:"device_mode" form:"device_mode"`
316
 	Number              string `gorm:"column:number" json:"number" form:"number"`
316
 	Number              string `gorm:"column:number" json:"number" form:"number"`
317
 	EquimentId          int64  `gorm:"column:equiment_id" json:"equiment_id" form:"equiment_id"`
317
 	EquimentId          int64  `gorm:"column:equiment_id" json:"equiment_id" form:"equiment_id"`
318
+	HomeAddress         string `gorm:"column:home_address" json:"home_address" form:"home_address"`
319
+	HomeSetting         string `gorm:"column:home_setting" json:"home_setting" form:"home_setting"`
318
 }
320
 }
319
 
321
 
320
 type DeviceAddmacher struct {
322
 type DeviceAddmacher struct {
349
 	Mtime               int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
351
 	Mtime               int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
350
 	ZoneId              int64  `gorm:"column:zone_id" json:"zone_id" form:"zone_id"`
352
 	ZoneId              int64  `gorm:"column:zone_id" json:"zone_id" form:"zone_id"`
351
 	BedId               int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
353
 	BedId               int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
354
+	HomeAddress         string `gorm:"column:home_address" json:"home_address" form:"home_address"`
355
+	HomeSetting         string `gorm:"column:home_setting" json:"home_setting" form:"home_setting"`
352
 }
356
 }
353
 
357
 
354
 func (DeviceAddmacher) TableName() string {
358
 func (DeviceAddmacher) TableName() string {

+ 1 - 0
models/good_models.go View File

108
 	IsZeroFlag                  int64                `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
108
 	IsZeroFlag                  int64                `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
109
 	SplitOfNumber               int64                `gorm:"column:split_of_number" json:"split_of_number" form:"split_of_number"`
109
 	SplitOfNumber               int64                `gorm:"column:split_of_number" json:"split_of_number" form:"split_of_number"`
110
 	ZuobiaoId                   string               `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
110
 	ZuobiaoId                   string               `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
111
+	RegisterNumberName          string               `gorm:"column:register_number_name" json:"register_number_name" form:"register_number_name"`
111
 
112
 
112
 	WarehousingInfoOne []*StartWarehousingInfo `gorm:"json:"warehouse_info"` //期间增加
113
 	WarehousingInfoOne []*StartWarehousingInfo `gorm:"json:"warehouse_info"` //期间增加
113
 
114
 

+ 11 - 7
models/his_models.go View File

81
 }
81
 }
82
 
82
 
83
 type XtHisDepartment struct {
83
 type XtHisDepartment struct {
84
-	ID          int64  `gorm:"column:id" json:"id" form:"id"`
85
-	Name        string `gorm:"column:name" json:"name" form:"name"`
86
-	Number      string `gorm:"column:number" json:"number" form:"number"`
87
-	UserOrgId   int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
88
-	Status      int64  `gorm:"column:status" json:"status" form:"status"`
89
-	CreatedTime int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
90
-	UpdatedTime int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
84
+	ID             int64  `gorm:"column:id" json:"id" form:"id"`
85
+	Name           string `gorm:"column:name" json:"name" form:"name"`
86
+	Number         string `gorm:"column:number" json:"number" form:"number"`
87
+	UserOrgId      int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
88
+	Status         int64  `gorm:"column:status" json:"status" form:"status"`
89
+	CreatedTime    int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
90
+	UpdatedTime    int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
91
+	DepartmentType string `gorm:"column:department_type" json:"department_type" form:"department_type"`
92
+	Lender         string `gorm:"column:lender" json:"lender" form:"lender"`
93
+	Phone          string `gorm:"column:phone" json:"phone" form:"phone"`
94
+	StartTime      string `gorm:"column:start_time" json:"start_time" form:"start_time"`
91
 }
95
 }
92
 
96
 
93
 func (XtHisDepartment) TableName() string {
97
 func (XtHisDepartment) TableName() string {

+ 4 - 0
models/role_models.go View File

90
 	OutpatientIllnesscategory               string `gorm:"column:outpatient_illness_category" json:"outpatient_illness_category" form:"outpatient_illness_category"`
90
 	OutpatientIllnesscategory               string `gorm:"column:outpatient_illness_category" json:"outpatient_illness_category" form:"outpatient_illness_category"`
91
 	IsActive                                int64  `gorm:"column:is_active" json:"is_active" form:"is_active"`
91
 	IsActive                                int64  `gorm:"column:is_active" json:"is_active" form:"is_active"`
92
 	ActiveStatus                            int64  `gorm:"column:active_status" json:"active_status" form:"active_status"`
92
 	ActiveStatus                            int64  `gorm:"column:active_status" json:"active_status" form:"active_status"`
93
+	Birth                                   int64  `gorm:"column:birth" json:"birth" form:"birth"`
94
+	WorkAddress                             string `gorm:"column:work_address" json:"work_address" form:"work_address"`
95
+	WorkStartTime                           int64  `gorm:"column:work_start_time" json:"work_start_time" form:"work_start_time"`
96
+	WorkEndTime                             int64  `gorm:"column:work_end_time" json:"work_end_time" form:"work_end_time"`
93
 }
97
 }
94
 
98
 
95
 func (App_Role) TableName() string {
99
 func (App_Role) TableName() string {

+ 1 - 1
service/device_service.go View File

725
 	db := readUserDb.Table("xt_device_addmacher as a").Where("a.status =1")
725
 	db := readUserDb.Table("xt_device_addmacher as a").Where("a.status =1")
726
 	d := readUserDb.Table("xt_device_mode as d")
726
 	d := readUserDb.Table("xt_device_mode as d")
727
 	fmt.Print("d", d)
727
 	fmt.Print("d", d)
728
-	err := db.Select("a.id,a.serial_number,a.device_type,a.bed_number,a.device_name,a.manufacture_factory,a.service_manufacturer,a.unit_type as device_mode,a.use_section,a.section_number,a.buy_date,a.install_date,a.start_date,a.maintenace_engineer,a.telephone,a.guarantee_date,a.machine_status,a.user_total,a.disinfection_mode,a.remarks,a.rubbish_date,a.rubbish_reason,a.user_year,a.work_time,a.revers_mode,a.user_org_id,a.status,a.ctime,a.mtime,a.zone_id,a.bed_id").Joins("left join xt_device_mode as d on d.id = a.unit_type ").Where("a.id = ? and a.user_org_id = ?", id, orgid).Find(&addmacher).Error
728
+	err := db.Select("a.id,a.serial_number,a.device_type,a.bed_number,a.device_name,a.manufacture_factory,a.service_manufacturer,a.unit_type as device_mode,a.use_section,a.section_number,a.buy_date,a.install_date,a.start_date,a.maintenace_engineer,a.telephone,a.guarantee_date,a.machine_status,a.user_total,a.disinfection_mode,a.remarks,a.rubbish_date,a.rubbish_reason,a.user_year,a.work_time,a.revers_mode,a.user_org_id,a.status,a.ctime,a.mtime,a.zone_id,a.bed_id,a.home_address,a.home_setting").Joins("left join xt_device_mode as d on d.id = a.unit_type ").Where("a.id = ? and a.user_org_id = ?", id, orgid).Find(&addmacher).Error
729
 	return addmacher, err
729
 	return addmacher, err
730
 }
730
 }
731
 
731
 

+ 1 - 1
service/his_project_service.go View File

148
 
148
 
149
 func UpdatedDepartment(id int64, department *models.XtHisDepartment) error {
149
 func UpdatedDepartment(id int64, department *models.XtHisDepartment) error {
150
 
150
 
151
-	err := XTWriteDB().Model(&department).Where("id=? and status = 1", id).Updates(map[string]interface{}{"name": department.Name, "number": department.Number, "updated_time": time.Now().Unix()}).Error
151
+	err := XTWriteDB().Model(&department).Where("id=? and status = 1", id).Updates(map[string]interface{}{"name": department.Name, "number": department.Number, "updated_time": time.Now().Unix(), "department_type": department.DepartmentType, "lender": department.Lender, "phone": department.Phone, "start_time": department.StartTime}).Error
152
 	return err
152
 	return err
153
 }
153
 }
154
 
154
 

+ 1 - 1
service/manage_service.go View File

54
 
54
 
55
 func UpdateMachine(id int64, orgid int64, addmacher *models.DeviceAddmacher) error {
55
 func UpdateMachine(id int64, orgid int64, addmacher *models.DeviceAddmacher) error {
56
 
56
 
57
-	err := writeUserDb.Model(&addmacher).Where("id = ? AND user_org_id = ? AND status = ?", id, orgid, 1).Updates(map[string]interface{}{"serial_number": addmacher.SerialNumber, "device_type": addmacher.DeviceType, "bed_number": addmacher.BedNumber, "device_name": addmacher.DeviceName, "manufacture_factory": addmacher.ManufactureFactory, "service_manufacturer": addmacher.ServiceManufacturer, "unit_type": addmacher.UnitType, "use_section": addmacher.UseSection, "section_number": addmacher.SectionNumber, "buy_date": addmacher.BuyDate, "install_date": addmacher.InstallDate, "start_date": addmacher.StartDate, "maintenace_engineer": addmacher.MaintenaceEngineer, "telephone": addmacher.Telephone, "guarantee_date": addmacher.GuaranteeDate, "machine_status": addmacher.MachineStatus, "user_total": addmacher.UserTotal, "remarks": addmacher.Remarks, "rubbish_date": addmacher.RubbishDate, "rubbish_reason": addmacher.RubbishReason, "user_year": addmacher.UserYear, "work_time": addmacher.WorkTime, "bed_id": addmacher.BedId, "disinfection_mode": addmacher.DisinfectionMode, "revers_mode": addmacher.ReversMode, "mtime": time.Now().Unix(), "zone_id": addmacher.ZoneId}).Error
57
+	err := writeUserDb.Model(&addmacher).Where("id = ? AND user_org_id = ? AND status = ?", id, orgid, 1).Updates(map[string]interface{}{"serial_number": addmacher.SerialNumber, "device_type": addmacher.DeviceType, "bed_number": addmacher.BedNumber, "device_name": addmacher.DeviceName, "manufacture_factory": addmacher.ManufactureFactory, "service_manufacturer": addmacher.ServiceManufacturer, "unit_type": addmacher.UnitType, "use_section": addmacher.UseSection, "section_number": addmacher.SectionNumber, "buy_date": addmacher.BuyDate, "install_date": addmacher.InstallDate, "start_date": addmacher.StartDate, "maintenace_engineer": addmacher.MaintenaceEngineer, "telephone": addmacher.Telephone, "guarantee_date": addmacher.GuaranteeDate, "machine_status": addmacher.MachineStatus, "user_total": addmacher.UserTotal, "remarks": addmacher.Remarks, "rubbish_date": addmacher.RubbishDate, "rubbish_reason": addmacher.RubbishReason, "user_year": addmacher.UserYear, "work_time": addmacher.WorkTime, "bed_id": addmacher.BedId, "disinfection_mode": addmacher.DisinfectionMode, "revers_mode": addmacher.ReversMode, "mtime": time.Now().Unix(), "zone_id": addmacher.ZoneId, "home_address": addmacher.HomeAddress, "home_setting": addmacher.HomeSetting}).Error
58
 
58
 
59
 	return err
59
 	return err
60
 
60
 

+ 9 - 3
service/role_service.go View File

1
 package service
1
 package service
2
 
2
 
3
 import (
3
 import (
4
-	"XT_New/models"
5
-	"XT_New/utils"
6
 	"database/sql"
4
 	"database/sql"
7
 	"encoding/json"
5
 	"encoding/json"
8
 	"fmt"
6
 	"fmt"
10
 	"strings"
8
 	"strings"
11
 	"time"
9
 	"time"
12
 
10
 
11
+	"XT_New/models"
12
+	"XT_New/utils"
13
+
13
 	"github.com/jinzhu/gorm"
14
 	"github.com/jinzhu/gorm"
14
 )
15
 )
15
 
16
 
328
 	return user.IsSuperAdmin, nil
329
 	return user.IsSuperAdmin, nil
329
 }
330
 }
330
 
331
 
331
-func CreateGeneralAdminUserOne(orgID int64, appID int64, mobile string, name string, userTitle string, roleIds string, user_type int, user_title int, department_id int64, deapartment_name string, sex int64, age int64, nation string, card_type int64, idCard string, education int64, studyMajorName string, workMajorName string, roletype int64, medicalCode string, doctorcode string, licensing int64, jobnumber string, prescriptionQualificationIdentification int64, identificationOutpatients int64, startime int64, medicalRangeCode int64, medicalLevel int64, medicalTypeJob int64, pharmacistRegistrationNumber string, doctorRangeCode int64, doctorLevel int64, doctorTypeJob int64, doctorNumber string, outpatientIllnessCategory string, isActive int64, activeStatus int64) (*models.AdminUser, string, error) {
332
+func CreateGeneralAdminUserOne(orgID int64, appID int64, mobile string, name string, userTitle string, roleIds string, user_type int, user_title int, department_id int64, deapartment_name string, sex int64, age int64, nation string, card_type int64, idCard string, education int64, studyMajorName string, workMajorName string, roletype int64, medicalCode string, doctorcode string, licensing int64, jobnumber string, prescriptionQualificationIdentification int64, identificationOutpatients int64, startime int64, medicalRangeCode int64, medicalLevel int64, medicalTypeJob int64, pharmacistRegistrationNumber string, doctorRangeCode int64, doctorLevel int64, doctorTypeJob int64, doctorNumber string, outpatientIllnessCategory string, isActive int64, activeStatus int64, word_address string, birth int64, word_start_time int64, work_end_time int64) (*models.AdminUser, string, error) {
332
 	now := time.Now().Unix()
333
 	now := time.Now().Unix()
333
 	tx := writeUserDb.Begin()
334
 	tx := writeUserDb.Begin()
334
 	var adminUser models.AdminUser
335
 	var adminUser models.AdminUser
345
 			adminUser.Status = 1
346
 			adminUser.Status = 1
346
 			adminUser.CreateTime = now
347
 			adminUser.CreateTime = now
347
 			adminUser.ModifyTime = now
348
 			adminUser.ModifyTime = now
349
+
348
 			if createErr := tx.Create(&adminUser).Error; createErr != nil {
350
 			if createErr := tx.Create(&adminUser).Error; createErr != nil {
349
 				tx.Rollback()
351
 				tx.Rollback()
350
 				return nil, "", createErr
352
 				return nil, "", createErr
394
 		DoctorRangeCode:                         doctorRangeCode,
396
 		DoctorRangeCode:                         doctorRangeCode,
395
 		DoctorTypeJob:                           doctorTypeJob,
397
 		DoctorTypeJob:                           doctorTypeJob,
396
 		DoctorLevel:                             doctorLevel,
398
 		DoctorLevel:                             doctorLevel,
399
+		WorkStartTime:                           word_start_time,
400
+		Birth:                                   birth,
401
+		WorkEndTime:                             work_end_time,
402
+		WorkAddress:                             word_address,
397
 	}
403
 	}
398
 	if createApp_RoleErr := tx.Create(&app_role).Error; createApp_RoleErr != nil {
404
 	if createApp_RoleErr := tx.Create(&app_role).Error; createApp_RoleErr != nil {
399
 		tx.Rollback()
405
 		tx.Rollback()

+ 1 - 0
service/stock_service.go View File

281
 		"is_show":                        goodInfo.IsShow,
281
 		"is_show":                        goodInfo.IsShow,
282
 		"is_zero_flag":                   goodInfo.IsZeroFlag,
282
 		"is_zero_flag":                   goodInfo.IsZeroFlag,
283
 		"split_of_number":                goodInfo.SplitOfNumber,
283
 		"split_of_number":                goodInfo.SplitOfNumber,
284
+		"register_number_name":           goodInfo.RegisterNumberName,
284
 	}).Error
285
 	}).Error
285
 
286
 
286
 	writeDb.Model(&models.WarehousingInfo{}).Where("good_id = ? AND org_id = ?", goodInfo.ID, goodInfo.OrgId).Updates(map[string]interface{}{"good_type_id": goodInfo.GoodTypeId})
287
 	writeDb.Model(&models.WarehousingInfo{}).Where("good_id = ? AND org_id = ?", goodInfo.ID, goodInfo.OrgId).Updates(map[string]interface{}{"good_type_id": goodInfo.GoodTypeId})