소스 검색

历史排班

28169 1 년 전
부모
커밋
3781b0f231

+ 52 - 30
controllers/manage_api_controller.go 파일 보기

155
 	beego.Router("/api/manage/getobjectregistrationbyidlist", &MachineApiController{}, "Get:GetObjectRegistrationByIdList")
155
 	beego.Router("/api/manage/getobjectregistrationbyidlist", &MachineApiController{}, "Get:GetObjectRegistrationByIdList")
156
 	beego.Router("/api/manage/updateobjectregistration", &MachineApiController{}, "Post:UpdateObjectRegistration")
156
 	beego.Router("/api/manage/updateobjectregistration", &MachineApiController{}, "Post:UpdateObjectRegistration")
157
 	beego.Router("/api/manage/deleteobjectregistration", &MachineApiController{}, "Get:DeleteObjectTregistration")
157
 	beego.Router("/api/manage/deleteobjectregistration", &MachineApiController{}, "Get:DeleteObjectTregistration")
158
+
159
+	beego.Router("/api/manage/getregistgoodinforlist", &MachineApiController{}, "Get:GetRegistGoodInforList")
160
+	beego.Router("/api/manage/getregistnumber", &MachineApiController{}, "Get:GetRegistNumber")
158
 }
161
 }
159
 
162
 
160
 func (this *MachineApiController) SaveManageInfo() {
163
 func (this *MachineApiController) SaveManageInfo() {
230
 	work_time := dataBody["work_time"].(string)
233
 	work_time := dataBody["work_time"].(string)
231
 	treat_types := dataBody["treat_type"].([]interface{})
234
 	treat_types := dataBody["treat_type"].([]interface{})
232
 	revers := int64(dataBody["revers_mode"].(float64))
235
 	revers := int64(dataBody["revers_mode"].(float64))
236
+	zone_id := int64(dataBody["zone_id"].(float64))
233
 	ids := make([]int64, 0)
237
 	ids := make([]int64, 0)
234
 	for _, treat := range treat_types {
238
 	for _, treat := range treat_types {
235
 		id := int64(treat.(float64))
239
 		id := int64(treat.(float64))
248
 		DeviceType:          device_type,
252
 		DeviceType:          device_type,
249
 		BedNumber:           number.Number,
253
 		BedNumber:           number.Number,
250
 		BedId:               bed_number,
254
 		BedId:               bed_number,
251
-		ZoneId:              number.ZoneID,
255
+		ZoneId:              zone_id,
252
 		DeviceName:          device_name,
256
 		DeviceName:          device_name,
253
 		ManufactureFactory:  manufacture_factory,
257
 		ManufactureFactory:  manufacture_factory,
254
 		ServiceManufacturer: service_manufacturer,
258
 		ServiceManufacturer: service_manufacturer,
363
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDialysisNoExist)
367
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDialysisNoExist)
364
 		return
368
 		return
365
 	}
369
 	}
370
+	zone_id := int64(dataBody["zone_id"].(float64))
366
 	addmacher := models.DeviceAddmacher{
371
 	addmacher := models.DeviceAddmacher{
367
 		ID:                  id,
372
 		ID:                  id,
368
 		SerialNumber:        serial_number,
373
 		SerialNumber:        serial_number,
388
 		RubbishReason:       rubbish_reason,
393
 		RubbishReason:       rubbish_reason,
389
 		UserYear:            user_year,
394
 		UserYear:            user_year,
390
 		WorkTime:            work_time,
395
 		WorkTime:            work_time,
396
+		ZoneId:              zone_id,
391
 	}
397
 	}
392
 	err = service.UpdateMachine(id, orgid, &addmacher)
398
 	err = service.UpdateMachine(id, orgid, &addmacher)
393
 	errors := service.UpdateTreatMode(id, orgid, ids)
399
 	errors := service.UpdateTreatMode(id, orgid, ids)
490
 
496
 
491
 	revers_modes := int64(dataBody["revers_mode"].(float64))
497
 	revers_modes := int64(dataBody["revers_mode"].(float64))
492
 
498
 
499
+	zone_id := int64(dataBody["zone_id"].(float64))
493
 	addmacher := models.DeviceAddmacher{
500
 	addmacher := models.DeviceAddmacher{
494
 		ID:                  id,
501
 		ID:                  id,
495
 		SerialNumber:        serial_number,
502
 		SerialNumber:        serial_number,
516
 		WorkTime:            work_time,
523
 		WorkTime:            work_time,
517
 		DisinfectionMode:    disinfection_mode,
524
 		DisinfectionMode:    disinfection_mode,
518
 		ReversMode:          revers_modes,
525
 		ReversMode:          revers_modes,
526
+		ZoneId:              zone_id,
519
 	}
527
 	}
520
 	fmt.Println("addmacher", addmacher)
528
 	fmt.Println("addmacher", addmacher)
521
 	err = service.UpdateMachine(id, orgid, &addmacher)
529
 	err = service.UpdateMachine(id, orgid, &addmacher)
