28169 1 anno fa
parent
commit
aad340d8b9

+ 4 - 4
controllers/pharmacy_controller.go Vedi File

165
 		etime = stime + 86399
165
 		etime = stime + 86399
166
 	}
166
 	}
167
 
167
 
168
-	if orgid == 10164 || orgid == 3877 || orgid == 10188 || orgid == 10217 || orgid == 9671 || orgid == 10387 {
168
+	if orgid == 10164 || orgid == 3877 || orgid == 10188 || orgid == 10217 || orgid == 9671 || orgid == 10387 || orgid == 10375 {
169
 
169
 
170
 		//获取排班班次
170
 		//获取排班班次
171
 		schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition)
171
 		schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition)
189
 		})
189
 		})
190
 	}
190
 	}
191
 
191
 
192
-	if orgid != 10164 && orgid == 3877 && orgid != 10188 && orgid != 10217 && orgid != 9671 && orgid != 10387 {
192
+	if orgid != 10164 && orgid == 3877 && orgid != 10188 && orgid != 10217 && orgid != 9671 && orgid != 10387 && orgid != 10375 {
193
 		//查询表里当天的数据
193
 		//查询表里当天的数据
194
 		var flist []*models.TmpPatient
194
 		var flist []*models.TmpPatient
195
 		flist, err = service.GetTodayDrug(stime, etime, orgid, 1, keyword)
195
 		flist, err = service.GetTodayDrug(stime, etime, orgid, 1, keyword)
245
 		etime = stime + 86399
245
 		etime = stime + 86399
246
 	}
246
 	}
247
 
247
 
248
-	if orgid != 9671 && orgid != 10188 && orgid != 10217 && orgid != 3877 && orgid != 10164 && orgid != 10387 {
248
+	if orgid != 9671 && orgid != 10188 && orgid != 10217 && orgid != 3877 && orgid != 10164 && orgid != 10387 && orgid != 10375 {
249
 		//查询表里当天的数据
249
 		//查询表里当天的数据
250
 		var flist []*models.TmpPatient
250
 		var flist []*models.TmpPatient
251
 		flist, err = service.GetTodayDrug(stime, etime, orgid, 0, keyword)
251
 		flist, err = service.GetTodayDrug(stime, etime, orgid, 0, keyword)
269
 	}
269
 	}
270
 
270
 
271
 	//当天已发药的人数
271
 	//当天已发药的人数
272
-	if orgid == 9671 || orgid == 10188 || orgid == 10217 || orgid == 3877 || orgid == 10164 || orgid == 10387 {
272
+	if orgid == 9671 || orgid == 10188 || orgid == 10217 || orgid == 3877 || orgid == 10164 || orgid == 10387 || orgid == 10375 {
273
 
273
 
274
 		//获取排班班次
274
 		//获取排班班次
275
 		schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition)
275
 		schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition)

+ 5 - 5
controllers/print_data_api_controller.go Vedi File

37
 	idStrs := strings.Split(schIDStr, ",")
37
 	idStrs := strings.Split(schIDStr, ",")
38
 	adminUserInfo := this.GetAdminUserInfo()
38
 	adminUserInfo := this.GetAdminUserInfo()
39
 
39
 
