Selaa lähdekoodia

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

陈少旭 3 viikkoa sitten
vanhempi
commit
1d2a347acd
36 muutettua tiedostoa jossa 508 lisäystä ja 122 poistoa
  1. BIN
      XT_New.exe
  2. 10 10
      controllers/base_api_controller.go
  3. 1 15
      controllers/common_api_controller.go
  4. 52 3
      controllers/drug_stock_api_contorller.go
  5. 23 7
      controllers/his_project_api_controller.go
  6. 21 0
      controllers/manage_api_controller.go
  7. 14 3
      controllers/manager_center_api_controller.go
  8. 22 18
      controllers/mobile_api_controllers/dialysis_api_controller.go
  9. 6 9
      controllers/mobile_api_controllers/dialysis_api_controller_extend.go
  10. 9 9
      controllers/mobile_api_controllers/patient_api_controller.go
  11. 1 0
      controllers/new_mobile_api_controllers/new_dialysis_api_controller.go
  12. 11 5
      controllers/patient_api_controller.go
  13. 9 7
      controllers/pharmacy_controller.go
  14. 33 2
      controllers/role_controller.go
  15. 29 6
      controllers/self_drug_api_congtroller.go
  16. 52 1
      controllers/stock_in_api_controller.go
  17. 8 0
      models/device_models.go
  18. 2 0
      models/drug.go
  19. 4 2
      models/good_models.go
  20. 11 7
      models/his_models.go
  21. 2 0
      models/new_stock_models.go
  22. 4 0
      models/role_models.go
  23. 39 0
      models/stock_models.go
  24. 3 3
      service/common_service.go
  25. 1 1
      service/device_service.go
  26. 2 2
      service/doctor_advice_service.go
  27. 1 1
      service/his_project_service.go
  28. 66 0
      service/his_service.go
  29. 9 0
      service/manage_center_service.go
  30. 1 1
      service/manage_service.go
  31. 6 2
      service/new_stock_service.go
  32. 8 1
      service/patient_service.go
  33. 9 3
      service/role_service.go
  34. 36 3
      service/self_drug_service.go
  35. 2 0
      service/stock_service.go
  36. 1 1
      service/user_service.go

BIN
XT_New.exe Näytä tiedosto


+ 10 - 10
controllers/base_api_controller.go Näytä tiedosto

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 = 10745 //机构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 = 10745 //机构id小英9675或4
97
-		adminUserInfo.CurrentAppId = 18734 //4
96
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
97
+		adminUserInfo.CurrentAppId = 17733 //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 = 10745 //机构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 = 10745 //机构id小英9675或4
343
-		adminUserInfo.CurrentAppId = 18734 //4
342
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
343
+		adminUserInfo.CurrentAppId = 17733 //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)

+ 1 - 15
controllers/common_api_controller.go Näytä tiedosto

1436
 	startimeStrUnix := startimeStr.Unix()
1436
 	startimeStrUnix := startimeStr.Unix()
1437
 
1437
 
1438
 	endtime := this.GetString("endtime")
1438
 	endtime := this.GetString("endtime")
1439
-	fmt.Println("结束时间", endtime)
1439
+
1440
 	endtimeStr := endtime + " 23:59:59"
1440
 	endtimeStr := endtime + " 23:59:59"
1441
 	endtimeStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endtimeStr)
1441
 	endtimeStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endtimeStr)
1442
 	endtimeStrsUnix := endtimeStrs.Unix()
1442
 	endtimeStrsUnix := endtimeStrs.Unix()
1467
 func (this *CommonApiController) GetCartogramList() {
1467
 func (this *CommonApiController) GetCartogramList() {
1468
 	adminUser := this.GetAdminUserInfo()
1468
 	adminUser := this.GetAdminUserInfo()
1469
 	orgid := adminUser.CurrentOrgId
1469
 	orgid := adminUser.CurrentOrgId
1470
-	//fmt.Println("orgid", orgid)
1471
 	lapstor, _ := this.GetInt64("lapstor")
1470
 	lapstor, _ := this.GetInt64("lapstor")
1472
 	fmt.Println("lapstor", lapstor)
1471
 	fmt.Println("lapstor", lapstor)
1473
 	startime := this.GetString("startime")
1472
 	startime := this.GetString("startime")
1474
-	//fmt.Println("开始时间", startime)
1475
 	startimeStr, _ := utils.ParseTimeStringToTime("2006-01-02", startime)
1473
 	startimeStr, _ := utils.ParseTimeStringToTime("2006-01-02", startime)
1476
 	startimeStrUnix := startimeStr.Unix()
1474
 	startimeStrUnix := startimeStr.Unix()
1477
-	//fmt.Println("时间搓", startimeStrUnix)
1478
 	endtime := this.GetString("endtime")
1475
 	endtime := this.GetString("endtime")
1479
-	//fmt.Println("结束时间", endtime)
1480
 	endtimeStr := endtime + " 23:59:59"
1476
 	endtimeStr := endtime + " 23:59:59"
1481
 	endtimeStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endtimeStr)
1477
 	endtimeStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endtimeStr)
1482
 	endtimeStrsUnix := endtimeStrs.Unix()
1478
 	endtimeStrsUnix := endtimeStrs.Unix()
1483
-	//fmt.Println("结束时间搓", endtimeStrsUnix)
1484
-	//limit, _ := this.GetInt64("limit")
1485
-	//page, _ := this.GetInt64("page")
1486
-
1487
 	//统计总共
1479
 	//统计总共
1488
 	_, total, err := service.GetTotalPatientsControl(orgid, startimeStrUnix, endtimeStrsUnix)
1480
 	_, total, err := service.GetTotalPatientsControl(orgid, startimeStrUnix, endtimeStrsUnix)
1489
-	//fmt.Println("total=================", total)
1490
 	//统计rangetype= 1
1481
 	//统计rangetype= 1
1491
 	_, standtotal, err := service.GetStandControl(orgid, startimeStrUnix, endtimeStrsUnix)
1482
 	_, standtotal, err := service.GetStandControl(orgid, startimeStrUnix, endtimeStrsUnix)
1492
-	//fmt.Println(standtotal)
1493
 	_, standtotalOne, err := service.GetStandControlOne(orgid, startimeStrUnix, endtimeStrsUnix)
1483
 	_, standtotalOne, err := service.GetStandControlOne(orgid, startimeStrUnix, endtimeStrsUnix)
1494
-	//fmt.Println(standtotalOne)
1495
-	//cartogramlist, err := service.GetLastPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix)
1496
-	//infectiouscontrol, err := service.GetInfectiousPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix)
1497
-	//_, total, err := service.GetPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix, page, limit)
1498
 	if err != nil {
1484
 	if err != nil {
1499
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1485
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1500
 		return
1486
 		return

+ 52 - 3
controllers/drug_stock_api_contorller.go Näytä tiedosto

3473
 
3473
 
3474
 		flowList, _ := service.GetNewDrugFlowList(item.DrugId, item.OrgId, item.ID, tx)
3474
 		flowList, _ := service.GetNewDrugFlowList(item.DrugId, item.OrgId, item.ID, tx)
3475
 
3475
 
3476
-		fmt.Println("FlowList=================", flowList)
3477
 		var his_count int64
3476
 		var his_count int64
3478
 		if len(flowList) > 0 {
3477
 		if len(flowList) > 0 {
3479
 			for _, item := range flowList {
3478
 			for _, item := range flowList {
3489
 				}
3488
 				}
3490
 			}
3489
 			}
3491
 		}
3490
 		}
3492
-		fmt.Println("incount_0000000000000000", in_cout)
3493
-		fmt.Println("his_count--------------", his_count)
3494
 
3491
 
3495
 		if in_cout != his_count {
3492
 		if in_cout != his_count {
3496
 			is_success = 1
3493
 			is_success = 1
3498
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeFlow)
3495
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeFlow)
3499
 			return
3496
 			return
3500
 		}
3497
 		}
3498
+
3499
+		goodcodelist := strings.Split(item.DrugCode, ",")
3500
+
3501
+		if len(goodcodelist) > 0 {
3502
+			goodInfo, _ := service.GetNewDrugByIdIsStop(item.DrugId, item.OrgId, tx)
3503
+			for _, it := range goodcodelist {
3504
+				if it != "" {
3505
+					codeInfo := models.XtDrugCodeInfo{
3506
+						DrugId:          item.DrugId,
3507
+						BatchNumber:     item.Number,
3508
+						DrugCode:        it,
3509
+						WarehouseInfoId: item.ID,
3510
+						IsUserCount:     0,
3511
+						IsOutStatus:     2,
3512
+						Status:          1,
3513
+						UserOrgId:       item.OrgId,
3514
+						Ctime:           time.Now().Unix(),
3515
+						Mtime:           time.Now().Unix(),
3516
+						SplitOfNumber:   goodInfo.SplitOfNumber,
3517
+					}
3518
+					service.CreateDrugCodeInfo(codeInfo, tx)
3519
+				}
3520
+
3521
+			}
3522
+		}
3523
+
3501
 	}
3524
 	}
3502
 
3525
 
3503
 	if is_success != 1 {
3526
 	if is_success != 1 {
3600
 		//扣减库存
3623
 		//扣减库存
3601
 		service.ReduceNewDrugStockCount(item.StorehouseId, item.DrugId, item.OrgId, total_count, over_count, tx)
3624
 		service.ReduceNewDrugStockCount(item.StorehouseId, item.DrugId, item.OrgId, total_count, over_count, tx)
3602
 
3625
 
3626
+		//改变扫码库里面的状态
3627
+		goodcodelist := strings.Split(item.DrugCode, ",")
3628
+
3629
+		if len(goodcodelist) > 0 {
3630
+			goodInfo, _ := service.GetNewGoodByIdIsStop(item.DrugId, item.OrgId, tx)
3631
+			for _, it := range goodcodelist {
3632
+				if it != "" {
3633
+					codeInfo := models.XtDrugCodeInfo{
3634
+						DrugId:          item.DrugId,
3635
+						BatchNumber:     item.Number,
3636
+						DrugCode:        it,
3637
+						WarehouseInfoId: item.ID,
3638
+						IsUserCount:     0,
3639
+						IsOutStatus:     2,
3640
+						Status:          0,
3641
+						UserOrgId:       item.OrgId,
3642
+						Ctime:           time.Now().Unix(),
3643
+						Mtime:           time.Now().Unix(),
3644
+						SplitOfNumber:   goodInfo.SplitOfNumber,
3645
+					}
3646
+					service.UpdateDrugCodeInfo(codeInfo, tx)
3647
+				}
3648
+
3649
+			}
3650
+		}
3651
+
3603
 	}
3652
 	}