2748
 func (this *MachineApiController) SaveManageinfoTwo() {
2756
 func (this *MachineApiController) SaveManageinfoTwo() {
2749
 	adminUserInfo := this.GetAdminUserInfo()
2757
 	adminUserInfo := this.GetAdminUserInfo()
2750
 	orgid := adminUserInfo.CurrentOrgId
2758
 	orgid := adminUserInfo.CurrentOrgId
2751
-	fmt.Println("机构id", orgid)
2752
 	dataBody := make(map[string]interface{}, 0)
2759
 	dataBody := make(map[string]interface{}, 0)
2753
 	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
2760
 	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
2754
 	fmt.Println("err", err)
2761
 	fmt.Println("err", err)
2755
 	serial_numbe := dataBody["serial_number"].(string)
2762
 	serial_numbe := dataBody["serial_number"].(string)
2756
-	fmt.Println("序列号", serial_numbe)
2757
 	device_type := int64(dataBody["device_type"].(float64))
2763
 	device_type := int64(dataBody["device_type"].(float64))
2758
-	fmt.Println("设备类型", device_type)
2759
-	//bed_number := dataBody["beds"].(string)
2760
-	//fmt.Println("床位号", bed_number)
2761
 	bed_number := this.GetString("beds")
2764
 	bed_number := this.GetString("beds")
2762
 	device_name := dataBody["device_name"].(string)
2765
 	device_name := dataBody["device_name"].(string)
2763
-	fmt.Println("设备名称", device_name)
2764
 	manufacture_factory := dataBody["manufacture_factory"].(string)
2766
 	manufacture_factory := dataBody["manufacture_factory"].(string)
2765
-	fmt.Println("生产厂家", manufacture_factory)
2766
 	service_manufacturer := dataBody["service_manufacturer"].(string)
2767
 	service_manufacturer := dataBody["service_manufacturer"].(string)
2767
-	fmt.Println("维修厂家", service_manufacturer)
2768
 	unit_type := int64(dataBody["unit_type"].(float64))
2768
 	unit_type := int64(dataBody["unit_type"].(float64))
2769
-	//unit_type := strconv.FormatInt(unittype, 10)
2770
-	//fmt.Println("设备型号", unit_type)
2771
 	use_section := dataBody["use_section"].(string)
2769
 	use_section := dataBody["use_section"].(string)
2772
-	fmt.Println("使用科室", use_section)
2773
 	section_number := dataBody["section_number"].(string)
2770
 	section_number := dataBody["section_number"].(string)
2774
-	fmt.Println("科室编号", section_number)
2775
 	buy_date := dataBody["buy_date"].(string)
2771
 	buy_date := dataBody["buy_date"].(string)
2776
-	fmt.Println("buy_date", buy_date)
2772
+
2777
 	timeLayout := "2006-01-02 15:04:05"
2773
 	timeLayout := "2006-01-02 15:04:05"
2778
 	theTime, err := utils.ParseTimeStringToTime(timeLayout, buy_date+" 00:00:00")
2774
 	theTime, err := utils.ParseTimeStringToTime(timeLayout, buy_date+" 00:00:00")
2779
 	buydate := theTime.Unix()
2775
 	buydate := theTime.Unix()
2781
 	if int_num < 0 {
2777
 	if int_num < 0 {
2782
 		buydate = 0
2778
 		buydate = 0
2783
 	}
2779
 	}
2784
-	fmt.Println("购买日期", buydate)
2785
 
2780
 
2786
 	install_date := dataBody["install_date"].(string)
2781
 	install_date := dataBody["install_date"].(string)
2787
 	toTime, err := utils.ParseTimeStringToTime(timeLayout, install_date+" 00:00:00")
2782
 	toTime, err := utils.ParseTimeStringToTime(timeLayout, install_date+" 00:00:00")
2790
 	if buy_num < 0 {
2785
 	if buy_num < 0 {
2791
 		installdate = 0
2786
 		installdate = 0
2792
 	}
2787
 	}
2793
-	fmt.Println("安装日期", installdate)
2794
 
2788
 
2795
 	start_date := dataBody["start_date"].(string)
2789
 	start_date := dataBody["start_date"].(string)
2796
 	stringToTime, err := utils.ParseTimeStringToTime(timeLayout, start_date+" 00:00:00")
2790
 	stringToTime, err := utils.ParseTimeStringToTime(timeLayout, start_date+" 00:00:00")
2799
 	if start_num < 0 {
2793
 	if start_num < 0 {
2800
 		startdate = 0
2794
 		startdate = 0
2801
 	}
2795
 	}
2802
-	fmt.Println("启用日期", startdate)
2803
-
2804
 	maintenance_engineer := dataBody["maintenance_engineer"].(string)
2796
 	maintenance_engineer := dataBody["maintenance_engineer"].(string)
2805
-	fmt.Println("维修工程", maintenance_engineer)
2806
 	telephone := dataBody["telephone"].(string)
2797
 	telephone := dataBody["telephone"].(string)
2807
-	fmt.Println("telephone", telephone)
2808
 	guarantee_date := dataBody["guarantee_date"].(string)
2798
 	guarantee_date := dataBody["guarantee_date"].(string)
2809
-	fmt.Println("保修期限", guarantee_date)
2810
 	machine_status := int64(dataBody["machine_status"].(float64))
2799
 	machine_status := int64(dataBody["machine_status"].(float64))
2811
-	fmt.Println("机器状态", machine_status)
2812
 	disinfection_mode := int64(dataBody["Disinfection_mode"].(float64))
2800
 	disinfection_mode := int64(dataBody["Disinfection_mode"].(float64))
2813
-	fmt.Println("消毒方式", disinfection_mode)
2814
 	remarks := dataBody["remarks"].(string)
2801
 	remarks := dataBody["remarks"].(string)
2815
-	fmt.Println("备注", remarks)
2816
 	rubbish_date := dataBody["rubbish_date"].(string)
2802
 	rubbish_date := dataBody["rubbish_date"].(string)
2817
 	timeStringToTime, err := utils.ParseTimeStringToTime(timeLayout, rubbish_date+" 00:00:00")
2803
 	timeStringToTime, err := utils.ParseTimeStringToTime(timeLayout, rubbish_date+" 00:00:00")
2818
 	rubbishdate := timeStringToTime.Unix()
2804
 	rubbishdate := timeStringToTime.Unix()
2820
 	if rubb_num < 0 {
2806
 	if rubb_num < 0 {
2821
 		rubbishdate = 0
2807
 		rubbishdate = 0
2822
 	}
2808
 	}
2823
-	fmt.Println("报废日期", rubbishdate)
2824
 	rubbish_reason := int64(dataBody["rubbish_reason"].(float64))
2809
 	rubbish_reason := int64(dataBody["rubbish_reason"].(float64))
2825
-	fmt.Println("报废原因", rubbish_reason)
2826
 	user_year := dataBody["user_year"].(string)
2810
 	user_year := dataBody["user_year"].(string)
2827
-	fmt.Println("使用年限", user_year)
2828
 	work_time := dataBody["work_time"].(string)
2811
 	work_time := dataBody["work_time"].(string)
2829
-	fmt.Println("工作时长", work_time)
2830
 	revers := int64(dataBody["revers_mode"].(float64))
2812
 	revers := int64(dataBody["revers_mode"].(float64))
2831
-	fmt.Println("反渗模式", revers)
2832
-
2813
+	zone_id := int64(dataBody["zone_id"].(float64))
2833
 	addmacher := &models.DeviceAddmacher{
2814
 	addmacher := &models.DeviceAddmacher{
2834
 		SerialNumber:        serial_numbe,
2815
 		SerialNumber:        serial_numbe,
2835
 		DeviceType:          device_type,
2816
 		DeviceType:          device_type,
2857
 		Status:              1,
2838
 		Status:              1,
2858
 		Ctime:               time.Now().Unix(),
2839
 		Ctime:               time.Now().Unix(),
2859
 		UserOrgId:           orgid,
2840
 		UserOrgId:           orgid,
2841
+		ZoneId:              zone_id,
2860
 	}
2842
 	}
2861
 	err = service.CreateMacher(addmacher)
2843
 	err = service.CreateMacher(addmacher)
2862
 	fmt.Println("什么原因啊", err)
2844
 	fmt.Println("什么原因啊", err)
3646
 	appId := this.GetAdminUserInfo().CurrentAppId
3628
 	appId := this.GetAdminUserInfo().CurrentAppId
3647
 	list, err := service.GetAllDoctorTwo(orgId, appId)
3629
 	list, err := service.GetAllDoctorTwo(orgId, appId)
3648
 	operators, err := service.GetAdminUserEsOne(orgId)
3630
 	operators, err := service.GetAdminUserEsOne(orgId)
3631
+
3649
 	if err != nil {
3632
 	if err != nil {
3650
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
3633
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
3651
 		return
3634
 		return
5692
 	})
5675
 	})
