lange hace 5 años
padre
commit
844358b6fb

+ 77 - 6
whepi-ui/templates/home/ribao.js

@@ -409,8 +409,6 @@ function selectinput6(obj) {
 }
 
 //添加出行详情
-
-
 function insertlingyun() {
   var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
   if (sf == 0 || sf == 3) {
@@ -458,6 +456,7 @@ function insertlingyun() {
       $.alert("请填写出发地");
       return;
     }
+    person.startLocal = 4;
     person.startLocalOther = $('#js_input_cfdq').val();
     person.startLocalStr = $('#js_input_cfdq').val();
   } else if (cfd != 4 && cfd != 0) {
@@ -485,6 +484,7 @@ function insertlingyun() {
       $.alert("请填写目的地");
       return;
     }
+    person.endLocal = 4;
     person.endLocalOther = $('#js_input_mddq').val();
     person.endlocalStr = $('#js_input_mddq').val();
   } else if (mdd != 4 && mdd != 0) {
@@ -547,7 +547,7 @@ function tab() {
     html += "<td style='text-align: center;' >" + listcx[i].endlocalStr + " </td>";
     html += "<td style='text-align: center;' >" + listcx[i].tripTypeStr + " </td>";
     html += "<td style='text-align: center;' >" + listcx[i].tripTypeDesp + " </td>";
-    html += "<td style='text-align: center;' ><button value=" + i + " style='height:3vh;background-color: red;text-align: center; with:60%' class='weui-btn weui-btn_mini weui-btn_primary' onclick='splice(this.value)'>" + "删除" + " </button></td>";
+    html += "<td style='text-align: center;' ><button value=" + i + " style='height:5vh;background-color: red;text-align: center; with:60%' class='weui-btn weui-btn_mini weui-btn_primary' onclick='splice(this.value)'>" + "删除" + " </button></td>";
 
     html += "</tr>";
     $("#tabtr").html(html);
@@ -593,6 +593,7 @@ function ribao_refrash() {
     },
     type: 'GET',
     success: function (data) {
+      // alert(data.data);
       console.log(data);
       if (data.data == undefined) {
         $('#rb_family').empty();
@@ -670,10 +671,14 @@ function ribao_cell(v) {
   if (v.isTrip != undefined)
     isTrip = "是否出行:" + getIsTrip(v.isTrip) + ";"
 
+  var tripDet = "";
+  if (v.tripDet != undefined)
+    tripDet = "出行详细:" + v.tripDet + ";"
+
   $('#rb_family').append($('<div class="weui-media-box weui-media-box_text" style="height: 15vh">\n' +
     '                                      <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #bc4246" onclick=\'deleteSuspected(' + JSON.stringify(v.suspectedId) + ')\'>删除</a>\n' +
     '                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #2a62bc" onclick=\'updateSuspected(' + JSON.stringify(v.suspectedId) + ')\'>修改</a></h4>\n' +
-    '                                      <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + workLocal + todayLocal + isTrip + '</p>\n' +
+    '                                      <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + workLocal + todayLocal + isTrip + tripDet + '</p>\n' +
     '                                    </div>\n' +
     '                              '));
 }
@@ -822,6 +827,7 @@ function ribao_add() {
           $("#js_input_sf").val(getIsTrip(0));
           $("#js_input_sf").attr("data-values", 0);
           $('#none')[0].style.display = 'none';
+          $('#tabtr').empty();
           // $("#suspectedId").val("");
           // $("#js_input_gzzd").val("");
           // $("#js_input_jrszd").val("");
@@ -1194,7 +1200,39 @@ function updateSuspected(suspectedId) {
             "suspectedId": suspectedId
           },
           success: function (data) {
-            alert(data);
+            var xxIds = [];
+            var xxName = [
+              "序号",
+              "出发地",
+              "目的地",
+              "出行方式",
+              "车次/航班/车牌",
+              "操作"
+            ];
+            for (var i = 0; i < xxName.length; i++) {
+              xxIds.push({
+                name: xxName[i]
+              });
+            }
+            $('#tabtr').empty();
+            var html = "<tr style='background-color: #f8f8f8;'>";
+            for (var i = 0; i < xxIds.length; i++) {
+              html += "<th>" + xxIds[i].name + "</th>";
+            }
+            html += "</tr>"
+            data.data.forEach(function (v) {
+              {
+                html += "<tr>";
+                html += "<td style='text-align: center;'>" + v.sort + "</td>";
+                html += "<td style='text-align: center;' >" + getLocalOther(v.startLocal, v.startLocalOther) + " </td>";
+                html += "<td style='text-align: center;' >" + getLocalOther(v.endLocal, v.endLocalOther) + " </td>";
+                html += "<td style='text-align: center;' >" + getTripType(v.tripType) + " </td>";
+                html += "<td style='text-align: center;' >" + v.tripTypeDesp + " </td>";
+                html += "<td style='text-align: center;' ><button value=" + i + " style='height:5vh;background-color: red;text-align: center; with:60%' class='weui-btn weui-btn_mini weui-btn_primary' onclick='splice(this.value)'>" + "删除" + " </button></td>";
+                html += "</tr>";
+                $("#tabtr").html(html);
+              }
+            });
           },
         });
       }
@@ -1312,9 +1350,14 @@ function helpValue1(v) {
   var isTrip = "";
   if (v.isTrip != 0)
     isTrip = "是否出行:" + getIsTrip(v.isTrip) + ";"
+
+  var tripDet = "";
+  if (v.tripDet != undefined)
+    tripDet = "出行详细:" + v.tripDet + ";"
+
   $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text" style="height: 15vh">\n' +
     '                                      <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '</h4>\n' +
-    '                                      <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + workLocal + todayLocal + isTrip + '</p>\n' +
+    '                                      <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + workLocal + todayLocal + isTrip + tripDet + '</p>\n' +
     '                                    </div>\n' +
     '                              '));
 }
@@ -1440,6 +1483,34 @@ function getLocal(local) {
   return "";
 }
 
+function getLocalOther(local, localOther) {
+  if (local == 0)
+    return "";
+  else if (local == 1)
+    return "武汉市";
+  else if (local == 2)
+    return "宜昌市";
+  else if (local == 3)
+    return "当阳市";
+  else if (local == 4)
+    return localOther;
+  return "";
+}
+
+function getTripType(tripType) {
+  if (tripType == 0)
+    return "";
+  else if (tripType == 1)
+    return "长途汽车";
+  else if (tripType == 2)
+    return "火车";
+  else if (tripType == 3)
+    return "飞机";
+  else if (tripType == 4)
+    return "自驾";
+  return "";
+}
+
 
 function getDiarrhea(diarrhea) {
   if (diarrhea == 0)

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