Просмотр исходного кода

Merge branch 'master' of http://git.yvanui.com/hust/wuhan_epi

lange 5 лет назад
Родитель
Сommit
357dcada6f
75 измененных файлов с 5776 добавлено и 455 удалено
  1. 21 0
      admin-ui/app/whepi/index.js
  2. 121 0
      admin-ui/app/whepi/lingyun/lingyunUser.js
  3. 8 0
      admin-ui/app/whepi/mock/menu.json
  4. 14 0
      admin-ui/app/whepi/mock/menu6.json
  5. 12 12
      admin-ui/app/whepi/scan/qrImg.js
  6. 30 22
      admin-ui/app/whepi/tugou/dialogTugou.js
  7. 1 4
      whepi-doc/mrsb.sql
  8. BIN
      whepi-ui/ly.png
  9. BIN
      whepi-ui/static/adminHelp_1.jpg
  10. BIN
      whepi-ui/static/homeHelp.jpg
  11. BIN
      whepi-ui/static/outHelp.jpg
  12. 43 9
      whepi-ui/templates/groupBuying/groupBuyingCx.ftl
  13. 10 2
      whepi-ui/templates/groupBuying/groupBuyingXx.ftl
  14. 19 0
      whepi-ui/templates/home/adminHelp.ftl
  15. 1 1
      whepi-ui/templates/home/buyClient.ftl
  16. 12 1
      whepi-ui/templates/home/frag.head.ftl
  17. 114 19
      whepi-ui/templates/home/home.ftl
  18. 1 1
      whepi-ui/templates/home/homeHelp.ftl
  19. 19 0
      whepi-ui/templates/home/outHelp.ftl
  20. 244 79
      whepi-ui/templates/home/ribao.ftl
  21. 978 60
      whepi-ui/templates/home/ribao.js
  22. 190 0
      whepi-ui/templates/lingyun/home.ftl
  23. 306 0
      whepi-ui/templates/lingyun/ribao.ftl
  24. 1484 0
      whepi-ui/templates/lingyun/ribao.js
  25. 36 0
      whepi-ui/templates/user/returnWork.ftl
  26. 5 4
      whepi-ui/templates/user/scan.ftl
  27. 1 1
      whepi-ui/templates/yeweihui/home.ftl
  28. 10 6
      whepi-ui/templates/yeweihui/tgPublish.ftl
  29. 1 1
      whepi-ui/templates/yeweihui/tuangouMemberList.ftl
  30. 1 1
      whepi-web/src/main/java/com/bofeng/controller/EpiAdminController.java
  31. 255 0
      whepi-web/src/main/java/com/bofeng/controller/EpiLYExportController.java
  32. 4 0
      whepi-web/src/main/java/com/bofeng/dao/JmTuangouDao.java
  33. 120 0
      whepi-web/src/main/java/com/bofeng/dao/MsReportMapper.java
  34. 27 0
      whepi-web/src/main/java/com/bofeng/dao/MsSuspectedMapper.java
  35. 18 0
      whepi-web/src/main/java/com/bofeng/dao/MsTripDetMapper.java
  36. 16 0
      whepi-web/src/main/java/com/bofeng/dao/MsTripMapper.java
  37. 2 1
      whepi-web/src/main/java/com/bofeng/dao/OutUserMapper.java
  38. 4 2
      whepi-web/src/main/java/com/bofeng/dao/RbMapper.java
  39. 1 0
      whepi-web/src/main/java/com/bofeng/dao/SweepCodeMapper.java
  40. 3 0
      whepi-web/src/main/java/com/bofeng/dao/UptownHouseMapper.java
  41. 4 1
      whepi-web/src/main/java/com/bofeng/dao/UptownUnitMapper.java
  42. 2 0
      whepi-web/src/main/java/com/bofeng/dao/UserOpenMapper.java
  43. 62 3
      whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoLY.java
  44. 64 6
      whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoPrivate.java
  45. 4 0
      whepi-web/src/main/java/com/bofeng/entity/MsReport.java
  46. 19 0
      whepi-web/src/main/java/com/bofeng/entity/MsSuspected.java
  47. 36 0
      whepi-web/src/main/java/com/bofeng/entity/MsTrip.java
  48. 61 0
      whepi-web/src/main/java/com/bofeng/entity/MsTripDet.java
  49. 6 0
      whepi-web/src/main/java/com/bofeng/entity/SysUptownHouse.java
  50. 10 0
      whepi-web/src/main/java/com/bofeng/entity/UserOpen.java
  51. 39 57
      whepi-web/src/main/java/com/bofeng/service/BuyService.java
  52. 15 5
      whepi-web/src/main/java/com/bofeng/service/JmTuangouService.java
  53. 220 9
      whepi-web/src/main/java/com/bofeng/service/MsReportService.java
  54. 68 13
      whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java
  55. 276 0
      whepi-web/src/main/java/com/bofeng/service/MsTripService.java
  56. 53 0
      whepi-web/src/main/java/com/bofeng/service/RbService.java
  57. 6 0
      whepi-web/src/main/java/com/bofeng/service/SweepCodeService.java
  58. 42 41
      whepi-web/src/main/java/com/bofeng/service/UserOpenService.java
  59. 124 0
      whepi-web/src/main/java/com/bofeng/word/WordUtils.java
  60. 40 15
      whepi-web/src/main/java/com/bofeng/wx/WxController.java
  61. 36 9
      whepi-web/src/main/java/com/bofeng/wx/controller/MsReportController.java
  62. 89 0
      whepi-web/src/main/java/com/bofeng/wx/controller/MsTripController.java
  63. 31 10
      whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java
  64. 202 49
      whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java
  65. 71 2
      whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java
  66. 18 4
      whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java
  67. 5 2
      whepi-web/src/main/resources/application-xielianghe.yml
  68. 1 1
      whepi-web/src/main/resources/application.yml
  69. 1 1
      whepi-web/src/main/resources/mapper/BuyMapper.xml
  70. 3 0
      whepi-web/src/main/resources/mapper/JmTuangouMapper.xml
  71. 1 1
      whepi-web/src/main/resources/mapper/MsSuspected.xml
  72. 7 0
      whepi-web/src/main/resources/mapper/MsTripDet.xml
  73. 20 0
      whepi-web/src/main/resources/mapper/SweepCodeMapper.xml
  74. 8 0
      whepi-web/src/main/resources/mapper/UserOpen.xml
  75. BIN
      whepi-web/src/main/resources/word/健康及旅居申报表_20200221.docx

+ 21 - 0
admin-ui/app/whepi/index.js

@@ -92,6 +92,27 @@ $(function () {
         onLoadSuccess: function (node, data) {
         }
       });
+    } else if (userRole == "6") {//凌云后台菜单
+      $('#menutree').tree({
+        url: '/app/whepi/mock/menu6.json',
+        onDblClick: function (node) {
+          var $this = $(this);
+          if (!$this.tree('isLeaf', node.target)) {
+            $this.tree(node.state === 'closed' ? 'expand' : 'collapse', node.target);
+          }
+        },
+        onSelect: function () {
+          return false;
+        },
+        onClick: function (node) {
+          var href = node.href;
+          if ($.trim(href)) {
+            App.addTab({title: node.text, url: node.href, id: node.id, iconCls: node.iconCls});
+          }
+        },
+        onLoadSuccess: function (node, data) {
+        }
+      });
     }
 
 

+ 121 - 0
admin-ui/app/whepi/lingyun/lingyunUser.js

@@ -0,0 +1,121 @@
+define(function (require) {
+        return function (context) {
+
+            var $grid1, $form;
+
+            // 输入搜索文本后点击回车按钮查询列表
+            function enterQueryGrid1(e) {
+                if (e.keyCode === 13) {
+                    var tmp = $(this).val();
+                    $form.formSet({queryProperties: tmp});
+                    queryGrid1();
+                }
+            }
+
+            // 检索条件查询
+            function queryGrid1() {
+                var queryForm = $form.formGet();
+                $grid1.reload({
+                    mtype: 'POST',
+                    url: api('/sweepCode/selectLingyunUser'),
+                    queryParams: queryForm
+                }, true);
+            }
+
+            var queryToolbar = {
+                xtype: 'toolbar',
+                title: '用户管理',
+                items: [
+                    {
+                        text: '查询', iconCls: 'fa fa-search', onClick: function () {
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+                            $form.formClear();
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+                            App.closeMe(this);
+                        }
+                    }
+                ]
+            };
+
+            var queryForm = {
+                onRender: function () {
+                    $form = $(this);
+                },
+                xtype: 'form',
+                items: [[
+                    {
+                        xtype: 'textbox',
+                        label: '检索条件',
+                        name: 'queryProperties',
+                        prompt: "小区名称/用户名称/电话号码",
+                        labelWidth: 'auto',
+                        events: {keydown: enterQueryGrid1}, width: 350
+                    },
+                ]]
+            };
+
+            return {
+                north: {
+                    height: 88,
+                    /* split: true,
+                     border: false,*///底框是否可变动
+                    items: [
+                        queryToolbar,
+                        queryForm
+                    ]
+                },
+                center: {
+                    height: '60%',
+                    split: true,
+                    items:
+                        {
+                            onRender: function () {
+                                $grid1 = $(this);
+                                queryGrid1()
+                            },
+                            xtype: 'grid',
+                            toolbar: {
+                                xtype: 'toolbar',
+                                title: '用户列表',
+                                items: [
+                                    {
+                                        text: '生成健康及旅居申请表', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+
+                                        }
+                                    },
+                                    {
+                                        text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+
+                                        }
+                                    }
+
+                                ]
+                            },
+                            multiselect: true, /// 表格多选
+                            idField: 'userId',
+                            editable: true,
+                            editOnSelected: true,
+                            autoSizeColumns: true,
+                            columns:
+                                [
+                                    [
+                                        {field: 'userId', title: '用户ID', hidden: true},
+                                        {field: 'linkman', title: '用户名', maxWidth: 200, align: 'left',},
+                                        {field: 'uptownName', title: '小区名称', maxWidth: 200, align: 'left',},
+                                        {field: 'phone', title: '电话', maxWidth: 200, align: 'left',},
+                                        {field: 'dept', title: '部门', maxWidth: 200, align: 'left',},
+
+                                    ]
+                                ]
+                        }
+                }
+            };
+        };
+    }
+);

+ 8 - 0
admin-ui/app/whepi/mock/menu.json

@@ -48,6 +48,14 @@
           "iconCls": "icon-blank fa fa-align-justify",
           "state": "close",
           "children": []
+        },
+        {
+          "id": "ENT100025",
+          "text": "凌云导出报表",
+          "href": "/app/whepi/lingyun/lingyunUser.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
         }
       ]
     },

+ 14 - 0
admin-ui/app/whepi/mock/menu6.json

@@ -0,0 +1,14 @@
+{
+  "success": true,
+  "msg": "",
+  "data": [
+    {
+      "id": "ENT10001",
+      "text": "资源需求管理",
+      "href": "/app/whepi/tugou/tugou.js",
+      "iconCls": "icon-blank fa fa-align-justify",
+      "state": "close",
+      "children": []
+    }
+  ]
+}

+ 12 - 12
admin-ui/app/whepi/scan/qrImg.js

