|
@@ -323,7 +323,7 @@ func (c *HisApiController) FJ3501AND3502() {
|
323
|
323
|
struct3502.FixmedinsCode = miConfig.Code
|
324
|
324
|
struct3502.Opter = roles.UserName
|
325
|
325
|
struct3502.RxFlag = "0"
|
326
|
|
- struct3502.InvChgTime = time.Unix(drug.Ctime, 0).Format("2006-01-02 15:04:05")
|
|
326
|
+ struct3502.InvChgTime = time.Now().Format("2006-01-02")
|
327
|
327
|
struct3502.OrgName = miConfig.OrgName
|
328
|
328
|
struct3502.AccessKey = miConfig.AccessKey
|
329
|
329
|
struct3502.RequestUrl = miConfig.Url
|
|
@@ -548,7 +548,7 @@ func (c *HisApiController) DeleteXSandBG() {
|
548
|
548
|
for _, item := range drugs {
|
549
|
549
|
if item.IsPc == 1 && item.IsBg == 1 {
|
550
|
550
|
var struct3507 models.Struct3507
|
551
|
|
- struct3507.FixmedinsBchno = ""
|
|
551
|
+ struct3507.FixmedinsBchno =
|
552
|
552
|
struct3507.InvDataType = "1"
|
553
|
553
|
struct3507.Opter = roles.UserName
|
554
|
554
|
struct3507.OrgName = miConfig.OrgName
|
|
@@ -615,28 +615,115 @@ func (c *HisApiController) ChangeDrug() {
|
615
|
615
|
|
616
|
616
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
617
|
617
|
|
|
618
|
+ var err []string
|
618
|
619
|
for _, item := range flows {
|
|
620
|
+ var res3 ResultSix
|
619
|
621
|
if item.ConsumableType == 3 { //3为自动出库 7为自动退库
|
620
|
622
|
prescription := service.GetHisPrescriptionByID(item.HisDoctorAdviceInfo.PrescriptionId)
|
621
|
|
- if prescription.OrderStatus == 2 { //已经结算
|
|
623
|
+ if prescription.OrderStatus == 2 {
|
|
624
|
+ //已经结算
|
622
|
625
|
//判断是否已经销售
|
623
|
626
|
if item.IsSale == 1 { //是否已经销售,1是 0否
|
624
|
627
|
//是否已经变更 1是 0否
|
625
|
628
|
if item.IsChange == 0 { //没变更,进行变更操作
|
626
|
|
- ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102", roles)
|
|
629
|
+ result, result2 := ChangeStock(item.Count, item, miConfig, "107", roles)
|
|
630
|
+ saveLog(result, result2, "3502", "自动出库,已经销售,未变更3502")
|
|
631
|
+ var respJSON3 map[string]interface{}
|
|
632
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
633
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
634
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
635
|
+ return
|
|
636
|
+ }
|
|
637
|
+ userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
638
|
+ if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
639
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
640
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
641
|
+ return
|
|
642
|
+ }
|
|
643
|
+ if res3.Infcode != -1{
|
|
644
|
+ item.IsChange = 1
|
|
645
|
+ item.Bchno = item.NewDrugWarehouseInfo.Bchno
|
|
646
|
+ service.SaveDF(item)
|
|
647
|
+ }else{
|
|
648
|
+ err = append(err,item.HisDoctorAdviceInfo.AdviceName +",销售变更失败:"+res3.ErrMsg)
|
|
649
|
+ }
|
627
|
650
|
}
|
628
|
651
|
} else { //没销售,
|
629
|
|
- //进行商品销售接口
|
630
|
|
- SaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item.HisDoctorAdviceInfo, miConfig, "", roles)
|
|
652
|
+ var res FJ3507Result
|
631
|
653
|
|
632
|
|
- if item.IsChange == 0 { //没变更,进行变更操作
|
633
|
|
- ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102", roles)
|
|
654
|
+ //进行商品销售接口
|
|
655
|
+ result3, result4 := SaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item, miConfig, "", roles)
|
|
656
|
+ saveLog(result3, result4, "3505", "自动出库,未销售进行销售行为,3505")
|
|
657
|
+ var respJSON3 map[string]interface{}
|
|
658
|
+ if err := json.Unmarshal([]byte(string(result3)), &respJSON3); err != nil {
|
|
659
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
660
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
661
|
+ return
|
|
662
|
+ }
|
|
663
|
+ userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
664
|
+ if err := json.Unmarshal(userJSONBytes3, &res); err != nil {
|
|
665
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
666
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
667
|
+ return
|
|
668
|
+ }
|
|
669
|
+ if res.Infcode != -1 {
|
|
670
|
+ item.IsSale = 1
|
|
671
|
+ item.SaleDate = time.Now().Format("2006-01-02")
|
|
672
|
+ err5 := service.SaveDF(item)
|
|
673
|
+ if err5 == nil {
|
|
674
|
+ if item.IsChange == 0 { //没变更,进行变更操作
|
|
675
|
+ result, result2 := ChangeStock(item.Count, item, miConfig, "107", roles)
|
|
676
|
+ saveLog(result, result2, "3502", "自动出库,没销售,未变更3502")
|
|
677
|
+
|
|
678
|
+ var respJSON3 map[string]interface{}
|
|
679
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
680
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
681
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
682
|
+ return
|
|
683
|
+ }
|
|
684
|
+ userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
685
|
+ if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
686
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
687
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
688
|
+ return
|
|
689
|
+ }
|
|
690
|
+ if res3.Infcode != -1 {
|
|
691
|
+ item.IsChange = 1
|
|
692
|
+ item.Bchno = item.NewDrugWarehouseInfo.Bchno
|
|
693
|
+ service.SaveDF(item)
|
|
694
|
+ } else {
|
|
695
|
+ err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
|
696
|
+ }
|
|
697
|
+ }
|
|
698
|
+ }
|
|
699
|
+ }else{
|
|
700
|
+ err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售失败:"+res.ErrMsg)
|
634
|
701
|
}
|
635
|
702
|
}
|
636
|
703
|
} else { //还没结算
|
637
|
704
|
if item.IsChange == 0 { //没变更,进行变更操作
|
638
|
|
- ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102", roles)
|
|
705
|
+ result, result2 :=ChangeStock(item.Count, item, miConfig, "107", roles)
|
|
706
|
+ saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
639
|
707
|
|
|
708
|
+ var respJSON3 map[string]interface{}
|
|
709
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
710
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
711
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
712
|
+ return
|
|
713
|
+ }
|
|
714
|
+ userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
715
|
+ if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
716
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
717
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
718
|
+ return
|
|
719
|
+ }
|
|
720
|
+ if res3.Infcode != -1{
|
|
721
|
+ item.IsChange = 1
|
|
722
|
+ item.Bchno = item.NewDrugWarehouseInfo.Bchno
|
|
723
|
+ service.SaveDF(item)
|
|
724
|
+ }else{
|
|
725
|
+ err = append(err,item.HisDoctorAdviceInfo.AdviceName +",销售变更失败:"+res3.ErrMsg)
|
|
726
|
+ }
|
640
|
727
|
}
|
641
|
728
|
}
|
642
|
729
|
} else if item.ConsumableType == 7 {
|
|
@@ -648,97 +735,174 @@ func (c *HisApiController) ChangeDrug() {
|
648
|
735
|
if item.IsSale == 1 { //是否已经销售,1是 0否
|
649
|
736
|
//是否已经变更 1是 0否
|
650
|
737
|
if item.IsChange == 0 { //没变更,进行变更操作
|
651
|
|
- ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102", roles)
|
|
738
|
+ result, result2 :=ChangeStock(item.Count, item, miConfig, "107", roles)
|
|
739
|
+ saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
|
740
|
+
|
|
741
|
+ var respJSON3 map[string]interface{}
|
|
742
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
743
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
744
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
745
|
+ return
|
|
746
|
+ }
|
|
747
|
+ userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
748
|
+ if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
749
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
750
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
751
|
+ return
|
|
752
|
+ }
|
|
753
|
+ if res3.Infcode != -1{
|
|
754
|
+ item.IsChange = 1
|
|
755
|
+ item.Bchno = item.NewDrugWarehouseInfo.Bchno
|
|
756
|
+ service.SaveDF(item)
|
|
757
|
+ }else{
|
|
758
|
+ err = append(err,item.HisDoctorAdviceInfo.AdviceName +",销售变更失败:"+res3.ErrMsg)
|
|
759
|
+ }
|
652
|
760
|
}
|
653
|
761
|
} else { //没销售,
|
654
|
762
|
//进行商品销售退货接口
|
655
|
|
- CancleSaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item.HisDoctorAdviceInfo, miConfig, "")
|
|
763
|
+ result111, result222 := CancleSaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item, miConfig, "",roles)
|
|
764
|
+ saveLog(result111,result222,"3506","销售退货")
|
656
|
765
|
if item.IsChange == 0 { //没变更,进行变更操作
|
657
|
|
- ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102", roles)
|
|
766
|
+ result, result2 :=ChangeStock(item.Count, item, miConfig, "107", roles)
|
|
767
|
+ saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
|
768
|
+
|
|
769
|
+ var respJSON3 map[string]interface{}
|
|
770
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
771
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
772
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
773
|
+ return
|
|
774
|
+ }
|
|
775
|
+ userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
776
|
+ if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
777
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
778
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
779
|
+ return
|
|
780
|
+ }
|
|
781
|
+ if res3.Infcode != -1{
|
|
782
|
+ item.IsChange = 1
|
|
783
|
+ item.Bchno = item.NewDrugWarehouseInfo.Bchno
|
|
784
|
+ service.SaveDF(item)
|
|
785
|
+ }else{
|
|
786
|
+ err = append(err,item.HisDoctorAdviceInfo.AdviceName +",销售变更失败:"+res3.ErrMsg)
|
|
787
|
+ }
|
658
|
788
|
}
|
659
|
789
|
}
|
660
|
790
|
} else { //还没结算
|
661
|
791
|
if item.IsChange == 0 { //没变更,进行变更操作
|
662
|
|
- ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102", roles)
|
|
792
|
+ result, result2 := ChangeStock(item.Count, item, miConfig, "107", roles)
|
|
793
|
+ saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
|
794
|
+
|
|
795
|
+ var respJSON3 map[string]interface{}
|
|
796
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
797
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
798
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
799
|
+ return
|
|
800
|
+ }
|
|
801
|
+ userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
802
|
+ if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
803
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
804
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
805
|
+ return
|
|
806
|
+ }
|
|
807
|
+ if res3.Infcode != -1{
|
|
808
|
+ item.IsChange = 1
|
|
809
|
+ item.Bchno = item.NewDrugWarehouseInfo.Bchno
|
|
810
|
+ service.SaveDF(item)
|
|
811
|
+ }else{
|
|
812
|
+ err = append(err,item.HisDoctorAdviceInfo.AdviceName +",销售变更失败:"+res3.ErrMsg)
|
|
813
|
+ }
|
663
|
814
|
|
664
|
815
|
}
|
665
|
816
|
}
|
666
|
817
|
|
667
|
818
|
} else { //其他方式
|
668
|
819
|
if item.IsChange == 0 { //没变更,进行变更操作
|
669
|
|
- ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102", roles)
|
|
820
|
+ result, result2 := ChangeStock(item.Count, item, miConfig, "107", roles)
|
|
821
|
+ saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
|
822
|
+
|
|
823
|
+ var respJSON3 map[string]interface{}
|
|
824
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
825
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
826
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
827
|
+ return
|
|
828
|
+ }
|
|
829
|
+ userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
830
|
+ if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
831
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
832
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
833
|
+ return
|
|
834
|
+ }
|
|
835
|
+ if res3.Infcode != -1{
|
|
836
|
+ item.IsChange = 1
|
|
837
|
+ item.Bchno = item.NewDrugWarehouseInfo.Bchno
|
|
838
|
+ service.SaveDF(item)
|
|
839
|
+ }else{
|
|
840
|
+ err = append(err,item.HisDoctorAdviceInfo.AdviceName +",销售变更失败:"+res3.ErrMsg)
|
|
841
|
+ }
|
670
|
842
|
}
|
671
|
843
|
}
|
672
|
844
|
}
|
673
|
845
|
}
|
674
|
846
|
|
675
|
|
-func ChangeStock(count int64, drug models.HisDoctorAdviceInfo, miConfig models.MedicalInsuranceOrgConfig, chgType string, role models.UserAdminRole) {
|
|
847
|
+func ChangeStock(count int64, drug *models.DrugFlow, miConfig models.MedicalInsuranceOrgConfig, chgType string, role models.UserAdminRole) (string,string){
|
676
|
848
|
var struct3502 models.Struct3502
|
677
|
|
- struct3502.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
|
|
849
|
+ struct3502.MedListCodg = drug.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
|
678
|
850
|
struct3502.FixmedinsHilistId = miConfig.Code
|
679
|
851
|
struct3502.FixmedinsHilistName = miConfig.OrgName
|
680
|
852
|
struct3502.FixmedinsCode = miConfig.Code
|
681
|
853
|
struct3502.Opter = role.UserName
|
682
|
854
|
struct3502.RxFlag = "0"
|
683
|
|
- struct3502.InvChgTime = time.Unix(drug.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
|
855
|
+ struct3502.InvChgTime = time.Now().Format("2006-01-02")
|
684
|
856
|
struct3502.OrgName = miConfig.OrgName
|
685
|
857
|
struct3502.AccessKey = miConfig.AccessKey
|
686
|
858
|
struct3502.RequestUrl = miConfig.Url
|
687
|
859
|
struct3502.SecretKey = miConfig.SecretKey
|
688
|
860
|
struct3502.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
689
|
861
|
struct3502.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
690
|
|
-
|
691
|
862
|
struct3502.Url = miConfig.Url
|
692
|
863
|
struct3502.AppId = miConfig.Cainfo
|
693
|
864
|
struct3502.AppSecret = miConfig.AppSecret
|
694
|
865
|
struct3502.Enckey = miConfig.EncKey
|
695
|
866
|
struct3502.SignKey = miConfig.SignKey
|
696
|
867
|
struct3502.SecretKey = miConfig.SecretKey
|
697
|
|
-
|
698
|
868
|
struct3502.InvChgType = chgType
|
699
|
|
- struct3502.FixmedinsBchno = ""
|
|
869
|
+ struct3502.FixmedinsBchno = drug.NewDrugWarehouseInfo.Bchno
|
700
|
870
|
struct3502.Cnt = strconv.FormatInt(count, 10)
|
701
|
871
|
struct3502.Pric = fmt.Sprintf("%.2f", drug.Price)
|
702
|
|
- result1, result2, result3 := service.FJyb3502(struct3502)
|
703
|
|
- fmt.Println(result1)
|
704
|
|
- fmt.Println(result2)
|
705
|
|
- fmt.Println(result3)
|
706
|
|
-
|
|
872
|
+ result1, result2, _ := service.FJyb3502(struct3502)
|
|
873
|
+ return result1,result2
|
707
|
874
|
}
|
708
|
|
-func SaleStock(org_id int64, pre models.HisPrescription, drug models.HisDoctorAdviceInfo, miConfig models.MedicalInsuranceOrgConfig, chgType string, role models.UserAdminRole) {
|
|
875
|
+func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow, miConfig models.MedicalInsuranceOrgConfig, chgType string, role models.UserAdminRole) (string, string){
|
709
|
876
|
var struct3505 models.Struct3505
|
710
|
|
- struct3505.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
|
|
877
|
+ struct3505.MedListCodg = drug.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
|
711
|
878
|
struct3505.FixmedinsHilistId = miConfig.Code
|
712
|
879
|
struct3505.FixmedinsHilistName = miConfig.OrgName
|
|
880
|
+ struct3505.FixmedinsBchno = drug.NewDrugWarehouseInfo.Bchno
|
|
881
|
+
|
713
|
882
|
struct3505.FixmedinsCode = miConfig.Code
|
714
|
|
- struct3505.FixmedinsBchno = ""
|
715
|
883
|
roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
716
|
|
- struct3505.PrscDrName = roles.UserName
|
717
|
|
- struct3505.PharName = ""
|
718
|
|
- struct3505.PharPracCertNo = ""
|
|
884
|
+ struct3505.PrscDrName =roles.UserName
|
|
885
|
+ struct3505.PharName = "刘水山"
|
|
886
|
+ struct3505.PharPracCertNo = "2015026350260000002611351127"
|
719
|
887
|
order := service.GetHisOrderByNumber(pre.BatchNumber)
|
720
|
888
|
struct3505.SetlId = order.SetlId
|
721
|
889
|
struct3505.MdtrtSn = order.MdtrtId
|
722
|
|
- struct3505.ManuLotnum = ""
|
723
|
|
- struct3505.ManuDate = ""
|
|
890
|
+ struct3505.ManuLotnum = drug.Number
|
|
891
|
+ struct3505.ManuDate = time.Unix(drug.ProductDate, 0).Format("2006-01-02 15:04:05")
|
724
|
892
|
struct3505.ExpyEnd = ""
|
725
|
893
|
struct3505.RxFlag = "0"
|
726
|
894
|
struct3505.TrdnFlag = "1"
|
727
|
|
-
|
|
895
|
+ struct3505.RtalDocno = order.Number
|
728
|
896
|
struct3505.Url = miConfig.Url
|
729
|
897
|
struct3505.AppId = miConfig.Cainfo
|
730
|
898
|
struct3505.AppSecret = miConfig.AppSecret
|
731
|
899
|
struct3505.Enckey = miConfig.EncKey
|
732
|
900
|
struct3505.SignKey = miConfig.SignKey
|
733
|
901
|
struct3505.SecretKey = miConfig.SecretKey
|
734
|
|
-
|
735
|
|
- struct3505.RtalDocno = order.Number
|
736
|
|
- strValue := fmt.Sprintf("%.2f", drug.PrescribingNumber)
|
|
902
|
+ strValue := fmt.Sprintf("%.2f", drug.HisDoctorAdviceInfo.PrescribingNumber)
|
737
|
903
|
struct3505.SelRetnCnt = strValue
|
738
|
|
- struct3505.SelRetnTime = time.Unix(drug.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
739
|
|
- roles_two, _ := service.GetAdminUserInfoByID(org_id, order.Creator)
|
740
|
|
-
|
741
|
|
- struct3505.SelRetnOpterName = roles_two.UserName
|
|
904
|
+ struct3505.SelRetnTime = time.Unix(drug.HisDoctorAdviceInfo.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
|
905
|
+ struct3505.SelRetnOpterName = role.UserName
|
742
|
906
|
if order.IsMedicineInsurance == 1 {
|
743
|
907
|
struct3505.MdtrtSetlType = "1"
|
744
|
908
|
} else {
|
|
@@ -750,32 +914,30 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug models.HisDoctorAd
|
750
|
914
|
struct3505.SecretKey = miConfig.SecretKey
|
751
|
915
|
struct3505.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
752
|
916
|
struct3505.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
753
|
|
- result1, result2, result3 := service.FJyb3505(struct3505)
|
754
|
|
- fmt.Println(result1)
|
755
|
|
- fmt.Println(result2)
|
756
|
|
- fmt.Println(result3)
|
|
917
|
+ result1, result2, _ := service.FJyb3505(struct3505)
|
|
918
|
+ return result1,result2
|
757
|
919
|
|
758
|
920
|
}
|
759
|
|
-func CancleSaleStock(org_id int64, pre models.HisPrescription, drug models.HisDoctorAdviceInfo, miConfig models.MedicalInsuranceOrgConfig, chgType string) {
|
|
921
|
+func CancleSaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow, miConfig models.MedicalInsuranceOrgConfig, chgType string,role models.UserAdminRole) (string,string){
|
760
|
922
|
var struct3506 models.Struct3506
|
761
|
|
- struct3506.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
|
|
923
|
+ struct3506.MedListCodg = drug.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
|
762
|
924
|
struct3506.FixmedinsHilistId = miConfig.Code
|
763
|
925
|
struct3506.FixmedinsHilistName = miConfig.OrgName
|
764
|
926
|
struct3506.FixmedinsCode = miConfig.Code
|
765
|
|
- struct3506.FixmedinsBchno = ""
|
|
927
|
+ struct3506.FixmedinsBchno = drug.NewDrugWarehouseInfo.Bchno
|
|
928
|
+ struct3506.Opter = role.UserName
|
766
|
929
|
order := service.GetHisOrderByNumber(pre.BatchNumber)
|
767
|
|
- //roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
768
|
|
- struct3506.ManuLotnum = ""
|
769
|
|
- struct3506.ManuDate = ""
|
|
930
|
+ struct3506.ManuLotnum = drug.NewDrugWarehouseInfo.Number
|
|
931
|
+ struct3506.ManuDate = time.Unix(drug.ProductDate, 0).Format("2006-01-02")
|
770
|
932
|
struct3506.MdtrtSn = order.MdtrtId
|
771
|
933
|
struct3506.ExpyEnd = ""
|
772
|
934
|
struct3506.RxFlag = "0"
|
773
|
935
|
struct3506.TrdnFlag = "1"
|
774
|
|
- strValue := fmt.Sprintf("%.2f", drug.PrescribingNumber)
|
|
936
|
+ strValue := fmt.Sprintf("%.2f", drug.HisDoctorAdviceInfo.PrescribingNumber)
|
775
|
937
|
struct3506.SelRetnCnt = strValue
|
776
|
|
- struct3506.SelRetnTime = time.Unix(drug.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
777
|
|
- roles_two, _ := service.GetAdminUserInfoByID(org_id, order.Creator)
|
778
|
|
- struct3506.SelRetnOpterName = roles_two.UserName
|
|
938
|
+ struct3506.SelRetnTime = time.Unix(drug.HisDoctorAdviceInfo.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
|
939
|
+ //roles_two, _ := service.GetAdminUserInfoByID(org_id, order.Creator)
|
|
940
|
+ struct3506.SelRetnOpterName = role.UserName
|
779
|
941
|
struct3506.OrgName = miConfig.OrgName
|
780
|
942
|
struct3506.AccessKey = miConfig.AccessKey
|
781
|
943
|
struct3506.RequestUrl = miConfig.Url
|
|
@@ -789,12 +951,8 @@ func CancleSaleStock(org_id int64, pre models.HisPrescription, drug models.HisDo
|
789
|
951
|
struct3506.Enckey = miConfig.EncKey
|
790
|
952
|
struct3506.SignKey = miConfig.SignKey
|
791
|
953
|
struct3506.SecretKey = miConfig.SecretKey
|
792
|
|
-
|
793
|
|
- result1, result2, result3 := service.FJyb3506(struct3506)
|
794
|
|
- fmt.Println(result1)
|
795
|
|
- fmt.Println(result2)
|
796
|
|
- fmt.Println(result3)
|
797
|
|
-
|
|
954
|
+ result1, result2, _ := service.FJyb3506(struct3506)
|
|
955
|
+ return result1,result2
|
798
|
956
|
}
|
799
|
957
|
|
800
|
958
|
func (c *HisApiController) Get1318() {
|