lange před 5 roky
rodič
revize
8734fc024f

+ 129 - 109
admin-ui/app/whepi/lingyun/lingyunUser.js

@@ -1,121 +1,141 @@
 define(function (require) {
-        return function (context) {
+    return function (context) {
 
-            var $grid1, $form;
+      var $grid1, $form;
 
-            // 输入搜索文本后点击回车按钮查询列表
-            function enterQueryGrid1(e) {
-                if (e.keyCode === 13) {
-                    var tmp = $(this).val();
-                    $form.formSet({queryProperties: tmp});
-                    queryGrid1();
-                }
-            }
+      // 输入搜索文本后点击回车按钮查询列表
+      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);
+      }
 
-            // 检索条件查询
-            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 queryToolbar = {
+      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: '用户管理',
+                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);
-                        }
+                  {
+                    text: '生成健康及旅居申请表', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+                      var row = $grid1.checkedData();
+                      if (row.length == 0) {
+                        $.yvan.msg('请至少选择一行数据');
+                        return;
+                      }
+                      var ids = "";
+                      for (var i = 0; i < row.length; i++) {
+                        ids += row[i].userId + ","
+                      }
+                      ids=ids.substring(0,ids.length-1);
+                      window.open(api('/export/lyReports?userId=' + ids));
                     }
-                ]
-            };
-
-            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 () {
-
-                                        }
-                                    }
+                  },
+                  {
+                    text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+                      var row = $grid1.checkedData();
+                      if (row.length == 0) {
+                        $.yvan.msg('请至少选择一行数据');
+                        return;
+                      }
+                      var ids = "";
+                      for (var i = 0; i < row.length; i++) {
+                        ids += row[i].userId + ","
+                      }
+                      ids=ids.substring(0,ids.length-1);
+                      window.open(api('/export/lyApproves?userId=' + ids));
+                    }
+                  }
 
-                                ]
-                            },
-                            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',},
+                ]
+              },
+              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',},
 
-                                    ]
-                                ]
-                        }
-                }
-            };
-        };
-    }
+                  ]
+                ]
+            }
+        }
+      };
+    };
+  }
 );

binární
temp/%E5%81%A5%E5%BA%B7%E5%8F%8A%E6%97%85%E5%B1%85%E7%94%B3%E6%8A%A5%E8%A1%A8.docx


binární
temp/%E9%9A%94%E7%A6%BB%E4%BA%BA%E5%91%98%E8%A7%A3%E9%99%A4%E9%9A%94%E7%A6%BB%E5%AE%A1%E6%89%B9%E8%A1%A8.docx


+ 136 - 77
whepi-web/src/main/java/com/bofeng/controller/EpiLYExportController.java