@@ -84,18 +84,18 @@ define(function (require) {
                                 xtype: 'toolbar',
                                 title: '小区大门详情',
                                 items: [
-                                    // {
-                                    //     text: '添加大门', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
-                                    //         $.yvan.showDialog(this,
-                                    //             require('/app/whepi/scan/addDoor.js')({
-                                    //                 isEdit: false,
-                                    //                 confirm: function () {
-                                    //                     queryGrid1();
-                                    //                 }
-                                    //             })
-                                    //         );
-                                    //     }
-                                    // },
+                                    {
+                                        text: '添加大门', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+                                            $.yvan.showDialog(this,
+                                                require('/app/whepi/scan/addDoor.js')({
+                                                    isEdit: false,
+                                                    confirm: function () {
+                                                        queryGrid1();
+                                                    }
+                                                })
+                                            );
+                                        }
+                                    },
                                     // {
                                     //     text: '编辑大门', iconCls: 'fa fa fa-pencil-square-o fa-lg', onClick: function () {
                                     //         var row = $grid1.rowData();

+ 30 - 22
admin-ui/app/whepi/tugou/dialogTugou.js

@@ -36,7 +36,7 @@ define(function (require) {
     return {
       xtype: 'dialog',
       dialogId: 'dialogTugou',
-      title: context.isEdit == 2 ? '增补修订需求' : '新增需求发布',
+      title: context.isEdit == 2 ? '增补修订需求' : (context.isEdit == 3 ? '取消需求' : '新增需求发布'),
       width: '100%',
       height: '100%',
       onOpen: function () {
@@ -78,7 +78,7 @@ define(function (require) {
                 width: 900,
                 height: 35,
                 validType: 'isBlank',
-                readonly: context.isEdit != 1 ? true : false,
+                disabled: context.isEdit != 1 ? true : false,
                 onChange: function (data) {
                   queryGrid1(data);
                 },
@@ -93,7 +93,7 @@ define(function (require) {
               }, {id: '5', text: '其他服务'}],
               width: 450,
               height: 35,
-              readonly: context.isEdit != 1 ? true : false,
+              disabled: context.isEdit != 1 ? true : false,
               required: true,
               onChange: function (data) {
 
@@ -101,14 +101,14 @@ define(function (require) {
             }, {
               name: 'tgPrice',
               label: '单价',
-              readonly: context.isEdit != 1 ? true : false,
+              disabled: context.isEdit != 1 ? true : false,
               maxlength: 6, validType: 'number',
               width: 450, height: 35,
             }],
             [{
               name: 'tgItemNum',
               label: '个人限额',
-              readonly: context.isEdit != 1 ? true : false,
+              disabled: context.isEdit != 1 ? true : false,
               maxlength: 6, validType: 'integer',
               width: 450, height: 35,
             },],
@@ -116,31 +116,31 @@ define(function (require) {
               name: 'tgGoods', label: '套餐描述',
               required: true, width: 900, height: 35,
               maxlength: 500,
-              readonly: context.isEdit != 1 ? true : false,
+              disabled: context.isEdit != 1 ? true : false,
               height: '100px', multiline: true,
             }],
             [{
               name: 'tgMinNum',
               label: '最低配送',
-              readonly: context.isEdit != 1 ? true : false,
+              disabled: context.isEdit != 1 ? true : false,
               maxlength: 4, validType: 'integer',
               width: 450, height: 35,
             }, {
               name: 'tgMaxNum',
-              readonly: context.isEdit != 1 ? true : false,
+              disabled: context.isEdit != 1 ? true : false,
               label: '配送上限', validType: 'integer',
               maxlength: 4, width: 450, height: 35,
             }],
             [{
               name: 'tgEndTime',
               label: '需求截止时间',
-              readonly: context.isEdit != 1 ? true : false,
+              disabled: context.isEdit == 3 ? true : false,
               xtype: 'datetimebox',
               required: true, width: 450, height: 35,
             }, {
               name: 'tgDeliverTime',
               multiline: true,
-              readonly: context.isEdit != 1 ? true : false,
+              disabled: context.isEdit == 3 ? true : false,
               xtype: 'datetimebox',
               label: '预计配货时间',
               required: true, width: 450, height: 35,
@@ -148,19 +148,19 @@ define(function (require) {
               {
                 name: 'tgPhoneNumber', validType: 'telNum',
                 label: '联系电话', width: 450, height: 35,
-                readonly: context.isEdit != 1 ? true : false,
+                disabled: context.isEdit != 1 ? true : false,
                 required: true, maxlength: 11,
               },
               {
                 name: 'tgSupplier', width: 450, height: 35,
-                label: '供应商', maxlength: 20,
-                readonly: context.isEdit != 1 ? true : false,
+                label: '供应商', maxlength: 20, required: true,
+                disabled: context.isEdit != 1 ? true : false,
               }],
             [
               {
                 name: 'remark', width: 900, height: 120,
                 label: '备注', maxlength: 500, multiline: true,
-                required: true, xtype: context.isEdit==1 ? 'hidden' : '',
+                required: true, xtype: context.isEdit == 1 ? 'hidden' : '',
               }
             ]
           ],
@@ -173,21 +173,29 @@ define(function (require) {
               $.yvan.msg('请先选择小区');
               return;
             }
-            if ($form.formGet().tgMinNum > $form.formGet().tgMaxNum) {
-              $.yvan.msg('最大上限必须大于等于最小起订量');
-              return;
+            if ($form.formGet().tgMinNum != '') {
+              if ($form.formGet().tgMaxNum != '') {
+                if ($form.formGet().tgMinNum > $form.formGet().tgMaxNum) {
+                  $.yvan.msg('最大上限必须大于等于最小起订量');
+                  return;
+                }
+              }
             }
+
             if ($form.formGet().tgEndTime > $form.formGet().tgDeliverTime) {
               $.yvan.msg('团购截止时间必须小于预计送货时间');
               return;
             }
             console.log($form.formGet());
-            if (isLoading === true) {
-              return;
-            }
-            else {
-              isLoading = true;
+            if (context.isEdit == 1) {
+              if (isLoading === true) {
+                return;
+              }
+              else {
+                isLoading = true;
+              }
             }
+
             $.yvan.postForm($form, {
               url: (context.isEdit == 1 ? api('/yeweihui/tgPublish') : (context.isEdit == 3 ? api('/yeweihui/updateStatus') : api('/yeweihui/tgStatus'))),
               success: function (data) {

+ 1 - 4
whepi-doc/mrsb.sql

@@ -67,10 +67,6 @@ CREATE TABLE ms_trip  (
   today_local       int(11)    NOT NULL DEFAULT 0                           COMMENT '今日驻地:0未填写,1武汉市,2宜昌市,3当阳市,其他地点',
   today_local_other varchar(50)  NOT NULL DEFAULT ''                        COMMENT '今日驻地其他地点',
   is_trip           int(11)    NOT NULL DEFAULT 0                           COMMENT '是否出行:0否,1是',
-  user_create       bigint(20) NOT NULL DEFAULT 0                           COMMENT '新增人',
-  time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0)       COMMENT '新增时间',
-  user_update       bigint(20) NOT NULL DEFAULT 0                           COMMENT '修改人',
-  time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
   PRIMARY KEY (trip_id) USING BTREE
 ) ENGINE = InnoDB default charset=utf8mb4 comment = '家庭出行表';
 
@@ -88,6 +84,7 @@ CREATE TABLE ms_trip_det  (
   end_local         int(11)    NOT NULL DEFAULT 0                           COMMENT '目的地:0未填写,1武汉市,2宜昌市,3当阳市,其他地点',
   end_local_other   varchar(50)  NOT NULL DEFAULT ''                        COMMENT '目的地其他地点',
   trip_type         int(11)    NOT NULL DEFAULT 0                           COMMENT '出行方式:0未填写,1长途汽车,2火车,3飞机',
+  trip_type_desp    varchar(50)  NOT NULL DEFAULT ''                        COMMENT '车次/航班/车牌',
   user_create       bigint(20) NOT NULL DEFAULT 0                           COMMENT '新增人',
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0)       COMMENT '新增时间',
   user_update       bigint(20) NOT NULL DEFAULT 0                           COMMENT '修改人',

BIN
whepi-ui/ly.png


BIN
whepi-ui/static/adminHelp_1.jpg


BIN
whepi-ui/static/homeHelp.jpg


BIN
whepi-ui/static/outHelp.jpg


+ 43 - 9
whepi-ui/templates/groupBuying/groupBuyingCx.ftl

@@ -23,15 +23,25 @@
             <div style="height: 1vh;"></div>
             <p style="text-indent: -0em;margin-left: 2em;">单&nbsp;&nbsp;&nbsp;&nbsp;价:&nbsp;&nbsp;${ tgItem.tgPrice }</p>
             <div style="height: 1vh;"></div>
-            <p style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;${ tgItem.tgMinNum }</p>
+            <p id="cx_p_tgMinNum" style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;</p>
             <div style="height: 1vh;"></div>
-            <p style="text-indent: -0em;margin-left: 2em;">最大订量(份):&nbsp;&nbsp;${ tgItem.tgMaxNum }</p>
+            <p id="cx_p_tgMaxNum" style="text-indent: -0em;margin-left: 2em;">最大订量(份):&nbsp;&nbsp;</p>
             <div style="height: 1vh;"></div>
             <p id="cx_p_tgItemNum" style="text-indent: -0em;margin-left: 2em;">个人限额(份):&nbsp;&nbsp;</p>
-            <div style="height: 1vh;"></div>
-            <p id="cx_p_endTime" style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;</p>
-            <div style="height: 1vh;"></div>
-            <p id="cx_p_deliverTime"style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;</p>
+            <div id="cx_showView">
+                <div style="height: 1vh;"></div>
+                <p id="cx_p_endTime" style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;</p>
+                <div style="height: 1vh;"></div>
+                <p id="cx_p_deliverTime"style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;</p>
+            </div>
+            <div id="cx_modifyView">
+                <div style="height: 1vh;"></div>
+                <p class="weui-media-box__desc" style="text-indent: -0em;margin-left: 2em;">截止时间:</p>
+                <input id="cx_tg_input_end_time" type="text" placeholder="请选择时间" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;text-indent: -0em;margin-left: 2em;"/>
+                <div style="height: 1vh;"></div>
+                <p class="weui-media-box__desc" style="text-indent: -0em;margin-left: 2em;">预计送货时间:</p>
+                <input id="cx_tg_input_deliver_time" type="text" placeholder="请选择时间" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;text-indent: -0em;margin-left: 2em;"/>
+            </div>
             <div style="height: 1vh;"></div>
             <p style="text-indent: -0em;margin-left: 2em;">服务电话:&nbsp;&nbsp;${ tgItem.tgPhoneNumber }</p>
         </div>
@@ -53,9 +63,31 @@
 
     var operation = ${operation};
 
+    if (operation === 'remark') {
+        $('#cx_showView').hide();
+        $('#cx_modifyView').show();
+
+        $('#cx_tg_input_end_time').val(tgItem.tgEndTime);
+        $('#cx_tg_input_deliver_time').val(tgItem.tgDeliverTime);
+
+        $("#cx_tg_input_end_time").datetimePicker();
+        $("#cx_tg_input_deliver_time").datetimePicker();
+    }
+    if (operation === 'cancel') {
+        $('#cx_showView').show();
+        $('#cx_modifyView').hide();
+
+        $('#cx_p_endTime').append(tgItem.tgEndTime);
+        $('#cx_p_deliverTime').append(tgItem.tgDeliverTime);
+    }
 
-    $('#cx_p_endTime').append(tgItem.tgEndTime);
-    $('#cx_p_deliverTime').append(tgItem.tgDeliverTime);
+    if (tgItem.tgMinNum != 0) {
+        $('#cx_p_tgMinNum').append(tgItem.tgMinNum);
+    }
+
+    if (tgItem.tgMaxNum != 0) {
+        $('#cx_p_tgMaxNum').append(tgItem.tgMaxNum);
+    }
 
     if (tgItem.tgItemNum != 0) {
         $('#cx_p_tgItemNum').append(tgItem.tgItemNum);
@@ -75,7 +107,9 @@
 
         let sendData = {
             jmId: tgItem.jmId,
-            remark: inputValue
+            remark: inputValue,
+            endTime: $('#cx_tg_input_end_time').val(),
+            deliverTime: $('#cx_tg_input_deliver_time').val()
         };
 
         if (operation === 'cancel') {

+ 10 - 2
whepi-ui/templates/groupBuying/groupBuyingXx.ftl

@@ -24,9 +24,9 @@
             <div style="height: 1vh;"></div>
             <p style="text-indent: -0em;margin-left: 2em;">单&nbsp;&nbsp;&nbsp;&nbsp;价:&nbsp;&nbsp;${ tgItem.tgPrice }</p>
             <div style="height: 1vh;"></div>
-            <p style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;${ tgItem.tgMinNum }</p>
+            <p id="p_tgMinNum" style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;</p>
             <div style="height: 1vh;"></div>
-            <p style="text-indent: -0em;margin-left: 2em;">最大订量(份):&nbsp;&nbsp;${ tgItem.tgMaxNum }</p>
+            <p id="p_tgMaxNum" style="text-indent: -0em;margin-left: 2em;">最大订量(份):&nbsp;&nbsp;</p>
             <div style="height: 1vh;"></div>
             <p id="p_tgItemNum" style="text-indent: -0em;margin-left: 2em;">个人限额(份):&nbsp;&nbsp;</p>
             <div style="height: 1vh;"></div>
@@ -136,6 +136,14 @@
     $('#p_endTime').append(tgItem.tgEndTime);
     $('#p_deliverTime').append(tgItem.tgDeliverTime);
 
+    if (tgItem.tgMinNum != 0) {
+        $('#p_tgMinNum').append(tgItem.tgMinNum);
+    }
+
+    if (tgItem.tgMaxNum != 0) {
+        $('#p_tgMaxNum').append(tgItem.tgMaxNum);
+    }
+
     if (tgItem.tgItemNum != 0) {
         $('#p_tgItemNum').append(tgItem.tgItemNum);
     }

+ 19 - 0
whepi-ui/templates/home/adminHelp.ftl

@@ -0,0 +1,19 @@
+<#assign title="管理员手册"/>
+<#include "/home/frag.head.ftl" />
+
+<div class="page__bd" style="height: 300px">
+    <div class="container">
+        <img src="/static/adminHelp_1.jpg" style="width: 100%"/>
+</div>
+
+
+<#include "/home/frag.foot.ftl" />
+
+<script>
+
+    (function ($) {
+
+    })(jQuery);
+
+
+</script>

+ 1 - 1
whepi-ui/templates/home/buyClient.ftl

@@ -85,7 +85,7 @@
                 $("#Buycount").html(data.data.count);
                 $("#myStatus").html(getStatus(data.data.tgStatus));
                 $("#myPhone").val(data.data.phone);
-                if (data.data.roleType == 1) {
+                if (data.data.tgMaxNum - data.data.count <= 0) {
                     $("#tc1").toggle();
                 } else {
                     $("#tc").html(data.data.tgMaxNum - data.data.count);

+ 12 - 1
whepi-ui/templates/home/frag.head.ftl

@@ -148,8 +148,19 @@
             margin-right: 0.5vw;
             margin-top: 0.7vw;
         }
+        .tt{
+            border-top: 3px solid #75859f;
+            margin-top:2.4em
+        }
+        .weui-radio{
+            padding:10px 15px;
+            position:relative;
+            -webkit-box-align:center;
+            -webkit-align-items:center;
+            align-items:center
+        }
     </style>
 </head>
 <span hidden="hidden" id="id"></span>
 
-<body style="height: 100%" ontouchstart>
+<body style="height: 100%;overflow:hidden;" ontouchstart>

+ 114 - 19
whepi-ui/templates/home/home.ftl

@@ -3,13 +3,16 @@
 
 <div class="weui-tab">
     <input id="userId" type="text" hidden="hidden" value=${user_id!}/>
+    <input id="uptownId" type="text" hidden="hidden" value=${uptown_id!}/>
     <div class="weui-tab__bd">
         <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
             <#include "/home/ribao.ftl" /></div>
         <div id="tab2" class="weui-tab__bd-item">
             <#include "/home/qiuzhu.ftl" /></div>
+        <#if uptownId != 1238790987234 && uptownId != 5>
         <div id="tab3" class="weui-tab__bd-item">
-    <#include "/home/buy.ftl" /></div>
+            <#include "/home/buy.ftl" /></div>
+        </#if>
     <#--<div id="tab4" class="weui-tab__bd-item">-->
     <#--<h1>页面四</h1> </div>-->
     </div>
@@ -22,10 +25,12 @@
             <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
             <p class="weui-tabbar__label">家庭求助</p>
         </a>
+        <#if uptownId != 1238790987234 && uptownId != 5>
         <a id="jt3" href="#tab3" class="weui-tabbar__item" onclick="buyGroup()">
             <div class="weui-tabbar__icon"><img src="/static/images/wx/upload.png" alt=""></div>
-            <p class="weui-tabbar__label">商品团购</p>
+            <p class="weui-tabbar__label">团购</p>
         </a>
+        </#if>
     <#--<a href="#tab4" class="weui-tabbar__item">-->
     <#--<div class="weui-tabbar__icon"> <img src="./images/icon_nav_cell.png" alt=""> </div>-->
     <#--<p class="weui-tabbar__label">我</p>-->
@@ -38,6 +43,9 @@
 
 <#include "/home/frag.foot.ftl" />
 <script>
+    var xiaoquId = '1238790987234'; //1238790987234
+    var ceshixiaoquId = '5';
+    var canSahngbao = true;
     <#include "/home/ribao.js" />
     <#include "/home/qiuzhu.js" />
     (function ($) {
@@ -54,16 +62,27 @@
             });
         });
 
-
+        var uptownId = $("#uptownId").val();
+        if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
+            $('#ribao_trip')[0].style.display = '';
+            $('#ribao_djgl')[0].style.display = 'none';
+            $('#ribao_jbqk')[0].style.display = 'none';
+        } else {
+            $('#ribao_trip')[0].style.display = 'none';
+            $('#ribao_djgl')[0].style.display = '';
+            $('#ribao_jbqk')[0].style.display = '';
+        }
         ribao_init();
         qiuzhu_init();
         family_init();
         ribao_add();
         ribao_cancel();
+        getUptownUnitLY();
 
         <#if msReport ??>var msReport = ${msReport}</#if>;
         $('#ribao_jinrijujian').append(msReport.safetyNum);
         if (msReport.reportStatus == 1) {
+            canSahngbao = false;
             document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
         }
         ribaoInitialization(msReport.reportId);
@@ -113,6 +132,82 @@
         }
     })(jQuery);
 
+    // 凌云更换单位
+    function getUptownUnitLY() {
+        $.ajax({
+            type: "GET",
+            url: "/home/getUptownUnitLY.json?uptownId=" + $("#uptownId").val(),
+            data: {},
+            dataType: "json",
+            success: function (data) {
+                if (data.length > 0) {
+                    $("#newUnitId").empty();
+                    $('#newUnitId').append("<option>请选择</option>");
+                    var html = "";
+                    for (var i = 0; i < data.length; i++) {
+                        html += '<option value="' + data[i].unitId + '">' + data[i].ridgepole + data[i].unit + '</option>';
+                    }
+                    $('#newUnitId').append(html);
+                    $("#newUnitId").val('0');
+                }
+            }
+        });
+    }
+
+    // 凌云更换单位后保存
+    function changeUnitId() {
+        var unitId = $("#unitId").val();
+        var newUnitId = $("#newUnitId").val();
+        var newUnitText = $("#newUnitId").find("option:selected").text();
+        if (!newUnitId || newUnitId == "请选择") {
+            $.alert("请选择部门")
+            return false;
+        }
+        if (newUnitId == unitId) {
+            $.alert("您选择的部门和原来的部门一样")
+            return false;
+        }
+        $.ajax({
+            url: '/home/changeUnitId.json',
+            type: "post",
+            data: {
+                userId: $('#userId').val(),
+                newUnitId: newUnitId,
+            }, success: function (date) {
+                $("#unitId").val(newUnitId);
+                $("#unitMsg").text(newUnitText);
+                $.alert("更改成功")
+                return false;
+            }
+        });
+    }
+
+    // 凌云更换工号后保存
+    function changeDoorplate() {
+        var doorplate = $("#doorplateMsg").text();
+        var newDoorplate = $("#newDoorplate").val().trim();
+        if (!newDoorplate) {
+            $.alert("请输入工号")
+            return false;
+        }
+        if (doorplate == newDoorplate) {
+            $.alert("您输入的工号和原本的工号一样")
+            return false;
+        }
+        $.ajax({
+            url: '/home/changeDoorplate.json',
+            type: "post",
+            data: {
+                userId: $('#userId').val(),
+                newDoorplate: newDoorplate,
+            }, success: function (date) {
+                $("#doorplateMsg").text(newDoorplate);
+                $.alert("更改成功")
+                return false;
+            }
+        });
+    }
+
 
     //小区求助信息的展示
     function familyClick() {
@@ -154,23 +249,23 @@
     function xiaoQuItemClick(v) {
         window.location.href = "/quzhu/home/quxiao.html?taskId=" + v.taskId + "&userId=" + $('#userId').val();
         /*familyClick();*/
-    /*    $.ajax({
-            url: '/home/home/taskQuery',
-            data: {taskId: v.taskId},
-            type: 'GET',
-            success: function (data) {
-                console.log(data);
-                if ($('#userId').val() != data.data.userId) {
-                    $.alert('当前求助信息不是你的')
-                    return;
-                } else {
-                    window.location.href = "/quzhu/home/quxiao.html?taskId=" + v.taskId + "&userId=" + v.userId;
-                    familyClick()
+        /*    $.ajax({
+                url: '/home/home/taskQuery',
+                data: {taskId: v.taskId},
+                type: 'GET',
+                success: function (data) {
+                    console.log(data);
+                    if ($('#userId').val() != data.data.userId) {
+                        $.alert('当前求助信息不是你的')
+                        return;
+                    } else {
+                        window.location.href = "/quzhu/home/quxiao.html?taskId=" + v.taskId + "&userId=" + v.userId;
+                        familyClick()
+                    }
+                },
+                error: function () {
                 }
-            },
-            error: function () {
-            }
-        });*/
+            });*/
 
     }
 

+ 1 - 1
whepi-ui/templates/home/homeHelp.ftl

@@ -1,4 +1,4 @@
-<#assign title="操作帮助"/>
+<#assign title="家庭手册"/>
 <#include "/home/frag.head.ftl" />
 
 <div class="page__bd" style="height: 300px">

+ 19 - 0
whepi-ui/templates/home/outHelp.ftl

@@ -0,0 +1,19 @@
+<#assign title="出入管理"/>
+<#include "/home/frag.head.ftl" />
+
+<div class="page__bd" style="height: 300px">
+    <div class="container">
+        <img src="/static/outHelp.jpg" style="width: 100%"/>
+</div>
+
+
+<#include "/home/frag.foot.ftl" />
+
+<script>
+
+    (function ($) {
+
+    })(jQuery);
+
+
+</script>

+ 244 - 79
whepi-ui/templates/home/ribao.ftl

@@ -7,10 +7,16 @@
             <a class="weui-navbar__item" target="#rb_nav2" module="ri_bao">
                 健康日历
             </a>
+            <#if (uptownId??) && (uptownId == 1238790987234 || uptownId == 5 )>
+            <a class="weui-navbar__item" target="#rb_nav3" module="ri_bao">
+                更改部门
+            </a>
+            </#if>
         </div>
         <div class="weui-tab__panel">
             <div id="rb_nav1" class="weui-tab__bd-item ri_bao_weui_tab_bd_item_active">
-                <div id="notOpenRibao">
+                <div class="weui-panel weui-panel_access">
+                    <div id="notOpenRibao">
                     <div class="weui-cells weui-cells_form">
                         <div class="weui-cell weui-cell_vcode" style="height: 7vh">
                             <div class="weui-cell__hd">
@@ -33,14 +39,16 @@
                     <#--</div>-->
                     </div>
                     <div class="weui-cells__tips"> <span style="color: red">
+                        <br/>
                         注:请如实上报情况,便以相互帮助,小区是我家,团结就是力量!后期会有医生跟踪分析,给予大家医疗建议,请认真填报!
                     </span></div>
                     <div class="weui-btn-area">
-                        <a id="btn_shangbao" class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips" style=""
+                        <a id="btn_shangbao" class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips"
+                           style=""
                            onclick="addReport()">上报</a>
                     </div>
                 </div>
-                <div id="ribao" class="weui-btn-area" style="display: none">
+                    <div id="ribao" class="weui-btn-area" style="display: none">
                     <div style="text-align: center;">基本信息</div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between;">
                         <input id="js_input_user_name" class="weui-input" autofocus="" type="text" placeholder="请输入姓名"
@@ -53,87 +61,120 @@
                                maxlength="3"
                                style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 25%; text-align: center;"/>
                     </div>
-                    <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">基本情况</div>
-                    <div class="weui-cells weui-cells_checkbox">
-                        <label class="weui-cell weui-cell_active weui-check__label" for="s11">
-                            <div class="weui-cell__hd">
-                                <input type="checkbox" class="weui-check" name="checkbox1" id="s11">
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                            <div class="weui-cell__bd">
-                                <p>心脑血管疾病(服用ARB)</p>
-                            </div>
-                        </label>
-                        <label class="weui-cell weui-cell_active weui-check__label" for="s12">
-                            <div class="weui-cell__hd">
-                                <input type="checkbox" name="checkbox2" class="weui-check" id="s12">
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                            <div class="weui-cell__bd">
-                                <p>心脑血管疾病(未服ARB)</p>
-                            </div>
-                        </label>
-                        <label class="weui-cell weui-cell_active weui-check__label" for="s13">
-                            <div class="weui-cell__hd">
-                                <input type="checkbox" name="checkbox3" class="weui-check" id="s13">
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                            <div class="weui-cell__bd">
-                                <p>呼吸系统病史</p>
-                            </div>
-                        </label>
-                        <label class="weui-cell weui-cell_active weui-check__label" for="s14">
-                            <div class="weui-cell__hd">
-                                <input type="checkbox" name="checkbox4" class="weui-check" id="s14">
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                            <div class="weui-cell__bd">
-                                <p>肿瘤病史</p>
-                            </div>
-                        </label>
-                        <label class="weui-cell weui-cell_active weui-check__label" for="s15">
-                            <div class="weui-cell__hd">
-                                <input type="checkbox" name="checkbox5" class="weui-check" id="s15">
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                            <div class="weui-cell__bd">
-                                <p>糖尿病史</p>
-                            </div>
-                        </label>
-                        <label class="weui-cell weui-cell_active weui-check__label" for="s16">
-                            <div class="weui-cell__hd">
-                                <input type="checkbox" name="checkbox6" class="weui-check" id="s16">
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                            <div class="weui-cell__bd">
-                                <p>服用过激素药物</p>
-                            </div>
-                        </label>
-                        <label class="weui-cell weui-cell_active weui-check__label" for="s17">
-                            <div class="weui-cell__hd">
-                                <input type="checkbox" name="checkbox7" class="weui-check" id="s17">
-                                <i class="weui-icon-checked"></i>
-                            </div>
-                            <div class="weui-cell__bd">
-                                <p>妊娠期</p>
-                            </div>
-                        </label>
+                    <div id="ribao_jbqk">
+                        <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">基本情况</div>
+                        <div class="weui-cells weui-cells_checkbox">
+                            <label class="weui-cell weui-cell_active weui-check__label" for="s11">
+                                <div class="weui-cell__hd">
+                                    <input type="checkbox" class="weui-check" name="checkbox1" id="s11">
+                                    <i class="weui-icon-checked"></i>
+                                </div>
+                                <div class="weui-cell__bd">
+                                    <p>心脑血管疾病(服用ARB)</p>
+                                </div>
+                            </label>
+                            <label class="weui-cell weui-cell_active weui-check__label" for="s12">
+                                <div class="weui-cell__hd">
+                                    <input type="checkbox" name="checkbox2" class="weui-check" id="s12">
+                                    <i class="weui-icon-checked"></i>
+                                </div>
+                                <div class="weui-cell__bd">
+                                    <p>心脑血管疾病(未服ARB)</p>
+                                </div>
+                            </label>
+                            <label class="weui-cell weui-cell_active weui-check__label" for="s13">
+                                <div class="weui-cell__hd">
+                                    <input type="checkbox" name="checkbox3" class="weui-check" id="s13">
+                                    <i class="weui-icon-checked"></i>
+                                </div>
+                                <div class="weui-cell__bd">
+                                    <p>呼吸系统病史</p>
+                                </div>
+                            </label>
+                            <label class="weui-cell weui-cell_active weui-check__label" for="s14">
+                                <div class="weui-cell__hd">
+                                    <input type="checkbox" name="checkbox4" class="weui-check" id="s14">
+                                    <i class="weui-icon-checked"></i>
+                                </div>
+                                <div class="weui-cell__bd">
+                                    <p>肿瘤病史</p>
+                                </div>
+                            </label>
+                            <label class="weui-cell weui-cell_active weui-check__label" for="s15">
+                                <div class="weui-cell__hd">
+                                    <input type="checkbox" name="checkbox5" class="weui-check" id="s15">
+                                    <i class="weui-icon-checked"></i>
+                                </div>
+                                <div class="weui-cell__bd">
+                                    <p>糖尿病史</p>
+                                </div>
+                            </label>
+                            <label class="weui-cell weui-cell_active weui-check__label" for="s16">
+                                <div class="weui-cell__hd">
+                                    <input type="checkbox" name="checkbox6" class="weui-check" id="s16">
+                                    <i class="weui-icon-checked"></i>
+                                </div>
+                                <div class="weui-cell__bd">
+                                    <p>服用过激素药物</p>
+                                </div>
+                            </label>
+                            <label class="weui-cell weui-cell_active weui-check__label" for="s17">
+                                <div class="weui-cell__hd">
+                                    <input type="checkbox" name="checkbox7" class="weui-check" id="s17">
+                                    <i class="weui-icon-checked"></i>
+                                </div>
+                                <div class="weui-cell__bd">
+                                    <p>妊娠期</p>
+                                </div>
+                            </label>
+                        </div>
                     </div>
-                    <#--<textarea id="jibenmiaoshu" class="weui-textarea" placeholder="身体基本状况描述" rows="5"-->
-                              <#--style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>-->
+
+                <#--<textarea id="jibenmiaoshu" class="weui-textarea" placeholder="身体基本状况描述" rows="5"-->
+                <#--style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>-->
                     <input id="suspectedId" type="text" hidden="hidden" value=""/>
                     <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">病情描述</div>
+
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">确诊新冠肺炎</div>
-                        <input id="switchQuezhen" class="weui-input" autofocus="" type="text" placeholder="请选择"
-                               maxlength="20"
-                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">新冠肺炎</div>
+                    <#--<input id="switchQuezhen" class="weui-input" autofocus="" type="text" placeholder="请选择"-->
+                    <#--maxlength="20"-->
+                    <#--style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>-->
+                        <div class="weui-cells_checkbox" style="width: 125%">
+                            <label class="weui-radio weui-cell_active weui-check__label" for="s18" >
+                                <input type="radio" name="radio" value="0" class="weui-check" id="s18" style="width: 10%"/>
+                                <i class="weui-icon-checked"></i>无
+                            </label>
+                            <label class="weui-radio weui-cell_active weui-check__label" for="s19" >
+                                <input type="radio" name="radio" value="1" class="weui-check" id="s19" style="width: 10%"/>
+                                <i class="weui-icon-checked"></i>确诊
+                            </label>
+                            <br/>
+                            <div style="height: 20px"></div>
+                            <label class="weui-radio weui-cell_active weui-check__label" for="s20">
+                                <input type="radio" name="radio" value="2" class="weui-check" id="s20" style="width: 10%">
+                                <i class="weui-icon-checked"></i>疑似
+                            </label>
+                            <#--<div style="height: 10px"></div>-->
+                            <label class="weui-radio weui-cell_active weui-check__label" for="s21" style="width: 25%">
+                                <input type="radio" name="radio" value="3" class="weui-check" id="s21">
+                                <i class="weui-icon-checked"></i>有接触史
+                            </label>
+                            <br/>
+                            <div style="height: 20px"></div>
+                            <label class="weui-radio weui-cell_active weui-check__label" for="s22" style="width: 25%">
+                                <input type="radio" name="radio" value="4" class="weui-check" id="s22">
+                                <i class="weui-icon-checked"></i>解除隔离
+                            </label>
+                        </div>
                     </div>
-                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">单间隔离</div>
-                        <input id="switchDanjiangeli" class="weui-input" autofocus="" type="text" placeholder="请选择"
-                               maxlength="20"
-                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    <div id="ribao_djgl">
+                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                            <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">单间隔离</div>
+                            <input id="switchDanjiangeli" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                                   maxlength="20"
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                        </div>
                     </div>
 
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
@@ -192,15 +233,103 @@
                     </div>
                     <div style="display: flex; justify-content: center;">
                         <div style="width: 70%;color: red; text-align: center;">
+                            <br/>
                             自愿填写病情描述(温度为必填项),提交后会根据每天病情描述变化趋势给出更加科学的健康评估建议
                         </div>
                     </div>
+                    <div id="ribao_trip" class="weui-btn-area"><#--style="display: none"-->
+                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 6vh;">
+                            <div style="height: 5vh; line-height: 5vh; width: 55%;">工作驻地</div>
+                            <input id="js_input_gzzd" class="weui-input" type="text" placeholder="请选择"
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%"
+                                   onchange="selectinput1(this)"/>
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            <input id="js_input_qtdd" placeholder="其它地点" disabled="disabled" type="text"
+                                   style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;"/>
+                        </div>
+                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                            <div style="height: 5vh; line-height: 5vh; width: 55%;">今晚住地</div>
+                            <input id="js_input_jrszd" class="weui-input" type="text" placeholder="请选择"
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%"
+                                   onchange="selectinput2(this)"/>
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            <input id="js_input_jrszq" placeholder="其它地点" disabled="disabled" type="text"
+                                   style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;"/>
+                        </div>
+                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                            <div style="height: 5vh; line-height: 5vh; width: 55%;">是否出行</div>
+                            <input id="js_input_sf" class="weui-input" type="text" placeholder="请选择"
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 145%"
+                                   onchange="selectinput6(this)"/>
+                        </div>
+                        <br/>
+                    <#--<div style="text-align: center;height: 1vh;">出行情况上报</div>-->
+
+                        <div id="none">
+                            <div class="weui-loadmore weui-loadmore_line" style="width: 100%;height: 1vh;">
+                                <span class="weui-loadmore__tips">出行情况上报</span>
+                            </div>
+                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 6vh;">
+                                <div style="height: 5vh; line-height: 5vh; width: 55%;">出发地</div>
+                                <input id="js_input_cfd" class="weui-input" type="text" placeholder="请选择"
+                                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%"
+                                       onchange="selectinput3(this)"/>
+                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                <input id="js_input_cfdq" placeholder="其它地点" disabled="disabled" type="text"
+                                       style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;"/>
+                            </div>
+                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                                <div style="height: 5vh; line-height: 5vh; width: 55%;">目的地</div>
+                                <input id="js_input_mdd" class="weui-input" type="text" placeholder="请选择"
+                                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%"
+                                       onchange="selectinput4(this)"/>
+                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                <input id="js_input_mddq" placeholder="其它地点" disabled="disabled" type="text"
+                                       style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;"/>
+                            </div>
+                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                                <div style="height: 5vh; line-height: 5vh; width: 55%;">出行方式</div>
+                                <input id="js_input_cxfs" class="weui-input" type="text" placeholder="请选择出行方式"
+                                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%"
+                                       onchange="selectinput5(this)"/>
+                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                <input id="js_input_cxfsq" placeholder="车次/航班/车牌" type="text"
+                                       style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;"/>
+
+                            </div>
+                            <div class="weui-cell__ft" style="margin-top: 1vh;">
+                                <button href="javascript:" style="height:5vh; margin-right: 0vh;width: 70px;"
+                                        class="weui-btn weui-btn_mini weui-btn_primary" onclick="insertlingyun()">添加
+                                </button>
+                            </div>
+                            <div class="weui-loadmore tt" style="width: 100%;height: 1vh;margin-top: 1vh;">
+                            </div>
+                            <div>
+                                <table cellspacing="0" cellpadding="0" style="width: 100%">
+                                    <tbody id="tabtr"><#--border="1" cellspacing="0" cellpadding="0"-->
+                                    <tr style="background-color: #f8f8f8;">
+                                    <#-- <td style="text-align: center;">序号</td>
+                                <td style="text-align: center;">出发地</td>
+                                <td style="text-align: center;">目的地</td>
+                                <td style="text-align: center;">出行方式</td>
+                                <td style="text-align: center;">车次/航班/车牌</td>-->
+                                    </tr>
+                                    </tbody>
+                                </table>
+                                <table id="tab5" class="new_tab" align="left" cellpadding="0" cellspacing="0"
+                                       style="width: 100%;">
+                                </table>
+                            </div>
+                        </div>
+
+                    </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh; margin-bottom: 5vh;">
                         <a id="cancel" href="javascript:;" class="weui-btn weui-btn_default" style="width: 30%;">取消</a>
                         <a id="commit" href="javascript:;" onclick="ribaoCommit();" class="weui-btn weui-btn_primary"
                            style="margin-top: 0;width: 30%;">提交</a>
                     </div>
                 </div>
+                </div>
                 </br>
                 </br>
             </div>
@@ -221,6 +350,42 @@
                     <br/><br/>
                 </div>
             </div>
+            <div id="rb_nav3" class="weui-tab__bd-item ">
+                <div class="weui-panel weui-panel_access">
+                <#--                    <div class="weui-panel__hd" style=" font-size: large">${uptown_name!''}小区</div>-->
+                    <div class="weui-panel__hd" style=" font-size: large">员工姓名:${linkman!''}</div>
+                    <div class="weui-panel__hd" style=" font-size: large">所在部门:<span id="unitMsg">${ridgepole!''}${unit!''}</span></div>
+                    <div class="weui-panel__hd" style=" font-size: large">员工编号:<span id="doorplateMsg">${doorplate!''}</span></div>
+                    <input id="unitId" type="text" hidden="hidden" value="${unitId!''}"/>
+                    <input id="uptownId" type="text" hidden="hidden" value="${uptownId!''}"/>
+                    <div class="weui-cell weui-cell_select weui-cell_select-after">
+                        <div class="weui-cell__hd">
+                            <label for="" class="weui-label" id="danweiTitle">更改部门</label>
+                        </div>
+                        <div class="weui-cell__bd">
+                            <select class="weui-select" id="newUnitId">
+                                <option>请选择</option>
+                            </select>
+                        </div>
+                    </div>
+                    <div class="weui-form__opr-area">
+                        <a class="weui-btn weui-btn_primary" href="javascript:;" onclick="changeUnitId();">确定部门更改</a>
+                    </div>
+                    <div>
+                        <div class="weui-cells__title" id="menpaiTitle">更改工号</div>
+                        <div class="weui-cells">
+                            <div class="weui-cell">
+                                <div class="weui-cell__bd">
+                                    <input class="weui-input" type="text" id="newDoorplate" placeholder="请输入工号"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="weui-form__opr-area">
+                        <a class="weui-btn weui-btn_primary" href="javascript:;" onclick="changeDoorplate();">确定工号更改</a>
+                    </div>
+                </div>
+            </div>
         </div>
     </div>
 </div>

Разница между файлами не показана из-за своего большого размера
+ 978 - 60
whepi-ui/templates/home/ribao.js


+ 190 - 0
whepi-ui/templates/lingyun/home.ftl

@@ -0,0 +1,190 @@
+<#assign title="我的家"/>
+<#include "/home/frag.head.ftl" />
+
+<div class="weui-tab">
+    <input id="userId" type="text" hidden="hidden" value=${user_id!}/>
+    <div class="weui-tab__bd">
+        <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
+            <#include "/lingyun/ribao.ftl" /></div>
+        <div id="tab2" class="weui-tab__bd-item">
+            <#include "/home/qiuzhu.ftl" /></div>
+        <div id="tab3" class="weui-tab__bd-item">
+    <#include "/home/buy.ftl" /></div>
+    <#--<div id="tab4" class="weui-tab__bd-item">-->
+    <#--<h1>页面四</h1> </div>-->
+    </div>
+    <div class="weui-tabbar">
+        <a id="jt1" href="#tab1" class="weui-tabbar__item weui-bar__item--on">
+            <div class="weui-tabbar__icon"><img src="/static/images/wx/order.png" alt=""></div>
+            <p class="weui-tabbar__label">健康日报</p>
+        </a>
+        <a id="jt2" href="#tab2" class="weui-tabbar__item" onclick="familyClick()">
+            <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
+            <p class="weui-tabbar__label">家庭求助</p>
+        </a>
+        <a id="jt3" href="#tab3" class="weui-tabbar__item" onclick="buyGroup()">
+            <div class="weui-tabbar__icon"><img src="/static/images/wx/upload.png" alt=""></div>
+            <p class="weui-tabbar__label">团购</p>
+        </a>
+    <#--<a href="#tab4" class="weui-tabbar__item">-->
+    <#--<div class="weui-tabbar__icon"> <img src="./images/icon_nav_cell.png" alt=""> </div>-->
+    <#--<p class="weui-tabbar__label">我</p>-->
+    <#--</a>-->
+    </div>
+</div>
+
+
+</body>
+
+<#include "/home/frag.foot.ftl" />
+<script>
+    <#include "/lingyun/ribao.js" />
+    <#include "/home/qiuzhu.js" />
+    (function ($) {
+
+        $(function () {
+            $('.weui-navbar__item').on('click', function () {
+                $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
+                //内容切换
+                var moduleClass = jQuery(this).attr("module");
+                var ss = ".weui-tab__panel ." + moduleClass + "_weui_tab_bd_item_active";
+                $(ss).removeClass(moduleClass + '_weui_tab_bd_item_active');
+                var data_toggle = jQuery(this).attr("target");
+                $(data_toggle).addClass(moduleClass + "_weui_tab_bd_item_active");
+            });
+        });
+
+
+        ribao_init();
+        qiuzhu_init();
+        family_init();
+        ribao_add();
+        ribao_cancel();
+
+        <#if msReport ??>var msReport = ${msReport}</#if>;
+        $('#ribao_jinrijujian').append(msReport.safetyNum);
+        if (msReport.reportStatus == 1) {
+          canSahngbao = false;
+            document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
+        }
+        ribaoInitialization(msReport.reportId);
+        $("#my-input-ribao").calendar();
+        /*submit_back();*/
+        familyClick();
+
+        $(function () {
+            $("#ground").bind("click", function () {
+                if ($("#Gj").val() == "off") {
+                    $("#Gj").val("on");
+                    console.log("关闭查看所有");
+
+                    qzMy_help('', $("#quetyFamily").val());
+                } else {
+                    $("#Gj").val("off");
+                    console.log("查看已解决的");
+                    qzMy_help(3, $("#quetyFamily").val());
+                }
+            });
+        });
+
+
+        function selectTab() {
+            $("#tab1").removeClass('weui-tab__bd-item--active');
+            $("#jt1").removeClass('weui-bar__item--on');
+            $("#tab3").addClass('weui-tab__bd-item--active');
+            $("#jt3").addClass('weui-bar__item--on');
+            buyGroup();
+        }
+
+        function selectqiuzhu() {
+            $("#tab1").removeClass('weui-tab__bd-item--active');
+            $("#jt1").removeClass('weui-bar__item--on');
+            $("#tab2").addClass('weui-tab__bd-item--active');
+            $("#jt2").addClass('weui-bar__item--on');
+            familyClick();
+        }
+
+        var show = ${show!'"-"'};
+
+        if (show == 'tuangou') {
+            selectTab();
+
+        } else if (show == 'qiuzhu') {
+            selectqiuzhu();
+        }
+    })(jQuery);
+
+
+    //小区求助信息的展示
+    function familyClick() {
+        $('#notitle').empty();//清除节点
+        $.ajax({
+            url: '/home/home/queryQzTaskxq',
+            data: {userId: $('#userId').val()},
+            type: 'GET',
+            async: false,
+            success: function (data) {
+                console.log(data);
+                if (data.data.length > 0) {
+                    hasData = true;
+                    data.data.forEach(function (v) {
+                        familyValue(v);
+                    });
+                } else {
+
+                }
+            },
+            error: function () {
+            }
+        });
+    }
+
+    function familyValue(v) {
+        $('#notitle').append($('<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form" ' +
+                '                               onclick=\'xiaoQuItemClick(' + JSON.stringify(v) + ')\'>\n' +
+                '                        <div class="weui-cell__bd" taskId="1212>\n' +
+                '                            <div class="weui-media-box weui-media-box_text" id="title">\n' +
+                '                                <p class="weui-media-box__desc" >' + v.taskTitle + '</p>\n' +
+                '                            </div>\n' +
+                '                        </div>\n' +
+                '                        <div class="weui-cell__ft">' + conversion(v.taskStatus) + '</div>\n' +
+                '                    </a>\n<br/>'));
+
+    }
+
+    function xiaoQuItemClick(v) {
+        window.location.href = "/quzhu/home/quxiao.html?taskId=" + v.taskId + "&userId=" + $('#userId').val();
+        /*familyClick();*/
+        /*    $.ajax({
+                url: '/home/home/taskQuery',
+                data: {taskId: v.taskId},
+                type: 'GET',
+                success: function (data) {
+                    console.log(data);
+                    if ($('#userId').val() != data.data.userId) {
+                        $.alert('当前求助信息不是你的')
+                        return;
+                    } else {
+                        window.location.href = "/quzhu/home/quxiao.html?taskId=" + v.taskId + "&userId=" + v.userId;
+                        familyClick()
+                    }
+                },
+                error: function () {
+                }
+            });*/
+
+    }
+
+
+    //完成 已解决  为完成的方法
+    function conversion(a) {
+        if (a == 1) {
+            return "<span style='color:red;'>未解决</span>";
+        } else if (a == 2) {
+            return "<span style='color:Black;'>处理中</span>";
+        } else {
+            return "<span style='color:green;'>已完成</span>";
+        }
+    }
+
+</script>

+ 306 - 0
whepi-ui/templates/lingyun/ribao.ftl

@@ -0,0 +1,306 @@
+<div class="page__bd">
+    <div class="weui-tab">
+        <div class="weui-navbar">
+            <a class="weui-navbar__item weui-bar__item_on" target="#rb_nav1" module="ri_bao" onclick="ribao_refrash()">
+                今日报告
+            </a>
+            <a class="weui-navbar__item" target="#rb_nav2" module="ri_bao">
+                健康日历
+            </a>
+        </div>
+        <div class="weui-tab__panel">
+            <div id="rb_nav1" class="weui-tab__bd-item ri_bao_weui_tab_bd_item_active">
+                <div id="notOpenRibao">
+                    <div class="weui-cells weui-cells_form">
+                        <div class="weui-cell weui-cell_vcode" style="height: 7vh">
+                            <div class="weui-cell__hd">
+                                <label class="weui-label">今日居家</label>
+                            </div>
+                            <div class="weui-cell__bd" id="ribao_jinrijujian">
+
+                            </div>
+                            <div class="weui-cell__ft">
+                                <button id="btnAdd" href="javascript:" style="height:5vh; margin-right: 3vh;"
+                                        class="weui-btn weui-btn_mini weui-btn_primary">添加人员
+                                </button>
+                            </div>
+                        </div>
+                    </div>
+                    <div id="rb_family">
+                    <#--<div class="weui-media-box weui-media-box_text">-->
+                    <#--<h4 class="weui-media-box__title">家人1:咳嗽、乏力、未确诊 <a href="javascript:" >删除</a></h4>-->
+                    <#--<p class="weui-media-box__desc">由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。</p>-->
+                    <#--</div>-->
+                    </div>
+                    <div class="weui-cells__tips"> <span style="color: red">
+                        <br/>
+                        注:请如实上报情况,便以相互帮助,小区是我家,团结就是力量!后期会有医生跟踪分析,给予大家医疗建议,请认真填报!
+                    </span></div>
+                    <div class="weui-btn-area">
+                        <a id="btn_shangbao" class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips" style=""
+                           onclick="addReport()">上报</a>
+                    </div>
+                </div>
+                <div id="ribao" class="weui-btn-area" style="display: none">
+                    <div style="text-align: center;">基本信息</div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between;">
+                        <input id="js_input_user_name" class="weui-input" autofocus="" type="text" placeholder="请输入姓名"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 30%; text-align: center;"/>
+                        <input id="js_input_user_sex" class="weui-input" autofocus="" type="text" placeholder="性别"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 25%; text-align: center;"/>
+                        <input id="js_input_user_age" class="weui-input" autofocus="" type="text" placeholder="年龄"
+                               maxlength="3"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 25%; text-align: center;"/>
+                    </div>
+                    <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">基本情况</div>
+                    <div class="weui-cells weui-cells_checkbox">
+                        <label class="weui-cell weui-cell_active weui-check__label" for="s11">
+                            <div class="weui-cell__hd">
+                                <input type="checkbox" class="weui-check" name="checkbox1" id="s11">
+                                <i class="weui-icon-checked"></i>
+                            </div>
+                            <div class="weui-cell__bd">
+                                <p>心脑血管疾病(服用ARB)</p>
+                            </div>
+                        </label>
+                        <label class="weui-cell weui-cell_active weui-check__label" for="s12">
+                            <div class="weui-cell__hd">
+                                <input type="checkbox" name="checkbox2" class="weui-check" id="s12">
+                                <i class="weui-icon-checked"></i>
+                            </div>
+                            <div class="weui-cell__bd">
+                                <p>心脑血管疾病(未服ARB)</p>
+                            </div>
+                        </label>
+                        <label class="weui-cell weui-cell_active weui-check__label" for="s13">
+                            <div class="weui-cell__hd">
+                                <input type="checkbox" name="checkbox3" class="weui-check" id="s13">
+                                <i class="weui-icon-checked"></i>
+                            </div>
+                            <div class="weui-cell__bd">
+                                <p>呼吸系统病史</p>
+                            </div>
+                        </label>
+                        <label class="weui-cell weui-cell_active weui-check__label" for="s14">
+                            <div class="weui-cell__hd">
+                                <input type="checkbox" name="checkbox4" class="weui-check" id="s14">
+                                <i class="weui-icon-checked"></i>
+                            </div>
+                            <div class="weui-cell__bd">
+                                <p>肿瘤病史</p>
+                            </div>
+                        </label>
+                        <label class="weui-cell weui-cell_active weui-check__label" for="s15">
+                            <div class="weui-cell__hd">
+                                <input type="checkbox" name="checkbox5" class="weui-check" id="s15">
+                                <i class="weui-icon-checked"></i>
+                            </div>
+                            <div class="weui-cell__bd">
+                                <p>糖尿病史</p>
+                            </div>
+                        </label>
+                        <label class="weui-cell weui-cell_active weui-check__label" for="s16">
+                            <div class="weui-cell__hd">
+                                <input type="checkbox" name="checkbox6" class="weui-check" id="s16">
+                                <i class="weui-icon-checked"></i>
+                            </div>
+                            <div class="weui-cell__bd">
+                                <p>服用过激素药物</p>
+                            </div>
+                        </label>
+                        <label class="weui-cell weui-cell_active weui-check__label" for="s17">
+                            <div class="weui-cell__hd">
+                                <input type="checkbox" name="checkbox7" class="weui-check" id="s17">
+                                <i class="weui-icon-checked"></i>
+                            </div>
+                            <div class="weui-cell__bd">
+                                <p>妊娠期</p>
+                            </div>
+                        </label>
+                    </div>
+                <#--<textarea id="jibenmiaoshu" class="weui-textarea" placeholder="身体基本状况描述" rows="5"-->
+                <#--style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>-->
+                    <input id="suspectedId" type="text" hidden="hidden" value=""/>
+                    <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">病情描述</div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">确诊新冠肺炎</div>
+                        <input id="switchQuezhen" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    </div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">单间隔离</div>
+                        <input id="switchDanjiangeli" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    </div>
+
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">体温</div>
+                        <input id="js_input_user_tiwen" class="weui-input" autofocus="" type="number" placeholder="请输入"
+                               maxlength="4"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    </div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">咳嗽现象</div>
+                        <input id="js_input_user_kesou" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    </div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh;line-height: 5vh; width: 55%;">肌肉酸痛</div>
+                        <input id="js_input_user_jirou" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    </div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh;line-height: 5vh; width: 55%;">呼吸困难</div>
+                        <input id="js_input_user_huxi" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    </div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">乏力现象</div>
+                        <input id="js_input_user_fali" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    </div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">腹泻现象</div>
+                        <input id="js_input_user_fuxie" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    </div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh; line-height: 5vh;width: 55%;">其他描述</div>
+                        <textarea id="shuruqita" class="weui-textarea" placeholder="输入内容(300字内)" rows="5"
+                                  style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>
+                    </div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh; line-height: 5vh;width: 55%;">
+                            <button id="ribao_score" style="height:5vh;"
+                                    class="weui-btn weui-btn_mini weui-btn_primary">健康评估
+                            </button>
+                        </div>
+                        <input id="js_input_score_rezult" class="weui-input" autofocus="" readonly="readonly"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                        <input id="js_input_score_rezult_value" type="text" hidden="hidden"/>
+                        <input id="js_input_temperature_score" type="text" hidden="hidden"/>
+                        <input id="js_input_score_histroy" type="text" hidden="hidden"/>
+                        <input id="js_input_score" type="text" hidden="hidden"/>
+                    </div>
+                    <div style="display: flex; justify-content: center;">
+                        <div style="width: 70%;color: red; text-align: center;">
+                            <br/>
+                            自愿填写病情描述(温度为必填项),提交后会根据每天病情描述变化趋势给出更加科学的健康评估建议
+                        </div>
+                    </div>
+                    <div id="ribao" class="weui-btn-area"><#--style="display: none"-->
+                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 6vh;">
+                            <div style="height: 5vh; line-height: 5vh; width: 55%;">工作驻地</div>
+                            <input id="js_input_gzzd" class="weui-input" type="text" placeholder="请选择"
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput1(this)"/>
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            <input id="js_input_qtdd" placeholder="其它地点" disabled="disabled" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
+                        </div>
+                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                            <div style="height: 5vh; line-height: 5vh; width: 55%;">今晚住地</div>
+                            <input id="js_input_jrszd" class="weui-input" type="text" placeholder="请选择"
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput2(this)"/>
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            <input id="js_input_jrszq" placeholder="其它地点" disabled="disabled" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
+                        </div>
+                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                            <div style="height: 5vh; line-height: 5vh; width: 55%;">是否出行</div>
+                            <input id="js_input_sf" class="weui-input" type="text" placeholder="请选择"
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 145%" onchange="selectinput6(this)"/>
+                        </div>
+                        <br/>
+                    <#--<div style="text-align: center;height: 1vh;">出行情况上报</div>-->
+
+                        <div id="none">
+                            <div class="weui-loadmore weui-loadmore_line" style="width: 100%;height: 1vh;">
+                                <span class="weui-loadmore__tips">出行情况上报</span>
+                            </div>
+                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 6vh;">
+                                <div style="height: 5vh; line-height: 5vh; width: 55%;">出发地</div>
+                                <input id="js_input_cfd" class="weui-input" type="text" placeholder="请选择"
+                                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput3(this)"/>
+                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                <input id="js_input_cfdq" placeholder="其它地点" disabled="disabled" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
+                            </div>
+                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                                <div style="height: 5vh; line-height: 5vh; width: 55%;">目的地</div>
+                                <input id="js_input_mdd" class="weui-input" type="text" placeholder="请选择"
+                                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput4(this)"/>
+                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                <input id="js_input_mddq" placeholder="其它地点" disabled="disabled" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
+                            </div>
+                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                                <div style="height: 5vh; line-height: 5vh; width: 55%;">出行方式</div>
+                                <input id="js_input_cxfs" class="weui-input" type="text" placeholder="请选择出行方式"
+                                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput5(this)"/>
+                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                <input id="js_input_cxfsq" placeholder="车次/航班/车牌" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
+
+                            </div>
+                            <div class="weui-cell__ft" style="margin-top: 1vh;">
+                                <button href="javascript:" style="height:5vh; margin-right: 0vh;width: 70px;"
+                                        class="weui-btn weui-btn_mini weui-btn_primary" onclick="insertlingyun()">添加
+                                </button>
+                            </div>
+                            <div class="weui-loadmore tt" style="width: 100%;height: 1vh;margin-top: 1vh;">
+                            </div>
+                            <div>
+                                <table cellspacing="0" cellpadding="0" style="width: 100%">
+                                    <tbody id="tabtr"><#--border="1" cellspacing="0" cellpadding="0"-->
+                                    <tr style="background-color: #f8f8f8;">
+                                    <#-- <td style="text-align: center;">序号</td>
+                                <td style="text-align: center;">出发地</td>
+                                <td style="text-align: center;">目的地</td>
+                                <td style="text-align: center;">出行方式</td>
+                                <td style="text-align: center;">车次/航班/车牌</td>-->
+                                    </tr>
+                                    </tbody>
+                                </table>
+                                <table id="tab5" class="new_tab" align="left" cellpadding="0" cellspacing="0"
+                                       style="width: 100%;">
+                                </table>
+                            </div>
+                        </div>
+
+                    </div>
+                    
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh; margin-bottom: 5vh;">
+                        <a id="cancel" href="javascript:;" class="weui-btn weui-btn_default" style="width: 30%;">取消</a>
+                        <a id="commit" href="javascript:;" onclick="ribaoCommit();" class="weui-btn weui-btn_primary"
+                           style="margin-top: 0;width: 30%;">提交</a>
+                    </div>
+                </div>
+                </br>
+                </br>
+            </div>
+            <div id="rb_nav2" class="weui-tab__bd-item ">
+                <div id="my-input-ribao"></div>
+                <div class="weui-panel weui-panel_access">
+                    <div class="weui-panel__hd" style="color: #0bb20c; font-size: large">我的家人</div>
+                    <div class="weui-panel__bd" id="ribao_famliy">
+                    <#--<div class="weui-media-box weui-media-box_text">-->
+                    <#--<h4 class="weui-media-box__title">家人1:咳嗽、乏力、未确诊</h4>-->
+                    <#--<p class="weui-media-box__desc">由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。</p>-->
+                    <#--</div>-->
+                    <#--<div class="weui-media-box weui-media-box_text">-->
+                    <#--<h4 class="weui-media-box__title">家人1:咳嗽、乏力、确诊</h4>-->
+                    <#--<p class="weui-media-box__desc">由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。</p>-->
+                    <#--</div>-->
+                    </div>
+                    <br/><br/>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+

Разница между файлами не показана из-за своего большого размера
+ 1484 - 0
whepi-ui/templates/lingyun/ribao.js


+ 36 - 0
whepi-ui/templates/user/returnWork.ftl

@@ -0,0 +1,36 @@
+<#assign title="${tittle!''}复工许可证"/>
+<#include "/home/frag.head.ftl" />
+
+<div class="weui-tab">
+    <div class="weui-tab__bd">
+        <div class="weui-tab__bd-item weui-tab__bd-item--active">
+            <div class="page__bd">
+                <header class="user-header">
+                    <br/>
+                    <br/>
+                    <#if (uptownId??) && (uptownId == 1238790987234 || uptownId == 5 )>
+                        <img class="user-title" style="height: 60px;width: 70px;" id="qr" src="/ly.png"/>
+                    </#if>
+                    <p class="user-title-long">${doorplate!''}</p>
+                    <br/>
+                    <p class="user-title-long">${name!''}</p>
+                    <br/>
+                    <h1 class="user-title-big ${collor!''}">${into!""}</h1>
+                    <br/>
+                    <br/>
+                    <p class="user-title-long">${errorMsg!""}</p>
+                    <br/>
+                    <br/>
+                </header>
+                <br/>
+                <br/>
+                <p class="user-title-long">${now!''}</p>
+            </div>
+        </div>
+    </div>
+</div>
+</div>
+</body>
+<#include "/home/frag.foot.ftl" />
+<script>
+</script>

+ 5 - 4
whepi-ui/templates/user/scan.ftl

@@ -1,4 +1,4 @@
-<#assign title="电子出入许可证"/>
+<#assign title="${tittle!''}电子出入许可证"/>
 <#include "/home/frag.head.ftl" />
 
 <div class="weui-tab">
@@ -8,9 +8,10 @@
                 <header class="user-header">
                     <br/>
                     <br/>
-                    <br/>
-                    <br/>
-                    <br/>
+                    <#if (tittle?? )&&(tittle == "凌云") ><img class="user-title" style="height: 60px;width: 70px;" id="qr" src="/ly.png"/></#if>
+                    <#if (tittle?? )&&(tittle != "凌云") ><br/>
+                        <br/>
+                        <br/></#if>
                     <p class="user-title-long">${doorplate!''}
                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${name!''}</p>
                     <br/>

+ 1 - 1
whepi-ui/templates/yeweihui/home.ftl

@@ -32,7 +32,7 @@
             <p class="weui-tabbar__label">求助</p>
         </a>
         <a id="tab3a" href="#tab3" class="weui-tabbar__item">
-            <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
+            <div class="weui-tabbar__icon"><img src="/static/images/wx/upload.png" alt=""></div>
             <p class="weui-tabbar__label">团购</p>
         </a>
     <#--<a href="#tab3" class="weui-tabbar__item">-->

+ 10 - 6
whepi-ui/templates/yeweihui/tgPublish.ftl

@@ -156,9 +156,11 @@
         //     return;
         // }
 
-        if (parseInt(maxnum) < parseInt(minnum)) {
-            $.alert("最大订量应大于或等于最低起送量");
-            return;
+        if (maxnum != "0" && minnum != "0") {
+            if (parseInt(maxnum) < parseInt(minnum)) {
+                $.alert("最大订量应大于或等于最低起送量");
+                return;
+            }
         }
 
         // if (parseInt(itemNum) <= 0) {
@@ -166,9 +168,11 @@
         //     return;
         // }
 
-        if (parseInt(maxnum) < parseInt(itemNum)) {
-            $.alert("最大订量应大于或等于个人限额");
-            return;
+        if (maxnum != "0" && itemNum != "0") {
+            if (parseInt(maxnum) < parseInt(itemNum)) {
+                $.alert("最大订量应大于或等于个人限额");
+                return;
+            }
         }
 
         let curTimestamp =(new Date()).valueOf();

+ 1 - 1
whepi-ui/templates/yeweihui/tuangouMemberList.ftl

@@ -84,7 +84,7 @@
     $('#tg_member_xiaoqu').html(members[0].uptownName);
     $('#tg_member_num').append(totalNum);
     $('#tg_member_count').append(members.length);
-    $('#tg_member_totoalPrice').append(totalPrice);
+    $('#tg_member_totoalPrice').append(totalPrice.toFixed(2));
 
     $("#tg_member_export").attr('href', '/yeweihui/tuangou/member/list/export?jmId=' + tgItem.jmId);
     $('#tg_member_export_url_detail').val(window.location.hostname + '/yeweihui/tuangou/member/list/export?jmId=' + tgItem.jmId);

+ 1 - 1
whepi-web/src/main/java/com/bofeng/controller/EpiAdminController.java

@@ -79,7 +79,7 @@ public class EpiAdminController {
         System.out.println("==============执行定时任务完毕================");
     }
 
-    @Scheduled(cron = "0 0 0 * * ?") //每天0点执行一次
+//    @Scheduled(cron = "0 0 0 * * ?") //每天0点执行一次
     public void scheduledReportByFixedDelay() {
         System.out.println("==============执行定时任务开始================");
         msReportService.getNowByYesterdayDate();

+ 255 - 0
whepi-web/src/main/java/com/bofeng/controller/EpiLYExportController.java

@@ -0,0 +1,255 @@
+package com.bofeng.controller;
+
+import com.bofeng.dao.MsReportMapper;
+import com.bofeng.dao.UserOpenMapper;
+import com.bofeng.entity.*;
+import com.bofeng.service.MsReportService;
+import com.bofeng.service.MsTripService;
+import com.bofeng.word.WordUtils;
+import com.google.common.collect.Lists;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+public class EpiLYExportController {
+
+    @Autowired
+    private UserOpenMapper userOpenMapper;
+    @Autowired
+    private MsReportMapper msReportMapper;
+    @Autowired
+    private MsTripService msTripService;
+    @Autowired
+    private MsReportService msReportService;
+
+    @ApiOperation("导出单个健康及旅居申报表")
+    @GetMapping("/whepi/export/lyReport")
+    public @ResponseBody
+    void exportSellPlan(HttpServletRequest request, HttpServletResponse response) {
+        //Long userId = Long.parseLong(request.getParameter("1234"));
+        Long userId = 1234L;
+        String userName = "", workPlace = "", telPhone = "", isLeave = "", trip = "", blackTime = "", veicle = "", otherSymptom = "", isTrue = "";
+        //用户姓名,电话
+        UserOpen userOpen = userOpenMapper.selectUserBaseByUserId(userId);
+        if (userOpen != null) {
+            userName = userOpen.getLinkman();
+            telPhone = userOpen.getPhone();
+        }
+        //工作驻地
+        MsTrip msTrip = msReportMapper.selectWorkByUserId(userId);
+        if (msTrip != null)
+            workPlace = msReportService.getLocalOther(msTrip.getWorkLocal(), msTrip.getWorkLocalOther());
+        //是否离开过驻地
+        MsTrip msTrip1 = msReportMapper.selectIsTripByUserId(userId);
+        if (msTrip1 == null)
+            isLeave = "否";
+        else
+            isLeave = "是";
+        //15日居住地
+        List<MsTrip> listMsTrip = msReportMapper.select15TripByUserId(userId);
+        if (listMsTrip != null && listMsTrip.size() > 0) {
+            for (MsTrip msTrip2 : listMsTrip) {
+                trip += msReportService.getLocalOther(msTrip2.getTodayLocal(), msTrip2.getTodayLocalOther()) + ",";
+            }
+            trip = trip.substring(0, trip.length() - 1);
+        }
+        //返回时间
+        MsReport msReport = msReportMapper.selectBackTripByUserId(userId);
+        if (msReport != null) {
+            blackTime = msReport.getReportDate().toString();
+            //返回交通工具
+            List<MsTripDet> listMsTripDet = msReportMapper.selectBackTripByReportrId(msReport.getReportId());
+            if (listMsTripDet != null && listMsTripDet.size() > 0) {
+                for (MsTripDet msTripDet : listMsTripDet) {
+                    veicle += msReportService.getTripType(msTripDet.getTripType()) + ",";
+                }
+                veicle = veicle.substring(0, veicle.length() - 1);
+            }
+        }
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("userName", userName);
+        map.put("workPlace", workPlace);
+        map.put("telPhone", telPhone);
+        map.put("isLeave", isLeave);
+        map.put("trip", trip);
+        map.put("backTime", blackTime);
+        map.put("vehicle", veicle);
+
+        Map<String, Object> rt = new HashMap<String, Object>();
+        map.put("rt", rt);
+        for (int i = 1; i <= 5; i++) {
+            rt.put("d"+i, msReportService.getTimeByDate(i-5));
+            rt.put("t"+i,  msReportService.getTemperature(userId, i-5));
+        }
+
+        //是否有其他症状
+        List<MsSuspected> listSuspected1 = msReportMapper.selectOtherSymptomByReportrId(userId);
+        if (listSuspected1 != null && listSuspected1.size() > 0)
+            otherSymptom = "是";
+        else
+            otherSymptom = "否";
+        map.put("otherSymptom", otherSymptom);
+        Integer sureNum = msReportMapper.selectisSuspectedNum(userId);
+        if (sureNum == 0)
+            isTrue = "否";
+        else
+            isTrue = "是";
+        //是否确诊
+        map.put("isTrue", isTrue);
+
+        WordUtils.exportWord("word/健康及旅居申报表_20200221.docx", "temp", "健康及旅居申报表.docx", map, request, response);
+    }
+
+    @ApiOperation("导出多个健康及旅居申报表")
+    @GetMapping("/whepi/export/lyReports")
+    public @ResponseBody
+    void exportSellPlan2(HttpServletRequest request, HttpServletResponse response) {
+
+        List<Map<String, Object>> list = Lists.newArrayList();
+        for (int i = 0; i < 5; i++) {
+            Map<String, Object> map = new HashMap<String, Object>();
+            map.put("userName", "张山");
+            map.put("workPlace", "武汉");
+            map.put("telPhone", "13245452345");
+            map.put("isLeave", "是");
+            map.put("trip", "北京、上海、武汉");
+            map.put("backTime", "2020-03-10");
+            map.put("vehicle", "火箭");
+
+            Map<String, Object> rt = new HashMap<String, Object>();
+            map.put("rt", rt);
+            rt.put("d1", "02-20");
+            rt.put("d2", "02-21");
+            rt.put("d3", "02-22");
+            rt.put("d4", "02-23");
+            rt.put("d5", "02-24");
+            rt.put("t1", "-");
+            rt.put("t2", "37.0");
+            rt.put("t3", "36.6");
+            rt.put("t4", "36.6");
+            rt.put("t5", "36.8");
+
+            map.put("otherSymptom", "ee");
+            map.put("isTrue", "否");
+            list.add(map);
+        }
+        WordUtils.exportWord("word/健康及旅居申报表_20200221.docx", "temp", "健康及旅居申报表.docx", list, request, response);
+    }
+
+    @ApiOperation("导出单个隔离人员解除隔离审批表")
+    @GetMapping("/whepi/export/lyApprove")
+    public @ResponseBody
+    void lyApprove(HttpServletRequest request, HttpServletResponse response) {
+
+        //Long userId = Long.parseLong(request.getParameter("1234"));
+        Long userId = 1234L;
+        String userName = "", org = "", gander = "", bAddr = "", backDate = "",otherSymptom="";
+        //用户姓名,部门
+        UserOpen userOpen = userOpenMapper.selectUserBaseByUserId(userId);
+        if (userOpen != null) {
+            userName = userOpen.getLinkman();
+            org = userOpen.getRidgepole() + userOpen.getUnit();
+        }
+        //性别
+        MsSuspected msSuspected = msReportMapper.selectGrenderUserId(userId);
+        if (msSuspected != null) {
+            if (msSuspected.getGrender() == 1)
+                gander = "男";
+            if (msSuspected.getGrender() == 2)
+                gander = "女";
+        }
+
+        //返回时间
+        MsReport msReport = msReportMapper.selectBackTripByUserId(userId);
+        if (msReport != null) {
+            backDate = msReport.getReportDate().toString();
+            bAddr = msReportService.getLocalOther(msReport.getTodayLocal(), msReport.getTodayLocalOther());
+        }
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("userName", userName);
+        map.put("gander", gander);
+        map.put("org", org);
+        map.put("bAddr", bAddr);
+        map.put("backDate", backDate);
+
+        //最近15天体温
+        Map<String, Object> rt = new HashMap<String, Object>();
+        map.put("rt", rt);
+        for (int i = 1; i <= 15; i++) {
+            rt.put("d"+i, msReportService.getTimeByDate(i-15));
+            rt.put("t"+i,  msReportService.getTemperature(userId, i-15));
+        }
+
+        List<MsSuspected> listSuspected1 = msReportMapper.selectOtherSymptomByReportrId(userId);
+        if (listSuspected1 != null && listSuspected1.size() > 0)
+            otherSymptom = "是";
+        else
+            otherSymptom = "否";
+        map.put("otherSymptom", otherSymptom);
+
+        WordUtils.exportWord("word/隔离人员解除隔离审批表_20200221.docx", "temp", "隔离人员解除隔离审批表.docx", map, request, response);
+    }
+
+    @ApiOperation("导出多个隔离人员解除隔离审批表")
+    @GetMapping("/whepi/export/lyApproves")
+    public @ResponseBody
+    void lyApproves(HttpServletRequest request, HttpServletResponse response) {
+
+        List<Map<String, Object>> list = Lists.newArrayList();
+        for (int i = 0; i < 5; i++) {
+            Map<String, Object> map = new HashMap<String, Object>();
+            map.put("userName", "张山");
+            map.put("gander", "男");
+            map.put("org", "研发部");
+            map.put("bAddr", "北京");
+            map.put("backDate", "2020-03-10");
+
+            Map<String, Object> rt = new HashMap<String, Object>();
+            map.put("rt", rt);
+            rt.put("d1", "02-20");
+            rt.put("d2", "02-21");
+            rt.put("d3", "02-22");
+            rt.put("d4", "02-23");
+            rt.put("d5", "02-24");
+            rt.put("d6", "02-25");
+            rt.put("d7", "02-26");
+            rt.put("d8", "02-27");
+            rt.put("d9", "02-28");
+            rt.put("d10", "02-29");
+            rt.put("d11", "03-01");
+            rt.put("d12", "03-02");
+            rt.put("d13", "03-03");
+            rt.put("d14", "03-04");
+            rt.put("d15", "03-05");
+            rt.put("t1", "-");
+            rt.put("t2", "37.0");
+            rt.put("t3", "36.6");
+            rt.put("t4", "36.6");
+            rt.put("t5", "36.8");
+            rt.put("t6", "-");
+            rt.put("t7", "37.0");
+            rt.put("t8", "36.6");
+            rt.put("t9", "36.6");
+            rt.put("t10", "36.8");
+            rt.put("t11", "-");
+            rt.put("t12", "37.0");
+            rt.put("t13", "36.6");
+            rt.put("t14", "36.6");
+            rt.put("t15", "36.8");
+
+            map.put("otherSymptom", "无");
+            list.add(map);
+        }
+
+        WordUtils.exportWord("word/隔离人员解除隔离审批表_20200221.docx", "temp", "隔离人员解除隔离审批表.docx", list, request, response);
+    }
+}

+ 4 - 0
whepi-web/src/main/java/com/bofeng/dao/JmTuangouDao.java

@@ -5,8 +5,10 @@ import com.bofeng.entity.JmTuangou;
 import com.yvan.PageDb;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
+import org.joda.time.DateTime;
 import org.springframework.stereotype.Repository;
 
+import java.util.Date;
 import java.util.List;
 
 @Mapper
@@ -43,4 +45,6 @@ public interface JmTuangouDao extends BaseMapper<JmTuangou> {
 
   JmTuangou getSelectOneRoleId(@Param("jmId") Long jmId);
 
+  int updateRemarkByJmIdzbxd(@Param("jmId") Long jmId, @Param("remark") String remark, @Param("tgEndTime")Date tgEndTime, @Param("tgDeliverTime")Date tgDeliverTime);
+
 }

+ 120 - 0
whepi-web/src/main/java/com/bofeng/dao/MsReportMapper.java

@@ -2,6 +2,9 @@ package com.bofeng.dao;
 
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.bofeng.entity.MsReport;
+import com.bofeng.entity.MsSuspected;
+import com.bofeng.entity.MsTrip;
+import com.bofeng.entity.MsTripDet;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -47,8 +50,79 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
     @Select("select count(suspected_id) from ms_suspected where report_id=#{reportId} and suspected_status=1")
     Integer selectisNoSuspectedNum(@Param("reportId") Long reportId);
 
+    //异常
+    @Select("select count(suspected_id) from ms_suspected where report_id=#{reportId} and  medical in (1,2,3)")
+    Integer selectAbnormalNum(@Param("reportId") Long reportId);
+
+    /**
+     * 导出word
+     */
+    //工作驻地
+    @Select("select a.*\n" +
+            "from ms_trip a\n" +
+            "LEFT JOIN ms_suspected b on a.trip_id=b.suspected_id\n" +
+            "LEFT JOIN ms_report c on b.report_id=c.report_id\n" +
+            "where c.report_status=1 and c.user_create=#{userId} ORDER BY c.report_date desc LIMIT 1")
+    MsTrip selectWorkByUserId(@Param("userId") Long userId);
+
+    //是否离开
+    @Select("select a.*\n" +
+            "from ms_trip a\n" +
+            "LEFT JOIN ms_suspected b on a.trip_id=b.suspected_id\n" +
+            "LEFT JOIN ms_report c on b.report_id=c.report_id\n" +
+            "where c.report_status=1 and c.user_create=#{userId} and (a.work_local!=a.today_local or a.work_local_other!=a.today_local_other) ORDER BY c.report_date desc LIMIT 1")
+    MsTrip selectIsTripByUserId(@Param("userId") Long userId);
+
+    //十五日居住地
+    @Select("select * from (\n" +
+            "select a.today_local,a.today_local_other\n" +
+            "from ms_trip a\n" +
+            "LEFT JOIN ms_suspected b on a.trip_id=b.suspected_id\n" +
+            "LEFT JOIN ms_report c on b.report_id=c.report_id\n" +
+            "where c.report_status=1  and c.user_create=#{userId}  ORDER BY c.report_date desc  LIMIT 15 ) tt GROUP BY tt.today_local,tt.today_local_other")
+    List<MsTrip> select15TripByUserId(@Param("userId") Long userId);
+
+    //返回驻地时间
+    @Select("select a.report_date,a.report_id,c.today_local,c.today_local_other \n" +
+            "from ms_report a \n" +
+            "LEFT JOIN ms_suspected b on a.report_id=b.report_id\n" +
+            "left join ms_trip c on b.suspected_id=c.trip_id\n" +
+            "where (c.work_local =c.today_local or c.work_local_other =c.today_local_other) and c.is_trip=1 and a.report_status=1 and a.user_create=#{userId}\n" +
+            "ORDER BY a.report_date desc LIMIT 1")
+    MsReport selectBackTripByUserId(@Param("userId") Long userId);
+
+    //返回驻地交通方式
+    @Select("select a.trip_type\n" +
+            "from ms_trip_det a\n" +
+            "left JOIN ms_suspected b on a.trip_id=b.suspected_id where b.report_id=#{reportId} GROUP BY a.trip_type\n")
+    List<MsTripDet> selectBackTripByReportrId(@Param("reportId") Long reportId);
+
+    //近5日的
+    @Select("select b.temperature\n" +
+            "from ms_report a\n" +
+            "LEFT JOIN ms_suspected b on a.report_id=b.report_id\n" +
+            "where a.report_status=1 and a.user_create=#{userId} and a.report_date=#{reportDate}\n")
+    MsSuspected select5ByReportrId(@Param("userId") Long userId, @Param("reportDate") String reportDate);
+
+    //是否有其他症状
+    @Select("select b.*\n" +
+            "from ms_report a\n" +
+            "LEFT JOIN ms_suspected b on a.report_id=b.report_id\n" +
+            "where a.report_status=1  and a.user_create=#{userId} and (b.cough>0 or b.muscle>0 or b.dyspnea>0 or b.fatigue>0 or b.diarrhea>0)\n")
+    List<MsSuspected> selectOtherSymptomByReportrId(@Param("userId") Long userId);
+
+    //是否确诊
+    @Select("select count(a.suspected_id) from ms_suspected a inner join ms_report b on a.report_id=b.report_id where a.medical in (1,2,3) and b.report_status=1 and b.user_create=#{userId}")
+    Integer selectAbnormalNumUserId(@Param("userId") Long userId);
+
+    //性别
+    @Select("select a.* from ms_suspected a inner join ms_report b on a.report_id=b.report_id where b.report_status=1 and b.user_create=#{userId}")
+    MsSuspected selectGrenderUserId(@Param("userId") Long userId);
+
+
     /**
      * 最近3天是否都有上报
+     *
      * @param userId
      * @return
      */
@@ -61,10 +135,56 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
 
     /**
      * 最近提交的日报, msStatus 健康状态:1正常,2异常
+     *
      * @param userId
      * @return
      */
     @Select("select * from ms_report where user_create=#{userId} and report_status=1 order by report_date desc limit 1")
     MsReport selectMsReportToday(@Param("userId") Long userId);
 
+    @Select("select * from ms_report where user_create=#{userId} and ms_status = 2 and report_status=1 order by report_date desc limit 3")
+    List<MsReport> selectMsReportThereError(@Param("userId") Long userId);
+
+    /**
+     * 最近15天确诊,疑似,密切接触者
+     * @param userId
+     * @return
+     */
+    @Select("select * from ms_report where report_status=1 and report_date > date_sub(curdate(),interval 15 day) and ms_status=2 and user_create=#{userId}")
+    List<MsReport> queryMsReportBySure(@Param("userId") Long userId);
+
+    /**
+     * 最近是否填过确诊,疑似,密切接触者
+     * @param userId
+     * @return
+     */
+    @Select("select a.* from ms_report a LEFT JOIN ms_suspected b on a.report_id=b.report_id where a.report_status=1 and b.medical in (1,2,3) and a.user_create=#{userId}")
+    List<MsReport> queryMsReportIsXG(@Param("userId") Long userId);
+
+    /**
+     * 最近状态 0无,1确诊,2疑似,3密切接触者,4解除隔离
+     * @param userId
+     * @return
+     */
+    @Select("select b.medical from ms_report a LEFT JOIN ms_suspected b on a.report_id=b.report_id where a.report_status=1 and a.user_create=#{userId} ORDER BY report_date desc LIMIT 1")
+    Integer queryLateStatus(@Param("userId") Long userId);
+
+    /**
+     * 最近去工作驻地的时间
+     * @param userId
+     * @return
+     */
+    @Select("select DATE_FORMAT(a.report_date,'%Y-%m-%d') from ms_report a LEFT JOIN ms_suspected b on a.report_id=b.report_id left join ms_trip c on b.suspected_id=c.trip_id where " +
+            "(c.work_local =c.today_local or c.work_local_other =c.today_local_other) and c.is_trip=1 and a.report_status=1 and a.user_create=#{userId} ORDER BY a.report_date desc LIMIT 1")
+    String returnWork(@Param("userId") Long userId);
+
+    /**
+     * 最近去工作驻地的时间
+     * @param userId
+     * @return
+     */
+    @Select("select a.* from ms_report a LEFT JOIN ms_suspected b on a.report_id=b.report_id left join ms_trip c on b.suspected_id=c.trip_id where (c.work_local " +
+            "!=c.today_local or c.work_local_other !=c.today_local_other) and c.is_trip=1 and a.report_status=1 and a.user_create=#{userId} and a.report_date>#{reportDate} ORDER BY a.report_date desc LIMIT 15")
+    List<MsReport> returnWorkTime(@Param("reportDate") String reportDate, @Param("userId") Long userId);
+
 }

+ 27 - 0
whepi-web/src/main/java/com/bofeng/dao/MsSuspectedMapper.java

@@ -4,6 +4,7 @@ package com.bofeng.dao;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsSuspected;
+import com.bofeng.entity.MsTripDet;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -28,4 +29,30 @@ public interface MsSuspectedMapper extends BaseMapper<MsSuspected> {
     //判断家人是否有历史评分
     @Select("select score from ms_suspected where user_create=#{userCreate} and user_name=#{userName} and suspected_id !=#{suspectedId}  order by time_update desc limit 1")
     Integer selectUserNameScore(@Param("userCreate") Long userCreate, @Param("userName") String userName, @Param("suspectedId") Long suspectedId);
+
+
+    //判断家人是否有历史评分
+    @Select("select a.* \n" +
+            "from ms_suspected a \n" +
+            "INNER JOIN ms_report b on a.report_id=b.report_id \n" +
+            "where b.user_create=#{userCreate} and b.report_date=(select report_date from ms_report where user_create=#{userCreate} and report_date<curdate() ORDER BY report_date desc LIMIT 1)\n" +
+            "and a.user_name not in (select a.user_name from ms_suspected a INNER JOIN ms_report b on a.report_id=b.report_id where b.user_create=#{userCreate} and b.report_date=curdate())\n" +
+            " ORDER by a.time_create  LIMIT 1")
+    MsSuspected selectAddSuspected(@Param("userCreate") Long userCreate);
+
+    //获取最近的一个人一个家人
+    @Select("select a.*,c.* \n" +
+            "from ms_suspected a \n" +
+            "INNER JOIN ms_report b on a.report_id=b.report_id \n" +
+            "left JOIN ms_trip c on a.suspected_id=c.trip_id \n" +
+            "where b.user_create=#{userCreate} and b.report_date=(select report_date from ms_report where user_create=#{userCreate} and report_date<curdate() ORDER BY report_date desc LIMIT 1)\n" +
+            "ORDER by a.time_create ")
+    List<MsSuspected> selectNextSuspected(@Param("userCreate") Long userCreate);
+
+    //选择家人
+    @Select("select a.*,b.* from ms_suspected a LEFT JOIN ms_trip b on a.suspected_id=b.trip_id where a.suspected_id =#{suspectedId}")
+    MsSuspected selectBySuspectedId(@Param("suspectedId") Long suspectedId);
+
+    @Select("select * from ms_trip_det  where trip_id =#{suspectedId}")
+    List<MsTripDet> selectTripSuspected(@Param("suspectedId") Long suspectedId);
 }

+ 18 - 0
whepi-web/src/main/java/com/bofeng/dao/MsTripDetMapper.java

@@ -0,0 +1,18 @@
+package com.bofeng.dao;
+
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.bofeng.entity.MsTripDet;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Author: xielianghe
+ * @Date: 2020/2/22 14:56
+ */
+@Mapper
+@Repository
+public interface MsTripDetMapper extends BaseMapper<MsTripDet> {
+    int deleteByTripId(@Param("tripId") Long tripId);
+}

+ 16 - 0
whepi-web/src/main/java/com/bofeng/dao/MsTripMapper.java

@@ -0,0 +1,16 @@
+package com.bofeng.dao;
+
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.bofeng.entity.MsTrip;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Author: xielianghe
+ * @Date: 2020/2/22 12:43
+ */
+@Mapper
+@Repository
+public interface MsTripMapper extends BaseMapper<MsTrip> {
+}

+ 2 - 1
whepi-web/src/main/java/com/bofeng/dao/OutUserMapper.java

@@ -15,11 +15,12 @@ import java.util.Map;
 @Repository
 public interface OutUserMapper extends BaseMapper<OutUser> {
 
+
     @Select("SELECT * FROM out_user WHERE name = #{name} and phone = #{phone} and start_date <= curdate() and end_date >= curdate()")
     OutUser getOutUserByPhone(@Param("name") String name, @Param("phone") Long phone);
 
     @Select("SELECT * FROM out_user WHERE phone = #{phone} and start_date <= curdate() and end_date >= curdate()")
-    OutUser getOutUserByPhone(@Param("phone") Long phone);
+    OutUser queryOutUserByPhone(@Param("phone") Long phone);
 
     List<OutUser> getAllOutUser(PageDb pageDb, Map<String, Object> queryParam);
 

+ 4 - 2
whepi-web/src/main/java/com/bofeng/dao/RbMapper.java

@@ -97,12 +97,13 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
             "select suu.ridgepole,suu.unit,suh.doorplate,suho.linkman,suho.phone,msr.safety_num as safetyNum, msr.report_status as reportStatus,\n" +
                     "msr.sure_num as sureNum,msr.suspected_num as suspectedNum,msr.normal_num as normalNum, \n" +
                     "msr.single_num as singleNum,mss.user_name as userName,mss.grender, mss.age,mss.family_status as familyStatus,\n" +
-                    "mss.medical,mss.temperature,mss.cough,mss.muscle ,mss.dyspnea,mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult \n" +
+                    "mss.medical,mss.temperature,mss.cough,mss.muscle ,mss.dyspnea,mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult,tr.trip_id,tr.is_trip,tr.today_local,tr.today_local_other,tr.work_local,tr.work_local_other \n" +
                     "from sys_uptown_house suh\n" +
                     "inner join sys_uptown_home suho on suho.house_id=suh.house_id\n" +
                     "INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}\n" +
                     "left join ms_report msr on msr.house_id = suh.house_id and msr.report_date = #{date}\n" +
                     "left join ms_suspected mss on mss.report_id=msr.report_id\n" +
+                    "left join ms_trip tr on mss.suspected_id=trip_id\n" +
                     "order by suu.unit_id asc "
     )
     List<ExcelRiBaoLY> selectExcelRiBaoLY(@Param("uptownId") Long uptownId, @Param("date") String date);
@@ -111,12 +112,13 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
             "select suu.ridgepole,suu.unit,suh.doorplate,suho.linkman,suho.phone,msr.safety_num as safetyNum, msr.report_status as reportStatus,\n" +
                     "msr.sure_num as sureNum,msr.suspected_num as suspectedNum,msr.normal_num as normalNum, \n" +
                     "msr.single_num as singleNum,mss.user_name as userName,mss.grender, mss.age,mss.family_status as familyStatus,\n" +
-                    "mss.medical,mss.temperature,mss.cough,mss.muscle ,mss.dyspnea,mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult \n" +
+                    "mss.medical,mss.temperature,mss.cough,mss.muscle ,mss.dyspnea,mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult ,tr.trip_id,tr.is_trip,tr.today_local,tr.today_local_other,tr.work_local,tr.work_local_other\n" +
                     "from sys_uptown_house suh\n" +
                     "inner join sys_uptown_home suho on suho.house_id=suh.house_id\n" +
                     "INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}\n" +
                     "left join ms_report msr on msr.house_id = suh.house_id and msr.report_date = #{date}\n" +
                     "left join ms_suspected mss on mss.report_id=msr.report_id\n" +
+                    "left join ms_trip tr on mss.suspected_id=trip_id\n" +
                     "order by suu.unit_id asc "
     )
     List<ExcelRiBaoPrivate> selectExcelRiBaoPrivate(@Param("uptownId") Long uptownId, @Param("date") String date);

+ 1 - 0
whepi-web/src/main/java/com/bofeng/dao/SweepCodeMapper.java

@@ -12,5 +12,6 @@ import java.util.Map;
 @Repository
 public interface SweepCodeMapper {
     List<SysUptownHouse> selectCode(PageDb pageDb, Map<String, Object> queryParam);
+    List<SysUptownHouse> selectLingyunUser(PageDb pageDb, Map<String, Object> queryParam);
     List<SysUptownHouse> export(Map<String, Object> queryParam);
 }

+ 3 - 0
whepi-web/src/main/java/com/bofeng/dao/UptownHouseMapper.java

@@ -18,4 +18,7 @@ public interface UptownHouseMapper extends BaseMapper<UptownHouse> {
 
     @Select("select * from sys_uptown_house where status = 1 and unit_id = #{unitId} and doorplate = #{doorplate}")
     List<UptownHouse> getUptownHouseBy(@Param("unitId") Long unitId, @Param("doorplate") String doorplate);
+
+    @Select("select uh.* from sys_uptown_house uh INNER JOIN sys_user_role ur on ur.property_id = uh.house_id where ur.user_id = #{userId} and ur.role_id = 1")
+    UptownHouse getUptownHouseByUser(@Param("userId") Long userId);
 }

+ 4 - 1
whepi-web/src/main/java/com/bofeng/dao/UptownUnitMapper.java

@@ -35,8 +35,11 @@ public interface UptownUnitMapper extends BaseMapper<UptownUnit> {
 
     List<UptownUnit> queryYiChangList(@Param("uptownId") Long uptownId, @Param("reportDate") String reportDate);
 
-    @Select("SELECT u.uptown_id,u.uptown_name as uptownName,uu.ridgepole,uu.unit,uh.doorplate FROM sys_user_role ur INNER JOIN sys_uptown_house uh " +
+    @Select("SELECT u.uptown_id,u.uptown_name as uptownName,uu.ridgepole,uu.unit,uu.unit_id,uh.doorplate FROM sys_user_role ur INNER JOIN sys_uptown_house uh " +
             "ON uh.house_id = ur.property_id INNER JOIN sys_uptown_unit uu ON uh.unit_id = uu.unit_id INNER JOIN " +
             "sys_uptown u ON u.uptown_id = uu.uptown_id WHERE ur.user_id = #{userId} AND ur.role_id = 1")
     UptownUnit getUptownUnitByUser(@Param("userId") Long userId);
+
+    @Select("select * from sys_uptown_unit where status = 1 and uptown_id = #{uptownId}")
+    List<UptownUnit> getUptownUnitLY(@Param("uptownId") Long uptownId);
 }

+ 2 - 0
whepi-web/src/main/java/com/bofeng/dao/UserOpenMapper.java

@@ -31,4 +31,6 @@ public interface UserOpenMapper extends BaseMapper<UserOpen> {
     List<UserOpen> getOpenUser(@Param("start") Long start, @Param("count") Long count);
 
     List<UserOpen> getUsersByUptownId(@Param("uptownId") Long uptownId);
+
+    UserOpen selectUserBaseByUserId(@Param("userId") Long userId);
 }

+ 62 - 3
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoLY.java

@@ -34,6 +34,12 @@ public class ExcelRiBaoLY {
     private int normalNum = 0;
     private String statusDesp = "";
     private String others = "";
+    private Long tripId = 0L;
+    private int workLocal = 0;
+    private String workLocalOther = "";
+    private int todayLocal = 0;
+    private String todayLocalOther = "";
+    private int isTrip = 0;
 
 
     @ExcelProperty(value = "单位", index = 0)
@@ -163,9 +169,15 @@ public class ExcelRiBaoLY {
             return "未填报";
         }
         if (medical == 0) {
-            medicalStr = "否";
-        } else {
-            medicalStr = "是";
+            medicalStr = "无";
+        } else if (medical == 1) {
+            medicalStr = "确诊";
+        } else if (medical == 2) {
+            medicalStr = "疑似";
+        } else if (medical == 3) {
+            medicalStr = "有接触史";
+        } else if (medical == 4) {
+            medicalStr = "解除隔离";
         }
         return medicalStr;
     }
@@ -279,4 +291,51 @@ public class ExcelRiBaoLY {
         }
         return bingqingDesc;
     }
+
+    @ExcelProperty(value = "工作驻地", index = 15)
+    private String workLoalDesc = "";
+
+    public String getWorkLoalDesc() {
+        if (workLocal == 1) {
+            workLoalDesc = "武汉";
+        } else if (workLocal == 2) {
+            workLoalDesc = "宜昌";
+        } else if (workLocal == 3) {
+            workLoalDesc = "当阳";
+        }else if (workLocal == 4) {
+            workLoalDesc = workLocalOther;
+        }
+        return workLoalDesc;
+    }
+    @ExcelProperty(value = "今晚住地", index = 16)
+    private String todayLoalDesc = "";
+
+    public String getTodayLoalDesc() {
+        if (todayLocal == 1) {
+            todayLoalDesc = "武汉";
+        } else if (todayLocal == 2) {
+            todayLoalDesc = "宜昌";
+        } else if (todayLocal == 3) {
+            todayLoalDesc = "当阳";
+        } else if (todayLocal == 4) {
+            todayLoalDesc = todayLocalOther;
+        }
+        return workLoalDesc;
+    }
+
+    @ExcelProperty(value = "是否出行", index = 17)
+    private String isTripDesc = "";
+
+    public String getIsTripDesc() {
+        if (isTrip == 1) {
+            isTripDesc = "是";
+        } else if (isTrip == 0) {
+            isTripDesc = "否";
+        }
+        return isTripDesc;
+    }
+
+    @ExcelProperty(value = "出行详细", index = 18)
+    private String tripDetDesc = "";
+
 }

+ 64 - 6
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoPrivate.java

@@ -34,6 +34,12 @@ public class ExcelRiBaoPrivate {
     private int normalNum = 0;
     private String statusDesp = "";
     private String others = "";
+    private Long tripId = 0L;
+    private int workLocal = 0;
+    private String workLocalOther = "";
+    private int todayLocal = 0;
+    private String todayLocalOther = "";
+    private int isTrip = 0;
 
 
     @ExcelProperty(value = "楼栋", index = 0)
@@ -166,7 +172,7 @@ public class ExcelRiBaoPrivate {
         return temperatureStr;
     }
 
-    @ExcelProperty(value = "确诊", index = 14)
+    @ExcelProperty(value = "新冠病毒", index = 14)
     private String medicalStr;
 
     public String getMedicalStr() {
@@ -174,9 +180,15 @@ public class ExcelRiBaoPrivate {
             return "未填报";
         }
         if (medical == 0) {
-            medicalStr = "否";
-        } else {
-            medicalStr = "是";
+            medicalStr = "无";
+        } else if (medical == 1) {
+            medicalStr = "确诊";
+        } else if (medical == 2) {
+            medicalStr = "疑似";
+        } else if (medical == 3) {
+            medicalStr = "有接触史";
+        } else if (medical == 4) {
+            medicalStr = "解除隔离";
         }
         return medicalStr;
     }
@@ -206,8 +218,7 @@ public class ExcelRiBaoPrivate {
 
         if (Conv.NI(familyStatus.split(",")[0]) == 1) {
             baseDesc += "心血管疾病(服用ARB),";
-        }
-        else if (Conv.NI(familyStatus.split(",")[1]) == 1) {
+        } else if (Conv.NI(familyStatus.split(",")[1]) == 1) {
             baseDesc += "心血管疾病(未服用ARB),";
         }
         if (Conv.NI(familyStatus.split(",")[2]) == 1) {
@@ -318,4 +329,51 @@ public class ExcelRiBaoPrivate {
         return scoreRezultStr;
     }
 
+    @ExcelProperty(value = "工作驻地", index = 19)
+    private String workLoalDesc = "";
+
+    public String getWorkLoalDesc() {
+        if (workLocal == 1) {
+            workLoalDesc = "武汉";
+        } else if (workLocal == 2) {
+            workLoalDesc = "宜昌";
+        } else if (workLocal == 3) {
+            workLoalDesc = "当阳";
+        } else if (workLocal == 4) {
+            workLoalDesc = workLocalOther;
+        }
+        return workLoalDesc;
+    }
+
+    @ExcelProperty(value = "今晚住地", index = 20)
+    private String todayLoalDesc = "";
+
+    public String getTodayLoalDesc() {
+        if (todayLocal == 1) {
+            todayLoalDesc = "武汉";
+        } else if (todayLocal == 2) {
+            todayLoalDesc = "宜昌";
+        } else if (todayLocal == 3) {
+            todayLoalDesc = "当阳";
+        } else if (todayLocal == 4) {
+            todayLoalDesc = todayLocalOther;
+        }
+        return workLoalDesc;
+    }
+
+    @ExcelProperty(value = "是否出行", index = 21)
+    private String isTripDesc = "";
+
+    public String getIsTripDesc() {
+        if (isTrip == 1) {
+            isTripDesc = "是";
+        } else if (isTrip == 0) {
+            isTripDesc = "否";
+        }
+        return isTripDesc;
+    }
+
+    @ExcelProperty(value = "出行详细", index = 22)
+    private String tripDetDesc = "";
+
 }

+ 4 - 0
whepi-web/src/main/java/com/bofeng/entity/MsReport.java

@@ -72,4 +72,8 @@ public class MsReport {
 
     @TableField(exist = false)
     private String msgReport = "";
+    @TableField(exist = false)
+    private Integer todayLocal = 0;
+    @TableField(exist = false)
+    private String todayLocalOther = "";
 }

+ 19 - 0
whepi-web/src/main/java/com/bofeng/entity/MsSuspected.java

@@ -166,4 +166,23 @@ public class MsSuspected {
 
     @TableField(exist = false)
     private String uptownName;
+
+    //出行
+    @TableField(exist = false)
+    private Integer workLocal;
+
+    @TableField(exist = false)
+    private String workLocalOther = "";
+
+    @TableField(exist = false)
+    private Integer todayLocal;
+
+    @TableField(exist = false)
+    private String todayLocalOther = "";
+
+    @TableField(exist = false)
+    private Integer isTrip ;
+
+    @TableField(exist = false)
+    private String tripDet ;
 }

+ 36 - 0
whepi-web/src/main/java/com/bofeng/entity/MsTrip.java

@@ -0,0 +1,36 @@
+package com.bofeng.entity;
+
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Author: xielianghe
+ * @Date: 2020/2/21 22:00
+ */
+@Getter
+@Setter
+@TableName("ms_trip")
+public class MsTrip {
+
+    @TableId("trip_id")
+    private Long tripId;
+
+    @TableField("work_local")
+    private Integer workLocal;
+
+    @TableField("work_local_other")
+    private String workLocalOther;
+
+    @TableField("today_local")
+    private Integer todayLocal;
+
+    @TableField("today_local_other")
+    private String todayLocalOther;
+
+    @TableField("is_trip")
+    private Integer isTrip;
+}

+ 61 - 0
whepi-web/src/main/java/com/bofeng/entity/MsTripDet.java

@@ -0,0 +1,61 @@
+package com.bofeng.entity;
+
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+import org.joda.time.DateTime;
+
+import java.util.Date;
+
+/**
+ * @Author: xielianghe
+ * @Date: 2020/2/21 22:00
+ */
+@Getter
+@Setter
+@TableName("ms_trip_det")
+public class MsTripDet {
+
+    @TableId("trip_det_id")
+    private Long tripDetId;
+
+    @TableField("trip_id")
+    private Long tripId;
+
+    @TableField("sort")
+    private Integer sort;
+
+    @TableField("start_local")
+    private Integer startLocal;
+
+    @TableField("start_local_other")
+    private String startLocalOther;
+
+    @TableField("end_local")
+    private Integer endLocal;
+
+    @TableField("end_local_other")
+    private String endLocalOther;
+
+    @TableField("trip_type")
+    private Integer tripType;
+
+    @TableField("trip_type_desp")
+    private String tripTypeDesp;
+
+    @TableField("user_create")
+    private Long userCreate;
+
+    @TableField("time_create")
+    private DateTime timeCreate;
+
+    @TableField("user_update")
+    private Long userUpdate;
+
+    @TableField("time_update")
+    private DateTime timeUpdate;
+}

+ 6 - 0
whepi-web/src/main/java/com/bofeng/entity/SysUptownHouse.java

@@ -97,6 +97,12 @@ public class SysUptownHouse implements Serializable {
     @TableField(exist = false)
     private String jcStatus;
 
+    @TableField(exist = false)
+    private String dept;
+
+    @TableField(exist = false)
+    private Long userId;
+
 
 
 }

+ 10 - 0
whepi-web/src/main/java/com/bofeng/entity/UserOpen.java

@@ -54,4 +54,14 @@ public class UserOpen {
 
     @TableField("head_img_url")
     private String headImgUrl;
+
+    //导出word
+    @TableField(exist = false)
+    private String linkman = "";
+    @TableField(exist = false)
+    private String phone = "";
+    @TableField(exist = false)
+    private String ridgepole = "";
+    @TableField(exist = false)
+    private String unit = "";
 }

+ 39 - 57
whepi-web/src/main/java/com/bofeng/service/BuyService.java

@@ -27,44 +27,29 @@ public class BuyService {
   @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
   public int buyGroup(Buy buy) {
     Buy buy1 = buyMapper.selectBuyOne(buy.getUserId(), buy.getJmId());
-    JmTuangou roleType = jmTuangouDao.getSelectOneRoleId(buy.getJmId());
-    if (buy1 != null) {
-      JmTuangou jmTuangou = jmTuangouDao.selectJmTuangouByJmId(buy1.getJmId());
-      Buy buy2 = buyMapper.selectById(buy1.getBuyId());
-      if (roleType.getRoleType() != 1) {
-        if (jmTuangou.getTgMaxNum().intValue() >= jmTuangou.getCurrentNum().intValue() - buy2.getBuyCount().intValue() + buy.getBuyCount().intValue()) {
-          //个人限额(指挥部的限额 和 管理员的限额)
-          if (roleType.getTgItemNum().intValue() != 0 && roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
-            return 4;
-          }
-          buy.setBuyId(buy1.getBuyId());
-          return buyMapper.updateById(buy);
-        } else {
-          return 3;//不允许更改团购数量
-        }
-      } else {
-        //指挥部的更改
-        //个人限额(指挥部的限额 和 管理员的限额)
-        if (roleType.getTgItemNum().intValue() != 0 && roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
-          return 4;
-        }
-        buy.setBuyId(buy1.getBuyId());
-        return buyMapper.updateById(buy);
-      }
-    }
-    //1 是指挥部
-    if (roleType.getRoleType() != 1) {
-      //第一次购买团购数量大于最大上限数量不允许
-      JmTuangou jmTuangou = jmTuangouDao.selectJmTuangouByJmId(buy.getJmId());
-      if (jmTuangou.getTgMaxNum().intValue() < jmTuangou.getCurrentNum().intValue() + buy.getBuyCount().intValue()) {
+    JmTuangou jmTuangou = jmTuangouDao.selectJmTuangouByJmId(buy.getJmId());//团购主表
+    if (buy1 != null) {//判断是否是第一次添加
+      //JmTuangou jmTuangou = jmTuangouDao.selectJmTuangouByJmId(buy.getJmId());
+
+      //最大上限有的话就遵循
+      if (jmTuangou.getTgMaxNum().intValue() != 0 && jmTuangou.getTgMaxNum().intValue() < jmTuangou.getCurrentNum().intValue() + buy.getBuyCount().intValue()) {
         return 3;
       }
+      //单人限额有的话的遵循
+      if (jmTuangou.getTgItemNum().intValue() != 0 && jmTuangou.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
+        return 4;
+      }
+      buy.setBuyId(buy1.getBuyId());
+      return buyMapper.updateById(buy);
     }
-    //个人限额(指挥部的限额 和 管理员的限额)
-    if (roleType.getTgItemNum().intValue() != 0 && roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
+    //最大上限有的话就遵循
+    if (jmTuangou.getTgMaxNum() != 0 && jmTuangou.getTgMaxNum().intValue() < jmTuangou.getCurrentNum().intValue() + buy.getBuyCount().intValue()) {
+      return 3;
+    }
+    //单人限额有的话的遵循
+    if (jmTuangou.getTgItemNum().intValue() != 0 && jmTuangou.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
       return 4;
     }
-
     buy.setBuyId(IdWorker.getId());
     buy.setUserCreate(buy.getUserId());
     buy.setTimeCreate(new DateTime());
@@ -114,38 +99,35 @@ public class BuyService {
   //截止日期状态的更改
   @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
   public int updateStatus() {
+    //团购的在团状态
     List<JmTuangou> jmTuangous = jmTuangouDao.selectAll();
     if (jmTuangous != null && jmTuangous.size() > 0) {
       for (JmTuangou list : jmTuangous) {
-        //判断是指挥部还是管理员
-        if (list.getRoleType() == 1) {
-          if (list.getTgEndTime().getTime() < new DateTime().getMillis()) {
-            jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
-          }
-        } else {
-          // 团购数量  最小起订量
+        //到了截止日期
+        if (list.getTgEndTime().getTime() < new DateTime().getMillis()) {
+          //已经到了截止日期  判断有没有人购买
           Buy buy = buyMapper.selectCountNum(list.getJmId());
-          //已经到截止时间
-          if (list.getTgEndTime().getTime() < new DateTime().getMillis()) {
-
-            if (buy != null) { //最小起订量
-              if (list.getTgMinNum().longValue() > buy.getCount().longValue()) {
-                jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
+          if (buy.getCount().intValue() > 0) {
+            //判断是否有最小起订量 只有达到最小量的并且是到截止时间的
+            if (list.getTgMinNum().intValue() != 0) {
+              if (buy.getCount().intValue() >= list.getTgMinNum().intValue()) {
+                if (buy.getCount().intValue() == 0 && list.getTgMinNum().intValue() == 0) {
+                  jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
+                } else if (buy.getCount().intValue() != 0) {
+                  jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
+                }
               } else {
-                jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
+                jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
               }
             } else {
-              jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
+              jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
             }
-          } /*else {
-            //团购数量已经过了最大起订量的 就直接发货
-            if (buy != null) {
-              if (list.getTgMaxNum().intValue() == buy.getCount().intValue()) {
-                jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
-              }
-            }
-          }*/
-        }
+          } else {
+            //已经到截止日期但是没人购买就取消
+            jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
+          }
+
+        }//已经到截止日期
       }
     }
     return 1;

+ 15 - 5
whepi-web/src/main/java/com/bofeng/service/JmTuangouService.java

@@ -192,13 +192,23 @@ public class JmTuangouService {
   }
 
   @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
-  public Integer updateRemarkByJmId(Long jmId, Long status, String remark) {
-    if (status == 0) {
-      return jmTuangouDao.updateRemarkByJmId(jmId, remark);
+  public Integer updateRemarkByJmId(Long jmId, Long status, String remark, String endTime, String deliverTime) {
+    if (status == 0) { // 增补修订
+      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+      Date tgEndTime = new Date();
+      Date tgDeliverTime = new Date();
+      try {
+        tgEndTime = sdf.parse(endTime);
+        tgDeliverTime = sdf.parse(deliverTime);
+      } catch (ParseException e) {
+        e.printStackTrace();
+      }
+      return jmTuangouDao.updateRemarkByJmIdzbxd(jmId, remark, tgEndTime, tgDeliverTime);
     }
-    if (remark.equals("")) {
+    if (remark.equals("")) {  // 完成
       return jmTuangouDao.updateStatusByJmId(jmId, status);
     }
+    // 取消
     return jmTuangouDao.updateStatusRemarkByJmId(jmId, status, remark);
   }
 
@@ -226,6 +236,6 @@ public class JmTuangouService {
 
   @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
   public int updateRemarkByJmIdzbxd(JmTuangou jmTuangou) {
-    return jmTuangouDao.updateRemarkByJmId(jmTuangou.getJmId(), jmTuangou.getRemark());
+    return jmTuangouDao.updateRemarkByJmIdzbxd(jmTuangou.getJmId(), jmTuangou.getRemark(),jmTuangou.getTgEndTime(),jmTuangou.getTgDeliverTime());
   }
 }

+ 220 - 9
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -4,9 +4,10 @@ package com.bofeng.service;
 import com.baomidou.mybatisplus.toolkit.IdWorker;
 import com.bofeng.dao.MsReportMapper;
 import com.bofeng.dao.MsSuspectedMapper;
-import com.bofeng.entity.MsReport;
-import com.bofeng.entity.MsSuspected;
-import com.bofeng.entity.UserOpen;
+import com.bofeng.dao.MsTripDetMapper;
+import com.bofeng.dao.MsTripMapper;
+import com.bofeng.entity.*;
+import org.apache.commons.lang3.tuple.Triple;
 import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -34,10 +35,32 @@ public class MsReportService {
     @Autowired
     private MsReportService msReportService;
     @Autowired
-    private MsSuspectedService msSuspectedService;
+    private MsTripDetMapper msTripDetMapper;
+    @Autowired
+    private MsTripMapper msTripMapper;
 
     public List<MsSuspected> getByReportId(Long reportId) {
-        return msSuspectedMapper.selectByReportId(reportId);
+        List<MsSuspected> listSuspected = null;
+        listSuspected = msSuspectedMapper.selectByReportId(reportId);
+        if (listSuspected != null && listSuspected.size() > 0) {
+            String tripDet;
+            for (MsSuspected msSuspected : listSuspected) {
+                tripDet = "";
+                //出行详细
+                List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(msSuspected.getSuspectedId());
+                if (listDet != null && listDet.size() > 0) {
+                    for (MsTripDet msTripDet : listDet) {
+                        tripDet += "出发地:" + getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
+                        tripDet += "目的地:" + getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
+                        tripDet += "出行方式:" + getTripType(msTripDet.getTripType()) + ",";
+                        tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
+                    }
+                    msSuspected.setTripDet(tripDet.substring(0, tripDet.length() - 1));
+                }
+            }
+
+        }
+        return listSuspected;
     }
 
     public MsReport getByReport(Long reportId) {
@@ -46,19 +69,62 @@ public class MsReportService {
 
     //获取前一天数据
     public List<MsSuspected> getByReportReportDate(String reportDate, Long userCreate) {
-
         List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
         List<MsSuspected> listSuspected = null;
         if (listReport != null && listReport.size() > 0) {
             listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
+            if (listSuspected != null && listSuspected.size() > 0) {
+                String tripDet;
+                for (MsSuspected msSuspected : listSuspected) {
+                    tripDet = "";
+                    //出行详细
+                    List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(msSuspected.getSuspectedId());
+                    if (listDet != null && listDet.size() > 0) {
+                        for (MsTripDet msTripDet : listDet) {
+                            tripDet += "出发地:" + getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
+                            tripDet += "目的地:" + getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
+                            tripDet += "出行方式:" + getTripType(msTripDet.getTripType()) + ",";
+                            tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
+                        }
+                        msSuspected.setTripDet(tripDet.substring(0, tripDet.length() - 1));
+                    }
+                }
+
+            }
         }
         return listSuspected;
     }
 
+    public String getLocalOther(Integer local, String localOther) {
+        String localDet = "";
+        if (local == 1) {
+            localDet = "武汉";
+        } else if (local == 2)
+            localDet = "宜昌";
+        else if (local == 3)
+            localDet = "当阳";
+        else if (local == 4)
+            localDet = localOther;
+        return localDet;
+    }
+
+    public String getTripType(Integer tripType) {
+        String tripTypeDet = "";
+        if (tripType == 1) {
+            tripTypeDet = "长途汽车";
+        } else if (tripType == 2)
+            tripTypeDet = "火车";
+        else if (tripType == 3)
+            tripTypeDet = "飞机";
+        else if (tripType == 4)
+            tripTypeDet = "自驾";
+        return tripTypeDet;
+    }
+
     //获取今天数据
     public MsReport getReportByDateNow(Long userCreate) {
         //根据昨天的获取今天的
-        // msReportService.getNowByYesterday(userCreate);
+        //msReportService.getNowByYesterday(userCreate);
         //msReportService.getNowByYesterdayDate();
         //msReportService.addReport250();
         Date t = new Date();
@@ -66,7 +132,16 @@ public class MsReportService {
         String reportDate = df.format(t);
         List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
         MsReport msReport = new MsReport();
-        if (listReport != null && listReport.size() > 0) {
+        //今天不存在
+        if (listReport == null || listReport.size() == 0) {
+            //最近一天数据复制到今天
+            msReportService.getNowByNextDat(userCreate);
+            List<MsReport> listReport1 = msReportMapper.selectByReportDate(reportDate, userCreate);
+            //今天不存在
+            if (listReport1 != null && listReport1.size() > 0)
+                msReport = msReportMapper.selectById(Long.parseLong(listReport1.get(0).getReportId().toString()));
+        } else {
+
             msReport = msReportMapper.selectById(Long.parseLong(listReport.get(0).getReportId().toString()));
         }
         return msReport;
@@ -292,10 +367,146 @@ public class MsReportService {
             msReport1.setUserUpdate(count);
             msReport1.setTimeUpdate(DateTime.now());
             count += msReportMapper.insert(msReport1);
-            if (count> 250) {
+            if (count > 250) {
                 break;
             }
         }
     }
 
+
+    //通过最近一天数据更新今天数据
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public void getNowByNextDat(Long userCreate) {
+
+        SimpleDateFormat sj = new SimpleDateFormat("yyyy-MM-dd");
+        Date d = new Date();
+
+        //判断今天是否有数据
+        String DateNow = sj.format(d);
+        List<MsReport> listReport = msReportMapper.selectByReportDate(DateNow, userCreate);
+        if (listReport != null && listReport.size() > 0)
+            return;
+
+        //判断最近一天是否有数据
+        List<MsSuspected> listSuspected = msSuspectedMapper.selectNextSuspected(userCreate);
+        //有数据
+        if (listSuspected != null && listSuspected.size() > 0) {
+            //添加到今天日报
+            MsReport msReport = msReportMapper.selectById(Long.parseLong(listSuspected.get(0).getReportId().toString()));
+            Long reportId = 0L;
+            if (msReport != null) {
+                MsReport msReport1 = new MsReport();
+                msReport1.setReportId(IdWorker.getId());
+                msReport1.setHouseId(msReport.getHouseId());
+                msReport1.setSafetyNum(msReport.getSafetyNum());
+                msReport1.setSureNum(msReport.getSureNum());
+                msReport1.setSuspectedNum(msReport.getSuspectedNum());
+                msReport1.setNormalNum(msReport.getNormalNum());
+                msReport1.setSingleNum(msReport.getSingleNum());
+                msReport1.setRemarks(msReport.getRemarks());
+                msReport1.setReportDate(DateTime.now().toDate());
+                msReport1.setReportStatus(0);//未上报
+                msReport1.setMsStatus(msReport.getMsStatus());
+                msReport1.setUserCreate(userCreate);
+                msReport1.setTimeCreate(DateTime.now());
+                msReport1.setUserUpdate(userCreate);
+                msReport1.setTimeUpdate(DateTime.now());
+                msReportMapper.insert(msReport1);
+                reportId = msReport1.getReportId();
+            }
+            //添加今日家人
+            for (MsSuspected msSuspected : listSuspected) {
+                MsSuspected msSuspected1 = new MsSuspected();
+                msSuspected1.setSuspectedId(IdWorker.getId());
+                msSuspected1.setReportId(reportId);
+                msSuspected1.setUserName(msSuspected.getUserName());
+                msSuspected1.setGrender(msSuspected.getGrender());
+                msSuspected1.setAge(msSuspected.getAge());
+                msSuspected1.setFamilyStatus(msSuspected.getFamilyStatus());
+                msSuspected1.setStatusDesp(msSuspected.getStatusDesp());
+                msSuspected1.setMedical(msSuspected.getMedical());
+                msSuspected1.setTemperature(new BigDecimal(0));
+                msSuspected1.setCough(msSuspected.getCough());
+                msSuspected1.setMuscle(msSuspected.getMuscle());
+                msSuspected1.setDiarrhea(msSuspected.getDiarrhea());
+                msSuspected1.setFatigue(msSuspected.getFatigue());
+                msSuspected1.setDiarrhea(msSuspected.getDiarrhea());
+                msSuspected1.setSingleRoom(msSuspected.getSingleRoom());
+                msSuspected1.setOthers(msSuspected.getOthers());
+                // msSuspected1.setScoreRezult(msSuspected.getScoreRezult());
+                // msSuspected1.setScore(msSuspected.getScore());
+                // msSuspected1.setScoreHistroy(msSuspected.getScoreHistroy());
+                // msSuspected1.setTemperatureScore(msSuspected.getTemperatureScore());
+                msSuspected1.setSuspectedStatus(0);
+                msSuspected1.setUserCreate(userCreate);
+                msSuspected1.setTimeCreate(DateTime.now());
+                msSuspected1.setUserUpdate(userCreate);
+                msSuspected1.setTimeUpdate(DateTime.now());
+                msSuspectedMapper.insert(msSuspected1);
+
+                //添加行程
+                MsTrip msTrip = new MsTrip();
+                msTrip.setTripId(msSuspected1.getSuspectedId());
+                msTrip.setIsTrip(msSuspected.getIsTrip());
+                msTrip.setTodayLocal(msSuspected.getTodayLocal());
+                msTrip.setTodayLocalOther(msSuspected.getTodayLocalOther());
+                msTrip.setWorkLocal(msSuspected.getWorkLocal());
+                msTrip.setWorkLocalOther(msSuspected.getWorkLocalOther());
+                msTripMapper.insert(msTrip);
+
+                //添加出行详细
+                List<MsTripDet> listTripDet = msSuspectedMapper.selectTripSuspected(msSuspected.getSuspectedId());
+                if (listTripDet != null && listTripDet.size() > 0) {
+                    for (MsTripDet msTripDet : listTripDet) {
+                        MsTripDet msTripDet1 = new MsTripDet();
+                        msTripDet1.setTripDetId(IdWorker.getId());
+                        msTripDet1.setTripId(msSuspected1.getSuspectedId());
+                        msTripDet1.setSort(msTripDet.getSort());
+                        msTripDet1.setStartLocal(msTripDet.getStartLocal());
+                        msTripDet1.setStartLocalOther(msTripDet.getStartLocalOther());
+                        msTripDet1.setEndLocal(msTripDet.getEndLocal());
+                        msTripDet1.setEndLocalOther(msTripDet.getEndLocalOther());
+                        msTripDet1.setTripType(msTripDet.getTripType());
+                        msTripDet1.setTripTypeDesp(msTripDet.getTripTypeDesp());
+                        msTripDet1.setTimeCreate(DateTime.now());
+                        msTripDet1.setUserCreate(userCreate);
+                        msTripDet1.setTimeUpdate(DateTime.now());
+                        msTripDet1.setUserUpdate(userCreate);
+                        msTripDetMapper.insert(msTripDet1);
+                    }
+                }
+
+            }
+        }
+    }
+
+
+    //获取时间
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public String getTimeByDate(Integer numdate) {
+        String reportDate = "";
+        SimpleDateFormat sj = new SimpleDateFormat("yyyy-MM-dd");
+        Date d = new Date();
+        if (numdate == 0) {
+            reportDate = sj.format(d);
+        } else {
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(d);
+            calendar.add(Calendar.DATE, numdate);
+            reportDate = sj.format(calendar.getTime());
+        }
+        return reportDate;
+    }
+
+    //获取温度
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public String getTemperature(Long userId, Integer numdate) {
+        String temperature = "-";
+        MsSuspected msSuspected = msReportMapper.select5ByReportrId(userId, getTimeByDate(numdate));
+        if (msSuspected != null)
+            temperature = msSuspected.getTemperature().toString();
+        return temperature;
+    }
+
+
 }

+ 68 - 13
whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java

@@ -4,8 +4,11 @@ package com.bofeng.service;
 import com.baomidou.mybatisplus.toolkit.IdWorker;
 import com.bofeng.dao.MsReportMapper;
 import com.bofeng.dao.MsSuspectedMapper;
+import com.bofeng.dao.MsTripMapper;
 import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsSuspected;
+import com.bofeng.entity.MsTrip;
+import com.bofeng.entity.MsTripDet;
 import com.yvan.platform.Conv;
 import io.swagger.models.auth.In;
 import org.joda.time.DateTime;
@@ -32,11 +35,51 @@ public class MsSuspectedService {
     private MsSuspectedMapper msSuspectedMapper;
     @Autowired
     private MsReportMapper msReportMapper;
+    @Autowired
+    private MsReportService msReportService;
 
     //查询家人
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public MsSuspected selectSuspected(long suspectedId) {
-        return msSuspectedMapper.selectById(suspectedId);
+        return msSuspectedMapper.selectBySuspectedId(suspectedId);
+    }
+
+    //查询家人
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public List<MsTripDet> selectTripSuspected(long suspectedId) {
+        return msSuspectedMapper.selectTripSuspected(suspectedId);
+    }
+
+    //查询用户最近一天的一个家人
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public MsSuspected selectAddSuspected(Long userCreate) {
+        return msSuspectedMapper.selectAddSuspected(userCreate);
+    }
+
+    //查询用户最近一天的一个人的家人
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public List<MsSuspected> selectNextSuspected(Long userCreate) {
+        List<MsSuspected> listSuspected = null;
+        listSuspected = msSuspectedMapper.selectNextSuspected(userCreate);
+        if (listSuspected != null && listSuspected.size() > 0) {
+            String tripDet;
+            for (MsSuspected msSuspected : listSuspected) {
+                tripDet = "";
+                //出行详细
+                List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(msSuspected.getSuspectedId());
+                if (listDet != null && listDet.size() > 0) {
+                    for (MsTripDet msTripDet : listDet) {
+                        tripDet += "出发地:" + msReportService.getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
+                        tripDet += "目的地:" + msReportService.getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
+                        tripDet += "出行方式:" + msReportService.getTripType(msTripDet.getTripType()) + ",";
+                        tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
+                    }
+                    msSuspected.setTripDet(tripDet.substring(0, tripDet.length() - 1));
+                }
+            }
+
+        }
+        return listSuspected;
     }
 
     //添加家人
@@ -107,7 +150,7 @@ public class MsSuspectedService {
                 return 2L;
             //判断是否评估
             if (scoreRezult == 0) {
-                MsSuspected msSuspected1 = getScore(0L, userName, medical,temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
+                MsSuspected msSuspected1 = getScore(0L, userName, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
                 if (msSuspected1 != null) {
                     scoreRezult = msSuspected1.getScoreRezult();
                     score = msSuspected1.getScore();
@@ -143,6 +186,7 @@ public class MsSuspectedService {
             msSuspected.setUserUpdate(userCreate);
             msSuspected.setTimeUpdate(DateTime.now());
             msSuspectedMapper.insert(msSuspected);
+
         } else {
             //判断家人是否同名
             List<MsSuspected> list = msSuspectedMapper.selectUserNameNum(reportId, userName, reportDate);
@@ -154,7 +198,7 @@ public class MsSuspectedService {
                         return 2L;
                 }
             }
-            MsSuspected msSuspected2 = getScore(suspectedId, userName, medical,temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
+            MsSuspected msSuspected2 = getScore(suspectedId, userName, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
             if (msSuspected2 != null) {
                 scoreRezult = msSuspected2.getScoreRezult();
                 score = msSuspected2.getScore();
@@ -212,7 +256,7 @@ public class MsSuspectedService {
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public void updateReport(Long reportId, Integer medical, Integer singleRoom, BigDecimal temperature) {
         //更新今日日报
-        Integer trueNum = 0, singleNum = 0, isSuspected = 0, isNoSuspected = 0, isFamliy = 0;
+        Integer trueNum = 0, singleNum = 0, isSuspected = 0, isNoSuspected = 0, isFamliy = 0, abnormalNum = 0;
 
         //确诊
         trueNum = msReportMapper.selectSuspectedNum(reportId);
@@ -226,6 +270,9 @@ public class MsSuspectedService {
         //疑似
         isNoSuspected = msReportMapper.selectisNoSuspectedNum(reportId);
 
+        //异常人数
+        abnormalNum = msReportMapper.selectAbnormalNum(reportId);
+
         //今日居家
         List<MsSuspected> list = msSuspectedMapper.selectByReportId(reportId);
         if (list != null && list.size() > 0)
@@ -237,7 +284,7 @@ public class MsSuspectedService {
             msReport.setSuspectedNum(isNoSuspected);
             msReport.setNormalNum(isSuspected);
             msReport.setSafetyNum(isFamliy);
-            if (isNoSuspected > 0)
+            if (isNoSuspected > 0 || abnormalNum > 0)
                 msReport.setMsStatus(2);
             else
                 msReport.setMsStatus(1);
@@ -251,9 +298,9 @@ public class MsSuspectedService {
         MsSuspected msSuspected = new MsSuspected();
         msSuspected.setTemperatureScore(getTemperatureScore(temperature));
         msSuspected.setScore(addScore(medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea));
-        Integer scoreHistroy = msSuspectedMapper.selectUserNameScore(userCreate, userName, susprectedId);
+        Integer scoreHistroy = msSuspectedMapper.selectUserNameScore(userCreate, userName, susprectedId) == null ? 0 : msSuspectedMapper.selectUserNameScore(userCreate, userName, susprectedId);
         msSuspected.setScoreHistroy(scoreHistroy);
-        msSuspected.setScoreRezult(scoreRezulte(medical,msSuspected.getScoreHistroy(), msSuspected.getScore()));
+        msSuspected.setScoreRezult(scoreRezulte(medical, msSuspected.getScoreHistroy(), msSuspected.getScore()));
         return msSuspected;
     }
 
@@ -280,7 +327,12 @@ public class MsSuspectedService {
     public Integer addScore(Integer medical, BigDecimal temperature, Integer cough, Integer muscle, Integer dyspnea, Integer fatigue, Integer diarrhea) {
         Integer score = 0;
 
-        if (medical == 0) {
+        //确诊,疑似尽快就医
+        if (medical == 1 || medical==2)
+            score = 5;
+        else if (medical == 3)
+            score = 1;
+        else {
             //温度
             score += getTemperatureScore(temperature);
             //咳嗽
@@ -293,8 +345,8 @@ public class MsSuspectedService {
             score += fatigue;
             //肌肉
             score += diarrhea;
-        } else
-            score = 5;
+        }
+
         return score;
     }
 
@@ -302,7 +354,11 @@ public class MsSuspectedService {
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public Integer scoreRezulte(Integer medical, Integer scoreHistory, Integer score) {
         Integer scoreRezult = 0;
-        if (medical == 0) {
+        if (medical == 1 || medical==2)
+            scoreRezult = 4;
+        else if (medical == 3)
+            scoreRezult = 2;
+        else {
             //判断用户是否含有历史评分
             if (scoreHistory == null) {
                 //判断结果
@@ -329,8 +385,7 @@ public class MsSuspectedService {
                         scoreRezult = 4;
                 }
             }
-        } else
-            scoreRezult = 4;
+        }
         return scoreRezult;
     }
 }

+ 276 - 0
whepi-web/src/main/java/com/bofeng/service/MsTripService.java

@@ -0,0 +1,276 @@
+package com.bofeng.service;
+
+
+import com.baomidou.mybatisplus.toolkit.IdWorker;
+import com.bofeng.dao.MsReportMapper;
+import com.bofeng.dao.MsSuspectedMapper;
+import com.bofeng.dao.MsTripDetMapper;
+import com.bofeng.dao.MsTripMapper;
+import com.bofeng.entity.MsReport;
+import com.bofeng.entity.MsSuspected;
+import com.bofeng.entity.MsTrip;
+import com.bofeng.entity.MsTripDet;
+import com.yvan.platform.Conv;
+import org.joda.time.DateTime;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author: xielianghe
+ * @Date: 2020/2/22 13:33
+ */
+@Service
+@Transactional(readOnly = true)
+public class MsTripService {
+
+    @Autowired
+    private MsSuspectedMapper msSuspectedMapper;
+    @Autowired
+    private MsReportMapper msReportMapper;
+    @Autowired
+    private MsTripMapper msTripMapper;
+    @Autowired
+    private MsTripDetMapper msTripDetMapper;
+    @Autowired
+    private MsSuspectedService msSuspectedService;
+
+
+    //添加家人
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public Long addSuspectedTrip(Long suspectedId, String userName, Integer grender, Integer age, String familyStatus,
+                                 String statusDesp, Integer medical, BigDecimal temperature, Integer cough, Integer muscle,
+                                 Integer dyspnea, Integer fatigue, Integer diarrhea, Integer singleRoom, String others, Long userCreate, Integer scoreRezult, Integer temperatureScore, Integer scoreHistroy, Integer score
+            , Integer workLocal, String workLocalOther, Integer todayLocal, String todayLocalOther, Integer isTrip, List<MsTripDet> listTripDet) {
+        Long reportId = 0L;
+        //如果是当前日期 已经添加
+        Date t = new Date();
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+        String reportDate = df.format(t);
+        List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
+        Long houseId = msReportMapper.selectHouseIdByUserId(userCreate);
+        //首次进入。没有今日报告
+        if (listReport == null || listReport.size() == 0) {
+            MsReport msReport = new MsReport();
+            msReport.setReportId(IdWorker.getId());
+            msReport.setHouseId(houseId);
+            msReport.setSafetyNum(0);
+            msReport.setSureNum(0);
+            msReport.setSuspectedNum(0);
+            msReport.setNormalNum(0);
+            msReport.setSingleNum(0);
+            msReport.setRemarks("");
+            msReport.setReportDate(DateTime.now().toDate());
+            msReport.setMsStatus(0);
+            msReport.setUserCreate(userCreate);
+            msReport.setTimeCreate(DateTime.now());
+            msReport.setUserUpdate(userCreate);
+            msReport.setTimeUpdate(DateTime.now());
+            msReportMapper.insert(msReport);
+            reportId = msReport.getReportId();
+        } else {
+            reportId = listReport.get(0).getReportId();
+        }
+
+        //判断是否疑似
+        Integer suspectedStatus = 0;
+        //确诊
+        if (medical == 1)
+            suspectedStatus = 1;
+        //隔离
+        if (singleRoom == 1)
+            suspectedStatus = 1;
+        //体温
+        if (Conv.NFloat(temperature) < Conv.NFloat(35) || Conv.NFloat(temperature) > Conv.NFloat(37.3))
+            suspectedStatus = 1;
+        //咳嗽
+        if (cough > 0)
+            suspectedStatus = 1;
+        //肌肉酸痛
+        if (muscle > 0)
+            suspectedStatus = 1;
+        //呼吸困难
+        if (dyspnea > 0)
+            suspectedStatus = 1;
+        //乏力
+        if (fatigue > 0)
+            suspectedStatus = 1;
+        //腹泻
+        if (diarrhea > 0)
+            suspectedStatus = 1;
+        if (suspectedId == 0L) {
+            //判断家人是否同名
+            List<MsSuspected> list = msSuspectedMapper.selectUserNameNum(reportId, userName, reportDate);
+            if (list != null && list.size() > 0)
+                return 2L;
+            //判断是否评估
+            if (scoreRezult == 0) {
+                MsSuspected msSuspected1 = msSuspectedService.getScore(0L, userName, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
+                if (msSuspected1 != null) {
+                    scoreRezult = msSuspected1.getScoreRezult();
+                    score = msSuspected1.getScore();
+                    temperatureScore = msSuspected1.getTemperatureScore();
+                    scoreHistroy = msSuspected1.getScoreHistroy();
+                }
+            }
+
+            MsSuspected msSuspected = new MsSuspected();
+            msSuspected.setSuspectedId(IdWorker.getId());
+            msSuspected.setReportId(reportId);
+            msSuspected.setUserName(userName);
+            msSuspected.setGrender(grender);//默认为家人
+            msSuspected.setAge(age);
+            msSuspected.setFamilyStatus(familyStatus);
+            msSuspected.setStatusDesp(statusDesp);
+            msSuspected.setMedical(medical);
+            msSuspected.setTemperature(temperature);
+            msSuspected.setCough(cough);
+            msSuspected.setMuscle(muscle);
+            msSuspected.setDiarrhea(dyspnea);
+            msSuspected.setFatigue(fatigue);
+            msSuspected.setDiarrhea(diarrhea);
+            msSuspected.setSingleRoom(singleRoom);
+            msSuspected.setOthers(others);
+            msSuspected.setSuspectedStatus(suspectedStatus);
+            msSuspected.setScoreRezult(scoreRezult);
+            msSuspected.setScore(score);
+            msSuspected.setScoreHistroy(scoreHistroy);
+            msSuspected.setTemperatureScore(temperatureScore);
+            msSuspected.setUserCreate(userCreate);
+            msSuspected.setTimeCreate(DateTime.now());
+            msSuspected.setUserUpdate(userCreate);
+            msSuspected.setTimeUpdate(DateTime.now());
+            msSuspectedMapper.insert(msSuspected);
+
+            //添加出行
+            MsTrip msTrip = new MsTrip();
+            msTrip.setTripId(msSuspected.getSuspectedId());
+            msTrip.setIsTrip(isTrip);
+            msTrip.setTodayLocal(todayLocal);
+            msTrip.setTodayLocalOther(todayLocalOther);
+            msTrip.setWorkLocal(workLocal);
+            msTrip.setWorkLocalOther(workLocalOther);
+            msTripMapper.insert(msTrip);
+            //添加出行详细
+            if (listTripDet != null && listTripDet.size() > 0) {
+                for (MsTripDet msTripDet : listTripDet) {
+                    MsTripDet msTripDet1 = new MsTripDet();
+                    msTripDet1.setTripDetId(IdWorker.getId());
+                    msTripDet1.setTripId(msSuspected.getSuspectedId());
+                    msTripDet1.setSort(msTripDet.getSort());
+                    msTripDet1.setStartLocal(msTripDet.getStartLocal());
+                    msTripDet1.setStartLocalOther(msTripDet.getStartLocalOther());
+                    msTripDet1.setEndLocal(msTripDet.getEndLocal());
+                    msTripDet1.setEndLocalOther(msTripDet.getEndLocalOther());
+                    msTripDet1.setTripType(msTripDet.getTripType());
+                    msTripDet1.setTripTypeDesp(msTripDet.getTripTypeDesp());
+                    msTripDet1.setTimeCreate(DateTime.now());
+                    msTripDet1.setUserCreate(userCreate);
+                    msTripDet1.setTimeUpdate(DateTime.now());
+                    msTripDet1.setUserUpdate(userCreate);
+                    msTripDetMapper.insert(msTripDet1);
+                }
+            }
+
+        } else {
+            //判断家人是否同名
+            List<MsSuspected> list = msSuspectedMapper.selectUserNameNum(reportId, userName, reportDate);
+            if (list != null && list.size() > 0) {
+                if (list.size() > 1)
+                    return 2L;
+                else {
+                    if (list.get(0).getSuspectedId().longValue() != suspectedId.longValue())
+                        return 2L;
+                }
+            }
+            MsSuspected msSuspected2 = msSuspectedService.getScore(suspectedId, userName, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
+            if (msSuspected2 != null) {
+                scoreRezult = msSuspected2.getScoreRezult();
+                score = msSuspected2.getScore();
+                temperatureScore = msSuspected2.getTemperatureScore();
+                scoreHistroy = msSuspected2.getScoreHistroy();
+            }
+
+            MsSuspected msSuspected1 = msSuspectedMapper.selectById(suspectedId);
+            if (msSuspected1 != null) {
+                msSuspected1.setUserName(userName);
+                msSuspected1.setGrender(grender);//默认为家人
+                msSuspected1.setAge(age);
+                msSuspected1.setFamilyStatus(familyStatus);
+                msSuspected1.setStatusDesp(statusDesp);
+                msSuspected1.setMedical(medical);
+                msSuspected1.setTemperature(temperature);
+                msSuspected1.setCough(cough);
+                msSuspected1.setMuscle(muscle);
+                msSuspected1.setDiarrhea(dyspnea);
+                msSuspected1.setFatigue(fatigue);
+                msSuspected1.setDiarrhea(diarrhea);
+                msSuspected1.setSingleRoom(singleRoom);
+                msSuspected1.setOthers(others);
+                msSuspected1.setScoreRezult(scoreRezult);
+                msSuspected1.setScore(score);
+                msSuspected1.setScoreHistroy(scoreHistroy);
+                msSuspected1.setTemperatureScore(temperatureScore);
+                msSuspected1.setSuspectedStatus(suspectedStatus);
+                msSuspectedMapper.updateById(msSuspected1);
+            }
+            //编辑行程
+            MsTrip msTrip = msTripMapper.selectById(suspectedId);
+            if (msTrip != null) {
+                msTrip.setWorkLocalOther(workLocalOther);
+                msTrip.setWorkLocal(workLocal);
+                msTrip.setTodayLocalOther(todayLocalOther);
+                msTrip.setTodayLocal(todayLocal);
+                msTrip.setIsTrip(isTrip);
+                msTripMapper.updateById(msTrip);
+            } else {
+                msTrip = new MsTrip();
+                msTrip.setTripId(suspectedId);
+                msTrip.setIsTrip(isTrip);
+                msTrip.setTodayLocal(todayLocal);
+                msTrip.setTodayLocalOther(todayLocalOther);
+                msTrip.setWorkLocal(workLocal);
+                msTrip.setWorkLocalOther(workLocalOther);
+                msTripMapper.insert(msTrip);
+            }
+            //删除行程详细
+            msTripDetMapper.deleteByTripId(suspectedId);
+            //添加出行详细
+            if (listTripDet != null && listTripDet.size() > 0) {
+                for (MsTripDet msTripDet : listTripDet) {
+                    MsTripDet msTripDet1 = new MsTripDet();
+                    msTripDet1.setTripDetId(IdWorker.getId());
+                    msTripDet1.setTripId(suspectedId);
+                    msTripDet1.setSort(msTripDet.getSort());
+                    msTripDet1.setStartLocal(msTripDet.getStartLocal());
+                    msTripDet1.setStartLocalOther(msTripDet.getStartLocalOther());
+                    msTripDet1.setEndLocal(msTripDet.getEndLocal());
+                    msTripDet1.setEndLocalOther(msTripDet.getEndLocalOther());
+                    msTripDet1.setTripType(msTripDet.getTripType());
+                    msTripDet1.setTripTypeDesp(msTripDet.getTripTypeDesp());
+                    msTripDet1.setTimeCreate(DateTime.now());
+                    msTripDet1.setUserCreate(userCreate);
+                    msTripDet1.setTimeUpdate(DateTime.now());
+                    msTripDet1.setUserUpdate(userCreate);
+                    msTripDetMapper.insert(msTripDet1);
+                }
+            }
+        }
+        //更新今日日报
+        msSuspectedService.updateReport(reportId, medical, singleRoom, temperature);
+        return reportId;
+    }
+
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public Integer deleteTrip(Long suspectedId) {
+        msTripDetMapper.deleteByTripId(suspectedId);
+        msTripMapper.deleteById(suspectedId);
+        return 0;
+    }
+}

+ 53 - 0
whepi-web/src/main/java/com/bofeng/service/RbService.java

@@ -1,6 +1,7 @@
 package com.bofeng.service;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.bofeng.dao.MsSuspectedMapper;
 import com.bofeng.dao.QzTaskDao;
 import com.bofeng.dao.RbMapper;
 import com.bofeng.entity.*;
@@ -17,6 +18,10 @@ public class RbService {
 
     @Autowired
     private RbMapper rbMapper;
+    @Autowired
+    private MsSuspectedMapper msSuspectedMapper;
+    @Autowired
+    private MsReportService msReportService;
 
     public List<sysUptownUnit> selectAll (Long userId) {
         List<sysUptownUnit> sysUptownUnits = rbMapper.selectDY(userId);
@@ -95,4 +100,52 @@ public class RbService {
 
         return sysUptownHouses;
     }
+
+    public List<ExcelRiBaoPrivate> selectExcelRiBaoPrivate (Long upId,String date) {
+        List<ExcelRiBaoPrivate> list = rbMapper.selectExcelRiBaoPrivate(upId, date);
+
+        if (list != null && list.size() > 0) {
+            String tripDet;
+            for (ExcelRiBaoPrivate excelRiBaoPrivate : list) {
+                tripDet = "";
+                //出行详细
+                List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(excelRiBaoPrivate.getTripId());
+                if (listDet != null && listDet.size() > 0) {
+                    for (MsTripDet msTripDet : listDet) {
+                        tripDet += "出发地:" + msReportService.getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
+                        tripDet += "目的地:" + msReportService.getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
+                        tripDet += "出行方式:" + msReportService.getTripType(msTripDet.getTripType()) + ",";
+                        tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
+                    }
+                    excelRiBaoPrivate.setTripDetDesc(tripDet.substring(0, tripDet.length() - 1));
+                }
+            }
+
+        }
+        return list;
+    }
+
+    public List<ExcelRiBaoLY> selectExcelRiBaoLY (Long upId,String date) {
+        List<ExcelRiBaoLY> list = rbMapper.selectExcelRiBaoLY(upId, date);
+
+        if (list != null && list.size() > 0) {
+            String tripDet;
+            for (ExcelRiBaoLY excelRiBaoLY : list) {
+                tripDet = "";
+                //出行详细
+                List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(excelRiBaoLY.getTripId());
+                if (listDet != null && listDet.size() > 0) {
+                    for (MsTripDet msTripDet : listDet) {
+                        tripDet += "出发地:" + msReportService.getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
+                        tripDet += "目的地:" + msReportService.getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
+                        tripDet += "出行方式:" + msReportService.getTripType(msTripDet.getTripType()) + ",";
+                        tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
+                    }
+                    excelRiBaoLY.setTripDetDesc(tripDet.substring(0, tripDet.length() - 1));
+                }
+            }
+
+        }
+        return list;
+    }
 }

+ 6 - 0
whepi-web/src/main/java/com/bofeng/service/SweepCodeService.java

@@ -29,6 +29,12 @@ public class SweepCodeService {
     }
 
 
+    public List<SysUptownHouse> selectLingyunUser(PageDb pageDb, Map<String, Object> queryParam) {
+        List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.selectLingyunUser(pageDb,queryParam);
+        return sysUptownHouses;
+    }
+
+
     public List<SysUptownHouse> export(Map<String, Object> queryParam) {
         List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.export(queryParam);
         if(sysUptownHouses.size() != 0){

+ 42 - 41
whepi-web/src/main/java/com/bofeng/service/UserOpenService.java

@@ -8,6 +8,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.List;
+
 @Service
 @Transactional(readOnly = true)
 public class UserOpenService {
@@ -59,48 +61,47 @@ public class UserOpenService {
 
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public void saveUserInfo(Long userId, Integer userType, String linkman, String phone, Integer area, Long uptownId, Long unitId, String doorplate) {
-        UserRole userRole = new UserRole();
-        userRole.setUrId(IdWorker.getId());
-        userRole.setUserId(userId);
-        userRole.setRoleId(1);
-        userRole.setUserCreate(userId);
-        userRole.setUserUpdate(userId);
-        userRole.setStatus(1);
-        UptownHouse uptownHouse = new UptownHouse();
-        uptownHouse.setHouseId(IdWorker.getId());
+        List<UserRole> list = userRoleMapper.getUserRoleByUserId(userId);
+        if (list.size() == 0) {
+            UserRole userRole = new UserRole();
+            userRole.setUrId(IdWorker.getId());
+            userRole.setUserId(userId);
+            userRole.setRoleId(1);
+            userRole.setUserCreate(userId);
+            userRole.setUserUpdate(userId);
+            userRole.setStatus(1);
+            UptownHouse uptownHouse = new UptownHouse();
+            uptownHouse.setHouseId(IdWorker.getId());
+            uptownHouse.setUnitId(unitId);
+            uptownHouse.setDoorplate(doorplate);
+            uptownHouse.setStatus(1);
+            uptownHouseMapper.insert(uptownHouse);
+            UptownHome uptownHome = new UptownHome();
+            uptownHome.setHouseId(uptownHouse.getHouseId());
+            uptownHome.setLinkman(linkman);
+            uptownHome.setPhone(phone);
+            uptownHome.setYoung(0);
+            uptownHome.setMiddle(0);
+            uptownHome.setOld(0);
+            uptownHome.setRemark("");
+            uptownHome.setStatus(1);
+            uptownHomeMapper.insert(uptownHome);
+            userRole.setPropertyId(uptownHome.getHouseId());
+            userRoleMapper.insert(userRole);
+        }
+    }
+
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public void changeUnitId(Long userId, Long unitId) {
+        UptownHouse uptownHouse = uptownHouseMapper.getUptownHouseByUser(userId);
         uptownHouse.setUnitId(unitId);
+        uptownHouseMapper.updateById(uptownHouse);
+    }
+
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public void changeDoorplate(Long userId, String doorplate) {
+        UptownHouse uptownHouse = uptownHouseMapper.getUptownHouseByUser(userId);
         uptownHouse.setDoorplate(doorplate);
-        uptownHouse.setStatus(1);
-        uptownHouseMapper.insert(uptownHouse);
-        UptownHome uptownHome = new UptownHome();
-        uptownHome.setHouseId(uptownHouse.getHouseId());
-        uptownHome.setLinkman(linkman);
-        uptownHome.setPhone(phone);
-        uptownHome.setYoung(0);
-        uptownHome.setMiddle(0);
-        uptownHome.setOld(0);
-        uptownHome.setRemark("");
-        uptownHome.setStatus(1);
-        uptownHomeMapper.insert(uptownHome);
-        userRole.setPropertyId(uptownHome.getHouseId());
-//        if (userType == 2) {
-//            Owner owner = new Owner();
-//            owner.setOwnerId(IdWorker.getId());
-//            owner.setUptownId(uptownId);
-//            owner.setLinkman(linkman);
-//            owner.setPhone(phone);
-//            owner.setUserCreate(userId);
-//            owner.setUserUpdate(userId);
-//            ownerMapper.insert(owner);
-//            UserRole userRole1 = new UserRole();
-//            userRole1.setUrId(IdWorker.getId());
-//            userRole1.setUserId(userId);
-//            userRole1.setRoleId(userType);
-//            userRole1.setUserCreate(userId);
-//            userRole1.setUserUpdate(userId);
-//            userRole1.setPropertyId(owner.getOwnerId());
-//            userRoleMapper.insert(userRole1);
-//        }
-        userRoleMapper.insert(userRole);
+        uptownHouseMapper.updateById(uptownHouse);
     }
 }

+ 124 - 0
whepi-web/src/main/java/com/bofeng/word/WordUtils.java

@@ -0,0 +1,124 @@
+package com.bofeng.word;
+
+
+import java.io.*;
+import java.net.URLEncoder;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.afterturn.easypoi.word.WordExportUtil;
+import com.yvan.DateUtils;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.utility.DateUtil;
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
+import org.springframework.beans.factory.annotation.Value;
+
+public class WordUtils {
+
+    /**
+     * 导出word
+     * <p>第一步生成替换后的word文件,只支持docx</p>
+     * <p>第二步下载生成的文件</p>
+     * <p>第三步删除生成的临时文件</p>
+     * 模版变量中变量格式:{{foo}}
+     * @param templatePath word模板地址
+     * @param temDir 生成临时文件存放地址
+     * @param fileName 文件名
+     * @param params 替换的参数
+     * @param request HttpServletRequest
+     * @param response HttpServletResponse
+     */
+    public static void exportWord(String templatePath, String temDir, String fileName, Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) {
+//        Assert.notNull(templatePath,"模板路径不能为空");
+//        Assert.notNull(temDir,"临时文件路径不能为空");
+//        Assert.notNull(fileName,"导出文件名不能为空");
+//        Assert.isTrue(fileName.endsWith(".docx"),"word导出请使用docx格式");
+        if (!temDir.endsWith("/")){
+            temDir = temDir + File.separator;
+        }
+        File dir = new File(temDir);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+        try {
+            String userAgent = request.getHeader("user-agent").toLowerCase();
+            if (userAgent.contains("msie") || userAgent.contains("like gecko")) {
+                fileName = URLEncoder.encode(fileName, "UTF-8");
+            } else {
+                fileName = new String(fileName.getBytes("utf-8"), "ISO-8859-1");
+            }
+            XWPFDocument doc = WordExportUtil.exportWord07(templatePath, params);
+            String tmpPath = temDir + fileName;
+            FileOutputStream fos = new FileOutputStream(tmpPath);
+            doc.write(fos);
+            // 设置强制下载不打开
+            response.setContentType("application/force-download");
+            // 设置文件名
+            response.addHeader("Content-Disposition", "attachment;fileName=" + fileName);
+            OutputStream out = response.getOutputStream();
+            doc.write(out);
+            out.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+//            delAllFile(temDir);//这一步看具体需求,要不要删
+        }
+
+    }
+
+    /**
+     * 导出word
+     * <p>第一步生成替换后的word文件,只支持docx</p>
+     * <p>第二步下载生成的文件</p>
+     * <p>第三步删除生成的临时文件</p>
+     * 模版变量中变量格式:{{foo}}
+     * @param templatePath word模板地址
+     * @param temDir 生成临时文件存放地址
+     * @param fileName 文件名
+     * @param paramList 替换的参数
+     * @param request HttpServletRequest
+     * @param response HttpServletResponse
+     */
+    public static void exportWord(String templatePath, String temDir, String fileName, List<Map<String, Object>> paramList, HttpServletRequest request, HttpServletResponse response) {
+//        Assert.notNull(templatePath,"模板路径不能为空");
+//        Assert.notNull(temDir,"临时文件路径不能为空");
+//        Assert.notNull(fileName,"导出文件名不能为空");
+//        Assert.isTrue(fileName.endsWith(".docx"),"word导出请使用docx格式");
+        if (!temDir.endsWith("/")){
+            temDir = temDir + File.separator;
+        }
+        File dir = new File(temDir);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+        try {
+            String userAgent = request.getHeader("user-agent").toLowerCase();
+            if (userAgent.contains("msie") || userAgent.contains("like gecko")) {
+                fileName = URLEncoder.encode(fileName, "UTF-8");
+            } else {
+                fileName = new String(fileName.getBytes("utf-8"), "ISO-8859-1");
+            }
+            XWPFDocument doc = WordExportUtil.exportWord07(templatePath, paramList);
+            String tmpPath = temDir + fileName;
+            FileOutputStream fos = new FileOutputStream(tmpPath);
+            doc.write(fos);
+            // 设置强制下载不打开
+            response.setContentType("application/force-download");
+            // 设置文件名
+            response.addHeader("Content-Disposition", "attachment;fileName=" + fileName);
+            OutputStream out = response.getOutputStream();
+            doc.write(out);
+            out.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+//            delAllFile(temDir);//这一步看具体需求,要不要删
+        }
+
+    }
+}

+ 40 - 15
whepi-web/src/main/java/com/bofeng/wx/WxController.java

@@ -130,29 +130,34 @@ public class WxController {
                                 "/user/home.html",
                         WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
         );
-
-//        val btnDesc = new WxMenuButton();
-//        btnDesc.setName("平台简介");
-//        btnDesc.setType(WxConsts.MenuButtonType.VIEW);
-//        btnDesc.setUrl(
-//                wxService.oauth2buildAuthorizationUrl(weChatProperties.getDomain() +
-//                                "/home/desc.html",
-//                        WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
-//        );
-
         val bt2 = new WxMenuButton();
-        bt2.setName("外出查询");
-        bt2.setType(WxConsts.MenuButtonType.VIEW);
-        bt2.setUrl(
+        bt2.setName("相关查询");
+        val bt21 = new WxMenuButton();
+        bt21.setName("外出查询");
+        bt21.setType(WxConsts.MenuButtonType.VIEW);
+        bt21.setUrl(
                 wxService.oauth2buildAuthorizationUrl(weChatProperties.getDomain() +
                                 "/user/goOut.html",
                         WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
         );
+        val bt22 = new WxMenuButton();
+        bt22.setName("复工查询");
+        bt22.setType(WxConsts.MenuButtonType.VIEW);
+        bt22.setUrl(
+                wxService.oauth2buildAuthorizationUrl(weChatProperties.getDomain() +
+                                "/user/returnWork.html",
+                        WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
+        );
+        bt2.getSubButtons().add(bt21);
+        bt2.getSubButtons().add(bt22);
+
+
+
 
         val btnDesc = new WxMenuButton();
         btnDesc.setName("平台简介");
         val btn31 = new WxMenuButton();
-        btn31.setName("帮助");
+        btn31.setName("家庭手册");
         btn31.setType(WxConsts.MenuButtonType.VIEW);
         btn31.setUrl(
                 wxService.oauth2buildAuthorizationUrl(weChatProperties.getDomain() +
@@ -160,15 +165,35 @@ public class WxController {
                         WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
         );
         val btn32 = new WxMenuButton();
-        btn32.setName("简介");
+        btn32.setName("管理员手册");
         btn32.setType(WxConsts.MenuButtonType.VIEW);
         btn32.setUrl(
                 wxService.oauth2buildAuthorizationUrl(weChatProperties.getDomain() +
+                                "/home/adminHelp.html",
+                        WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
+        );
+
+        val btn33 = new WxMenuButton();
+        btn33.setName("出入管理");
+        btn33.setType(WxConsts.MenuButtonType.VIEW);
+        btn33.setUrl(
+                wxService.oauth2buildAuthorizationUrl(weChatProperties.getDomain() +
+                                "/home/outHelp.html",
+                        WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
+        );
+
+        val btn34 = new WxMenuButton();
+        btn34.setName("简介");
+        btn34.setType(WxConsts.MenuButtonType.VIEW);
+        btn34.setUrl(
+                wxService.oauth2buildAuthorizationUrl(weChatProperties.getDomain() +
                                 "/home/desc.html",
                         WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
         );
         btnDesc.getSubButtons().add(btn31);
         btnDesc.getSubButtons().add(btn32);
+        btnDesc.getSubButtons().add(btn33);
+        btnDesc.getSubButtons().add(btn34);
 //        btn3.getSubButtons().add(btnDesc);
 //        btn3.getSubButtons().add(btnHelp);
 

+ 36 - 9
whepi-web/src/main/java/com/bofeng/wx/controller/MsReportController.java

@@ -4,6 +4,7 @@ package com.bofeng.wx.controller;
 import com.bofeng.entity.*;
 import com.bofeng.service.MsReportService;
 import com.bofeng.service.MsSuspectedService;
+import com.bofeng.service.MsTripService;
 import com.yvan.Model;
 import com.yvan.ModelOps;
 import com.yvan.mvc.Pd;
@@ -31,6 +32,8 @@ public class MsReportController {
     private MsSuspectedService msSuspectedService;
     @Autowired
     private MsReportService msReportService;
+    @Autowired
+    private MsTripService msTripService;
 
     //添加家人
     @PostMapping("/home/addRibao")
@@ -61,15 +64,22 @@ public class MsReportController {
         Integer scoreHistroy = Conv.NI(request.getParameter("scoreHistroy"));
         Integer score = Conv.NI(request.getParameter("score"));
 
-        MsReport msReport=new MsReport();
-        Long reportId =msSuspectedService.addSuspected(suspectedId, userName, grender, age, familyStatus, statusDesp, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, singleRoom, others, userCreate,scoreRezult,temperatureScore,scoreHistroy,score);
-        if(reportId==2L)
+        MsReport msReport = new MsReport();
+        Long reportId = msSuspectedService.addSuspected(suspectedId, userName, grender, age, familyStatus, statusDesp, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, singleRoom, others, userCreate, scoreRezult, temperatureScore, scoreHistroy, score);
+        if (reportId == 2L)
             msReport.setMsgReport("2");
         else
-            msReport= msReportService.getByReport(reportId);
+            msReport = msReportService.getByReport(reportId);
         return msReport;
     }
 
+    //查询用户最近一天的一个家人
+    @GetMapping("/home/selectAddSuspected")
+    public MsSuspected selectAddSuspected(HttpServletRequest request) {
+        Long userCreate = Long.parseLong(request.getParameter("userCreate"));
+        return msSuspectedService.selectAddSuspected(userCreate);
+    }
+
     //查询家人
     @GetMapping("/home/selectSuspected")
     public MsSuspected selectSuspected(HttpServletRequest request) {
@@ -78,30 +88,47 @@ public class MsReportController {
         return msSuspectedService.selectSuspected(suspectedId);
     }
 
+    //查询出行详细
+    @GetMapping("/home/selectTripSuspected")
+    public Model<List<MsTripDet>> selectTripSuspected(HttpServletRequest request) {
+        //初始化今日日报
+        Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
+        return Model.newSuccess(msSuspectedService.selectTripSuspected(suspectedId));
+    }
+
     //删除家人病例
     @PostMapping("/home/deleteSuspected")
     public MsReport deleteSuspected(HttpServletRequest request) {
         Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
         MsSuspected msSuspected = msSuspectedService.selectSuspected(suspectedId);
         msSuspectedService.deleteSuspected(suspectedId);
+        msTripService.deleteTrip(suspectedId);
         if (msSuspected != null)
             return msReportService.getByReport(msSuspected.getReportId());
         else
             return null;
     }
 
-    //根据登录人获取家人
+    //根据点击获取家人
     @GetMapping("/home/home/queryRibao")
     public Model<List<MsSuspected>> queryRibao(@Pd(name = "userCreate") Long userCreate) {
         Date t = new Date();
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
         String reportDate = df.format(t);
-        return Model.newSuccess(msReportService.getByReportReportDate(reportDate, userCreate));
+        //今日有记录
+        List<MsSuspected> list = msReportService.getByReportReportDate(reportDate, userCreate);
+        if (list != null && list.size() > 0)
+            return Model.newSuccess(list);
+            //获取用户最新的记录
+        else {
+           // return Model.newSuccess(msSuspectedService.selectNextSuspected(userCreate));
+            return null;
+        }
     }
 
     //根据日报获取家人
     @GetMapping("/home/home/queryRibaoRefresh")
-    public Model<List<MsSuspected>> queryRibaoRefresh(@Pd(name = "reportId") Long reportId) {
+    public Model<List<MsSuspected>> queryRibaoRefresh(@Pd(name = "reportId") Long reportId, @Pd(name = "userCreate") Long userCreate) {
         return Model.newSuccess(msReportService.getByReportId(reportId));
     }
 
@@ -114,7 +141,7 @@ public class MsReportController {
             return ModelOps.newSuccess();
         } else if (re == 2) { //没有上报体温
             return ModelOps.newFail("请填报今日体温!");
-        }else if (re == 3) { //没有选择家人
+        } else if (re == 3) { //没有选择家人
             return ModelOps.newFail("请选择家人!");
         }
         return ModelOps.newFail("上报错误");
@@ -147,7 +174,7 @@ public class MsReportController {
         Integer dyspnea = Conv.NI(request.getParameter("dyspnea"));
         Integer fatigue = Conv.NI(request.getParameter("fatigue"));
         Integer diarrhea = Conv.NI(request.getParameter("diarrhea"));
-        return msSuspectedService.getScore(suspectedId,userName,medical,temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
+        return msSuspectedService.getScore(suspectedId, userName, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
     }
 
 }

+ 89 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/MsTripController.java

@@ -0,0 +1,89 @@
+package com.bofeng.wx.controller;
+
+
+import com.bofeng.entity.MsReport;
+import com.bofeng.entity.MsSuspected;
+import com.bofeng.entity.MsTripDet;
+import com.bofeng.entity.Owner;
+import com.bofeng.service.MsReportService;
+import com.bofeng.service.MsTripService;
+import com.yvan.platform.Conv;
+import com.yvan.platform.JsonWapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: xielianghe
+ * @Date: 2020/2/22 13:31
+ */
+@RestController
+public class MsTripController {
+    @Autowired
+    private MsReportService msReportService;
+    @Autowired
+    private MsTripService msTripService;
+
+    //添加家人出行
+    @PostMapping("/home/addRibaoTrip")
+    public MsReport saveUser(JsonWapper jsonWapper) throws UnsupportedEncodingException {
+        //初始化今日日报
+        Long suspectedId = jsonWapper.asObject(Long.class, "suspectedId") == null ? 0L : jsonWapper.asObject(Long.class, "suspectedId");
+        Long userCreate = jsonWapper.asObject(Long.class, "userCreate")== null ? 0L : jsonWapper.asObject(Long.class, "userCreate");
+        String userName = jsonWapper.asObject(String.class, "userName");
+        byte[] utf8Bytes = userName.getBytes("UTF-8");
+        userName = new String(utf8Bytes, "UTF-8");
+        Integer grender = jsonWapper.asObject(Integer.class, "grender");
+        Integer age = jsonWapper.asObject(Integer.class, "age");
+        String familyStatus = jsonWapper.asObject(String.class, "familyStatus");
+        String statusDesp = jsonWapper.asObject(String.class, "statusDesp");
+        Integer medical = jsonWapper.asObject(Integer.class, "medical")== null ? 0: jsonWapper.asObject(Integer.class, "medical");
+        BigDecimal temperature = jsonWapper.asObject(BigDecimal.class, "temperature");
+        Integer cough = jsonWapper.asObject(Integer.class, "cough")== null ? 0: jsonWapper.asObject(Integer.class, "cough");
+        Integer muscle = jsonWapper.asObject(Integer.class, "muscle")== null ? 0: jsonWapper.asObject(Integer.class, "muscle");
+        Integer dyspnea = jsonWapper.asObject(Integer.class, "dyspnea")== null ? 0: jsonWapper.asObject(Integer.class, "dyspnea");
+        Integer fatigue = jsonWapper.asObject(Integer.class, "fatigue")== null ? 0: jsonWapper.asObject(Integer.class, "fatigue");
+        Integer diarrhea = jsonWapper.asObject(Integer.class, "diarrhea")== null ? 0: jsonWapper.asObject(Integer.class, "diarrhea");
+        Integer singleRoom = jsonWapper.asObject(Integer.class, "singleRoom")== null ? 0: jsonWapper.asObject(Integer.class, "singleRoom");
+        String others = jsonWapper.asObject(String.class, "others");
+        Integer scoreRezult = jsonWapper.asObject(Integer.class, "scoreRezult")== null ? 0: jsonWapper.asObject(Integer.class, "scoreRezult");
+        Integer temperatureScore = jsonWapper.asObject(Integer.class, "temperatureScore")== null ? 0: jsonWapper.asObject(Integer.class, "temperatureScore");
+        Integer scoreHistroy = jsonWapper.asObject(Integer.class, "scoreHistroy")== null ? 0: jsonWapper.asObject(Integer.class, "scoreHistroy");
+        Integer score = jsonWapper.asObject(Integer.class, "score")== null ? 0: jsonWapper.asObject(Integer.class, "score");
+        //添加出行
+        Integer workLocal = jsonWapper.asObject(Integer.class, "workLocal");
+        String workLocalOther = jsonWapper.asObject(String.class, "workLocalOther");
+        Integer todayLocal = jsonWapper.asObject(Integer.class, "todayLocal");
+        String todayLocalOther = jsonWapper.asObject(String.class, "todayLocalOther");
+        Integer isTrip = jsonWapper.asObject(Integer.class, "isTrip");
+        List<MsTripDet> listTripDet = new ArrayList<>();
+        MsTripDet msTripDet;
+        if(jsonWapper.asList("tripDet").size()>0){
+            for (int i = 0; i < jsonWapper.asList("tripDet").size(); i++) {
+                Map<String, Object> mm = (Map) jsonWapper.asList("tripDet").get(i);
+                msTripDet = new MsTripDet();
+                msTripDet.setSort(i+1);
+                msTripDet.setStartLocal(Conv.NI(mm.get("startLocal")));
+                msTripDet.setStartLocalOther(mm.get("startLocalOther").toString());
+                msTripDet.setEndLocal(Conv.NI(mm.get("endLocal")));
+                msTripDet.setEndLocalOther(mm.get("endLocalOther").toString());
+                msTripDet.setTripType(Conv.NI(mm.get("tripType")));
+                msTripDet.setTripTypeDesp(mm.get("tripTypeDesp").toString());
+                listTripDet.add(msTripDet);
+            }
+        }
+        MsReport msReport = new MsReport();
+        Long reportId = msTripService.addSuspectedTrip(suspectedId, userName, grender, age, familyStatus, statusDesp, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, singleRoom, others, userCreate, scoreRezult, temperatureScore, scoreHistroy, score, workLocal, workLocalOther, todayLocal, todayLocalOther, isTrip, listTripDet);
+        if (reportId == 2L)
+            msReport.setMsgReport("2");
+        else
+            msReport = msReportService.getByReport(reportId);
+        return msReport;
+    }
+}

+ 31 - 10
whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java

@@ -67,6 +67,14 @@ public class ScanAdminController {
         return Model.newSuccess(pageDb,sysUptownHouses);
     }
 
+    @ApiOperation("凌云用户管理")
+    @PostMapping("/whepi/sweepCode/selectLingyunUser")
+    public Model<List<SysUptownHouse>> selectLingyunUser(PageDb pageDb,HttpParameterParser parser) {
+//        HttpServletResponse response,HttpServletRequest request
+        List<SysUptownHouse> sysUptownHouses = sweepCodeService.selectLingyunUser(pageDb,parser.getMap());
+        return Model.newSuccess(pageDb,sysUptownHouses);
+    }
+
     @ApiOperation("导出")
     @PostMapping("/whepi/sweepCode/export")
     @SneakyThrows
@@ -123,7 +131,7 @@ public class ScanAdminController {
     @ApiOperation("保存特殊人员")
     @PostMapping("/whepi/OutUser/saveOutUser")
     public Model saveOutUser(@JsonBody OutUser outUser) {
-        OutUser outUser1 = outUserMapper.getOutUserByPhone(outUser.getPhone());
+        OutUser outUser1 = outUserMapper.queryOutUserByPhone(outUser.getPhone());
         if (outUser1 != null) {
             return Model.newFail("该号码已经添加为特殊人员,请仔细检查该号码。");
         }
@@ -149,15 +157,28 @@ public class ScanAdminController {
     public Model<List<UptownDoor>> scanQrImg(HttpParameterParser parser, PageDb pagination) throws IOException, WriterException {
         List<UptownDoor> list = uptownDoorMapper.getAllUptownDoor(pagination, parser.getMap());
         for (UptownDoor door : list) {
-            if (door.getInImg().equals("")) {
-                String img = scan_qr(door.getDoorId(),1,door.getUptownName()+door.getDoorName()+getName(1));
-                uptownDoorMapper.updateDoorQc("in_img", img, door.getDoorId());
-                door.setInImg(img);
-            }
-            if (door.getOutImg().equals("")) {
-                String img = scan_qr(door.getDoorId(),2,door.getUptownName()+door.getDoorName()+getName(2));
-                uptownDoorMapper.updateDoorQc("out_img", img, door.getDoorId());
-                door.setOutImg(img);
+            if (door.getUptownId() == 1238790987234L || door.getUptownId() == 5) {
+                if (door.getInImg().equals("")) {
+                    String img = scan_qr(door.getDoorId(),1,door.getDoorName()+getName(1));
+                    uptownDoorMapper.updateDoorQc("in_img", img, door.getDoorId());
+                    door.setInImg(img);
+                }
+                if (door.getOutImg().equals("")) {
+                    String img = scan_qr(door.getDoorId(),2, door.getDoorName()+getName(2));
+                    uptownDoorMapper.updateDoorQc("out_img", img, door.getDoorId());
+                    door.setOutImg(img);
+                }
+            } else {
+                if (door.getInImg().equals("")) {
+                    String img = scan_qr(door.getDoorId(),1,door.getUptownName()+door.getDoorName()+getName(1));
+                    uptownDoorMapper.updateDoorQc("in_img", img, door.getDoorId());
+                    door.setInImg(img);
+                }
+                if (door.getOutImg().equals("")) {
+                    String img = scan_qr(door.getDoorId(),2,door.getUptownName()+door.getDoorName()+getName(2));
+                    uptownDoorMapper.updateDoorQc("out_img", img, door.getDoorId());
+                    door.setOutImg(img);
+                }
             }
         }
         return Model.newSuccess(pagination, list);

+ 202 - 49
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -84,18 +84,27 @@ public class ScanController {
                              @RequestParam(value = "inType", required = false, defaultValue = "0") Integer inType) {
         UserOpen userOpen = homeService.getUserOpenByCode(request.getParameter("code"));
         List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1L);
-//        UserOpen userOpen = userOpenMapper.selectByUserId(1L);
+//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1234L);
+//        UserOpen userOpen = userOpenMapper.selectByUserId(1234L);
         model.put("user", userOpen);
         model.put("user_id", "\"" + userOpen.getUserId() + "\"");
         if (list.size() == 0) {
             return new ModelAndView("/user/home.ftl", model);
         } else {
+            Boolean ly = false;
             UptownDoor uptownDoor = uptownDoorMapper.getUptownDoorById(doorId);
             List<UptownHome> uptownHomes =  uptownHomeMapper.getUptownHomeByUserId(userOpen.getUserId());
             UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userOpen.getUserId());
-            model.put("door", uptownDoor.getUptownName() + uptownDoor.getDoorName());
-            model.put("doorplate", unit.getRidgepole() + "栋" + unit.getUnit() + "单元" +unit.getDoorplate() + "号");
+            if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5) {
+                model.put("tittle", "凌云集团");
+                ly = true;
+            }
+            if (ly) {
+                model.put("doorplate", unit.getRidgepole() + unit.getUnit());
+            } else {
+                model.put("doorplate", unit.getRidgepole() + "栋" + unit.getUnit() + "单元" +unit.getDoorplate() + "号");
+                model.put("door", uptownDoor.getUptownName() + uptownDoor.getDoorName());
+            }
             model.put("name", uptownHomes.get(0).getLinkman());
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             model.put("now", sdf.format(new Date()));
@@ -117,9 +126,63 @@ public class ScanController {
             if (inType == 1) {
                 OutScan outScan = outScanMapper.getOutScanByUserlimit(userOpen.getUserId());
                 if (outScan != null && new Date(outScan.getDate().getMillis() + 3600L * 1000 * 24).compareTo(new Date()) == -1) {
-                    model.put("collor", "orange");
+                    if (!ly) {
+                        model.put("collor", "orange");
+                        model.put("into", "允许进入");
+                        model.put("errorMsg", "您在外驻留时间超过1日,请尽快上报您的健康状况,防止在外长时间逗留。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
+                        return new ModelAndView("/user/scan.ftl", model);
+                    }
+                }
+                if (ly) {
+                    List<MsReport> msReports1 = msReportMapper.queryMsReportIsXG(userOpen.getUserId());
+                    if (msReports1.size() != 0) {
+                        Integer status = msReportMapper.queryLateStatus(userOpen.getUserId());
+                        if (status != 4) {
+                            model.put("collor", "red");
+                            model.put("into", "不许进入");
+                            model.put("errorMsg", "由于您是新冠确诊或新冠疑似或密切接触者,评估未解除隔离规定,禁止进入。");
+                            scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                            return new ModelAndView("/user/scan.ftl", model);
+                        }
+                    }
+                    String returnWork = msReportMapper.returnWork(userOpen.getUserId());
+                    if (returnWork != null) {
+                        List<MsReport> msReports2 = msReportMapper.returnWorkTime(returnWork, userOpen.getUserId());
+                        if (msReports2.size() < 15) {
+                            model.put("collor", "red");
+                            model.put("into", "不许进入");
+                            model.put("errorMsg", "您返回工作驻地后未满14日,不许进入。"+day15(msReports2)+"起方可进入!");
+                            scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                            return new ModelAndView("/user/scan.ftl", model);
+                        }
+                    }
+                    List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
+                    if (msReports.size() == 0) {
+                        model.put("collor", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "您最近三日未上报健康日报,请说明原因,配合监测人员。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scan.ftl", model);
+                    } else if (msReports.size() < 3) {
+                        model.put("collor", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "您最近三日健康日报漏报,请说明原因并及时填报,配合监测人员。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scan.ftl", model);
+                    }
+                    List<MsReport> msReports2 = msReportMapper.selectMsReportThereError(userOpen.getUserId());
+                    if (msReports2.size() > 0) {
+                        model.put("collor", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "由于您健康或家人健康评估存在问题,禁止进入,如有疑问请联系直管领导。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scan.ftl", model);
+                    }
+                    //您近期内离开过工作单位驻地,请遵守返回工作驻地15日隔离规定,您目前未满15日,禁止进入。
+                    model.put("collor", "green");
                     model.put("into", "允许进入");
-                    model.put("errorMsg", "您在外驻留时间超过1日,请尽快上报您的健康状况,防止在外长时间逗留。");
+                    model.put("errorMsg", "欢迎归来,请注意遵守疫情期间工作安全规则,做好防护,安全工作,健康第一。");
                     scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
                     return new ModelAndView("/user/scan.ftl", model);
                 }
@@ -139,7 +202,7 @@ public class ScanController {
                     model.put("into", "禁止外出");
                     model.put("errorMsg", "根据武汉市小区封闭管理规定,非特殊人员禁止出行!");
                     scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
-                    return new ModelAndView("/user/goOut.ftl", model);
+                    return new ModelAndView("/user/scan.ftl", model);
                 }
                 OutScan outScan = outScanMapper.getOutScanThreeday(userOpen.getUserId(), 2, outScanConf.getGoOutFre());
                 if (outScan != null) {
@@ -223,7 +286,7 @@ public class ScanController {
                 model.put("into", "禁止外出");
                 model.put("errorMsg", "根据武汉市小区封闭管理规定,非特殊人员禁止出行!");
                 scanService.saveOutScanEstate(userOpen.getUserId(), -1, model.get("errorMsg").toString());
-                return new ModelAndView("/user/goOut.ftl", model);
+                return new ModelAndView("/user/scanEstate.ftl", model);
             }
             List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
             if (msReports.size() != 3) {
@@ -276,8 +339,8 @@ public class ScanController {
     public ModelAndView goOut(HttpServletRequest request, ModelMap model) throws ParseException {
         UserOpen userOpen = homeService.getUserOpen();
         List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1L);
-//        UserOpen userOpen = userOpenMapper.selectByUserId(1L);
+//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1234L);
+//        UserOpen userOpen = userOpenMapper.selectByUserId(1234L);
         model.put("user", userOpen);
         model.put("user_id", "\"" + userOpen.getUserId() + "\"");
         if (list.size() == 0) {
@@ -285,50 +348,129 @@ public class ScanController {
         } else {
             List<UptownHome> uptownHomes =  uptownHomeMapper.getUptownHomeByUserId(userOpen.getUserId());
             UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userOpen.getUserId());
-            model.put("doorplate", unit.getUptownName() + "小区" +unit.getRidgepole() + "栋" + unit.getUnit() + "单元" +unit.getDoorplate() + "号");
-            model.put("name", uptownHomes.get(0).getLinkman());
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-            model.put("now", sdf.format(new Date()));
-            OutUser outUser = outUserMapper.getOutUserByPhone(uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
-            if (outUser != null) {
+            if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5) {
+                model.put("into", "此功能暂未开放");
+                model.put("errorMsg", "外出请佩戴口罩,避免近距离接触,不得长时间在外逗留。");
+                return  new ModelAndView("/user/goOut.ftl", model);
+            } else {
+                model.put("doorplate", unit.getUptownName() + "小区" +unit.getRidgepole() + "栋" + unit.getUnit() + "单元" +unit.getDoorplate() + "号");
+                model.put("name", uptownHomes.get(0).getLinkman());
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                model.put("now", sdf.format(new Date()));
+                OutUser outUser = outUserMapper.getOutUserByPhone(uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
+                if (outUser != null) {
+                    model.put("collor", "green");
+                    model.put("into", "允许外出");
+                    model.put("errorMsg", "外出请佩戴口罩,避免近距离接触,保生产同时注意自身安全。");
+                    return new ModelAndView("/user/goOut.ftl", model);
+                }
+                OutScanConf outScanConf = outScanConfMapper.getOutScanConfByUptown(unit.getUptownId());
+                if (outScanConf.getGoOutFre() == 0) {
+                    model.put("collor", "red");
+                    model.put("into", "禁止外出");
+                    model.put("errorMsg", "根据武汉市小区封闭管理规定,非特殊人员禁止出行!");
+                    return new ModelAndView("/user/goOut.ftl", model);
+                }
+                List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
+                if (msReports.size() == 0) {
+                    model.put("collor", "red");
+                    model.put("into", "禁止外出");
+                    model.put("errorMsg", "您近期未提交健康日报,无法判断您健康状态,请提交健康日报。");
+                    return new ModelAndView("/user/goOut.ftl", model);
+                }
+                MsReport msReport = msReportMapper.selectMsReportToday(userOpen.getUserId());
+                if (msReport != null && msReport.getMsStatus() == 2) {
+                    model.put("collor", "red");
+                    model.put("into", "禁止外出");
+                    model.put("errorMsg", "健康日报提示您存在健康问题,禁止外出,请配合。");
+                    return new ModelAndView("/user/goOut.ftl", model);
+                }
+                OutScan outScan = outScanMapper.getOutScanThreeday(userOpen.getUserId(), 2, outScanConf.getGoOutFre());
+                if (outScan != null) {
+                    model.put("collor", "red");
+                    model.put("into", "禁止外出");
+                    model.put("errorMsg", "您今日健康状态评估正常,最近可外出时间"+sdf.format(new Date(outScan.getDayDate().getTime() + 1000L  *3600*24 * outScanConf.getGoOutFre()))+
+                            ",距今日还差"+differentDays(outScan.getDayDate(), sdf.parse(sdf.format(new Date())), outScanConf.getGoOutFre())+"天。");
+                    return new ModelAndView("/user/goOut.ftl", model);
+                }
                 model.put("collor", "green");
                 model.put("into", "允许外出");
-                model.put("errorMsg", "外出请佩戴口罩,避免近距离接触,保生产同时注意自身安全。");
+                model.put("errorMsg", "外出请佩戴口罩,避免近距离接触,不得长时间在外逗留。");
                 return new ModelAndView("/user/goOut.ftl", model);
             }
-            OutScanConf outScanConf = outScanConfMapper.getOutScanConfByUptown(unit.getUptownId());
-            if (outScanConf.getGoOutFre() == 0) {
-                model.put("collor", "red");
-                model.put("into", "禁止外出");
-                model.put("errorMsg", "根据武汉市小区封闭管理规定,非特殊人员禁止出行!");
-                return new ModelAndView("/user/goOut.ftl", model);
-            }
-            List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
-            if (msReports.size() == 0) {
-                model.put("collor", "red");
-                model.put("into", "禁止外出");
-                model.put("errorMsg", "您近期未提交健康日报,无法判断您健康状态,请提交健康日报。");
-                return new ModelAndView("/user/goOut.ftl", model);
-            }
-            MsReport msReport = msReportMapper.selectMsReportToday(userOpen.getUserId());
-            if (msReport != null && msReport.getMsStatus() == 2) {
-                model.put("collor", "red");
-                model.put("into", "禁止外出");
-                model.put("errorMsg", "健康日报提示您存在健康问题,禁止外出,请配合。");
-                return new ModelAndView("/user/goOut.ftl", model);
-            }
-            OutScan outScan = outScanMapper.getOutScanThreeday(userOpen.getUserId(), 2, outScanConf.getGoOutFre());
-            if (outScan != null) {
-                model.put("collor", "red");
-                model.put("into", "禁止外出");
-                model.put("errorMsg", "您今日健康状态评估正常,最近可外出时间"+sdf.format(new Date(outScan.getDayDate().getTime() + 1000L  *3600*24 * outScanConf.getGoOutFre()))+
-                        ",距今日还差"+differentDays(outScan.getDayDate(), sdf.parse(sdf.format(new Date())), outScanConf.getGoOutFre())+"天。");
-                return new ModelAndView("/user/goOut.ftl", model);
+        }
+    }
+
+    @ApiOperation("复工查询")
+    @GetMapping("/user/returnWork.html")
+    public ModelAndView returnWork(HttpServletRequest request, ModelMap model) throws ParseException {
+        UserOpen userOpen = homeService.getUserOpen();
+        List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
+//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1234L);
+//        UserOpen userOpen = userOpenMapper.selectByUserId(1234L);
+        model.put("user", userOpen);
+        model.put("user_id", "\"" + userOpen.getUserId() + "\"");
+        if (list.size() == 0) {
+            return new ModelAndView("/user/home.ftl", model);
+        } else {
+            List<UptownHome> uptownHomes =  uptownHomeMapper.getUptownHomeByUserId(userOpen.getUserId());
+            UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userOpen.getUserId());
+            model.put("uptownId", unit.getUptownId());
+            if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5) {
+                model.put("tittle", "凌云集团");
+                model.put("doorplate", unit.getRidgepole() + unit.getUnit());
+                model.put("name", uptownHomes.get(0).getLinkman());
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                model.put("now", sdf.format(new Date()));
+                List<MsReport> msReports1 = msReportMapper.queryMsReportIsXG(userOpen.getUserId());
+                if (msReports1.size() != 0) {
+                    Integer status = msReportMapper.queryLateStatus(userOpen.getUserId());
+                    if (status != 4) {
+                        model.put("collor", "red");
+                        model.put("into", "不可复工");
+                        model.put("errorMsg", "由于您是新冠确诊或新冠疑似或密切接触者,评估未解除隔离规定,禁止进入。");
+                        return new ModelAndView("/user/returnWork.ftl", model);
+                    }
+                }
+                String returnWork = msReportMapper.returnWork(userOpen.getUserId());
+                if (returnWork != null) {
+                    List<MsReport> msReports2 = msReportMapper.returnWorkTime(returnWork, userOpen.getUserId());
+                    if (msReports2.size() < 15) {
+                        model.put("collor", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "您返回工作驻地后未满14日,不许进入。"+day15(msReports2)+"起方可进入!");
+                        return new ModelAndView("/user/returnWork.ftl", model);
+                    }
+                }
+                List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
+                if (msReports.size() == 0) {
+                    model.put("collor", "red");
+                    model.put("into", "不可复工");
+                    model.put("errorMsg", "您最近三日未上报健康日报,请说明原因,配合监测人员。");
+                    return new ModelAndView("/user/returnWork.ftl", model);
+                } else if (msReports.size() < 3) {
+                    model.put("collor", "red");
+                    model.put("into", "不可复工");
+                    model.put("errorMsg", "您最近三日健康日报漏报,请说明原因并及时填报,配合监测人员。");
+                    return new ModelAndView("/user/returnWork.ftl", model);
+                }
+                List<MsReport> msReports2 = msReportMapper.selectMsReportThereError(userOpen.getUserId());
+                if (msReports2.size() > 0) {
+                    model.put("collor", "red");
+                    model.put("into", "不可复工");
+                    model.put("errorMsg", "由于您健康或家人健康评估存在问题,禁止进入,如有疑问请联系直管领导。");
+                    return new ModelAndView("/user/returnWork.ftl", model);
+                }
+                model.put("collor", "green");
+                model.put("into", "允许复工");
+                model.put("errorMsg", "欢迎您归来,请注意遵守抗击疫情期间工作安全规定,做好健康防护,安全工作,健康第一。");
+                return new ModelAndView("/user/returnWork.ftl", model);
+                //您近期内离开过工作单位驻地,请遵守返回工作驻地15日隔离规定,您目前未满15日,禁止进入。
+            } else {
+                model.put("into", "此功能暂未开放");
+                model.put("errorMsg", "复工期间请请注意安全。");
+                return  new ModelAndView("/user/returnWork.ftl", model);
             }
-            model.put("collor", "green");
-            model.put("into", "允许外出");
-            model.put("errorMsg", "外出请佩戴口罩,避免近距离接触,不得长时间在外逗留。");
-            return new ModelAndView("/user/goOut.ftl", model);
         }
     }
 
@@ -377,6 +519,17 @@ public class ScanController {
         return time.substring(0, time.length() - 1);
     }
 
+    public String day15(List<MsReport> list) {
+        SimpleDateFormat sdf = new SimpleDateFormat("MM月dd日");
+        Date time1 = null;
+        if(list.size() == 0) {
+            time1 = new Date();
+        } else {
+            time1 = list.get(0).getReportDate();
+        }
+        return sdf.format(new Date(time1.getTime() + 1000L*3600*24*14));
+    }
+
 //    /**
 //     * 生成进出门二维码
 //     * @param doorId 小区大门ID

+ 71 - 2
whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java

@@ -67,8 +67,8 @@ public class UserOpenController {
         if (userId == 0) {
             UserOpen userOpen = homeService.getUserOpen();
             list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-//            list = userRoleMapper.getUserRoleByUserId(1225321682867105793L);
-//            UserOpen userOpen = userOpenMapper.selectByUserId(1225321682867105793L);
+//            list = userRoleMapper.getUserRoleByUserId(1234L);
+//            UserOpen userOpen = userOpenMapper.selectByUserId(1234L);
             userId = userOpen.getUserId();
             model.put("user", userOpen);
             model.put("user_id", "\"" + userOpen.getUserId() + "\"");
@@ -78,7 +78,18 @@ public class UserOpenController {
                 Long uptown_id = uptowns.get(0).getUptownId();
                 String uptown_name = uptowns.get(0).getUptownName();
                 model.put("uptown_id", "\"" + uptown_id + "\"");
+                model.put("uptownId", uptown_id);
                 model.put("uptown_name", uptown_name);
+                // 凌云集团的可以更改unit
+                if (uptown_id == 1238790987234L || uptown_id == 5L) {
+                    UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userId);
+                    model.put("ridgepole", unit.getRidgepole());
+                    model.put("unit", unit.getUnit());
+                    model.put("unitId", unit.getUnitId());
+                    model.put("doorplate", unit.getDoorplate());
+                    List<UptownHome> uptownHomes =  uptownHomeMapper.getUptownHomeByUserId(userOpen.getUserId());
+                    model.put("linkman", uptownHomes.get(0).getLinkman());
+                }
             }
 
 
@@ -86,11 +97,15 @@ public class UserOpenController {
                 return new ModelAndView("/user/home.ftl", model);
             }
             if (list.size() == 1) {
+                //今天数据,今天没有,复制最近一天的数据
                 MsReport msReport = msReportService.getReportByDateNow(userId);
                 model.put("msReport", new JsonWapper(msReport));
                 return new ModelAndView("/home/home.ftl", model);
             }
             if (list.size() == 2) {
+                //今天数据,今天没有,复制最近一天的数据
+                MsReport msReport = msReportService.getReportByDateNow(userId);
+                model.put("msReport", new JsonWapper(msReport));
                 model.put("type", 1);
                 return new ModelAndView("/user/changeRole.ftl", model);
             }
@@ -161,7 +176,18 @@ public class UserOpenController {
                 Long uptown_id = uptowns.get(0).getUptownId();
                 String uptown_name = uptowns.get(0).getUptownName();
                 model.put("uptown_id", "\"" + uptown_id + "\"");
+                model.put("uptownId", uptown_id);
                 model.put("uptown_name", uptown_name);
+                // 凌云集团的可以更改unit
+                if (uptown_id == 1238790987234L || uptown_id == 5L) {
+                    UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userId);
+                    model.put("ridgepole", unit.getRidgepole());
+                    model.put("unit", unit.getUnit());
+                    model.put("unitId", unit.getUnitId());
+                    model.put("doorplate", unit.getDoorplate());
+                    List<UptownHome> uptownHomes =  uptownHomeMapper.getUptownHomeByUserId(userId);
+                    model.put("linkman", uptownHomes.get(0).getLinkman());
+                }
             }
             if (userType == 1) {
                 MsReport msReport = msReportService.getReportByDateNow(userId);
@@ -195,6 +221,38 @@ public class UserOpenController {
         return uptownUnitMapper.getUptownUnitData(uptownId);
     }
 
+    /**
+     * 凌云集团公司信息
+     * @return
+     */
+    @GetMapping("/home/getUptownUnitLY.json")
+    public List<UptownUnit> getUptownUnitLY(HttpServletRequest request) {
+        Long uptownId = Long.parseLong(request.getParameter("uptownId"));
+        return uptownUnitMapper.getUptownUnitLY(uptownId);
+    }
+
+    /**
+     * 凌云集团更改部门
+     * @return
+     */
+    @PostMapping("/home/changeUnitId.json")
+    public void changeUnitId(ModelMap model, HttpServletRequest request) {
+        Long userId = Long.parseLong(request.getParameter("userId"));
+        Long unitId = Long.parseLong(request.getParameter("newUnitId"));
+        userOpenService.changeUnitId(userId, unitId);
+    }
+
+    /**
+     * 凌云集团更改工号
+     * @return
+     */
+    @PostMapping("/home/changeDoorplate.json")
+    public void changeDoorplate(ModelMap model, HttpServletRequest request) {
+        Long userId = Long.parseLong(request.getParameter("userId"));
+        String doorplate = request.getParameter("newDoorplate");
+        userOpenService.changeDoorplate(userId, doorplate);
+    }
+
     @PostMapping("/home/checkHouseId.json")
     public ResultModel checkHouseId(HttpServletRequest request) {
         ResultModel resultModel = new ResultModel();
@@ -242,6 +300,17 @@ public class UserOpenController {
         return new ModelAndView("/home/homeHelp.ftl", model);
     }
 
+    @GetMapping("/home/adminHelp.html")
+    public ModelAndView adminHelp(ModelMap model) {
+        return new ModelAndView("/home/adminHelp.ftl", model);
+    }
+
+    @GetMapping("/home/outHelp.html")
+    public ModelAndView outHelp(ModelMap model) {
+        return new ModelAndView("/home/outHelp.ftl", model);
+    }
+
+
     @GetMapping("/home/testOk.html")
     public ModelAndView testOk(ModelMap model, HttpServletResponse response) {
         response.setHeader("Access-Control-Allow-Credentials", "true");

+ 18 - 4
whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java

@@ -167,6 +167,16 @@ public class YeWeiHuiController {
     return new ModelAndView("/yeweihui/ribao.ftl", model);
   }
 
+  @GetMapping("/lingyun/home.html")
+  public ModelAndView lingyunRibao(ModelMap model) {
+
+//        List<QzTask> taskList = qzTaskService.selectAll();
+//
+//        model.put("taskList", YvanUtil.toJsonPretty(taskList));
+
+    return new ModelAndView("/lingyun/home.ftl", model);
+  }
+
   @GetMapping("/yeweihui/ribaoDy")
   public Model<List<SysUptownHouse>> yeweihuiRibaoDy(Long str) {
 //        String[] split = str.split("&");
@@ -253,7 +263,7 @@ public class YeWeiHuiController {
     String fileName = uptown.getUptownName();
     fileName += "上报信息-";
     fileName += date;
-    List<ExcelRiBaoLY> list = rbMapper.selectExcelRiBaoLY(upId, date);
+    List<ExcelRiBaoLY> list = rbService.selectExcelRiBaoLY(upId, date);
     ExcelUtils.writeSheet(ExcelRiBaoLY.class, list).export(resp, fileName);
 
   }
@@ -270,7 +280,7 @@ public class YeWeiHuiController {
       String fileName = uptown.getUptownName();
       fileName += "上报信息-";
       fileName += date;
-      List<ExcelRiBaoPrivate> list = rbMapper.selectExcelRiBaoPrivate(upId, date);
+      List<ExcelRiBaoPrivate> list = rbService.selectExcelRiBaoPrivate(upId, date);
       ExcelUtils.writeSheet(ExcelRiBaoPrivate.class, list).export(resp, fileName);
     }
   }
@@ -352,9 +362,13 @@ public class YeWeiHuiController {
   }
 
   @PostMapping("/yeweihui/groupBuyingCx/remark/add.json")
-  public Model groupBuyingCxRemarkAdd(@Pd(name = "jmId") Long jmId, @Pd(name = "status", required = false, defaultValue = "0") Long status, @Pd(name = "remark", required = false) String remark) {
+  public Model groupBuyingCxRemarkAdd(@Pd(name = "jmId") Long jmId,
+                                      @Pd(name = "status", required = false, defaultValue = "0") Long status,
+                                      @Pd(name = "remark", required = false) String remark,
+                                      @Pd(name = "endTime", required = false) String endTime,
+                                      @Pd(name = "deliverTime", required = false) String deliverTime) {
 
-    Integer success = jmTuangouService.updateRemarkByJmId(jmId, status, remark);
+    Integer success = jmTuangouService.updateRemarkByJmId(jmId, status, remark, endTime, deliverTime);
 
     if (success == 1) {
       return Model.newSuccess("操作成功");

+ 5 - 2
whepi-web/src/main/resources/application-xielianghe.yml

@@ -65,8 +65,11 @@ spring:
     #driverClassName: com.mysql.jdbc.Driver
     #url: jdbc:mysql://localhost:3306/bofeng_test?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
     driverClassName: net.sf.log4jdbc.DriverSpy
-    url: jdbc:log4jdbc:mysql://39.99.148.1:3306/whepi_test?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
-    username: whepi_test
+#    url: jdbc:log4jdbc:mysql://39.99.148.1:3306/whepi_test?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
+#    username: whepi_test
+#    password: 123456
+    url: jdbc:log4jdbc:mysql://localhost:3306/test?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
+    username: root
     password: 123456
 
   redis:

+ 1 - 1
whepi-web/src/main/resources/application.yml

@@ -43,7 +43,7 @@ endpoints:
 #  whitelabel.enabled: false
 
 spring:
-  profiles.active: guojing
+  profiles.active: maoyunfeng
 
   application:
     name: bofeng-web

+ 1 - 1
whepi-web/src/main/resources/mapper/BuyMapper.xml

@@ -45,7 +45,7 @@
     </select>
 
     <select id="selectCountNum" resultType="com.bofeng.entity.Buy">
-        select sum(buy_count) as count,jm_id from jm_buy where jm_id=#{jmId} and buy_status=1 GROUP BY jm_id
+        select IFNULL(sum(buy_count),0) as count from jm_buy where jm_id=#{jmId} and buy_status=1
     </select>
 
 </mapper>

+ 3 - 0
whepi-web/src/main/resources/mapper/JmTuangouMapper.xml

@@ -98,5 +98,8 @@
         select * from jm_tuangou where jm_id=#{jmId}
     </select>
 
+    <update id="updateRemarkByJmIdzbxd">
+        update jm_tuangou set remark=#{remark},tg_end_time=#{tgEndTime},tg_deliver_time=#{tgDeliverTime}, time_update=now() where jm_id=#{jmId}
+    </update>
 
 </mapper>

+ 1 - 1
whepi-web/src/main/resources/mapper/MsSuspected.xml

@@ -2,6 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.bofeng.dao.MsSuspectedMapper">
     <select id="selectByReportId" resultType="com.bofeng.entity.MsSuspected">
-        select * from ms_suspected where report_id = #{reportId}
+        select a.*,b.* from ms_suspected a left join ms_trip b on a.suspected_id=b.trip_id where a.report_id = #{reportId}
     </select>
 </mapper>

+ 7 - 0
whepi-web/src/main/resources/mapper/MsTripDet.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bofeng.dao.MsTripDetMapper">
+    <delete id="deleteByTripId">
+        delete from ms_trip_det where trip_id = #{tripId}
+    </delete>
+</mapper>

+ 20 - 0
whepi-web/src/main/resources/mapper/SweepCodeMapper.xml

@@ -38,6 +38,26 @@
         </where>
      order by c.time_update desc
     </select>
+    <select id="selectLingyunUser" resultType="com.bofeng.entity.SysUptownHouse">
+     select
+     b.user_id,
+     a.linkman,
+     a.phone,
+     e.uptown_name,
+     concat(d.ridgepole,d.unit) as dept
+     from sys_uptown_home a
+     inner join sys_user_role b on a.house_id = b.property_id and b.role_id =1
+     inner join sys_uptown_house c on c.house_id = b.property_id
+     inner join sys_uptown_unit d on c.unit_id = d.unit_id
+     inner join sys_uptown e on e.uptown_id = d.uptown_id and e.uptown_id = 1238790987234
+        <where>
+         <if test="queryProperties != null and queryProperties != ''">
+          e.uptown_name like concat('%',#{queryProperties},'%')
+          or a.linkman like concat('%',#{queryProperties},'%')
+          or a.phone like concat('%',#{queryProperties},'%')
+         </if>
+        </where>
+    </select>
     <select id="export" resultType="com.bofeng.entity.SysUptownHouse">
      select DISTINCT
      a.uptown_name,

+ 8 - 0
whepi-web/src/main/resources/mapper/UserOpen.xml

@@ -28,4 +28,12 @@
           inner join sys_uptown u on u.uptown_id = uu.uptown_id
         where u.uptown_id = #{uptownId}
     </select>
+    <select id="selectUserBaseByUserId" resultType="com.bofeng.entity.UserOpen">
+      select g.linkman,g.phone,d.ridgepole,d.unit,e.doorplate
+from sys_user_role t
+inner join sys_uptown_house e on e.house_id = t.property_id
+inner join sys_uptown_home g on g.house_id = t.property_id
+inner join sys_uptown_unit d on d.unit_id = e.unit_id
+where t.user_id = #{userId} and t.role_id =1
+    </select>
 </mapper>

BIN
whepi-web/src/main/resources/word/健康及旅居申报表_20200221.docx