|
@@ -186,13 +186,17 @@ func HisManagerApiRegistRouters() {
|
186
|
186
|
beego.Router("/api/pc_bg", &HisApiController{}, "get:FJ3501AND3502")
|
187
|
187
|
//删除库盘和变更
|
188
|
188
|
beego.Router("/api/delete_pc_bg", &HisApiController{}, "get:DeletePCandBG")
|
189
|
|
- beego.Router("/api/delete_pc_bg", &HisApiController{}, "get:DeleteXSandBG")
|
|
189
|
+ beego.Router("/api/delete_xs_bg", &HisApiController{}, "get:DeleteXSandBG")
|
190
|
190
|
//药品变更
|
191
|
191
|
beego.Router("/api/changedrug", &HisApiController{}, "get:ChangeDrug")
|
192
|
192
|
|
193
|
193
|
}
|
194
|
194
|
func (c *HisApiController) FJ3501AND3502() {
|
195
|
195
|
ids := c.getString("ids")
|
|
196
|
+ //ids := c.getint("admin_")
|
|
197
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
198
|
+ roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
|
199
|
+
|
196
|
200
|
id_arr := strings.Split(ids, ",")
|
197
|
201
|
drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
|
198
|
202
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
@@ -202,7 +206,13 @@ func (c *HisApiController) FJ3501AND3502() {
|
202
|
206
|
var struct3501 models.Struct3501
|
203
|
207
|
struct3501.OrgName = miConfig.OrgName
|
204
|
208
|
struct3501.AccessKey = miConfig.AccessKey
|
|
209
|
+ struct3501.Opter = roles.UserName
|
205
|
210
|
struct3501.RequestUrl = miConfig.Url
|
|
211
|
+ struct3501.Url = miConfig.Url
|
|
212
|
+ struct3501.AppId = miConfig.Cainfo
|
|
213
|
+ struct3501.AppSecret = miConfig.AppSecret
|
|
214
|
+ struct3501.Enckey = miConfig.EncKey
|
|
215
|
+ struct3501.SignKey = miConfig.SignKey
|
206
|
216
|
struct3501.SecretKey = miConfig.SecretKey
|
207
|
217
|
struct3501.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
|
208
|
218
|
struct3501.FixmedinsHilistId = miConfig.Code
|
|
@@ -213,9 +223,8 @@ func (c *HisApiController) FJ3501AND3502() {
|
213
|
223
|
struct3501.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
214
|
224
|
struct3501.InvCnt = strconv.FormatInt(drug.StockMaxNumber, 10)
|
215
|
225
|
struct3501.ExpyEnd = time.Unix(drug.ExpiryDate, 0).Format("2006-01-02 15:04:05")
|
216
|
|
- //todo 批次号规则需要在咨询下保健
|
217
|
|
- struct3501.FixmedinsBchno = ""
|
218
|
|
- struct3501.Memo = ""
|
|
226
|
+ struct3501.FixmedinsBchno = strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(drug.ID, 10) + "-" + "3501"
|
|
227
|
+ struct3501.Memo = "入库"
|
219
|
228
|
result1, result2, result3 := service.FJyb3501(struct3501)
|
220
|
229
|
fmt.Println(result1)
|
221
|
230
|
fmt.Println(result2)
|
|
@@ -227,15 +236,23 @@ func (c *HisApiController) FJ3501AND3502() {
|
227
|
236
|
struct3502.FixmedinsHilistName = miConfig.OrgName
|
228
|
237
|
struct3502.FixmedinsCode = miConfig.Code
|
229
|
238
|
struct3502.RxFlag = "0"
|
230
|
|
- struct3502.InvChgTime = time.Unix(drug.Ctime, 0).Format("2006-01-02 15:04:05")
|
|
239
|
+ struct3502.InvChgTime = time.Now().Format("2006-01-02")
|
231
|
240
|
struct3502.OrgName = miConfig.OrgName
|
232
|
241
|
struct3502.AccessKey = miConfig.AccessKey
|
233
|
242
|
struct3502.RequestUrl = miConfig.Url
|
234
|
243
|
struct3502.SecretKey = miConfig.SecretKey
|
235
|
244
|
struct3502.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
236
|
245
|
struct3502.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
246
|
+
|
|
247
|
+ struct3502.Url = miConfig.Url
|
|
248
|
+ struct3502.AppId = miConfig.Cainfo
|
|
249
|
+ struct3502.AppSecret = miConfig.AppSecret
|
|
250
|
+ struct3502.Enckey = miConfig.EncKey
|
|
251
|
+ struct3502.SignKey = miConfig.SignKey
|
|
252
|
+ struct3502.SecretKey = miConfig.SecretKey
|
|
253
|
+
|
237
|
254
|
struct3502.InvChgType = "102"
|
238
|
|
- struct3502.FixmedinsBchno = ""
|
|
255
|
+ struct3501.FixmedinsBchno = strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(drug.ID, 10) + "-" + "3502"
|
239
|
256
|
struct3502.Cnt = strconv.FormatInt(drug.WarehousingCount, 10)
|
240
|
257
|
struct3502.Pric = fmt.Sprintf("%.2f", drug.BaseDrugLib.RetailPrice)
|
241
|
258
|
result11, result22, result33 := service.FJyb3502(struct3502)
|
|
@@ -260,6 +277,14 @@ func (c *HisApiController) FJ3501AND3502() {
|
260
|
277
|
struct3502.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
261
|
278
|
struct3502.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
262
|
279
|
struct3502.InvChgType = "102"
|
|
280
|
+
|
|
281
|
+ struct3502.Url = miConfig.Url
|
|
282
|
+ struct3502.AppId = miConfig.Cainfo
|
|
283
|
+ struct3502.AppSecret = miConfig.AppSecret
|
|
284
|
+ struct3502.Enckey = miConfig.EncKey
|
|
285
|
+ struct3502.SignKey = miConfig.SignKey
|
|
286
|
+ struct3502.SecretKey = miConfig.SecretKey
|
|
287
|
+
|
263
|
288
|
struct3502.FixmedinsBchno = ""
|
264
|
289
|
struct3502.Cnt = strconv.FormatInt(drug.WarehousingCount, 10)
|
265
|
290
|
struct3502.Pric = fmt.Sprintf("%.2f", drug.BaseDrugLib.RetailPrice)
|
|
@@ -270,9 +295,13 @@ func (c *HisApiController) FJ3501AND3502() {
|
270
|
295
|
}
|
271
|
296
|
}
|
272
|
297
|
}
|
|
298
|
+
|
273
|
299
|
func (c *HisApiController) DeletePCandBG() {
|
274
|
300
|
ids := c.getString("ids")
|
275
|
301
|
id_arr := strings.Split(ids, ",")
|
|
302
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
303
|
+ roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
|
304
|
+
|
276
|
305
|
drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
|
277
|
306
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
278
|
307
|
for _, item := range drugs {
|
|
@@ -280,12 +309,20 @@ func (c *HisApiController) DeletePCandBG() {
|
280
|
309
|
var struct3507 models.Struct3507
|
281
|
310
|
struct3507.FixmedinsBchno = ""
|
282
|
311
|
struct3507.InvDataType = "1"
|
|
312
|
+ struct3507.Opter = roles.UserName
|
283
|
313
|
struct3507.OrgName = miConfig.OrgName
|
284
|
314
|
struct3507.AccessKey = miConfig.AccessKey
|
285
|
315
|
struct3507.RequestUrl = miConfig.Url
|
286
|
316
|
struct3507.SecretKey = miConfig.SecretKey
|
287
|
317
|
struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
288
|
318
|
struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
319
|
+
|
|
320
|
+ struct3507.Url = miConfig.Url
|
|
321
|
+ struct3507.AppId = miConfig.Cainfo
|
|
322
|
+ struct3507.AppSecret = miConfig.AppSecret
|
|
323
|
+ struct3507.Enckey = miConfig.EncKey
|
|
324
|
+ struct3507.SignKey = miConfig.SignKey
|
|
325
|
+ struct3507.SecretKey = miConfig.SecretKey
|
289
|
326
|
service.FJyb3507(struct3507)
|
290
|
327
|
|
291
|
328
|
var struct3507_2 models.Struct3507
|
|
@@ -295,6 +332,14 @@ func (c *HisApiController) DeletePCandBG() {
|
295
|
332
|
struct3507_2.SecretKey = miConfig.SecretKey
|
296
|
333
|
struct3507_2.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
297
|
334
|
struct3507_2.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
335
|
+
|
|
336
|
+ struct3507_2.Url = miConfig.Url
|
|
337
|
+ struct3507_2.AppId = miConfig.Cainfo
|
|
338
|
+ struct3507_2.AppSecret = miConfig.AppSecret
|
|
339
|
+ struct3507_2.Enckey = miConfig.EncKey
|
|
340
|
+ struct3507_2.SignKey = miConfig.SignKey
|
|
341
|
+ struct3507_2.SecretKey = miConfig.SecretKey
|
|
342
|
+
|
298
|
343
|
struct3507_2.FixmedinsBchno = ""
|
299
|
344
|
struct3507_2.InvDataType = "2"
|
300
|
345
|
service.FJyb3507(struct3507_2)
|
|
@@ -307,6 +352,13 @@ func (c *HisApiController) DeletePCandBG() {
|
307
|
352
|
struct3507.SecretKey = miConfig.SecretKey
|
308
|
353
|
struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
309
|
354
|
struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
355
|
+
|
|
356
|
+ struct3507.Url = miConfig.Url
|
|
357
|
+ struct3507.AppId = miConfig.Cainfo
|
|
358
|
+ struct3507.AppSecret = miConfig.AppSecret
|
|
359
|
+ struct3507.Enckey = miConfig.EncKey
|
|
360
|
+ struct3507.SignKey = miConfig.SignKey
|
|
361
|
+ struct3507.SecretKey = miConfig.SecretKey
|
310
|
362
|
struct3507.FixmedinsBchno = ""
|
311
|
363
|
struct3507.InvDataType = "1"
|
312
|
364
|
service.FJyb3507(struct3507)
|
|
@@ -319,10 +371,13 @@ func (c *HisApiController) DeletePCandBG() {
|
319
|
371
|
func (c *HisApiController) DeleteXSandBG() {
|
320
|
372
|
ids := c.getString("ids")
|
321
|
373
|
id_arr := strings.Split(ids, ",")
|
|
374
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
375
|
+ roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
|
376
|
+
|
322
|
377
|
drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
|
323
|
378
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
324
|
379
|
for _, item := range drugs {
|
325
|
|
- if item.is == 1 && item.IsBg == 1 {
|
|
380
|
+ if item.IsPc == 1 && item.IsBg == 1 {
|
326
|
381
|
var struct3507 models.Struct3507
|
327
|
382
|
struct3507.FixmedinsBchno = ""
|
328
|
383
|
struct3507.InvDataType = "1"
|
|
@@ -332,6 +387,16 @@ func (c *HisApiController) DeleteXSandBG() {
|
332
|
387
|
struct3507.SecretKey = miConfig.SecretKey
|
333
|
388
|
struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
334
|
389
|
struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
390
|
+
|
|
391
|
+ struct3507.Url = miConfig.Url
|
|
392
|
+ struct3507.AppId = miConfig.Cainfo
|
|
393
|
+ struct3507.AppSecret = miConfig.AppSecret
|
|
394
|
+ struct3507.Enckey = miConfig.EncKey
|
|
395
|
+ struct3507.SignKey = miConfig.SignKey
|
|
396
|
+ struct3507.SecretKey = miConfig.SecretKey
|
|
397
|
+ struct3507.FixmedinsBchno = ""
|
|
398
|
+ struct3507.InvDataType = "1"
|
|
399
|
+
|
335
|
400
|
service.FJyb3507(struct3507)
|
336
|
401
|
|
337
|
402
|
var struct3507_2 models.Struct3507
|
|
@@ -343,6 +408,15 @@ func (c *HisApiController) DeleteXSandBG() {
|
343
|
408
|
struct3507_2.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
344
|
409
|
struct3507_2.FixmedinsBchno = ""
|
345
|
410
|
struct3507_2.InvDataType = "2"
|
|
411
|
+
|
|
412
|
+ struct3507_2.Url = miConfig.Url
|
|
413
|
+ struct3507_2.AppId = miConfig.Cainfo
|
|
414
|
+ struct3507_2.AppSecret = miConfig.AppSecret
|
|
415
|
+ struct3507_2.Enckey = miConfig.EncKey
|
|
416
|
+ struct3507_2.SignKey = miConfig.SignKey
|
|
417
|
+ struct3507_2.SecretKey = miConfig.SecretKey
|
|
418
|
+ struct3507_2.FixmedinsBchno = ""
|
|
419
|
+ struct3507_2.InvDataType = "1"
|
346
|
420
|
service.FJyb3507(struct3507_2)
|
347
|
421
|
}
|
348
|
422
|
if item.IsPc == 1 && item.IsBg == 0 {
|
|
@@ -439,6 +513,14 @@ func ChangeStock(count int64, drug models.HisDoctorAdviceInfo, miConfig models.M
|
439
|
513
|
struct3502.SecretKey = miConfig.SecretKey
|
440
|
514
|
struct3502.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
441
|
515
|
struct3502.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
516
|
+
|
|
517
|
+ struct3502.Url = miConfig.Url
|
|
518
|
+ struct3502.AppId = miConfig.Cainfo
|
|
519
|
+ struct3502.AppSecret = miConfig.AppSecret
|
|
520
|
+ struct3502.Enckey = miConfig.EncKey
|
|
521
|
+ struct3502.SignKey = miConfig.SignKey
|
|
522
|
+ struct3502.SecretKey = miConfig.SecretKey
|
|
523
|
+
|
442
|
524
|
struct3502.InvChgType = chgType
|
443
|
525
|
struct3502.FixmedinsBchno = ""
|
444
|
526
|
struct3502.Cnt = strconv.FormatInt(count, 10)
|
|
@@ -468,6 +550,14 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug models.HisDoctorAd
|
468
|
550
|
struct3505.ExpyEnd = ""
|
469
|
551
|
struct3505.RxFlag = "0"
|
470
|
552
|
struct3505.TrdnFlag = "1"
|
|
553
|
+
|
|
554
|
+ struct3505.Url = miConfig.Url
|
|
555
|
+ struct3505.AppId = miConfig.Cainfo
|
|
556
|
+ struct3505.AppSecret = miConfig.AppSecret
|
|
557
|
+ struct3505.Enckey = miConfig.EncKey
|
|
558
|
+ struct3505.SignKey = miConfig.SignKey
|
|
559
|
+ struct3505.SecretKey = miConfig.SecretKey
|
|
560
|
+
|
471
|
561
|
struct3505.RtalDocno = order.Number
|
472
|
562
|
strValue := fmt.Sprintf("%.2f", drug.PrescribingNumber)
|
473
|
563
|
struct3505.SelRetnCnt = strValue
|
|
@@ -518,6 +608,14 @@ func CancleSaleStock(org_id int64, pre models.HisPrescription, drug models.HisDo
|
518
|
608
|
struct3506.SecretKey = miConfig.SecretKey
|
519
|
609
|
struct3506.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
520
|
610
|
struct3506.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
611
|
+
|
|
612
|
+ struct3506.Url = miConfig.Url
|
|
613
|
+ struct3506.AppId = miConfig.Cainfo
|
|
614
|
+ struct3506.AppSecret = miConfig.AppSecret
|
|
615
|
+ struct3506.Enckey = miConfig.EncKey
|
|
616
|
+ struct3506.SignKey = miConfig.SignKey
|
|
617
|
+ struct3506.SecretKey = miConfig.SecretKey
|
|
618
|
+
|
521
|
619
|
result1, result2, result3 := service.FJyb3506(struct3506)
|
522
|
620
|
fmt.Println(result1)
|
523
|
621
|
fmt.Println(result2)
|