5693
 	return
5676
 	return
5694
 }
5677
 }
5678
+
5679
+func (this *MachineApiController) GetRegistGoodInforList() {
5680
+
5681
+	orgId := this.GetAdminUserInfo().CurrentOrgId
5682
+
5683
+	list, err := service.GetRegistGoodInforList(orgId)
5684
+
5685
+	if err != nil {
5686
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
5687
+		return
5688
+	}
5689
+	this.ServeSuccessJSON(map[string]interface{}{
5690
+		"list": list,
5691
+	})
5692
+	return
5693
+}
5694
+
5695
+func (this *MachineApiController) GetRegistNumber() {
5696
+
5697
+	id, _ := this.GetInt64("id")
5698
+	record_date := this.GetString("record_date")
5699
+	timeLayout := "2006-01-02"
5700
+	loc, _ := time.LoadLocation("Local")
5701
+	dataBody := make(map[string]interface{}, 0)
5702
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
5703
+	fmt.Println(err)
5704
+	recorddate, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
5705
+	recorddateunix := recorddate.Unix()
5706
+	orgId := this.GetAdminUserInfo().CurrentOrgId
5707
+	infor, err := service.GetRegistNumber(recorddateunix, id, orgId)
5708
+	if err != nil {
5709
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
5710
+		return
5711
+	}
5712
+	this.ServeSuccessJSON(map[string]interface{}{
5713
+		"list": infor,
5714
+	})
5715
+	return
5716
+}

+ 32 - 0
controllers/mobile_api_controllers/patient_api_controller.go 파일 보기

2296
 				newprescribe.Bicarbonate = 31.1
2296
 				newprescribe.Bicarbonate = 31.1
2297
 				newprescribe.DialysateFlow = 500
2297
 				newprescribe.DialysateFlow = 500
2298
 			}
2298
 			}
2299
+			appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
2300
+			//
2301
+			if appRole.UserType == 2 || appRole.UserType == 1 {
2302
+				newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2303
+				if adminUserInfo.Org.Id == 9882 {
2304
+					newprescribe.Creater = adminUserInfo.AdminUser.Id
2305
+				}
2306
+			}
2299
 			err := service.UpDateDialysisPrescription(&newprescribe)
2307
 			err := service.UpDateDialysisPrescription(&newprescribe)
2300
 			//获取key,清空redis
2308
 			//获取key,清空redis
2301
 			key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
2309
 			key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
2410
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
2418
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
2411
 				}
2419
 				}