3604
 	//更新审核
3653
 	//更新审核
3605
 	err := service.ReturnNewCheckWarehouseingInfo(warehousing_id, orgId, tx)
3654
 	err := service.ReturnNewCheckWarehouseingInfo(warehousing_id, orgId, tx)

+ 23 - 7
controllers/his_project_api_controller.go Näytä tiedosto

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 {

+ 21 - 0
controllers/manage_api_controller.go Näytä tiedosto

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)
258
+
259
+	home_type := dataBody["home_type"].(string)
260
+
261
+	home_big_type := dataBody["home_big_type"].(string)
262
+
255
 	ids := make([]int64, 0)
263
 	ids := make([]int64, 0)
256
 	for _, treat := range treat_types {
264
 	for _, treat := range treat_types {
257
 		id := int64(treat.(float64))
265
 		id := int64(treat.(float64))
295
 		Status:              1,
303
 		Status:              1,
296
 		Ctime:               time.Now().Unix(),
304
 		Ctime:               time.Now().Unix(),
297
 		UserOrgId:           orgid,
305
 		UserOrgId:           orgid,
306
+		HomeAddress:         home_address,
307
+		HomeSetting:         home_setting,
308
+		HomeType:            home_type,
309
+		HomeBigType:         home_big_type,
298
 	}
310
 	}
299
 	err = service.CreateMacher(addmacher)
311
 	err = service.CreateMacher(addmacher)
300
 	if err != nil {
312
 	if err != nil {
375
 	user_year := dataBody["user_year"].(string)
387
 	user_year := dataBody["user_year"].(string)
376
 	work_time := dataBody["work_time"].(string)
388
 	work_time := dataBody["work_time"].(string)
377
 	treat_types := dataBody["treat_type"].([]interface{})
389
 	treat_types := dataBody["treat_type"].([]interface{})
390
+	home_address := dataBody["home_address"].(string)
391
+	home_setting := dataBody["home_setting"].(string)
392
+	home_type := dataBody["home_type"].(string)
393
+
394
+	home_big_type := dataBody["home_big_type"].(string)
378
 	ids := make([]int64, 0)
395
 	ids := make([]int64, 0)
379
 	for _, treat := range treat_types {
396
 	for _, treat := range treat_types {
380
 		id := int64(treat.(float64))
397
 		id := int64(treat.(float64))
412
 		UserYear:            user_year,
429
 		UserYear:            user_year,
413
 		WorkTime:            work_time,
430
 		WorkTime:            work_time,
414
 		ZoneId:              zone_id,
431
 		ZoneId:              zone_id,
432
+		HomeAddress:         home_address,
433
+		HomeSetting:         home_setting,
434
+		HomeType:            home_type,
435
+		HomeBigType:         home_big_type,
415
 	}
436
 	}
416
 	err = service.UpdateMachine(id, orgid, &addmacher)
437
 	err = service.UpdateMachine(id, orgid, &addmacher)
417
 	errors := service.UpdateTreatMode(id, orgid, ids)
438
 	errors := service.UpdateTreatMode(id, orgid, ids)

+ 14 - 3
controllers/manager_center_api_controller.go Näytä tiedosto

172
 	scan_code := c.GetString("scan_code")
172
 	scan_code := c.GetString("scan_code")
173
 	drug_identification_code := c.GetString("drug_identification_code")
173
 	drug_identification_code := c.GetString("drug_identification_code")
174
 
174
 
175
+	split_of_number, _ := c.GetInt64("split_of_number")
176
+
175
 	hans := drug_name // 要转换的汉字字符串
177
 	hans := drug_name // 要转换的汉字字符串
176
 
178
 
177
 	// 创建一个拼音转换器
179
 	// 创建一个拼音转换器
266
 		IsZeroFlag:                  is_zero_flag,
268
 		IsZeroFlag:                  is_zero_flag,
267
 		ScanCode:                    scan_code,
269
 		ScanCode:                    scan_code,
268
 		DrugIdentificationCode:      drug_identification_code,
270
 		DrugIdentificationCode:      drug_identification_code,
271
+		SplitOfNumber:               split_of_number,
269
 	}
272
 	}
270
 	drugLib.FirstLetter = firstLetter
273
 	drugLib.FirstLetter = firstLetter
271
 	drugLib.Pinyin = firstLetter
274
 	drugLib.Pinyin = firstLetter
393
 	is_zero_flag, _ := c.GetInt64("is_zero_flag")
396
 	is_zero_flag, _ := c.GetInt64("is_zero_flag")
394
 	scan_code := c.GetString("scan_code")
397
 	scan_code := c.GetString("scan_code")
395
 	drug_identification_code := c.GetString("drug_identification_code")
398
 	drug_identification_code := c.GetString("drug_identification_code")
396
-
399
+	split_of_number, _ := c.GetInt64("split_of_number")
397
 	adminInfo := c.GetAdminUserInfo()
400
 	adminInfo := c.GetAdminUserInfo()
398
 	drug, _ := service.FindBaseDrugLibRecord(adminInfo.CurrentOrgId, id)
401
 	drug, _ := service.FindBaseDrugLibRecord(adminInfo.CurrentOrgId, id)
399
 
402
 
494
 		IsZeroFlag:                  is_zero_flag,
497
 		IsZeroFlag:                  is_zero_flag,
495
 		ScanCode:                    scan_code,
498
 		ScanCode:                    scan_code,
496
 		DrugIdentificationCode:      drug_identification_code,
499
 		DrugIdentificationCode:      drug_identification_code,
500
+		SplitOfNumber:               split_of_number,
497
 	}
501
 	}
498
 	if adminInfo.CurrentOrgId == 10206 || adminInfo.CurrentOrgId == 10344 {
502
 	if adminInfo.CurrentOrgId == 10206 || adminInfo.CurrentOrgId == 10344 {
499
 
503
 
1610
 	good_id, _ := c.GetInt64("good_id", 0)
1614
 	good_id, _ := c.GetInt64("good_id", 0)
1611
 	specification_name := c.GetString("specification_name")
1615
 	specification_name := c.GetString("specification_name")
1612
 	register_number := c.GetString("register_number")
1616
 	register_number := c.GetString("register_number")
1613
-
1617
+	register_number_name := c.GetString("register_number_name")
1614
 	good_unit, _ := c.GetInt64("good_unit", -1)
1618
 	good_unit, _ := c.GetInt64("good_unit", -1)
1615
 	buy_price, _ := c.GetFloat("buy_price", 0)
1619
 	buy_price, _ := c.GetFloat("buy_price", 0)
1616
 	sell_price, _ := c.GetFloat("sell_price", 0)
1620
 	sell_price, _ := c.GetFloat("sell_price", 0)
1661
 	is_show, _ := c.GetInt64("is_show")
1665
 	is_show, _ := c.GetInt64("is_show")
1662
 	is_zero_flag, _ := c.GetInt64("is_zero_flag")
1666
 	is_zero_flag, _ := c.GetInt64("is_zero_flag")
1663
 
1667
 
1668
+	split_of_number, _ := c.GetInt64("split_of_number")
1669
+
1664
 	adminUserInfo := c.GetAdminUserInfo()
1670
 	adminUserInfo := c.GetAdminUserInfo()
1665
 
1671
 
1666
 	totals := service.FindGoodInfoByNameTwo(specification_name, adminUserInfo.CurrentOrgId, good_id, good_name)
1672
 	totals := service.FindGoodInfoByNameTwo(specification_name, adminUserInfo.CurrentOrgId, good_id, good_name)
1745
 		Bck01b:                      "55",
1751
 		Bck01b:                      "55",
1746
 		IsShow:                      is_show,
1752
 		IsShow:                      is_show,
1747
 		IsZeroFlag:                  is_zero_flag,
1753
 		IsZeroFlag:                  is_zero_flag,
1754
+		SplitOfNumber:               split_of_number,
1755
+		RegisterNumberName:          register_number_name,
1748
 	}
1756
 	}
1749
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1757
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1750
 	if err == nil {
1758
 	if err == nil {
1816
 	bby01 := c.GetString("bby01")
1824
 	bby01 := c.GetString("bby01")
1817
 	is_show, _ := c.GetInt64("is_show")
1825
 	is_show, _ := c.GetInt64("is_show")
1818
 	is_zero_flag, _ := c.GetInt64("is_zero_flag")
1826
 	is_zero_flag, _ := c.GetInt64("is_zero_flag")
1819
-
1827
+	split_of_number, _ := c.GetInt64("split_of_number")
1828
+	register_number_name := c.GetString("register_number_name")
1820
 	// 创建一个拼音转换器
1829
 	// 创建一个拼音转换器
1821
 	p := pinyin.NewArgs()
1830
 	p := pinyin.NewArgs()
1822
 
1831
 
1893
 		Bck01b:                      "55",
1902
 		Bck01b:                      "55",
1894
 		IsShow:                      is_show,
1903
 		IsShow:                      is_show,
1895
 		IsZeroFlag:                  is_zero_flag,
1904
 		IsZeroFlag:                  is_zero_flag,
1905
+		SplitOfNumber:               split_of_number,
1906
+		RegisterNumberName:          register_number_name,
1896
 	}
1907
 	}
1897
 
1908
 
1898
 	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)

+ 22 - 18
controllers/mobile_api_controllers/dialysis_api_controller.go Näytä tiedosto

4388
 				}
4388
 				}
4389
 			}
4389
 			}
4390
 
4390
 
