Browse Source

打卡上报增加经纬度

peiguo 4 năm trước cách đây
mục cha
commit
2d1082ec3d

+ 11 - 0
admin-ui/app/whepi/lingyun/dialogDetail.js

@@ -43,6 +43,17 @@ define(function (require) {
               }
             },
             {
+              field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
+                if (value == 1) {
+                  return "<span style='color: green;'>是<span>";
+                } else if (value == 2) {
+                  return "<span style='color: red;'>否<span>";
+                } else {
+                  return "";
+                }
+              }
+            },
+            {
               field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
                 if (row.rowData.reportStatus  == 0) {
                   return "<span style='color: #ffb717;'>未上报<span>";

+ 11 - 0
admin-ui/app/whepi/lingyun/dialogDetail2.js

@@ -43,6 +43,17 @@ define(function (require) {
               }
             },
             {
+              field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
+                if (value == 1) {
+                  return "<span style='color: green;'>是<span>";
+                } else if (value == 2) {
+                  return "<span style='color: red;'>否<span>";
+                } else {
+                  return "";
+                }
+              }
+            },
+            {
               field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
                 if (row.rowData.reportStatus  == 0) {
                   return "<span style='color: #ffb717;'>未上报<span>";

+ 11 - 0
admin-ui/app/whepi/lingyun/dialogDetail7.js

@@ -43,6 +43,17 @@ define(function (require) {
               }
             },
             {
+              field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
+                if (value == 1) {
+                  return "<span style='color: green;'>是<span>";
+                } else if (value == 2) {
+                  return "<span style='color: red;'>否<span>";
+                } else {
+                  return "";
+                }
+              }
+            },
+            {
               field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
                 if (row.rowData.reportStatus == 0) {
                   return "<span style='color: #ffb717;'>未上报<span>";

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

@@ -344,6 +344,17 @@ define(function (require) {
                     {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
                     {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
                     {
+                      field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
+                        if (value == 1) {
+                          return "<span style='color: green;'>是<span>";
+                        } else if (value == 2) {
+                          return "<span style='color: red;'>否<span>";
+                        } else {
+                          return "";
+                        }
+                      }
+                    },
+                    {
                       field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
                         if (value == 1) {
                           return "<span style='color: green;'>允许复工<span>";

+ 11 - 0
admin-ui/app/whepi/lingyun/lingyunUser2.js

@@ -320,6 +320,17 @@ define(function (require) {
                     {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
                     {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
                     {
+                      field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
+                        if (value == 1) {
+                          return "<span style='color: green;'>是<span>";
+                        } else if (value == 2) {
+                          return "<span style='color: red;'>否<span>";
+                        } else {
+                          return "";
+                        }
+                      }
+                    },
+                    {
                       field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
                         if (value == 1) {
                           return "<span style='color: green;'>允许复工<span>";

+ 11 - 0
admin-ui/app/whepi/lingyun/lingyunUser7.js

@@ -341,6 +341,17 @@ define(function (require) {
                     {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
                     {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
                     {
+                      field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
+                        if (value == 1) {
+                          return "<span style='color: green;'>是<span>";
+                        } else if (value == 2) {
+                          return "<span style='color: red;'>否<span>";
+                        } else {
+                          return "";
+                        }
+                      }
+                    },
+                    {
                       field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
                         if (value == 1) {
                           return "<span style='color: green;'>允许复工<span>";

+ 2 - 0
whepi-doc/mrsb.sql

@@ -14,6 +14,8 @@ CREATE TABLE ms_report  (
   report_date       date                                                    COMMENT '上报日期',
   report_status     int(11) NOT NULL DEFAULT 0                              COMMENT '上报状态:0草稿,1正常',
   ms_status         int(11) NOT NULL DEFAULT 1                              COMMENT '健康状态:1正常,2异常',
+  longitude         varchar(20)  NOT NULL DEFAULT ''                        COMMENT '经度',
+  latitude          varchar(20)  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 '修改人',

+ 1 - 3
whepi-ui/templates/home/getLocation.js

@@ -19,7 +19,7 @@ function getLocation() {
 
       var geocoder = new qq.maps.Geocoder({
         complete: function (result) {
-          alert(JSON.stringify(result.detail.addressComponents));
+          // alert(JSON.stringify(result.detail.addressComponents));
           if ('武汉市' === result.detail.addressComponents.city) {
             autoLocal = '武汉市';
             //今晚驻地
@@ -63,8 +63,6 @@ function getLocation() {
       var coord = new qq.maps.LatLng(res.latitude, res.longitude)
       longitude = res.longitude;
       latitude = res.latitude;
-      alert(longitude)
-      alert(latitude)
       $("#commit").removeAttr("disabled",true).css("pointer-events","");
       $("#commit").css("background-color","#1AAD19").css("color","#FFFFFF");
       $("#dingwei").hide();

+ 2 - 0
whepi-ui/templates/home/ribao.js

@@ -1584,6 +1584,8 @@ function ribaoCommit() {
     "autoAddr": autoAddr,
     "isTrip": isTrip,
     "tripDet": listcx,
+    "longitude": longitude,
+    "latitude": longitude,
   };
 
   //loading

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

@@ -253,4 +253,9 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
             "and (b.temperature<35 or b.temperature>37.3 or b.cough>0 or b.muscle>0 or b.dyspnea>0 or b.fatigue>0 or b.diarrhea>0)\n" +
             "and a.report_date>date_add(NOW(), interval -1 MONTH)")
     List<MsSuspected> selectSymptomNum(@Param("userId") Long userId);
+
+    // 获取最近两天打开的经纬度
+    @Select("SELECT * FROM ms_report where user_create = #{userId} and report_date > date_sub(curdate(),interval 2 day) " +
+            "and longitude != \"\" and latitude !=\"\" order by report_date desc")
+    List<MsReport> selectLatelyLocal(@Param("userId") Long userId);
 }

+ 15 - 2
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoLYBM4.java

@@ -48,14 +48,13 @@ public class ExcelRiBaoLYBM4 {
     private int isContact = 0;
     private int isSuspected = 0;
     private int returnWork = 0;
+    private int living;
 
     private Date reportDate;
     private int msStatus;
 
     private Long userId;
 
-
-
     @ExcelProperty(value = "部门名称", index = 1)
     private String loudong = "";
 
@@ -390,6 +389,20 @@ public class ExcelRiBaoLYBM4 {
     @ExcelProperty(value = "出行详细", index = 13)
     private String tripDetDesc = "";
 
+    public String getLivingDesc() {
+        if (living == 1) {
+            livingDesc = "是";
+        } else if (living == 2) {
+            livingDesc = "否";
+        } else {
+            return "";
+        }
+        return livingDesc;
+    }
+
+    @ExcelProperty(value = "居家2公里", index = 14)
+    private String livingDesc = "";
+
     @ExcelProperty(value = "密切接触人员", index = 8)
     private String isContactDesc = "";
 

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

@@ -59,6 +59,14 @@ public class MsReport {
     @TableField("ms_status")
     private Integer msStatus;
 
+    @ApiModelProperty("经度")
+    @TableField("longitude")
+    private String longitude;
+
+    @ApiModelProperty("纬度")
+    @TableField("latitude")
+    private String latitude;
+
     @TableField("user_create")
     private Long userCreate;
 

+ 33 - 16
whepi-web/src/main/java/com/bofeng/service/MsTripService.java

@@ -45,7 +45,7 @@ public class MsTripService {
     public Long addSuspectedTrip(Long suspectedId, String userName, Integer grender, Integer age, String familyStatus,
                                  String statusDesp, Integer medical,Integer medicalState, 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 isContact, Integer isSuspected, Integer workLocal, String workLocalOther, Integer todayLocal, String todayLocalOther, String autoLocal, String autoAddr, Integer isTrip, List<MsTripDet> listTripDet) {
+            , Integer isContact, Integer isSuspected, Integer workLocal, String workLocalOther, Integer todayLocal, String todayLocalOther, String autoLocal, String autoAddr, Integer isTrip, List<MsTripDet> listTripDet, String longitude, String latitude) {
         Long reportId = 0L;
         //如果是当前日期 已经添加
         Date t = new Date();
@@ -70,6 +70,8 @@ public class MsTripService {
             msReport.setTimeCreate(DateTime.now());
             msReport.setUserUpdate(userCreate);
             msReport.setTimeUpdate(DateTime.now());
+            msReport.setLatitude(latitude);
+            msReport.setLongitude(longitude);
             msReportMapper.insert(msReport);
             reportId = msReport.getReportId();
         } else {
@@ -79,34 +81,43 @@ public class MsTripService {
         //判断是否疑似
         Integer suspectedStatus = 0;
         //确诊
-        if (medical == 1)
+        if (medical == 1) {
             suspectedStatus = 1;
+        }
         //隔离
-        if (singleRoom == 1)
+        if (singleRoom == 1) {
             suspectedStatus = 1;
+        }
         //体温
-        if (Conv.NFloat(temperature) < Conv.NFloat(35) || Conv.NFloat(temperature) > Conv.NFloat(37.3))
+        if (Conv.NFloat(temperature) < Conv.NFloat(35) || Conv.NFloat(temperature) > Conv.NFloat(37.3)) {
             suspectedStatus = 1;
+        }
         //咳嗽
-        if (cough > 0)
+        if (cough > 0) {
             suspectedStatus = 1;
+        }
         //肌肉酸痛
-        if (muscle > 0)
+        if (muscle > 0) {
             suspectedStatus = 1;
+        }
         //呼吸困难
-        if (dyspnea > 0)
+        if (dyspnea > 0) {
             suspectedStatus = 1;
+        }
         //乏力
-        if (fatigue > 0)
+        if (fatigue > 0) {
             suspectedStatus = 1;
+        }
         //腹泻
-        if (diarrhea > 0)
+        if (diarrhea > 0) {
             suspectedStatus = 1;
+        }
         if (suspectedId == 0L) {
             //判断家人是否同名
             List<MsSuspected> list = msSuspectedMapper.selectUserNameNum(reportId, userName, reportDate);
-            if (list != null && list.size() > 0)
+            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);
@@ -189,11 +200,13 @@ public class MsTripService {
             //判断家人是否同名
             List<MsSuspected> list = msSuspectedMapper.selectUserNameNum(reportId, userName, reportDate);
             if (list != null && list.size() > 0) {
-                if (list.size() > 1)
+                if (list.size() > 1) {
                     return 2L;
+                }
                 else {
-                    if (list.get(0).getSuspectedId().longValue() != suspectedId.longValue())
+                    if (list.get(0).getSuspectedId().longValue() != suspectedId.longValue()) {
                         return 2L;
+                    }
                 }
             }
             //判断是否出行
@@ -202,8 +215,9 @@ public class MsTripService {
             if (unit != null) {
                 if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5 || unit.getUptownId() == 100000002L) {
                     Integer rezuitNum = msReportService.addReportLy(userCreate, isTrip, todayLocal, todayLocalOther);
-                    if (rezuitNum == 4)
+                    if (rezuitNum == 4) {
                         return 4L;
+                    }
                 }
             }
 
@@ -306,18 +320,21 @@ public class MsTripService {
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public Integer addReportTest(Long userCreate, String reportDate) {
         List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
-        if (listReport == null || listReport.size() == 0)
+        if (listReport == null || listReport.size() == 0) {
             return 0;
+        }
 
         //判断体温是否填写
         List<MsSuspected> listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
-        if (listSuspected == null || listSuspected.size() == 0)
+        if (listSuspected == null || listSuspected.size() == 0) {
             return 3;
+        }
         else {
             for (MsSuspected msSuspected : listSuspected) {
                 //体温是否填写
-                if (msSuspected.getTemperature().compareTo(new BigDecimal(0)) == 0)
+                if (msSuspected.getTemperature().compareTo(new BigDecimal(0)) == 0) {
                     return 2;
+                }
 
                 //如果是凌云,判断出行是否填写异常
                 UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userCreate);

+ 39 - 4
whepi-web/src/main/java/com/bofeng/service/SweepCodeService.java

@@ -2,10 +2,7 @@ package com.bofeng.service;
 
 
 import com.bofeng.JwtHelper;
-import com.bofeng.dao.MsSuspectedMapper;
-import com.bofeng.dao.OutScanEstateMapper;
-import com.bofeng.dao.RbMapper;
-import com.bofeng.dao.SweepCodeMapper;
+import com.bofeng.dao.*;
 import com.bofeng.entity.*;
 import com.yvan.PageDb;
 import com.yvan.platform.StringUtils;
@@ -36,6 +33,8 @@ public class SweepCodeService {
     private MsReportService msReportService;
     @Autowired
     private ScanService scanService;
+    @Autowired
+    private MsReportMapper msReportMapper;
 
     public List<SysUptownHouse> selectCode(PageDb pageDb, Map<String, Object> queryParam) {
         List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.selectCode(pageDb,queryParam);
@@ -89,6 +88,18 @@ public class SweepCodeService {
                 }
                 // 复工
                 excelRiBaoLYBM4.setReturnWork(scanService.returnWorkLYlist(excelRiBaoLYBM4.getUserId(), excelRiBaoLYBM4.getLinkman(), excelRiBaoLYBM4.getPhone()));
+                // 昨天定位和今天定位是否2公里
+                List<MsReport> msReports = msReportMapper.selectLatelyLocal(userId);
+                if (msReports.size() == 2) {
+                    Double dis = scanService.getDistance(Double.parseDouble(msReports.get(1).getLongitude()),Double.parseDouble(msReports.get(1).getLatitude()),Double.parseDouble(msReports.get(0).getLongitude()), Double.parseDouble(msReports.get(0).getLatitude()));
+                    if (dis <= 2000) {
+                        excelRiBaoLYBM4.setLiving(1);
+                    } else {
+                        excelRiBaoLYBM4.setLiving(2);
+                    }
+                } else {
+                    excelRiBaoLYBM4.setLiving(0);
+                }
             }
         }
         return sysUptownHouses;
@@ -197,6 +208,18 @@ public class SweepCodeService {
                     }
                     excelRiBaoLYBM4.setTripDetDesc(tripDet.substring(0, tripDet.length() - 1));
                 }
+                // 昨天定位和今天定位是否2公里
+                List<MsReport> msReports = msReportMapper.selectLatelyLocal(userId);
+                if (msReports.size() == 2) {
+                    Double dis = scanService.getDistance(Double.parseDouble(msReports.get(1).getLongitude()),Double.parseDouble(msReports.get(1).getLatitude()),Double.parseDouble(msReports.get(0).getLongitude()), Double.parseDouble(msReports.get(0).getLatitude()));
+                    if (dis <= 2000) {
+                        excelRiBaoLYBM4.setLiving(1);
+                    } else {
+                        excelRiBaoLYBM4.setLiving(2);
+                    }
+                } else {
+                    excelRiBaoLYBM4.setLiving(0);
+                }
             }
         }
         return sysUptownHouses;
@@ -253,6 +276,18 @@ public class SweepCodeService {
                         excelRiBaoLYBM4.setReturnWorkMsg("禁止复工");
                     }
                 }
+                // 昨天定位和今天定位是否2公里
+                List<MsReport> msReports = msReportMapper.selectLatelyLocal(userId);
+                if (msReports.size() == 2) {
+                    Double dis = scanService.getDistance(Double.parseDouble(msReports.get(1).getLongitude()),Double.parseDouble(msReports.get(1).getLatitude()),Double.parseDouble(msReports.get(0).getLongitude()), Double.parseDouble(msReports.get(0).getLatitude()));
+                    if (dis <= 2000) {
+                        excelRiBaoLYBM4.setLiving(1);
+                    } else {
+                        excelRiBaoLYBM4.setLiving(2);
+                    }
+                } else {
+                    excelRiBaoLYBM4.setLiving(0);
+                }
             }
         }
         return sysUptownHouses;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 19 - 20
whepi-web/src/main/java/com/bofeng/wx/controller/MsTripController.java