2412
 			} else {
2420
 			} else {
2421
+				appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
2422
+				//
2423
+				if appRole.UserType == 2 || appRole.UserType == 1 {
2424
+					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2425
+					if adminUserInfo.Org.Id == 9882 {
2426
+						newprescribe.Creater = adminUserInfo.AdminUser.Id
2427
+					}
2428
+				}
2413
 				err := service.UpDateDialysisPrescription(&newprescribe)
2429
 				err := service.UpDateDialysisPrescription(&newprescribe)
2414
 				//获取key,清空redis
2430
 				//获取key,清空redis
2415
 				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
2431
 				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
2529
 					newprescribe.Bicarbonate = 31.1
2545
 					newprescribe.Bicarbonate = 31.1
2530
 					newprescribe.DialysateFlow = 500
2546
 					newprescribe.DialysateFlow = 500
2531
 				}
2547
 				}
2548
+				appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
2549
+				//
2550
+				if appRole.UserType == 2 || appRole.UserType == 1 {
2551
+					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2552
+					if adminUserInfo.Org.Id == 9882 {
2553
+						newprescribe.Creater = adminUserInfo.AdminUser.Id
2554
+					}
2555
+				}
2532
 				err := service.UpDateDialysisPrescription(&newprescribe)
2556
 				err := service.UpDateDialysisPrescription(&newprescribe)
2533
 				//获取key,清空redis
2557
 				//获取key,清空redis
2534
 				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
2558
 				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
2609
 					newprescribe.Bicarbonate = 31.1
2633
 					newprescribe.Bicarbonate = 31.1
2610
 					newprescribe.DialysateFlow = 500
2634
 					newprescribe.DialysateFlow = 500
2611
 				}
2635
 				}
2636
+				appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
2637
+				//
2638
+				if appRole.UserType == 2 || appRole.UserType == 1 {
2639
+					newprescribe.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2640
+					if adminUserInfo.Org.Id == 9882 {
2641
+						newprescribe.Creater = adminUserInfo.AdminUser.Id
2642
+					}
2643
+				}
2612
 				err := service.UpDateDialysisPrescription(&newprescribe)
2644
 				err := service.UpDateDialysisPrescription(&newprescribe)
2613
 				//获取key,清空redis
2645
 				//获取key,清空redis
2614
 				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
2646
 				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"

+ 2 - 0
controllers/self_drug_api_congtroller.go 파일 보기

2726
 	manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
2726
 	manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
2727
 	goodType, _ := service.GetAllNewGoodType(orgId)
2727
 	goodType, _ := service.GetAllNewGoodType(orgId)
2728
 	patientList, _ := service.GetAllpatientThirty(orgId)
2728
 	patientList, _ := service.GetAllpatientThirty(orgId)
2729
+	dealerList, _ := service.GetAllDealerList(orgId)
2729
 	if err != nil {
2730
 	if err != nil {
2730
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取仓库失败")
2731
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取仓库失败")
2731
 		return
2732
 		return
2736
 		"manufacturerList": manufacturerList,
2737
 		"manufacturerList": manufacturerList,
2737
 		"goodTypeList":     goodType,
2738
 		"goodTypeList":     goodType,
2738
 		"patientList":      patientList,
2739
 		"patientList":      patientList,
2740
+		"dealerList":       dealerList,
2739
 	})
2741
 	})
2740
 }
2742
 }
2741
 
2743
 

+ 89 - 0
controllers/sign_api_controller.go 파일 보기

2
 
2
 
3
 import (
3
 import (
4
 	"XT_New/service"
4
 	"XT_New/service"
5
+	"encoding/json"
5
 	"fmt"
6
 	"fmt"
6
 	"github.com/astaxie/beego"
7
 	"github.com/astaxie/beego"
7
 )
8
 )
14
 
15
 
15
 	//获取短信验证码
16
 	//获取短信验证码
16
 	beego.Router("/api/sign/getsign", &SignApiController{}, "Get:GetSign")
17
 	beego.Router("/api/sign/getsign", &SignApiController{}, "Get:GetSign")
18
+
19
+	//创建个人用户并实名
20
+	beego.Router("/api/sign/createrusername", &SignApiController{}, "Get:CreateUserName")
21
+
22
+	//创建个人印章
23
+	beego.Router("/api/sign/createpersionseal", &SignApiController{}, "Get:CreatePersionSeal")
24
+
25
+	//上传文件创建和他
17
 }
26
 }
18
 
27
 
19
 // 短信服务接口
28
 // 短信服务接口
30
 	return
39
 	return
31
 
40
 
32
 }
41
 }
