Browse Source

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

陈少旭 1 year ago
parent
commit
de203b3351

+ 12 - 0
controllers/his_api_controller.go View File

@@ -2980,6 +2980,9 @@ func (c *HisApiController) CreateHisPrescription() {
2980 2980
 								if s.Price != lastWarehouse.RetailPrice {
2981 2981
 									s.Price = lastWarehouse.RetailPrice
2982 2982
 								}
2983
+								if s.Price == 0 {
2984
+									s.Price = lastWarehouse.RetailPrice
2985
+								}
2983 2986
 							}
2984 2987
 
2985 2988
 							service.CreateHisDoctorAdvice(&s)
@@ -3676,6 +3679,15 @@ func (c *HisApiController) EditHisPrescription() {
3676 3679
 								c.ServeFailJSONWithSGJErrorCode(errcode)
3677 3680
 								return
3678 3681
 							}
3682
+
3683
+							if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 3877 {
3684
+								storeConfig, _ := service.GetAllStoreHouseConfig(adminInfo.CurrentOrgId)
3685
+								lastWarehouse, _ := service.FindLastDrugWarehousingInfoByID(s.DrugId, storeConfig.DrugStorehouseOut)
3686
+								if s.Price == 0 {
3687
+									s.Price = lastWarehouse.RetailPrice
3688
+								}
3689
+							}
3690
+
3679 3691
 							service.CreateHisDoctorAdvice(&s)
3680 3692
 							//记录日志
3681 3693
 							byterequest, _ := json.Marshal(s)

+ 664 - 0
controllers/manage_api_controller.go View File

@@ -158,6 +158,23 @@ func ManageRouters() {
158 158
 
159 159
 	beego.Router("/api/manage/getregistgoodinforlist", &MachineApiController{}, "Get:GetRegistGoodInforList")
160 160
 	beego.Router("/api/manage/getregistnumber", &MachineApiController{}, "Get:GetRegistNumber")
161
+
162
+	beego.Router("/api/manage/savesetairdisinfect", &MachineApiController{}, "Get:SaveSetAirDisInfect")
163
+	beego.Router("/api/manage/getsetairinfectbyid", &MachineApiController{}, "Get:GetSetAirInfectById")
164
+	beego.Router("/api/manage/savenewairwaydisinfect", &MachineApiController{}, "Post:SaveNewAirWayDisinfect")
165
+	beego.Router("/api/manage/getnewairwaydisinfectlist", &MachineApiController{}, "Get:GetNewAirWayDisinfectList")
166
+	beego.Router("/api/manage/getairdisinfectwaylongtime", &MachineApiController{}, "Get:GetAirDisinfectWayLongTime")
167
+	beego.Router("/api/manage/getnewairwaydisinfectbyidlist", &MachineApiController{}, "Get:GetNewAirWayDisinfectByIdList")
168
+	beego.Router("/api/manage/updatenewairwaydisinfect", &MachineApiController{}, "Post:UpdateNewAirWayDisInfect")
169
+	beego.Router("/api/manage/deletenewairwaydisinfect", &MachineApiController{}, "Get:DeleteNewAirWayDisinfect")
170
+
171
+	beego.Router("/api/manage/setobjectdisinfect", &MachineApiController{}, "Get:SaveSetObjectDisinfect")
172
+	beego.Router("/api/manage/getobjectwaydisinfect", &MachineApiController{}, "Get:GetObjectWayDisinect")
173
+	beego.Router("/api/manage/saveobjectwaytabledisinfect", &MachineApiController{}, "Post:SaveObjectWayTableDisinfect")
174
+	beego.Router("/api/manage/getobjcettabledisinfectwaylist", &MachineApiController{}, "Get:GetObjectAbleDisInfectWayList")
175
+	beego.Router("/api/manage/getobjecttabledisinfectwaybylist", &MachineApiController{}, "Get:GetObjectAbledDisInfectWayById")
176
+	beego.Router("/api/manage/updateobjectwaytabledisinfect", &MachineApiController{}, "Post:UpdateObjectWayAbleDisinfect")
177
+	beego.Router("/api/manage/deleteobjecttablewaydisinfect", &MachineApiController{}, "Get:DeleteObjectAbleWayDisinfect")
161 178
 }
162 179
 
163 180
 func (this *MachineApiController) SaveManageInfo() {
@@ -5714,3 +5731,650 @@ func (this *MachineApiController) GetRegistNumber() {
5714 5731
 	})
5715 5732
 	return
5716 5733
 }