@@ -35,8 +35,7 @@ public class EpiLYExportController {
     @GetMapping("/whepi/export/lyReport")
     public @ResponseBody
     void exportSellPlan(HttpServletRequest request, HttpServletResponse response) {
-        //Long userId = Long.parseLong(request.getParameter("1234"));
-        Long userId = 1234L;
+        Long userId = Long.parseLong(request.getParameter("userId"));
         String userName = "", workPlace = "", telPhone = "", isLeave = "", trip = "", blackTime = "", veicle = "", otherSymptom = "", isTrue = "";
         //用户姓名,电话
         UserOpen userOpen = userOpenMapper.selectUserBaseByUserId(userId);
@@ -58,14 +57,16 @@ public class EpiLYExportController {
         List<MsTrip> listMsTrip = msReportMapper.select15TripByUserId(userId);
         if (listMsTrip != null && listMsTrip.size() > 0) {
             for (MsTrip msTrip2 : listMsTrip) {
-                trip += msReportService.getLocalOther(msTrip2.getTodayLocal(), msTrip2.getTodayLocalOther()) + ",";
+                if (msReportService.getLocalOther(msTrip2.getTodayLocal(), msTrip2.getTodayLocalOther()) != "")
+                    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();
+            SimpleDateFormat sj = new SimpleDateFormat("yyyy-MM-dd");
+            blackTime = sj.format(msReport.getReportDate());
             //返回交通工具
             List<MsTripDet> listMsTripDet = msReportMapper.selectBackTripByReportrId(msReport.getReportId());
             if (listMsTripDet != null && listMsTripDet.size() > 0) {
@@ -87,8 +88,8 @@ public class EpiLYExportController {
         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));
+            rt.put("d" + i, msReportService.getTimeByDate(i - 5));
+            rt.put("t" + i, msReportService.getTemperature(userId, i - 5));
         }
 
         //是否有其他症状
@@ -113,33 +114,81 @@ public class EpiLYExportController {
     @GetMapping("/whepi/export/lyReports")
     public @ResponseBody
     void exportSellPlan2(HttpServletRequest request, HttpServletResponse response) {
-
+        String userIds = request.getParameter("userId");
+        String[] listUserId = userIds.split(",");
         List<Map<String, Object>> list = Lists.newArrayList();
-        for (int i = 0; i < 5; i++) {
+        for (String userStringId : listUserId) {
+            Long userId = Long.parseLong(userStringId);
+            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) {
+                    if (msReportService.getLocalOther(msTrip2.getTodayLocal(), msTrip2.getTodayLocalOther()) != "")
+                        trip += msReportService.getLocalOther(msTrip2.getTodayLocal(), msTrip2.getTodayLocalOther()) + ",";
+                }
+                trip = trip.substring(0, trip.length() - 1);
+            }
+            //返回时间
+            MsReport msReport = msReportMapper.selectBackTripByUserId(userId);
+            if (msReport != null) {
+                SimpleDateFormat sj = new SimpleDateFormat("yyyy-MM-dd");
+                blackTime = sj.format(msReport.getReportDate());
+                //返回交通工具
+                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", "张山");
-            map.put("workPlace", "武汉");
-            map.put("telPhone", "13245452345");
-            map.put("isLeave", "是");
-            map.put("trip", "北京、上海、武汉");
-            map.put("backTime", "2020-03-10");
-            map.put("vehicle", "火箭");
+            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);
-            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", "否");
+            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);
             list.add(map);
         }
         WordUtils.exportWord("word/健康及旅居申报表_20200221.docx", "temp", "健康及旅居申报表.docx", list, request, response);
@@ -149,10 +198,8 @@ public class EpiLYExportController {
     @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="";
+        Long userId = Long.parseLong(request.getParameter("userId"));
+        String userName = "", org = "", gander = "", bAddr = "", backDate = "", otherSymptom = "";
         //用户姓名,部门
         UserOpen userOpen = userOpenMapper.selectUserBaseByUserId(userId);
         if (userOpen != null) {
@@ -160,18 +207,22 @@ public class EpiLYExportController {
             org = userOpen.getRidgepole() + userOpen.getUnit();
         }
         //性别
-        MsSuspected msSuspected = msReportMapper.selectGrenderUserId(userId);
-        if (msSuspected != null) {
-            if (msSuspected.getGrender() == 1)
+        //性别
+        List<MsSuspected> ListMsSuspected = msReportMapper.selectGrenderUserId(userId);
+        if(ListMsSuspected!=null && ListMsSuspected.size()>1)
+            return;
+        if (ListMsSuspected!=null && ListMsSuspected.size()==1){
+            if (ListMsSuspected.get(0).getGrender() == 1)
                 gander = "男";
-            if (msSuspected.getGrender() == 2)
+            if (ListMsSuspected.get(0).getGrender() == 2)
                 gander = "女";
         }
 
         //返回时间
         MsReport msReport = msReportMapper.selectBackTripByUserId(userId);
         if (msReport != null) {
-            backDate = msReport.getReportDate().toString();
+            SimpleDateFormat sj = new SimpleDateFormat("yyyy-MM-dd");
+            backDate = sj.format(msReport.getReportDate());
             bAddr = msReportService.getLocalOther(msReport.getTodayLocal(), msReport.getTodayLocalOther());
         }
         Map<String, Object> map = new HashMap<String, Object>();
@@ -185,8 +236,8 @@ public class EpiLYExportController {
         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));
+            rt.put("d" + i, msReportService.getTimeByDate(i - 15));
+            rt.put("t" + i, msReportService.getTemperature(userId, i - 15));
         }
 
         List<MsSuspected> listSuspected1 = msReportMapper.selectOtherSymptomByReportrId(userId);
@@ -204,49 +255,57 @@ public class EpiLYExportController {
     public @ResponseBody
     void lyApproves(HttpServletRequest request, HttpServletResponse response) {
 
+        String userIds = request.getParameter("userId");
+        String[] listUserId = userIds.split(",");
         List<Map<String, Object>> list = Lists.newArrayList();
-        for (int i = 0; i < 5; i++) {
+        for (String userStringId : listUserId) {
+            Long userId = Long.parseLong(userStringId);
+            String userName = "", org = "", gander = "", bAddr = "", backDate = "", otherSymptom = "";
+            //用户姓名,部门
+            UserOpen userOpen = userOpenMapper.selectUserBaseByUserId(userId);
+            if (userOpen != null) {
+                userName = userOpen.getLinkman();
+                org = userOpen.getRidgepole() + userOpen.getUnit();
+            }
+            //性别
+            List<MsSuspected> ListMsSuspected = msReportMapper.selectGrenderUserId(userId);
+            if(ListMsSuspected!=null && ListMsSuspected.size()>1)
+                return;
+            if (ListMsSuspected!=null && ListMsSuspected.size()==1){
+                if (ListMsSuspected.get(0).getGrender() == 1)
+                    gander = "男";
+                if (ListMsSuspected.get(0).getGrender() == 2)
+                    gander = "女";
+            }
+
+            //返回时间
+            MsReport msReport = msReportMapper.selectBackTripByUserId(userId);
+            if (msReport != null) {
+                SimpleDateFormat sj = new SimpleDateFormat("yyyy-MM-dd");
+                backDate = sj.format(msReport.getReportDate());
+                bAddr = msReportService.getLocalOther(msReport.getTodayLocal(), msReport.getTodayLocalOther());
+            }
             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.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);
-            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", "无");
+            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);
             list.add(map);
         }
 

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

@@ -117,7 +117,7 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
 
     //性别
     @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);
+    List<MsSuspected> selectGrenderUserId(@Param("userId") Long userId);
 
 
     /**