42
+
43
+type Result2121 struct {
44
+	Phone          string `json:"phone"`
45
+	DisPlayName    string `json:"dis_play_name"`
46
+	Authentication string `json:"authentication"`
47
+	TwAuthReq      struct {
48
+		OneLineAuth string `json:"oneLineAuth"`
49
+		ApiAuthReq  struct {
50
+			RealName   float64 `json:"real_name"`
51
+			IdCardType string  `json:"id_card_type"`
52
+			IdCardNum  string  `json:"id_card_num"`
53
+			BankCard   string  `json:"bank_card"`
54
+			CodeNumber string  `json:"code_number"`
55
+			VerifyCode string  `json:"verify_code"`
56
+		} `json:"apiAuthReq"`
57
+	} `json:"twAuthReq"`
58
+}
59
+
60
+type MapData struct {
61
+	dat struct {
62
+		Code float64 `json:"code"`
63
+		data struct {
64
+			userId string `json:"userId"`
65
+		}
66
+	}
67
+}
68
+
69
+// 创建个人用户并实名
70
+func (this *SignApiController) CreateUserName() {
71
+
72
+	phone := this.GetString("phone")
73
+	disPlayName := this.GetString("disPlayName")
74
+
75
+	sign, userId := service.CreateUserName(phone, disPlayName)
76
+
77
+	var dat map[string]interface{}
78
+
79
+	if err := json.Unmarshal([]byte(sign), &dat); err == nil {
80
+		fmt.Println(dat)
81
+	} else {
82
+		fmt.Println(err)
83
+	}
84
+
85
+	this.ServeSuccessJSON(map[string]interface{}{
86
+		"sign":   sign,
87
+		"dat":    dat,
88
+		"userId": userId,
89
+	})
90
+	return
91
+}
92
+
93
+// 创建个人印章
94
+func (this *SignApiController) CreatePersionSeal() {
95
+
96
+	user_id := this.GetString("user_id")
97
+	person_seal_type, _ := this.GetInt64("person_seal_type")
98
+	person_seal_name := this.GetString("person_seal_name")
99
+	person_seal_base := this.GetString("person_seal_base")
100
+	color, _ := this.GetInt64("color")
101
+	alpha, _ := this.GetInt64("alpha")
102
+	width, _ := this.GetInt64("width")
103
+	height, _ := this.GetInt64("height")
104
+	border, _ := this.GetInt64("border")
105
+	font_type, _ := this.GetInt64("font_type")
106
+
107
+	sign, personSealId := service.CreatePersionSeal(user_id, person_seal_type, person_seal_name, person_seal_base, color, alpha, width, height, border, font_type)
108
+	var dat map[string]interface{}
109
+	if err := json.Unmarshal([]byte(sign), &dat); err == nil {
110
+		fmt.Println(dat)
111
+	} else {
112
+		fmt.Println(err)
113
+	}
114
+	this.ServeSuccessJSON(map[string]interface{}{
115
+		"sign":         sign,
116
+		"dat":          dat,
117
+		"personSealId": personSealId,
118
+	})
119
+	return
120
+
121
+}

+ 3 - 0
controllers/stock_in_api_controller.go 파일 보기

6521
 	limit, _ := this.GetInt64("limit")
6521
 	limit, _ := this.GetInt64("limit")
6522
 	page, _ := this.GetInt64("page")
6522
 	page, _ := this.GetInt64("page")
6523
 	orgId := this.GetAdminUserInfo().CurrentOrgId
6523
 	orgId := this.GetAdminUserInfo().CurrentOrgId
6524
+	appId := this.GetAdminUserInfo().CurrentAppId
6524
 	storehouse_id, _ := this.GetInt64("storehouse_id")
6525
 	storehouse_id, _ := this.GetInt64("storehouse_id")
6525
 	houseList, _ := service.GetAllStoreHouseList(orgId)
6526
 	houseList, _ := service.GetAllStoreHouseList(orgId)
6526
 	list, total, _ := service.GetInventoryDetailList(keyword, limit, page, orgId, storehouse_id)
6527
 	list, total, _ := service.GetInventoryDetailList(keyword, limit, page, orgId, storehouse_id)
6528
+	doclist, _ := service.GetAllDoctorListSix(orgId, appId)
6527
 	this.ServeSuccessJSON(map[string]interface{}{
6529
 	this.ServeSuccessJSON(map[string]interface{}{
6528
 		"list":      list,
6530
 		"list":      list,
6529
 		"total":     total,
6531
 		"total":     total,
6530
 		"houseList": houseList,
6532
 		"houseList": houseList,
6533
+		"doclist":   doclist,
6531
 	})
6534
 	})
6532
 }
6535
 }
6533
 
6536
 

+ 8 - 8
service/his_charge_service.go 파일 보기

22
 							}).Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
22
 							}).Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
23
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
23
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
24
 							}).Where("status = 1 ")
24
 							}).Where("status = 1 ")
25
-						})
25
+						}).Where("status = 1")
26
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
26
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
27
 			}).Where("p.status = 1  AND p.user_org_id = ?", org_id).Group("id").Find(&patients).Error
27
 			}).Where("p.status = 1  AND p.user_org_id = ?", org_id).Group("id").Find(&patients).Error
28
 
28
 
39
 							}).Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
39
 							}).Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
40
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
40
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
41
 							}).Where("status = 1 ")
41
 							}).Where("status = 1 ")
42
-						})
42
+						}).Where("status = 1")
43
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
43
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
44
 			}).Where("p.status = 1  AND p.user_org_id = ?", org_id).Group("id").Find(&patients).Error
44
 			}).Where("p.status = 1  AND p.user_org_id = ?", org_id).Group("id").Find(&patients).Error
45
 
45
 
54
 							return db.Select("id,project_id,user_org_id,status,patient_id,record_date,count,type").Preload("HisChargeProject", func(db *gorm.DB) *gorm.DB {
54
 							return db.Select("id,project_id,user_org_id,status,patient_id,record_date,count,type").Preload("HisChargeProject", func(db *gorm.DB) *gorm.DB {
55
 								return db.Select("id,project_name,unit").Where("status = 1 ")
55
 								return db.Select("id,project_name,unit").Where("status = 1 ")
56
 							}).Where("status = 1 ")
56
 							}).Where("status = 1 ")
57
-						})
57
+						}).Where("status = 1")
58
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
58
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
59
 			}).Where("p.status = 1  AND p.user_org_id = ?", org_id).Group("id").Find(&patients).Error
59
 			}).Where("p.status = 1  AND p.user_org_id = ?", org_id).Group("id").Find(&patients).Error
60
 
60
 
69
 							return db.Select("id,project_id,user_org_id,status,patient_id,record_date,count,type").Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
69
 							return db.Select("id,project_id,user_org_id,status,patient_id,record_date,count,type").Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
