Prechádzať zdrojové kódy

如果定位信息发生变更就必须重填写出行

peiguo 4 rokov pred
rodič
commit
9a987f70fc

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

@@ -53,6 +53,7 @@
     var latitude = '';
     var userFamilyStatus = '';
     var userFamilyStatusStr = '';
+    var oldAutoLocal = '';
     <#include "/home/ribao.js" />
     <#include "/home/qiuzhu.js" />
     <#include "/home/getLocation.js" />

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

@@ -1301,6 +1301,16 @@ function ribaoCommit() {
       return;
     }
   }
+  if (listcx.length > 0 && autoLocal == "") {
+    autoLocal = listcx[0].endlocalStr
+    if (autoLocal.indexOf("市") < 0) {
+      autoLocal = autoLocal + "市";
+    }
+  }
+  if (oldAutoLocal != "" && autoLocal != "" && oldAutoLocal != autoLocal) {
+    $.alert("请先确定是否离开工作驻地");
+    return;
+  }
   // if (autoLocal == '') {
   //   cantijiao = true;
   //   $.alert("请先设置微信获取当前位置");
@@ -1371,7 +1381,7 @@ function ribaoCommit() {
   var medical = $("input[name='radio']:checked").val();
   if (medical == undefined) {
     cantijiao = true;
-    $.alert("请选择新冠肺炎");
+    $.alert("请选择本人身体情况");
     return;
   }
 
@@ -1379,7 +1389,7 @@ function ribaoCommit() {
   if(medical == 1){
     if(medicalState == undefined){
       cantijiao = true;
-      $.alert("请选择新冠现象");
+      $.alert("请选择本人身体情况");
       return;
     }
   }
@@ -1749,6 +1759,7 @@ function updateSuspected(suspectedId) {
         getLocation();
 
         var suspected = data;
+        oldAutoLocal = data.autoLocal
         $("#suspectedId").val(suspected.suspectedId);
         $("#js_input_user_sex").val(getGreder(suspected.grender));
         $("#js_input_user_sex").attr("data-values", suspected.grender);

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

@@ -2,7 +2,6 @@ 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;
@@ -64,4 +63,9 @@ public interface MsSuspectedMapper extends BaseMapper<MsSuspected> {
 
     @Select("select * from ms_trip_det  where trip_id =#{suspectedId}")
     List<MsTripDet> selectTripSuspected(@Param("suspectedId") Long suspectedId);
+
+    //获取最近的定位
+    @Select("SELECT a.*,c.auto_local 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 a.report_status = 1 AND a.user_create = #{userId} and c.auto_local != '' ORDER BY a.report_date DESC LIMIT 1")
+    MsSuspected selectLatelyAutoLocal(@Param("userId") Long userId);
 }

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

@@ -235,4 +235,7 @@ public class MsSuspected {
 
     @TableField(exist = false)
     private Date reportDate ;
+
+    @TableField(exist = false)
+    private String autoLocal ;
 }

+ 11 - 3
whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java

@@ -4,13 +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.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;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -44,6 +41,17 @@ public class MsSuspectedService {
         return msSuspectedMapper.selectBySuspectedId(suspectedId);
     }
 
+    //获取最近的定位
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public String getLatelyAutoLocal(long userId) {
+        MsSuspected msSuspected = msSuspectedMapper.selectLatelyAutoLocal(userId);
+        if (msSuspected != null) {
+            return msSuspected.getAutoLocal();
+        } else {
+            return "";
+        }
+    }
+
     //查询家人
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public List<MsTripDet> selectTripSuspected(long suspectedId) {

+ 3 - 1
whepi-web/src/main/java/com/bofeng/wx/controller/MsReportController.java

@@ -86,7 +86,9 @@ public class MsReportController {
     public MsSuspected selectSuspected(HttpServletRequest request) {
         //初始化今日日报
         Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
-        return msSuspectedService.selectSuspected(suspectedId);
+        MsSuspected msSuspected = msSuspectedService.selectSuspected(suspectedId);
+        msSuspected.setAutoLocal(msSuspectedService.getLatelyAutoLocal(msSuspected.getUserCreate()));
+        return msSuspected;
     }
 
     //查询出行详细