@@ -407,4 +407,13 @@ def mqtt_upload_temperature(payload): |
||
| 407 | 407 |
|
| 408 | 408 |
set_old_temperature(eqpt.point_id, macid, temperature) |
| 409 | 409 |
|
| 410 |
+ try: |
|
| 411 |
+ ipui = IsolationPointUserInfo.objects.get(pk=eqpt.ipui_pk) |
|
| 412 |
+ except IsolationPointUserInfo.DoesNotExist: |
|
| 413 |
+ ipui = None |
|
| 414 |
+ if ipui: |
|
| 415 |
+ ipui.observed_ymds = list(set(ipui.observed_ymds + [point_measure_ymd])) |
|
| 416 |
+ ipui.observed_days = len(ipui.observed_ymds) |
|
| 417 |
+ ipui.save() |
|
| 418 |
+ |
|
| 410 | 419 |
set_screen_info(point.point_id, get_screen_data(point)) |
@@ -0,0 +1,19 @@ |
||
| 1 |
+# Generated by Django 3.2.6 on 2021-08-16 13:57 |
|
| 2 |
+ |
|
| 3 |
+from django.db import migrations |
|
| 4 |
+import jsonfield.fields |
|
| 5 |
+ |
|
| 6 |
+ |
|
| 7 |
+class Migration(migrations.Migration): |
|
| 8 |
+ |
|
| 9 |
+ dependencies = [ |
|
| 10 |
+ ('equipment', '0010_auto_20210816_2148'),
|
|
| 11 |
+ ] |
|
| 12 |
+ |
|
| 13 |
+ operations = [ |
|
| 14 |
+ migrations.AddField( |
|
| 15 |
+ model_name='isolationpointuserinfo', |
|
| 16 |
+ name='observed_ymds', |
|
| 17 |
+ field=jsonfield.fields.JSONField(blank=True, default=[], help_text='已测温日期', null=True, verbose_name='observed_ymds'), |
|
| 18 |
+ ), |
|
| 19 |
+ ] |
@@ -142,6 +142,7 @@ class IsolationPointUserInfo(BaseModelMixin): |
||
| 142 | 142 |
|
| 143 | 143 |
fields = JSONField(_('fields'), default=[], blank=True, null=True, help_text='字段信息')
|
| 144 | 144 |
|
| 145 |
+ observed_ymds = JSONField(_('observed_ymds'), default=[], blank=True, null=True, help_text='已测温日期')
|
|
| 145 | 146 |
observed_days = models.IntegerField(_('observed_days'), default=0, help_text='已测温天数')
|
| 146 | 147 |
leave_at = models.DateTimeField(_('leave_at'), blank=True, null=True, help_text='离开时间')
|
| 147 | 148 |
|