70
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
70
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
71
 							}).Where("status = 1 ")
71
 							}).Where("status = 1 ")
72
-						})
72
+						}).Where("status = 1")
73
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
73
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
74
 			}).Where("p.status = 1  AND p.user_org_id = ?", org_id).Group("id").Find(&patients).Error
74
 			}).Where("p.status = 1  AND p.user_org_id = ?", org_id).Group("id").Find(&patients).Error
75
 
75
 
92
 							}).Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
92
 							}).Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
93
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
93
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
94
 							}).Where("status = 1 ")
94
 							}).Where("status = 1 ")
95
-						})
95
+						}).Where("status = 1")
96
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
96
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
97
 			}).Where("p.status = 1  AND p.user_org_id = ? AND p.name LIKE ?", org_id, keyword).Group("id").Find(&patients).Error
97
 			}).Where("p.status = 1  AND p.user_org_id = ? AND p.name LIKE ?", org_id, keyword).Group("id").Find(&patients).Error
98
 
98
 
109
 							}).Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
109
 							}).Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
110
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
110
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
111
 							}).Where("status = 1 ")
111
 							}).Where("status = 1 ")
112
-						})
112
+						}).Where("status = 1")
113
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
113
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
114
 			}).Where("p.status = 1  AND p.user_org_id = ? AND p.name LIKE ?", org_id, keyword).Group("id").Find(&patients).Error
114
 			}).Where("p.status = 1  AND p.user_org_id = ? AND p.name LIKE ?", org_id, keyword).Group("id").Find(&patients).Error
115
 
115
 
124
 							return db.Select("id,project_id,user_org_id,status,patient_id,record_date,count,type").Preload("HisChargeProject", func(db *gorm.DB) *gorm.DB {
124
 							return db.Select("id,project_id,user_org_id,status,patient_id,record_date,count,type").Preload("HisChargeProject", func(db *gorm.DB) *gorm.DB {
125
 								return db.Select("id,project_name,unit").Where("status = 1 ")
125
 								return db.Select("id,project_name,unit").Where("status = 1 ")
126
 							}).Where("status = 1 ")
126
 							}).Where("status = 1 ")
127
-						})
127
+						}).Where("status = 1")
128
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
128
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
129
 			}).Where("p.status = 1  AND p.user_org_id = ? AND p.name LIKE ?", org_id, keyword).Group("id").Find(&patients).Error
129
 			}).Where("p.status = 1  AND p.user_org_id = ? AND p.name LIKE ?", org_id, keyword).Group("id").Find(&patients).Error
130
 
130
 
139
 							return db.Select("id,project_id,user_org_id,status,patient_id,record_date,count,type").Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
139
 							return db.Select("id,project_id,user_org_id,status,patient_id,record_date,count,type").Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
140
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
140
 								return db.Select("id,good_name,good_unit,specification_name").Where("status = 1 ")
141
 							}).Where("status = 1 ")
141
 							}).Where("status = 1 ")
142
-						})
142
+						}).Where("status = 1")
143
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
143
 					}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
144
 			}).Where("p.status = 1  AND p.user_org_id = ? AND p.name LIKE ?", org_id, keyword).Group("id").Find(&patients).Error
144
 			}).Where("p.status = 1  AND p.user_org_id = ? AND p.name LIKE ?", org_id, keyword).Group("id").Find(&patients).Error
145
 
145
 

+ 15 - 1
service/manage_service.go 파일 보기

53
 
53
 
54
 func UpdateMachine(id int64, orgid int64, addmacher *models.DeviceAddmacher) error {
54
 func UpdateMachine(id int64, orgid int64, addmacher *models.DeviceAddmacher) error {
55
 
55
 
56
-	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()}).Error
56
+	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
 
57
 
58
 	return err
58
 	return err
59
 
59
 
1794
 	err := XTWriteDB().Model(&models.XtDialysisRegistration{}).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"status": 0}).Error
1794
 	err := XTWriteDB().Model(&models.XtDialysisRegistration{}).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"status": 0}).Error
1795
 	return err
1795
 	return err
1796
 }
1796
 }
1797
+
1798
+func GetRegistGoodInforList(user_org_id int64) (good []*models.GoodInformationFourty, err error) {
1799
+
1800
+	err = XTReadDB().Where("org_id = ? and status =1", user_org_id).Find(&good).Error
1801
+
1802
+	return good, err
1803
+}
1804
+
1805
+func GetRegistNumber(sys_record_time int64, good_id int64, user_org_id int64) (infor []*models.WarehouseOutInfoNight, err error) {
1806
+
1807
+	err = XTReadDB().Where("sys_record_time = ? and good_id = ? and org_id = ? and status =1", sys_record_time, good_id, user_org_id).Find(&infor).Error
1808
+
1809
+	return infor, err
1810
+}

+ 1 - 1
service/self_drug_service.go 파일 보기

1115
 	if storehouse_id > 0 {
1115
 	if storehouse_id > 0 {
1116
 		db = db.Where("x.storehouse_id = ?", storehouse_id)
1116
 		db = db.Where("x.storehouse_id = ?", storehouse_id)
1117
 	}
1117
 	}
