|
@@ -3,6 +3,7 @@ package service
|
3
|
3
|
import (
|
4
|
4
|
"bytes"
|
5
|
5
|
"encoding/json"
|
|
6
|
+ "fmt"
|
6
|
7
|
"gdyb/models"
|
7
|
8
|
"gdyb/utils"
|
8
|
9
|
"github.com/astaxie/beego"
|
|
@@ -68,13 +69,17 @@ func AutoCreateStock() {
|
68
|
69
|
var NewDrugWarehouseOut []*models.NewDrugWarehouseOutInfo
|
69
|
70
|
var NewDrugCancelStock []*models.NewDrugCancelStockInfo
|
70
|
71
|
|
71
|
|
- readDb.Model(&models.NewWarehousingInfo{}).Where("user_org_id = ? and status = 1 and is_upload <> 1", org_id).Preload("GoodInfo", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewWarehousing)
|
72
|
|
- readDb.Model(&models.NewWarehouseOutInfo{}).Where("user_org_id = ? and status = 1 and is_upload <> 1", org_id).Preload("GoodInfo", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewWarehouseOut)
|
73
|
|
- readDb.Model(&models.NewCancelStockInfo{}).Where("user_org_id = ? and status = 1 and is_upload <> 1", org_id).Preload("GoodInfo", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewCancelStock)
|
|
72
|
+ //readDb.Model(&models.NewWarehousingInfo{}).Where("org_id = ? and status = 1 and is_upload <> 1", org_id).Preload("GoodInfo", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).First(&NewWarehousing)
|
|
73
|
+ //readDb.Model(&models.NewWarehouseOutInfo{}).Where("user_org_id = ? and status = 1 and is_upload <> 1", org_id).Preload("GoodInfo", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewWarehouseOut)
|
|
74
|
+ //readDb.Model(&models.NewCancelStockInfo{}).Where("user_org_id = ? and status = 1 and is_upload <> 1", org_id).Preload("GoodInfo", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewCancelStock)
|
74
|
75
|
|
75
|
|
- readDb.Model(&models.NewDrugWarehouseInfo{}).Where("user_org_id = ? and status = 1 and is_upload <> 1", org_id).Preload("BaseDrugLib", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewDrugWarehouse)
|
76
|
|
- readDb.Model(&models.NewDrugWarehouseOutInfo{}).Where("user_org_id = ? and status = 1 and is_upload <> 1", org_id).Preload("BaseDrugLib", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewDrugWarehouseOut)
|
77
|
|
- readDb.Model(&models.NewDrugCancelStockInfo{}).Where("user_org_id = ? and status = 1 and is_upload <> 1", org_id).Preload("BaseDrugLib", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewDrugCancelStock)
|
|
76
|
+ //readDb.Model(&models.NewDrugWarehouseInfo{}).Where("org_id = ? and status = 1 and is_upload <> 1 AND id >= 4778", org_id).Preload("BaseDrugLib", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewDrugWarehouse)
|
|
77
|
+ //readDb.Model(&models.NewDrugWarehouseOutInfo{}).Where("org_id = ? and status = 1 and is_upload <> 1 AND id >= 360136", org_id).Preload("NewDrugWarehouseInfo","status = 1").Preload("BaseDrugLib", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewDrugWarehouseOut)
|
|
78
|
+ //readDb.Model(&models.NewDrugCancelStockInfo{}).Where("user_org_id = ? and status = 1 and is_upload <> 1 AND id >= 4778", org_id).Preload("BaseDrugLib", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewDrugCancelStock)
|
|
79
|
+
|
|
80
|
+ //readDb.Model(&models.NewDrugWarehouseInfo{}).Where("org_id = ? and status = 1 and is_upload <> 1 AND id >= 5720", org_id).Preload("BaseDrugLib", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewDrugWarehouse)
|
|
81
|
+ //readDb.Model(&models.NewDrugWarehouseOutInfo{}).Where("org_id = ? and status = 1 and is_upload <> 1 AND id >= 366003", org_id).Preload("NewDrugWarehouseInfo","status = 1").Preload("BaseDrugLib", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewDrugWarehouseOut)
|
|
82
|
+ //readDb.Model(&models.NewDrugCancelStockInfo{}).Where("org_id = ? and status = 1 and is_upload <> 1 ", org_id).Preload("BaseDrugLib", "status = 1").Preload("Manufacturers", "status = 1 AND org_id = ?", org_id).Preload("Dealers", "status = 1 AND org_id = ?", org_id).Find(&NewDrugCancelStock)
|
78
|
83
|
|
79
|
84
|
for _, item := range NewWarehousing {
|
80
|
85
|
res := Post3503ForGoodInfo(org_id, item)
|
|
@@ -149,7 +154,7 @@ func AutoCreateStock() {
|
149
|
154
|
|
150
|
155
|
//采购
|
151
|
156
|
func Post3503ForGoodInfo(org_id int64, infos *models.NewWarehousingInfo) ResultSix {
|
152
|
|
-
|
|
157
|
+ fmt.Println(&infos)
|
153
|
158
|
var res ResultSix
|
154
|
159
|
miConfig, _ := FindMedicalInsuranceInfo(org_id)
|
155
|
160
|
data := make(map[string]interface{})
|
|
@@ -157,32 +162,48 @@ func Post3503ForGoodInfo(org_id int64, infos *models.NewWarehousingInfo) ResultS
|
157
|
162
|
var struct3503 models.Struct3503
|
158
|
163
|
struct3503.MedListCodg = infos.GoodInfo.MedicalInsuranceNumber
|
159
|
164
|
struct3503.FixmedinsHilistId = miConfig.Code
|
|
165
|
+ struct3503.FixmedinsCode = miConfig.Code
|
160
|
166
|
struct3503.FixmedinsHilistName = miConfig.OrgName
|
161
|
167
|
struct3503.FixmedinsBchno = infos.Number
|
162
|
|
- struct3503.SplerName = infos.Dealers.DealerName
|
|
168
|
+ var d models.Dealers
|
|
169
|
+ readDb.Model(&models.Dealers{}).Where("id = ?", infos.Dealer).First(&d)
|
|
170
|
+ if d.ID == 0 {
|
|
171
|
+ struct3503.SplerName = infos.Manufacturers.ManufacturerName
|
|
172
|
+ } else {
|
|
173
|
+ struct3503.SplerName = d.DealerName
|
|
174
|
+ }
|
163
|
175
|
struct3503.ManuLotnum = infos.Number
|
164
|
176
|
struct3503.ProdentpName = infos.Manufacturers.ManufacturerName
|
165
|
|
- struct3503.Aprvno = infos.LicenseNumber
|
166
|
|
- struct3503.ManuDate = time.Unix(infos.ProductDate, 0).Format("2006-01-02 15:04:05")
|
167
|
|
- struct3503.ExpyEnd = time.Unix(infos.ExpiryDate, 0).Format("2006-01-02 15:04:05")
|
|
177
|
+ struct3503.Aprvno = infos.GoodInfo.Number
|
|
178
|
+ struct3503.ManuDate = time.Unix(infos.ProductDate, 0).Format("2006-01-02")
|
|
179
|
+ struct3503.ExpyEnd = time.Unix(infos.ExpiryDate, 0).Format("2006-01-02")
|
168
|
180
|
struct3503.PurcRetnCnt = strconv.FormatInt(infos.TotalCount, 10)
|
169
|
181
|
struct3503.RxFlag = "0"
|
170
|
|
- struct3503.PurcRetnStoinTime = time.Unix(infos.Ctime, 0).Format("2006-01-02 15:04:05")
|
171
|
|
- struct3503.PurcRetnOpterName = "仓管员"
|
|
182
|
+ struct3503.PurcRetnStoinTime = time.Unix(infos.Ctime, 0).Format("2006-01-02")
|
|
183
|
+ if org_id == 10217 {
|
|
184
|
+ struct3503.PurcRetnOpterName = "施实芹"
|
|
185
|
+ } else {
|
|
186
|
+ struct3503.PurcRetnOpterName = ""
|
|
187
|
+ }
|
172
|
188
|
struct3503.OrgName = miConfig.OrgName
|
173
|
189
|
struct3503.AccessKey = miConfig.AccessKey
|
174
|
190
|
struct3503.RequestUrl = miConfig.Url
|
175
|
191
|
struct3503.SecretKey = miConfig.SecretKey
|
|
192
|
+ struct3503.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
193
|
+ struct3503.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
176
|
194
|
struct3503.Memo = ""
|
177
|
195
|
struct3503s = append(struct3503s, struct3503)
|
178
|
|
- data["struct_3501s"] = struct3503s
|
|
196
|
+ data["struct_3503s"] = struct3503s[0]
|
|
197
|
+
|
179
|
198
|
client := &http.Client{}
|
180
|
199
|
bytesData, _ := json.Marshal(data)
|
|
200
|
+ fmt.Println(string(bytesData))
|
181
|
201
|
var req *http.Request
|
182
|
202
|
|
183
|
203
|
if miConfig.MdtrtareaAdmvs == "320921" {
|
184
|
204
|
req, _ = http.NewRequest("POST", "http://192.168.2.110:9532/"+"jsyb/3503", bytes.NewReader(bytesData))
|
185
|
205
|
} else {
|
|
206
|
+ fmt.Println("111111")
|
186
|
207
|
req, _ = http.NewRequest("POST", "http://192.168.5.251:9532/"+"jsyb/3503", bytes.NewReader(bytesData))
|
187
|
208
|
}
|
188
|
209
|
|
|
@@ -223,29 +244,37 @@ func Post3503ForDrug(org_id int64, infos *models.NewDrugWarehouseInfo) ResultSix
|
223
|
244
|
var res ResultSix
|
224
|
245
|
miConfig, _ := FindMedicalInsuranceInfo(org_id)
|
225
|
246
|
data := make(map[string]interface{})
|
226
|
|
- var struct3501s []models.Struct3503
|
227
|
|
- var struct3501 models.Struct3503
|
228
|
|
- struct3501.MedListCodg = infos.BaseDrugLib.MedicalInsuranceNumber
|
229
|
|
- struct3501.FixmedinsHilistId = miConfig.Code
|
230
|
|
- struct3501.FixmedinsHilistName = miConfig.OrgName
|
231
|
|
- struct3501.FixmedinsBchno = infos.BatchNumber
|
232
|
|
- struct3501.SplerName = infos.Dealers.DealerName
|
233
|
|
- struct3501.ManuLotnum = infos.BatchNumber
|
234
|
|
- struct3501.ProdentpName = infos.Manufacturers.ManufacturerName
|
235
|
|
- struct3501.Aprvno = infos.BaseDrugLib.Number
|
236
|
|
- struct3501.ManuDate = time.Unix(infos.ProductDate, 0).Format("2006-01-02 15:04:05")
|
237
|
|
- struct3501.ExpyEnd = time.Unix(infos.ExpiryDate, 0).Format("2006-01-02 15:04:05")
|
238
|
|
- struct3501.PurcRetnCnt = strconv.FormatInt(infos.WarehousingCount, 10)
|
239
|
|
- struct3501.RxFlag = "0"
|
240
|
|
- struct3501.PurcRetnStoinTime = time.Unix(infos.Ctime, 0).Format("2006-01-02 15:04:05")
|
241
|
|
- struct3501.PurcRetnOpterName = "仓管员"
|
242
|
|
- struct3501.OrgName = miConfig.OrgName
|
243
|
|
- struct3501.AccessKey = miConfig.AccessKey
|
244
|
|
- struct3501.RequestUrl = miConfig.Url
|
245
|
|
- struct3501.SecretKey = miConfig.SecretKey
|
246
|
|
- struct3501.Memo = ""
|
247
|
|
- struct3501s = append(struct3501s, struct3501)
|
248
|
|
- data["struct_3501s"] = struct3501s
|
|
247
|
+ var struct3503s []models.Struct3503
|
|
248
|
+ var struct3503 models.Struct3503
|
|
249
|
+ struct3503.MedListCodg = infos.BaseDrugLib.MedicalInsuranceNumber
|
|
250
|
+ struct3503.FixmedinsHilistId = miConfig.Code
|
|
251
|
+ struct3503.FixmedinsHilistName = miConfig.OrgName
|
|
252
|
+ struct3503.FixmedinsBchno = infos.BatchNumber
|
|
253
|
+ var d models.Dealers
|
|
254
|
+ readDb.Model(&models.Dealers{}).Where("id = ?", infos.Dealer).First(&d)
|
|
255
|
+ struct3503.SplerName = d.DealerName
|
|
256
|
+ struct3503.ManuLotnum = infos.BatchNumber
|
|
257
|
+ struct3503.ProdentpName = infos.Manufacturers.ManufacturerName
|
|
258
|
+ struct3503.Aprvno = infos.BaseDrugLib.Number
|
|
259
|
+ struct3503.ManuDate = time.Unix(infos.ProductDate, 0).Format("2006-01-02 15:04:05")
|
|
260
|
+ struct3503.ExpyEnd = time.Unix(infos.ExpiryDate, 0).Format("2006-01-02 15:04:05")
|
|
261
|
+ struct3503.PurcRetnCnt = strconv.FormatInt(infos.WarehousingCount, 10)
|
|
262
|
+ struct3503.RxFlag = "0"
|
|
263
|
+ struct3503.PurcRetnStoinTime = time.Unix(infos.Ctime, 0).Format("2006-01-02 15:04:05")
|
|
264
|
+ if org_id == 10217 {
|
|
265
|
+ struct3503.PurcRetnOpterName = "施实芹"
|
|
266
|
+ } else {
|
|
267
|
+ struct3503.PurcRetnOpterName = "顾林玲"
|
|
268
|
+ }
|
|
269
|
+ struct3503.OrgName = miConfig.OrgName
|
|
270
|
+ struct3503.AccessKey = miConfig.AccessKey
|
|
271
|
+ struct3503.RequestUrl = miConfig.Url
|
|
272
|
+ struct3503.SecretKey = miConfig.SecretKey
|
|
273
|
+ struct3503.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
274
|
+ struct3503.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
275
|
+ struct3503.Memo = ""
|
|
276
|
+ struct3503s = append(struct3503s, struct3503)
|
|
277
|
+ data["struct_3503s"] = struct3503s[0]
|
249
|
278
|
client := &http.Client{}
|
250
|
279
|
bytesData, _ := json.Marshal(data)
|
251
|
280
|
var req *http.Request
|
|
@@ -384,46 +413,57 @@ func Post3505ForDrug(org_id int64, infos *models.NewDrugWarehouseOutInfo) Result
|
384
|
413
|
|
385
|
414
|
miConfig, _ := FindMedicalInsuranceInfo(org_id)
|
386
|
415
|
data := make(map[string]interface{})
|
387
|
|
- var struct3501s []models.Struct3505
|
388
|
|
- var struct3501 models.Struct3505
|
389
|
|
-
|
390
|
|
- struct3501.OrgName = miConfig.OrgName
|
391
|
|
- struct3501.AccessKey = miConfig.AccessKey
|
392
|
|
- struct3501.RequestUrl = miConfig.Url
|
393
|
|
- struct3501.SecretKey = miConfig.SecretKey
|
394
|
|
-
|
395
|
|
- struct3501.MedListCodg = infos.BaseDrugLib.MedicalInsuranceNumber
|
396
|
|
- struct3501.FixmedinsHilistId = miConfig.Code
|
397
|
|
- struct3501.FixmedinsHilistName = miConfig.OrgName
|
398
|
|
- struct3501.FixmedinsBchno = infos.BatchNumber
|
|
416
|
+ var struct3505s []models.Struct3505
|
|
417
|
+ var struct3505 models.Struct3505
|
|
418
|
+ struct3505.MedListCodg = infos.BaseDrugLib.MedicalInsuranceNumber
|
|
419
|
+ struct3505.FixmedinsHilistId = miConfig.Code
|
|
420
|
+ struct3505.FixmedinsHilistName = miConfig.OrgName
|
|
421
|
+ struct3505.FixmedinsBchno = infos.NewDrugWarehouseInfo.BatchNumber
|
|
422
|
+ struct3505.FixmedinsCode = miConfig.Code
|
|
423
|
+
|
|
424
|
+ struct3505.OrgName = miConfig.OrgName
|
|
425
|
+ struct3505.AccessKey = miConfig.AccessKey
|
|
426
|
+ struct3505.RequestUrl = miConfig.Url
|
|
427
|
+ struct3505.SecretKey = miConfig.SecretKey
|
|
428
|
+ struct3505.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
429
|
+ struct3505.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
430
|
+
|
|
431
|
+ struct3505.FixmedinsBchno = infos.NewDrugWarehouseInfo.BatchNumber
|
399
|
432
|
if org_id == 10188 {
|
400
|
|
- struct3501.PrscDrName = "王曙光"
|
401
|
|
- struct3501.PharName = "王曙光"
|
402
|
|
- struct3501.PharPracCertNo = ""
|
|
433
|
+ struct3505.PrscDrName = "王曙光"
|
|
434
|
+ struct3505.PharName = "顾林玲"
|
|
435
|
+ struct3505.PharPracCertNo = "K0404020449"
|
403
|
436
|
|
404
|
437
|
} else if org_id == 10217 {
|
405
|
|
- struct3501.PrscDrName = "王云刚"
|
406
|
|
- struct3501.PharName = "王云刚"
|
407
|
|
- struct3501.PharPracCertNo = ""
|
|
438
|
+ struct3505.PrscDrName = "王云刚"
|
|
439
|
+ struct3505.PharName = "施实芹"
|
|
440
|
+ struct3505.PharPracCertNo = "1532050832051512010002"
|
408
|
441
|
}
|
409
|
442
|
timestamp := time.Now().Unix()
|
410
|
443
|
tempTime := time.Unix(timestamp, 0)
|
411
|
444
|
timeFormat := tempTime.Format("20060102150405")
|
412
|
445
|
chrgBchno := rand.Intn(100000) + 10000
|
413
|
446
|
ipt_otp_no := timeFormat + strconv.FormatInt(int64(chrgBchno), 10)
|
414
|
|
- struct3501.MdtrtSn = ipt_otp_no
|
415
|
|
- struct3501.ManuLotnum = infos.BatchNumber
|
416
|
|
- struct3501.ManuDate = time.Unix(infos.ProductDate, 0).Format("2006-01-02 15:04:05")
|
417
|
|
- struct3501.ExpyEnd = time.Unix(infos.ExpiryDate, 0).Format("2006-01-02 15:04:05")
|
418
|
|
- struct3501.RxFlag = "0"
|
419
|
|
- struct3501.TrdnFlag = "1"
|
420
|
|
- struct3501.RtalDocno = strconv.FormatInt(int64(infos.ID), 10)
|
421
|
|
- struct3501.SelRetnCnt = strconv.FormatInt(int64(infos.Count), 10)
|
422
|
|
- struct3501.SelRetnTime = time.Unix(infos.Ctime, 0).Format("2006-01-02 15:04:05")
|
423
|
|
- struct3501.SelRetnOpterName = "仓管员"
|
|
447
|
+ struct3505.MdtrtSn = ipt_otp_no
|
|
448
|
+ struct3505.ManuLotnum = infos.NewDrugWarehouseInfo.BatchNumber
|
|
449
|
+ struct3505.ManuDate = time.Unix(infos.ProductDate, 0).Format("2006-01-02 15:04:05")
|
|
450
|
+ //struct3505.ExpyEnd = time.Unix(infos.ExpiryDate, 0).Format("2006-01-02 15:04:05")
|
|
451
|
+ struct3505.RxFlag = "0"
|
|
452
|
+ struct3505.TrdnFlag = "1"
|
|
453
|
+ struct3505.RtalDocno = strconv.FormatInt(int64(infos.ID), 10)
|
|
454
|
+ struct3505.SelRetnCnt = strconv.FormatInt(int64(infos.Count), 10)
|
|
455
|
+ struct3505.SelRetnTime = time.Unix(infos.Ctime, 0).Format("2006-01-02 15:04:05")
|
424
|
456
|
|
425
|
|
- struct3501s = append(struct3501s, struct3501)
|
426
|
|
- data["struct_3501s"] = struct3501s
|
|
457
|
+ if org_id == 10188 {
|
|
458
|
+ struct3505.SelRetnOpterName = "孙欣欣"
|
|
459
|
+
|
|
460
|
+ } else if org_id == 10217 {
|
|
461
|
+ struct3505.SelRetnOpterName = "晁海燕"
|
|
462
|
+
|
|
463
|
+ }
|
|
464
|
+
|
|
465
|
+ struct3505s = append(struct3505s, struct3505)
|
|
466
|
+ data["struct_3505s"] = struct3505s[0]
|
427
|
467
|
client := &http.Client{}
|
428
|
468
|
bytesData, _ := json.Marshal(data)
|
429
|
469
|
var req *http.Request
|
|
@@ -473,37 +513,44 @@ func Post3506ForGoodInfo(org_id int64, infos *models.NewCancelStockInfo) ResultS
|
473
|
513
|
var res ResultSix
|
474
|
514
|
miConfig, _ := FindMedicalInsuranceInfo(org_id)
|
475
|
515
|
data := make(map[string]interface{})
|
476
|
|
- var struct3501s []models.Struct3506
|
477
|
|
- var struct3501 models.Struct3506
|
478
|
|
-
|
479
|
|
- struct3501.OrgName = miConfig.OrgName
|
480
|
|
- struct3501.AccessKey = miConfig.AccessKey
|
481
|
|
- struct3501.RequestUrl = miConfig.Url
|
482
|
|
- struct3501.SecretKey = miConfig.SecretKey
|
483
|
|
- struct3501.MedListCodg = infos.GoodInfo.MedicalInsuranceNumber
|
484
|
|
- struct3501.FixmedinsHilistId = miConfig.Code
|
485
|
|
- struct3501.FixmedinsHilistName = miConfig.OrgName
|
486
|
|
- struct3501.FixmedinsBchno = infos.Number
|
487
|
|
- struct3501.ManuLotnum = infos.Number
|
488
|
|
- struct3501.ManuDate = time.Unix(infos.ProductDate, 0).Format("2006-01-02 15:04:05")
|
|
516
|
+ var struct3506s []models.Struct3506
|
|
517
|
+ var struct3506 models.Struct3506
|
|
518
|
+
|
|
519
|
+ struct3506.OrgName = miConfig.OrgName
|
|
520
|
+ struct3506.AccessKey = miConfig.AccessKey
|
|
521
|
+ struct3506.RequestUrl = miConfig.Url
|
|
522
|
+ struct3506.SecretKey = miConfig.SecretKey
|
|
523
|
+ struct3506.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
524
|
+ struct3506.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
525
|
+ struct3506.MedListCodg = infos.GoodInfo.MedicalInsuranceNumber
|
|
526
|
+ struct3506.FixmedinsHilistId = miConfig.Code
|
|
527
|
+ struct3506.FixmedinsHilistName = miConfig.OrgName
|
|
528
|
+ struct3506.FixmedinsBchno = infos.Number
|
|
529
|
+ struct3506.ManuLotnum = infos.Number
|
|
530
|
+ struct3506.ManuDate = time.Unix(infos.ProductDate, 0).Format("2006-01-02 15:04:05")
|
489
|
531
|
//struct3501.ExpyEnd = time.Unix(infos.ExpiryDate, 0).Format("2006-01-02 15:04:05")
|
490
|
|
- struct3501.RxFlag = "0"
|
491
|
|
- struct3501.TrdnFlag = "1"
|
492
|
|
- struct3501.SelRetnCnt = strconv.FormatInt(int64(infos.Count), 10)
|
493
|
|
- struct3501.SelRetnTime = time.Unix(infos.Ctime, 0).Format("2006-01-02 15:04:05")
|
494
|
|
- struct3501.SelRetnOpterName = "仓管员"
|
495
|
|
- struct3501.Memo = ""
|
|
532
|
+ struct3506.RxFlag = "0"
|
|
533
|
+ struct3506.TrdnFlag = "1"
|
|
534
|
+ struct3506.SelRetnCnt = strconv.FormatInt(int64(infos.Count), 10)
|
|
535
|
+ struct3506.SelRetnTime = time.Unix(infos.Ctime, 0).Format("2006-01-02 15:04:05")
|
|
536
|
+ //struct3506.SelRetnOpterName = "仓管员"
|
|
537
|
+ if org_id == 10188 {
|
|
538
|
+ struct3506.SelRetnOpterName = "孙欣欣"
|
|
539
|
+ } else if org_id == 10217 {
|
|
540
|
+ struct3506.SelRetnOpterName = "晁海燕"
|
|
541
|
+ }
|
|
542
|
+ struct3506.Memo = ""
|
496
|
543
|
|
497
|
|
- struct3501s = append(struct3501s, struct3501)
|
498
|
|
- data["struct_3501s"] = struct3501s
|
|
544
|
+ struct3506s = append(struct3506s, struct3506)
|
|
545
|
+ data["struct_3506s"] = struct3506s
|
499
|
546
|
client := &http.Client{}
|
500
|
547
|
bytesData, _ := json.Marshal(data)
|
501
|
548
|
var req *http.Request
|
502
|
549
|
|
503
|
550
|
if miConfig.MdtrtareaAdmvs == "320921" {
|
504
|
|
- req, _ = http.NewRequest("POST", "http://192.168.2.110:9532/"+"jsyb/3501", bytes.NewReader(bytesData))
|
|
551
|
+ req, _ = http.NewRequest("POST", "http://192.168.2.110:9532/"+"jsyb/3506", bytes.NewReader(bytesData))
|
505
|
552
|
} else {
|
506
|
|
- req, _ = http.NewRequest("POST", "http://192.168.5.251:9532/"+"jsyb/3501", bytes.NewReader(bytesData))
|
|
553
|
+ req, _ = http.NewRequest("POST", "http://192.168.5.251:9532/"+"jsyb/3506", bytes.NewReader(bytesData))
|
507
|
554
|
}
|
508
|
555
|
|
509
|
556
|
resp, _ := client.Do(req)
|
|
@@ -541,37 +588,46 @@ func Post3506ForGoodInfo(org_id int64, infos *models.NewCancelStockInfo) ResultS
|
541
|
588
|
}
|
542
|
589
|
func Post3506ForDrug(org_id int64, infos *models.NewDrugCancelStockInfo) ResultSix {
|
543
|
590
|
var res ResultSix
|
544
|
|
-
|
545
|
591
|
miConfig, _ := FindMedicalInsuranceInfo(org_id)
|
546
|
592
|
data := make(map[string]interface{})
|
547
|
|
- var struct3501s []models.Struct3506
|
548
|
|
- var struct3501 models.Struct3506
|
549
|
|
- struct3501.OrgName = miConfig.OrgName
|
550
|
|
- struct3501.AccessKey = miConfig.AccessKey
|
551
|
|
- struct3501.RequestUrl = miConfig.Url
|
552
|
|
- struct3501.SecretKey = miConfig.SecretKey
|
553
|
|
- struct3501.MedListCodg = infos.BaseDrugLib.MedicalInsuranceNumber
|
554
|
|
- struct3501.FixmedinsHilistId = miConfig.Code
|
555
|
|
- struct3501.FixmedinsHilistName = miConfig.OrgName
|
556
|
|
- struct3501.FixmedinsBchno = infos.BatchNumber
|
557
|
|
- struct3501.ManuLotnum = infos.BatchNumber
|
558
|
|
- struct3501.ManuDate = time.Unix(infos.ProductDate, 0).Format("2006-01-02 15:04:05")
|
559
|
|
- struct3501.RxFlag = "0"
|
560
|
|
- struct3501.TrdnFlag = "1"
|
561
|
|
- struct3501.SelRetnCnt = strconv.FormatInt(int64(infos.Count), 10)
|
562
|
|
- struct3501.SelRetnTime = time.Unix(infos.Ctime, 0).Format("2006-01-02 15:04:05")
|
563
|
|
- struct3501.SelRetnOpterName = "仓管员"
|
564
|
|
- struct3501.Memo = ""
|
565
|
|
- struct3501s = append(struct3501s, struct3501)
|
566
|
|
- data["struct_3501s"] = struct3501s
|
|
593
|
+ var struct3506s []models.Struct3506
|
|
594
|
+ var struct3506 models.Struct3506
|
|
595
|
+ struct3506.FixmedinsCode = miConfig.Code
|
|
596
|
+ struct3506.OrgName = miConfig.OrgName
|
|
597
|
+ struct3506.AccessKey = miConfig.AccessKey
|
|
598
|
+ struct3506.RequestUrl = miConfig.Url
|
|
599
|
+ struct3506.SecretKey = miConfig.SecretKey
|
|
600
|
+ struct3506.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
601
|
+ struct3506.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
602
|
+ struct3506.MedListCodg = infos.BaseDrugLib.MedicalInsuranceNumber
|
|
603
|
+ struct3506.FixmedinsHilistId = miConfig.Code
|
|
604
|
+ struct3506.FixmedinsHilistName = miConfig.OrgName
|
|
605
|
+ struct3506.FixmedinsBchno = infos.BatchNumber
|
|
606
|
+ struct3506.ManuLotnum = infos.BatchNumber
|
|
607
|
+ struct3506.ManuDate = time.Unix(infos.ProductDate, 0).Format("2006-01-02 15:04:05")
|
|
608
|
+ //struct3501.ExpyEnd = time.Unix(infos.ExpiryDate, 0).Format("2006-01-02 15:04:05")
|
|
609
|
+ struct3506.RxFlag = "0"
|
|
610
|
+ struct3506.TrdnFlag = "1"
|
|
611
|
+ struct3506.SelRetnCnt = strconv.FormatInt(int64(infos.Count), 10)
|
|
612
|
+ struct3506.SelRetnTime = time.Unix(infos.Ctime, 0).Format("2006-01-02 15:04:05")
|
|
613
|
+ //struct3506.SelRetnOpterName = "仓管员"
|
|
614
|
+ if org_id == 10188 {
|
|
615
|
+ struct3506.SelRetnOpterName = "孙欣欣"
|
|
616
|
+ } else if org_id == 10217 {
|
|
617
|
+ struct3506.SelRetnOpterName = "晁海燕"
|
|
618
|
+ }
|
|
619
|
+ struct3506.Memo = ""
|
|
620
|
+
|
|
621
|
+ struct3506s = append(struct3506s, struct3506)
|
|
622
|
+ data["struct_3506s"] = struct3506s[0]
|
567
|
623
|
client := &http.Client{}
|
568
|
624
|
bytesData, _ := json.Marshal(data)
|
569
|
625
|
var req *http.Request
|
570
|
626
|
|
571
|
627
|
if miConfig.MdtrtareaAdmvs == "320921" {
|
572
|
|
- req, _ = http.NewRequest("POST", "http://192.168.2.110:9532/"+"jsyb/3501", bytes.NewReader(bytesData))
|
|
628
|
+ req, _ = http.NewRequest("POST", "http://192.168.2.110:9532/"+"jsyb/3506", bytes.NewReader(bytesData))
|
573
|
629
|
} else {
|
574
|
|
- req, _ = http.NewRequest("POST", "http://192.168.5.251:9532/"+"jsyb/3501", bytes.NewReader(bytesData))
|
|
630
|
+ req, _ = http.NewRequest("POST", "http://192.168.5.251:9532/"+"jsyb/3506", bytes.NewReader(bytesData))
|
575
|
631
|
}
|
576
|
632
|
|
577
|
633
|
resp, _ := client.Do(req)
|