5734
+
5735
+func (this *MachineApiController) SaveSetAirDisInfect() {
5736
+
5737
+	air_way, _ := this.GetInt64("air_way")
5738
+	orgId := this.GetAdminUserInfo().CurrentOrgId
5739
+
5740
+	airdisinfect, _ := service.GetAirDisInfectSetting(orgId)
5741
+
5742
+	airSetting := models.XtDeviceAirSetting{
5743
+		ID:        airdisinfect.ID,
5744
+		AirWay:    air_way,
5745
+		UserOrgId: orgId,
5746
+		Ctime:     time.Now().Unix(),
5747
+		Status:    1,
5748
+		Mtime:     time.Now().Unix(),
5749
+	}
5750
+
5751
+	err := service.SaveSetAirDisInfect(airSetting)
5752
+
5753
+	if err != nil {
5754
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
5755
+		return
5756
+	}
5757
+	this.ServeSuccessJSON(map[string]interface{}{
5758
+		"airSetting": airSetting,
5759
+	})
5760
+	return
5761
+
5762
+}
5763
+
5764
+func (this *MachineApiController) GetSetAirInfectById() {
5765
+
5766
+	orgId := this.GetAdminUserInfo().CurrentOrgId
5767
+
5768
+	airset, _ := service.GetAirDisInfectSetting(orgId)
5769
+	this.ServeSuccessJSON(map[string]interface{}{
5770
+		"airset": airset,
5771
+	})
5772
+	return
5773
+
5774
+}
5775
+
5776
+func (this *MachineApiController) SaveNewAirWayDisinfect() {
5777
+
5778
+	timeLayout := "2006-01-02"
5779
+	loc, _ := time.LoadLocation("Local")
5780
+	dataBody := make(map[string]interface{}, 0)
5781
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
5782
+	fmt.Println("err", err)
5783
+	record_date := dataBody["record_date"].(string)
5784
+	recorddate, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
5785
+	recorddateunix := recorddate.Unix()
5786
+
5787
+	first_disinfection_water := dataBody["first_disinfection_water"].(string)
5788
+	first_disinfection_methods := dataBody["first_disinfection_methods"].(string)
5789
+	first_disinfection_time := dataBody["first_disinfection_time"].(string)
5790
+
5791
+	first_start_time := dataBody["first_start_time"].(string)
5792
+
5793
+	if len(first_start_time) == 0 {
5794
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5795
+		return
5796
+	}
5797
+	firstStartTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", first_start_time)
5798
+
5799
+	first_end_time := dataBody["first_end_time"].(string)
5800
+
5801
+	if len(first_end_time) == 0 {
5802
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5803
+		return
5804
+	}
5805
+	firstEndTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", first_end_time)
5806
+
5807
+	first_total_time := dataBody["first_total_time"].(string)
5808
+
5809
+	first_is_check := int64(dataBody["first_is_check"].(float64))
5810
+
5811
+	first_modifications := int64(dataBody["first_modifications"].(float64))
5812
+
5813
+	first_creator := int64(dataBody["first_creator"].(float64))
5814
+
5815
+	last_start_time := dataBody["last_start_time"].(string)
5816
+
5817
+	if len(last_start_time) == 0 {
5818
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5819
+		return
5820
+	}
5821
+	lastStartTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", last_start_time)
5822
+
5823
+	last_end_time := dataBody["last_end_time"].(string)
5824
+
5825
+	if len(last_end_time) == 0 {
5826
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5827
+		return
5828
+	}
5829
+	lastEndTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", last_end_time)
5830
+
5831
+	last_total_time := dataBody["last_total_time"].(string)
5832
+
5833
+	last_is_check := int64(dataBody["last_is_check"].(float64))
5834
+
5835
+	last_modifications := int64(dataBody["last_modifications"].(float64))
5836
+
5837
+	last_creator := int64(dataBody["last_creator"].(float64))
5838
+
5839
+	department := dataBody["department"].(string)
5840
+
5841
+	orgId := this.GetAdminUserInfo().CurrentOrgId
5842
+	disinfect := models.XtNewAriDisinfectWay{
5843
+		UserOrgId:                orgId,
5844
+		RecordDate:               recorddateunix,
5845
+		FirstDisinfectionWater:   first_disinfection_water,
5846
+		FirstDisinfectionMethods: first_disinfection_methods,
5847
+		FirstDisinfectionTime:    first_disinfection_time,
5848
+		FirstStartTime:           firstStartTime.Unix(),
5849
+		FirstEndTime:             firstEndTime.Unix(),
5850
+		FirstTotalTime:           first_total_time,
5851
+		FirstIsCheck:             first_is_check,
5852
+		FirstModifications:       first_modifications,
5853
+		FirstCreator:             first_creator,
5854
+		LastStartTime:            lastStartTime.Unix(),
5855
+		LastEndTime:              lastEndTime.Unix(),
5856
+		LastTotalTime:            last_total_time,
5857
+		LastIsCheck:              last_is_check,
5858
+		LastModifications:        last_modifications,
5859
+		LastCreator:              last_creator,
5860
+		Ctime:                    time.Now().Unix(),
5861
+		Mtime:                    time.Now().Unix(),
5862
+		Status:                   1,
5863
+		Department:               department,
5864
+	}
5865
+
5866
+	err = service.CreateNewAirWayDisinfectOne(disinfect)
5867
+
5868
+	if err != nil {
5869
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
5870
+		return
5871
+	}
5872
+	this.ServeSuccessJSON(map[string]interface{}{
5873
+		"disinfect": disinfect,
5874
+	})
5875
+}
5876
+
5877
+func (this *MachineApiController) GetNewAirWayDisinfectList() {
5878
+
5879
+	timeLayout := "2006-01-02"
5880
+	loc, _ := time.LoadLocation("Local")
5881
+	start_time := this.GetString("start_time")
5882
+	end_time := this.GetString("end_time")
5883
+	limit, _ := this.GetInt64("limit")
5884
+	page, _ := this.GetInt64("page")
5885
+	var startTime int64
5886
+	if len(start_time) > 0 {
5887
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
5888
+		if err != nil {
5889
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5890
+			return
5891
+		}
5892
+		startTime = theTime.Unix()
5893
+	}
5894
+	var endTime int64
5895
+	if len(end_time) > 0 {
5896
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
5897
+		if err != nil {
5898
+			utils.ErrorLog(err.Error())
5899
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5900
+			return
5901
+		}
5902
+		endTime = theTime.Unix()
5903
+	}
5904
+	orgId := this.GetAdminUserInfo().CurrentOrgId
5905
+	list, total, err := service.GetNewAirWayDisinfectList(limit, page, startTime, endTime, orgId)
5906
+	if err != nil {
5907
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
5908
+		return
5909
+	}
5910
+	this.ServeSuccessJSON(map[string]interface{}{
5911
+		"list":  list,
5912
+		"total": total,
5913
+	})
5914
+}
5915
+
5916
+func (this *MachineApiController) GetAirDisinfectWayLongTime() {
5917
+
5918
+	orgId := this.GetAdminUserInfo().CurrentOrgId
5919
+
5920
+	department := this.GetString("department")
5921
+	list, err := service.GetAirDisinfectWayLongTime(orgId, department)
5922
+
5923
+	if err != nil {
5924
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
5925
+		return
5926
+	}
5927
+	this.ServeSuccessJSON(map[string]interface{}{
5928
+		"list": list,
5929
+	})
5930
+}
5931
+
5932
+func (this *MachineApiController) GetNewAirWayDisinfectByIdList() {
5933
+
5934
+	id, _ := this.GetInt64("id")
5935
+	list, err := service.GetNewAirWayDisinfectByIdList(id)
5936
+	if err != nil {
5937
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
5938
+		return
5939
+	}
5940
+	this.ServeSuccessJSON(map[string]interface{}{
5941
+		"list": list,
5942
+	})
5943
+}
5944
+
5945
+func (this *MachineApiController) UpdateNewAirWayDisInfect() {
5946
+
5947
+	timeLayout := "2006-01-02"
5948
+	loc, _ := time.LoadLocation("Local")
5949
+	dataBody := make(map[string]interface{}, 0)
5950
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
5951
+	fmt.Println("err", err)
5952
+
5953
+	id := int64(dataBody["id"].(float64))
5954
+	record_date := dataBody["record_date"].(string)
5955
+	recorddate, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
5956
+	recorddateunix := recorddate.Unix()
5957
+
5958
+	first_disinfection_water := dataBody["first_disinfection_water"].(string)
5959
+	first_disinfection_methods := dataBody["first_disinfection_methods"].(string)
5960
+	first_disinfection_time := dataBody["first_disinfection_time"].(string)
5961
+
5962
+	first_start_time := dataBody["first_start_time"].(string)
5963
+
5964
+	if len(first_start_time) == 0 {
5965
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5966
+		return
5967
+	}
5968
+	firstStartTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", first_start_time)
5969
+
5970
+	first_end_time := dataBody["first_end_time"].(string)
5971
+
5972
+	if len(first_end_time) == 0 {
5973
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5974
+		return
5975
+	}
5976
+	firstEndTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", first_end_time)
5977
+
5978
+	first_total_time := dataBody["first_total_time"].(string)
5979
+
5980
+	first_is_check := int64(dataBody["first_is_check"].(float64))
5981
+
5982
+	first_modifications := int64(dataBody["first_modifications"].(float64))
5983
+
5984
+	first_creator := int64(dataBody["first_creator"].(float64))
5985
+
5986
+	last_start_time := dataBody["last_start_time"].(string)
5987
+
5988
+	if len(last_start_time) == 0 {
5989
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5990
+		return
5991
+	}
5992
+	lastStartTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", last_start_time)
5993
+
5994
+	last_end_time := dataBody["last_end_time"].(string)
5995
+
5996
+	if len(last_end_time) == 0 {
5997
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5998
+		return
5999
+	}
6000
+	lastEndTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", last_end_time)
6001
+
6002
+	last_total_time := dataBody["last_total_time"].(string)
6003
+
6004
+	last_is_check := int64(dataBody["last_is_check"].(float64))
6005
+
6006
+	last_modifications := int64(dataBody["last_modifications"].(float64))
6007
+
6008
+	last_creator := int64(dataBody["last_creator"].(float64))
6009
+
6010
+	department := dataBody["department"].(string)
6011
+	orgId := this.GetAdminUserInfo().CurrentOrgId
6012
+	disinfect := models.XtNewAriDisinfectWay{
6013
+		ID:                       id,
6014
+		UserOrgId:                orgId,
6015
+		RecordDate:               recorddateunix,
6016
+		FirstDisinfectionWater:   first_disinfection_water,
6017
+		FirstDisinfectionMethods: first_disinfection_methods,
6018
+		FirstDisinfectionTime:    first_disinfection_time,
6019
+		FirstStartTime:           firstStartTime.Unix(),
6020
+		FirstEndTime:             firstEndTime.Unix(),
6021
+		FirstTotalTime:           first_total_time,
6022
+		FirstIsCheck:             first_is_check,
6023
+		FirstModifications:       first_modifications,
6024
+		FirstCreator:             first_creator,
6025
+		LastStartTime:            lastStartTime.Unix(),
6026
+		LastEndTime:              lastEndTime.Unix(),
6027
+		LastTotalTime:            last_total_time,
6028
+		LastIsCheck:              last_is_check,
6029
+		LastModifications:        last_modifications,
6030
+		LastCreator:              last_creator,
6031
+		Ctime:                    time.Now().Unix(),
6032
+		Mtime:                    time.Now().Unix(),
6033
+		Status:                   1,
6034
+		Department:               department,
6035
+	}
6036
+
6037
+	err = service.CreateNewAirWayDisinfect(disinfect)
6038
+	if err != nil {
6039
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
6040
+		return
6041
+	}
6042
+	this.ServeSuccessJSON(map[string]interface{}{
6043
+		"disinfect": disinfect,
6044
+	})
6045
+}
6046
+
6047
+func (this *MachineApiController) DeleteNewAirWayDisinfect() {
6048
+
6049
+	id, _ := this.GetInt64("id")
6050
+	err := service.DeleteNewAirWayDisinfect(id)
6051
+	if err != nil {
6052
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
6053
+		return
6054
+	}
6055
+	this.ServeSuccessJSON(map[string]interface{}{
6056
+		"msg": "ok",
6057
+	})
6058
+	return
6059
+}
6060
+
6061
+func (this *MachineApiController) SaveSetObjectDisinfect() {
6062
+
6063
+	air_way, _ := this.GetInt64("air_way")
6064
+
6065
+	orgId := this.GetAdminUserInfo().CurrentOrgId
6066
+
6067
+	disinfect, _ := service.GetObjectTableDisinfect(orgId)
6068
+
6069
+	objctSet := models.XtDeviceObjctSet{
6070
+		ID:        disinfect.ID,
6071
+		UserOrgId: orgId,
6072
+		Status:    1,
6073
+		AirWay:    air_way,
6074
+		Ctime:     time.Now().Unix(),
6075
+		Mtime:     time.Now().Unix(),
6076
+	}
6077
+
6078
+	err := service.SaveSetObjectDisinfect(objctSet)
6079
+	if err != nil {
6080
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
6081
+		return
6082
+	}
6083
+	this.ServeSuccessJSON(map[string]interface{}{
6084
+		"objctSet": objctSet,
6085
+	})
6086
+	return
6087
+}
6088
+
6089
+func (this *MachineApiController) GetObjectWayDisinect() {
6090
+
6091
+	orgId := this.GetAdminUserInfo().CurrentOrgId
6092
+
6093
+	disinfect, _ := service.GetObjectTableDisinfect(orgId)
6094
+
6095
+	this.ServeSuccessJSON(map[string]interface{}{
6096
+		"disinfect": disinfect,
6097
+	})
6098
+	return
6099
+}
6100
+
6101
+func (this *MachineApiController) SaveObjectWayTableDisinfect() {
6102
+
6103
+	timeLayout := "2006-01-02"
6104
+	loc, _ := time.LoadLocation("Local")
6105
+	dataBody := make(map[string]interface{}, 0)
6106
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
6107
+	fmt.Println("err", err)
6108
+	record_date := dataBody["record_date"].(string)
6109
+	recorddate, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
6110
+	recorddateunix := recorddate.Unix()
6111
+
6112
+	first_disinfection_water := dataBody["first_disinfection_water"].(string)
6113
+	first_disinfection_methods := dataBody["first_disinfection_methods"].(string)
6114
+	first_disinfection_time := dataBody["first_disinfection_time"].(string)
6115
+
6116
+	first_start_time := dataBody["first_start_time"].(string)
6117
+
6118
+	var firstStartTimeUnix int64
6119
+	if len(first_start_time) > 0 {
6120
+		firstStartTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", first_start_time)
6121
+		firstStartTimeUnix = firstStartTime.Unix()
6122
+	}
6123
+
6124
+	var firstEndTimeUnix int64
6125
+	first_end_time := dataBody["first_end_time"].(string)
6126
+
6127
+	if len(first_end_time) > 0 {
6128
+		firstEndTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", first_end_time)
6129
+		firstEndTimeUnix = firstEndTime.Unix()
6130
+	}
6131
+
6132
+	first_total_time := dataBody["first_total_time"].(string)
6133
+
6134
+	first_is_check := int64(dataBody["first_is_check"].(float64))
6135
+
6136
+	first_modifications := int64(dataBody["first_modifications"].(float64))
6137
+
6138
+	first_creator := int64(dataBody["first_creator"].(float64))
6139
+
6140
+	last_disinfection_water := dataBody["last_disinfection_water"].(string)
6141
+	last_disinfection_methods := dataBody["last_disinfection_methods"].(string)
6142
+	last_disinfection_time := dataBody["last_disinfection_time"].(string)
6143
+	last_start_time := dataBody["last_start_time"].(string)
6144
+	var lastStartTimeUnix int64
6145
+	if len(last_start_time) > 0 {
6146
+		lastStartTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", last_start_time)
6147
+		lastStartTimeUnix = lastStartTime.Unix()
6148
+	}
6149
+
6150
+	last_end_time := dataBody["last_end_time"].(string)
6151
+
6152
+	var lastEndTimeUnix int64
6153
+	if len(last_end_time) > 0 {
6154
+		lastEndTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", last_end_time)
6155
+		lastEndTimeUnix = lastEndTime.Unix()
6156
+	}
6157
+
6158
+	last_total_time := dataBody["last_total_time"].(string)
6159
+
6160
+	last_is_check := int64(dataBody["last_is_check"].(float64))
6161
+
6162
+	last_modifications := int64(dataBody["last_modifications"].(float64))
6163
+
6164
+	last_creator := int64(dataBody["last_creator"].(float64))
6165
+
6166
+	orgId := this.GetAdminUserInfo().CurrentOrgId
6167
+
6168
+	department := dataBody["department"].(string)
6169
+	objectDisinfect := models.XtNewObjectDisinfectWay{
6170
+		UserOrgId:                orgId,
6171
+		RecordDate:               recorddateunix,
6172
+		FirstDisinfectionWater:   first_disinfection_water,
6173
+		FirstDisinfectionMethods: first_disinfection_methods,
6174
+		FirstDisinfectionTime:    first_disinfection_time,
6175
+		FirstStartTime:           firstStartTimeUnix,
6176
+		FirstEndTime:             firstEndTimeUnix,
6177
+		FirstTotalTime:           first_total_time,
6178
+		FirstIsCheck:             first_is_check,
6179
+		FirstModifications:       first_modifications,
6180
+		FirstCreator:             first_creator,
6181
+		LastStartTime:            lastStartTimeUnix,
6182
+		LastEndTime:              lastEndTimeUnix,
6183
+		LastTotalTime:            last_total_time,
6184
+		LastIsCheck:              last_is_check,
6185
+		LastModifications:        last_modifications,
6186
+		LastCreator:              last_creator,
6187
+		Ctime:                    time.Now().Unix(),
6188
+		Mtime:                    0,
6189
+		Status:                   1,
6190
+		LastDisinfectionWater:    last_disinfection_water,
6191
+		LastDisinfectionMethods:  last_disinfection_methods,
6192
+		LastDisinfectionTime:     last_disinfection_time,
6193
+		Department:               department,
6194
+	}
6195
+
6196
+	err = service.CreateNewObjectWayDisInfect(objectDisinfect)
6197
+
6198
+	if err != nil {
6199
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
6200
+		return
6201
+	}
6202
+	this.ServeSuccessJSON(map[string]interface{}{
6203
+		"objectDisinfect": objectDisinfect,
6204
+	})
6205
+}
6206
+
6207
+func (this *MachineApiController) GetObjectAbleDisInfectWayList() {
6208
+
6209
+	timeLayout := "2006-01-02"
6210
+	loc, _ := time.LoadLocation("Local")
6211
+	start_time := this.GetString("start_time")
6212
+	end_time := this.GetString("end_time")
6213
+	limit, _ := this.GetInt64("limit")
6214
+	page, _ := this.GetInt64("page")
6215
+	var startTime int64
6216
+	if len(start_time) > 0 {
6217
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
6218
+		if err != nil {
6219
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
6220
+			return
6221
+		}
6222
+		startTime = theTime.Unix()
6223
+	}
6224
+	var endTime int64
6225
+	if len(end_time) > 0 {
6226
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
6227
+		if err != nil {
6228
+			utils.ErrorLog(err.Error())
6229
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
6230
+			return
6231
+		}
6232
+		endTime = theTime.Unix()
6233
+	}
6234
+	orgId := this.GetAdminUserInfo().CurrentOrgId
6235
+	list, total, err := service.GetObjectAbleDisInfectWayList(limit, page, startTime, endTime, orgId)
6236
+
6237
+	if err != nil {
6238
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
6239
+		return
6240
+	}
6241
+	this.ServeSuccessJSON(map[string]interface{}{
6242
+		"list":  list,
6243
+		"total": total,
6244
+	})
6245
+}
6246
+
6247
+func (this *MachineApiController) GetObjectAbledDisInfectWayById() {
6248
+
6249
+	id, _ := this.GetInt64("id")
6250
+	list, err := service.GetObjectAbledDisInfectWayById(id)
6251
+	if err != nil {
6252
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
6253
+		return
6254
+	}
6255
+	this.ServeSuccessJSON(map[string]interface{}{
6256
+		"list": list,
6257
+	})
6258
+}
6259
+
6260
+func (this *MachineApiController) UpdateObjectWayAbleDisinfect() {
6261
+
6262
+	timeLayout := "2006-01-02"
6263
+	loc, _ := time.LoadLocation("Local")
6264
+	dataBody := make(map[string]interface{}, 0)
6265
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
6266
+	fmt.Println("err", err)
6267
+	record_date := dataBody["record_date"].(string)
6268
+	recorddate, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
6269
+	recorddateunix := recorddate.Unix()
6270
+
6271
+	first_disinfection_water := dataBody["first_disinfection_water"].(string)
6272
+	first_disinfection_methods := dataBody["first_disinfection_methods"].(string)
6273
+	first_disinfection_time := dataBody["first_disinfection_time"].(string)
6274
+
6275
+	first_start_time := dataBody["first_start_time"].(string)
6276
+
6277
+	var firstStartTimeUnix int64
6278
+	if len(first_start_time) > 0 {
6279
+		firstStartTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", first_start_time)
6280
+		firstStartTimeUnix = firstStartTime.Unix()
6281
+	}
6282
+
6283
+	var firstEndTimeUnix int64
6284
+	first_end_time := dataBody["first_end_time"].(string)
6285
+
6286
+	if len(first_end_time) > 0 {
6287
+		firstEndTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", first_end_time)
6288
+		firstEndTimeUnix = firstEndTime.Unix()
6289
+	}
6290
+
6291
+	first_total_time := dataBody["first_total_time"].(string)
6292
+
6293
+	first_is_check := int64(dataBody["first_is_check"].(float64))
6294
+
6295
+	first_modifications := int64(dataBody["first_modifications"].(float64))
6296
+
6297
+	first_creator := int64(dataBody["first_creator"].(float64))
6298
+
6299
+	last_disinfection_water := dataBody["last_disinfection_water"].(string)
6300
+	last_disinfection_methods := dataBody["last_disinfection_methods"].(string)
6301
+	last_disinfection_time := dataBody["last_disinfection_time"].(string)
6302
+	last_start_time := dataBody["last_start_time"].(string)
6303
+	var lastStartTimeUnix int64
6304
+	if len(last_start_time) > 0 {
6305
+		lastStartTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", last_start_time)
6306
+		lastStartTimeUnix = lastStartTime.Unix()
6307
+	}
6308
+
6309
+	last_end_time := dataBody["last_end_time"].(string)
6310
+
6311
+	var lastEndTimeUnix int64
6312
+	if len(last_end_time) > 0 {
6313
+		lastEndTime, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", last_end_time)
6314
+		lastEndTimeUnix = lastEndTime.Unix()
6315
+	}
6316
+
6317
+	last_total_time := dataBody["last_total_time"].(string)
6318
+
6319
+	last_is_check := int64(dataBody["last_is_check"].(float64))
6320
+
6321
+	last_modifications := int64(dataBody["last_modifications"].(float64))
6322
+
6323
+	last_creator := int64(dataBody["last_creator"].(float64))
6324
+
6325
+	id := int64(dataBody["id"].(float64))
6326
+
6327
+	orgId := this.GetAdminUserInfo().CurrentOrgId
6328
+
6329
+	department := dataBody["department"].(string)
6330
+	objectDisinfect := models.XtNewObjectDisinfectWay{
6331
+		ID:                       id,
6332
+		UserOrgId:                orgId,
6333
+		RecordDate:               recorddateunix,
6334
+		FirstDisinfectionWater:   first_disinfection_water,
6335
+		FirstDisinfectionMethods: first_disinfection_methods,
6336
+		FirstDisinfectionTime:    first_disinfection_time,
6337
+		FirstStartTime:           firstStartTimeUnix,
6338
+		FirstEndTime:             firstEndTimeUnix,
6339
+		FirstTotalTime:           first_total_time,
6340
+		FirstIsCheck:             first_is_check,
6341
+		FirstModifications:       first_modifications,
6342
+		FirstCreator:             first_creator,
6343
+		LastStartTime:            lastStartTimeUnix,
6344
+		LastEndTime:              lastEndTimeUnix,
6345
+		LastTotalTime:            last_total_time,
6346
+		LastIsCheck:              last_is_check,
6347
+		LastModifications:        last_modifications,
6348
+		LastCreator:              last_creator,
6349
+		Ctime:                    time.Now().Unix(),
6350
+		Mtime:                    0,
6351
+		Status:                   1,
6352
+		LastDisinfectionWater:    last_disinfection_water,
6353
+		LastDisinfectionMethods:  last_disinfection_methods,
6354
+		LastDisinfectionTime:     last_disinfection_time,
6355
+		Department:               department,
6356
+	}
6357
+	err = service.SaveobjectDisinfect(objectDisinfect)
6358
+	if err != nil {
6359
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
6360
+		return
6361
+	}
6362
+	this.ServeSuccessJSON(map[string]interface{}{
6363
+		"objectDisinfect": objectDisinfect,
6364
+	})
6365
+}
6366
+
6367
+func (this *MachineApiController) DeleteObjectAbleWayDisinfect() {
6368
+
6369
+	id, _ := this.GetInt64("id")
6370
+	err := service.DeleteObjectAbleWayDisinfect(id)
6371
+
6372
+	if err != nil {
6373
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
6374
+		return
6375
+	}
6376
+	this.ServeSuccessJSON(map[string]interface{}{
6377
+		"msg": "ok",
6378
+	})
6379
+	return
6380
+}

