|
@@ -2679,6 +2679,8 @@ func (c *HisApiController) RefundNumber() {
|
2679
|
2679
|
patient_id, _ := c.GetInt64("patient_id")
|
2680
|
2680
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
2681
|
2681
|
|
|
2682
|
+ his_patient_id, _ := c.GetInt64("id")
|
|
2683
|
+
|
2682
|
2684
|
timeLayout := "2006-01-02"
|
2683
|
2685
|
loc, _ := time.LoadLocation("Local")
|
2684
|
2686
|
adminUser := c.GetAdminUserInfo()
|
|
@@ -2689,7 +2691,9 @@ func (c *HisApiController) RefundNumber() {
|
2689
|
2691
|
return
|
2690
|
2692
|
}
|
2691
|
2693
|
recordDateTime := theTime.Unix()
|
2692
|
|
- his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
|
|
2694
|
+ //his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
|
|
2695
|
+
|
|
2696
|
+ his, _ := service.GetHisPatientRecord(adminUser.CurrentOrgId, his_patient_id)
|
2693
|
2697
|
//patientPrescription, _ := service.FindPatientPrescriptionInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
|
2694
|
2698
|
//order, _ := service.GetHisOrderByID(order_id)
|
2695
|
2699
|
miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
|
@@ -2720,17 +2724,37 @@ func (c *HisApiController) RefundNumber() {
|
2720
|
2724
|
return
|
2721
|
2725
|
}
|
2722
|
2726
|
|
2723
|
|
- //err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId)
|
2724
|
|
- service.UpdataRegStatus(patient_id, recordDateTime, adminUser.CurrentOrgId)
|
|
2727
|
+ respJSON3 = respJSON3["data"].(map[string]interface{})["pre"].(map[string]interface{})
|
|
2728
|
+ userJSONBytes3, _ := json.Marshal(respJSON3)
|
2725
|
2729
|
|
2726
|
|
- if err == nil {
|
2727
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
2728
|
|
- "msg": "退号成功",
|
2729
|
|
- })
|
2730
|
|
- } else {
|
|
2730
|
+ var res2 ResultSix
|
|
2731
|
+ if err := json.Unmarshal(userJSONBytes3, &res2); err != nil {
|
|
2732
|
+ utils.ErrorLog("解析失败:%v", err)
|
2731
|
2733
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
2732
|
2734
|
return
|
2733
|
2735
|
}
|
|
2736
|
+
|
|
2737
|
+ if res2.Infcode == 0 {
|
|
2738
|
+ //err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId)
|
|
2739
|
+ service.UpdataRegStatus(patient_id, recordDateTime, adminUser.CurrentOrgId)
|
|
2740
|
+
|
|
2741
|
+ if err == nil {
|
|
2742
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
2743
|
+ "msg": "退号成功",
|
|
2744
|
+ })
|
|
2745
|
+ } else {
|
|
2746
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
2747
|
+ return
|
|
2748
|
+ }
|
|
2749
|
+
|
|
2750
|
+ } else {
|
|
2751
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
2752
|
+ "code": -10,
|
|
2753
|
+ "msg": res2.ErrMsg,
|
|
2754
|
+ })
|
|
2755
|
+
|
|
2756
|
+ }
|
|
2757
|
+
|
2734
|
2758
|
} else {
|
2735
|
2759
|
//err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId)
|
2736
|
2760
|
//if err == nil {
|