40
-	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 || this.GetAdminUserInfo().CurrentOrgId == 10138 || this.GetAdminUserInfo().CurrentOrgId == 10278 || this.GetAdminUserInfo().CurrentOrgId == 9841 || this.GetAdminUserInfo().CurrentOrgId == 9845 || this.GetAdminUserInfo().CurrentOrgId == 10081 || this.GetAdminUserInfo().CurrentOrgId == 10215 || this.GetAdminUserInfo().CurrentOrgId == 10121 || this.GetAdminUserInfo().CurrentOrgId == 10234 || this.GetAdminUserInfo().CurrentOrgId == 10188 || this.GetAdminUserInfo().CurrentOrgId == 10217 || this.GetAdminUserInfo().CurrentOrgId == 10340 || this.GetAdminUserInfo().CurrentOrgId == 9905 || this.GetAdminUserInfo().CurrentOrgId == 10346 || this.GetAdminUserInfo().CurrentOrgId == 10441 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10101 {
40
+	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 || this.GetAdminUserInfo().CurrentOrgId == 10138 || this.GetAdminUserInfo().CurrentOrgId == 10278 || this.GetAdminUserInfo().CurrentOrgId == 9841 || this.GetAdminUserInfo().CurrentOrgId == 9845 || this.GetAdminUserInfo().CurrentOrgId == 10081 || this.GetAdminUserInfo().CurrentOrgId == 10215 || this.GetAdminUserInfo().CurrentOrgId == 10121 || this.GetAdminUserInfo().CurrentOrgId == 10234 || this.GetAdminUserInfo().CurrentOrgId == 10188 || this.GetAdminUserInfo().CurrentOrgId == 10217 || this.GetAdminUserInfo().CurrentOrgId == 10340 || this.GetAdminUserInfo().CurrentOrgId == 9905 || this.GetAdminUserInfo().CurrentOrgId == 10346 || this.GetAdminUserInfo().CurrentOrgId == 10441 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 10495 {
41
 
41
 
42
 		schedules, getScheduleErr := service.GetSchedulesSeven(adminUserInfo.CurrentOrgId, idStrs)
42
 		schedules, getScheduleErr := service.GetSchedulesSeven(adminUserInfo.CurrentOrgId, idStrs)
43
 		for _, item := range schedules {
43
 		for _, item := range schedules {
89
 			item.Summer = summerVM
89
 			item.Summer = summerVM
90
 
90
 
91
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)
91
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)
92
-			if this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 9671 && this.GetAdminUserInfo().CurrentOrgId != 10345 && this.GetAdminUserInfo().CurrentOrgId != 9970 {
92
+			if this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 9671 && this.GetAdminUserInfo().CurrentOrgId != 10345 && this.GetAdminUserInfo().CurrentOrgId != 9970 && this.GetAdminUserInfo().CurrentOrgId != 10495 {
93
 				item.Count = list.Count
93
 				item.Count = list.Count
94
 			}
94
 			}
95
 
95
 
96
-			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 || this.GetAdminUserInfo().CurrentOrgId == 10345 || this.GetAdminUserInfo().CurrentOrgId == 9970 {
96
+			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 || this.GetAdminUserInfo().CurrentOrgId == 10345 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10495 {
97
 
97
 
98
 				if item.ScheduleDate <= 1672416000 {
98
 				if item.ScheduleDate <= 1672416000 {
99
 					fmt.Print("进来1")
99
 					fmt.Print("进来1")
106
 				if item.ScheduleDate >= 1672502400 {
106
 				if item.ScheduleDate >= 1672502400 {
107
 					fmt.Print("进来2")
107
 					fmt.Print("进来2")
108
 					listOne, _ := service.GetDialysisOrderCountNight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
108
 					listOne, _ := service.GetDialysisOrderCountNight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
109
-
109
+					fmt.Println("listOne2322332", listOne.Count)
110
 					item.Patient.TotalDialysis = listOne.Count
110
 					item.Patient.TotalDialysis = listOne.Count
111
 					item.Count = listOne.Count
111
 					item.Count = listOne.Count
112
 				}
112
 				}
141
 		})
141
 		})
142
 	}
142
 	}
143
 
143
 
