|
|
151
|
+ antigen_result = models.IntegerField(_('antigen_result'), choices=ANTIGEN_RESULT_TYPE, default=UNKNOWN, help_text='抗原检测结果')
|
|
|
152
|
+ detect_at = models.DateTimeField(_('detect_at'), blank=True, null=True, help_text='检测时间')
|
|
|
153
|
+
|
|
141
|
154
|
class Meta:
|
|
142
|
155
|
verbose_name = _('隔离点用户录入信息')
|
|
143
|
156
|
verbose_name_plural = _('隔离点用户录入信息')
|
|
|
|
@@ -184,14 +197,16 @@ class IsolationPointUserInfo(BaseModelMixin):
|
|
184
|
197
|
'last_submit_at': self.last_submit_at,
|
|
185
|
198
|
'last_report_time': tc.local_string(utc_dt=self.last_submit_at, format='%m-%d %H:%M') if self.last_submit_at else '',
|
|
186
|
199
|
'remark': self.remark or '',
|
|
|
200
|
+ 'antigen_result': self.get_antigen_result_display(),
|
|
|
201
|
+ 'detect_at': tc.local_string(utc_dt=self.detect_at, format='%m-%d %H:%M') if self.detect_at else '',
|
|
187
|
202
|
}
|
|
188
|
203
|
|
|
189
|
204
|
@property
|
|
190
|
205
|
def userdata(self):
|
|
191
|
206
|
return {
|
|
192
|
|
- 'point_id': self.point_id,
|
|
193
|
|
- 'user_id': self.user_id,
|
|
194
|
|
- **{ field.get('key', ''): field.get('value', '') for field in self.fields }
|
|
|
207
|
+ 'point_id': self.point_id,
|
|
|
208
|
+ 'user_id': self.user_id,
|
|
|
209
|
+ **{field.get('key', ''): field.get('value', '') for field in self.fields}
|
|
195
|
210
|
}
|
|
196
|
211
|
|
|
197
|
212
|
|
|
|
|
@@ -296,15 +311,15 @@ class ThermometerMeasureLogInfo(BaseModelMixin):
|
|
296
|
311
|
'temperature': self.temperature,
|
|
297
|
312
|
'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d'),
|
|
298
|
313
|
}
|
|
299
|
|
-
|
|
|
314
|
+
|
|
300
|
315
|
@property
|
|
301
|
316
|
def userdata(self):
|
|
302
|
|
- return {
|
|
|
317
|
+ return {
|
|
303
|
318
|
'macid': self.macid,
|
|
304
|
319
|
'sn': self.sn,
|
|
305
|
320
|
'temperature': self.temperature,
|
|
306
|
321
|
'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M'),
|
|
307
|
|
- }
|
|
|
322
|
+ }
|
|
308
|
323
|
|
|
309
|
324
|
|
|
310
|
325
|
class AepThermometerMeasureLogInfo(BaseModelMixin):
|
|
|
|
@@ -352,3 +367,33 @@ class AepThermometerMeasureLogInfo(BaseModelMixin):
|
|
352
|
367
|
|
|
353
|
368
|
def __unicode__(self):
|
|
354
|
369
|
return self.pk
|
|
|
370
|
+
|
|
|
371
|
+
|
|
|
372
|
+class AntigenMeasureLogInfo(BaseModelMixin):
|
|
|
373
|
+
|
|
|
374
|
+ NEGATIVE = 0
|
|
|
375
|
+ POSITIVE = 1
|
|
|
376
|
+ UNKNOWN = 2
|
|
|
377
|
+
|
|
|
378
|
+ ANTIGEN_RESULT_TYPE = (
|
|
|
379
|
+ (NEGATIVE, '阴性'),
|
|
|
380
|
+ (POSITIVE, '阳性'),
|
|
|
381
|
+ (UNKNOWN, '未知'),
|
|
|
382
|
+ )
|
|
|
383
|
+
|
|
|
384
|
+ point_id = models.CharField(_('point_id'), max_length=32, blank=True, null=True, help_text='隔离点唯一标识', db_index=True)
|
|
|
385
|
+
|
|
|
386
|
+ user_id = models.CharField(_('user_id'), max_length=32, blank=True, null=True, help_text='用户唯一标识')
|
|
|
387
|
+
|
|
|
388
|
+ macid = models.CharField(_('macid'), max_length=32, blank=True, null=True, help_text='设备号')
|
|
|
389
|
+ phone = models.CharField(_('phone'), max_length=11, blank=True, null=True, help_text='用户手机号')
|
|
|
390
|
+ user_name = models.CharField(_('user_name'), max_length=255, blank=True, null=True, help_text='用户姓名')
|
|
|
391
|
+ result = models.IntegerField(_('result'), choices=ANTIGEN_RESULT_TYPE, default=UNKNOWN, help_text='抗原检测结果')
|
|
|
392
|
+ detect_at = models.DateTimeField(_('detect_at'), blank=True, null=True, help_text='检测时间')
|
|
|
393
|
+
|
|
|
394
|
+ class Meta:
|
|
|
395
|
+ verbose_name = _('抗原检测记录信息')
|
|
|
396
|
+ verbose_name_plural = _('抗原检测记录信息')
|
|
|
397
|
+
|
|
|
398
|
+ def __unicode__(self):
|
|
|
399
|
+ return self.pk
|