|
@@ -15,7 +15,6 @@ import (
|
15
|
15
|
"reflect"
|
16
|
16
|
"strconv"
|
17
|
17
|
"strings"
|
18
|
|
- "sync"
|
19
|
18
|
"syscall"
|
20
|
19
|
"time"
|
21
|
20
|
"unsafe"
|
|
@@ -666,8 +665,6 @@ func (c *HisApiController) GetHisPrescriptionConfig() {
|
666
|
665
|
})
|
667
|
666
|
}
|
668
|
667
|
|
669
|
|
-var waitGroup sync.WaitGroup
|
670
|
|
-
|
671
|
668
|
func (c *HisApiController) CreateHisPrescription() {
|
672
|
669
|
record_date := c.GetString("record_date")
|
673
|
670
|
patient_id, _ := c.GetInt64("patient_id")
|
|
@@ -715,12 +712,9 @@ func (c *HisApiController) CreateHisPrescription() {
|
715
|
712
|
_, stockConfig := service.FindAutomaticReduceRecordByOrgId(c.GetAdminUserInfo().CurrentOrgId)
|
716
|
713
|
|
717
|
714
|
if drugStockConfig.IsOpen == 1 {
|
718
|
|
-
|
719
|
715
|
//校验库存总量
|
720
|
716
|
if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
|
721
|
717
|
prescriptions, _ := dataBody["prescriptions"].([]interface{})
|
722
|
|
-
|
723
|
|
- //GetPrescriptionById(prescriptions)
|
724
|
718
|
if len(prescriptions) > 0 {
|
725
|
719
|
for _, item := range prescriptions {
|
726
|
720
|
items := item.(map[string]interface{})
|
|
@@ -731,6 +725,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
731
|
725
|
var drug_id int64
|
732
|
726
|
var prescribing_number float64
|
733
|
727
|
var prescribingNumberUnit string
|
|
728
|
+ var prescribingNumber string
|
734
|
729
|
|
735
|
730
|
var adviceId int64
|
736
|
731
|
if advice.(map[string]interface{})["id"] != nil || reflect.TypeOf(advice.(map[string]interface{})["id"]).String() == "float64" {
|
|
@@ -739,7 +734,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
739
|
734
|
if advice.(map[string]interface{})["prescribing_number"] != nil || reflect.TypeOf(advice.(map[string]interface{})["prescribing_number"]).String() == "string" {
|
740
|
735
|
prescribing_number_str := advice.(map[string]interface{})["prescribing_number"].(string)
|
741
|
736
|
prescribing_number, _ = strconv.ParseFloat(prescribing_number_str, 64)
|
742
|
|
-
|
|
737
|
+ prescribingNumber = advice.(map[string]interface{})["prescribing_number"].(string)
|
743
|
738
|
}
|
744
|
739
|
|
745
|
740
|
if advice.(map[string]interface{})["prescribing_number_unit"] != nil && reflect.TypeOf(advice.(map[string]interface{})["prescribing_number_unit"]).String() == "string" {
|
|
@@ -765,31 +760,51 @@ func (c *HisApiController) CreateHisPrescription() {
|
765
|
760
|
//查询该药品是否存在开药记录
|
766
|
761
|
advicelist, _ := service.GetHisAdviceListByDrugIdEight(drug_id, patient_id, recordDateTime, adviceId)
|
767
|
762
|
|
|
763
|
+ //新增处方
|
|
764
|
+ if advicelist.ID == 0 {
|
|
765
|
+ all_count, _ := strconv.ParseFloat(totals, 64)
|
|
766
|
+ if prescribingNumberUnit == drug.MinUnit {
|
|
767
|
+ if prescribing_number > all_count {
|
|
768
|
+ c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
|
769
|
+ return
|
|
770
|
+ }
|
|
771
|
+ } else {
|
|
772
|
+ if prescribingNumberUnit == drug.MaxUnit {
|
|
773
|
+ num := prescribing_number * float64(drug.MinNumber)
|
|
774
|
+ if num > all_count {
|
|
775
|
+ c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
|
776
|
+ return
|
|
777
|
+ }
|
|
778
|
+ }
|
|
779
|
+ }
|
|
780
|
+ }
|
768
|
781
|
//修改处方
|
769
|
782
|
if advicelist.ID > 0 {
|
770
|
783
|
var device_number int64
|
|
784
|
+
|
771
|
785
|
if advicelist.PrescribingNumberUnit == drug.MaxUnit {
|
772
|
|
- prescribingNumber := strconv.FormatFloat(advicelist.PrescribingNumber, 'f', -1, 64)
|
773
|
|
- prescribingNumberInt, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
|
786
|
+ prescribingNumberOne := strconv.FormatFloat(advicelist.PrescribingNumber, 'f', -1, 64)
|
|
787
|
+ prescribingNumberInt, _ := strconv.ParseInt(prescribingNumberOne, 10, 64)
|
774
|
788
|
device_number = prescribingNumberInt * drug.MinNumber
|
775
|
789
|
}
|
776
|
790
|
if advicelist.PrescribingNumberUnit == drug.MinUnit {
|
777
|
|
- prescribingNumber := strconv.FormatFloat(advicelist.PrescribingNumber, 'f', -1, 64)
|
778
|
|
- prescribingNumberInt, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
|
791
|
+ prescribingNumberOne := strconv.FormatFloat(advicelist.PrescribingNumber, 'f', -1, 64)
|
|
792
|
+ prescribingNumberInt, _ := strconv.ParseInt(prescribingNumberOne, 10, 64)
|
779
|
793
|
device_number = prescribingNumberInt
|
780
|
794
|
}
|
781
|
795
|
|
782
|
796
|
var number_count int64
|
783
|
797
|
if prescribingNumberUnit == drug.MaxUnit {
|
784
|
|
- prescribingNumber := strconv.FormatFloat(advicelist.PrescribingNumber, 'f', -1, 64)
|
785
|
798
|
prescribingNumberInt, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
786
|
799
|
number_count = prescribingNumberInt * drug.MinNumber
|
787
|
800
|
}
|
788
|
801
|
if prescribingNumberUnit == drug.MinUnit {
|
789
|
|
- prescribingNumber := strconv.FormatFloat(advicelist.PrescribingNumber, 'f', -1, 64)
|
790
|
802
|
prescribingNumberInt, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
791
|
803
|
number_count = prescribingNumberInt
|
792
|
804
|
}
|
|
805
|
+
|
|
806
|
+ fmt.Println("以前出库数量23323232322332323223233223232332", device_number)
|
|
807
|
+ fmt.Println("现在出库数量", number_count)
|
793
|
808
|
//如果修改的数量大于之前修改的数量
|
794
|
809
|
if (number_count - device_number) > 0 {
|
795
|
810
|
//如果修改的差数量 大于库存数量
|
|
@@ -798,27 +813,42 @@ func (c *HisApiController) CreateHisPrescription() {
|
798
|
813
|
return
|
799
|
814
|
}
|
800
|
815
|
}
|
801
|
|
- }
|
802
|
816
|
|
803
|
|
- //新增处方
|
804
|
|
- if advicelist.ID == 0 {
|
805
|
|
- all_count, _ := strconv.ParseFloat(totals, 64)
|
806
|
|
- if prescribingNumberUnit == drug.MinUnit {
|
807
|
|
- if prescribing_number > all_count {
|
808
|
|
- c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
809
|
|
- return
|
|
817
|
+ if device_number != number_count {
|
|
818
|
+
|
|
819
|
+ // 查询该药品最后一次出库记录
|
|
820
|
+ druginfo, _ := service.GetLastDrugWarehouseOutByDrugId(drug_id, patient_id, recordDateTime, adviceId)
|
|
821
|
+ fmt.Println("以前出库数量23323232322332323223233223232332", device_number)
|
|
822
|
+ fmt.Println("现在出库数量", number_count)
|
|
823
|
+ //回退库存
|
|
824
|
+ if druginfo.CountUnit == drug.MaxUnit && drug.MaxUnit != drug.MinUnit {
|
|
825
|
+
|
|
826
|
+ service.ModefyDrugByWarehouseInfo(druginfo.WarehouseInfoId, number_count)
|
810
|
827
|
}
|
811
|
|
- } else {
|
812
|
|
- if prescribingNumberUnit == drug.MaxUnit {
|
813
|
|
- num := prescribing_number * float64(drug.MinNumber)
|
814
|
|
- if num > all_count {
|
815
|
|
- c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
816
|
|
- return
|
|
828
|
+ if druginfo.CountUnit == drug.MinUnit && drug.MaxUnit != drug.MinUnit {
|
|
829
|
+ var stock_max_number int64
|
|
830
|
+ var stock_min_number int64
|
|
831
|
+
|
|
832
|
+ if number_count >= drug.MinNumber {
|
|
833
|
+ fmt.Println("尽力啊了吗332323322332233232332233223232323")
|
|
834
|
+ stock_max_number = device_number / drug.MinNumber
|
|
835
|
+ service.ModefyDrugByWarehouseInfo(druginfo.WarehouseInfoId, stock_max_number)
|
|
836
|
+ stock_min_number = device_number % drug.MinNumber
|
|
837
|
+ service.ModefyDrugByWarehouseInfoOne(druginfo.WarehouseInfoId, stock_min_number)
|
|
838
|
+
|
|
839
|
+ } else {
|
|
840
|
+ fmt.Println("99999999999999999999")
|
|
841
|
+ service.ModefyDrugByWarehouseInfoOne(druginfo.WarehouseInfoId, device_number)
|
817
|
842
|
}
|
818
|
843
|
}
|
|
844
|
+
|
|
845
|
+ if druginfo.CountUnit == drug.MaxUnit && druginfo.CountUnit == drug.MinUnit && drug.MaxUnit == drug.MinUnit {
|
|
846
|
+ service.ModefyDrugByWarehouseInfo(druginfo.WarehouseInfoId, device_number)
|
|
847
|
+ }
|
|
848
|
+ //删除记录
|
|
849
|
+ service.DeleteDrugAutoWarehouseSeven(drug_id, patient_id, recordDateTime, adviceId)
|
819
|
850
|
}
|
820
|
851
|
}
|
821
|
|
-
|
822
|
852
|
}
|
823
|
853
|
}
|
824
|
854
|
}
|
|
@@ -832,6 +862,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
832
|
862
|
prescriptions, _ := dataBody["prescriptions"].([]interface{})
|
833
|
863
|
if len(prescriptions) > 0 {
|
834
|
864
|
for _, item := range prescriptions {
|
|
865
|
+
|
835
|
866
|
items := item.(map[string]interface{})
|
836
|
867
|
if items["project"] != nil && reflect.TypeOf(items["project"]).String() == "[]interface {}" {
|
837
|
868
|
projects := items["project"].([]interface{})
|
|
@@ -840,6 +871,8 @@ func (c *HisApiController) CreateHisPrescription() {
|
840
|
871
|
var project_id int64
|
841
|
872
|
var project_type int64
|
842
|
873
|
var totals float64
|
|
874
|
+ var project_name string
|
|
875
|
+ var parsetotal int64
|
843
|
876
|
if project.(map[string]interface{})["project_id"] != nil || reflect.TypeOf(project.(map[string]interface{})["project_id"]).String() == "float64" {
|
844
|
877
|
project_id = int64(project.(map[string]interface{})["project_id"].(float64))
|
845
|
878
|
}
|
|
@@ -848,20 +881,21 @@ func (c *HisApiController) CreateHisPrescription() {
|
848
|
881
|
}
|
849
|
882
|
if project.(map[string]interface{})["total"] != nil || reflect.TypeOf(project.(map[string]interface{})["total"]).String() == "string" {
|
850
|
883
|
total, _ := project.(map[string]interface{})["total"].(string)
|
851
|
|
-
|
852
|
884
|
totals, _ = strconv.ParseFloat(total, 64)
|
|
885
|
+ parsetotal, _ = strconv.ParseInt(total, 10, 64)
|
853
|
886
|
}
|
854
|
|
- if project_type == 3 {
|
|
887
|
+ if project.(map[string]interface{})["project_name"] != nil || reflect.TypeOf(project.(map[string]interface{})["project_name"]).String() == "string" {
|
|
888
|
+ project_name = project.(map[string]interface{})["project_name"].(string)
|
855
|
889
|
|
|
890
|
+ }
|
|
891
|
+ if project_type == 3 {
|
856
|
892
|
//查找该耗材的出库记录
|
857
|
|
- goodWarehouseInfo, _ := service.GetAutoRecordByGoodIdSeven(project_id, patient_id, recordDateTime)
|
858
|
|
-
|
859
|
|
- if goodWarehouseInfo.ID == 0 {
|
860
|
|
- good, _ := service.FindGoodInfoByIdSeven(project_id)
|
861
|
|
- if good.ID == 0 {
|
862
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
863
|
|
- return
|
864
|
|
- }
|
|
893
|
+ goodWarehouseInfo, _ := service.GetAutoRecordByGoodIdSevenEight(project_id, patient_id, recordDateTime)
|
|
894
|
+ var total_count int64
|
|
895
|
+ for _, it := range goodWarehouseInfo {
|
|
896
|
+ total_count += it.Count
|
|
897
|
+ }
|
|
898
|
+ if len(goodWarehouseInfo) == 0 {
|
865
|
899
|
//查询耗材库存
|
866
|
900
|
list, _ := service.GetGoodWarehouseInfoSeven(project_id)
|
867
|
901
|
var stock_count int64
|
|
@@ -871,183 +905,11 @@ func (c *HisApiController) CreateHisPrescription() {
|
871
|
905
|
stock_counts := strconv.FormatInt(stock_count, 10)
|
872
|
906
|
stock_total_count, _ := strconv.ParseFloat(stock_counts, 64)
|
873
|
907
|
if totals > stock_total_count {
|
874
|
|
- c.ServeDynamicFailJsonSend(good.GoodName + "库存不足")
|
|
908
|
+ c.ServeDynamicFailJsonSend(project_name + "库存不足")
|
875
|
909
|
return
|
876
|
910
|
}
|
877
|
911
|
}
|
878
|
|
- }
|
879
|
|
-
|
880
|
|
- }
|
881
|
|
- }
|
882
|
|
- }
|
883
|
|
- }
|
884
|
|
- }
|
885
|
|
- }
|
886
|
|
- }
|
887
|
|
-
|
888
|
|
- ch := make(chan struct{})
|
889
|
|
- count := 2 // count 表示活动的协程个数
|
890
|
|
-
|
891
|
|
- go func() {
|
892
|
|
- if drugStockConfig.IsOpen == 1 {
|
893
|
|
- //校验库存总量
|
894
|
|
- if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
|
895
|
|
- prescriptions, _ := dataBody["prescriptions"].([]interface{})
|
896
|
|
- if len(prescriptions) > 0 {
|
897
|
|
- for _, item := range prescriptions {
|
898
|
|
- items := item.(map[string]interface{})
|
899
|
|
- if items["advices"] != nil && reflect.TypeOf(items["advices"]).String() == "[]interface {}" {
|
900
|
|
- advices := items["advices"].([]interface{})
|
901
|
|
- if len(advices) > 0 {
|
902
|
|
- for _, advice := range advices {
|
903
|
|
- var drug_id int64
|
904
|
|
- var prescribingNumberUnit string
|
905
|
|
- var prescribingNumber string
|
906
|
|
- var adviceId int64
|
907
|
|
- if advice.(map[string]interface{})["id"] != nil || reflect.TypeOf(advice.(map[string]interface{})["id"]).String() == "float64" {
|
908
|
|
- drug_id = int64(advice.(map[string]interface{})["id"].(float64))
|
909
|
|
- }
|
910
|
|
- if advice.(map[string]interface{})["prescribing_number"] != nil || reflect.TypeOf(advice.(map[string]interface{})["prescribing_number"]).String() == "string" {
|
911
|
|
-
|
912
|
|
- prescribingNumber = advice.(map[string]interface{})["prescribing_number"].(string)
|
913
|
|
-
|
914
|
|
- }
|
915
|
|
-
|
916
|
|
- if advice.(map[string]interface{})["prescribing_number_unit"] != nil && reflect.TypeOf(advice.(map[string]interface{})["prescribing_number_unit"]).String() == "string" {
|
917
|
|
- prescribingNumberUnit, _ = advice.(map[string]interface{})["prescribing_number_unit"].(string)
|
918
|
|
- }
|
919
|
|
-
|
920
|
|
- if advice.(map[string]interface{})["advice_id"] != nil || reflect.TypeOf(advice.(map[string]interface{})["advice_id"]).String() == "float64" {
|
921
|
|
- adviceId = int64(advice.(map[string]interface{})["advice_id"].(float64))
|
922
|
|
- }
|
923
|
|
-
|
924
|
|
- drug, _ := service.FindBaseDrugLibRecordSeven(adminInfo.CurrentOrgId, drug_id)
|
925
|
|
- if drug.ID == 0 {
|
926
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
927
|
|
- return
|
928
|
|
- }
|
929
|
|
-
|
930
|
|
- //查询药品的所有库存
|
931
|
|
- list, _ := service.GetDrugWarehouseInfoPrescriptionSeven(drug_id, adminInfo.CurrentOrgId)
|
932
|
|
- var total_count int64
|
933
|
|
- for _, it := range list {
|
934
|
|
- total_count += it.StockMaxNumber*drug.MinNumber + it.StockMinNumber
|
935
|
|
- }
|
936
|
|
-
|
937
|
|
- //查询该药品是否存在开药记录
|
938
|
|
- advicelist, _ := service.GetHisAdviceListByDrugIdEight(drug_id, patient_id, recordDateTime, adviceId)
|
939
|
|
-
|
940
|
|
- //修改处方
|
941
|
|
- if advicelist.ID > 0 {
|
942
|
|
- var device_number int64
|
943
|
|
- if advicelist.PrescribingNumberUnit == drug.MaxUnit {
|
944
|
|
- prescribingNumber := strconv.FormatFloat(advicelist.PrescribingNumber, 'f', -1, 64)
|
945
|
|
- prescribingNumberInt, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
946
|
|
- device_number = prescribingNumberInt * drug.MinNumber
|
947
|
|
- }
|
948
|
|
- if advicelist.PrescribingNumberUnit == drug.MinUnit {
|
949
|
|
- prescribingNumber := strconv.FormatFloat(advicelist.PrescribingNumber, 'f', -1, 64)
|
950
|
|
- prescribingNumberInt, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
951
|
|
- device_number = prescribingNumberInt
|
952
|
|
- }
|
953
|
|
-
|
954
|
|
- var sum_count int64
|
955
|
|
- //判断是否做过修改
|
956
|
|
- if prescribingNumberUnit == drug.MaxUnit {
|
957
|
|
-
|
958
|
|
- prescribingNumberInt, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
959
|
|
-
|
960
|
|
- sum_count = prescribingNumberInt * drug.MinNumber
|
961
|
|
- }
|
962
|
|
- if prescribingNumberUnit == drug.MinUnit {
|
963
|
|
- prescribingNumberInt, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
964
|
|
- sum_count = prescribingNumberInt
|
965
|
|
- }
|
966
|
|
- fmt.Println("sum_count23322332323232323232323223322323", sum_count)
|
967
|
|
- fmt.Println("devcie_number23333223333332232332233232323223", device_number)
|
968
|
|
-
|
969
|
|
- if device_number != sum_count {
|
970
|
|
-
|
971
|
|
- // 查询该药品最后一次出库记录
|
972
|
|
- druginfo, _ := service.GetLastDrugWarehouseOutByDrugId(drug_id, patient_id, recordDateTime, adviceId)
|
973
|
|
- fmt.Println("单位12332232322332322323233223", druginfo.CountUnit)
|
974
|
|
- fmt.Println("单位2332233223323223322332332233223", drug.MaxUnit)
|
975
|
|
- //回退库存
|
976
|
|
- if druginfo.CountUnit == drug.MaxUnit && drug.MaxUnit != drug.MinUnit {
|
977
|
|
-
|
978
|
|
- service.ModefyDrugByWarehouseInfo(druginfo.WarehouseInfoId, device_number)
|
979
|
|
- }
|
980
|
|
- if druginfo.CountUnit == drug.MinUnit && drug.MaxUnit != drug.MinUnit {
|
981
|
|
- var stock_max_number int64
|
982
|
|
- var stock_min_number int64
|
983
|
|
- if device_number >= drug.MinNumber {
|
984
|
|
- stock_max_number = device_number / drug.MinNumber
|
985
|
|
- //fmt.Println("大的值2323233232232323", stock_max_number)
|
986
|
|
- service.ModefyDrugByWarehouseInfo(druginfo.WarehouseInfoId, stock_max_number)
|
987
|
|
- stock_min_number = device_number % drug.MinNumber
|
988
|
|
- // fmt.Println("小的值322332332323233223", stock_min_number)
|
989
|
|
- if stock_min_number == drug.MinNumber {
|
990
|
|
-
|
991
|
|
- }
|
992
|
|
- service.ModefyDrugByWarehouseInfoOne(druginfo.WarehouseInfoId, stock_min_number)
|
993
|
|
-
|
994
|
|
- } else {
|
995
|
|
-
|
996
|
|
- service.ModefyDrugByWarehouseInfoOne(druginfo.WarehouseInfoId, device_number)
|
997
|
|
- }
|
998
|
|
-
|
999
|
|
- }
|
1000
|
|
-
|
1001
|
|
- if druginfo.CountUnit == drug.MaxUnit && druginfo.CountUnit == drug.MinUnit && drug.MaxUnit == drug.MinUnit {
|
1002
|
|
- service.ModefyDrugByWarehouseInfo(druginfo.WarehouseInfoId, device_number)
|
1003
|
|
- }
|
1004
|
|
-
|
1005
|
|
- //删除记录
|
1006
|
|
- service.DeleteDrugAutoWarehouseSeven(drug_id, patient_id, recordDateTime, adviceId)
|
1007
|
|
- }
|
1008
|
|
- }
|
1009
|
|
- }
|
1010
|
|
- }
|
1011
|
|
- }
|
1012
|
|
- }
|
1013
|
|
- }
|
1014
|
|
- }
|
1015
|
|
- }
|
1016
|
|
- ch <- struct{}{}
|
1017
|
|
- }()
|
1018
|
|
-
|
1019
|
|
- go func() {
|
1020
|
|
- if stockConfig.IsOpen == 1 {
|
1021
|
|
- if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
|
1022
|
|
- prescriptions, _ := dataBody["prescriptions"].([]interface{})
|
1023
|
|
- if len(prescriptions) > 0 {
|
1024
|
|
- for _, item := range prescriptions {
|
1025
|
|
- items := item.(map[string]interface{})
|
1026
|
|
- if items["project"] != nil && reflect.TypeOf(items["project"]).String() == "[]interface {}" {
|
1027
|
|
- projects := items["project"].([]interface{})
|
1028
|
|
- if len(projects) > 0 {
|
1029
|
|
- for _, project := range projects {
|
1030
|
|
- var project_id int64
|
1031
|
|
- var project_type int64
|
1032
|
|
- var parsetotal int64
|
1033
|
|
- if project.(map[string]interface{})["project_id"] != nil || reflect.TypeOf(project.(map[string]interface{})["project_id"]).String() == "float64" {
|
1034
|
|
- project_id = int64(project.(map[string]interface{})["project_id"].(float64))
|
1035
|
|
- }
|
1036
|
|
- if project.(map[string]interface{})["type"] != nil || reflect.TypeOf(project.(map[string]interface{})["type"]).String() == "float64" {
|
1037
|
|
- project_type = int64(project.(map[string]interface{})["type"].(float64))
|
1038
|
|
- }
|
1039
|
|
- if project.(map[string]interface{})["total"] != nil || reflect.TypeOf(project.(map[string]interface{})["total"]).String() == "string" {
|
1040
|
|
- total, _ := project.(map[string]interface{})["total"].(string)
|
1041
|
|
- parsetotal, _ = strconv.ParseInt(total, 10, 64)
|
1042
|
|
- }
|
1043
|
|
-
|
1044
|
|
- if project_type == 3 {
|
1045
|
|
- //查找该耗材的出库记录
|
1046
|
|
- goodWarehouseInfo, _ := service.GetAutoRecordByGoodIdSevenEight(project_id, patient_id, recordDateTime)
|
1047
|
|
- var total_count int64
|
1048
|
|
- for _, it := range goodWarehouseInfo {
|
1049
|
|
- total_count += it.Count
|
1050
|
|
- }
|
|
912
|
+ if len(goodWarehouseInfo) > 0 {
|
1051
|
913
|
//查询该患者耗材的历史数据
|
1052
|
914
|
ordProject, _ := service.GetHisProjectPrescriptionByPatientId(patient_id, recordDateTime)
|
1053
|
915
|
if total_count > 0 {
|
|
@@ -1055,12 +917,13 @@ func (c *HisApiController) CreateHisPrescription() {
|
1055
|
917
|
if parsetotal != total_count || len(ordProject) != len(projects) {
|
1056
|
918
|
//查找今日该患者已经出库的所有耗材
|
1057
|
919
|
goodList, _ := service.GetAllAutoRecordByPatient(patient_id, recordDateTime)
|
|
920
|
+ fmt.Println("goodList3323223232323232323", goodList)
|
1058
|
921
|
for _, item := range goodList {
|
1059
|
922
|
//回退库存
|
1060
|
923
|
service.ModefyWarehouseInfo(item.Count, item.WarehouseInfotId)
|
1061
|
|
- //删除记录
|
1062
|
|
- service.DeleteAutoWarehouse(item.PatientId, item.SysRecordTime)
|
1063
|
924
|
}
|
|
925
|
+ //删除记录
|
|
926
|
+ service.DeleteAutoWarehouse(patient_id, recordDateTime)
|
1064
|
927
|
}
|
1065
|
928
|
}
|
1066
|
929
|
}
|
|
@@ -1071,16 +934,6 @@ func (c *HisApiController) CreateHisPrescription() {
|
1071
|
934
|
}
|
1072
|
935
|
}
|
1073
|
936
|
}
|
1074
|
|
- ch <- struct{}{}
|
1075
|
|
- }()
|
1076
|
|
-
|
1077
|
|
- for range ch {
|
1078
|
|
- // 每次从ch中接收数据,表明一个活动的协程结束
|
1079
|
|
- count--
|
1080
|
|
- // 当所有活动的协程都结束时,关闭管道
|
1081
|
|
- if count == 0 {
|
1082
|
|
- close(ch)
|
1083
|
|
- }
|
1084
|
937
|
}
|
1085
|
938
|
|
1086
|
939
|
info, _ := service.FindHisPatientPrescriptionInfo(adminInfo.CurrentOrgId, patient_id, recordDateTime, p_type, his_patient_id)
|
|
@@ -1158,10 +1011,18 @@ func (c *HisApiController) CreateHisPrescription() {
|
1158
|
1011
|
defer redis.Close()
|
1159
|
1012
|
}
|
1160
|
1013
|
|
|
1014
|
+ //定义切片
|
|
1015
|
+
|
|
1016
|
+ var adviceList []models.HisDoctorAdviceInfo
|
|
1017
|
+ var projectList []models.HisPrescriptionProject
|
|
1018
|
+
|
|
1019
|
+ //var hisLis []models.HisList
|
|
1020
|
+
|
1161
|
1021
|
if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
|
1162
|
1022
|
prescriptions, _ := dataBody["prescriptions"].([]interface{})
|
1163
|
1023
|
|
1164
|
1024
|
var tempPrescription *models.HisPrescription
|
|
1025
|
+
|
1165
|
1026
|
if len(prescriptions) > 0 {
|
1166
|
1027
|
for _, item := range prescriptions {
|
1167
|
1028
|
items := item.(map[string]interface{})
|
|
@@ -1302,6 +1163,10 @@ func (c *HisApiController) CreateHisPrescription() {
|
1302
|
1163
|
|
1303
|
1164
|
s.StartTime = pTime
|
1304
|
1165
|
service.CreateHisDoctorAdvice(&s)
|
|
1166
|
+
|
|
1167
|
+ //存储切片中
|
|
1168
|
+ adviceList = append(adviceList, s)
|
|
1169
|
+
|
1305
|
1170
|
redis := service.RedisClient()
|
1306
|
1171
|
key := strconv.FormatInt(adminInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(theTime.Unix(), 10) + ":his_advices_list_all"
|
1307
|
1172
|
redis.Set(key, "", time.Second)
|
|
@@ -1349,6 +1214,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
1349
|
1214
|
}
|
1350
|
1215
|
|
1351
|
1216
|
service.CreateHisProjectTwo(&p)
|
|
1217
|
+ projectList = append(projectList, p)
|
1352
|
1218
|
var randNum int
|
1353
|
1219
|
randNum = rand.Intn(10000) + 1000
|
1354
|
1220
|
timestamp := time.Now().Unix()
|
|
@@ -1408,14 +1274,14 @@ func (c *HisApiController) CreateHisPrescription() {
|
1408
|
1274
|
|
1409
|
1275
|
service.SaveHisProjectTwo(&p)
|
1410
|
1276
|
|
1411
|
|
- if p.Type == 3 { //处理透前准备耗材数量数据
|
1412
|
|
- consumables, _ := service.FindHisConsumablesByID(adminInfo.CurrentOrgId, patient_id, recordDateTime, p.ProjectId)
|
1413
|
|
- if consumables.ID > 0 {
|
1414
|
|
- cnt, _ := strconv.ParseInt(p.Count, 10, 64)
|
1415
|
|
- consumables.Count = cnt
|
1416
|
|
- service.UpdateConsumables(&consumables)
|
1417
|
|
- }
|
1418
|
|
- }
|
|
1277
|
+ //if p.Type == 3 { //处理透前准备耗材数量数据
|
|
1278
|
+ // consumables, _ := service.FindHisConsumablesByID(adminInfo.CurrentOrgId, patient_id, recordDateTime, p.ProjectId)
|
|
1279
|
+ // if consumables.ID > 0 {
|
|
1280
|
+ // cnt, _ := strconv.ParseInt(p.Count, 10, 64)
|
|
1281
|
+ // consumables.Count = cnt
|
|
1282
|
+ // service.UpdateConsumables(&consumables)
|
|
1283
|
+ // }
|
|
1284
|
+ //}
|
1419
|
1285
|
|
1420
|
1286
|
}
|
1421
|
1287
|
}
|
|
@@ -1458,6 +1324,33 @@ func (c *HisApiController) CreateHisPrescription() {
|
1458
|
1324
|
}
|
1459
|
1325
|
}
|
1460
|
1326
|
|
|
1327
|
+ //redisClient := service.RedisClient()
|
|
1328
|
+ //defer redisClient.Close()
|
|
1329
|
+ //
|
|
1330
|
+ //list := models.HisList{
|
|
1331
|
+ // Patient_id: patient_id,
|
|
1332
|
+ // Advice_id:0,
|
|
1333
|
+ // Record_date: 0,
|
|
1334
|
+ // Advice: adviceList,
|
|
1335
|
+ // Project: nil,
|
|
1336
|
+ //}
|
|
1337
|
+ //hisLis = append(hisLis, list)
|
|
1338
|
+ //
|
|
1339
|
+ //advice_json, _ := json.Marshal(&hisLis)
|
|
1340
|
+ //redisClient.RPush("111", advice_json).Result()
|
|
1341
|
+ //result, _ := redisClient.RPop("111").Result()
|
|
1342
|
+ //fmt.Println("resuilt2332323323232323232323232322323233232",redisClient.LLen("111"))
|
|
1343
|
+ //
|
|
1344
|
+ //var dat []map[string]interface{}
|
|
1345
|
+ //json.Unmarshal([]byte(result), &dat)
|
|
1346
|
+ //fmt.Println("hhhh2332323232233223322332322323232323",dat)
|
|
1347
|
+ //
|
|
1348
|
+ //for k,v:=range dat{
|
|
1349
|
+ // fmt.Println("第",k,"个数的值是:",v,v["Advice"],v["Patient_id"])
|
|
1350
|
+ //}
|
|
1351
|
+ //project_json, _ := json.Marshal(&projectList)
|
|
1352
|
+ //redisClient.LPush("222", project_json).Result()
|
|
1353
|
+
|
1461
|
1354
|
if err == nil {
|
1462
|
1355
|
c.ServeSuccessJSON(map[string]interface{}{
|
1463
|
1356
|
"msg": "保存成功",
|
|
@@ -3338,82 +3231,82 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
|
3338
|
3231
|
}
|
3339
|
3232
|
}
|
3340
|
3233
|
|
3341
|
|
- _, drugStockConfig := service.FindDrugStockAutomaticReduceRecordByOrgId(advice.UserOrgId)
|
3342
|
|
-
|
3343
|
|
- if drugStockConfig.IsOpen == 1 {
|
3344
|
|
-
|
3345
|
|
- drug, _ := service.FindBaseDrugLibRecord(advice.UserOrgId, advice.DrugId)
|
3346
|
|
- if advice.ID == 0 { //医嘱不存在
|
3347
|
|
- if advice.PrescribingNumberUnit == drug.MinUnit { //当前数据单位与基础库一致为最小单位,直接计算
|
3348
|
|
- drug.Total = drug.Total - advice.PrescribingNumber
|
3349
|
|
- service.UpdateBaseDrugLib(&drug)
|
3350
|
|
-
|
3351
|
|
- } else if advice.PrescribingNumberUnit == drug.MaxUnit { //当前数据单位为最大单位,需要将最大单位转为最小单位
|
3352
|
|
- num := advice.PrescribingNumber * float64(drug.MinNumber)
|
3353
|
|
- drug.Total = drug.Total - num
|
3354
|
|
- service.UpdateBaseDrugLib(&drug)
|
3355
|
|
- }
|
3356
|
|
-
|
3357
|
|
- } else if advice.ID > 0 { //医嘱存在
|
3358
|
|
- hisAdvice, _ := service.GetHisDoctorAdvicesById(advice.ID)
|
3359
|
|
- var num float64
|
3360
|
|
-
|
3361
|
|
- if advice.PrescribingNumberUnit == drug.MinUnit { //当前数据为最小单位
|
3362
|
|
- if hisAdvice.PrescribingNumberUnit == advice.PrescribingNumberUnit { //原数据为最小单位,三个单位一致为最小单位直接计算
|
3363
|
|
- if hisAdvice.PrescribingNumber > advice.PrescribingNumber {
|
3364
|
|
- num = hisAdvice.PrescribingNumber - advice.PrescribingNumber
|
3365
|
|
- drug.Total = drug.Total + num
|
3366
|
|
- service.UpdateBaseDrugLib(&drug)
|
3367
|
|
- } else if hisAdvice.PrescribingNumber < advice.PrescribingNumber {
|
3368
|
|
- num = advice.PrescribingNumber - hisAdvice.PrescribingNumber
|
3369
|
|
- drug.Total = drug.Total - num
|
3370
|
|
- service.UpdateBaseDrugLib(&drug)
|
3371
|
|
- }
|
3372
|
|
- } else { //原数据为最大单位,需要将最大单位数量转为最小单位数量
|
3373
|
|
- num2 := hisAdvice.PrescribingNumber * float64(drug.MinNumber)
|
3374
|
|
- if num2 > advice.PrescribingNumber {
|
3375
|
|
- num = num2 - advice.PrescribingNumber
|
3376
|
|
- drug.Total = drug.Total + num
|
3377
|
|
- service.UpdateBaseDrugLib(&drug)
|
3378
|
|
- } else if num2 < advice.PrescribingNumber {
|
3379
|
|
- num = advice.PrescribingNumber - num2
|
3380
|
|
- drug.Total = drug.Total - num
|
3381
|
|
- service.UpdateBaseDrugLib(&drug)
|
3382
|
|
- }
|
3383
|
|
-
|
3384
|
|
- }
|
3385
|
|
-
|
3386
|
|
- } else if advice.PrescribingNumberUnit == drug.MaxUnit { //当前数据为最大单位
|
3387
|
|
- if advice.PrescribingNumberUnit == hisAdvice.PrescribingNumberUnit { //原数据为最大单位, 当前数据单位和原数据单位都为最大单位,需要将两个数据转成最小单位
|
3388
|
|
- num1 := hisAdvice.PrescribingNumber * float64(drug.MinNumber)
|
3389
|
|
- num2 := advice.PrescribingNumber * float64(drug.MinNumber)
|
3390
|
|
- if num1 > num2 {
|
3391
|
|
- num = num1 - num2
|
3392
|
|
- drug.Total = drug.Total + num
|
3393
|
|
- service.UpdateBaseDrugLib(&drug)
|
3394
|
|
- } else if num1 < num2 {
|
3395
|
|
- num = num2 - num1
|
3396
|
|
- drug.Total = drug.Total - num
|
3397
|
|
- service.UpdateBaseDrugLib(&drug)
|
3398
|
|
- }
|
3399
|
|
-
|
3400
|
|
- } else { //原数据为最小单位,当前数据为最大单位,需要将当前数据数量转为最小单位数量
|
3401
|
|
- num2 := advice.PrescribingNumber * float64(drug.MinNumber)
|
3402
|
|
- //num2 := hisAdvice.PrescribingNumber * (drug.Dose / float64(drug.MinNumber))
|
3403
|
|
- if hisAdvice.PrescribingNumber > num2 {
|
3404
|
|
- num = hisAdvice.PrescribingNumber - num2
|
3405
|
|
- drug.Total = drug.Total + num
|
3406
|
|
- service.UpdateBaseDrugLib(&drug)
|
3407
|
|
- } else if num2 < advice.PrescribingNumber {
|
3408
|
|
- num = num2 - hisAdvice.PrescribingNumber
|
3409
|
|
- drug.Total = drug.Total - num
|
3410
|
|
- service.UpdateBaseDrugLib(&drug)
|
3411
|
|
- }
|
3412
|
|
-
|
3413
|
|
- }
|
3414
|
|
- }
|
3415
|
|
- }
|
3416
|
|
- }
|
|
3234
|
+ //_, drugStockConfig := service.FindDrugStockAutomaticReduceRecordByOrgId(advice.UserOrgId)
|
|
3235
|
+ //
|
|
3236
|
+ //if drugStockConfig.IsOpen == 1 {
|
|
3237
|
+ //
|
|
3238
|
+ // drug, _ := service.FindBaseDrugLibRecord(advice.UserOrgId, advice.DrugId)
|
|
3239
|
+ // if advice.ID == 0 { //医嘱不存在
|
|
3240
|
+ // if advice.PrescribingNumberUnit == drug.MinUnit { //当前数据单位与基础库一致为最小单位,直接计算
|
|
3241
|
+ // drug.Total = drug.Total - advice.PrescribingNumber
|
|
3242
|
+ // service.UpdateBaseDrugLib(&drug)
|
|
3243
|
+ //
|
|
3244
|
+ // } else if advice.PrescribingNumberUnit == drug.MaxUnit { //当前数据单位为最大单位,需要将最大单位转为最小单位
|
|
3245
|
+ // num := advice.PrescribingNumber * float64(drug.MinNumber)
|
|
3246
|
+ // drug.Total = drug.Total - num
|
|
3247
|
+ // service.UpdateBaseDrugLib(&drug)
|
|
3248
|
+ // }
|
|
3249
|
+ //
|
|
3250
|
+ // } else if advice.ID > 0 { //医嘱存在
|
|
3251
|
+ // hisAdvice, _ := service.GetHisDoctorAdvicesById(advice.ID)
|
|
3252
|
+ // var num float64
|
|
3253
|
+ //
|
|
3254
|
+ // if advice.PrescribingNumberUnit == drug.MinUnit { //当前数据为最小单位
|
|
3255
|
+ // if hisAdvice.PrescribingNumberUnit == advice.PrescribingNumberUnit { //原数据为最小单位,三个单位一致为最小单位直接计算
|
|
3256
|
+ // if hisAdvice.PrescribingNumber > advice.PrescribingNumber {
|
|
3257
|
+ // num = hisAdvice.PrescribingNumber - advice.PrescribingNumber
|
|
3258
|
+ // drug.Total = drug.Total + num
|
|
3259
|
+ // service.UpdateBaseDrugLib(&drug)
|
|
3260
|
+ // } else if hisAdvice.PrescribingNumber < advice.PrescribingNumber {
|
|
3261
|
+ // num = advice.PrescribingNumber - hisAdvice.PrescribingNumber
|
|
3262
|
+ // drug.Total = drug.Total - num
|
|
3263
|
+ // service.UpdateBaseDrugLib(&drug)
|
|
3264
|
+ // }
|
|
3265
|
+ // } else { //原数据为最大单位,需要将最大单位数量转为最小单位数量
|
|
3266
|
+ // num2 := hisAdvice.PrescribingNumber * float64(drug.MinNumber)
|
|
3267
|
+ // if num2 > advice.PrescribingNumber {
|
|
3268
|
+ // num = num2 - advice.PrescribingNumber
|
|
3269
|
+ // drug.Total = drug.Total + num
|
|
3270
|
+ // service.UpdateBaseDrugLib(&drug)
|
|
3271
|
+ // } else if num2 < advice.PrescribingNumber {
|
|
3272
|
+ // num = advice.PrescribingNumber - num2
|
|
3273
|
+ // drug.Total = drug.Total - num
|
|
3274
|
+ // service.UpdateBaseDrugLib(&drug)
|
|
3275
|
+ // }
|
|
3276
|
+ //
|
|
3277
|
+ // }
|
|
3278
|
+ //
|
|
3279
|
+ // } else if advice.PrescribingNumberUnit == drug.MaxUnit { //当前数据为最大单位
|
|
3280
|
+ // if advice.PrescribingNumberUnit == hisAdvice.PrescribingNumberUnit { //原数据为最大单位, 当前数据单位和原数据单位都为最大单位,需要将两个数据转成最小单位
|
|
3281
|
+ // num1 := hisAdvice.PrescribingNumber * float64(drug.MinNumber)
|
|
3282
|
+ // num2 := advice.PrescribingNumber * float64(drug.MinNumber)
|
|
3283
|
+ // if num1 > num2 {
|
|
3284
|
+ // num = num1 - num2
|
|
3285
|
+ // drug.Total = drug.Total + num
|
|
3286
|
+ // service.UpdateBaseDrugLib(&drug)
|
|
3287
|
+ // } else if num1 < num2 {
|
|
3288
|
+ // num = num2 - num1
|
|
3289
|
+ // drug.Total = drug.Total - num
|
|
3290
|
+ // service.UpdateBaseDrugLib(&drug)
|
|
3291
|
+ // }
|
|
3292
|
+ //
|
|
3293
|
+ // } else { //原数据为最小单位,当前数据为最大单位,需要将当前数据数量转为最小单位数量
|
|
3294
|
+ // num2 := advice.PrescribingNumber * float64(drug.MinNumber)
|
|
3295
|
+ // //num2 := hisAdvice.PrescribingNumber * (drug.Dose / float64(drug.MinNumber))
|
|
3296
|
+ // if hisAdvice.PrescribingNumber > num2 {
|
|
3297
|
+ // num = hisAdvice.PrescribingNumber - num2
|
|
3298
|
+ // drug.Total = drug.Total + num
|
|
3299
|
+ // service.UpdateBaseDrugLib(&drug)
|
|
3300
|
+ // } else if num2 < advice.PrescribingNumber {
|
|
3301
|
+ // num = num2 - hisAdvice.PrescribingNumber
|
|
3302
|
+ // drug.Total = drug.Total - num
|
|
3303
|
+ // service.UpdateBaseDrugLib(&drug)
|
|
3304
|
+ // }
|
|
3305
|
+ //
|
|
3306
|
+ // }
|
|
3307
|
+ // }
|
|
3308
|
+ // }
|
|
3309
|
+ //}
|
3417
|
3310
|
|
3418
|
3311
|
//
|
3419
|
3312
|
//if json["execution_time"] != nil && reflect.TypeOf(json["execution_time"]).String() == "string" {
|
|
@@ -3555,46 +3448,46 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
|
3555
|
3448
|
// project.WeekDay = week_day
|
3556
|
3449
|
//}
|
3557
|
3450
|
|
3558
|
|
- _, stockConfig := service.FindAutomaticReduceRecordByOrgId(project.UserOrgId)
|
3559
|
|
-
|
3560
|
|
- if project.ID == 0 {
|
3561
|
|
- if stockConfig.IsOpen == 1 {
|
3562
|
|
- if project.Type == 3 {
|
3563
|
|
- good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
|
3564
|
|
- f_count, _ := strconv.ParseFloat(project.Count, 64)
|
3565
|
|
- good.Total = good.Total - f_count
|
3566
|
|
- service.UpdateGoodInfo(&good)
|
3567
|
|
- }
|
3568
|
|
- }
|
3569
|
|
-
|
3570
|
|
- } else {
|
3571
|
|
- temp_project, _ := service.GetHisPrescriptionProjectByID(project.ID)
|
3572
|
|
-
|
3573
|
|
- if stockConfig.IsOpen == 1 {
|
3574
|
|
- if project.Type == 3 {
|
3575
|
|
- good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
|
3576
|
|
- if project.Count < temp_project.Count {
|
3577
|
|
- f_count_one, _ := strconv.ParseFloat(project.Count, 64)
|
3578
|
|
- f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
|
3579
|
|
-
|
3580
|
|
- other_count := f_count_two - f_count_one
|
3581
|
|
- other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
|
3582
|
|
- good.Total = good.Total + other_count_two
|
3583
|
|
- service.UpdateGoodInfo(&good)
|
3584
|
|
- } else if project.Count > temp_project.Count {
|
3585
|
|
- f_count_one, _ := strconv.ParseFloat(project.Count, 64)
|
3586
|
|
- f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
|
3587
|
|
-
|
3588
|
|
- other_count := f_count_one - f_count_two
|
3589
|
|
- other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
|
3590
|
|
- good.Total = good.Total - other_count_two
|
3591
|
|
- service.UpdateGoodInfo(&good)
|
3592
|
|
- }
|
3593
|
|
-
|
3594
|
|
- }
|
3595
|
|
- }
|
3596
|
|
-
|
3597
|
|
- }
|
|
3451
|
+ //_, stockConfig := service.FindAutomaticReduceRecordByOrgId(project.UserOrgId)
|
|
3452
|
+ //
|
|
3453
|
+ //if project.ID == 0 {
|
|
3454
|
+ // if stockConfig.IsOpen == 1 {
|
|
3455
|
+ // if project.Type == 3 {
|
|
3456
|
+ // good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
|
|
3457
|
+ // f_count, _ := strconv.ParseFloat(project.Count, 64)
|
|
3458
|
+ // good.Total = good.Total - f_count
|
|
3459
|
+ // service.UpdateGoodInfo(&good)
|
|
3460
|
+ // }
|
|
3461
|
+ // }
|
|
3462
|
+ //
|
|
3463
|
+ //} else {
|
|
3464
|
+ // temp_project, _ := service.GetHisPrescriptionProjectByID(project.ID)
|
|
3465
|
+ //
|
|
3466
|
+ // if stockConfig.IsOpen == 1 {
|
|
3467
|
+ // if project.Type == 3 {
|
|
3468
|
+ // good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
|
|
3469
|
+ // if project.Count < temp_project.Count {
|
|
3470
|
+ // f_count_one, _ := strconv.ParseFloat(project.Count, 64)
|
|
3471
|
+ // f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
|
|
3472
|
+ //
|
|
3473
|
+ // other_count := f_count_two - f_count_one
|
|
3474
|
+ // other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
|
|
3475
|
+ // good.Total = good.Total + other_count_two
|
|
3476
|
+ // service.UpdateGoodInfo(&good)
|
|
3477
|
+ // } else if project.Count > temp_project.Count {
|
|
3478
|
+ // f_count_one, _ := strconv.ParseFloat(project.Count, 64)
|
|
3479
|
+ // f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
|
|
3480
|
+ //
|
|
3481
|
+ // other_count := f_count_one - f_count_two
|
|
3482
|
+ // other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
|
|
3483
|
+ // good.Total = good.Total - other_count_two
|
|
3484
|
+ // service.UpdateGoodInfo(&good)
|
|
3485
|
+ // }
|
|
3486
|
+ //
|
|
3487
|
+ // }
|
|
3488
|
+ // }
|
|
3489
|
+ //
|
|
3490
|
+ //}
|
3598
|
3491
|
|
3599
|
3492
|
return 0
|
3600
|
3493
|
}
|
|
@@ -6932,8 +6825,3 @@ func (c *HisApiController) GetHisDoctorAdviceInfo() {
|
6932
|
6825
|
})
|
6933
|
6826
|
return
|
6934
|
6827
|
}
|
6935
|
|
-
|
6936
|
|
-func GetPrescriptionById(prescription []interface{}) {
|
6937
|
|
-
|
6938
|
|
- fmt.Println("prescription222222222222225555532323332323233223323323322332323232323232332322323323232", prescription)
|
6939
|
|
-}
|