4391
-			if adminUserInfo.Org.Id == 10766 || adminUserInfo.Org.Id == 10768 {
4391
+			if adminUserInfo.Org.Id == 10766 || adminUserInfo.Org.Id == 10768 || adminUserInfo.Org.Id == 9478 {
4392
 				if prescription.ModeId == 2 || prescription.ModeId == 13 {
4392
 				if prescription.ModeId == 2 || prescription.ModeId == 13 {
4393
 					totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
4393
 					totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
4394
 					if totalMin == 0 {
4394
 					if totalMin == 0 {
5953
 		var displacement_quantity float64
5953
 		var displacement_quantity float64
5954
 		totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
5954
 		totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
5955
 
5955
 
5956
-		//replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*60) / 1000
5957
-		////乘10 除10是为了保留一位小数
5958
 		replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
5956
 		replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
5959
-		fmt.Println("replacement_rate", replacement_rate)
5960
-		record.ReplacementRate = replacement_rate
5961
-		displacement_quantity = math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600) * replacement_rate
5962
-		record.DisplacementQuantity = displacement_quantity
5963
-		//fmt.Println("totalMin", totalMin)
5964
-		//fmt.Println("math.Floor(prescription", math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*60))
5965
-		//fmt.Println("replacement_rate", replacement_rate)
5966
-		//fmt.Println("math.Floor", math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600))
5967
-		//fmt.Println("displacement_quantity===================", displacement_quantity)
5968
-	}
5969
 
5957
 
5970
-	if adminInfo.Org.Id == 9478 {
5971
-		var replacement_rate float64
5972
-		var displacement_quantity float64
5973
-		totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
5974
-		replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*60) / 1000
5975
 		record.ReplacementRate = replacement_rate
5958
 		record.ReplacementRate = replacement_rate
5976
 		displacement_quantity = math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600) * replacement_rate
5959
 		displacement_quantity = math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600) * replacement_rate
5977
 		record.DisplacementQuantity = displacement_quantity
5960
 		record.DisplacementQuantity = displacement_quantity
5996
 		var displacement_quantity float64
5979
 		var displacement_quantity float64
5997
 		totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
5980
 		totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
5998
 		replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*60) / 1000
5981
 		replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*60) / 1000
5982
+
5999
 		record.ReplacementRate = replacement_rate
5983
 		record.ReplacementRate = replacement_rate
6000
 		displacement_quantity = math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600) * replacement_rate
5984
 		displacement_quantity = math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600) * replacement_rate
6001
 		record.DisplacementQuantity = displacement_quantity
5985
 		record.DisplacementQuantity = displacement_quantity
6032
 		record.UltrafiltrationVolume = ultrafiltration_volume / 1000
6016
 		record.UltrafiltrationVolume = ultrafiltration_volume / 1000
6033
 	}
6017
 	}
6034
 
6018
 
6019
+	if adminInfo.Org.Id == 9478 {
6020
+		totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
6021
+		if totalMin == 0 {
6022
+			totalMin = 240
6023
+		}
6024
+		if prescription.DisplaceLiquiValue == 0 {
6025
+			prescription.DisplaceLiquiValue = 15
6026
+		}
6027
+		var replacement_rate float64
6028
+		//乘10 除10是为了保留一位小数
6029
+		replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
6030
+
6031
+		fmt.Println("hahahahahhaahahah", replacement_rate)
6032
+		record.ReplacementRate = replacement_rate
6033
+	}
6034
+
6035
 	lastMonitorRecordList, _ := service.GetLastMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
6035
 	lastMonitorRecordList, _ := service.GetLastMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
6036
 
6036
 
6037
 	fisrtMonitorRecordList, _ := service.GetFisrtMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
6037
 	fisrtMonitorRecordList, _ := service.GetFisrtMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
13353
 
13353
 
13354
 	dataBody := make(map[string]interface{}, 0)
13354
 	dataBody := make(map[string]interface{}, 0)
13355
 	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
13355
 	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
13356
+
13356
 	if err != nil {
13357
 	if err != nil {
13357
 		utils.ErrorLog(err.Error())
13358
 		utils.ErrorLog(err.Error())
13358
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
13359
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
13360
 	}
13361
 	}
13361
 	orgId := c.GetMobileAdminUserInfo().Org.Id
13362
 	orgId := c.GetMobileAdminUserInfo().Org.Id
13362
 	patient_id := int64(dataBody["patient_id"].(float64))
13363
 	patient_id := int64(dataBody["patient_id"].(float64))
13364
+
13363
 	record_date := int64(dataBody["record_date"].(float64))
13365
 	record_date := int64(dataBody["record_date"].(float64))
13364
 
13366
 
13365
 	execution_staff := int64(dataBody["execution_staff"].(float64))
13367
 	execution_staff := int64(dataBody["execution_staff"].(float64))
13367
 	execution_time := dataBody["execution_time"].(string)
13369
 	execution_time := dataBody["execution_time"].(string)
13368
 
13370
 
13369
 	executionTime, parseStartDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", execution_time)
13371
 	executionTime, parseStartDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", execution_time)
