|
@@ -70,6 +70,10 @@ func HisManagerApiRegistRouters() {
|
70
|
70
|
beego.Router("/api/batchsettlelist/get", &HisApiController{}, "get:GetBatchSettleList")
|
71
|
71
|
beego.Router("/api/psn/info", &HisApiController{}, "get:GetPsnNcdsInfo")
|
72
|
72
|
|
|
73
|
+ beego.Router("/api/allopatry/get", &HisApiController{}, "get:GetAllopatry")
|
|
74
|
+ beego.Router("/api/comfirmallopatry/post", &HisApiController{}, "post:ComfirmAllopatry")
|
|
75
|
+ beego.Router("/api/allopatry/refund", &HisApiController{}, "post:RefundAllopatry")
|
|
76
|
+
|
73
|
77
|
}
|
74
|
78
|
func (c *HisApiController) GetPsnNcdsInfo() {
|
75
|
79
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
@@ -9078,142 +9082,205 @@ func (c *HisApiController) ReversalData() {
|
9078
|
9082
|
fmt.Println(result)
|
9079
|
9083
|
}
|
9080
|
9084
|
}
|
9081
|
|
-func (c *HisApiController) ReversalOtherData() {
|
9082
|
|
- var customData []*CustomData
|
9083
|
|
-
|
9084
|
|
- custom := &CustomData{
|
9085
|
|
- MsgId: "H44022900158202103301714472004",
|
9086
|
|
- PsnNo: "44020000001101329945",
|
9087
|
|
- Info: "2208",
|
9088
|
|
- }
|
9089
|
|
- customData = append(customData, custom)
|
9090
|
|
-
|
9091
|
|
- custom1 := &CustomData{
|
9092
|
|
- MsgId: "H4402290015820210330172057803",
|
9093
|
|
- PsnNo: "44020000001101161813",
|
9094
|
|
- Info: "2208",
|
9095
|
|
- }
|
9096
|
|
- customData = append(customData, custom1)
|
9097
|
|
- custom2 := &CustomData{
|
9098
|
|
- MsgId: "H44022900158202103301705198813",
|
9099
|
|
- PsnNo: "44190000133097375417",
|
9100
|
|
- Info: "2208",
|
9101
|
|
- }
|
9102
|
|
- customData = append(customData, custom2)
|
9103
|
|
- custom3 := &CustomData{
|
9104
|
|
- MsgId: "H44022900158202103301715524756",
|
9105
|
|
- PsnNo: "44020000001100187221",
|
9106
|
|
- Info: "2208",
|
9107
|
|
- }
|
9108
|
|
- customData = append(customData, custom3)
|
9109
|
|
- custom4 := &CustomData{
|
9110
|
|
- MsgId: "H44022900158202103301730376224",
|
9111
|
|
- PsnNo: "44020000001101959155",
|
9112
|
|
- Info: "2208",
|
9113
|
|
- }
|
9114
|
|
- customData = append(customData, custom4)
|
9115
|
|
- custom5 := &CustomData{
|
9116
|
|
- MsgId: "H44022900158202103301748008725",
|
9117
|
|
- PsnNo: "44020000001104246641",
|
9118
|
|
- Info: "2208",
|
9119
|
|
- }
|
9120
|
|
- customData = append(customData, custom5)
|
9121
|
|
- custom6 := &CustomData{
|
9122
|
|
- MsgId: "H44022900158202103301718096755",
|
9123
|
|
- PsnNo: "44020000001102211860",
|
9124
|
|
- Info: "2208",
|
9125
|
|
- }
|
9126
|
|
- customData = append(customData, custom6)
|
9127
|
|
- custom7 := &CustomData{
|
9128
|
|
- MsgId: "H44022900158202103301736551640",
|
9129
|
|
- PsnNo: "44020000001102687718",
|
9130
|
|
- Info: "2208",
|
9131
|
|
- }
|
9132
|
|
-
|
9133
|
|
- customData = append(customData, custom7)
|
9134
|
|
-
|
9135
|
|
- custom8 := &CustomData{
|
9136
|
|
- MsgId: "H44022900158202103301743097676",
|
9137
|
|
- PsnNo: "44020000001102127785",
|
9138
|
|
- Info: "2208",
|
9139
|
|
- }
|
9140
|
|
- customData = append(customData, custom8)
|
9141
|
|
- custom9 := &CustomData{
|
9142
|
|
- MsgId: "H44022900158202103301712304203",
|
9143
|
|
- PsnNo: "44020000001101518097",
|
9144
|
|
- Info: "2208",
|
9145
|
|
- }
|
9146
|
|
- customData = append(customData, custom9)
|
9147
|
|
- custom10 := &CustomData{
|
9148
|
|
- MsgId: "H44022900158202103301738448785",
|
9149
|
|
- PsnNo: "44020000001100500813",
|
9150
|
|
- Info: "2208",
|
9151
|
|
- }
|
9152
|
|
- customData = append(customData, custom10)
|
9153
|
|
-
|
9154
|
|
- custom11 := &CustomData{
|
9155
|
|
- MsgId: "H44022900158202103301732455843",
|
9156
|
|
- PsnNo: "44020000001102690557",
|
9157
|
|
- Info: "2208",
|
9158
|
|
- }
|
9159
|
|
-
|
9160
|
|
- customData = append(customData, custom11)
|
9161
|
|
-
|
9162
|
|
- custom12 := &CustomData{
|
9163
|
|
- MsgId: "H44022900158202103301745421708",
|
9164
|
|
- PsnNo: "44020000001102211928",
|
9165
|
|
- Info: "2208",
|
|
9085
|
+func (c *HisApiController) GetAllopatry() {
|
|
9086
|
+ year := c.GetString("year")
|
|
9087
|
+ month := c.GetString("month")
|
|
9088
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
9089
|
+ adminUser := c.GetAdminUserInfo()
|
|
9090
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
|
9091
|
+ roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
|
9092
|
+ result, _ := service.Gdyb3260(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month)
|
|
9093
|
+ var dat map[string]interface{}
|
|
9094
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
9095
|
+ fmt.Println(dat)
|
|
9096
|
+ } else {
|
|
9097
|
+ fmt.Println(err)
|
9166
|
9098
|
}
|
9167
|
|
- customData = append(customData, custom12)
|
9168
|
|
-
|
9169
|
|
- custom1212 := &CustomData{
|
9170
|
|
- MsgId: "H440229001582021033017351627",
|
9171
|
|
- PsnNo: "44020000001102481733",
|
9172
|
|
- Info: "2208",
|
|
9099
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
9100
|
+ var res2 models.Result3260
|
|
9101
|
+ if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
|
|
9102
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
9103
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
9104
|
+ return
|
9173
|
9105
|
}
|
9174
|
|
- customData = append(customData, custom1212)
|
|
9106
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
9107
|
+ "result": res2,
|
|
9108
|
+ })
|
9175
|
9109
|
|
9176
|
|
- custom13 := &CustomData{
|
9177
|
|
- MsgId: "H44022900158202103301740327951",
|
9178
|
|
- PsnNo: "44020000001103174866",
|
9179
|
|
- Info: "2208",
|
9180
|
|
- }
|
9181
|
|
- customData = append(customData, custom13)
|
9182
|
|
- custom14 := &CustomData{
|
9183
|
|
- MsgId: "H4402290015820210330174922668",
|
9184
|
|
- PsnNo: "44020000001102927272",
|
9185
|
|
- Info: "2208",
|
9186
|
|
- }
|
9187
|
|
- customData = append(customData, custom14)
|
9188
|
|
- custom15 := &CustomData{
|
9189
|
|
- MsgId: "H44022900158202103301752362273",
|
9190
|
|
- PsnNo: "44020000001102942890",
|
9191
|
|
- Info: "2208",
|
|
9110
|
+}
|
|
9111
|
+func (c *HisApiController) ComfirmAllopatry() {
|
|
9112
|
+ year := c.GetString("year")
|
|
9113
|
+ month := c.GetString("month")
|
|
9114
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
9115
|
+ adminUser := c.GetAdminUserInfo()
|
|
9116
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
|
9117
|
+ roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
|
9118
|
+ result, _ := service.Gdyb3261(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month)
|
|
9119
|
+ var dat map[string]interface{}
|
|
9120
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
9121
|
+ fmt.Println(dat)
|
|
9122
|
+ } else {
|
|
9123
|
+ fmt.Println(err)
|
9192
|
9124
|
}
|
9193
|
|
- customData = append(customData, custom15)
|
9194
|
|
-
|
9195
|
|
- custom16 := &CustomData{
|
9196
|
|
- MsgId: "H44022900158202103301751082917",
|
9197
|
|
- PsnNo: "44020000001101662162",
|
9198
|
|
- Info: "2208",
|
|
9125
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
9126
|
+ var res2 models.Result3261
|
|
9127
|
+ if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
|
|
9128
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
9129
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
9130
|
+ return
|
9199
|
9131
|
}
|
9200
|
|
- customData = append(customData, custom16)
|
|
9132
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
9133
|
+ "result": res2,
|
|
9134
|
+ })
|
9201
|
9135
|
|
9202
|
|
- custom17 := &CustomData{
|
9203
|
|
- MsgId: "H44022900158202103301754147728",
|
9204
|
|
- PsnNo: "44020000000229014511",
|
9205
|
|
- Info: "2208",
|
9206
|
|
- }
|
9207
|
|
- customData = append(customData, custom17)
|
|
9136
|
+}
|
9208
|
9137
|
|
9209
|
|
- adminUser := c.GetAdminUserInfo()
|
9210
|
|
- miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
|
9138
|
+//func (c *HisApiController) RefundAllopatry() {
|
|
9139
|
+// year := c.GetString("year")
|
|
9140
|
+// month := c.GetString("month")
|
|
9141
|
+// admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
9142
|
+// adminUser := c.GetAdminUserInfo()
|
|
9143
|
+// miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
|
9144
|
+// roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
|
9145
|
+//
|
|
9146
|
+//}
|
9211
|
9147
|
|
9212
|
|
- for _, item := range customData {
|
9213
|
|
- result := service.Gdyb2601(item.PsnNo, item.MsgId, item.Info, miConfig.OrgName, "张俊杰", miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey)
|
9214
|
|
- fmt.Println(result)
|
9215
|
|
- }
|
9216
|
|
-}
|
|
9148
|
+//func (c *HisApiController) ReversalOtherData() {
|
|
9149
|
+// var customData []*CustomData
|
|
9150
|
+//
|
|
9151
|
+// custom := &CustomData{
|
|
9152
|
+// MsgId: "H44022900158202103301714472004",
|
|
9153
|
+// PsnNo: "44020000001101329945",
|
|
9154
|
+// Info: "2208",
|
|
9155
|
+// }
|
|
9156
|
+// customData = append(customData, custom)
|
|
9157
|
+//
|
|
9158
|
+// custom1 := &CustomData{
|
|
9159
|
+// MsgId: "H4402290015820210330172057803",
|
|
9160
|
+// PsnNo: "44020000001101161813",
|
|
9161
|
+// Info: "2208",
|
|
9162
|
+// }
|
|
9163
|
+// customData = append(customData, custom1)
|
|
9164
|
+// custom2 := &CustomData{
|
|
9165
|
+// MsgId: "H44022900158202103301705198813",
|
|
9166
|
+// PsnNo: "44190000133097375417",
|
|
9167
|
+// Info: "2208",
|
|
9168
|
+// }
|
|
9169
|
+// customData = append(customData, custom2)
|
|
9170
|
+// custom3 := &CustomData{
|
|
9171
|
+// MsgId: "H44022900158202103301715524756",
|
|
9172
|
+// PsnNo: "44020000001100187221",
|
|
9173
|
+// Info: "2208",
|
|
9174
|
+// }
|
|
9175
|
+// customData = append(customData, custom3)
|
|
9176
|
+// custom4 := &CustomData{
|
|
9177
|
+// MsgId: "H44022900158202103301730376224",
|
|
9178
|
+// PsnNo: "44020000001101959155",
|
|
9179
|
+// Info: "2208",
|
|
9180
|
+// }
|
|
9181
|
+// customData = append(customData, custom4)
|
|
9182
|
+// custom5 := &CustomData{
|
|
9183
|
+// MsgId: "H44022900158202103301748008725",
|
|
9184
|
+// PsnNo: "44020000001104246641",
|
|
9185
|
+// Info: "2208",
|
|
9186
|
+// }
|
|
9187
|
+// customData = append(customData, custom5)
|
|
9188
|
+// custom6 := &CustomData{
|
|
9189
|
+// MsgId: "H44022900158202103301718096755",
|
|
9190
|
+// PsnNo: "44020000001102211860",
|
|
9191
|
+// Info: "2208",
|
|
9192
|
+// }
|
|
9193
|
+// customData = append(customData, custom6)
|
|
9194
|
+// custom7 := &CustomData{
|
|
9195
|
+// MsgId: "H44022900158202103301736551640",
|
|
9196
|
+// PsnNo: "44020000001102687718",
|
|
9197
|
+// Info: "2208",
|
|
9198
|
+// }
|
|
9199
|
+//
|
|
9200
|
+// customData = append(customData, custom7)
|
|
9201
|
+//
|
|
9202
|
+// custom8 := &CustomData{
|
|
9203
|
+// MsgId: "H44022900158202103301743097676",
|
|
9204
|
+// PsnNo: "44020000001102127785",
|
|
9205
|
+// Info: "2208",
|
|
9206
|
+// }
|
|
9207
|
+// customData = append(customData, custom8)
|
|
9208
|
+// custom9 := &CustomData{
|
|
9209
|
+// MsgId: "H44022900158202103301712304203",
|
|
9210
|
+// PsnNo: "44020000001101518097",
|
|
9211
|
+// Info: "2208",
|
|
9212
|
+// }
|
|
9213
|
+// customData = append(customData, custom9)
|
|
9214
|
+// custom10 := &CustomData{
|
|
9215
|
+// MsgId: "H44022900158202103301738448785",
|
|
9216
|
+// PsnNo: "44020000001100500813",
|
|
9217
|
+// Info: "2208",
|
|
9218
|
+// }
|
|
9219
|
+// customData = append(customData, custom10)
|
|
9220
|
+//
|
|
9221
|
+// custom11 := &CustomData{
|
|
9222
|
+// MsgId: "H44022900158202103301732455843",
|
|
9223
|
+// PsnNo: "44020000001102690557",
|
|
9224
|
+// Info: "2208",
|
|
9225
|
+// }
|
|
9226
|
+//
|
|
9227
|
+// customData = append(customData, custom11)
|
|
9228
|
+//
|
|
9229
|
+// custom12 := &CustomData{
|
|
9230
|
+// MsgId: "H44022900158202103301745421708",
|
|
9231
|
+// PsnNo: "44020000001102211928",
|
|
9232
|
+// Info: "2208",
|
|
9233
|
+// }
|
|
9234
|
+// customData = append(customData, custom12)
|
|
9235
|
+//
|
|
9236
|
+// custom1212 := &CustomData{
|
|
9237
|
+// MsgId: "H440229001582021033017351627",
|
|
9238
|
+// PsnNo: "44020000001102481733",
|
|
9239
|
+// Info: "2208",
|
|
9240
|
+// }
|
|
9241
|
+// customData = append(customData, custom1212)
|
|
9242
|
+//
|
|
9243
|
+// custom13 := &CustomData{
|
|
9244
|
+// MsgId: "H44022900158202103301740327951",
|
|
9245
|
+// PsnNo: "44020000001103174866",
|
|
9246
|
+// Info: "2208",
|
|
9247
|
+// }
|
|
9248
|
+// customData = append(customData, custom13)
|
|
9249
|
+// custom14 := &CustomData{
|
|
9250
|
+// MsgId: "H4402290015820210330174922668",
|
|
9251
|
+// PsnNo: "44020000001102927272",
|
|
9252
|
+// Info: "2208",
|
|
9253
|
+// }
|
|
9254
|
+// customData = append(customData, custom14)
|
|
9255
|
+// custom15 := &CustomData{
|
|
9256
|
+// MsgId: "H44022900158202103301752362273",
|
|
9257
|
+// PsnNo: "44020000001102942890",
|
|
9258
|
+// Info: "2208",
|
|
9259
|
+// }
|
|
9260
|
+// customData = append(customData, custom15)
|
|
9261
|
+//
|
|
9262
|
+// custom16 := &CustomData{
|
|
9263
|
+// MsgId: "H44022900158202103301751082917",
|
|
9264
|
+// PsnNo: "44020000001101662162",
|
|
9265
|
+// Info: "2208",
|
|
9266
|
+// }
|
|
9267
|
+// customData = append(customData, custom16)
|
|
9268
|
+//
|
|
9269
|
+// custom17 := &CustomData{
|
|
9270
|
+// MsgId: "H44022900158202103301754147728",
|
|
9271
|
+// PsnNo: "44020000000229014511",
|
|
9272
|
+// Info: "2208",
|
|
9273
|
+// }
|
|
9274
|
+// customData = append(customData, custom17)
|
|
9275
|
+//
|
|
9276
|
+// adminUser := c.GetAdminUserInfo()
|
|
9277
|
+// miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
|
9278
|
+//
|
|
9279
|
+// for _, item := range customData {
|
|
9280
|
+// result := service.Gdyb2601(item.PsnNo, item.MsgId, item.Info, miConfig.OrgName, "张俊杰", miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey)
|
|
9281
|
+// fmt.Println(result)
|
|
9282
|
+// }
|
|
9283
|
+//}
|
9217
|
9284
|
|
9218
|
9285
|
func PathExists(path string) (bool, error) {
|
9219
|
9286
|
_, err := os.Stat(path)
|
|
@@ -9312,59 +9379,6 @@ func ReadFile(filePath string) []byte {
|
9312
|
9379
|
return fd
|
9313
|
9380
|
}
|
9314
|
9381
|
|
9315
|
|
-func RemoveRepeatedTeam(arr []*models.HisOrderInfo) (newArr []*models.HisOrderInfo) {
|
9316
|
|
- newArr = make([]*models.HisOrderInfo, 0)
|
9317
|
|
- for i := 0; i < len(arr); i++ {
|
9318
|
|
- repeat := false
|
9319
|
|
- for j := i + 1; j < len(arr); j++ {
|
9320
|
|
- if arr[i].HisPrescriptionProject.TeamId == arr[j].HisPrescriptionProject.TeamId {
|
9321
|
|
- repeat = true
|
9322
|
|
- break
|
9323
|
|
- }
|
9324
|
|
- }
|
9325
|
|
- if !repeat {
|
9326
|
|
- newArr = append(newArr, arr[i])
|
9327
|
|
- }
|
9328
|
|
- }
|
9329
|
|
- return
|
9330
|
|
-}
|
9331
|
|
-
|
9332
|
|
-func saveRegisterLog(result string) {
|
9333
|
|
-
|
9334
|
|
- org_id, _ := beego.AppConfig.Int64("org_id")
|
9335
|
|
- miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
|
9336
|
|
- dir := miConfig.OrgName + "日志"
|
9337
|
|
- utils.Mkdir(dir)
|
9338
|
|
- month := time.Unix(1557042972, 0).Format("1")
|
9339
|
|
- year := time.Now().Format("2006")
|
9340
|
|
- month = time.Now().Format("01")
|
9341
|
|
- day := time.Now().Format("02")
|
9342
|
|
- file := strconv.FormatInt(org_id, 10) + "_" + year + month + day + "_log"
|
9343
|
|
- file_name := file + ".txt"
|
9344
|
|
- file_path := miConfig.OrgName + "日志" + "/" + file_name
|
9345
|
|
- exist, _ := utils.PathExists(file_path)
|
9346
|
|
- if exist { //存在
|
9347
|
|
- fmt.Println("存在")
|
9348
|
|
- f, err := os.OpenFile(file_path, os.O_WRONLY, 0644)
|
9349
|
|
- if err != nil {
|
9350
|
|
- fmt.Println("read fail")
|
9351
|
|
- }
|
9352
|
|
- content := "\r\n" + result
|
9353
|
|
- n, _ := f.Seek(0, 2)
|
9354
|
|
- _, err = f.WriteAt([]byte(content), n)
|
9355
|
|
-
|
9356
|
|
- } else { //不存在
|
9357
|
|
- fmt.Println("文件不存在,创建文件")
|
9358
|
|
- f, err := os.Create(miConfig.OrgName + "日志" + "/" + file_name)
|
9359
|
|
- defer f.Close()
|
9360
|
|
- if err != nil {
|
9361
|
|
- } else {
|
9362
|
|
- _, err = f.Write([]byte("记录日志"))
|
9363
|
|
- }
|
9364
|
|
- }
|
9365
|
|
-
|
9366
|
|
-}
|
9367
|
|
-
|
9368
|
9382
|
func saveLog(result string, request string, infno string, desc string) {
|
9369
|
9383
|
|
9370
|
9384
|
org_id, _ := beego.AppConfig.Int64("org_id")
|