Browse Source

历史排班

28169 1 year ago
parent
commit
aad340d8b9

+ 4 - 4
controllers/pharmacy_controller.go View File

@@ -165,7 +165,7 @@ func (this *PharmacyController) IssuedDrug() {
165 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 171
 		schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition)
@@ -189,7 +189,7 @@ func (this *PharmacyController) IssuedDrug() {
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 194
 		var flist []*models.TmpPatient
195 195
 		flist, err = service.GetTodayDrug(stime, etime, orgid, 1, keyword)
@@ -245,7 +245,7 @@ func (this *PharmacyController) WaitingDrug() {
245 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 250
 		var flist []*models.TmpPatient
251 251
 		flist, err = service.GetTodayDrug(stime, etime, orgid, 0, keyword)
@@ -269,7 +269,7 @@ func (this *PharmacyController) WaitingDrug() {
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 275
 		schedule, _ := service.GetSchedulePatientId(stime, etime, orgid, shift, partition)

+ 5 - 5
controllers/print_data_api_controller.go View File

@@ -37,7 +37,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
37 37
 	idStrs := strings.Split(schIDStr, ",")
38 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 42
 		schedules, getScheduleErr := service.GetSchedulesSeven(adminUserInfo.CurrentOrgId, idStrs)
43 43
 		for _, item := range schedules {
@@ -89,11 +89,11 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
89 89
 			item.Summer = summerVM
90 90
 
91 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 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 98
 				if item.ScheduleDate <= 1672416000 {
99 99
 					fmt.Print("进来1")
@@ -106,7 +106,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
106 106
 				if item.ScheduleDate >= 1672502400 {
107 107
 					fmt.Print("进来2")
108 108
 					listOne, _ := service.GetDialysisOrderCountNight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
109
-
109
+					fmt.Println("listOne2322332", listOne.Count)
110 110
 					item.Patient.TotalDialysis = listOne.Count
111 111
 					item.Count = listOne.Count
112 112
 				}
@@ -141,7 +141,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
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 145
 		schedules, getScheduleErr := service.GetSchedules(adminUserInfo.CurrentOrgId, idStrs)
146 146
 		for _, item := range schedules {
147 147
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)

+ 32 - 1
controllers/sign_api_controller.go View File

@@ -22,7 +22,8 @@ func SignApiRegistRouters() {
22 22
 	//创建个人印章
23 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,3 +120,33 @@ func (this *SignApiController) CreatePersionSeal() {
119 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 View File

@@ -679,7 +679,7 @@ func DispensingMedicine(orgid, patient_id, stime, etime, creater int64) (err err
679 679
 			if PettyCash(v.DrugId) {
680 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 684
 				kou := FenDrugInventory(v, orgid)
685 685
 				if !kou {
@@ -712,7 +712,7 @@ func DispensingMedicine(orgid, patient_id, stime, etime, creater int64) (err err
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 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 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 718
 		if err != nil {

+ 69 - 0
service/sign_service.go View File

@@ -258,3 +258,72 @@ func CreatePersionSeal(user_id string, person_seal_type int64, person_seal_name
258 258
 	fmt.Println("str", personSealId)
259 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
+}