|
@@ -3787,7 +3787,7 @@ func (c *HisApiController) ChangeDrugtwo() {
|
3787
|
3787
|
|
3788
|
3788
|
//ids := c.GetString("ids")
|
3789
|
3789
|
//id_arr := strings.Split(ids, ",")
|
3790
|
|
- flows, _ := service.GetNewDrugFlowInfotwo()
|
|
3790
|
+ flows, _ := service.GetNewDrugFlowInfothree123()
|
3791
|
3791
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
3792
|
3792
|
roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
3793
|
3793
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
@@ -3799,40 +3799,42 @@ func (c *HisApiController) ChangeDrugtwo() {
|
3799
|
3799
|
if prescription.OrderStatus == 2 {
|
3800
|
3800
|
//已经结算
|
3801
|
3801
|
//判断是否已经销售
|
3802
|
|
- if item.IsSale == 1 { //是否已经销售,1是 0否
|
3803
|
|
- //是否已经变更 1是 0否
|
3804
|
|
- if item.IsChange == 0 { //没变更,进行变更操作
|
3805
|
|
- bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
|
3806
|
|
-
|
3807
|
|
- result, result2 := ChangeStock(item.Count, item, miConfig, "102", roles, bg_number)
|
3808
|
|
- saveLog(result, result2, "3502", "自动出库,已经销售,未变更3502")
|
3809
|
|
- var respJSON3 map[string]interface{}
|
3810
|
|
- if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
3811
|
|
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
3812
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3813
|
|
- return
|
3814
|
|
- }
|
3815
|
|
- userJSONBytes3, _ := json.Marshal(respJSON3)
|
3816
|
|
- if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
3817
|
|
- utils.ErrorLog("解析失败:%v", err)
|
3818
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3819
|
|
- return
|
3820
|
|
- }
|
3821
|
|
- if res3.Infcode == 0 {
|
3822
|
|
- item.IsChange = 1
|
3823
|
|
- item.BgBchno = bg_number
|
3824
|
|
- service.SaveDF2(item)
|
3825
|
|
- } else {
|
3826
|
|
- err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
3827
|
|
- }
|
3828
|
|
- }
|
3829
|
|
- } else { //没销售,
|
|
3802
|
+ //if item.IsSale == 1 { //是否已经销售,1是 0否
|
|
3803
|
+ // //是否已经变更 1是 0否
|
|
3804
|
+ // if item.IsChange == 0 { //没变更,进行变更操作
|
|
3805
|
+ // bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
|
|
3806
|
+ //
|
|
3807
|
+ // result, result2 := ChangeStock(item.Count, item, miConfig, "102", roles, bg_number)
|
|
3808
|
+ // saveLog(result, result2, "3502", "自动出库,已经销售,未变更3502")
|
|
3809
|
+ // var respJSON3 map[string]interface{}
|
|
3810
|
+ // if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
3811
|
+ // utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
3812
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3813
|
+ // return
|
|
3814
|
+ // }
|
|
3815
|
+ // userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
3816
|
+ // if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
3817
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
3818
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3819
|
+ // return
|
|
3820
|
+ // }
|
|
3821
|
+ // if res3.Infcode == 0 {
|
|
3822
|
+ // item.IsChange = 1
|
|
3823
|
+ // item.BgBchno = bg_number
|
|
3824
|
+ // service.SaveDF2(item)
|
|
3825
|
+ // } else {
|
|
3826
|
+ // err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
|
3827
|
+ // }
|
|
3828
|
+ // }
|
|
3829
|
+ //}
|
|
3830
|
+ //else
|
|
3831
|
+ { //没销售,
|
3830
|
3832
|
var res FJ3507Result
|
3831
|
3833
|
var res3507for10188 FJ3507ResultFor10188
|
3832
|
3834
|
number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3505"
|
3833
|
3835
|
|
3834
|
3836
|
//进行商品销售接口
|
3835
|
|
- result3, result4 := SaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item, miConfig, "", roles, number)
|
|
3837
|
+ result3, result4 := SaleStock10217(c.GetAdminUserInfo().CurrentOrgId, prescription, item, miConfig, "", roles, number)
|
3836
|
3838
|
saveLog(result3, result4, "3505", "自动出库,未销售进行销售行为,3505")
|
3837
|
3839
|
var respJSON3 map[string]interface{}
|
3838
|
3840
|
if err := json.Unmarshal([]byte(string(result3)), &respJSON3); err != nil {
|
|
@@ -3870,60 +3872,61 @@ func (c *HisApiController) ChangeDrugtwo() {
|
3870
|
3872
|
item.Bchno = number
|
3871
|
3873
|
item.SaleDate = time.Now().Format("2006-01-02")
|
3872
|
3874
|
|
3873
|
|
- err5 := service.SaveDF(item)
|
3874
|
|
- if err5 == nil {
|
3875
|
|
- if item.IsChange == 0 { //没变更,进行变更操作
|
3876
|
|
- bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
|
3877
|
|
-
|
3878
|
|
- result, result2 := ChangeStock(item.Count, item, miConfig, "102", roles, bg_number)
|
3879
|
|
- saveLog(result, result2, "3502", "自动出库,没销售,未变更3502")
|
3880
|
|
-
|
3881
|
|
- var respJSON3 map[string]interface{}
|
3882
|
|
- if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
3883
|
|
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
3884
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3885
|
|
- return
|
3886
|
|
- }
|
3887
|
|
-
|
3888
|
|
- if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
|
3889
|
|
- if err := json.Unmarshal(userJSONBytes3, &res3507for10188); err != nil {
|
3890
|
|
- utils.ErrorLog("解析失败:%v", err)
|
3891
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3892
|
|
- return
|
3893
|
|
- }
|
3894
|
|
- //if res3507for10188.Infcode
|
3895
|
|
- res3.InfRefmsgid = res3507for10188.InfRefmsgid
|
3896
|
|
- //res.Output = resSix10265.Output
|
3897
|
|
- res3.ErrMsg = res3507for10188.ErrMsg
|
3898
|
|
- res3.Cainfo = res3507for10188.Cainfo
|
3899
|
|
- res3.WarnMsg = res3507for10188.WarnMsg
|
3900
|
|
- infocode, _ := strconv.ParseInt(res3507for10188.Infcode, 10, 64)
|
3901
|
|
- res3.Infcode = infocode
|
3902
|
|
- } else {
|
3903
|
|
-
|
3904
|
|
- if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
3905
|
|
- utils.ErrorLog("解析失败:%v", err)
|
3906
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3907
|
|
- return
|
3908
|
|
- }
|
3909
|
|
-
|
3910
|
|
- }
|
3911
|
|
-
|
3912
|
|
- if res3.Infcode == 0 {
|
3913
|
|
- item.IsChange = 1
|
3914
|
|
- item.BgBchno = bg_number
|
3915
|
|
- service.SaveDF2(item)
|
3916
|
|
- } else {
|
3917
|
|
- err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
3918
|
|
- }
|
3919
|
|
- }
|
3920
|
|
- }
|
|
3875
|
+ service.SaveDF(item)
|
|
3876
|
+ //if err5 == nil {
|
|
3877
|
+ // if item.IsChange == 0 { //没变更,进行变更操作
|
|
3878
|
+ // bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
|
|
3879
|
+ //
|
|
3880
|
+ // result, result2 := ChangeStock(item.Count, item, miConfig, "102", roles, bg_number)
|
|
3881
|
+ // saveLog(result, result2, "3502", "自动出库,没销售,未变更3502")
|
|
3882
|
+ //
|
|
3883
|
+ // var respJSON3 map[string]interface{}
|
|
3884
|
+ // if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
3885
|
+ // utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
3886
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3887
|
+ // return
|
|
3888
|
+ // }
|
|
3889
|
+ //
|
|
3890
|
+ // if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
|
|
3891
|
+ // if err := json.Unmarshal(userJSONBytes3, &res3507for10188); err != nil {
|
|
3892
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
3893
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3894
|
+ // return
|
|
3895
|
+ // }
|
|
3896
|
+ // //if res3507for10188.Infcode
|
|
3897
|
+ // res3.InfRefmsgid = res3507for10188.InfRefmsgid
|
|
3898
|
+ // //res.Output = resSix10265.Output
|
|
3899
|
+ // res3.ErrMsg = res3507for10188.ErrMsg
|
|
3900
|
+ // res3.Cainfo = res3507for10188.Cainfo
|
|
3901
|
+ // res3.WarnMsg = res3507for10188.WarnMsg
|
|
3902
|
+ // infocode, _ := strconv.ParseInt(res3507for10188.Infcode, 10, 64)
|
|
3903
|
+ // res3.Infcode = infocode
|
|
3904
|
+ // } else {
|
|
3905
|
+ //
|
|
3906
|
+ // if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
3907
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
3908
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3909
|
+ // return
|
|
3910
|
+ // }
|
|
3911
|
+ //
|
|
3912
|
+ // }
|
|
3913
|
+ //
|
|
3914
|
+ // if res3.Infcode == 0 {
|
|
3915
|
+ // item.IsChange = 1
|
|
3916
|
+ // item.BgBchno = bg_number
|
|
3917
|
+ // service.SaveDF2(item)
|
|
3918
|
+ // } else {
|
|
3919
|
+ // err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
|
3920
|
+ // }
|
|
3921
|
+ // }
|
|
3922
|
+ //}
|
3921
|
3923
|
} else {
|
3922
|
3924
|
err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售失败:"+res.ErrMsg)
|
3923
|
3925
|
}
|
3924
|
3926
|
}
|
3925
|
3927
|
|
3926
|
|
- } else { //还没结算
|
|
3928
|
+ } else
|
|
3929
|
+ { //还没结算
|
3927
|
3930
|
var res3507for10188 FJ3507ResultFor10188
|
3928
|
3931
|
|
3929
|
3932
|
if item.IsChange == 0 { //没变更,进行变更操作
|
|
@@ -3964,212 +3967,6 @@ func (c *HisApiController) ChangeDrugtwo() {
|
3964
|
3967
|
|
3965
|
3968
|
}
|
3966
|
3969
|
|
3967
|
|
- if res3.Infcode == 0 {
|
3968
|
|
- item.IsChange = 1
|
3969
|
|
- item.BgBchno = bg_number
|
3970
|
|
- service.SaveDF2(item)
|
3971
|
|
- } else {
|
3972
|
|
- err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
3973
|
|
- }
|
3974
|
|
- }
|
3975
|
|
- }
|
3976
|
|
- } else if item.ConsumableType == 7 {
|
3977
|
|
- var res3507for10188 FJ3507ResultFor10188
|
3978
|
|
-
|
3979
|
|
- prescription := service.GetHisPrescriptionByID(item.HisDoctorAdviceInfo.PrescriptionId)
|
3980
|
|
- order := service.GetHisOrderByNumber(prescription.BatchNumber)
|
3981
|
|
- if order.OrderStatus == 2 || order.OrderStatus == 1 { //已经结算
|
3982
|
|
- //判断是否已经销售
|
3983
|
|
- if item.IsSale == 2 { //是否已经销售,1是 0否
|
3984
|
|
- //是否已经变更 1是 0否
|
3985
|
|
- if item.IsChange == 0 { //没变更,进行变更操作
|
3986
|
|
- bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
|
3987
|
|
-
|
3988
|
|
- result, result2 := ChangeStock(item.Count, item, miConfig, "101", roles, bg_number)
|
3989
|
|
- saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
3990
|
|
-
|
3991
|
|
- var respJSON3 map[string]interface{}
|
3992
|
|
- if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
3993
|
|
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
3994
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3995
|
|
- return
|
3996
|
|
- }
|
3997
|
|
- userJSONBytes3, _ := json.Marshal(respJSON3)
|
3998
|
|
- if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
|
3999
|
|
- if err := json.Unmarshal(userJSONBytes3, &res3507for10188); err != nil {
|
4000
|
|
- utils.ErrorLog("解析失败:%v", err)
|
4001
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4002
|
|
- return
|
4003
|
|
- }
|
4004
|
|
- //if res3507for10188.Infcode
|
4005
|
|
- res3.InfRefmsgid = res3507for10188.InfRefmsgid
|
4006
|
|
- //res.Output = resSix10265.Output
|
4007
|
|
- res3.ErrMsg = res3507for10188.ErrMsg
|
4008
|
|
- res3.Cainfo = res3507for10188.Cainfo
|
4009
|
|
- res3.WarnMsg = res3507for10188.WarnMsg
|
4010
|
|
- infocode, _ := strconv.ParseInt(res3507for10188.Infcode, 10, 64)
|
4011
|
|
- res3.Infcode = infocode
|
4012
|
|
- } else {
|
4013
|
|
-
|
4014
|
|
- if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
4015
|
|
- utils.ErrorLog("解析失败:%v", err)
|
4016
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4017
|
|
- return
|
4018
|
|
- }
|
4019
|
|
-
|
4020
|
|
- }
|
4021
|
|
- if res3.Infcode == 0 {
|
4022
|
|
- item.IsChange = 1
|
4023
|
|
- item.BgBchno = bg_number
|
4024
|
|
- service.SaveDF2(item)
|
4025
|
|
- } else {
|
4026
|
|
- err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
4027
|
|
- }
|
4028
|
|
- }
|
4029
|
|
- } else { //没销售,
|
4030
|
|
- //进行商品销售退货接口
|
4031
|
|
- number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3506"
|
4032
|
|
-
|
4033
|
|
- result111, result222 := CancleSaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item, miConfig, "", roles, number)
|
4034
|
|
- saveLog(result111, result222, "3506", "销售退货")
|
4035
|
|
- var res7 FJ3507Result
|
4036
|
|
-
|
4037
|
|
- //进行商品销售接口
|
4038
|
|
- //result3, result4 := SaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item, miConfig, "", roles,number)
|
4039
|
|
- //saveLog(result3, result4, "3506", "自动退库,未销售退货进行销售退货行为,3505")
|
4040
|
|
- var respJSON3 map[string]interface{}
|
4041
|
|
- if err := json.Unmarshal([]byte(string(result111)), &respJSON3); err != nil {
|
4042
|
|
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
4043
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4044
|
|
- return
|
4045
|
|
- }
|
4046
|
|
- userJSONBytes3, _ := json.Marshal(respJSON3)
|
4047
|
|
-
|
4048
|
|
- if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
|
4049
|
|
- if err := json.Unmarshal(userJSONBytes3, &res3507for10188); err != nil {
|
4050
|
|
- utils.ErrorLog("解析失败:%v", err)
|
4051
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4052
|
|
- return
|
4053
|
|
- }
|
4054
|
|
- //if res3507for10188.Infcode
|
4055
|
|
- res7.InfRefmsgid = res3507for10188.InfRefmsgid
|
4056
|
|
- //res.Output = resSix10265.Output
|
4057
|
|
- res7.ErrMsg = res3507for10188.ErrMsg
|
4058
|
|
- res7.Cainfo = res3507for10188.Cainfo
|
4059
|
|
- res7.WarnMsg = res3507for10188.WarnMsg
|
4060
|
|
- infocode, _ := strconv.ParseInt(res3507for10188.Infcode, 10, 64)
|
4061
|
|
- res7.Infcode = infocode
|
4062
|
|
- } else {
|
4063
|
|
-
|
4064
|
|
- if err := json.Unmarshal(userJSONBytes3, &res7); err != nil {
|
4065
|
|
- utils.ErrorLog("解析失败:%v", err)
|
4066
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4067
|
|
- return
|
4068
|
|
- }
|
4069
|
|
-
|
4070
|
|
- }
|
4071
|
|
- if res7.Infcode == 0 {
|
4072
|
|
- item.IsSale = 2
|
4073
|
|
- item.SaleDate = item.SaleDate
|
4074
|
|
- item.Bchno = number
|
4075
|
|
- service.SaveDF(item)
|
4076
|
|
- if item.IsChange == 0 { //没变更,进行变更操作
|
4077
|
|
- bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
|
4078
|
|
-
|
4079
|
|
- result, result2 := ChangeStock(item.Count, item, miConfig, "101", roles, bg_number)
|
4080
|
|
- saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
4081
|
|
-
|
4082
|
|
- var respJSON3 map[string]interface{}
|
4083
|
|
- if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
4084
|
|
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
4085
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4086
|
|
- return
|
4087
|
|
- }
|
4088
|
|
- userJSONBytes3, _ := json.Marshal(respJSON3)
|
4089
|
|
- //if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
4090
|
|
- // utils.ErrorLog("解析失败:%v", err)
|
4091
|
|
- // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4092
|
|
- // return
|
4093
|
|
- //}
|
4094
|
|
-
|
4095
|
|
- if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
|
4096
|
|
- if err := json.Unmarshal(userJSONBytes3, &res3507for10188); err != nil {
|
4097
|
|
- utils.ErrorLog("解析失败:%v", err)
|
4098
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4099
|
|
- return
|
4100
|
|
- }
|
4101
|
|
- //if res3507for10188.Infcode
|
4102
|
|
- res3.InfRefmsgid = res3507for10188.InfRefmsgid
|
4103
|
|
- //res.Output = resSix10265.Output
|
4104
|
|
- res3.ErrMsg = res3507for10188.ErrMsg
|
4105
|
|
- res3.Cainfo = res3507for10188.Cainfo
|
4106
|
|
- res3.WarnMsg = res3507for10188.WarnMsg
|
4107
|
|
- infocode, _ := strconv.ParseInt(res3507for10188.Infcode, 10, 64)
|
4108
|
|
- res3.Infcode = infocode
|
4109
|
|
- } else {
|
4110
|
|
-
|
4111
|
|
- if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
4112
|
|
- utils.ErrorLog("解析失败:%v", err)
|
4113
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4114
|
|
- return
|
4115
|
|
- }
|
4116
|
|
-
|
4117
|
|
- }
|
4118
|
|
- if res3.Infcode == 0 {
|
4119
|
|
- item.IsChange = 1
|
4120
|
|
- item.BgBchno = bg_number
|
4121
|
|
- service.SaveDF2(item)
|
4122
|
|
- } else {
|
4123
|
|
- err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
4124
|
|
- }
|
4125
|
|
- }
|
4126
|
|
- } else {
|
4127
|
|
- err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res7.ErrMsg)
|
4128
|
|
- }
|
4129
|
|
- }
|
4130
|
|
- } else { //还没结算
|
4131
|
|
- if item.IsChange == 0 { //没变更,进行变更操作
|
4132
|
|
- bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
|
4133
|
|
-
|
4134
|
|
- result, result2 := ChangeStock(item.Count, item, miConfig, "101", roles, bg_number)
|
4135
|
|
- saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
4136
|
|
-
|
4137
|
|
- var respJSON3 map[string]interface{}
|
4138
|
|
- if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
4139
|
|
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
4140
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4141
|
|
- return
|
4142
|
|
- }
|
4143
|
|
- userJSONBytes3, _ := json.Marshal(respJSON3)
|
4144
|
|
- //if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
4145
|
|
- // utils.ErrorLog("解析失败:%v", err)
|
4146
|
|
- // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4147
|
|
- // return
|
4148
|
|
- //}
|
4149
|
|
-
|
4150
|
|
- if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
|
4151
|
|
- if err := json.Unmarshal(userJSONBytes3, &res3507for10188); err != nil {
|
4152
|
|
- utils.ErrorLog("解析失败:%v", err)
|
4153
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4154
|
|
- return
|
4155
|
|
- }
|
4156
|
|
- //if res3507for10188.Infcode
|
4157
|
|
- res3.InfRefmsgid = res3507for10188.InfRefmsgid
|
4158
|
|
- //res.Output = resSix10265.Output
|
4159
|
|
- res3.ErrMsg = res3507for10188.ErrMsg
|
4160
|
|
- res3.Cainfo = res3507for10188.Cainfo
|
4161
|
|
- res3.WarnMsg = res3507for10188.WarnMsg
|
4162
|
|
- infocode, _ := strconv.ParseInt(res3507for10188.Infcode, 10, 64)
|
4163
|
|
- res3.Infcode = infocode
|
4164
|
|
- } else {
|
4165
|
|
-
|
4166
|
|
- if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
4167
|
|
- utils.ErrorLog("解析失败:%v", err)
|
4168
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
4169
|
|
- return
|
4170
|
|
- }
|
4171
|
|
-
|
4172
|
|
- }
|
4173
|
3970
|
if res3.Infcode == 0 {
|
4174
|
3971
|
item.IsChange = 1
|
4175
|
3972
|
item.BgBchno = bg_number
|
|
@@ -4180,6 +3977,213 @@ func (c *HisApiController) ChangeDrugtwo() {
|
4180
|
3977
|
}
|
4181
|
3978
|
}
|
4182
|
3979
|
}
|
|
3980
|
+ //if item.ConsumableType == 7 {
|
|
3981
|
+ // var res3507for10188 FJ3507ResultFor10188
|
|
3982
|
+ //
|
|
3983
|
+ // prescription := service.GetHisPrescriptionByID(item.HisDoctorAdviceInfo.PrescriptionId)
|
|
3984
|
+ // order := service.GetHisOrderByNumber(prescription.BatchNumber)
|
|
3985
|
+ // if order.OrderStatus == 2 || order.OrderStatus == 1 { //已经结算
|
|
3986
|
+ // //判断是否已经销售
|
|
3987
|
+ // if item.IsSale == 2 { //是否已经销售,1是 0否
|
|
3988
|
+ // //是否已经变更 1是 0否
|
|
3989
|
+ // if item.IsChange == 0 { //没变更,进行变更操作
|
|
3990
|
+ // bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
|
|
3991
|
+ //
|
|
3992
|
+ // result, result2 := ChangeStock(item.Count, item, miConfig, "101", roles, bg_number)
|
|
3993
|
+ // saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
|
3994
|
+ //
|
|
3995
|
+ // var respJSON3 map[string]interface{}
|
|
3996
|
+ // if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
3997
|
+ // utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
3998
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3999
|
+ // return
|
|
4000
|
+ // }
|
|
4001
|
+ // userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
4002
|
+ // if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
|
|
4003
|
+ // if err := json.Unmarshal(userJSONBytes3, &res3507for10188); err != nil {
|
|
4004
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
4005
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4006
|
+ // return
|
|
4007
|
+ // }
|
|
4008
|
+ // //if res3507for10188.Infcode
|
|
4009
|
+ // res3.InfRefmsgid = res3507for10188.InfRefmsgid
|
|
4010
|
+ // //res.Output = resSix10265.Output
|
|
4011
|
+ // res3.ErrMsg = res3507for10188.ErrMsg
|
|
4012
|
+ // res3.Cainfo = res3507for10188.Cainfo
|
|
4013
|
+ // res3.WarnMsg = res3507for10188.WarnMsg
|
|
4014
|
+ // infocode, _ := strconv.ParseInt(res3507for10188.Infcode, 10, 64)
|
|
4015
|
+ // res3.Infcode = infocode
|
|
4016
|
+ // } else {
|
|
4017
|
+ //
|
|
4018
|
+ // if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
4019
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
4020
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4021
|
+ // return
|
|
4022
|
+ // }
|
|
4023
|
+ //
|
|
4024
|
+ // }
|
|
4025
|
+ // if res3.Infcode == 0 {
|
|
4026
|
+ // item.IsChange = 1
|
|
4027
|
+ // item.BgBchno = bg_number
|
|
4028
|
+ // service.SaveDF2(item)
|
|
4029
|
+ // } else {
|
|
4030
|
+ // err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
|
4031
|
+ // }
|
|
4032
|
+ // }
|
|
4033
|
+ // } else { //没销售,
|
|
4034
|
+ // //进行商品销售退货接口
|
|
4035
|
+ // number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3506"
|
|
4036
|
+ //
|
|
4037
|
+ // result111, result222 := CancleSaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item, miConfig, "", roles, number)
|
|
4038
|
+ // saveLog(result111, result222, "3506", "销售退货")
|
|
4039
|
+ // var res7 FJ3507Result
|
|
4040
|
+ //
|
|
4041
|
+ // //进行商品销售接口
|
|
4042
|
+ // //result3, result4 := SaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item, miConfig, "", roles,number)
|
|
4043
|
+ // //saveLog(result3, result4, "3506", "自动退库,未销售退货进行销售退货行为,3505")
|
|
4044
|
+ // var respJSON3 map[string]interface{}
|
|
4045
|
+ // if err := json.Unmarshal([]byte(string(result111)), &respJSON3); err != nil {
|
|
4046
|
+ // utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
4047
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4048
|
+ // return
|
|
4049
|
+ // }
|
|
4050
|
+ // userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
4051
|
+ //
|
|
4052
|
+ // if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
|
|
4053
|
+ // if err := json.Unmarshal(userJSONBytes3, &res3507for10188); err != nil {
|
|
4054
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
4055
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4056
|
+ // return
|
|
4057
|
+ // }
|
|
4058
|
+ // //if res3507for10188.Infcode
|
|
4059
|
+ // res7.InfRefmsgid = res3507for10188.InfRefmsgid
|
|
4060
|
+ // //res.Output = resSix10265.Output
|
|
4061
|
+ // res7.ErrMsg = res3507for10188.ErrMsg
|
|
4062
|
+ // res7.Cainfo = res3507for10188.Cainfo
|
|
4063
|
+ // res7.WarnMsg = res3507for10188.WarnMsg
|
|
4064
|
+ // infocode, _ := strconv.ParseInt(res3507for10188.Infcode, 10, 64)
|
|
4065
|
+ // res7.Infcode = infocode
|
|
4066
|
+ // } else {
|
|
4067
|
+ //
|
|
4068
|
+ // if err := json.Unmarshal(userJSONBytes3, &res7); err != nil {
|
|
4069
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
4070
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4071
|
+ // return
|
|
4072
|
+ // }
|
|
4073
|
+ //
|
|
4074
|
+ // }
|
|
4075
|
+ // if res7.Infcode == 0 {
|
|
4076
|
+ // item.IsSale = 2
|
|
4077
|
+ // item.SaleDate = item.SaleDate
|
|
4078
|
+ // item.Bchno = number
|
|
4079
|
+ // service.SaveDF(item)
|
|
4080
|
+ // if item.IsChange == 0 { //没变更,进行变更操作
|
|
4081
|
+ // bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
|
|
4082
|
+ //
|
|
4083
|
+ // result, result2 := ChangeStock(item.Count, item, miConfig, "101", roles, bg_number)
|
|
4084
|
+ // saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
|
4085
|
+ //
|
|
4086
|
+ // var respJSON3 map[string]interface{}
|
|
4087
|
+ // if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
4088
|
+ // utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
4089
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4090
|
+ // return
|
|
4091
|
+ // }
|
|
4092
|
+ // userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
4093
|
+ // //if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
4094
|
+ // // utils.ErrorLog("解析失败:%v", err)
|
|
4095
|
+ // // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4096
|
+ // // return
|
|
4097
|
+ // //}
|
|
4098
|
+ //
|
|
4099
|
+ // if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
|
|
4100
|
+ // if err := json.Unmarshal(userJSONBytes3, &res3507for10188); err != nil {
|
|
4101
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
4102
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4103
|
+ // return
|
|
4104
|
+ // }
|
|
4105
|
+ // //if res3507for10188.Infcode
|
|
4106
|
+ // res3.InfRefmsgid = res3507for10188.InfRefmsgid
|
|
4107
|
+ // //res.Output = resSix10265.Output
|
|
4108
|
+ // res3.ErrMsg = res3507for10188.ErrMsg
|
|
4109
|
+ // res3.Cainfo = res3507for10188.Cainfo
|
|
4110
|
+ // res3.WarnMsg = res3507for10188.WarnMsg
|
|
4111
|
+ // infocode, _ := strconv.ParseInt(res3507for10188.Infcode, 10, 64)
|
|
4112
|
+ // res3.Infcode = infocode
|
|
4113
|
+ // } else {
|
|
4114
|
+ //
|
|
4115
|
+ // if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
4116
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
4117
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4118
|
+ // return
|
|
4119
|
+ // }
|
|
4120
|
+ //
|
|
4121
|
+ // }
|
|
4122
|
+ // if res3.Infcode == 0 {
|
|
4123
|
+ // item.IsChange = 1
|
|
4124
|
+ // item.BgBchno = bg_number
|
|
4125
|
+ // service.SaveDF2(item)
|
|
4126
|
+ // } else {
|
|
4127
|
+ // err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
|
4128
|
+ // }
|
|
4129
|
+ // }
|
|
4130
|
+ // } else {
|
|
4131
|
+ // err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res7.ErrMsg)
|
|
4132
|
+ // }
|
|
4133
|
+ // }
|
|
4134
|
+ // } else { //还没结算
|
|
4135
|
+ // if item.IsChange == 0 { //没变更,进行变更操作
|
|
4136
|
+ // bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
|
|
4137
|
+ //
|
|
4138
|
+ // result, result2 := ChangeStock(item.Count, item, miConfig, "101", roles, bg_number)
|
|
4139
|
+ // saveLog(result, result2, "3502", "自动出库,未销售,未变更3502")
|
|
4140
|
+ //
|
|
4141
|
+ // var respJSON3 map[string]interface{}
|
|
4142
|
+ // if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
|
|
4143
|
+ // utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
4144
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4145
|
+ // return
|
|
4146
|
+ // }
|
|
4147
|
+ // userJSONBytes3, _ := json.Marshal(respJSON3)
|
|
4148
|
+ // //if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
4149
|
+ // // utils.ErrorLog("解析失败:%v", err)
|
|
4150
|
+ // // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4151
|
+ // // return
|
|
4152
|
+ // //}
|
|
4153
|
+ //
|
|
4154
|
+ // if c.GetAdminUserInfo().CurrentOrgId == 10188 || c.GetAdminUserInfo().CurrentOrgId == 10217 {
|
|
4155
|
+ // if err := json.Unmarshal(userJSONBytes3, &res3507for10188); err != nil {
|
|
4156
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
4157
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4158
|
+ // return
|
|
4159
|
+ // }
|
|
4160
|
+ // //if res3507for10188.Infcode
|
|
4161
|
+ // res3.InfRefmsgid = res3507for10188.InfRefmsgid
|
|
4162
|
+ // //res.Output = resSix10265.Output
|
|
4163
|
+ // res3.ErrMsg = res3507for10188.ErrMsg
|
|
4164
|
+ // res3.Cainfo = res3507for10188.Cainfo
|
|
4165
|
+ // res3.WarnMsg = res3507for10188.WarnMsg
|
|
4166
|
+ // infocode, _ := strconv.ParseInt(res3507for10188.Infcode, 10, 64)
|
|
4167
|
+ // res3.Infcode = infocode
|
|
4168
|
+ // } else {
|
|
4169
|
+ //
|
|
4170
|
+ // if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
|
|
4171
|
+ // utils.ErrorLog("解析失败:%v", err)
|
|
4172
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4173
|
+ // return
|
|
4174
|
+ // }
|
|
4175
|
+ //
|
|
4176
|
+ // }
|
|
4177
|
+ // if res3.Infcode == 0 {
|
|
4178
|
+ // item.IsChange = 1
|
|
4179
|
+ // item.BgBchno = bg_number
|
|
4180
|
+ // service.SaveDF2(item)
|
|
4181
|
+ // } else {
|
|
4182
|
+ // err = append(err, item.HisDoctorAdviceInfo.AdviceName+",销售变更失败:"+res3.ErrMsg)
|
|
4183
|
+ // }
|
|
4184
|
+ // }
|
|
4185
|
+ // }
|
|
4186
|
+ //}
|
4183
|
4187
|
}
|
4184
|
4188
|
if len(err) == 0 {
|
4185
|
4189
|
c.ServeSuccessJSON(map[string]interface{}{
|
|
@@ -5254,9 +5258,11 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
|
5254
|
5258
|
struct3505.FixmedinsHilistName = drug.HisDoctorAdviceInfo.BaseDrugLib.DrugName
|
5255
|
5259
|
struct3505.FixmedinsBchno = number
|
5256
|
5260
|
struct3505.Opter = role.UserName
|
5257
|
|
-
|
|
5261
|
+ struct3505.Bchno = "---"
|
5258
|
5262
|
struct3505.FixmedinsCode = miConfig.Code
|
5259
|
5263
|
struct3505.Code = miConfig.Code
|
|
5264
|
+ struct3505.FinlTrnsPric = drug.HisDoctorAdviceInfo.Price
|
|
5265
|
+
|
5260
|
5266
|
|
5261
|
5267
|
roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
5262
|
5268
|
struct3505.PrscDrName = roles.UserName
|
|
@@ -5315,9 +5321,9 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
|
5315
|
5321
|
struct3505.MdtrtSn = order.MdtrtId
|
5316
|
5322
|
struct3505.ManuLotnum = drug.Number
|
5317
|
5323
|
struct3505.ManuDate = time.Unix(drug.ProductDate, 0).Format("2006-01-02")
|
5318
|
|
- struct3505.ExpyEnd = ""
|
|
5324
|
+ struct3505.ExpyEnd = time.Unix(drug.ExpireDate, 0).Format("2006-01-02")
|
5319
|
5325
|
struct3505.RxFlag = "1"
|
5320
|
|
- struct3505.TrdnFlag = "1"
|
|
5326
|
+ struct3505.TrdnFlag = "0"
|
5321
|
5327
|
struct3505.RtalDocno = order.Number
|
5322
|
5328
|
struct3505.PsnCertType = "01"
|
5323
|
5329
|
|
|
@@ -5392,6 +5398,153 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
|
5392
|
5398
|
|
5393
|
5399
|
}
|
5394
|
5400
|
|
|
5401
|
+}
|
|
5402
|
+
|
|
5403
|
+func SaleStock10217(org_id int64, pre models.HisPrescription, drug *models.DrugFlow, miConfig models.MedicalInsuranceOrgConfig, chgType string, role models.UserAdminRole, number string) (string, string) {
|
|
5404
|
+ var struct3505 models.Struct3505
|
|
5405
|
+ struct3505.MedListCodg = drug.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
|
|
5406
|
+ struct3505.FixmedinsHilistId = drug.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
|
|
5407
|
+ struct3505.FixmedinsHilistName = drug.HisDoctorAdviceInfo.BaseDrugLib.DrugName
|
|
5408
|
+ struct3505.FixmedinsBchno = number
|
|
5409
|
+ struct3505.Opter = role.UserName
|
|
5410
|
+
|
|
5411
|
+ struct3505.FixmedinsCode = miConfig.Code
|
|
5412
|
+ struct3505.Code = miConfig.Code
|
|
5413
|
+
|
|
5414
|
+ roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
|
5415
|
+ struct3505.PrscDrName = roles.UserName
|
|
5416
|
+ if org_id == 10191 {
|
|
5417
|
+ struct3505.PharName = "刘水山"
|
|
5418
|
+ struct3505.PharPracCertNo = "2015026350260000002611351127"
|
|
5419
|
+ }
|
|
5420
|
+
|
|
5421
|
+ if org_id == 10188 {
|
|
5422
|
+ struct3505.PharName = "李汉清"
|
|
5423
|
+ struct3505.PharPracCertNo = "30220200932022010034"
|
|
5424
|
+ }
|
|
5425
|
+
|
|
5426
|
+ if org_id == 10217 {
|
|
5427
|
+ struct3505.PharName = "张敏"
|
|
5428
|
+ struct3505.PharPracCertNo = "30220230432090100108"
|
|
5429
|
+ }
|
|
5430
|
+
|
|
5431
|
+ if org_id == 10318 {
|
|
5432
|
+ struct3505.PharName = "邹刘阳"
|
|
5433
|
+ struct3505.PharPracCertNo = "210441200001378"
|
|
5434
|
+ }
|
|
5435
|
+
|
|
5436
|
+ if org_id == 10402 {
|
|
5437
|
+ struct3505.PharName = "刘韶健"
|
|
5438
|
+ struct3505.PharPracCertNo = "2015026440262015440501001198"
|
|
5439
|
+ }
|
|
5440
|
+
|
|
5441
|
+
|
|
5442
|
+
|
|
5443
|
+ if org_id == 9919 {
|
|
5444
|
+ struct3505.PharName = "周君权"
|
|
5445
|
+ struct3505.PharPracCertNo = "089644396094401375"
|
|
5446
|
+ }
|
|
5447
|
+
|
|
5448
|
+
|
|
5449
|
+ if org_id == 10644 {
|
|
5450
|
+ struct3505.PharName = "陈金娣"
|
|
5451
|
+ struct3505.PharPracCertNo = "20181441500320100066"
|
|
5452
|
+ }
|
|
5453
|
+
|
|
5454
|
+ if org_id == 10567 {
|
|
5455
|
+ struct3505.PharName = "范小兰"
|
|
5456
|
+ struct3505.PharPracCertNo = "0200102079485"
|
|
5457
|
+ }
|
|
5458
|
+ if org_id == 10721 {
|
|
5459
|
+ struct3505.PharName = "孙莉侠"
|
|
5460
|
+ struct3505.PharPracCertNo = "060399"
|
|
5461
|
+ }
|
|
5462
|
+ if org_id == 10726 {
|
|
5463
|
+ struct3505.PharName = "彭建福"
|
|
5464
|
+ struct3505.PharPracCertNo = "D445281006261"
|
|
5465
|
+ }
|
|
5466
|
+ order := service.GetHisOrderByNumber(pre.BatchNumber)
|
|
5467
|
+ struct3505.SetlId = order.SetlId
|
|
5468
|
+ struct3505.MdtrtSn = order.MdtrtId
|
|
5469
|
+ struct3505.ManuLotnum = drug.Number
|
|
5470
|
+ struct3505.ManuDate = time.Unix(drug.ProductDate, 0).Format("2006-01-02")
|
|
5471
|
+ struct3505.ExpyEnd = time.Unix(drug.ExpireDate, 0).Format("2006-01-02")
|
|
5472
|
+ struct3505.RxFlag = "1"
|
|
5473
|
+ struct3505.TrdnFlag = "0"
|
|
5474
|
+ struct3505.RtalDocno = order.Number
|
|
5475
|
+ struct3505.PsnCertType = "01"
|
|
5476
|
+
|
|
5477
|
+ struct3505.CertNo = order.Certno
|
|
5478
|
+ struct3505.PsnNo = order.PsnNo
|
|
5479
|
+ struct3505.PsnName = order.PsnName
|
|
5480
|
+
|
|
5481
|
+ struct3505.Url = miConfig.Url
|
|
5482
|
+ struct3505.AppId = miConfig.Cainfo
|
|
5483
|
+ struct3505.AppSecret = miConfig.AppSecret
|
|
5484
|
+ struct3505.Enckey = miConfig.EncKey
|
|
5485
|
+ struct3505.SignKey = miConfig.SignKey
|
|
5486
|
+ struct3505.SecretKey = miConfig.SecretKey
|
|
5487
|
+ strValue := fmt.Sprintf("%.2f", drug.HisDoctorAdviceInfo.PrescribingNumber)
|
|
5488
|
+ struct3505.SelRetnCnt = strValue
|
|
5489
|
+ struct3505.SelRetnTime = time.Unix(drug.HisDoctorAdviceInfo.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
|
5490
|
+ struct3505.SelRetnOpterName = role.UserName
|
|
5491
|
+ if order.IsMedicineInsurance == 1 {
|
|
5492
|
+ struct3505.MdtrtSetlType = "1"
|
|
5493
|
+ } else {
|
|
5494
|
+ struct3505.MdtrtSetlType = "2"
|
|
5495
|
+ }
|
|
5496
|
+ struct3505.OrgName = miConfig.OrgName
|
|
5497
|
+ struct3505.AccessKey = miConfig.AccessKey
|
|
5498
|
+ struct3505.RequestUrl = miConfig.Url
|
|
5499
|
+ struct3505.SecretKey = miConfig.SecretKey
|
|
5500
|
+ struct3505.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
5501
|
+ struct3505.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
5502
|
+ struct3505.Cainfo = miConfig.Cainfo
|
|
5503
|
+ struct3505.DrugTracCodg = drug.DrugCode
|
|
5504
|
+
|
|
5505
|
+ if miConfig.MdtrtareaAdmvs == "350500" {
|
|
5506
|
+ result1, result2, _ := service.FJyb3505(struct3505)
|
|
5507
|
+ return result1, result2
|
|
5508
|
+ } else if miConfig.MdtrtareaAdmvs == "440100" {
|
|
5509
|
+ result1, result2 := service.Gzyb3505(struct3505, struct3505.SecretKey)
|
|
5510
|
+ return result1, result2
|
|
5511
|
+ } else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") {
|
|
5512
|
+ result1, result2 := service.Gdyb3505(struct3505, struct3505.SecretKey)
|
|
5513
|
+ return result1, result2
|
|
5514
|
+ }else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "361") {
|
|
5515
|
+ result1, result2 := service.JXyb3505(struct3505, struct3505.SecretKey,struct3505.AccessKey,struct3505.RequestUrl)
|
|
5516
|
+ return result1, result2
|
|
5517
|
+ }else if miConfig.MdtrtareaAdmvs == "340699" {
|
|
5518
|
+ result1, result2 := service.AHyb3505(struct3505, struct3505.SecretKey,struct3505.RequestUrl)
|
|
5519
|
+ return result1, result2
|
|
5520
|
+ } else {
|
|
5521
|
+ data := make(map[string]interface{})
|
|
5522
|
+ data["struct_3505s"] = struct3505
|
|
5523
|
+ client := &http.Client{}
|
|
5524
|
+ bytesData, _ := json.Marshal(data)
|
|
5525
|
+ var req *http.Request
|
|
5526
|
+ if miConfig.MdtrtareaAdmvs == "320921" {
|
|
5527
|
+ req, _ = http.NewRequest("POST", "http://192.168.2.3:9532/"+"jsyb/3505", bytes.NewReader(bytesData))
|
|
5528
|
+ } else {
|
|
5529
|
+ req, _ = http.NewRequest("POST", "http://192.168.5.251:9532/"+"jsyb/3505", bytes.NewReader(bytesData))
|
|
5530
|
+ }
|
|
5531
|
+ resp, _ := client.Do(req)
|
|
5532
|
+ defer resp.Body.Close()
|
|
5533
|
+ body, ioErr := ioutil.ReadAll(resp.Body)
|
|
5534
|
+ if ioErr != nil {
|
|
5535
|
+ utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
|
|
5536
|
+ }
|
|
5537
|
+ var respJSON map[string]interface{}
|
|
5538
|
+ if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
|
|
5539
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
5540
|
+ }
|
|
5541
|
+ //var resSix10265 ResultSix10265 //1101结果
|
|
5542
|
+ respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
|
|
5543
|
+ result, _ := json.Marshal(respJSON)
|
|
5544
|
+ return string(result), ""
|
|
5545
|
+
|
|
5546
|
+ }
|
|
5547
|
+
|
5395
|
5548
|
}
|
5396
|
5549
|
func CancleSaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow, miConfig models.MedicalInsuranceOrgConfig, chgType string, role models.UserAdminRole, number string) (string, string) {
|
5397
|
5550
|
var struct3506 models.Struct3506
|
|
@@ -25856,8 +26009,9 @@ func (c *HisApiController) GetRegisterInfo() {
|
25856
|
26009
|
bas := strings.Split(psn_info.CardInfo, "|")
|
25857
|
26010
|
cert_no = bas[2]
|
25858
|
26011
|
} else if id_card_type == 4 {
|
25859
|
|
- cert_no = IdCardNo
|
|
26012
|
+ cert_no = psn_info.VerifyNumber
|
25860
|
26013
|
psn_info.VerifyNumber = psn_info.VerifyNumber
|
|
26014
|
+ IdCardNo = psn_info.VerifyNumber
|
25861
|
26015
|
} else {
|
25862
|
26016
|
cert_no = IdCardNo
|
25863
|
26017
|
psn_info.VerifyNumber = cert_no
|
|
@@ -25918,8 +26072,9 @@ func (c *HisApiController) GetRegisterInfo() {
|
25918
|
26072
|
bas := strings.Split(psn_info.CardInfo, "|")
|
25919
|
26073
|
cert_no = bas[2]
|
25920
|
26074
|
} else if id_card_type == 4 {
|
25921
|
|
- cert_no = IdCardNo
|
|
26075
|
+ cert_no = psn_info.VerifyNumber
|
25922
|
26076
|
psn_info.VerifyNumber = psn_info.VerifyNumber
|
|
26077
|
+ IdCardNo = psn_info.VerifyNumber
|
25923
|
26078
|
} else {
|
25924
|
26079
|
cert_no = IdCardNo
|
25925
|
26080
|
psn_info.VerifyNumber = cert_no
|
|
@@ -29290,7 +29445,7 @@ func (c *HisApiController) GetUploadInfo() {
|
29290
|
29445
|
psn_info.VerifyNumber = his.Certno + "|" + psn_info.VerifyNumber
|
29291
|
29446
|
} else if his.IdCardType == 4 {
|
29292
|
29447
|
psn_info.VerifyNumber = strings.Replace(psn_info.VerifyNumber, "+", "%2B", -1)
|
29293
|
|
- cert_no = his.Certno
|
|
29448
|
+ cert_no =psn_info.VerifyNumber
|
29294
|
29449
|
psn_info.VerifyNumber = psn_info.VerifyNumber
|
29295
|
29450
|
} else {
|
29296
|
29451
|
cert_no = his.Certno
|
|
@@ -32491,7 +32646,7 @@ func (c *HisApiController) GetPreUploadInfo() {
|
32491
|
32646
|
|
32492
|
32647
|
if his.IdCardType == 4 {
|
32493
|
32648
|
psn_info.VerifyNumber = psn_info.VerifyNumber
|
32494
|
|
- cert_no = psn_info.Certno
|
|
32649
|
+ cert_no = psn_info.VerifyNumber
|
32495
|
32650
|
} else if his.IdCardType == 2 {
|
32496
|
32651
|
cert_no = psn_info.Certno
|
32497
|
32652
|
psn_info.VerifyNumber = psn_info.Certno
|