144
-	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 && this.GetAdminUserInfo().CurrentOrgId != 10138 && this.GetAdminUserInfo().CurrentOrgId != 10278 && this.GetAdminUserInfo().CurrentOrgId != 9841 && this.GetAdminUserInfo().CurrentOrgId != 9845 && this.GetAdminUserInfo().CurrentOrgId != 10081 && this.GetAdminUserInfo().CurrentOrgId != 10215 && this.GetAdminUserInfo().CurrentOrgId != 10121 && this.GetAdminUserInfo().CurrentOrgId != 10234 && this.GetAdminUserInfo().CurrentOrgId != 10188 && this.GetAdminUserInfo().CurrentOrgId != 10217 && this.GetAdminUserInfo().CurrentOrgId != 10340 && this.GetAdminUserInfo().CurrentOrgId != 9905 && this.GetAdminUserInfo().CurrentOrgId != 10346 && this.GetAdminUserInfo().CurrentOrgId != 10441 && this.GetAdminUserInfo().CurrentOrgId != 9970 && this.GetAdminUserInfo().CurrentOrgId != 10101 {
144
+	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 && this.GetAdminUserInfo().CurrentOrgId != 10138 && this.GetAdminUserInfo().CurrentOrgId != 10278 && this.GetAdminUserInfo().CurrentOrgId != 9841 && this.GetAdminUserInfo().CurrentOrgId != 9845 && this.GetAdminUserInfo().CurrentOrgId != 10081 && this.GetAdminUserInfo().CurrentOrgId != 10215 && this.GetAdminUserInfo().CurrentOrgId != 10121 && this.GetAdminUserInfo().CurrentOrgId != 10234 && this.GetAdminUserInfo().CurrentOrgId != 10188 && this.GetAdminUserInfo().CurrentOrgId != 10217 && this.GetAdminUserInfo().CurrentOrgId != 10340 && this.GetAdminUserInfo().CurrentOrgId != 9905 && this.GetAdminUserInfo().CurrentOrgId != 10346 && this.GetAdminUserInfo().CurrentOrgId != 10441 && this.GetAdminUserInfo().CurrentOrgId != 9970 && this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 10495 {
145
 		schedules, getScheduleErr := service.GetSchedules(adminUserInfo.CurrentOrgId, idStrs)
145
 		schedules, getScheduleErr := service.GetSchedules(adminUserInfo.CurrentOrgId, idStrs)
146
 		for _, item := range schedules {
146
 		for _, item := range schedules {
147
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)
147
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)

+ 32 - 1
controllers/sign_api_controller.go Vedi File

22
 	//创建个人印章
22
 	//创建个人印章
23
 	beego.Router("/api/sign/createpersionseal", &SignApiController{}, "Get:CreatePersionSeal")
23
 	beego.Router("/api/sign/createpersionseal", &SignApiController{}, "Get:CreatePersionSeal")
24
 
24
 
25
-	//上传文件创建和他
25
+	//上传文件创建创建合同
26
+	beego.Router("/api/sign/createuploadpact", &SignApiController{}, "Get:CreateUploadPact")
26
 }
27
 }
27
 
28
 
28
 // 短信服务接口
29
 // 短信服务接口
119
 	return
120
 	return
120
 
121
 
121
 }
122
 }
123
+
124
+func (this *SignApiController) CreateUploadPact() {
125
+
126
+	contractcode := this.GetString("contractcode")
127
+
128
+	contractname := this.GetString("contractname")
129
+
130
+	signcount, _ := this.GetInt64("signcount")
131
+
132
+	docname := this.GetString("docname")
133
+
134
+	contractbase := this.GetString("contractbase")
135
+
136
+	creator := this.GetString("creator")
137
+
138
+	enterpriseid := this.GetString("enterpriseid")
139
+
140
+	signvalidays, _ := this.GetInt64("signvalidays")
141
+
142
+	sysncurl := this.GetString("sysncurl")
143
+
144
+	asyncurl := this.GetString("asyncurl")
145
+
146
+	sign := service.CreateUploadPact(contractcode, contractname, signcount, docname, contractbase, creator, enterpriseid, signvalidays, sysncurl, asyncurl)
147
+
148
+	this.ServeSuccessJSON(map[string]interface{}{
149
+		"sign": sign,
150
+	})
151
+	return
152
+}

+ 2 - 2
service/pharmacy_service.go Vedi File

679
 			if PettyCash(v.DrugId) {
679
 			if PettyCash(v.DrugId) {
680
 				continue
680
 				continue
681
 			}
681
 			}