1118
-	err = db.Select("x.id,x.drug_name,x.specification_name,x.warehousing_unit,x.count,x.last_price,x.retail_price,x.manufacturer,x.dealer,x.remark,x.drug_id,x.warehousing_order,x.number,x.batch_number,x.start_time,x.creater,x.checker,x.checker_status,x.checker_time,x.total,x.drug_origin_place,x.expiry_date,x.product_date,x.min_count,x.storehouse_id,x.warehouse_info_id,t.dose,t.dose_unit,t.max_unit,x.min_unit,x.stock_max_number,x.stock_min_number,x.last_stock_max_number,x.last_stock_min_number,x.inventory_type,t.min_number,t.retail_price").Joins("left join sgj_users.sgj_user_admin_role as r on r.id = x.creater").Joins("left join xt_base_drug as t on t.id =x.drug_id").Count(&total).Offset(offset).Limit(limit).Scan(&list).Error
1118
+	err = db.Select("x.id,x.drug_name,x.specification_name,x.warehousing_unit,x.count,x.last_price,x.retail_price,x.manufacturer,x.dealer,x.remark,x.drug_id,x.warehousing_order,x.number,x.batch_number,x.start_time,x.creater,x.checker,x.checker_status,x.checker_time,x.total,x.drug_origin_place,x.expiry_date,x.product_date,x.min_count,x.storehouse_id,x.ctime,x.warehouse_info_id,t.dose,t.dose_unit,t.max_unit,x.min_unit,x.stock_max_number,x.stock_min_number,x.last_stock_max_number,x.last_stock_min_number,x.inventory_type,t.min_number,t.retail_price").Joins("left join sgj_users.sgj_user_admin_role as r on r.id = x.creater").Joins("left join xt_base_drug as t on t.id =x.drug_id").Count(&total).Offset(offset).Limit(limit).Scan(&list).Error
1119
 	return list, total, err
1119
 	return list, total, err
1120
 }
1120
 }
1121
 
1121
 

+ 158 - 18
service/sign_service.go 파일 보기

1
 package service
1
 package service
2
 
2
 
3
 import (
3
 import (
4
+	"XT_New/utils"
4
 	"bytes"
5
 	"bytes"
5
 	"crypto/hmac"
6
 	"crypto/hmac"
6
 	"crypto/sha1"
7
 	"crypto/sha1"
7
-	"crypto/sha256"
8
 	"encoding/base64"
8
 	"encoding/base64"
9
-	"encoding/hex"
10
 	"encoding/json"
9
 	"encoding/json"
11
 	"fmt"
10
 	"fmt"
12
 	"github.com/astaxie/beego"
11
 	"github.com/astaxie/beego"
78
 	return str
77
 	return str
79
 }
78
 }
80
 
79
 
81
-// 生成签名
82
-func setSignatureStr(nonce string, secret_key string) string {
83
-	fmt.Println(nonce)
84
-	fmt.Println(secret_key)
85
-	str := secret_key + nonce
86
-	hash := sha256.New()
87
-	//输入数据
88
-	hash.Write([]byte(str))
89
-	//计算哈希值
90
-	bytes := hash.Sum(nil)
91
-	//将字符串编码为16进制格式,返回字符串
92
-	hashCode := hex.EncodeToString(bytes)
93
-	//返回哈希值
94
-	return hashCode
95
-}
96
-
97
 func generateHMACSHA1SignatureOne(data interface{}, key, serviceCode string) (string, error) {
80
 func generateHMACSHA1SignatureOne(data interface{}, key, serviceCode string) (string, error) {
98
 	// 将数据转换为 JSON 格式的字节数组
81
 	// 将数据转换为 JSON 格式的字节数组
99
 	jsonData, err := json.Marshal(data)
82
 	jsonData, err := json.Marshal(data)
118
 	// 返回带有前缀的签名字符串
101
 	// 返回带有前缀的签名字符串
119
 	return "HMAC-SHA1 " + signature, nil
102
 	return "HMAC-SHA1 " + signature, nil
120
 }
103
 }