+ 24 - 2
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -9817,6 +9817,7 @@ func (c *DialysisAPIController) GetControlMonitorList() {
9817 9817
 
9818 9818
 func (c *DialysisAPIController) GetAdviceListNoExecution() {
9819 9819
 
9820
+	admin_user_id, _ := c.GetInt64("admin_user_id")
9820 9821
 	timeStr := time.Now().Format("2006-01-02")
9821 9822
 	timeLayout := "2006-01-02 15:04:05"
9822 9823
 	timeStringToTime, _ := utils.ParseTimeStringToTime(timeLayout, timeStr+" 00:00:00")
@@ -9824,10 +9825,31 @@ func (c *DialysisAPIController) GetAdviceListNoExecution() {
9824 9825
 
9825 9826
 	orgId := c.GetMobileAdminUserInfo().Org.Id
9826 9827
 
9827
-	adviceList, _ := service.GetAdviceListNoExecution(timenow, orgId)
9828
+	//查询当前护士的患者
9829
+	orderList, _ := service.GetDialysisOrderNoExecution(admin_user_id, orgId)
9830
+	var patientIds []int64
9831
+
9832
+	for _, item := range orderList {
9833
+		patientIds = append(patientIds, item.PatientId)
9834
+	}
9835
+
9836
+	adviceList, _ := service.GetAdviceListNoExecution(timenow, orgId, patientIds)
9837
+
9838
+	hisAdviceList, _ := service.GetHisAdviceListNoExecution(timenow, orgId, patientIds)
9839
+	fmt.Println("hisAdviceList", hisAdviceList)
9840
+	projectList, _ := service.GetProjectListNoExecution(timenow, orgId, patientIds)
9841
+	fmt.Println("projectList", projectList)
9842
+	//药品管理信息
9843
+	_, drugStockConfig := service.FindHisConfig(orgId)
9844
+
9845
+	patientList, _ := service.GetPatientNoExecutionList(orgId, patientIds)
9828 9846
 
9829 9847
 	c.ServeSuccessJSON(map[string]interface{}{
9830
-		"adviceList": adviceList,
9848
+		"adviceList":      adviceList,
9849
+		"hisAdviceList":   hisAdviceList,
9850
+		"projectList":     projectList,
9851
+		"drugStockConfig": drugStockConfig,
9852
+		"patientList":     patientList,
9831 9853
 	})
9832 9854
 
9833 9855
 }

+ 90 - 10
controllers/sign_api_controller.go View File

@@ -73,6 +73,12 @@ func SignApiRegistRouters() {
73 73
 
74 74
 	beego.Router("/api/device/uploadprintorder", &SignApiController{}, "Post:UploadPrintOrder")
75 75
 
76
+	//sdk 版本
77
+	beego.Router("/api/device/createqianshuusername", &SignApiController{}, "Post:CreateQianshuUserName")
78
+
79
+	//发送消息
80
+	beego.Router("/api/device/createskdsendinformation", &SignApiController{}, "Post:CreateSdkSendInformation")
81
+
76 82
 }
77 83
 
78 84
 // 短信服务接口
@@ -499,8 +505,9 @@ func (this *SignApiController) CreateNewPersionSeal() {
499 505
 
500 506
 	lastPerson, _ := service.GetLastPersonEnterPrise(admin_user_id, orgId)
501 507
 
502
-	personSeal, personSealId := service.CreateNewPersionSeal(lastPerson.UserId)
508
+	//personSeal, personSealId := service.CreateNewPersionSeal(lastPerson.UserId)
503 509
 
510
+	personSeal, personSealId := service.CreateSKDPersionSeal(lastPerson.UserId)
504 511
 	service.UpdatePerseEnterPriseById(lastPerson.ID, personSealId)
505 512
 	this.ServeSuccessJSON(map[string]interface{}{
506 513
 		"personSeal": personSeal,
@@ -511,17 +518,70 @@ func (this *SignApiController) CreateNewPersionSeal() {
511 518
 
512 519
 func (this *SignApiController) CreateNewEnterPrise() {
513 520
 
514
-	orgId := this.GetAdminUserInfo().CurrentOrgId
515
-
516
-	admin_user_id, _ := this.GetInt64("admin_user_id")
517
-
518
-	enterPrise, _ := service.GetEnterPriseByUserOrgId(orgId)
519
-	fmt.Println("地址日活", enterPrise.Enterpriseid)
520
-	lastPerson, _ := service.GetLastPersonEnterPrise(admin_user_id, orgId)
521
+	//orgId := this.GetAdminUserInfo().CurrentOrgId
522
+	//
523
+	//admin_user_id, _ := this.GetInt64("admin_user_id")
524
+	//
525
+	//enterPrise, _ := service.GetEnterPriseByUserOrgId(orgId)
526
+	//fmt.Println("地址日活", enterPrise.Enterpriseid)
527
+	//lastPerson, _ := service.GetLastPersonEnterPrise(admin_user_id, orgId)
528
+	//
529
+	//newEnterPrise, sealId := service.CreateNewEnterPrise(enterPrise.Enterpriseid, lastPerson.UserId)
530
+	//
531
+	//fmt.Println("newEnterPrise",newEnterPrise)
532
+	//service.UpdatePersonEnterPrise(lastPerson.ID, sealId)
521 533
 
522
-	newEnterPrise, sealId := service.CreateNewEnterPrise(enterPrise.Enterpriseid, lastPerson.UserId)
534
+	newEnterPrise, _ := service.CreateSDKEnterPrise()
523 535
 
524
-	service.UpdatePersonEnterPrise(lastPerson.ID, sealId)
536
+	//var url string
537
+	//url = "http://localhost:8890/sdk/seal/createEnterpriseSeal"
538
+	//appId := beego.AppConfig.String("sign_appid")
539
+	//
540
+	//serviceKye := beego.AppConfig.String("serviceKye")
541
+	//
542
+	//serviceCode := beego.AppConfig.String("serviceCode")
543
+	//
544
+	//maprequest := make(map[string]interface{})
545
+	//
546
+	//maprequest["sealType"] = 1
547
+	//maprequest["enterpriseName"] = "深圳伊森时光科技有限公司"
548
+	//maprequest["horizontalText"] = "财务专用章"
549
+	//
550
+	//byterequest, _ := json.Marshal(maprequest)
551
+	//reader := bytes.NewReader(byterequest)
552
+	//
553
+	//signatureStr, _ := service.GenerateHMACSHA1SignatureTwo(maprequest, serviceKye, serviceCode)
554
+	//fmt.Println("signatureStr", signatureStr)
555
+	//request, err := http.NewRequest("POST", url, reader)
556
+	//
557
+	//fmt.Println("request23222222222222222", request)
558
+	//if err != nil {
559
+	//	fmt.Println(err.Error())
560
+	//}
561
+	//
562
+	//request.Header.Set("appId", appId)
563
+	//request.Header.Set("serviceCode", serviceCode)
564
+	//request.Header.Set("Content-Type", "application/json;charset=UTF-8")
565
+	//request.Header.Set("Content-Signature", signatureStr)
566
+	//client := http.Client{}
567
+	//
568
+	//resp, err := client.Do(request)
569
+	//if err != nil {
570
+	//	fmt.Println(err.Error())
571
+	//
572
+	//}
573
+	//respBytes, err := ioutil.ReadAll(resp.Body)
574
+	//if err != nil {
575
+	//	fmt.Println(err.Error())
576
+	//
577
+	//}
578
+	//str := string(respBytes)
579
+	//fmt.Println("strwowowowowo", str)
580
+	//
581
+	//var respJSON map[string]interface{}
582
+	//if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
583
+	//	utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
584
+	//}
525 585
 
526 586
 	this.ServeSuccessJSON(map[string]interface{}{
527 587
 		"newEnterPrise": newEnterPrise,
@@ -572,3 +632,23 @@ func (this *SignApiController) UploadPrintOrder() {
572 632
 	})
573 633
 
574 634
 }
635
+
636
+func (this *SignApiController) CreateQianshuUserName() {
637
+
638
+	sign, userId := service.CreateQianshuUserName()
639
+
640
+	this.ServeSuccessJSON(map[string]interface{}{
641
+		"sign":   sign,
642
+		"userId": userId,
643
+	})
644
+}
645
+
646
+func (this *SignApiController) CreateSdkSendInformation() {
647
+
648
+	information, orderId := service.CreateSdkSendInformation()
649
+
650
+	this.ServeSuccessJSON(map[string]interface{}{
651
+		"information": information,
652
+		"orderId":     orderId,
653
+	})
654
+}

+ 91 - 0
models/device_models.go View File

@@ -1385,6 +1385,36 @@ func (XtNewAriDisinfect) TableName() string {
1385 1385
 	return "xt_new_ari_disinfect"
1386 1386
 }
1387 1387
 
1388
+type XtNewAriDisinfectWay struct {
1389
+	ID                       int64  `gorm:"column:id" json:"id" form:"id"`
1390
+	UserOrgId                int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1391
+	RecordDate               int64  `gorm:"column:record_date" json:"record_date" form:"record_date"`
1392
+	FirstDisinfectionWater   string `gorm:"column:first_disinfection_water" json:"first_disinfection_water" form:"first_disinfection_water"`
1393
+	FirstDisinfectionMethods string `gorm:"column:first_disinfection_methods" json:"first_disinfection_methods" form:"first_disinfection_methods"`
1394
+	FirstDisinfectionTime    string `gorm:"column:first_disinfection_time" json:"first_disinfection_time" form:"first_disinfection_time"`
1395
+	FirstStartTime           int64  `gorm:"column:first_start_time" json:"first_start_time" form:"first_start_time"`
1396
+	FirstEndTime             int64  `gorm:"column:first_end_time" json:"first_end_time" form:"first_end_time"`
1397
+	FirstTotalTime           string `gorm:"column:first_total_time" json:"first_total_time" form:"first_total_time"`
1398
+	FirstIsCheck             int64  `gorm:"column:first_is_check" json:"first_is_check" form:"first_is_check"`
1399
+	FirstModifications       int64  `gorm:"column:first_modifications" json:"first_modifications" form:"first_modifications"`
1400
+	FirstCreator             int64  `gorm:"column:first_creator" json:"first_creator" form:"first_creator"`
1401
+	LastStartTime            int64  `gorm:"column:last_start_time" json:"last_start_time" form:"last_start_time"`
1402
+	LastEndTime              int64  `gorm:"column:last_end_time" json:"last_end_time" form:"last_end_time"`
1403
+	LastTotalTime            string `gorm:"column:last_total_time" json:"last_total_time" form:"last_total_time"`
1404
+	LastIsCheck              int64  `gorm:"column:last_is_check" json:"last_is_check" form:"last_is_check"`
1405
+	LastModifications        int64  `gorm:"column:last_modifications" json:"last_modifications" form:"last_modifications"`
1406
+	LastCreator              int64  `gorm:"column:last_creator" json:"last_creator" form:"last_creator"`
1407
+	Ctime                    int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
1408
+	Mtime                    int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
1409
+	Status                   int64  `gorm:"column:status" json:"status" form:"status"`
1410
+	Department               string `gorm:"column:department" json:"department" form:"department"`
1411
+}
1412
+
1413
+func (XtNewAriDisinfectWay) TableName() string {
1414
+
1415
+	return "xt_new_ari_disinfect_way"
1416
+}
1417
+
1388 1418
 type XtNewObjectDisinfect struct {
1389 1419
 	ID                         int64  `gorm:"column:id" json:"id" form:"id"`
1390 1420
 	UserOrgId                  int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
@@ -1502,3 +1532,64 @@ func (NewDeviceInformation) TableName() string {
1502 1532
 
1503 1533
 	return "xt_device_information"
1504 1534
 }
1535
+
1536
+type XtDeviceAirSetting struct {
1537
+	ID        int64 `gorm:"column:id" json:"id" form:"id"`
1538
+	AirWay    int64 `gorm:"column:air_way" json:"air_way" form:"air_way"`
1539
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1540
+	Ctime     int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
1541
+	Status    int64 `gorm:"column:status" json:"status" form:"status"`
1542
+	Mtime     int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
1543
+}
1544
+
1545
+func (XtDeviceAirSetting) TableName() string {
1546
+
1547
+	return "xt_device_air_setting"
1548
+}
1549
+
1550
+type XtDeviceObjctSet struct {
1551
+	ID        int64 `gorm:"column:id" json:"id" form:"id"`
1552
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1553
+	Status    int64 `gorm:"column:status" json:"status" form:"status"`
1554
+	AirWay    int64 `gorm:"column:air_way" json:"air_way" form:"air_way"`
1555
+	Ctime     int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
1556
+	Mtime     int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
1557
+}
1558
+
1559
+func (XtDeviceObjctSet) TableName() string {
1560
+
1561
+	return "xt_device_objct_set"
1562
+}
1563
+
1564
+type XtNewObjectDisinfectWay struct {
1565
+	ID                       int64  `gorm:"column:id" json:"id" form:"id"`
1566
+	UserOrgId                int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1567
+	RecordDate               int64  `gorm:"column:record_date" json:"record_date" form:"record_date"`
1568
+	FirstDisinfectionWater   string `gorm:"column:first_disinfection_water" json:"first_disinfection_water" form:"first_disinfection_water"`
1569
+	FirstDisinfectionMethods string `gorm:"column:first_disinfection_methods" json:"first_disinfection_methods" form:"first_disinfection_methods"`
1570
+	FirstDisinfectionTime    string `gorm:"column:first_disinfection_time" json:"first_disinfection_time" form:"first_disinfection_time"`
1571
+	FirstStartTime           int64  `gorm:"column:first_start_time" json:"first_start_time" form:"first_start_time"`
1572
+	FirstEndTime             int64  `gorm:"column:first_end_time" json:"first_end_time" form:"first_end_time"`
1573
+	FirstTotalTime           string `gorm:"column:first_total_time" json:"first_total_time" form:"first_total_time"`
1574
+	FirstIsCheck             int64  `gorm:"column:first_is_check" json:"first_is_check" form:"first_is_check"`
1575
+	FirstModifications       int64  `gorm:"column:first_modifications" json:"first_modifications" form:"first_modifications"`
1576
+	FirstCreator             int64  `gorm:"column:first_creator" json:"first_creator" form:"first_creator"`
1577
+	Ctime                    int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
1578
+	Mtime                    int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
1579
+	Status                   int64  `gorm:"column:status" json:"status" form:"status"`
1580
+	LastDisinfectionWater    string `gorm:"column:last_disinfection_water" json:"last_disinfection_water" form:"last_disinfection_water"`
1581
+	LastDisinfectionMethods  string `gorm:"column:last_disinfection_methods" json:"last_disinfection_methods" form:"last_disinfection_methods"`
1582
+	LastDisinfectionTime     string `gorm:"column:last_disinfection_time" json:"last_disinfection_time" form:"last_disinfection_time"`
1583
+	Department               string `gorm:"column:department" json:"department" form:"department"`
1584
+	LastStartTime            int64  `gorm:"column:last_start_time" json:"last_start_time" form:"last_start_time"`
1585
+	LastEndTime              int64  `gorm:"column:last_end_time" json:"last_end_time" form:"last_end_time"`
1586
+	LastTotalTime            string `gorm:"column:last_total_time" json:"last_total_time" form:"last_total_time"`
1587
+	LastIsCheck              int64  `gorm:"column:last_is_check" json:"last_is_check" form:"last_is_check"`
1588
+	LastModifications        int64  `gorm:"column:last_modifications" json:"last_modifications" form:"last_modifications"`
1589
+	LastCreator              int64  `gorm:"column:last_creator" json:"last_creator" form:"last_creator"`
1590
+}
1591
+
1592
+func (XtNewObjectDisinfectWay) TableName() string {
1593
+
1594
+	return "xt_new_object_disinfect_way"
1595
+}

+ 45 - 0
models/dialysis.go View File

@@ -1552,3 +1552,48 @@ type DialysisFinish struct {
1552 1552
 func (DialysisFinish) TableName() string {
1553 1553
 	return "xt_dialysis_finish"
1554 1554
 }
1555
+
1556
+type NoDoctorAdvice struct {
1557
+	ID             int64 `gorm:"column:id" json:"id" form:"id"`
1558
+	UserOrgId      int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1559
+	PatientId      int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1560
+	Status         int64 `gorm:"column:status" json:"status" form:"status"`
1561
+	ExecutionState int64 `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
1562
+	AdviceDate     int64 `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
1563
+	AdviceType     int64 `gorm:"column:advice_type" json:"advice_type" form:"advice_type"`
1564
+	Count          int64 `json:"count"`
1565
+}
1566
+
1567
+func (NoDoctorAdvice) TableName() string {
1568
+	return "xt_doctor_advice"
1569
+}
1570
+
1571
+type HisNoDoctorAdvice struct {
1572
+	ID             int64 `gorm:"column:id" json:"id" form:"id"`
1573
+	UserOrgId      int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1574
+	PatientId      int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1575
+	Status         int64 `gorm:"column:status" json:"status" form:"status"`
1576
+	ExecutionState int64 `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
1577
+	AdviceDate     int64 `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
1578
+	AdviceType     int64 `gorm:"column:advice_type" json:"advice_type" form:"advice_type"`
1579
+	Count          int64 `json:"count"`
1580
+}
1581
+
1582
+func (HisNoDoctorAdvice) TableName() string {
1583
+	return "his_doctor_advice_info"
1584
+}
1585
+
1586
+type NoHisPrescriptionProject struct {
1587
+	ID             int64 `gorm:"column:id" json:"id" form:"id"`
1588
+	UserOrgId      int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1589
+	Status         int64 `gorm:"column:status" json:"status" form:"status"`
1590
+	PatientId      int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1591
+	RecordDate     int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
1592
+	Count          int64 `json:"count"`
1593
+	ExecutionState int64 `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
1594
+	AdviceDate     int64 `json:"advice_date"`
1595
+}
1596
+
1597
+func (NoHisPrescriptionProject) TableName() string {
1598
+	return "his_prescription_project"
1599
+}

+ 125 - 0
service/manage_service.go View File

@@ -1666,6 +1666,24 @@ func GetNewAirDisinfectList(limit int64, page int64, start_time int64, end_time
1666 1666
 	return list, total, err
1667 1667
 }
1668 1668
 
1669
+func GetNewAirWayDisinfectList(limit int64, page int64, start_time int64, end_time int64, user_org_id int64) (list []*models.XtNewAriDisinfectWay, total int64, err error) {
1670
+
1671
+	offset := (page - 1) * limit
1672
+
1673
+	db := XTReadDB().Model(&list).Where("status =1")
1674
+	if start_time > 0 {
1675
+		db = db.Where("record_date >= ?", start_time)
1676
+	}
1677
+	if end_time > 0 {
1678
+		db = db.Where("record_date <= ?", end_time)
1679
+	}
1680
+	if user_org_id > 0 {
1681
+		db = db.Where("user_org_id = ?", user_org_id)
1682
+	}
1683
+	err = db.Count(&total).Offset(offset).Limit(limit).Find(&list).Error
1684
+	return list, total, err
1685
+}
1686
+
1669 1687
 func GetNewAirDisinfectByIdList(id int64) (models.XtNewAriDisinfect, error) {
1670 1688
 
1671 1689
 	disinfect := models.XtNewAriDisinfect{}
@@ -1695,6 +1713,20 @@ func CreateObjectDisInfect(disinfect models.XtNewObjectDisinfect) error {
1695 1713
 	return err
1696 1714
 }
1697 1715
 
1716
+func CreateNewAirWayDisinfectOne(disinfect models.XtNewAriDisinfectWay) error {
1717
+
1718
+	err := XTWriteDB().Create(&disinfect).Error
1719
+
1720
+	return err
1721
+}
1722
+
1723
+func CreateNewAirWayDisinfect(disinfect models.XtNewAriDisinfectWay) error {
1724
+
1725
+	err := XTWriteDB().Save(&disinfect).Error
1726
+
1727
+	return err
1728
+}
1729
+
1698 1730
 func GetObjectTableDisinfectList(limit int64, page int64, start_time int64, end_time int64, user_org_id int64) (list []*models.XtNewObjectDisinfect, total int64, err error) {
1699 1731
 
1700 1732
 	offset := (page - 1) * limit
@@ -1713,6 +1745,24 @@ func GetObjectTableDisinfectList(limit int64, page int64, start_time int64, end_
1713 1745
 	return list, total, err
1714 1746
 }
1715 1747
 
1748
+func GetObjectAbleDisInfectWayList(limit int64, page int64, start_time int64, end_time int64, user_org_id int64) (list []*models.XtNewObjectDisinfectWay, total int64, err error) {
1749
+
1750
+	offset := (page - 1) * limit
1751
+
1752
+	db := XTReadDB().Model(&list).Where("status =1")
1753
+	if start_time > 0 {
1754
+		db = db.Where("record_date >= ?", start_time)
1755
+	}
1756
+	if end_time > 0 {
1757
+		db = db.Where("record_date <= ?", end_time)
1758
+	}
1759
+	if user_org_id > 0 {
1760
+		db = db.Where("user_org_id = ?", user_org_id)
1761
+	}
1762
+	err = db.Count(&total).Offset(offset).Limit(limit).Find(&list).Error
1763
+	return list, total, err
1764
+}
1765
+
1716 1766
 func GetObjectTableDisinfectByList(id int64) (models.XtNewObjectDisinfect, error) {
1717 1767
 
1718 1768
 	disinfect := models.XtNewObjectDisinfect{}
@@ -1741,6 +1791,12 @@ func GetAirDisInfectionLongTime(user_org_id int64) (list []*models.XtNewAriDisin
1741 1791
 	return
1742 1792
 }
1743 1793
 
1794
+func GetAirDisinfectWayLongTime(user_org_id int64, department string) (list []*models.XtNewAriDisinfectWay, err error) {
1795
+
1796
+	err = XTReadDB().Where("user_org_id = ? and status = 1 and department= ?", user_org_id, department).Order("id desc").First(&list).Error
1797
+	return
1798
+}
1799
+
1744 1800
 func GetObjectDisInfectionLongTime(user_org_id int64) (list []*models.XtNewObjectDisinfect, err error) {
1745 1801
 
1746 1802
 	err = XTReadDB().Where("user_org_id = ? and status = 1", user_org_id).Find(&list).Error
@@ -1813,3 +1869,72 @@ func GetRegistNumber(sys_record_time int64, good_id int64, user_org_id int64) (i
1813 1869
 
1814 1870
 	return infor, err
1815 1871
 }
1872
+
1873
+func GetAirDisInfectSetting(orgid int64) (models.XtDeviceAirSetting, error) {
1874
+
1875
+	setting := models.XtDeviceAirSetting{}
1876
+
1877
+	err := XTReadDB().Where("user_org_id =? and status=1", orgid).Find(&setting).Error
1878
+
1879
+	return setting, err
1880
+}
1881
+
1882
+func SaveSetAirDisInfect(setting models.XtDeviceAirSetting) error {
1883
+
1884
+	err := XTWriteDB().Save(&setting).Error
1885
+
1886
+	return err
1887
+}
1888
+
1889
+func GetNewAirWayDisinfectByIdList(id int64) (models.XtNewAriDisinfectWay, error) {
1890
+
1891
+	disinfectWay := models.XtNewAriDisinfectWay{}
1892
+	err := XTReadDB().Where("id = ? and status =1", id).Find(&disinfectWay).Error
1893
+	return disinfectWay, err
1894
+}
1895
+
1896
+func DeleteNewAirWayDisinfect(id int64) error {
1897
+
1898
+	err := XTWriteDB().Model(models.XtNewAriDisinfectWay{}).Where("id=? and status=1", id).Updates(map[string]interface{}{"status": 0}).Error
1899
+	return err
1900
+}
1901
+
1902
+func GetObjectTableDisinfect(user_org_id int64) (models.XtDeviceObjctSet, error) {
1903
+
1904
+	objctSet := models.XtDeviceObjctSet{}
1905
+
1906
+	err := XTReadDB().Where("user_org_id = ? and status=1", user_org_id).Find(&objctSet).Error
1907
+	return objctSet, err
1908
+}
1909
+
1910
+func SaveSetObjectDisinfect(objectSet models.XtDeviceObjctSet) error {
1911
+
1912
+	err := XTWriteDB().Save(&objectSet).Error
1913
+
1914
+	return err
1915
+}
1916
+
1917
+func CreateNewObjectWayDisInfect(way models.XtNewObjectDisinfectWay) error {
1918
+
1919
+	err := XTWriteDB().Create(&way).Error
1920
+	return err
1921
+}
1922
+
1923
+func GetObjectAbledDisInfectWayById(id int64) (models.XtNewObjectDisinfectWay, error) {
1924
+
1925
+	objway := models.XtNewObjectDisinfectWay{}
1926
+	err := XTReadDB().Where("id=? and status=1", id).Find(&objway).Error
1927
+	return objway, err
1928
+}
1929
+
1930
+func SaveobjectDisinfect(way models.XtNewObjectDisinfectWay) error {
1931
+
1932
+	err := XTWriteDB().Save(&way).Error
1933
+	return err
1934
+}
1935
+
1936
+func DeleteObjectAbleWayDisinfect(id int64) error {
1937
+
1938
+	err := XTWriteDB().Model(models.XtNewObjectDisinfectWay{}).Where("id=? and status=1", id).Updates(map[string]interface{}{"status": 0}).Error
1939
+	return err
1940
+}

+ 66 - 2
service/patient_service.go View File

@@ -3209,8 +3209,72 @@ func CreateDeviceValusalMapVrr(vrr models.XtDeviceValusalMapVrr) error {
3209 3209
 	return err
3210 3210
 }
3211 3211
 
3212
-func GetAdviceListNoExecution(advice_date int64, user_org_id int64) (advice []*models.XtDoctorAdvice, err error) {
3212
+func GetDialysisOrderNoExecution(start_nurse int64, user_org_id int64) (order []*models.XtDialysisOrder, err error) {
3213
+
3214
+	err = XTReadDB().Where("start_nurse = ? and user_org_id =? and status =1", start_nurse, user_org_id).Find(&order).Error
3215
+	return order, err
3216
+}
3217
+
3218
+func GetAdviceListNoExecution(advice_date int64, user_org_id int64, patientIds []int64) (advice []*models.NoDoctorAdvice, err error) {
3219
+
3220
+	db := XTReadDB().Model(advice).Where("status=1 and  execution_state = 2 and advice_type = 2")
3221
+
3222
+	if advice_date > 0 {
3223
+		db = db.Where("advice_date= ?", advice_date)
3224
+	}
3225
+	if user_org_id > 0 {
3226
+		db = db.Where("user_org_id =?", user_org_id)
3227
+	}
3228
+	if len(patientIds) > 0 {
3229
+		db = db.Where("patient_id in(?)", patientIds)
3230
+	}
3231
+
3232
+	err = db.Select("patient_id,Count(id) as count,advice_date").Group("patient_id").Find(&advice).Error
3233
+	return advice, err
3234
+}
3235
+
3236
+func GetHisAdviceListNoExecution(advice_date int64, user_org_id int64, patientIds []int64) (advice []*models.HisNoDoctorAdvice, err error) {
3237
+
3238
+	db := XTReadDB().Model(advice).Where("status=1 and  execution_state = 2")
3239
+
3240
+	if advice_date > 0 {
3241
+		db = db.Where("advice_date= ?", advice_date)
3242
+	}
3243
+	if user_org_id > 0 {
3244
+		db = db.Where("user_org_id =?", user_org_id)
3245
+	}
3246
+	if len(patientIds) > 0 {
3247
+		db = db.Where("patient_id in(?)", patientIds)
3248
+	}
3249
+
3250
+	err = db.Select("advice_date,patient_id,Count(id) as count").Group("patient_id").Find(&advice).Error
3213 3251
 
3214
-	err = XTReadDB().Where("advice_date = ? and user_org_id = ? and status =1 and execution_state = 2", advice_date, user_org_id).Find(&advice).Error
3215 3252
 	return advice, err
3216 3253
 }
3254
+
3255
+func GetProjectListNoExecution(record_date int64, user_org_id int64, patientIds []int64) (project []*models.NoHisPrescriptionProject, err error) {
3256
+
3257
+	db := XTReadDB().Model(&project).Where("status=1 and execution_state =0")
3258
+	if record_date > 0 {
3259
+		db = db.Where("record_date= ?", record_date)
3260
+	}
3261
+	if user_org_id > 0 {
3262
+		db = db.Where("user_org_id =?", user_org_id)
3263
+	}
3264
+	if len(patientIds) > 0 {
3265
+		db = db.Where("patient_id in(?)", patientIds)
3266
+	}
3267
+
3268
+	err = db.Select("patient_id,Count(id) as count,record_date as advice_date").Group("patient_id").Find(&project).Error
3269
+	return project, err
3270
+}
3271
+
3272
+func GetPatientNoExecutionList(org_id int64, patientsIds []int64) (patient []*models.XtPatients, err error) {
3273
+
3274
+	err = XTReadDB().Where("user_org_id = ? and id in(?)", org_id, patientsIds).Find(&patient).Error
3275
+	return patient, err
3276
+}
3277
+func FindHisConfig(org_id int64) (err error, config models.XtHisConfig) {
3278
+	err = readDb.Model(&models.XtHisConfig{}).Where("status = 1 AND user_org_id = ?", org_id).First(&config).Error
3279
+	return
3280
+}

+ 278 - 1
service/sign_service.go View File

@@ -103,6 +103,31 @@ func generateHMACSHA1SignatureOne(data interface{}, key, serviceCode string) (st
103 103
 	return "HMAC-SHA1 " + signature, nil
104 104
 }
105 105
 
106
+func GenerateHMACSHA1SignatureTwo(data interface{}, key string) (string, error) {
107
+	// 将数据转换为 JSON 格式的字节数组
108
+	jsonData, err := json.Marshal(data)
109
+	if err != nil {
110
+		return "", err
111
+	}
112
+
113
+	// 将密钥和 serviceCode 进行拼接
114
+	signingKey := key
115
+
116
+	// 将签名密钥转换为字节数组
117
+	keyBytes := []byte(signingKey)
118
+
119
+	// 创建一个新的 HMAC-SHA1 实例
120
+	h := hmac.New(sha1.New, keyBytes)
121
+
122
+	// 将 JSON 数据添加到 HMAC 实例中
123
+	h.Write(jsonData)
124
+
125
+	signature := base64.StdEncoding.EncodeToString(h.Sum(nil))
126
+
127
+	// 返回带有前缀的签名字符串
128
+	return "HMAC-SHA1 " + signature, nil
129
+}
130
+
106 131
 func CreateUserName(phone string, disPlayName string) (string, string) {
107 132
 
108 133
 	var url string
@@ -1077,6 +1102,67 @@ func CreateNewPersionSeal(userId string) (string, string) {
1077 1102
 	return str, personSealId
1078 1103
 }
1079 1104
 
1105
+func CreateSKDPersionSeal(userId string) (string, string) {
1106
+
1107
+	maprequest := make(map[string]interface{})
1108
+
1109
+	//maprequest["userId"] = userId
1110
+
1111
+	//印章字体 1宋体(默认)2 黑体
1112
+	maprequest["fontType"] = 1
1113
+	//个人姓名(1-42位字符)
1114
+	maprequest["personName"] = "王志文"
1115
+	var url string
1116
+	url = "http://localhost:8890/sdk/seal/createPersonSeal"
1117
+	appId := beego.AppConfig.String("sign_appid")
1118
+
1119
+	fmt.Println("appId", appId)
1120
+	serviceKye := beego.AppConfig.String("serviceKye")
1121
+	fmt.Println("serviceKye", serviceKye)
1122
+	serviceCode := beego.AppConfig.String("serviceCode")
1123
+
1124
+	fmt.Println("serviceCode", serviceCode)
1125
+	byterequest, _ := json.Marshal(maprequest)
1126
+	reader := bytes.NewReader(byterequest)
1127
+
1128
+	signatureStr, ERR := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
1129
+
1130
+	fmt.Println(ERR)
1131
+
1132
+	request, err := http.NewRequest("POST", url, reader)
1133
+	fmt.Println("errwowowoowowowow", err)
1134
+	if err != nil {
1135
+		fmt.Println(err.Error())
1136
+	}
1137
+
1138
+	request.Header.Set("appId", appId)
1139
+	request.Header.Set("serviceCode", serviceCode)
1140
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1141
+	request.Header.Set("Content-Signature", signatureStr)
1142
+	client := http.Client{}
1143
+
1144
+	resp, err := client.Do(request)
1145
+	if err != nil {
1146
+		fmt.Println(err.Error())
1147
+
1148
+	}
1149
+	respBytes, err := ioutil.ReadAll(resp.Body)
1150
+	if err != nil {
1151
+		fmt.Println(err.Error())
1152
+
1153
+	}
1154
+	str := string(respBytes)
1155
+	fmt.Println("strwoooooooooooooooooooo", str)
1156
+	var respJSON map[string]interface{}
1157
+	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1158
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1159
+	}
1160
+	var personSealId string
1161
+	//personSealId = respJSON["data"].(map[string]interface{})["personSealId"].(string)
1162
+	//fmt.Println("str", personSealId)
1163
+	return str, personSealId
1164
+}
1165
+
1080 1166
 func UpdatePerseEnterPriseById(id int64, personSealId string) error {
1081 1167
 
1082 1168
 	err := XTWriteDB().Model(models.XtDevicePersonEnterprise{}).Where("id= ? and status =1", id).Updates(map[string]interface{}{"person_seal_id": personSealId}).Error
@@ -1111,7 +1197,7 @@ func CreateNewEnterPrise(enterpriseId string, userId string) (string, string) {
1111 1197
 
1112 1198
 	request, err := http.NewRequest("POST", url, reader)
1113 1199
 
1114
-	fmt.Println("request23222222222222222", request)
1200
+	fmt.Println("中国人民欢迎您", request)
1115 1201
 	if err != nil {
1116 1202
 		fmt.Println(err.Error())
1117 1203
 	}
@@ -1145,6 +1231,62 @@ func CreateNewEnterPrise(enterpriseId string, userId string) (string, string) {
1145 1231
 	return str, sealId
1146 1232
 }
1147 1233
 
1234
+func CreateSDKEnterPrise() (string, string) {
1235
+
1236
+	var url string
1237
+	url = "http://localhost:8890/sdk/seal/createEnterpriseSeal"
1238
+	appId := beego.AppConfig.String("sign_appid")
1239
+
1240
+	serviceKye := beego.AppConfig.String("serviceKye")
1241
+
1242
+	serviceCode := beego.AppConfig.String("serviceCode")
1243
+
1244
+	maprequest := make(map[string]interface{})
1245
+
1246
+	maprequest["sealType"] = 1
1247
+	maprequest["enterpriseName"] = "深圳伊森时光科技有限公司"
1248
+	maprequest["horizontalText"] = "财务专用章"
1249
+
1250
+	byterequest, _ := json.Marshal(maprequest)
1251
+	reader := bytes.NewReader(byterequest)
1252
+
1253
+	signatureStr, _ := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
1254
+
1255
+	fmt.Println("signatureStr", signatureStr)
1256
+	request, err := http.NewRequest("POST", url, reader)
1257
+
1258
+	if err != nil {
1259
+		fmt.Println(err.Error())
1260
+	}
1261
+
1262
+	request.Header.Set("appId", appId)
1263
+	request.Header.Set("serviceCode", serviceCode)
1264
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1265
+	request.Header.Set("Content-Signature", signatureStr)
1266
+	client := http.Client{}
1267
+
1268
+	resp, err := client.Do(request)
1269
+	if err != nil {
1270
+		fmt.Println(err.Error())
1271
+
1272
+	}
1273
+	respBytes, err := ioutil.ReadAll(resp.Body)
1274
+	if err != nil {
1275
+		fmt.Println(err.Error())
1276
+
1277
+	}
1278
+	str := string(respBytes)
1279
+
1280
+	var respJSON map[string]interface{}
1281
+	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1282
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1283
+	}
1284
+	var sealId string
1285
+	//sealId = respJSON["data"].(map[string]interface{})["sealId"].(string)
1286
+	//fmt.Println("sealId", sealId)
1287
+	return str, sealId
1288
+}
1289
+
1148 1290
 func UpdatePersonEnterPrise(id int64, sealId string) error {
1149 1291
 
1150 1292
 	err := XTWriteDB().Model(models.XtDevicePersonEnterprise{}).Where("id = ? and status =1", id).Updates(map[string]interface{}{"seal_id": sealId}).Error
@@ -1381,3 +1523,138 @@ func GetDataConfigDisinfectionFluid(org_id int64) (models.Dataconfig, error) {
1381 1523
 
1382 1524
 	return dataconfig, err
1383 1525
 }
1526
+
1527
+func CreateQianshuUserName() (string, string) {
1528
+
1529
+	var url string
1530
+
1531
+	url = "http://localhost:8890/sdk/user/create"
1532
+	var account string
1533
+
1534
+	account = "13318464642"
1535
+
1536
+	var realName string
1537
+
1538
+	realName = "马文强"
1539
+
1540
+	maprequest := make(map[string]interface{})
1541
+
1542
+	maprequest["account"] = account
1543
+
1544
+	//账号类型:1手机号,2邮箱
1545
+	maprequest["accountType"] = 1
1546
+
1547
+	maprequest["realName"] = realName
1548
+
1549
+	//签署人类型 1个人 2.企业
1550
+	maprequest["signerType"] = 1
1551
+
1552
+	// 0表示 身份证
1553
+	maprequest["cardType"] = 0
1554
+
1555
+	maprequest["cardNumber"] = "430526199408156511"
1556
+
1557
+	fmt.Println("maprequestwowowowowoowow", maprequest)
1558
+
1559
+	byterequest, _ := json.Marshal(maprequest)
1560
+
1561
+	appId := beego.AppConfig.String("sign_appid")
1562
+
1563
+	serviceKye := beego.AppConfig.String("serviceKye")
1564
+
1565
+	serviceCode := beego.AppConfig.String("serviceCode")
1566
+
1567
+	reader := bytes.NewReader(byterequest)
1568
+
1569
+	signatureStr, _ := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
1570
+
1571
+	request, err := http.NewRequest("POST", url, reader)
1572
+	if err != nil {
1573
+		fmt.Println(err.Error())
1574
+	}
1575
+	fmt.Println("请求参数", request)
1576
+	fmt.Println("Content-Signature", signatureStr)
1577
+	request.Header.Set("appId", appId)
1578
+	request.Header.Set("appKey", serviceKye)
1579
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1580
+	request.Header.Set("Content-Signature", signatureStr)
1581
+	client := http.Client{}
1582
+
1583
+	resp, err := client.Do(request)
1584
+	if err != nil {
1585
+		fmt.Println(err.Error())
1586
+
1587
+	}
1588
+	respBytes, err := ioutil.ReadAll(resp.Body)
1589
+	if err != nil {
1590
+		fmt.Println(err.Error())
1591
+
1592
+	}
1593
+	str := string(respBytes)
1594
+
1595
+	var respJSON map[string]interface{}
1596
+	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1597
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1598
+	}
1599
+	var UserId string
1600
+	//UserId = respJSON["data"].(map[string]interface{})["userId"].(string)
1601
+	//fmt.Println("str", UserId)
1602
+	return str, UserId
1603
+}
1604
+
1605
+func CreateSdkSendInformation() (string, string) {
1606
+
1607
+	var url string
1608
+
1609
+	url = "http://localhost:8890/sdk/msg/sendMsg"
1610
+	maprequest := make(map[string]interface{})
1611
+
1612
+	maprequest["phone"] = "13318464642"
1613
+
1614
+	maprequest["signType"] = "pdf"
1615
+
1616
+	byterequest, _ := json.Marshal(maprequest)
1617
+
1618
+	appId := beego.AppConfig.String("sign_appid")
1619
+
1620
+	serviceKye := beego.AppConfig.String("serviceKye")
1621
+
1622
+	reader := bytes.NewReader(byterequest)
1623
+	serviceCode := beego.AppConfig.String("serviceCode")
1624
+	signatureStr, _ := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
1625
+
1626
+	request, err := http.NewRequest("POST", url, reader)
1627
+	if err != nil {
1628
+		fmt.Println(err.Error())
1629
+	}
1630
+	fmt.Println("请求参数", request)
1631
+	fmt.Println("Content-Signature", signatureStr)
1632
+
1633
+	request.Header.Set("appId", appId)
1634
+	request.Header.Set("appKey", serviceKye)
1635
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1636
+	request.Header.Set("Content-Signature", signatureStr)
1637
+	client := http.Client{}
1638
+
1639
+	resp, err := client.Do(request)
1640
+
1641
+	if err != nil {
1642
+		fmt.Println(err.Error())
1643
+
1644
+	}
1645
+	respBytes, err := ioutil.ReadAll(resp.Body)
1646
+	if err != nil {
1647
+		fmt.Println(err.Error())
1648
+
1649
+	}
1650
+	str := string(respBytes)
1651
+
1652
+	var respJSON map[string]interface{}
1653
+	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1654
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1655
+	}
1656
+	var orderId string
1657
+	//orderId = respJSON["data"].(map[string]interface{})["orderId"].(string)
1658
+	//fmt.Println("str", orderId)
1659
+	return str, orderId
1660
+}