13372
+
13370
 	if parseStartDateErr != nil {
13373
 	if parseStartDateErr != nil {
13371
 		c.ErrorLog("时间解析失败:%v", parseStartDateErr)
13374
 		c.ErrorLog("时间解析失败:%v", parseStartDateErr)
13372
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
13375
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
13378
 	var team_list []int64
13381
 	var team_list []int64
13379
 	if dataBody["new_advice_list"] != nil && reflect.TypeOf(dataBody["new_advice_list"]).String() == "[]interface {}" {
13382
 	if dataBody["new_advice_list"] != nil && reflect.TypeOf(dataBody["new_advice_list"]).String() == "[]interface {}" {
13380
 		newAdviceList, _ := dataBody["new_advice_list"].([]interface{})
13383
 		newAdviceList, _ := dataBody["new_advice_list"].([]interface{})
13384
+
13381
 		if len(newAdviceList) > 0 {
13385
 		if len(newAdviceList) > 0 {
13382
 			for _, item := range newAdviceList {
13386
 			for _, item := range newAdviceList {
13383
 				items := item.(map[string]interface{})
13387
 				items := item.(map[string]interface{})

+ 6 - 9
controllers/mobile_api_controllers/dialysis_api_controller_extend.go Näytä tiedosto

2
 
2
 
3
 import (
3
 import (
4
 	"encoding/json"
4
 	"encoding/json"
5
-	"fmt"
6
 	"strconv"
5
 	"strconv"
7
 	"time"
6
 	"time"
8
 
7
 
60
 		operateTime = 0
59
 		operateTime = 0
61
 		// recordTime = ""
60
 		// recordTime = ""
62
 	}
61
 	}
63
-	fmt.Println(date)
64
-	fmt.Println(operateTime)
65
 
62
 
66
 	pulseFrequency, _ := this.GetFloat("pulse_frequency")
63
 	pulseFrequency, _ := this.GetFloat("pulse_frequency")
67
 	//breathingRated, _ := this.GetFloat("breathing_rated")
64
 	//breathingRated, _ := this.GetFloat("breathing_rated")
267
 		AccumulatedBloodVolumeOne:        accumulated_blood_volume_one,
264
 		AccumulatedBloodVolumeOne:        accumulated_blood_volume_one,
268
 	}
265
 	}
269
 
266
 
270
-	err := service.CreateMonitor(&record)
267
+	service.CreateMonitor(&record)
271
 	//记录日志
268
 	//记录日志
272
 	byterequest, _ := json.Marshal(record)
269
 	byterequest, _ := json.Marshal(record)
273
 	monitorRecordLog := models.XtMonitorRecordLog{
270
 	monitorRecordLog := models.XtMonitorRecordLog{
297
 		PatientId:  patientID,
294
 		PatientId:  patientID,
298
 	}
295
 	}
299
 
296
 
300
-	dialysisFinish, err := service.GetDialysisFinish(record.UserOrgId, record.MonitoringDate, 7, patientID)
297
+	dialysisFinish, _ := service.GetDialysisFinish(record.UserOrgId, record.MonitoringDate, 7, patientID)
301
 	if dialysisFinish.ID == 0 {
298
 	if dialysisFinish.ID == 0 {
302
 		service.CreateDialysisFinish(finish)
299
 		service.CreateDialysisFinish(finish)
303
 	}
300
 	}
308
 	keyOne := strconv.FormatInt(adminInfo.Org.Id, 10) + ":" + strconv.FormatInt(date, 10) + ":monitor_record_list_all"
305
 	keyOne := strconv.FormatInt(adminInfo.Org.Id, 10) + ":" + strconv.FormatInt(date, 10) + ":monitor_record_list_all"
309
 	redis.Set(keyOne, "", time.Second)
306
 	redis.Set(keyOne, "", time.Second)
310
 	defer redis.Close()
307
 	defer redis.Close()
311
-	if err != nil {
312
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeMonitorCreate)
313
-		return
314
-	}
308
+	//if err != nil {
309
+	//	this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeMonitorCreate)
310
+	//	return
311
+	//}
315
 
312
 
316
 	this.ServeSuccessJSON(map[string]interface{}{
313
 	this.ServeSuccessJSON(map[string]interface{}{
317
 		"monitor": record,
314
 		"monitor": record,

+ 9 - 9
controllers/mobile_api_controllers/patient_api_controller.go Näytä tiedosto

1696
 
1696
 
1697
 							if medical.IsUse != 1 {
1697
 							if medical.IsUse != 1 {
1698
 								if (list.Count*medical.MinNumber + list.StockMinNumber) == 0 {
1698
 								if (list.Count*medical.MinNumber + list.StockMinNumber) == 0 {
1699
-									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && advice.UserOrgId != 10724 && advice.UserOrgId != 10571 && advice.UserOrgId != 10731 {
1699
+									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && advice.UserOrgId != 10724 && advice.UserOrgId != 10571 && advice.UserOrgId != 10731 && advice.UserOrgId != 10610 {
1700
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1700
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1701
 										advice.ExecutionTime = 0
1701
 										advice.ExecutionTime = 0
1702
 										advice.ExecutionState = 2
1702
 										advice.ExecutionState = 2
1712
 
1712
 
1713
 								}
1713
 								}
1714
 								if prescribing_number_total > total {
1714
 								if prescribing_number_total > total {
1715
-									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && advice.UserOrgId != 10724 && advice.UserOrgId != 10571 && advice.UserOrgId != 10731 {
1715
+									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && advice.UserOrgId != 10724 && advice.UserOrgId != 10571 && advice.UserOrgId != 10731 && advice.UserOrgId != 10610 {
1716
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1716
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1717
 										advice.ExecutionTime = 0
1717
 										advice.ExecutionTime = 0
1718
 										advice.ExecutionState = 2
1718
 										advice.ExecutionState = 2
1739
 											//查询今日是否出库
1739
 											//查询今日是否出库
1740
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1740
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1741
 											if drugOutInfo.ID == 0 {
1741
 											if drugOutInfo.ID == 0 {
1742
-												if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1742
+												if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1743
 													service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1743
 													service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1744
 												}
1744
 												}
1745
 
1745
 
1749
 										if pharmacyConfig.IsOpen != 1 {
1749
 										if pharmacyConfig.IsOpen != 1 {
1750
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1750
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1751
 											if drugOutInfo.ID == 0 {
1751
 											if drugOutInfo.ID == 0 {
1752
-												if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1752
+												if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1753
 													service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1753
 													service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1754
 												}
1754
 												}
1755
 
1755
 
1776
 									if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
1776
 									if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
1777
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1777
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1778
 										if drugOutInfo.ID == 0 {
1778
 										if drugOutInfo.ID == 0 {
1779
-											if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1779
+											if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1780
 												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1780
 												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1781
 											}
1781
 											}
1782
 
1782
 
1800
 										service.CreateDrugError(drugError)
1800
 										service.CreateDrugError(drugError)
1801
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1801
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1802
 										if drugOutInfo.ID == 0 {
1802
 										if drugOutInfo.ID == 0 {
1803
-											if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1803
+											if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1804
 												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1804
 												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1805
 											}
1805
 											}
1806
 
1806
 
1893
 									return
1893
 									return
1894
 								}
1894
 								}
1895
 								if prescribing_number_total > total {
1895
 								if prescribing_number_total > total {
1896
-									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1896
+									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1897
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1897
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1898
 										advice.ExecutionTime = 0
1898
 										advice.ExecutionTime = 0
1899
 										advice.ExecutionState = 2
1899
 										advice.ExecutionState = 2
1912
 									//查询今日是否出库
1912
 									//查询今日是否出库
1913
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1913
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1914
 									if drugOutInfo.ID == 0 {
1914
 									if drugOutInfo.ID == 0 {
1915
-										if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1915
+										if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1916
 											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1916
 											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1917
 										}
1917
 										}
1918
 
1918
 
1922
 									//查询今日是否出库
1922
 									//查询今日是否出库
1923
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1923
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1924
 									if drugOutInfo.ID == 0 {
1924
 									if drugOutInfo.ID == 0 {
1925
-										if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1925
+										if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1926
 											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1926
 											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1927
 										}
1927
 										}
1928
 
1928
 

+ 1 - 0
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go Näytä tiedosto

3068
 	org_id := this.GetMobileAdminUserInfo().Org.Id
3068
 	org_id := this.GetMobileAdminUserInfo().Org.Id
3069
 
3069
 
3070
 	patient, _ := service.GetPatientDetailTwo(patient_id)
3070
 	patient, _ := service.GetPatientDetailTwo(patient_id)
3071
+
3071
 	inspection, _ := service.GetInspectionGroup(patient.BloodId, org_id)
3072
 	inspection, _ := service.GetInspectionGroup(patient.BloodId, org_id)
3072
 
3073
 
3073
 	if len(inspection) > 0 {
3074
 	if len(inspection) > 0 {

+ 11 - 5
controllers/patient_api_controller.go Näytä tiedosto

9146
 
9146
 
9147
 	inspection, _ := service.GetNewInspectionByProjectId(patient_id, project_id, inspect_date, orgId)
9147
 	inspection, _ := service.GetNewInspectionByProjectId(patient_id, project_id, inspect_date, orgId)
9148
 
9148
 
9149
+	referenceList, _ := service.GetNewInspectionRefence(orgId, project_id)
9150
+
9149
 	this.ServeSuccessJSON(map[string]interface{}{
9151
 	this.ServeSuccessJSON(map[string]interface{}{
9150
-		"inspection": inspection,
9152
+		"inspection":    inspection,
9153
+		"referenceList": referenceList,
9151
 	})
9154
 	})
9152
 }
9155
 }
9153
 
9156
 
9353
 
9356
 
9354
 	id, _ := this.GetInt64("id")
9357
 	id, _ := this.GetInt64("id")
9355
 
9358
 
9359
+	patient_id, _ := this.GetInt64("patient_id")
9360
+
9356
 	db := service.XTWriteDB()
9361
 	db := service.XTWriteDB()
9357
 	// 开始外部循环的事务
9362
 	// 开始外部循环的事务
9358
 	tx := db.Begin()
9363
 	tx := db.Begin()
9371
 	warehouseInfo, _ := service.GetPatientCountById(id, tx)
9376
 	warehouseInfo, _ := service.GetPatientCountById(id, tx)
9372
 
9377
 
9373
 	if warehouseInfo.ID > 0 {
9378
 	if warehouseInfo.ID > 0 {
9374
-		service.ModiftyPatientCount(warehouseInfo.Count, warehouseInfo.IsType, warehouseInfo.PatientId, tx)
9375
-		patient, _ := service.GetSfPatientById(tx, warehouseInfo.PatientId)
9379
+
9380
+		service.ModiftyPatientCount(warehouseInfo.Count, warehouseInfo.IsType, patient_id, tx)
9381
+		patient, _ := service.GetSfPatientById(tx, patient_id)
9376
 
9382
 
9377
 		var over_count int64
9383
 		var over_count int64
9378
 		if warehouseInfo.IsType == 1 {
9384
 		if warehouseInfo.IsType == 1 {
9396
 			Count:           warehouseInfo.Count,
9402
 			Count:           warehouseInfo.Count,
9397
 			ModeId:          warehouseInfo.IsType,
9403
 			ModeId:          warehouseInfo.IsType,
9398
 			IsType:          1,
9404
 			IsType:          1,
9399
-			PatientId:       warehouseInfo.PatientId,
9405
+			PatientId:       patient_id,
9400
 			Status:          1,
9406
 			Status:          1,
9401
 			Ctime:           time.Now().Unix(),
9407
 			Ctime:           time.Now().Unix(),
9402
 			Mtime:           time.Now().Unix(),
9408
 			Mtime:           time.Now().Unix(),
9409
 	}
9415
 	}
9410
 
9416
 
9411
 	checkpatientcount, _ := service.CheckPatientCount(id, tx)
9417
 	checkpatientcount, _ := service.CheckPatientCount(id, tx)
9412
-
9418
+	fmt.Println("checkpatientcount----------------", checkpatientcount)
9413
 	tx.Commit()
9419
 	tx.Commit()
9414
 
9420
 
9415
 	this.ServeSuccessJSON(map[string]interface{}{
9421
 	this.ServeSuccessJSON(map[string]interface{}{

+ 9 - 7
controllers/pharmacy_controller.go Näytä tiedosto

1220
 
1220
 
1221
 	recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
1221
 	recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
1222
 
1222
 
1223
+	baseDrug, _ := service.GetBaseDrugMedical(drug_id)
1224
+
1223
 	//盘亏
1225
 	//盘亏
1224
 	if ord_total > new_total {
1226
 	if ord_total > new_total {
1225
 
1227
 
1259
 			StockMaxNumber:     stock_max_number,
1261
 			StockMaxNumber:     stock_max_number,
1260
 			StockMinNumber:     stock_min_number,
1262
 			StockMinNumber:     stock_min_number,
1261
 			MinCount:           0,
1263
 			MinCount:           0,
1262
-			MinUnit:            drugWarehouseInfoOne.MinUnit,
1264
+			MinUnit:            baseDrug.MinUnit,
1263
 			LastStockMaxNumber: last_stock_max_number,
1265
 			LastStockMaxNumber: last_stock_max_number,
1264
 			LastStockMinNumber: last_stock_min_number,
1266
 			LastStockMinNumber: last_stock_min_number,
1265
 			InventoryType:      11,
1267
 			InventoryType:      11,
1300
 			CancelOutDetailId:       0,
1302
 			CancelOutDetailId:       0,
1301
 			ExpireDate:              drugWarehouseInfoOne.ExpiryDate,
1303
 			ExpireDate:              drugWarehouseInfoOne.ExpiryDate,
1302
 			ProductDate:             0,
1304
 			ProductDate:             0,
1303
-			MaxUnit:                 drugWarehouseInfoOne.MaxUnit,
1304
-			MinUnit:                 drugWarehouseInfoOne.MinUnit,
1305
+			MaxUnit:                 baseDrug.MinUnit,
1306
+			MinUnit:                 baseDrug.MinUnit,
1305
 			StorehouseId:            storehouse_id,
1307
 			StorehouseId:            storehouse_id,
1306
 			OverCount:               sum_count,
1308
 			OverCount:               sum_count,
1307
 		}
1309
 		}
1320
 		inventory := models.XtDrugInventory{
1322
 		inventory := models.XtDrugInventory{
1321
 			DrugName:           base.DrugName,
1323
 			DrugName:           base.DrugName,
1322
 			SpecificationName:  specification_name,
1324
 			SpecificationName:  specification_name,
1323
-			WarehousingUnit:    drugWarehouseInfoOne.MaxUnit,
1325
+			WarehousingUnit:    drugWarehouseInfoOne.MinUnit,
1324
 			Count:              consumable_count,
1326
 			Count:              consumable_count,
1325
 			LastPrice:          drugWarehouseInfoOne.Price,
1327
 			LastPrice:          drugWarehouseInfoOne.Price,
1326
 			RetailPrice:        drugWarehouseInfoOne.RetailPrice,
1328
 			RetailPrice:        drugWarehouseInfoOne.RetailPrice,
1351
 			StockMaxNumber:     stock_max_number,
1353
 			StockMaxNumber:     stock_max_number,
1352
 			StockMinNumber:     stock_min_number,
1354
 			StockMinNumber:     stock_min_number,
1353
 			MinCount:           0,
1355
 			MinCount:           0,
1354
-			MinUnit:            drugWarehouseInfoOne.MinUnit,
1356
+			MinUnit:            baseDrug.MinUnit,
1355
 			LastStockMaxNumber: last_stock_max_number,
1357
 			LastStockMaxNumber: last_stock_max_number,
1356
 			LastStockMinNumber: last_stock_min_number,
1358
 			LastStockMinNumber: last_stock_min_number,
1357
 			InventoryType:      10,
1359
 			InventoryType:      10,
1392
 			CancelOutDetailId:       0,
1394
 			CancelOutDetailId:       0,
1393
 			ExpireDate:              drugWarehouseInfoOne.ExpiryDate,
1395
 			ExpireDate:              drugWarehouseInfoOne.ExpiryDate,
1394
 			ProductDate:             0,
1396
 			ProductDate:             0,
1395
-			MaxUnit:                 drugWarehouseInfoOne.MaxUnit,
1396
-			MinUnit:                 drugWarehouseInfoOne.MinUnit,
1397
+			MaxUnit:                 baseDrug.MinUnit,
1398
+			MinUnit:                 baseDrug.MinUnit,
1397
 			StorehouseId:            storehouse_id,
1399
 			StorehouseId:            storehouse_id,
1398
 			OverCount:               sum_count,
1400
 			OverCount:               sum_count,
1399
 		}
1401
 		}

+ 33 - 2
controllers/role_controller.go Näytä tiedosto

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)

+ 29 - 6
controllers/self_drug_api_congtroller.go Näytä tiedosto

203
 
203
 
204
 	beego.Router("/api/drug/getdrugwarehouseinfoprintlist", &SelfDrugApiController{}, "Get:GetDrugWarehouseInfoPrintList")
204
 	beego.Router("/api/drug/getdrugwarehouseinfoprintlist", &SelfDrugApiController{}, "Get:GetDrugWarehouseInfoPrintList")
205
 
205
 
206
+	beego.Router("/api/patient/changegoodwarehouseinfo", &SelfDrugApiController{}, "Post:ChangeGoodWarehouseInfo")
207
+
206
 }
208
 }
207
 
209
 
208
 func (this *SelfDrugApiController) GetCurrentPatient() {
210
 func (this *SelfDrugApiController) GetCurrentPatient() {
2960
 	keyword := this.GetString("keyword")
2962
 	keyword := this.GetString("keyword")
2961
 	page, _ := this.GetInt64("page")
2963
 	page, _ := this.GetInt64("page")
2962
 	limit, _ := this.GetInt64("limit")
2964
 	limit, _ := this.GetInt64("limit")
2965
+	good_type_id, _ := this.GetInt64("good_type_id")
2963
 
2966
 
2964
 	// 查询该机构所有耗材入库信息
2967
 	// 查询该机构所有耗材入库信息
2965
 	//goodList, _ := service.GetAllGoodListSeven(orgId)
2968
 	//goodList, _ := service.GetAllGoodListSeven(orgId)
2983
 		}
2986
 		}
2984
 	}
2987
 	}
2985
 
2988
 
2986
-	stockList, total, err := service.GetGoodStockList(orgId, storehouse_id, good_type, keyword, page, limit, ids)
2989
+	stockList, total, err := service.GetGoodStockList(orgId, storehouse_id, good_type, keyword, page, limit, ids, good_type_id)
2987
 
2990
 
2988
 	if err != nil {
2991
 	if err != nil {
2989
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取查询信息失败")
2992
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取查询信息失败")
3867
 	start_time := this.GetString("start_time")
3870
 	start_time := this.GetString("start_time")
3868
 	end_time := this.GetString("end_time")
3871
 	end_time := this.GetString("end_time")
3869
 	orgId := this.GetAdminUserInfo().CurrentOrgId
3872
 	orgId := this.GetAdminUserInfo().CurrentOrgId
3873
+
3874
+	query_type, _ := this.GetInt64("query_type")
3870
 	timeLayout := "2006-01-02"
3875
 	timeLayout := "2006-01-02"
3871
 	loc, _ := time.LoadLocation("Local")
3876
 	loc, _ := time.LoadLocation("Local")
3872
 	var startTime int64
3877
 	var startTime int64
3906
 	medicalInsuranceLevelParent, _ := service.GetDrugDataConfig(0, medicalInsuranceLevel)
3911
 	medicalInsuranceLevelParent, _ := service.GetDrugDataConfig(0, medicalInsuranceLevel)
3907
 	medicalInsuranceLevelList, _ := service.GetParentDataConfig(medicalInsuranceLevelParent.ID, orgId)
3912
 	medicalInsuranceLevelList, _ := service.GetParentDataConfig(medicalInsuranceLevelParent.ID, orgId)
3908
 
3913
 
3909
-	if orgId == 10265 {
3914
+	if orgId == 10265 || orgId == 10138 {
3910
 		//storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
3915
 		//storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
3911
 
3916
 
3912
-		list, total, err := service.GetGoodNewPurchaseStockQuery(good_type, keyword, page, limit, orgId, ids, goodIds)
3917
+		list, total, err := service.GetGoodNewPurchaseStockQuery(good_type, keyword, page, limit, orgId, ids, goodIds, query_type)
3913
 
3918
 
3914
 		for _, item := range list {
3919
 		for _, item := range list {
3915
 
3920
 
3979
 		})
3984
 		})
3980
 	}
3985
 	}
3981
 
3986
 
3982
-	if orgId != 10265 {
3983
-		list, total, err := service.GetGoodNewPurchaseStockQueryOne(good_type, keyword, page, limit, orgId, ids, goodIds)
3987
+	if orgId != 10265 && orgId != 10138 {
3988
+		list, total, err := service.GetGoodNewPurchaseStockQueryOne(good_type, keyword, page, limit, orgId, ids, goodIds, query_type)
3984
 		storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
3989
 		storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
3985
 		for _, item := range list {
3990
 		for _, item := range list {
3986
 
3991
 
4094
 
4099
 
4095
 	start_time := this.GetString("start_time")
4100
 	start_time := this.GetString("start_time")
4096
 	end_time := this.GetString("end_time")
4101
 	end_time := this.GetString("end_time")
4102
+
4103
+	query_type, _ := this.GetInt64("query_type")
4097
 	orgId := this.GetAdminUserInfo().CurrentOrgId
4104
 	orgId := this.GetAdminUserInfo().CurrentOrgId
4098
 	timeLayout := "2006-01-02"
4105
 	timeLayout := "2006-01-02"
4099
 	loc, _ := time.LoadLocation("Local")
4106
 	loc, _ := time.LoadLocation("Local")
4130
 	}
4137
 	}
4131
 
4138
 
4132
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)
4139
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)
4133
-	list, total, err := service.GetDrugNewPurchaseStockQuery(good_type, keyword, page, limit, orgId, startTime, endTime, ids, infoIds)
4140
+	list, total, err := service.GetDrugNewPurchaseStockQuery(good_type, keyword, page, limit, orgId, startTime, endTime, ids, infoIds, query_type)
4134
 
4141
 
4135
 	for _, item := range list {
4142
 	for _, item := range list {
4136
 
4143
 
6910
 	})
6917
 	})
6911
 
6918
 
6912
 }
6919
 }
6920
+
6921
+func (this *SelfDrugApiController) ChangeGoodWarehouseInfo() {
6922
+
6923
+	dataBody := make(map[string]interface{}, 0)
6924
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
6925
+	fmt.Println(err)
6926
+	id := int64(dataBody["id"].(float64))
6927
+	good_code := dataBody["good_code"].(string)
6928
+
6929
+	service.ModifyGoodCodeWarehouseInfo(id, good_code)
6930
+
6931
+	this.ServeSuccessJSON(map[string]interface{}{
6932
+		"msg": "ok",
6933
+	})
6934
+
6935
+}

+ 52 - 1
controllers/stock_in_api_controller.go Näytä tiedosto

7616
 				return
7616
 				return
7617
 			}
7617
 			}
7618
 
7618
 
7619
+			goodcodelist := strings.Split(item.GoodCode, ",")
7620
+
7621
+			if len(goodcodelist) > 0 {
7622
+				goodInfo, _ := service.GetNewGoodByIdIsStop(item.GoodId, item.OrgId, tx)
7623
+				for _, it := range goodcodelist {
7624
+					if it != "" {
7625
+						codeInfo := models.XtGoodCodeInfo{
7626
+							GoodId:          item.GoodId,
7627
+							BatchNumber:     item.Number,
7628
+							GoodCode:        it,
7629
+							WarehouseInfoId: item.ID,
7630
+							IsUserCount:     0,
7631
+							IsOutStatus:     2,
7632
+							Status:          1,
7633
+							UserOrgId:       item.OrgId,
7634
+							Ctime:           time.Now().Unix(),
7635
+							Mtime:           time.Now().Unix(),
7636
+							SplitOfNumber:   goodInfo.SplitOfNumber,
7637
+						}
7638
+						service.CreateCodeInfo(codeInfo, tx)
7639
+					}
7640
+
7641
+				}
7642
+			}
7643
+
7619
 		}
7644
 		}
7620
 	}
7645
 	}
7621
 	if is_success != 1 {
7646
 	if is_success != 1 {
7657
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCheckGoodParamWrong)
7682
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCheckGoodParamWrong)
7658
 			return
7683
 			return
7659
 		}
7684
 		}
7685
+
7686
+		//改变扫码库里面的状态
7687
+		goodcodelist := strings.Split(item.GoodCode, ",")
7688
+
7689
+		if len(goodcodelist) > 0 {
7690
+			goodInfo, _ := service.GetNewGoodByIdIsStop(item.GoodId, item.OrgId, tx)
7691
+			for _, it := range goodcodelist {
7692
+				if it != "" {
7693
+					codeInfo := models.XtGoodCodeInfo{
7694
+						GoodId:          item.GoodId,
7695
+						BatchNumber:     item.Number,
7696
+						GoodCode:        it,
7697
+						WarehouseInfoId: item.ID,
7698
+						IsUserCount:     0,
7699
+						IsOutStatus:     2,
7700
+						Status:          0,
7701
+						UserOrgId:       item.OrgId,
7702
+						Ctime:           time.Now().Unix(),
7703
+						Mtime:           time.Now().Unix(),
7704
+						SplitOfNumber:   goodInfo.SplitOfNumber,
7705
+					}
7706
+					service.UpdateCodeInfo(codeInfo, tx)
7707
+				}
7708
+
7709
+			}
7710
+		}
7660
 	}
7711
 	}
7661
 
7712
 
7662
 	err := service.UpdateNewWarehouseInfoMap(list, warehousing_info_id, orgId, tx)
7713
 	err := service.UpdateNewWarehouseInfoMap(list, warehousing_info_id, orgId, tx)
8166
 	//	service.UpdateDealerManufacturerOne(item.ID, manufacturer.ManufacturerName)
8217
 	//	service.UpdateDealerManufacturerOne(item.ID, manufacturer.ManufacturerName)
8167
 	//}
8218
 	//}
8168
 
8219
 
8169
-	drugList, _ := service.GetAllBaseDrugListTwentyOne(10726)
8220
+	drugList, _ := service.GetAllBaseDrugListTwentyOne(10265)
8170
 
8221
 
8171
 	for _, item := range drugList {
8222
 	for _, item := range drugList {
8172
 		var drug_spec = item.Dose + item.DoseUnit + "*" + strconv.FormatInt(item.MinNumber, 10) + item.MinUnit + "/" + item.MaxUnit
8223
 		var drug_spec = item.Dose + item.DoseUnit + "*" + strconv.FormatInt(item.MinNumber, 10) + item.MinUnit + "/" + item.MaxUnit

+ 8 - 0
models/device_models.go Näytä tiedosto

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"`
320
+	HomeType            string `gorm:"column:home_type" json:"home_type" form:"home_type"`
321
+	HomeBigType         string `gorm:"column:home_big_type" json:"home_big_type" form:"home_big_type"`
318
 }
322
 }
319
 
323
 
320
 type DeviceAddmacher struct {
324
 type DeviceAddmacher struct {
349
 	Mtime               int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
353
 	Mtime               int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
350
 	ZoneId              int64  `gorm:"column:zone_id" json:"zone_id" form:"zone_id"`
354
 	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"`
355
 	BedId               int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
356
+	HomeAddress         string `gorm:"column:home_address" json:"home_address" form:"home_address"`
357
+	HomeSetting         string `gorm:"column:home_setting" json:"home_setting" form:"home_setting"`
358
+	HomeType            string `gorm:"column:home_type" json:"home_type" form:"home_type"`
359
+	HomeBigType         string `gorm:"column:home_big_type" json:"home_big_type" form:"home_big_type"`
352
 }
360
 }
353
 
361
 
354
 func (DeviceAddmacher) TableName() string {
362
 func (DeviceAddmacher) TableName() string {

+ 2 - 0
models/drug.go Näytä tiedosto

94
 	IsZeroFlag             int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
94
 	IsZeroFlag             int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
95
 	ScanCode               string `gorm:"column:scan_code" json:"scan_code" form:"scan_code"`
95
 	ScanCode               string `gorm:"column:scan_code" json:"scan_code" form:"scan_code"`
96
 	DrugIdentificationCode string `gorm:"column:drug_identification_code" json:"drug_identification_code" form:"drug_identification_code"`
96
 	DrugIdentificationCode string `gorm:"column:drug_identification_code" json:"drug_identification_code" form:"drug_identification_code"`
97
+	SplitOfNumber          int64  `gorm:"column:split_of_number" json:"split_of_number" form:"split_of_number"`
97
 }
98
 }
98
 
99
 
99
 func (BaseDrugLib) TableName() string {
100
 func (BaseDrugLib) TableName() string {
118
 	IsZeroFlag                  int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
119
 	IsZeroFlag                  int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
119
 	MedicalInsuranceLevel       int64  `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
120
 	MedicalInsuranceLevel       int64  `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
120
 	SocialSecurityDirectoryCode string `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
121
 	SocialSecurityDirectoryCode string `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
122
+	SplitOfNumber               int64  `gorm:"column:split_of_number" json:"split_of_number" form:"split_of_number"`
121
 }
123
 }
122
 
124
 
123
 func (BaseDrugLibSeven) TableName() string {
125
 func (BaseDrugLibSeven) TableName() string {

+ 4 - 2
models/good_models.go Näytä tiedosto

106
 	Bby01                       string               `gorm:"column:bby01" json:"bby01" form:"bby01"`
106
 	Bby01                       string               `gorm:"column:bby01" json:"bby01" form:"bby01"`
107
 	Bck01b                      string               `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
107
 	Bck01b                      string               `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
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
-
110
-	ZuobiaoId string `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
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"`
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
 
330
 	GoodStatus        string `gorm:"column:good_status" json:"good_status" form:"good_status"`
331
 	GoodStatus        string `gorm:"column:good_status" json:"good_status" form:"good_status"`
331
 	SpecificationName string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
332
 	SpecificationName string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
332
 	SumCount          int64  `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
333
 	SumCount          int64  `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
334
+	SplitOfNumber     int64  `gorm:"column:split_of_number" json:"split_of_number" form:"split_of_number"`
333
 }
335
 }
334
 
336
 
335
 func (GoodInfoSeven) TableName() string {
337
 func (GoodInfoSeven) TableName() string {

+ 11 - 7
models/his_models.go Näytä tiedosto

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 {

+ 2 - 0
models/new_stock_models.go Näytä tiedosto

290
 	GoodNumber                  string                  `gorm:"column:good_number" json:"good_number" form:"good_number"`
290
 	GoodNumber                  string                  `gorm:"column:good_number" json:"good_number" form:"good_number"`
291
 	SocialSecurityDirectoryCode string                  `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
291
 	SocialSecurityDirectoryCode string                  `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
292
 	MedicalInsuranceLevel       int64                   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
292
 	MedicalInsuranceLevel       int64                   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
293
+	StockWarnCount              int64                   `gorm:"column:stock_warn_count" json:"stock_warn_count" form:"stock_warn_count"`
293
 	StWarehousingInfo           []*StWarehousingInfo    `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"xt_warehouse_info"`
294
 	StWarehousingInfo           []*StWarehousingInfo    `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"xt_warehouse_info"`
294
 	WarehousingInfoOne          []*StartWarehousingInfo `gorm:"json:"warehouse_info"` //期间增加
295
 	WarehousingInfoOne          []*StartWarehousingInfo `gorm:"json:"warehouse_info"` //期间增加
295
 	WarehousingInfoStart        []*StartWarehousingInfo `gorm:"json:"warehouse_info_start"`
296
 	WarehousingInfoStart        []*StartWarehousingInfo `gorm:"json:"warehouse_info_start"`
428
 	Mtime                            int64             `gorm:"column:mtime" json:"mtime" form:"mtime"`
429
 	Mtime                            int64             `gorm:"column:mtime" json:"mtime" form:"mtime"`
429
 	OrgId                            int64             `gorm:"column:org_id" json:"org_id" form:"org_id"`
430
 	OrgId                            int64             `gorm:"column:org_id" json:"org_id" form:"org_id"`
430
 	IsSelfDrug                       int64             `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
431
 	IsSelfDrug                       int64             `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
432
+	DrugStockLimitCount              int64             `gorm:"column:drug_stock_limit_count" json:"drug_stock_limit_count" form:"drug_stock_limit_count"`
431
 	MedicalInsuranceNumber           string            `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
433
 	MedicalInsuranceNumber           string            `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
432
 	DrugFlowWarehouseInfo            []*DrugFlowTwenty `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_flow_info"`
434
 	DrugFlowWarehouseInfo            []*DrugFlowTwenty `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_flow_info"`
433
 	DrugActFlowWarehouseInfo         []*DrugFlowTwenty `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_act_flow_info"`
435
 	DrugActFlowWarehouseInfo         []*DrugFlowTwenty `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_act_flow_info"`

+ 4 - 0
models/role_models.go Näytä tiedosto

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 {

+ 39 - 0
models/stock_models.go Näytä tiedosto

1783
 	IsUpload                  int64   `gorm:"column:is_upload" json:"is_upload" form:"is_upload"`
1783
 	IsUpload                  int64   `gorm:"column:is_upload" json:"is_upload" form:"is_upload"`
1784
 	ManafacturerName          string  `gorm:"column:manafacturer_name" json:"manafacturer_name" form:"manafacturer_name"`
1784
 	ManafacturerName          string  `gorm:"column:manafacturer_name" json:"manafacturer_name" form:"manafacturer_name"`
1785
 	DealerName                string  `gorm:"column:dealer_name" json:"dealer_name" form:"dealer_name"`
1785
 	DealerName                string  `gorm:"column:dealer_name" json:"dealer_name" form:"dealer_name"`
1786
+	GoodCode                  string  `gorm:"column:good_code" json:"good_code" form:"good_code"`
1786
 }
1787
 }
1787
 
1788
 
1788
 func (XtWarehouseInfoEight) TableName() string {
1789
 func (XtWarehouseInfoEight) TableName() string {
1953
 func (PrintDrugWarehouseInfo) TableName() string {
1954
 func (PrintDrugWarehouseInfo) TableName() string {
1954
 	return "xt_drug_warehouse_info"
1955
 	return "xt_drug_warehouse_info"
1955
 }
1956
 }
1957
+
1958
+type XtGoodCodeInfo struct {
1959
+	ID              int64  `gorm:"column:id" json:"id" form:"id"`
1960
+	GoodId          int64  `gorm:"column:good_id" json:"good_id" form:"good_id"`
1961
+	BatchNumber     string `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
1962
+	GoodCode        string `gorm:"column:good_code" json:"good_code" form:"good_code"`
1963
+	WarehouseInfoId int64  `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
1964
+	IsUserCount     int64  `gorm:"column:is_user_count" json:"is_user_count" form:"is_user_count"`
1965
+	IsOutStatus     int64  `gorm:"column:is_out_status" json:"is_out_status" form:"is_out_status"`
1966
+	Status          int64  `gorm:"column:status" json:"status" form:"status"`
1967
+	UserOrgId       int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1968
+	Ctime           int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
1969
+	Mtime           int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
1970
+	SplitOfNumber   int64  `gorm:"column:split_of_number" json:"split_of_number" form:"split_of_number"`
1971
+}
1972
+
1973
+func (XtGoodCodeInfo) TableName() string {
1974
+	return "xt_good_code_info"
1975
+}
1976
+
1977
+type XtDrugCodeInfo struct {
1978
+	ID              int64  `gorm:"column:id" json:"id" form:"id"`
1979
+	DrugId          int64  `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
1980
+	BatchNumber     string `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
1981
+	DrugCode        string `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
1982
+	WarehouseInfoId int64  `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
1983
+	IsUserCount     int64  `gorm:"column:is_user_count" json:"is_user_count" form:"is_user_count"`
1984
+	IsOutStatus     int64  `gorm:"column:is_out_status" json:"is_out_status" form:"is_out_status"`
1985
+	Status          int64  `gorm:"column:status" json:"status" form:"status"`
1986
+	UserOrgId       int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1987
+	Ctime           int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
1988
+	Mtime           int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
1989
+	SplitOfNumber   int64  `gorm:"column:split_of_number" json:"split_of_number" form:"split_of_number"`
1990
+}
1991
+
1992
+func (XtDrugCodeInfo) TableName() string {
1993
+	return "xt_drug_code_info"
1994
+}

+ 3 - 3
service/common_service.go Näytä tiedosto

2493
 func GetPatientsControl(orgid int64, lapstor int64, startime int64, endtime int64, page int64, limit int64) (inspection []*models.PatientInspectionCount, total int64, err error) {
2493
 func GetPatientsControl(orgid int64, lapstor int64, startime int64, endtime int64, page int64, limit int64) (inspection []*models.PatientInspectionCount, total int64, err error) {
2494
 
2494
 
2495
 	db := readDb.Table("xt_inspection as x").Where("x.status =1")
2495
 	db := readDb.Table("xt_inspection as x").Where("x.status =1")
2496
-	table := readDb.Table("xt_patients as s")
2496
+	table := readDb.Table("xt_patients as s").Where("s.patient_type =1")
2497
 	fmt.Println(table)
2497
 	fmt.Println(table)
2498
 	d := readDb.Table(" xt_inspection_reference as r")
2498
 	d := readDb.Table(" xt_inspection_reference as r")
2499
 	fmt.Println(d)
2499
 	fmt.Println(d)
2557
 func GetLastPatientsControl(orgid int64, lapstor int64, startime int64, endtime int64) (inspection []*models.PatientInspectionCount, err error) {
2557
 func GetLastPatientsControl(orgid int64, lapstor int64, startime int64, endtime int64) (inspection []*models.PatientInspectionCount, err error) {
2558
 
2558
 
2559
 	db := readDb.Table("xt_inspection as x").Where("x.status =1")
2559
 	db := readDb.Table("xt_inspection as x").Where("x.status =1")
2560
-	table := readDb.Table("xt_patients as s")
2560
+	table := readDb.Table("xt_patients as s").Where("s.patient_type =1")
2561
 	//fmt.Println(table)
2561
 	//fmt.Println(table)
2562
 	d := readDb.Table(" xt_inspection_reference as r")
2562
 	d := readDb.Table(" xt_inspection_reference as r")
2563
 	fmt.Println(d)
2563
 	fmt.Println(d)
2673
 
2673
 
2674
 func GetInfectiousControl(orgid int64, lapstor int64, startime int64, endtime int64) (inspection []*models.PatientInspectionCount, err error) {
2674
 func GetInfectiousControl(orgid int64, lapstor int64, startime int64, endtime int64) (inspection []*models.PatientInspectionCount, err error) {
2675
 	db := readDb.Table("xt_inspection as x").Where("x.status =1")
2675
 	db := readDb.Table("xt_inspection as x").Where("x.status =1")
2676
-	table := readDb.Table("xt_patients as s")
2676
+	table := readDb.Table("xt_patients as s").Where("s.patient_type =1")
2677
 	fmt.Println(table)
2677
 	fmt.Println(table)
2678
 	d := readDb.Table(" xt_inspection_reference as r")
2678
 	d := readDb.Table(" xt_inspection_reference as r")
2679
 	fmt.Println(d)
2679
 	fmt.Println(d)

+ 1 - 1
service/device_service.go Näytä tiedosto

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,a.home_type,a.home_big_type").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
 

+ 2 - 2
service/doctor_advice_service.go Näytä tiedosto

550
 		db = db.Where("advice_date<=?", end_time)
550
 		db = db.Where("advice_date<=?", end_time)
551
 	}
551
 	}
552
 
552
 
553
-	err = db.Find(&list).Error
553
+	err = db.Order("advice_name").Find(&list).Error
554
 
554
 
555
 	return list, err
555
 	return list, err
556
 }
556
 }
569
 		db = db.Where("advice_date<=?", end_time)
569
 		db = db.Where("advice_date<=?", end_time)
570
 	}
570
 	}
571
 
571
 
572
-	err = db.Preload("Drug", "status=1 and org_id = ?", user_org_id).Find(&list).Error
572
+	err = db.Preload("Drug", "status=1 and org_id = ?", user_org_id).Order("advice_name").Find(&list).Error
573
 
573
 
574
 	return list, err
574
 	return list, err
575
 }
575
 }

+ 1 - 1
service/his_project_service.go Näytä tiedosto

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
 

+ 66 - 0
service/his_service.go Näytä tiedosto

3117
 	return goodInfoSeven, err
3117
 	return goodInfoSeven, err
3118
 }
3118
 }
3119
 
3119
 
3120
+func GetNewGoodByIdIsStop(good_id int64, org_id int64, tx *gorm.DB) (models.GoodInfoSeven, error) {
3121
+
3122
+	goodInfoSeven := models.GoodInfoSeven{}
3123
+	err = tx.Where("org_id = ? and status = 1  and id =?", org_id, good_id).Find(&goodInfoSeven).Error
3124
+	if err != gorm.ErrRecordNotFound {
3125
+		if err != nil {
3126
+			tx.Rollback()
3127
+			return goodInfoSeven, err
3128
+		}
3129
+	}
3130
+	return goodInfoSeven, err
3131
+}
3132
+
3133
+func GetNewDrugByIdIsStop(good_id int64, org_id int64, tx *gorm.DB) (models.BaseDrugLibSeven, error) {
3134
+
3135
+	goodInfoSeven := models.BaseDrugLibSeven{}
3136
+	err = tx.Where("org_id = ? and status = 1  and id =?", org_id, good_id).Find(&goodInfoSeven).Error
3137
+	if err != gorm.ErrRecordNotFound {
3138
+		if err != nil {
3139
+			tx.Rollback()
3140
+			return goodInfoSeven, err
3141
+		}
3142
+	}
3143
+	return goodInfoSeven, err
3144
+}
3145
+
3146
+func CreateCodeInfo(info models.XtGoodCodeInfo, tx *gorm.DB) error {
3147
+
3148
+	err := tx.Create(&info).Error
3149
+	if err != nil {
3150
+		tx.Rollback()
3151
+		return err
3152
+	}
3153
+	return err
3154
+}
3155
+
3156
+func CreateDrugCodeInfo(info models.XtDrugCodeInfo, tx *gorm.DB) error {
3157
+
3158
+	err := tx.Create(&info).Error
3159
+	if err != nil {
3160
+		tx.Rollback()
3161
+		return err
3162
+	}
3163
+	return err
3164
+}
3165
+
3166
+func UpdateCodeInfo(info models.XtGoodCodeInfo, tx *gorm.DB) error {
3167
+
3168
+	err := tx.Model(&info).Where("warehouse_info_id = ? and good_code =? and status=1 and user_org_id =?", info.WarehouseInfoId, info.GoodCode, info.UserOrgId).Updates(map[string]interface{}{"status": 0}).Error
3169
+	if err != nil {
3170
+		tx.Rollback()
3171
+		return err
3172
+	}
3173
+	return err
3174
+}
3175
+
3176
+func UpdateDrugCodeInfo(info models.XtDrugCodeInfo, tx *gorm.DB) error {
3177
+
3178
+	err := tx.Model(&info).Where("warehouse_info_id = ? and drug_code =? and status=1 and user_org_id =?", info.WarehouseInfoId, info.DrugCode, info.UserOrgId).Updates(map[string]interface{}{"status": 0}).Error
3179
+	if err != nil {
3180
+		tx.Rollback()
3181
+		return err
3182
+	}
3183
+	return err
3184
+}
3185
+
3120
 func GetHisPrescriptionByBatchNumber(org_id int64, number string) (prescription []*models.HisPrescription, err error) {
3186
 func GetHisPrescriptionByBatchNumber(org_id int64, number string) (prescription []*models.HisPrescription, err error) {
3121
 	err = readDb.Model(&models.HisPrescription{}).
3187
 	err = readDb.Model(&models.HisPrescription{}).
3122
 		Preload("HisAdditionalCharge", func(db *gorm.DB) *gorm.DB {
3188
 		Preload("HisAdditionalCharge", func(db *gorm.DB) *gorm.DB {

+ 9 - 0
service/manage_center_service.go Näytä tiedosto

1140
 	err := XTWriteDB().Model(&models.HisPrescriptionAdviceTemplate{}).Where("id =? and status=1", id).Updates(map[string]interface{}{"price": price}).Error
1140
 	err := XTWriteDB().Model(&models.HisPrescriptionAdviceTemplate{}).Where("id =? and status=1", id).Updates(map[string]interface{}{"price": price}).Error
1141
 	return err
1141
 	return err
1142
 }
1142
 }
1143
+
1144
+func ModifyGoodCodeWarehouseInfo(id int64, good_code string) (models.XtWarehouseInfoEight, error) {
1145
+
1146
+	info := models.XtWarehouseInfoEight{}
1147
+
1148
+	err := XTWriteDB().Model(&info).Where("id = ? and status=1", id).Updates(map[string]interface{}{"good_code": good_code}).Error
1149
+
1150
+	return info, err
1151
+}

+ 1 - 1
service/manage_service.go Näytä tiedosto

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, "home_type": addmacher.HomeType, "home_big_type": addmacher.HomeBigType}).Error
58
 
58
 
59
 	return err
59
 	return err
60
 
60
 

+ 6 - 2
service/new_stock_service.go Näytä tiedosto

110
 	return err
110
 	return err
111
 }
111
 }
112
 
112
 
113
-func GetGoodStockList(orgId int64, storehouse_id int64, good_type int64, keyword string, page int64, limit int64, ids []int64) (good []*models.GoodInformation, total int64, err error) {
113
+func GetGoodStockList(orgId int64, storehouse_id int64, good_type int64, keyword string, page int64, limit int64, ids []int64, good_type_id int64) (good []*models.GoodInformation, total int64, err error) {
114
 	offset := (page - 1) * limit
114
 	offset := (page - 1) * limit
115
 	likeKey := "%" + keyword + "%"
115
 	likeKey := "%" + keyword + "%"
116
 
116
 
117
 	db := XTReadDB().Table("xt_good_information as x").Where("x.status = 1  and x.org_id =? and find_in_set('停用',x.good_status) = 0", orgId)
117
 	db := XTReadDB().Table("xt_good_information as x").Where("x.status = 1  and x.org_id =? and find_in_set('停用',x.good_status) = 0", orgId)
118
 
118
 
119
+	if good_type_id > 0 {
120
+		db = db.Where("x.good_type_id = ?", good_type_id)
121
+	}
122
+
119
 	if good_type == 2 {
123
 	if good_type == 2 {
120
-		db = db.Where(" x.total_count<=x.stock_warn_count")
124
+		db = db.Where(" x.sum_count<=x.stock_warn_count")
121
 	}
125
 	}
122
 
126
 
123
 	if good_type == 3 {
127
 	if good_type == 3 {

+ 8 - 1
service/patient_service.go Näytä tiedosto

5051
 	return inspection, err
5051
 	return inspection, err
5052
 }
5052
 }
5053
 
5053
 
5054
+func GetNewInspectionRefence(org_id int64, project_id int64) (reference []*models.XtInspectionReference, err error) {
5055
+
5056
+	err = XTReadDB().Where("(org_id = ? or org_id = 0) and project_id = ?", org_id, project_id).Find(&reference).Error
5057
+
5058
+	return reference, err
5059
+}
5060
+
5054
 func GetSelfDrugOutInfo(patient_id int64, sys_record_time int64, drug_id int64) (outInfo []*models.XtSelfDrugWarehouseOutInfo, err error) {
5061
 func GetSelfDrugOutInfo(patient_id int64, sys_record_time int64, drug_id int64) (outInfo []*models.XtSelfDrugWarehouseOutInfo, err error) {
5055
 
5062
 
5056
 	err = XTReadDB().Where("patient_id = ? and sys_record_time = ? and drug_id = ? and status=1", patient_id, sys_record_time, drug_id).Find(&outInfo).Error
5063
 	err = XTReadDB().Where("patient_id = ? and sys_record_time = ? and drug_id = ? and status=1", patient_id, sys_record_time, drug_id).Find(&outInfo).Error
5280
 
5287
 
5281
 	patientInCount := models.SfPatientInCount{}
5288
 	patientInCount := models.SfPatientInCount{}
5282
 
5289
 
5283
-	err := tx.Where("id = ?", id).Find(&patientInCount).Error
5290
+	err := tx.Where("id = ? and status=1", id).Find(&patientInCount).Error
5284
 	if err != nil {
5291
 	if err != nil {
5285
 		tx.Rollback()
5292
 		tx.Rollback()
5286
 		return patientInCount, err
5293
 		return patientInCount, err

+ 9 - 3
service/role_service.go Näytä tiedosto

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()

+ 36 - 3
service/self_drug_service.go Näytä tiedosto

2858
 	return err
2858
 	return err
2859
 }
2859
 }
2860
 
2860
 
2861
-func GetGoodNewPurchaseStockQuery(good_type int64, keyword string, page int64, limit int64, orgid int64, ids []int64, goodIds []int64) (goodinfo []*models.GoodInfoTwenty, total int64, err error) {
2861
+func GetGoodNewPurchaseStockQuery(good_type int64, keyword string, page int64, limit int64, orgid int64, ids []int64, goodIds []int64, query_type int64) (goodinfo []*models.GoodInfoTwenty, total int64, err error) {
2862
 
2862
 
2863
 	db := XTReadDB().Model(&goodinfo).Where("status = 1")
2863
 	db := XTReadDB().Model(&goodinfo).Where("status = 1")
2864
 	offset := (page - 1) * limit
2864
 	offset := (page - 1) * limit
2870
 	if orgid > 0 {
2870
 	if orgid > 0 {
2871
 		db = db.Where("org_id = ?", orgid)
2871
 		db = db.Where("org_id = ?", orgid)
2872
 	}
2872
 	}
2873
+
2874
+	if query_type == 2 {
2875
+		db = db.Where("sum_count<=stock_warn_count")
2876
+	}
2877
+	if query_type == 3 {
2878
+		db = db.Where("sum_count = 0")
2879
+	}
2880
+
2881
+	if query_type == 4 {
2882
+		db = db.Where("sum_count > 0")
2883
+	}
2873
 	//if len(ids) > 0 {
2884
 	//if len(ids) > 0 {
2874
 	//	db = db.Where("id in(?)", goodIds)
2885
 	//	db = db.Where("id in(?)", goodIds)
2875
 	//}
2886
 	//}
2881
 	return goodinfo, total, err
2892
 	return goodinfo, total, err
2882
 }
2893
 }
2883
 
2894
 
2884
-func GetGoodNewPurchaseStockQueryOne(good_type int64, keyword string, page int64, limit int64, orgid int64, ids []int64, goodIds []int64) (goodinfo []*models.GoodInfoTwenty, total int64, err error) {
2895
+func GetGoodNewPurchaseStockQueryOne(good_type int64, keyword string, page int64, limit int64, orgid int64, ids []int64, goodIds []int64, query_type int64) (goodinfo []*models.GoodInfoTwenty, total int64, err error) {
2885
 
2896
 
2886
 	db := XTReadDB().Model(&goodinfo).Where("status = 1")
2897
 	db := XTReadDB().Model(&goodinfo).Where("status = 1")
2887
 	if orgid == 10697 || orgid == 10644 {
2898
 	if orgid == 10697 || orgid == 10644 {
2893
 		db = db.Where("good_type_id = ?", good_type)
2904
 		db = db.Where("good_type_id = ?", good_type)
2894
 	}
2905
 	}
2895
 
2906
 
2907
+	if query_type == 2 {
2908
+		db = db.Where("sum_count<=stock_warn_count")
2909
+	}
2910
+	if query_type == 3 {
2911
+		db = db.Where("sum_count = 0")
2912
+	}
2913
+
2914
+	if query_type == 4 {
2915
+		db = db.Where("sum_count > 0")
2916
+	}
2917
+
2896
 	if orgid > 0 {
2918
 	if orgid > 0 {
2897
 		db = db.Where("org_id = ?", orgid)
2919
 		db = db.Where("org_id = ?", orgid)
2898
 	}
2920
 	}
2942
 	return info, err
2964
 	return info, err
2943
 }
2965
 }
2944
 
2966
 
2945
-func GetDrugNewPurchaseStockQuery(good_type int64, keyword string, page int64, limit int64, orgid int64, startime int64, endtime int64, ids []int64, infos []int64) (druginfo []*models.VmBaseDrugTwenty, total int64, err error) {
2967
+func GetDrugNewPurchaseStockQuery(good_type int64, keyword string, page int64, limit int64, orgid int64, startime int64, endtime int64, ids []int64, infos []int64, query_type int64) (druginfo []*models.VmBaseDrugTwenty, total int64, err error) {
2946
 
2968
 
2947
 	db := XTReadDB().Model(&druginfo).Where("status = 1 and is_self_drug!=1")
2969
 	db := XTReadDB().Model(&druginfo).Where("status = 1 and is_self_drug!=1")
2948
 	offset := (page - 1) * limit
2970
 	offset := (page - 1) * limit
2954
 		db = db.Where("find_in_set('停用',drug_status) = 0")
2976
 		db = db.Where("find_in_set('停用',drug_status) = 0")
2955
 	}
2977
 	}
2956
 
2978
 
2979
+	if query_type == 2 {
2980
+		db = db.Where("sum_count<=drug_stock_limit_count")
2981
+	}
2982
+	if query_type == 3 {
2983
+		db = db.Where("sum_count = 0")
2984
+	}
2985
+
2986
+	if query_type == 4 {
2987
+		db = db.Where("sum_count > 0")
2988
+	}
2989
+
2957
 	if orgid > 0 {
2990
 	if orgid > 0 {
2958
 		db = db.Where("org_id = ?", orgid)
2991
 		db = db.Where("org_id = ?", orgid)
2959
 	}
2992
 	}

+ 2 - 0
service/stock_service.go Näytä tiedosto

280
 		"first_letter":                   goodInfo.FirstLetter,
280
 		"first_letter":                   goodInfo.FirstLetter,
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,
284
+		"register_number_name":           goodInfo.RegisterNumberName,
283
 	}).Error
285
 	}).Error
284
 
286
 
285
 	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})

+ 1 - 1
service/user_service.go Näytä tiedosto

100
 
100
 
101
 	err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.status=1 and uar.org_id=?  and ua.status=1", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
101
 	err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.status=1 and uar.org_id=?  and ua.status=1", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
102
 
102
 
103
-	if orgId == 10724 {
103
+	if orgId == 10724 || orgId == 10653 {
104
 		err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.org_id=?", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
104
 		err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.org_id=?", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
105
 	} else {
105
 	} else {
106
 		err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.status=1 and uar.org_id=?  and ua.status=1", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
106
 		err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.status=1 and uar.org_id=?  and ua.status=1", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error