104
+
105
+func CreateUserName(phone string, disPlayName string) (string, string) {
106
+
107
+	var url string
108
+
109
+	url = "http://demo.itruscloud.com/apigate/contractpaasapi/user/createUserRealName"
110
+	var phoneOne string
111
+
112
+	phoneOne = "13318464649"
113
+
114
+	var disPlayNameOne string
115
+
116
+	disPlayNameOne = "王老师"
117
+
118
+	var authentication string
119
+	//测试环境用true
120
+	authentication = "true"
121
+
122
+	maprequest := make(map[string]interface{})
123
+
124
+	twAuthReq := make(map[string]interface{})
125
+
126
+	apiAuthReq := make(map[string]interface{})
127
+
128
+	customerReq := make(map[string]interface{})
129
+
130
+	customerReq["idCardType"] = "0"
131
+	customerReq["idCardNum"] = "430526199408156511"
132
+
133
+	apiAuthReq["realNameType"] = 3
134
+	apiAuthReq["idCardType"] = "0"
135
+	apiAuthReq["idCardNum"] = "430526199408156511"
136
+	apiAuthReq["bankCard"] = "6225551675364804"
137
+	//验证码流水号
138
+	apiAuthReq["codeNumber"] = "msg202307071510269187701"
139
+	//验证码
140
+	apiAuthReq["verifyCode"] = "123456"
141
+
142
+	twAuthReq["oneLineAuth"] = "false"
143
+
144
+	twAuthReq["apiAuthReq"] = apiAuthReq
145
+
146
+	maprequest["phone"] = phoneOne
147
+	maprequest["displayName"] = disPlayNameOne
148
+	maprequest["authentication"] = authentication
149
+
150
+	maprequest["twAuthReq"] = twAuthReq
151
+	maprequest["customerAuthReq"] = customerReq
152
+
153
+	byterequest, _ := json.Marshal(maprequest)
154
+
155
+	appId := beego.AppConfig.String("sign_appid")
156
+
157
+	serviceKye := beego.AppConfig.String("serviceKye")
158
+
159
+	serviceCode := beego.AppConfig.String("serviceCode")
160
+
161
+	reader := bytes.NewReader(byterequest)
162
+
163
+	signatureStr, _ := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
164
+
165
+	fmt.Println(signatureStr)
166
+
167
+	request, err := http.NewRequest("POST", url, reader)
168
+	if err != nil {
169
+		fmt.Println(err.Error())
170
+	}
171
+	fmt.Println("请求参数", request)
172
+	fmt.Println("Content-Signature", signatureStr)
173
+	fmt.Println("appID", appId)
174
+	fmt.Println("serviceCode", serviceCode)
175
+	request.Header.Set("appId", appId)
176
+	request.Header.Set("serviceCode", serviceCode)
177
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
178
+	request.Header.Set("Content-Signature", signatureStr)
179
+	client := http.Client{}
180
+
181
+	resp, err := client.Do(request)
182
+	if err != nil {
183
+		fmt.Println(err.Error())
184
+
185
+	}
186
+	respBytes, err := ioutil.ReadAll(resp.Body)
187
+	if err != nil {
188
+		fmt.Println(err.Error())
189
+
190
+	}
191
+	str := string(respBytes)
192
+
193
+	var respJSON map[string]interface{}
194
+	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
195
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
196
+	}
197
+	var UserId string
198
+	UserId = respJSON["data"].(map[string]interface{})["userId"].(string)
199
+	fmt.Println("str", UserId)
200
+	return str, UserId
201
+
202
+}
203
+
204
+func CreatePersionSeal(user_id string, person_seal_type int64, person_seal_name string, person_seal_base string, color int64, alpha int64, width int64, height int64, border int64, font_type int64) (string, string) {
205
+
206
+	maprequest := make(map[string]interface{})
207
+
208
+	maprequest["userId"] = "DVVZ65G1JTC1BH3AHYY2KYAE"
209
+
210
+	maprequest["personSealType"] = 1
211
+
212
+	maprequest["personSealName"] = "测试印章"
213
+
214
+	var url string
215
+
216
+	url = "http://demo.itruscloud.com/apigate/contractpaasapi/user/createPersonSeal"
217
+	appId := beego.AppConfig.String("sign_appid")
218
+
219
+	serviceKye := beego.AppConfig.String("serviceKye")
220
+
221
+	serviceCode := beego.AppConfig.String("serviceCode")
222
+	byterequest, _ := json.Marshal(maprequest)
223
+	reader := bytes.NewReader(byterequest)
224
+
225
+	signatureStr, _ := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
226
+
227
+	fmt.Println(signatureStr)
228
+
229
+	request, err := http.NewRequest("POST", url, reader)
230
+	if err != nil {
231
+		fmt.Println(err.Error())
232
+	}
233
+
234
+	request.Header.Set("appId", appId)
235
+	request.Header.Set("serviceCode", serviceCode)
236
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
237
+	request.Header.Set("Content-Signature", signatureStr)
238
+	client := http.Client{}
239
+
240
+	resp, err := client.Do(request)
241
+	if err != nil {
242
+		fmt.Println(err.Error())
243
+
244
+	}
245
+	respBytes, err := ioutil.ReadAll(resp.Body)
246
+	if err != nil {
247
+		fmt.Println(err.Error())
248
+
249
+	}
250
+	str := string(respBytes)
251
+
252
+	var respJSON map[string]interface{}
253
+	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
254
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
255
+	}
256
+	var personSealId string
257
+	personSealId = respJSON["data"].(map[string]interface{})["personSealId"].(string)
258
+	fmt.Println("str", personSealId)
259
+	return str, personSealId
260
+}

+ 1 - 1
service/stock_service.go 파일 보기

6109
 	if storehouse_id > 0 {
6109
 	if storehouse_id > 0 {
6110
 		db = db.Where("x.storehouse_id = ?", storehouse_id)
6110
 		db = db.Where("x.storehouse_id = ?", storehouse_id)
6111
 	}
6111
 	}
6112
-	err = db.Select("x.id,x.good_name,x.specification_name,x.warehousing_unit,x.count,x.buy_price,x.packing_price,x.new_price,x.manufacturer,x.dealer,x.remark,x.good_id,x.warehousing_order,x.license_number,x.start_time,x.creater,x.checker,x.checker_status,x.checker_time,x.total,x.number,x.expire_date,x.product_date,t.packing_unit,x.last_stock_count,x.type,x.inventory_type,x.stock_count,x.storehouse_id").Joins("left join sgj_users.sgj_user_admin_role as r on r.id = x.creater").Joins("left join xt_good_information as t on t.id =x.good_id").Count(&total).Offset(offset).Limit(limit).Scan(&list).Error
6112
+	err = db.Select("x.id,x.good_name,x.specification_name,x.warehousing_unit,x.count,x.buy_price,x.packing_price,x.new_price,x.manufacturer,x.dealer,x.remark,x.good_id,x.warehousing_order,x.license_number,x.start_time,x.creater,x.checker,x.checker_status,x.checker_time,x.total,x.number,x.expire_date,x.product_date,t.packing_unit,x.last_stock_count,x.type,x.inventory_type,x.stock_count,x.storehouse_id,x.ctime").Joins("left join sgj_users.sgj_user_admin_role as r on r.id = x.creater").Joins("left join xt_good_information as t on t.id =x.good_id").Count(&total).Offset(offset).Limit(limit).Scan(&list).Error
6113
 	return list, total, err
6113
 	return list, total, err
6114
 }
6114
 }
6115
 
6115