>
- list_display = ('eqpt_id', 'point_id', 'macid', 'sn', 'active_status', 'active_at', 'name', 'sex', 'birth_stamp', 'age', 'phone', 'remark', 'last_submit_at', 'eqpt_register_status', 'eqpt_register_result', 'status', 'updated_at', 'created_at')
+ list_display = ('eqpt_id', 'point_id', 'macid', 'sn', 'active_status', 'active_at', 'ipui_pk', 'name', 'sex', 'birth_stamp', 'age', 'phone', 'remark', 'last_submit_at', 'eqpt_register_status', 'eqpt_register_result', 'status', 'updated_at', 'created_at')
list_filter = ('point_id', 'status')
@@ -27,6 +31,7 @@ class ThermometerMeasureLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin):
admin.site.register(IsolationPointInfo, IsolationPointInfoAdmin)
+admin.site.register(IsolationPointUserInfo, IsolationPointUserInfoAdmin)
admin.site.register(ThermometerEquipmentInfo, ThermometerEquipmentInfoAdmin)
admin.site.register(ThermometerMeasureInfo, ThermometerMeasureInfoAdmin)
admin.site.register(ThermometerMeasureLogInfo, ThermometerMeasureLogInfoAdmin)
@@ -0,0 +1,46 @@ |
||
| 1 |
+# Generated by Django 3.2.6 on 2021-08-12 05:57 |
|
| 2 |
+ |
|
| 3 |
+from django.db import migrations, models |
|
| 4 |
+import jsonfield.fields |
|
| 5 |
+ |
|
| 6 |
+ |
|
| 7 |
+class Migration(migrations.Migration): |
|
| 8 |
+ |
|
| 9 |
+ dependencies = [ |
|
| 10 |
+ ('equipment', '0005_thermometermeasureloginfo_temperature_src'),
|
|
| 11 |
+ ] |
|
| 12 |
+ |
|
| 13 |
+ operations = [ |
|
| 14 |
+ migrations.AddField( |
|
| 15 |
+ model_name='isolationpointinfo', |
|
| 16 |
+ name='limit_scene_qrcode_url', |
|
| 17 |
+ field=models.CharField(blank=True, help_text='字段二维码', max_length=255, null=True, verbose_name='limit_scene_qrcode_url'), |
|
| 18 |
+ ), |
|
| 19 |
+ migrations.AddField( |
|
| 20 |
+ model_name='isolationpointinfo', |
|
| 21 |
+ name='point_fields', |
|
| 22 |
+ field=jsonfield.fields.JSONField(blank=True, default=[], help_text='字段列表', null=True, verbose_name='point_fields'), |
|
| 23 |
+ ), |
|
| 24 |
+ migrations.AddField( |
|
| 25 |
+ model_name='thermometerequipmentinfo', |
|
| 26 |
+ name='ipui_pk', |
|
| 27 |
+ field=models.IntegerField(default=0, help_text='隔离点用户录入PK', verbose_name='ipui_pk'), |
|
| 28 |
+ ), |
|
| 29 |
+ migrations.CreateModel( |
|
| 30 |
+ name='IsolationPointUserInfo', |
|
| 31 |
+ fields=[ |
|
| 32 |
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
| 33 |
+ ('status', models.BooleanField(default=True, help_text='Status', verbose_name='status')),
|
|
| 34 |
+ ('created_at', models.DateTimeField(auto_now_add=True, help_text='Create Time', verbose_name='created_at')),
|
|
| 35 |
+ ('updated_at', models.DateTimeField(auto_now=True, help_text='Update Time', verbose_name='updated_at')),
|
|
| 36 |
+ ('point_id', models.CharField(blank=True, db_index=True, help_text='隔离点唯一标识', max_length=32, null=True, verbose_name='point_id')),
|
|
| 37 |
+ ('user_id', models.CharField(blank=True, db_index=True, help_text='用户唯一标识', max_length=32, null=True, verbose_name='user_id')),
|
|
| 38 |
+ ('fields', jsonfield.fields.JSONField(blank=True, default=[], help_text='字段信息', null=True, verbose_name='fields')),
|
|
| 39 |
+ ], |
|
| 40 |
+ options={
|
|
| 41 |
+ 'verbose_name': '隔离点用户录入信息', |
|
| 42 |
+ 'verbose_name_plural': '隔离点用户录入信息', |
|
| 43 |
+ 'unique_together': {('point_id', 'user_id')},
|
|
| 44 |
+ }, |
|
| 45 |
+ ), |
|
| 46 |
+ ] |
@@ -11,9 +11,19 @@ from TimeConvert import TimeConvert as tc |
||
| 11 | 11 |
class IsolationPointInfo(BaseModelMixin): |
| 12 | 12 |
point_id = ShortUUIDField(_('point_id'), max_length=32, blank=True, null=True, help_text='隔离点唯一标识', db_index=True, unique=True)
|
| 13 | 13 |
point_name = models.CharField(_('point_name'), max_length=255, blank=True, null=True, help_text='隔离点名称')
|
| 14 |
+ |
|
| 14 | 15 |
# [{"start": "8:00", "end": "9:00"}, {"start": "12:00", "end": "14:00"}]
|
| 15 | 16 |
point_measure_window = JSONField(_('point_measure_window'), default=[], blank=True, null=True, help_text='隔离点测温时间段')
|
| 16 | 17 |
|
| 18 |
+ # {
|
|
| 19 |
+ # "type": "input", # input, select, file |
|
| 20 |
+ # "name": "", |
|
| 21 |
+ # "options": ["男", "女"], # type=select |
|
| 22 |
+ # } |
|
| 23 |
+ point_fields = JSONField(_('point_fields'), default=[], blank=True, null=True, help_text='字段列表')
|
|
| 24 |
+ |
|
| 25 |
+ limit_scene_qrcode_url = models.CharField(_('limit_scene_qrcode_url'), max_length=255, blank=True, null=True, help_text='字段二维码')
|
|
| 26 |
+ |
|
| 17 | 27 |
class Meta: |
| 18 | 28 |
verbose_name = _('隔离点信息')
|
| 19 | 29 |
verbose_name_plural = _('隔离点信息')
|
@@ -42,6 +52,33 @@ class IsolationPointInfo(BaseModelMixin): |
||
| 42 | 52 |
return '' |
| 43 | 53 |
|
| 44 | 54 |
|
| 55 |
+class IsolationPointUserInfo(BaseModelMixin): |
|
| 56 |
+ point_id = models.CharField(_('point_id'), max_length=32, blank=True, null=True, help_text='隔离点唯一标识', db_index=True)
|
|
| 57 |
+ |
|
| 58 |
+ user_id = models.CharField(_('user_id'), max_length=32, blank=True, null=True, help_text='用户唯一标识', db_index=True)
|
|
| 59 |
+ |
|
| 60 |
+ fields = JSONField(_('fields'), default=[], blank=True, null=True, help_text='字段信息')
|
|
| 61 |
+ |
|
| 62 |
+ class Meta: |
|
| 63 |
+ verbose_name = _('隔离点用户录入信息')
|
|
| 64 |
+ verbose_name_plural = _('隔离点用户录入信息')
|
|
| 65 |
+ |
|
| 66 |
+ unique_together = ( |
|
| 67 |
+ ('point_id', 'user_id'),
|
|
| 68 |
+ ) |
|
| 69 |
+ |
|
| 70 |
+ def __unicode__(self): |
|
| 71 |
+ return self.pk |
|
| 72 |
+ |
|
| 73 |
+ @property |
|
| 74 |
+ def data(self): |
|
| 75 |
+ return {
|
|
| 76 |
+ 'point_id': self.point_id, |
|
| 77 |
+ 'user_id': self.user_id, |
|
| 78 |
+ 'fields': self.fields, |
|
| 79 |
+ } |
|
| 80 |
+ |
|
| 81 |
+ |
|
| 45 | 82 |
class ThermometerEquipmentInfo(BaseModelMixin): |
| 46 | 83 |
ONLINE = 1 |
| 47 | 84 |
OFFLINE = 0 |
@@ -70,6 +107,8 @@ class ThermometerEquipmentInfo(BaseModelMixin): |
||
| 70 | 107 |
active_at = models.DateTimeField(_('active_at'), blank=True, null=True, help_text=_('激活时间'))
|
| 71 | 108 |
|
| 72 | 109 |
# 用户基本信息 |
| 110 |
+ ipui_pk = models.IntegerField(_('ipui_pk'), default=0, help_text='隔离点用户录入PK')
|
|
| 111 |
+ |
|
| 73 | 112 |
name = models.CharField(_('name'), max_length=255, blank=True, null=True, help_text='用户姓名')
|
| 74 | 113 |
sex = models.IntegerField(_('sex'), choices=SexModelMixin.SEX_TUPLE, default=SexModelMixin.UNKNOWN, help_text='用户性别')
|
| 75 | 114 |
birth_stamp = models.BigIntegerField(_('birth_stamp'), default=0, help_text='生日时间戳')
|
@@ -1,2 +1,4 @@ |
||
| 1 |
+pywe-miniapp==1.1.6 |
|
| 1 | 2 |
pywe-oauth==1.1.1 |
| 2 | 3 |
pywe-pay==1.0.14 |
| 4 |
+pywe-storage==1.0.1 |