|
@@ -0,0 +1,363 @@
|
|
1
|
+package service
|
|
2
|
+
|
|
3
|
+import (
|
|
4
|
+ "fmt"
|
|
5
|
+ "regexp"
|
|
6
|
+ "unicode"
|
|
7
|
+)
|
|
8
|
+
|
|
9
|
+type KMResult struct {
|
|
10
|
+ FRequestCode string `gorm:"column:F_RequestCode" json:"F_RequestCode" form:"F_RequestCode"`
|
|
11
|
+ FHospSampleID string `gorm:"column:F_HospSampleID" json:"F_HospSampleID" form:"F_HospSampleID"`
|
|
12
|
+ FHospSampleNumber string `gorm:"column:F_HospSampleNumber" json:"F_HospSampleNumber" form:"F_HospSampleNumber"`
|
|
13
|
+ FInputDate string `gorm:"column:F_InputDate" json:"F_InputDate" form:"F_InputDate"`
|
|
14
|
+ FSamplingDate string `gorm:"column:F_SamplingDate" json:"F_SamplingDate" form:"F_SamplingDate"`
|
|
15
|
+ FName string `gorm:"column:F_Name" json:"F_Name" form:"F_Name"`
|
|
16
|
+ FSex string `gorm:"column:F_Sex" json:"F_Sex" form:"F_Sex"`
|
|
17
|
+ FAge string `gorm:"column:F_Age" json:"F_Age" form:"F_Age"`
|
|
18
|
+ FAgeUnit string `gorm:"column:F_AgeUnit" json:"F_AgeUnit" form:"F_AgeUnit"`
|
|
19
|
+ FPatientNumber string `gorm:"column:F_PatientNumber" json:"F_PatientNumber" form:"F_PatientNumber"`
|
|
20
|
+ FItemType string `gorm:"column:F_ItemType" json:"F_ItemType" form:"F_ItemType"`
|
|
21
|
+ FCompoundItem string `gorm:"column:F_CompoundItem" json:"F_CompoundItem" form:"F_CompoundItem"`
|
|
22
|
+ FCompoundItemName string `gorm:"column:F_CompoundItemName" json:"F_CompoundItemName" form:"F_CompoundItemName"`
|
|
23
|
+ FNaturalItem string `gorm:"column:F_NaturalItem" json:"F_NaturalItem" form:"F_NaturalItem"`
|
|
24
|
+ FNaturalItemName string `gorm:"column:F_NaturalItemName" json:"F_NaturalItemName" form:"F_NaturalItemName"`
|
|
25
|
+ FSingleItem string `gorm:"column:F_SingleItem" json:"F_SingleItem" form:"F_SingleItem"`
|
|
26
|
+ FSingleItemName string `gorm:"column:F_SingleItemName" json:"F_SingleItemName" form:"F_SingleItemName"`
|
|
27
|
+ FHospNaturalItem string `gorm:"column:F_HospNaturalItem" json:"F_HospNaturalItem" form:"F_HospNaturalItem"`
|
|
28
|
+ FHospNaturalItemName string `gorm:"column:F_HospNaturalItemName" json:"F_HospNaturalItemName" form:"F_HospNaturalItemName"`
|
|
29
|
+ FHospItem string `gorm:"column:F_HospItem" json:"F_HospItem" form:"F_HospItem"`
|
|
30
|
+ FHospItemName string `gorm:"column:F_HospItemName" json:"F_HospItemName" form:"F_HospItemName"`
|
|
31
|
+ FTestNO string `gorm:"column:F_TestNO" json:"F_TestNO" form:"F_TestNO"`
|
|
32
|
+ FResult string `gorm:"column:F_Result" json:"F_Result" form:"F_Result"`
|
|
33
|
+ FUnit string `gorm:"column:F_Unit" json:"F_Unit" form:"F_Unit"`
|
|
34
|
+ FHint string `gorm:"column:F_Hint" json:"F_Hint" form:"F_Hint"`
|
|
35
|
+ FSuggestion string `gorm:"column:F_Suggestion" json:"F_Suggestion" form:"F_Suggestion"`
|
|
36
|
+ FReference string `gorm:"column:F_Reference" json:"F_Reference" form:"F_Reference"`
|
|
37
|
+ FReference2 string `gorm:"column:F_Reference2" json:"F_Reference2" form:"F_Reference2"`
|
|
38
|
+ FDepartmentName string `gorm:"column:F_DepartmentName" json:"F_DepartmentName" form:"F_DepartmentName"`
|
|
39
|
+ FRecorderName string `gorm:"column: F_RecorderName" json:"F_RecorderName" form:"F_RecorderName"`
|
|
40
|
+ FRecordTime string `gorm:"column:F_RecordTime" json:"F_RecordTime" form:"F_RecordTime"`
|
|
41
|
+ FCheckerName string `gorm:"column:F_CheckerName" json:"F_CheckerName" form:"F_CheckerName"`
|
|
42
|
+ FCheckTime string `gorm:"column:F_CheckTime" json:"F_CheckTime" form:"F_CheckTime"`
|
|
43
|
+ FAuthorizeName string `gorm:"column:F_AuthorizeName" json:"F_AuthorizeName" form:"F_AuthorizeName"`
|
|
44
|
+ FAuthorizeTime string `gorm:"column:F_AuthorizeTime" json:"F_AuthorizeTime" form:"F_AuthorizeTime"`
|
|
45
|
+ FSubResults string `gorm:"column:F_SubResults" json:"F_SubResults" form:"F_SubResults"`
|
|
46
|
+ FPathologyGrossingDesc string `gorm:"column:F_PathologyGrossingDesc" json:"F_PathologyGrossingDesc" form:"F_PathologyGrossingDesc"`
|
|
47
|
+ FReportBarCode string `gorm:"column:F_ReportBarCode" json:"F_ReportBarCode" form:"F_ReportBarCode"`
|
|
48
|
+ FReceiveTime string `gorm:"column:F_ReceiveTime" json:"F_ReceiveTime" form:"F_ReceiveTime"`
|
|
49
|
+ FStatus string `gorm:"column:F_Status" json:"F_Status" form:"F_Status"`
|
|
50
|
+ FRemark string `gorm:"column:F_Remark" json:"F_Remark" form:"F_Remark"`
|
|
51
|
+ FTestMethodName string `gorm:"column:F_TestMethodName" json:"F_TestMethodName" form:"F_TestMethodName"`
|
|
52
|
+ FMachineName string `gorm:"column:F_MachineName" json:"F_MachineName" form:"F_MachineName"`
|
|
53
|
+ FItemDesc string `gorm:"column:F_ItemDesc" json:"F_ItemDesc" form:"F_ItemDesc"`
|
|
54
|
+ FIsDelayed string `gorm:"column:F_IsDelayed" json:"F_IsDelayed" form:"F_IsDelayed"`
|
|
55
|
+ FDelayeddesc string `gorm:"column:F_Delayeddesc" json:"F_Delayeddesc" form:"F_Delayeddesc"`
|
|
56
|
+ FIsReimbu string `gorm:"column:F_IsReimbu" json:"F_IsReimbu" form:"F_IsReimbu"`
|
|
57
|
+ FReimbuDesc string `gorm:"column:F_ReimbuDesc" json:"F_ReimbuDesc" form:"F_ReimbuDesc"`
|
|
58
|
+ FDetailItemID string `gorm:"column:F_DetailItemID" json:"F_DetailItemID" form:"F_DetailItemID"`
|
|
59
|
+ FIDCardNo string `gorm:"column:F_IDCardNo" json:"F_IDCardNo" form:"F_IDCardNo"`
|
|
60
|
+}
|
|
61
|
+
|
|
62
|
+func (KMResult) TableName() string {
|
|
63
|
+ return "v_km_lis_result"
|
|
64
|
+}
|
|
65
|
+
|
|
66
|
+//获取lis返回检验检查结果数据
|
|
67
|
+func GetSHResultDataInsertDB(org_id int64) (result []*KMResult) {
|
|
68
|
+ record, _ := GetLastSyncResultRecord(org_id)
|
|
69
|
+ fmt.Println(record)
|
|
70
|
+ //if record.ID == 0 {
|
|
71
|
+ // list, err := GetSHResultRecord()
|
|
72
|
+ // if err == nil {
|
|
73
|
+ // fmt.Println(list)
|
|
74
|
+ //
|
|
75
|
+ // //插入到系统检验检查数据
|
|
76
|
+ // for _, item := range list {
|
|
77
|
+ // project_id := int64(0)
|
|
78
|
+ // if len(item.FIDCardNo) > 0 {
|
|
79
|
+ // project_id, _ = GetShjhProjectID(org_id, item.FCompoundItemName)
|
|
80
|
+ // } else {
|
|
81
|
+ // continue
|
|
82
|
+ // }
|
|
83
|
+ // printInfo, _ := GetPatientsInfoByIDCardNo(item.FIDCardNo, 10215)
|
|
84
|
+ //
|
|
85
|
+ // if printInfo.ID == 0 {
|
|
86
|
+ // fmt.Println(item)
|
|
87
|
+ // fmt.Println(printInfo)
|
|
88
|
+ // fmt.Println("暂无该患者")
|
|
89
|
+ // continue
|
|
90
|
+ // }
|
|
91
|
+ //
|
|
92
|
+ // item_id, _ := GetShItemID(org_id, item.FCompoundItemName, item.FSingleItemName, project_id)
|
|
93
|
+ //
|
|
94
|
+ // tx := writeMiddleDb.Begin()
|
|
95
|
+ // var inspection models.MiddleInspection
|
|
96
|
+ // var inspection_reference models.MiddleInspectionReference
|
|
97
|
+ //
|
|
98
|
+ // recordDateStr := ""
|
|
99
|
+ // //inspect_date := item.FRecordTime.Format("2006-01-02 15:04")
|
|
100
|
+ //
|
|
101
|
+ // recordDateStr = item.FRecordTime
|
|
102
|
+ // date, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", recordDateStr)
|
|
103
|
+ // record_date, _ := utils.ParseTimeStringToTime("2006-01-02", date.Format("2006-01-02"))
|
|
104
|
+ // var total int
|
|
105
|
+ // var RangeOptions string
|
|
106
|
+ // var RangeMin string
|
|
107
|
+ // var RangeMax string
|
|
108
|
+ // // 判断检查类型
|
|
109
|
+ // var ItemType int
|
|
110
|
+ // if IsChineseChar(item.FReference) || strings.Contains(item.FReference, "|") || strings.Contains(item.FReference, "≤") {
|
|
111
|
+ // ItemType = 2
|
|
112
|
+ // } else {
|
|
113
|
+ // if strings.Contains(item.FReference, "-") {
|
|
114
|
+ // ItemType = 1
|
|
115
|
+ // } else {
|
|
116
|
+ // ItemType = 2
|
|
117
|
+ // }
|
|
118
|
+ // }
|
|
119
|
+ //
|
|
120
|
+ // if ItemType == 1 {
|
|
121
|
+ // Range := strings.Split(item.FReference, "-")
|
|
122
|
+ // RangeMin = Range[0]
|
|
123
|
+ // RangeMax = Range[1]
|
|
124
|
+ // } else {
|
|
125
|
+ // RangeOptions = item.FReference
|
|
126
|
+ // }
|
|
127
|
+ //
|
|
128
|
+ // err = readMiddleDb.Model(&models.MiddleInspectionReference{}).Where("org_id = ? and project_id = ? and item_id = ? and status = 1", org_id, project_id, item_id).Find(&inspection_reference).Count(&total).Error
|
|
129
|
+ // if inspection_reference.ID > 0 {
|
|
130
|
+ // ItemType = inspection_reference.RangeType
|
|
131
|
+ // }
|
|
132
|
+ // if total <= 0 {
|
|
133
|
+ // inspection_reference.OrgId = org_id
|
|
134
|
+ // inspection_reference.ProjectName = item.FCompoundItemName
|
|
135
|
+ // inspection_reference.Project = item.FCompoundItemName
|
|
136
|
+ // inspection_reference.ProjectId = project_id
|
|
137
|
+ // inspection_reference.ItemName = item.FSingleItemName
|
|
138
|
+ // inspection_reference.ItemNameAddition = ""
|
|
139
|
+ // inspection_reference.ItemId = item_id
|
|
140
|
+ // inspection_reference.RangeType = ItemType
|
|
141
|
+ // inspection_reference.RangeMin = RangeMin
|
|
142
|
+ // inspection_reference.RangeMax = RangeMax
|
|
143
|
+ // inspection_reference.RangeOptions = RangeOptions
|
|
144
|
+ // inspection_reference.Unit = item.FUnit
|
|
145
|
+ // inspection_reference.Status = 1
|
|
146
|
+ // inspection_reference.CreatedTime = time.Now().Unix()
|
|
147
|
+ // inspection_reference.UpdatedTime = time.Now().Unix()
|
|
148
|
+ // inspection_reference.InspectDate = item.FCheckTime
|
|
149
|
+ // inspection_reference.UTime = item.FCheckTime
|
|
150
|
+ // err = tx.Model(&models.MiddleInspectionReference{}).Create(&inspection_reference).Error
|
|
151
|
+ // if err != nil {
|
|
152
|
+ // tx.Rollback()
|
|
153
|
+ // }
|
|
154
|
+ // }
|
|
155
|
+ //
|
|
156
|
+ // var itotal int
|
|
157
|
+ // err = readMiddleDb.Model(&models.MiddleInspection{}).Where("org_id = ? and project_id = ? and item_id = ? and record_date = ? and patient_id = ? and status = 1", org_id, project_id, item_id, record_date.Unix(), printInfo.ID).Find(&inspection).Count(&itotal).Error
|
|
158
|
+ // if itotal <= 0 {
|
|
159
|
+ // inspection.PatientId = printInfo.ID
|
|
160
|
+ // inspection.OrgId = org_id
|
|
161
|
+ // inspection.ProjectId = project_id
|
|
162
|
+ // inspection.ItemName = inspection_reference.ItemName
|
|
163
|
+ // inspection.ProjectName = inspection_reference.ProjectName
|
|
164
|
+ // inspection.InspectType = ItemType
|
|
165
|
+ // inspection.ItemId = item_id
|
|
166
|
+ // inspection.InspectValue = item.FResult
|
|
167
|
+ // inspection.InspectDate = item.FCheckTime
|
|
168
|
+ // inspection.RecordDate = record_date.Unix()
|
|
169
|
+ // inspection.Status = 1
|
|
170
|
+ // inspection.CreatedTime = time.Now().Unix()
|
|
171
|
+ // inspection.UpdatedTime = time.Now().Unix()
|
|
172
|
+ // inspection.UTime = item.FCheckTime
|
|
173
|
+ // inspection.HisUserId = strconv.FormatInt(printInfo.ID, 10)
|
|
174
|
+ // err = tx.Model(&models.MiddleInspection{}).Create(&inspection).Error
|
|
175
|
+ // if err != nil {
|
|
176
|
+ // tx.Rollback()
|
|
177
|
+ // }
|
|
178
|
+ // }
|
|
179
|
+ //
|
|
180
|
+ // tx.Commit()
|
|
181
|
+ //
|
|
182
|
+ // }
|
|
183
|
+ // //插入一条查询检验检查结果记录状态数据
|
|
184
|
+ // var info LisSyncResultStatusInfo
|
|
185
|
+ // info.Ctime = time.Now().Unix()
|
|
186
|
+ // info.Status = 1
|
|
187
|
+ // info.Mtime = time.Now().Unix()
|
|
188
|
+ // info.OrgId = org_id
|
|
189
|
+ // info.IsResult = 1
|
|
190
|
+ // info.LastId = int64(len(list))
|
|
191
|
+ // info.ResultDate = time.Now().Unix()
|
|
192
|
+ // writeMiddleDb.Save(&info)
|
|
193
|
+ // }
|
|
194
|
+ //
|
|
195
|
+ //} else
|
|
196
|
+ //{
|
|
197
|
+ // if record.LastId != 0 {
|
|
198
|
+ // list, err := GetResultRecordByID(record.LastId)
|
|
199
|
+ // fmt.Println(list)
|
|
200
|
+ // //插入中间库中
|
|
201
|
+ // //插入一条插入中间库记录数据
|
|
202
|
+ // if err == nil {
|
|
203
|
+ //
|
|
204
|
+ // //插入到系统检验检查数据
|
|
205
|
+ // for _, item := range list {
|
|
206
|
+ // project_id := int64(0)
|
|
207
|
+ // if len(item.Barcode) > 0 {
|
|
208
|
+ // project_id, _ = GetBljhProjectID(org_id, item.Groupname)
|
|
209
|
+ // } else {
|
|
210
|
+ // continue
|
|
211
|
+ // }
|
|
212
|
+ // printInfo, _ := GetHisLabelPrintInfoById(item.Barcode)
|
|
213
|
+ // item_id, _ := GetBlItemID(org_id, item.Groupname, item.Itemname, project_id)
|
|
214
|
+ //
|
|
215
|
+ // tx := writeMiddleDb.Begin()
|
|
216
|
+ // var inspection models.MiddleInspection
|
|
217
|
+ // var inspection_reference models.MiddleInspectionReference
|
|
218
|
+ //
|
|
219
|
+ // recordDateStr := ""
|
|
220
|
+ // inspect_date := item.Repdate.Format("2006-01-02 15:04")
|
|
221
|
+ // if item.Repdate.Unix() == 0 {
|
|
222
|
+ // recordDateStr = time.Now().Format("2006-01-02 15:04")
|
|
223
|
+ // } else {
|
|
224
|
+ //
|
|
225
|
+ // recordDateStr = inspect_date
|
|
226
|
+ // }
|
|
227
|
+ //
|
|
228
|
+ // date, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", recordDateStr)
|
|
229
|
+ // record_date, _ := utils.ParseTimeStringToTime("2006-01-02", date.Format("2006-01-02"))
|
|
230
|
+ // var total int
|
|
231
|
+ // var RangeOptions string
|
|
232
|
+ // var RangeMin string
|
|
233
|
+ // var RangeMax string
|
|
234
|
+ // // 判断检查类型
|
|
235
|
+ // var ItemType int
|
|
236
|
+ // if strings.Contains(item.Refrange, "-") {
|
|
237
|
+ // ItemType = 1
|
|
238
|
+ //
|
|
239
|
+ // } else {
|
|
240
|
+ // ItemType = 2
|
|
241
|
+ //
|
|
242
|
+ // }
|
|
243
|
+ //
|
|
244
|
+ // if ItemType == 1 {
|
|
245
|
+ // Range := strings.Split(item.Refrange, "-")
|
|
246
|
+ // RangeMin = Range[0]
|
|
247
|
+ // RangeMax = Range[1]
|
|
248
|
+ // } else {
|
|
249
|
+ // RangeOptions = item.Refrange
|
|
250
|
+ // }
|
|
251
|
+ //
|
|
252
|
+ // err = readMiddleDb.Model(&models.MiddleInspectionReference{}).Where("org_id = ? and project_id = ? and item_id = ? and status = 1", org_id, project_id, item_id).Find(&inspection_reference).Count(&total).Error
|
|
253
|
+ // if inspection_reference.ID > 0 {
|
|
254
|
+ // ItemType = inspection_reference.RangeType
|
|
255
|
+ // }
|
|
256
|
+ // if total <= 0 {
|
|
257
|
+ // inspection_reference.OrgId = org_id
|
|
258
|
+ // inspection_reference.ProjectName = item.Groupname
|
|
259
|
+ // inspection_reference.Project = item.Groupname
|
|
260
|
+ // inspection_reference.ProjectId = project_id
|
|
261
|
+ // inspection_reference.ItemName = item.Itemname
|
|
262
|
+ // inspection_reference.ItemNameAddition = item.Barcode
|
|
263
|
+ // inspection_reference.ItemId = item_id
|
|
264
|
+ // inspection_reference.RangeType = ItemType
|
|
265
|
+ // inspection_reference.RangeMin = RangeMin
|
|
266
|
+ // inspection_reference.RangeMax = RangeMax
|
|
267
|
+ // inspection_reference.RangeOptions = RangeOptions
|
|
268
|
+ // inspection_reference.Unit = item.Unit
|
|
269
|
+ // inspection_reference.Status = 1
|
|
270
|
+ // inspection_reference.CreatedTime = time.Now().Unix()
|
|
271
|
+ // inspection_reference.UpdatedTime = time.Now().Unix()
|
|
272
|
+ // inspection_reference.InspectDate = inspect_date
|
|
273
|
+ // inspection_reference.UTime = inspect_date
|
|
274
|
+ // err = tx.Model(&models.MiddleInspectionReference{}).Create(&inspection_reference).Error
|
|
275
|
+ // if err != nil {
|
|
276
|
+ // tx.Rollback()
|
|
277
|
+ // }
|
|
278
|
+ // }
|
|
279
|
+ //
|
|
280
|
+ // var itotal int
|
|
281
|
+ // err = readMiddleDb.Model(&models.MiddleInspection{}).Where("org_id = ? and project_id = ? and item_id = ? and record_date = ? and patient_id = ? and status = 1", org_id, project_id, item_id, record_date.Unix(), printInfo.PatientId).Find(&inspection).Count(&itotal).Error
|
|
282
|
+ // if itotal <= 0 {
|
|
283
|
+ // inspection.PatientId = printInfo.PatientId
|
|
284
|
+ // inspection.OrgId = org_id
|
|
285
|
+ // inspection.ProjectId = project_id
|
|
286
|
+ // inspection.ItemName = inspection_reference.ItemName
|
|
287
|
+ // inspection.ProjectName = inspection_reference.ProjectName
|
|
288
|
+ // inspection.InspectType = ItemType
|
|
289
|
+ // inspection.ItemId = item_id
|
|
290
|
+ // inspection.InspectValue = item.Result
|
|
291
|
+ // inspection.InspectDate = inspect_date
|
|
292
|
+ // inspection.RecordDate = record_date.Unix()
|
|
293
|
+ // inspection.Status = 1
|
|
294
|
+ // inspection.CreatedTime = time.Now().Unix()
|
|
295
|
+ // inspection.UpdatedTime = time.Now().Unix()
|
|
296
|
+ // inspection.UTime = inspect_date
|
|
297
|
+ // inspection.HisUserId = strconv.FormatInt(printInfo.PatientId, 10)
|
|
298
|
+ // err = tx.Model(&models.MiddleInspection{}).Create(&inspection).Error
|
|
299
|
+ // if err != nil {
|
|
300
|
+ // tx.Rollback()
|
|
301
|
+ // }
|
|
302
|
+ // }
|
|
303
|
+ //
|
|
304
|
+ // tx.Commit()
|
|
305
|
+ //
|
|
306
|
+ // }
|
|
307
|
+ // //插入一条查询检验检查结果记录状态数据
|
|
308
|
+ // var info LisSyncResultStatusInfo
|
|
309
|
+ // info.Ctime = time.Now().Unix()
|
|
310
|
+ // info.Status = 1
|
|
311
|
+ // info.Mtime = time.Now().Unix()
|
|
312
|
+ // info.OrgId = org_id
|
|
313
|
+ // info.IsResult = 1
|
|
314
|
+ // code, _ := strconv.ParseInt(list[0].Barcode, 10, 64)
|
|
315
|
+ // info.LastId = code
|
|
316
|
+ // info.ResultDate = time.Now().Unix()
|
|
317
|
+ // writeMiddleDb.Save(&info)
|
|
318
|
+ //
|
|
319
|
+ // }
|
|
320
|
+ //
|
|
321
|
+ // }
|
|
322
|
+ //
|
|
323
|
+ //}
|
|
324
|
+ //
|
|
325
|
+ //// 第一步:跟进org_id 去中间库查出需要同步的数据
|
|
326
|
+ //inspection_references, _ := GetSyncInspectionReferenceByOrgId(org_id)
|
|
327
|
+ //inspections, _ := GetSyncInspectionByOrgId(org_id)
|
|
328
|
+ //
|
|
329
|
+ //// 第二步:将数据同步到业务库
|
|
330
|
+ //if len(inspection_references) > 0 {
|
|
331
|
+ // for _, inspection_reference := range inspection_references {
|
|
332
|
+ // SyncInspectionReference(&inspection_reference)
|
|
333
|
+ // }
|
|
334
|
+ //}
|
|
335
|
+ //
|
|
336
|
+ //if len(inspections) > 0 {
|
|
337
|
+ // for _, inspection := range inspections {
|
|
338
|
+ // SyncInspection(&inspection)
|
|
339
|
+ // }
|
|
340
|
+ //}
|
|
341
|
+ return
|
|
342
|
+
|
|
343
|
+}
|
|
344
|
+
|
|
345
|
+func GetSHResultRecord() (record []*KMResult, err error) {
|
|
346
|
+ err = dataBase.Model(&KMResult{}).Order("barcode asc").Find(&record).Error
|
|
347
|
+ return
|
|
348
|
+}
|
|
349
|
+
|
|
350
|
+//判断是否包含中文
|
|
351
|
+func IsChineseChar(str string) bool {
|
|
352
|
+ for _, r := range str {
|
|
353
|
+ if unicode.Is(unicode.Scripts["Han"], r) || (regexp.MustCompile("[\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b]").MatchString(string(r))) {
|
|
354
|
+ return true
|
|
355
|
+ }
|
|
356
|
+ }
|
|
357
|
+ return false
|
|
358
|
+}
|
|
359
|
+
|
|
360
|
+func GetResultRecordByTime(id int64) (record []*KMResult, err error) {
|
|
361
|
+ err = readDb.Model(&KMResult{}).Where("barcode > ? AND repdate >= 2021-08-12 00:00:00", id).Order("barcode asc").Find(&record).Error
|
|
362
|
+ return
|
|
363
|
+}
|