682
-			if orgid != 10217 && orgid != 10188 && orgid != 9671 && orgid != 10164 && orgid != 10387 {
682
+			if orgid != 10217 && orgid != 10188 && orgid != 9671 && orgid != 10164 && orgid != 10387 && orgid != 10375 {
683
 				////判断药品库存是否充足
683
 				////判断药品库存是否充足
684
 				kou := FenDrugInventory(v, orgid)
684
 				kou := FenDrugInventory(v, orgid)
685
 				if !kou {
685
 				if !kou {
712
 	}
712
 	}
713
 
713
 
714
 	//针对大丰响水
714
 	//针对大丰响水
715
-	if orgid != 10217 && orgid != 10188 && orgid != 9671 && orgid != 10164 && orgid != 10387 {
715
+	if orgid != 10217 && orgid != 10188 && orgid != 9671 && orgid != 10164 && orgid != 10387 && orgid != 10375 {
716
 		err = tx.Raw("select id from xt_doctor_advice where status = 1 and (advice_type = 2 or advice_type = 3) and advice_date >= ? and advice_date <= ? and "+
716
 		err = tx.Raw("select id from xt_doctor_advice where status = 1 and (advice_type = 2 or advice_type = 3) and advice_date >= ? and advice_date <= ? and "+
717
 			"user_org_id = ? and patient_id = ? and is_medicine = 0 and drug_id in (select id from xt_base_drug where org_id = ? and is_pharmacy = 1)", stime, etime, orgid, patient_id, orgid).Scan(&xids).Error
717
 			"user_org_id = ? and patient_id = ? and is_medicine = 0 and drug_id in (select id from xt_base_drug where org_id = ? and is_pharmacy = 1)", stime, etime, orgid, patient_id, orgid).Scan(&xids).Error
718
 		if err != nil {
718
 		if err != nil {

+ 69 - 0
service/sign_service.go Vedi File

258
 	fmt.Println("str", personSealId)
258
 	fmt.Println("str", personSealId)
259
 	return str, personSealId
259
 	return str, personSealId
260
 }
260
 }
261
+
262
+func CreateUploadPact(contractcode string, contractname string, signcount int64, docname string, contractbase string, creator string, enterpriseid string, signvalidays int64, sysncurl string, asyncurl string) string {
263
+
264
+	var url string
265
+
266
+	url = "http://demo.itruscloud.com/apigate/contractpaasapi/contract/createByFile"
267
+	appId := beego.AppConfig.String("sign_appid")
268
+
269
+	serviceKye := beego.AppConfig.String("serviceKye")
270
+
271
+	serviceCode := beego.AppConfig.String("serviceCode")
272
+
273
+	maprequest := make(map[string]interface{})
274
+
275
+	maprequest["contractCode"] = "102020620701056856"
276
+
277
+	maprequest["contractName"] = "汽车购买交易合同"
278
+
279
+	maprequest["signCount"] = 10
280
+
281
+	maprequest["docName"] = "员工保密协议"
282
+
283
+	file := "C:/Users/28169/Desktop/打印单.pdf"
284
+	fileBytes, err := ioutil.ReadFile(file) // 读取file
285
+
286
+	contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
287
+
288
+	maprequest["contractBase64"] = contractBase64
289
+
290
+	maprequest["creator"] = "1003"
291
+
292
+	maprequest["enterpriseId"] = "1001"
293
+
294
+	maprequest["signValidDays"] = 90
295
+
296
+	maprequest["sysnUrl"] = "https://kuyi.shengws.com/chenxuemin1.png"
297
+
298
+	maprequest["asyncUrl"] = "https://kuyi.shengws.com/chenxuemin1.png"
299
+
300
+	byterequest, _ := json.Marshal(maprequest)
301
+	reader := bytes.NewReader(byterequest)
302
+
303
+	signatureStr, _ := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
304
+
305
+	request, err := http.NewRequest("POST", url, reader)
306
+	if err != nil {
307
+		fmt.Println(err.Error())
308
+	}
309
+
310
+	request.Header.Set("appId", appId)
311
+	request.Header.Set("serviceCode", serviceCode)
312
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
313
+	request.Header.Set("Content-Signature", signatureStr)
314
+	client := http.Client{}
315
+
316
+	resp, err := client.Do(request)
317
+	if err != nil {
318
+		fmt.Println(err.Error())
319
+
320
+	}
321
+	respBytes, err := ioutil.ReadAll(resp.Body)
322
+	if err != nil {
323
+		fmt.Println(err.Error())
324
+
325
+	}
326
+	str := string(respBytes)
327
+
328
+	return str
329
+}