maoyunfeng 5 years ago
parent
commit
4116041cc0

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

@@ -57,9 +57,9 @@
 
         var uptownId = $("#uptownId").val();
         if (uptownId == '1238790987234')
-            $('#none')[0].style.display = '';
+            $('#ribao_trip')[0].style.display = 'none';
         else
-            $('#none')[0].style.display = 'none';
+            $('#ribao_trip')[0].style.display = '';
         ribao_init();
         qiuzhu_init();
         family_init();

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

@@ -190,7 +190,7 @@
                         <input id="js_input_score_histroy" type="text" hidden="hidden"/>
                         <input id="js_input_score" type="text" hidden="hidden"/>
                     </div>
-                    <div id="ribao" class="weui-btn-area"><#--style="display: none"-->
+                    <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="请选择"

File diff suppressed because it is too large
+ 1519 - 1379
whepi-ui/templates/home/ribao.js


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

@@ -41,7 +41,7 @@ public interface MsSuspectedMapper extends BaseMapper<MsSuspected> {
     MsSuspected selectAddSuspected(@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}")
+    @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}")

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

@@ -182,4 +182,7 @@ public class MsSuspected {
 
     @TableField(exist = false)
     private Integer isTrip ;
+
+    @TableField(exist = false)
+    private String tripDet ;
 }

+ 68 - 3
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -6,7 +6,9 @@ import com.bofeng.dao.MsReportMapper;
 import com.bofeng.dao.MsSuspectedMapper;
 import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsSuspected;
+import com.bofeng.entity.MsTripDet;
 import com.bofeng.entity.UserOpen;
+import org.apache.commons.lang3.tuple.Triple;
 import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -37,7 +39,27 @@ public class MsReportService {
     private MsSuspectedService msSuspectedService;
 
     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.getEndLocalOther()) + ",";
+                        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,15 +68,58 @@ 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.getEndLocalOther()) + ",";
+                            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) {
         //根据昨天的获取今天的
@@ -292,7 +357,7 @@ public class MsReportService {
             msReport1.setUserUpdate(count);
             msReport1.setTimeUpdate(DateTime.now());
             count += msReportMapper.insert(msReport1);
-            if (count> 250) {
+            if (count > 250) {
                 break;
             }
         }

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

@@ -87,10 +87,10 @@ public class MsReportController {
 
     //查询出行详细
     @GetMapping("/home/selectTripSuspected")
-    public List<MsTripDet> selectTripSuspected(HttpServletRequest request) {
+    public Model<List<MsTripDet>> selectTripSuspected(HttpServletRequest request) {
         //初始化今日日报
         Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
-        return msSuspectedService.selectTripSuspected(suspectedId);
+        return Model.newSuccess(msSuspectedService.selectTripSuspected(suspectedId));
     }
 
     //删除家人病例

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

@@ -68,7 +68,7 @@ public class MsTripController {
             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);
+                msTripDet.setSort(i+1);
                 msTripDet.setStartLocal(Integer.parseInt(mm.get("startLocal").toString()));
                 msTripDet.setStartLocalOther(mm.get("startLocalOther").toString());
                 msTripDet.setEndLocal(Integer.parseInt(mm.get("endLocal").toString()));