test_user 5 months ago
parent
commit
ea78e95d6f
4 changed files with 84 additions and 79 deletions
  1. 71 70
      controllers/sg/his_api_controller.go
  2. 1 1
      models/new_stock_models.go
  3. 9 5
      service/fj_service.go
  4. 3 3
      service/his_service.go

+ 71 - 70
controllers/sg/his_api_controller.go View File

@@ -185,7 +185,7 @@ func HisManagerApiRegistRouters() {
185 185
 	beego.Router("/api/pc_bg", &HisApiController{}, "get:FJ3501AND3502")
186 186
 	//删除库盘和变更
187 187
 	beego.Router("/api/delete_pc_bg", &HisApiController{}, "get:DeletePCandBG")
188
-	beego.Router("/api/delete_xs_bg", &HisApiController{}, "get:DeleteXSandBG")
188
+	//beego.Router("/api/delete_xs_bg", &HisApiController{}, "get:DeleteXSandBG")
189 189
 	//药品变更
190 190
 	beego.Router("/api/changedrug", &HisApiController{}, "get:ChangeDrug")
191 191
 
@@ -537,74 +537,74 @@ func (c *HisApiController) DeletePCandBG() {
537 537
 
538 538
 }
539 539
 
540
-func (c *HisApiController) DeleteXSandBG() {
541
-	ids := c.GetString("ids")
542
-	id_arr := strings.Split(ids, ",")
543
-	admin_user_id, _ := c.GetInt64("admin_user_id")
544
-	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
545
-
546
-	drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
547
-	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
548
-	for _, item := range drugs {
549
-		if item.IsPc == 1 && item.IsBg == 1 {
550
-			var struct3507 models.Struct3507
551
-			struct3507.FixmedinsBchno =
552
-			struct3507.InvDataType = "1"
553
-			struct3507.Opter = roles.UserName
554
-			struct3507.OrgName = miConfig.OrgName
555
-			struct3507.AccessKey = miConfig.AccessKey
556
-			struct3507.RequestUrl = miConfig.Url
557
-			struct3507.SecretKey = miConfig.SecretKey
558
-			struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
559
-			struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
560
-
561
-			struct3507.Url = miConfig.Url
562
-			struct3507.AppId = miConfig.Cainfo
563
-			struct3507.AppSecret = miConfig.AppSecret
564
-			struct3507.Enckey = miConfig.EncKey
565
-			struct3507.SignKey = miConfig.SignKey
566
-			struct3507.SecretKey = miConfig.SecretKey
567
-			struct3507.FixmedinsBchno = ""
568
-			struct3507.InvDataType = "1"
569
-
570
-			service.FJyb3507(struct3507)
571
-
572
-			var struct3507_2 models.Struct3507
573
-			struct3507_2.OrgName = miConfig.OrgName
574
-			struct3507_2.AccessKey = miConfig.AccessKey
575
-			struct3507_2.RequestUrl = miConfig.Url
576
-			struct3507_2.SecretKey = miConfig.SecretKey
577
-			struct3507_2.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
578
-			struct3507_2.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
579
-			struct3507_2.FixmedinsBchno = ""
580
-			struct3507_2.InvDataType = "2"
581
-
582
-			struct3507_2.Url = miConfig.Url
583
-			struct3507_2.AppId = miConfig.Cainfo
584
-			struct3507_2.AppSecret = miConfig.AppSecret
585
-			struct3507_2.Enckey = miConfig.EncKey
586
-			struct3507_2.SignKey = miConfig.SignKey
587
-			struct3507_2.SecretKey = miConfig.SecretKey
588
-			struct3507_2.FixmedinsBchno = ""
589
-			struct3507_2.InvDataType = "1"
590
-			service.FJyb3507(struct3507_2)
591
-		}
592
-		if item.IsPc == 1 && item.IsBg == 0 {
593
-			var struct3507 models.Struct3507
594
-			struct3507.OrgName = miConfig.OrgName
595
-			struct3507.AccessKey = miConfig.AccessKey
596
-			struct3507.RequestUrl = miConfig.Url
597
-			struct3507.SecretKey = miConfig.SecretKey
598
-			struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
599
-			struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
600
-			struct3507.FixmedinsBchno = ""
601
-			struct3507.InvDataType = "1"
602
-			service.FJyb3507(struct3507)
603
-		}
604
-
605
-	}
606
-
607
-}
540
+//func (c *HisApiController) DeleteXSandBG() {
541
+//	ids := c.GetString("ids")
542
+//	id_arr := strings.Split(ids, ",")
543
+//	admin_user_id, _ := c.GetInt64("admin_user_id")
544
+//	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
545
+//
546
+//	drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
547
+//	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
548
+//	for _, item := range drugs {
549
+//		if item.IsPc == 1 && item.IsBg == 1 {
550
+//			var struct3507 models.Struct3507
551
+//			struct3507.FixmedinsBchno =item
552
+//			struct3507.InvDataType = "1"
553
+//			struct3507.Opter = roles.UserName
554
+//			struct3507.OrgName = miConfig.OrgName
555
+//			struct3507.AccessKey = miConfig.AccessKey
556
+//			struct3507.RequestUrl = miConfig.Url
557
+//			struct3507.SecretKey = miConfig.SecretKey
558
+//			struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
559
+//			struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
560
+//
561
+//			struct3507.Url = miConfig.Url
562
+//			struct3507.AppId = miConfig.Cainfo
563
+//			struct3507.AppSecret = miConfig.AppSecret
564
+//			struct3507.Enckey = miConfig.EncKey
565
+//			struct3507.SignKey = miConfig.SignKey
566
+//			struct3507.SecretKey = miConfig.SecretKey
567
+//			struct3507.FixmedinsBchno = ""
568
+//			struct3507.InvDataType = "1"
569
+//
570
+//			service.FJyb3507(struct3507)
571
+//
572
+//			var struct3507_2 models.Struct3507
573
+//			struct3507_2.OrgName = miConfig.OrgName
574
+//			struct3507_2.AccessKey = miConfig.AccessKey
575
+//			struct3507_2.RequestUrl = miConfig.Url
576
+//			struct3507_2.SecretKey = miConfig.SecretKey
577
+//			struct3507_2.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
578
+//			struct3507_2.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
579
+//			struct3507_2.FixmedinsBchno = ""
580
+//			struct3507_2.InvDataType = "2"
581
+//
582
+//			struct3507_2.Url = miConfig.Url
583
+//			struct3507_2.AppId = miConfig.Cainfo
584
+//			struct3507_2.AppSecret = miConfig.AppSecret
585
+//			struct3507_2.Enckey = miConfig.EncKey
586
+//			struct3507_2.SignKey = miConfig.SignKey
587
+//			struct3507_2.SecretKey = miConfig.SecretKey
588
+//			struct3507_2.FixmedinsBchno = ""
589
+//			struct3507_2.InvDataType = "1"
590
+//			service.FJyb3507(struct3507_2)
591
+//		}
592
+//		if item.IsPc == 1 && item.IsBg == 0 {
593
+//			var struct3507 models.Struct3507
594
+//			struct3507.OrgName = miConfig.OrgName
595
+//			struct3507.AccessKey = miConfig.AccessKey
596
+//			struct3507.RequestUrl = miConfig.Url
597
+//			struct3507.SecretKey = miConfig.SecretKey
598
+//			struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
599
+//			struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
600
+//			struct3507.FixmedinsBchno = ""
601
+//			struct3507.InvDataType = "1"
602
+//			service.FJyb3507(struct3507)
603
+//		}
604
+//
605
+//	}
606
+//
607
+//}
608 608
 
609 609
 func (c *HisApiController) ChangeDrug() {
610 610
 	ids := c.GetString("ids")
@@ -878,6 +878,7 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
878 878
 	struct3505.FixmedinsHilistId = miConfig.Code
879 879
 	struct3505.FixmedinsHilistName = miConfig.OrgName
880 880
 	struct3505.FixmedinsBchno = drug.NewDrugWarehouseInfo.Bchno
881
+	struct3505.Opter = role.UserName
881 882
 
882 883
 	struct3505.FixmedinsCode = miConfig.Code
883 884
 	roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
@@ -888,7 +889,7 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
888 889
 	struct3505.SetlId = order.SetlId
889 890
 	struct3505.MdtrtSn = order.MdtrtId
890 891
 	struct3505.ManuLotnum = drug.Number
891
-	struct3505.ManuDate = time.Unix(drug.ProductDate, 0).Format("2006-01-02 15:04:05")
892
+	struct3505.ManuDate = time.Unix(drug.ProductDate, 0).Format("2006-01-02")
892 893
 	struct3505.ExpyEnd = ""
893 894
 	struct3505.RxFlag = "0"
894 895
 	struct3505.TrdnFlag = "1"

+ 1 - 1
models/new_stock_models.go View File

@@ -438,7 +438,7 @@ type DrugFlow struct {
438 438
 	OrderId                   int64                `gorm:"column:order_id" json:"order_id" form:"order_id"`
439 439
 	IsSale                    int64                `gorm:"column:is_sale" json:"is_sale" form:"is_sale"`
440 440
 	IsChange                  int64                `gorm:"column:is_change" json:"is_change" form:"is_change"`
441
-	NewDrugWarehouseInfo      NewDrugWarehouseInfo `gorm:"ForeignKey:ID;AssociationForeignKey:WarehousingId" json:"dw"`
441
+	NewDrugWarehouseInfo      NewDrugWarehouseInfo `gorm:"ForeignKey:ID;AssociationForeignKey:WarehousingDetailId" json:"dw"`
442 442
 	Bchno                     string               `gorm:"column:bchno" json:"bchno" form:"bchno"`
443 443
 	SaleDate                  string               `gorm:"column:sale_date" json:"sale_date" form:"sale_date"`
444 444
 }

+ 9 - 5
service/fj_service.go View File

@@ -3113,7 +3113,7 @@ func FJyb3505(struct3505 models.Struct3505) (string, string, string) {
3113 3113
 	input := make(map[string]interface{})
3114 3114
 	inputData := make(map[string]interface{})
3115 3115
 	druginputData := make(map[string]interface{})
3116
-	druginputData2 := make(map[string]interface{})
3116
+	//druginputData2 := make(map[string]interface{})
3117 3117
 
3118 3118
 	inputMessage["infno"] = "3505"                                  // 交易编码
3119 3119
 	inputData["med_list_codg"] = struct3505.MedListCodg             // 定点医药机构目录编号
@@ -3157,10 +3157,12 @@ func FJyb3505(struct3505 models.Struct3505) (string, string, string) {
3157 3157
 	inputData["sel_retn_cnt"] = struct3505.SelRetnCnt              // 人员编号 (来自1101接口返回)
3158 3158
 	inputData["sel_retn_time"] = struct3505.SelRetnTime            // 人员编号 (来自1101接口返回)
3159 3159
 	inputData["sel_retn_opter_name"] = struct3505.SelRetnOpterName // 人员编号 (来自1101接口返回)
3160
-	inputData["memo"] = struct3505.Memo                            // 人员编号 (来自1101接口返回)
3161
-	druginputData["drug_trac_codg"] = ""
3162
-	druginputData2["drugtracinfo"] = druginputData
3163
-	inputData["drug_trac_info"] = druginputData2
3160
+	inputData["memo"] = struct3505.Memo
3161
+	inputData["mdtrt_setl_type"] = struct3505.MdtrtSetlType                            // 人员编号 (来自1101接口返回)
3162
+	// 人员编号 (来自1101接口返回)
3163
+	//druginputData["drug_trac_codg"] = ""
3164
+	//druginputData2["drugtracinfo"] = druginputData
3165
+	inputData["drug_trac_info"] = druginputData
3164 3166
 
3165 3167
 	input["selinfo"] = inputData
3166 3168
 	inputMessage["input"] = input //交易输入
@@ -3235,6 +3237,8 @@ func FJyb3506(struct3506 models.Struct3506) (string, string, string) {
3235 3237
 	}
3236 3238
 
3237 3239
 	enc := mahonia.NewEncoder("gbk")
3240
+	return "", "", ""
3241
+
3238 3242
 	output, err_msg := GetFjBusinessHandleInfo([]byte(enc.ConvertString(string(bytesData))))
3239 3243
 	return output, requestLog, err_msg
3240 3244
 

+ 3 - 3
service/his_service.go View File

@@ -1709,9 +1709,9 @@ func GetNewDrugWarehouseInfo(id_arr []string) (newDrugWarehouse []*models.NewDru
1709 1709
 }
1710 1710
 
1711 1711
 func GetNewDrugFlowInfo(id_arr []string) (flows []*models.DrugFlow, err error) {
1712
-	err = readDb.Model(&models.DrugFlow{}).Where("org_id = ? and status = 1 and id in (?)", 10191, id_arr).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
1713
-		return db.Where("status = 1").Preload("BaseDrugLib", "status=1").Preload("NewDrugWarehouseInfo", "status = 1")
1714
-	}).Find(&flows).Error
1712
+	err = readDb.Model(&models.DrugFlow{}).Where("user_org_id = ? and status = 1 and id in (?)", 10191, id_arr).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
1713
+		return db.Where("status = 1").Preload("BaseDrugLib", "status=1")
1714
+	}).Preload("NewDrugWarehouseInfo", "status = 1").Find(&flows).Error
1715 1715
 	return
1716 1716
 }
1717 1717