|
@@ -1 +1,434 @@
|
1
|
1
|
package controllers
|
|
2
|
+
|
|
3
|
+import (
|
|
4
|
+ "XT_New/enums"
|
|
5
|
+ "XT_New/models"
|
|
6
|
+ "XT_New/service"
|
|
7
|
+ "XT_New/utils"
|
|
8
|
+ "encoding/json"
|
|
9
|
+ "fmt"
|
|
10
|
+ "github.com/astaxie/beego"
|
|
11
|
+ "github.com/shopspring/decimal"
|
|
12
|
+ "strings"
|
|
13
|
+ "time"
|
|
14
|
+)
|
|
15
|
+
|
|
16
|
+type HisDepositApiController struct {
|
|
17
|
+ BaseAuthAPIController
|
|
18
|
+}
|
|
19
|
+
|
|
20
|
+func HisDepositApiRegistRouters() {
|
|
21
|
+ beego.Router("/api/his/ttt", &HisDepositApiController{}, "get:TTT") //测试接口
|
|
22
|
+ beego.Router("/api/his/gethisuser", &HisDepositApiController{}, "get:GetHisUser") //获取病例中心,有效患者名称
|
|
23
|
+ beego.Router("/api/his/adddeposit", &HisDepositApiController{}, "post:AddDeposit") //新增押金
|
|
24
|
+ beego.Router("/api/his/getdepositcode", &HisDepositApiController{}, "get:GetDepositCode") //获取新增押金编号
|
|
25
|
+ beego.Router("/api/his/getdeletecode", &HisDepositApiController{}, "get:GetDeleteCode") //获取退款编号
|
|
26
|
+ beego.Router("/api/his/rechargedetails", &HisDepositApiController{}, "get:RechargeDetails") //充值明细列表
|
|
27
|
+ beego.Router("/api/his/updeposit", &HisDepositApiController{}, "get:UpDeposit") //审核
|
|
28
|
+ beego.Router("/api/his/deletehistory", &HisDepositApiController{}, "get:DeleteHistory") //删除
|
|
29
|
+ beego.Router("/api/his/rechargesummary", &HisDepositApiController{}, "get:RechargeSummary") //充值汇总列表
|
|
30
|
+ beego.Router("/api/his/getuserlist", &HisDepositApiController{}, "get:GetUserList") //获取患者押金列表
|
|
31
|
+ beego.Router("/api/his/depositflow", &HisDepositApiController{}, "get:DepositFlow") //根据患者id获取押金流水
|
|
32
|
+}
|
|
33
|
+func (this *HisDepositApiController) TTT() {
|
|
34
|
+ id, _ := this.GetInt64("id")
|
|
35
|
+ err := service.DelDecimalHistory(id)
|
|
36
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
37
|
+ "list": err,
|
|
38
|
+ })
|
|
39
|
+ return
|
|
40
|
+}
|
|
41
|
+
|
|
42
|
+//获取病例中心,有效患者名称
|
|
43
|
+func (this *HisDepositApiController) GetHisUser() {
|
|
44
|
+ orgid := this.GetAdminUserInfo().CurrentOrgId
|
|
45
|
+ list, err := service.GetHisUser(orgid)
|
|
46
|
+ if err != nil {
|
|
47
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
|
|
48
|
+ return
|
|
49
|
+ }
|
|
50
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
51
|
+ "list": list,
|
|
52
|
+ })
|
|
53
|
+ return
|
|
54
|
+}
|
|
55
|
+
|
|
56
|
+//新增押金
|
|
57
|
+func (this *HisDepositApiController) AddDeposit() {
|
|
58
|
+ orgid := this.GetAdminUserInfo().CurrentOrgId
|
|
59
|
+ dataBody := make(map[string]interface{}, 0)
|
|
60
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
61
|
+ if err != nil {
|
|
62
|
+ utils.ErrorLog(err.Error())
|
|
63
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
64
|
+ return
|
|
65
|
+ }
|
|
66
|
+ switch {
|
|
67
|
+ case dataBody["code"] == nil:
|
|
68
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "押金编号不能为空")
|
|
69
|
+ return
|
|
70
|
+ case dataBody["his_patient_id"] == nil:
|
|
71
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "患者名称不能为空")
|
|
72
|
+ return
|
|
73
|
+ case dataBody["deposit"] == nil:
|
|
74
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "押金金额不能为空")
|
|
75
|
+ return
|
|
76
|
+ case dataBody["trial_status"] == nil:
|
|
77
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "审核状态不能为空")
|
|
78
|
+ return
|
|
79
|
+ }
|
|
80
|
+ code := dataBody["code"].(string) //押金编号
|
|
81
|
+ his_patient_id := int64(dataBody["his_patient_id"].(float64)) //患者编号
|
|
82
|
+ deposit := decimal.NewFromFloat(dataBody["deposit"].(float64)) //押金金额
|
|
83
|
+ var remarks string
|
|
84
|
+ if dataBody["remarks"] == nil {
|
|
85
|
+ remarks = ""
|
|
86
|
+ } else {
|
|
87
|
+ remarks = dataBody["remarks"].(string) //备注
|
|
88
|
+ }
|
|
89
|
+ trial_status := int64(dataBody["trial_status"].(float64)) //审核状态
|
|
90
|
+ createid := this.GetAdminUserInfo().AdminUser.Id
|
|
91
|
+ pp := this.GetAdminUserInfo()
|
|
92
|
+ fmt.Println(pp)
|
|
93
|
+ err = service.UpDeposit(code, remarks, his_patient_id, orgid, trial_status, createid, deposit)
|
|
94
|
+ if err != nil {
|
|
95
|
+ utils.ErrorLog(err.Error())
|
|
96
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
97
|
+ return
|
|
98
|
+ }
|
|
99
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
100
|
+ "list": "添加成功",
|
|
101
|
+ })
|
|
102
|
+ return
|
|
103
|
+}
|
|
104
|
+
|
|
105
|
+//获取新增押金编号
|
|
106
|
+func (this *HisDepositApiController) GetDepositCode() {
|
|
107
|
+ orgid := this.GetAdminUserInfo().CurrentOrgId
|
|
108
|
+ var code string
|
|
109
|
+ for a := true; a == true; {
|
|
110
|
+ code = service.CreateCPCode("CP")
|
|
111
|
+ tmp := service.FindDecimalCode(orgid, code)
|
|
112
|
+ if tmp == false {
|
|
113
|
+ a = false
|
|
114
|
+ }
|
|
115
|
+ }
|
|
116
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
117
|
+ "list": code,
|
|
118
|
+ })
|
|
119
|
+ return
|
|
120
|
+}
|
|
121
|
+
|
|
122
|
+//获取退款编号
|
|
123
|
+func (this *HisDepositApiController) GetDeleteCode() {
|
|
124
|
+ orgid := this.GetAdminUserInfo().CurrentOrgId
|
|
125
|
+ var code string
|
|
126
|
+ for a := true; a == true; {
|
|
127
|
+ code = service.CreateCPCode("AF")
|
|
128
|
+ tmp := service.FindDecimalCode(orgid, code)
|
|
129
|
+ if tmp == false {
|
|
130
|
+ a = false
|
|
131
|
+ }
|
|
132
|
+ }
|
|
133
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
134
|
+ "list": code,
|
|
135
|
+ })
|
|
136
|
+ return
|
|
137
|
+}
|
|
138
|
+
|
|
139
|
+//充值明细列表
|
|
140
|
+func (this *HisDepositApiController) RechargeDetails() {
|
|
141
|
+ orgid := this.GetAdminUserInfo().CurrentOrgId
|
|
142
|
+ timeLayout := "2006-01-02"
|
|
143
|
+ loc, _ := time.LoadLocation("Local")
|
|
144
|
+ keyword := this.GetString("keyword")
|
|
145
|
+ start_time := this.GetString("start_time")
|
|
146
|
+ end_time := this.GetString("end_time")
|
|
147
|
+ var stime int64 //开始时间
|
|
148
|
+ var etime int64 //结束时间
|
|
149
|
+
|
|
150
|
+ namemap := make(map[int64]string)
|
|
151
|
+ slicekey := make([]int64, 0)
|
|
152
|
+ if len(keyword) > 0 {
|
|
153
|
+ list, _ := service.GetHisUser(orgid)
|
|
154
|
+ for _, v := range list {
|
|
155
|
+ namemap[v.ID] = v.Name
|
|
156
|
+ }
|
|
157
|
+ for k, v := range namemap {
|
|
158
|
+ res := strings.Contains(v, keyword)
|
|
159
|
+ if res == true {
|
|
160
|
+ slicekey = append(slicekey, k)
|
|
161
|
+ }
|
|
162
|
+ }
|
|
163
|
+ }
|
|
164
|
+ if start_time == "" && end_time == "" {
|
|
165
|
+ stime, etime = service.GetMondayOfWeek()
|
|
166
|
+ } else {
|
|
167
|
+ stmp, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
168
|
+ etmp, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
169
|
+ stime = stmp.Unix()
|
|
170
|
+ etime = etmp.Unix()
|
|
171
|
+ }
|
|
172
|
+ list, err := service.DetailsList(orgid, stime, etime, keyword, slicekey)
|
|
173
|
+ if err != nil {
|
|
174
|
+ utils.ErrorLog(err.Error())
|
|
175
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
176
|
+ return
|
|
177
|
+ }
|
|
178
|
+ var sum decimal.Decimal
|
|
179
|
+ for i := 0; i < len(list); i++ {
|
|
180
|
+ if list[i].TrialStatus == 1 {
|
|
181
|
+ sum = sum.Add(list[i].Deposit)
|
|
182
|
+ }
|
|
183
|
+ list[i].Name = service.GetCreateidName(list[i].CreateId)
|
|
184
|
+ }
|
|
185
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
186
|
+ "list": list,
|
|
187
|
+ "sum": sum,
|
|
188
|
+ })
|
|
189
|
+ return
|
|
190
|
+}
|
|
191
|
+
|
|
192
|
+//充值汇总列表
|
|
193
|
+func (this *HisDepositApiController) RechargeSummary() {
|
|
194
|
+ orgid := this.GetAdminUserInfo().CurrentOrgId
|
|
195
|
+ timeLayout := "2006-01-02"
|
|
196
|
+ loc, _ := time.LoadLocation("Local")
|
|
197
|
+ keyword := this.GetString("keyword")
|
|
198
|
+ start_time := this.GetString("start_time")
|
|
199
|
+ end_time := this.GetString("end_time")
|
|
200
|
+ var stime int64 //开始时间
|
|
201
|
+ var etime int64 //结束时间
|
|
202
|
+ namemap := make(map[int64]string)
|
|
203
|
+ slicekey := make([]int64, 0)
|
|
204
|
+ lists, _ := service.GetHisUser(orgid)
|
|
205
|
+ for _, v := range lists {
|
|
206
|
+ namemap[v.ID] = v.Name
|
|
207
|
+ }
|
|
208
|
+ if len(keyword) > 0 {
|
|
209
|
+ for k, v := range namemap {
|
|
210
|
+ res := strings.Contains(v, keyword)
|
|
211
|
+ if res == true {
|
|
212
|
+ slicekey = append(slicekey, k)
|
|
213
|
+ }
|
|
214
|
+ }
|
|
215
|
+ }
|
|
216
|
+ if start_time == "" && end_time == "" {
|
|
217
|
+ stime, etime = service.GetMondayOfWeek()
|
|
218
|
+ } else {
|
|
219
|
+ stmp, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
220
|
+ etmp, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
221
|
+ stime = stmp.Unix()
|
|
222
|
+ etime = etmp.Unix()
|
|
223
|
+ }
|
|
224
|
+ list, err := service.SummaryList(orgid, stime, etime, keyword, slicekey)
|
|
225
|
+ if err != nil {
|
|
226
|
+ utils.ErrorLog(err.Error())
|
|
227
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
228
|
+ return
|
|
229
|
+ }
|
|
230
|
+ //list为详细数据,把list整理合并为maplist输出
|
|
231
|
+ maplist := make(map[int64]models.Summary)
|
|
232
|
+ Finlist := []models.Summary{}
|
|
233
|
+ tmpslice := make([]int64, 0)
|
|
234
|
+ var sum decimal.Decimal
|
|
235
|
+ for i := 0; i < len(list); i++ {
|
|
236
|
+ if list[i].TrialStatus == 1 {
|
|
237
|
+ if k, ok := maplist[list[i].HisPatientId]; ok {
|
|
238
|
+ k.SumDecimal = k.SumDecimal.Add(list[i].Deposit)
|
|
239
|
+ maplist[list[i].HisPatientId] = models.Summary{
|
|
240
|
+ namemap[list[i].HisPatientId],
|
|
241
|
+ k.SumDecimal,
|
|
242
|
+ service.GetUserMoney(list[i].HisPatientId, orgid),
|
|
243
|
+ }
|
|
244
|
+ } else {
|
|
245
|
+ maplist[list[i].HisPatientId] = models.Summary{
|
|
246
|
+ namemap[list[i].HisPatientId],
|
|
247
|
+ list[i].Deposit,
|
|
248
|
+ service.GetUserMoney(list[i].HisPatientId, orgid),
|
|
249
|
+ }
|
|
250
|
+ tmpslice = append(tmpslice, list[i].HisPatientId)
|
|
251
|
+ }
|
|
252
|
+ sum = sum.Add(list[i].Deposit)
|
|
253
|
+ }
|
|
254
|
+ }
|
|
255
|
+ //maplist虽然满足接口要求,但格式不行,整理为Finlist输出
|
|
256
|
+ for i := 0; i < len(tmpslice); i++ {
|
|
257
|
+ Finlist = append(Finlist, maplist[tmpslice[i]])
|
|
258
|
+ }
|
|
259
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
260
|
+ "list": Finlist,
|
|
261
|
+ "sum": sum,
|
|
262
|
+ })
|
|
263
|
+ return
|
|
264
|
+}
|
|
265
|
+
|
|
266
|
+//审核
|
|
267
|
+func (this *HisDepositApiController) UpDeposit() {
|
|
268
|
+ id, _ := this.GetInt64("id", 0)
|
|
269
|
+ if id == 0 {
|
|
270
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "id不能为空")
|
|
271
|
+ return
|
|
272
|
+ }
|
|
273
|
+ tmp, err := service.GetDecimalHistoryOne(id)
|
|
274
|
+ if err != nil {
|
|
275
|
+ utils.ErrorLog("无法查询该记录信息", err.Error())
|
|
276
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "无法查询该记录信息")
|
|
277
|
+ return
|
|
278
|
+ }
|
|
279
|
+ if tmp.TrialStatus == 0 {
|
|
280
|
+ err = service.UpDecimalHistory(id)
|
|
281
|
+ if err != nil {
|
|
282
|
+ utils.ErrorLog("更新押金历史表出错,原因为:", err.Error())
|
|
283
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "系统错误")
|
|
284
|
+ return
|
|
285
|
+ }
|
|
286
|
+ } else {
|
|
287
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "当前状态不可审核")
|
|
288
|
+ return
|
|
289
|
+ }
|
|
290
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
291
|
+ "list": "审核通过",
|
|
292
|
+ })
|
|
293
|
+ return
|
|
294
|
+}
|
|
295
|
+func (this *HisDepositApiController) DeleteHistory() {
|
|
296
|
+ id, _ := this.GetInt64("id", 0)
|
|
297
|
+ if id == 0 {
|
|
298
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "id不能为空")
|
|
299
|
+ return
|
|
300
|
+ }
|
|
301
|
+ tmp, err := service.GetDecimalHistoryOne(id)
|
|
302
|
+ if err != nil {
|
|
303
|
+ utils.ErrorLog("无法查询该记录信息", err.Error())
|
|
304
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "无法查询该记录信息")
|
|
305
|
+ return
|
|
306
|
+ }
|
|
307
|
+ if tmp.TrialStatus == 0 {
|
|
308
|
+ err = service.DelDecimalHistory(id)
|
|
309
|
+ if err != nil {
|
|
310
|
+ utils.ErrorLog("删除历史记录出错,原因为:", err.Error())
|
|
311
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "系统错误")
|
|
312
|
+ return
|
|
313
|
+ }
|
|
314
|
+ } else {
|
|
315
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "已审核的单据不能进行删除操作")
|
|
316
|
+ return
|
|
317
|
+ }
|
|
318
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
319
|
+ "list": "删除成功",
|
|
320
|
+ })
|
|
321
|
+ return
|
|
322
|
+}
|
|
323
|
+
|
|
324
|
+//根据id获取押金流水
|
|
325
|
+func (this *HisDepositApiController) DepositFlow() {
|
|
326
|
+ orgid := this.GetAdminUserInfo().CurrentOrgId
|
|
327
|
+ check := map[string][]string{
|
|
328
|
+ "id": {"must", "int", "id"},
|
|
329
|
+ "deposit_status": {"must", "int", "deposit_status"},
|
|
330
|
+ }
|
|
331
|
+ _, err := checks(this, &check)
|
|
332
|
+ if err != nil {
|
|
333
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
|
|
334
|
+ return
|
|
335
|
+ }
|
|
336
|
+ id, _ := this.GetInt64("id") //患者id
|
|
337
|
+ //获取当前患者的姓名
|
|
338
|
+ tmp, _ := service.GetHisUserName(orgid, id)
|
|
339
|
+ name := tmp.Name
|
|
340
|
+ deposit_status, _ := this.GetInt64("deposit_status", 0) //押金类型
|
|
341
|
+ if deposit_status > 3 {
|
|
342
|
+ utils.ErrorLog("押金类型错误,deposit_status:", deposit_status)
|
|
343
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "押金类型错误")
|
|
344
|
+ return
|
|
345
|
+ }
|
|
346
|
+ start_time := this.GetString("start_time", "") //开始时间
|
|
347
|
+ end_time := this.GetString("end_time", "") //结束时间
|
|
348
|
+ timeLayout := "2006-01-02"
|
|
349
|
+ loc, _ := time.LoadLocation("Local")
|
|
350
|
+ var stime int64 //开始时间
|
|
351
|
+ var etime int64 //结束时间
|
|
352
|
+ if start_time == "" && end_time == "" {
|
|
353
|
+ stime, etime = service.GetMonth()
|
|
354
|
+ } else {
|
|
355
|
+ stmp, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
356
|
+ etmp, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
357
|
+ stime = stmp.Unix()
|
|
358
|
+ etime = etmp.Unix()
|
|
359
|
+ }
|
|
360
|
+ //获取该角色当前时间段的余额
|
|
361
|
+ decimal := service.GetMoneyforTime(id, orgid, etime)
|
|
362
|
+ //获取列表
|
|
363
|
+ deposirhistory, errs := service.GetFlowList(id, orgid, stime, etime, deposit_status)
|
|
364
|
+ if errs != nil {
|
|
365
|
+ utils.ErrorLog("获取列表失败,原因为:", errs.Error())
|
|
366
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, errs.Error())
|
|
367
|
+ return
|
|
368
|
+ }
|
|
369
|
+
|
|
370
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
371
|
+ "list": deposirhistory,
|
|
372
|
+ "name": name,
|
|
373
|
+ "decimal": decimal,
|
|
374
|
+ })
|
|
375
|
+ return
|
|
376
|
+}
|
|
377
|
+
|
|
378
|
+//
|
|
379
|
+func (this *HisDepositApiController) GetUserList() {
|
|
380
|
+ orgid := this.GetAdminUserInfo().CurrentOrgId
|
|
381
|
+ keyword := this.GetString("keyword")
|
|
382
|
+ page, _ := this.GetInt64("page") //页码
|
|
383
|
+ limit, _ := this.GetInt64("limit") //每一页查出来的条数
|
|
384
|
+ check := map[string][]string{
|
|
385
|
+ "page": {"must", "string", "page"},
|
|
386
|
+ "limit": {"must", "string", "limit"},
|
|
387
|
+ }
|
|
388
|
+ _, err := checks(this, &check)
|
|
389
|
+ if err != nil {
|
|
390
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
|
|
391
|
+ return
|
|
392
|
+ }
|
|
393
|
+ namemap := make(map[int64]string)
|
|
394
|
+ slicekey := make([]int64, 0)
|
|
395
|
+ lists, _ := service.GetHisUser(orgid)
|
|
396
|
+ for _, v := range lists {
|
|
397
|
+ namemap[v.ID] = v.Name
|
|
398
|
+ }
|
|
399
|
+ if len(keyword) > 0 {
|
|
400
|
+ for k, v := range namemap {
|
|
401
|
+ res := strings.Contains(v, keyword)
|
|
402
|
+ if res == true {
|
|
403
|
+ slicekey = append(slicekey, k)
|
|
404
|
+ }
|
|
405
|
+ }
|
|
406
|
+ }
|
|
407
|
+ list, total, errs := service.GetUserList(page, limit, orgid, keyword, slicekey)
|
|
408
|
+ if errs != nil {
|
|
409
|
+ utils.ErrorLog(errs.Error())
|
|
410
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
|
|
411
|
+ return
|
|
412
|
+ }
|
|
413
|
+ for i := 0; i < len(list); i++ {
|
|
414
|
+ list[i].HisPatientName = namemap[list[i].HisPatientId]
|
|
415
|
+ }
|
|
416
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
417
|
+ "list": list,
|
|
418
|
+ "total": total,
|
|
419
|
+ })
|
|
420
|
+ return
|
|
421
|
+}
|
|
422
|
+
|
|
423
|
+//判断前端参数是否为空
|
|
424
|
+func checks(this *HisDepositApiController, m *map[string][]string) (map[string]string, error) {
|
|
425
|
+ tmp := make(map[string]string)
|
|
426
|
+ for k, v := range *m {
|
|
427
|
+ t := this.GetString(k)
|
|
428
|
+ if v[0] == "must" && t == "" {
|
|
429
|
+ return nil, fmt.Errorf(v[2] + "不能为空")
|
|
430
|
+ }
|
|
431
|
+ tmp[k] = t
|
|
432
|
+ }
|
|
433
|
+ return tmp, nil
|
|
434
|
+}
|