Browse Source

Merge remote-tracking branch 'origin/master'

maoyunfeng 5 years ago
parent
commit
8b7af7f36a

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

@@ -132,7 +132,7 @@
     function getUptownUnitLY() {
         $.ajax({
             type: "GET",
-            url: "/home/getUptownUnitLY.json",
+            url: "/home/getUptownUnitLY.json?uptownId=" + $("#uptownId").val(),
             data: {},
             dataType: "json",
             success: function (data) {

+ 2 - 1
whepi-ui/templates/home/ribao.ftl

@@ -7,7 +7,7 @@
             <a class="weui-navbar__item" target="#rb_nav2" module="ri_bao">
                 健康日历
             </a>
-            <#if (uptownId??) && (uptownId == 11238790987234)>
+            <#if (uptownId??) && (uptownId == 11238790987234 || uptownId == 5 )>
             <a class="weui-navbar__item" target="#rb_nav3" module="ri_bao">
                 更改部门
             </a>
@@ -356,6 +356,7 @@
                     <div class="weui-panel__hd" style=" font-size: large"><span
                             id="unitMsg">${ridgepole!''}${unit!''}</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>

+ 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);

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

@@ -40,6 +40,6 @@ public interface UptownUnitMapper extends BaseMapper<UptownUnit> {
             "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 = 1238790987234")
-    List<UptownUnit> getUptownUnitLY();
+    @Select("select * from sys_uptown_unit where status = 1 and uptown_id = #{uptownId}")
+    List<UptownUnit> getUptownUnitLY(@Param("uptownId") Long uptownId);
 }

+ 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 = "";
+
 }

+ 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 - 5
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() + "\"");
@@ -81,7 +81,7 @@ public class UserOpenController {
                 model.put("uptownId", uptown_id);
                 model.put("uptown_name", uptown_name);
                 // 凌云集团的可以更改unit
-                if (uptown_id == 1238790987234L) {
+                if (uptown_id == 1238790987234L || uptown_id == 5L) {
                     UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userId);
                     model.put("ridgepole", unit.getRidgepole());
                     model.put("unit", unit.getUnit());
@@ -179,7 +179,7 @@ public class UserOpenController {
                 model.put("uptownId", uptown_id);
                 model.put("uptown_name", uptown_name);
                 // 凌云集团的可以更改unit
-                if (uptown_id == 1238790987234L) {
+                if (uptown_id == 1238790987234L || uptown_id == 5L) {
                     UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userId);
                     model.put("ridgepole", unit.getRidgepole());
                     model.put("unit", unit.getUnit());
@@ -227,7 +227,8 @@ public class UserOpenController {
      */
     @GetMapping("/home/getUptownUnitLY.json")
     public List<UptownUnit> getUptownUnitLY(HttpServletRequest request) {
-        return uptownUnitMapper.getUptownUnitLY();
+        Long uptownId = Long.parseLong(request.getParameter("uptownId"));
+        return uptownUnitMapper.getUptownUnitLY(uptownId);
     }
 
     /**

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

@@ -263,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);
 
   }
@@ -280,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);
     }
   }