فهرست منبع

Merge remote-tracking branch 'origin/master'

peiguo 5 سال پیش
والد
کامیت
809a680edf

+ 33 - 21
whepi-ui/templates/home/home.ftl

@@ -3,6 +3,7 @@
 
 <div class="weui-tab">
     <input id="userId" type="text" hidden="hidden" value=${user_id!}/>
+    <input id="uptownId" type="text" hidden="hidden" value=${uptown_id!}/>
     <div class="weui-tab__bd">
         <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
             <#include "/home/ribao.ftl" /></div>
@@ -54,7 +55,18 @@
             });
         });
 
-
+        var uptownId = $("#uptownId").val();
+        if (uptownId == '1238790987234'){
+            $('#ribao_trip')[0].style.display = 'none';
+            $('#ribao_dnjgl')[0].style.display = 'none';
+            $('#ribao_qz')[0].style.display = 'none';
+            $('#ribao_zz')[0].style.display = '';
+        }else{
+            $('#ribao_trip')[0].style.display = '';
+            $('#ribao_dnjgl')[0].style.display = '';
+            $('#ribao_qz')[0].style.display = '';
+            $('#ribao_zz')[0].style.display = 'none';
+        }
         ribao_init();
         qiuzhu_init();
         family_init();
@@ -127,7 +139,7 @@
                     $('#newUnitId').append("<option>请选择</option>");
                     var html = "";
                     for (var i = 0; i < data.length; i++) {
-                        html += '<option value="' + data[i].unitId + '">'+data[i].ridgepole+data[i].unit + '</option>';
+                        html += '<option value="' + data[i].unitId + '">' + data[i].ridgepole + data[i].unit + '</option>';
                     }
                     $('#newUnitId').append(html);
                     $("#newUnitId").val('0');
@@ -141,11 +153,11 @@
         var unitId = $("#unitId").val();
         var newUnitId = $("#newUnitId").val();
         var newUnitText = $("#newUnitId").find("option:selected").text();
-        if (!newUnitId || newUnitId=="请选择") {
+        if (!newUnitId || newUnitId == "请选择") {
             $.alert("请选择部门")
             return false;
         }
-        if (newUnitId==unitId) {
+        if (newUnitId == unitId) {
             $.alert("您选择的部门和原来的部门一样")
             return false;
         }
@@ -157,7 +169,7 @@
             data: {
                 userId: $('#userId').val(),
                 newUnitId: newUnitId,
-            },success: function (date) {
+            }, success: function (date) {
                 $("#unitId").val(newUnitId);
                 $("#unitMsg").text(newUnitText);
             }
@@ -205,23 +217,23 @@
     function xiaoQuItemClick(v) {
         window.location.href = "/quzhu/home/quxiao.html?taskId=" + v.taskId + "&userId=" + $('#userId').val();
         /*familyClick();*/
-    /*    $.ajax({
-            url: '/home/home/taskQuery',
-            data: {taskId: v.taskId},
-            type: 'GET',
-            success: function (data) {
-                console.log(data);
-                if ($('#userId').val() != data.data.userId) {
-                    $.alert('当前求助信息不是你的')
-                    return;
-                } else {
-                    window.location.href = "/quzhu/home/quxiao.html?taskId=" + v.taskId + "&userId=" + v.userId;
-                    familyClick()
+        /*    $.ajax({
+                url: '/home/home/taskQuery',
+                data: {taskId: v.taskId},
+                type: 'GET',
+                success: function (data) {
+                    console.log(data);
+                    if ($('#userId').val() != data.data.userId) {
+                        $.alert('当前求助信息不是你的')
+                        return;
+                    } else {
+                        window.location.href = "/quzhu/home/quxiao.html?taskId=" + v.taskId + "&userId=" + v.userId;
+                        familyClick()
+                    }
+                },
+                error: function () {
                 }
-            },
-            error: function () {
-            }
-        });*/
+            });*/
 
     }
 

+ 24 - 11
whepi-ui/templates/home/ribao.ftl

@@ -128,18 +128,31 @@
                 <#--style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>-->
                     <input id="suspectedId" type="text" hidden="hidden" value=""/>
                     <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">病情描述</div>
-                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">确诊新冠肺炎</div>
-                        <input id="switchQuezhen" class="weui-input" autofocus="" type="text" placeholder="请选择"
-                               maxlength="20"
-                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    <div id="ribao_qz">
+                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                            <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">确诊新冠肺炎</div>
+                            <input id="switchQuezhen" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                                   maxlength="20"
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                        </div>
                     </div>
-                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">单间隔离</div>
-                        <input id="switchDanjiangeli" class="weui-input" autofocus="" type="text" placeholder="请选择"
-                               maxlength="20"
-                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                    <div id="ribao_zz">
+                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                            <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">今日症状</div>
+                            <input id="switchQuezhen_zz" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                                   maxlength="20"
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                        </div>
                     </div>
+                    <div id="ribao_dnjgl">
+                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                            <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">单间隔离</div>
+                            <input id="switchDanjiangeli" class="weui-input" autofocus="" type="text" placeholder="请选择"
+                                   maxlength="20"
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
+                        </div>
+                    </div>
+
 
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                         <div style="color: gray;height: 5vh; line-height: 5vh; width: 55%;">体温</div>
@@ -195,7 +208,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="请选择"

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1576 - 1377
whepi-ui/templates/home/ribao.js


+ 34 - 31
whepi-ui/templates/lingyun/ribao.js

@@ -701,7 +701,7 @@ function ribao_add() {
                     $("#js_input_user_name").val(suspected.userName);
                     $("#js_input_user_age").val(suspected.age);
                     //基本情况
-                    if (suspected.familyStatus != "") {
+                    if (suspected.familyStatus!=undefined) {
                         var familyStatusList = suspected.familyStatus.split(",");
                         if (familyStatusList[0] == 1)
                             $("input[name='checkbox1']").prop("checked", "checked");
@@ -820,7 +820,8 @@ function ribao_cancel() {
 
 function ribaoCommit() {
     var suspectedId = $("#suspectedId").val();
-    var userId = $("#userId").val();
+    // var userId = $("#userId").val();
+    var userId = "1";
     var userName = $("#js_input_user_name").val();
     var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
     var age = $("#js_input_user_age").val();
@@ -964,39 +965,41 @@ function ribaoCommit() {
     }else{
         isTrip = sf;
     }
-console.log(JSON.stringify(listcx))
+
+  var data = {
+      "suspectedId": suspectedId,
+      "userCreate": userId,
+      "userName": userName,
+      "grender": grender,
+      "age": age,
+      "familyStatus": familyStatus,
+      "statusDesp": statusDesp,
+      "medical": medical,
+      "singleRoom": singleRoom,
+      "temperature": temperature,
+      "cough": cough,
+      "muscle": muscle,
+      "dyspnea": dyspnea,
+      "fatigue": fatigue,
+      "diarrhea": diarrhea,
+      "others": others,
+      "scoreRezult": scoreRezult,
+      "temperatureScore": temperatureScore,
+      "scoreHistroy": scoreHistroy,
+      "score": score,
+      "workLocal": workLocal,
+      "workLocalOther": workLocalOther,
+      "todayLocal": todyLocal,
+      "todayLocalOther": todyLocalOther,
+      "isTrip": isTrip,
+      "tripDet": listcx,
+    };
 
     $.ajax({
         url: '/home/addRibaoTrip',
+        contentType: "application/json; charset=utf-8",
         type: "post",
-        data: {
-            "suspectedId": suspectedId,
-            "userCreate": userId,
-            "userName": userName,
-            "grender": grender,
-            "age": age,
-            "familyStatus": familyStatus,
-            "statusDesp": statusDesp,
-            "medical": medical,
-            "singleRoom": singleRoom,
-            "temperature": temperature,
-            "cough": cough,
-            "muscle": muscle,
-            "dyspnea": dyspnea,
-            "fatigue": fatigue,
-            "diarrhea": diarrhea,
-            "others": others,
-            "scoreRezult": scoreRezult,
-            "temperatureScore": temperatureScore,
-            "scoreHistroy": scoreHistroy,
-            "score": score,
-            "workLocal": JSON.stringify(workLocal),
-            "workLocalOther": JSON.stringify(workLocalOther),
-            "todyLocal": JSON.stringify(todyLocal),
-            "todyLocalOther": JSON.stringify(todyLocalOther),
-            "isTrip": JSON.stringify(isTrip),
-            "listcx": JSON.stringify(listcx),
-        },
+        data: JSON.stringify(data),
         success: function (data) {
             if (data.msgReport == "2") {
                 $.toast("家人姓名不能重复,如果重复,可以带上称呼");

+ 1 - 0
whepi-web/src/main/java/com/bofeng/controller/EpiLYExportController.java

@@ -21,6 +21,7 @@ public class EpiLYExportController {
     @GetMapping("/whepi/export/lyReport")
     public @ResponseBody
     void exportSellPlan(HttpServletRequest request, HttpServletResponse response) {
+        Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("userName", "张山");
         map.put("workPlace", "武汉");

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

@@ -4,6 +4,7 @@ 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;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -38,4 +39,11 @@ public interface MsSuspectedMapper extends BaseMapper<MsSuspected> {
             "and a.user_name not in (select a.user_name from ms_suspected a INNER JOIN ms_report b on a.report_id=b.report_id where b.user_create=#{userCreate} and b.report_date=curdate())\n" +
             " ORDER by a.time_create  LIMIT 1")
     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}")
+    MsSuspected selectBySuspectedId(@Param("suspectedId") Long suspectedId);
+
+    @Select("select * from ms_trip_det  where trip_id =#{suspectedId}")
+    List<MsTripDet> selectTripSuspected(@Param("suspectedId") Long suspectedId);
 }

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

@@ -166,4 +166,23 @@ public class MsSuspected {
 
     @TableField(exist = false)
     private String uptownName;
+
+    //出行
+    @TableField(exist = false)
+    private Integer workLocal;
+
+    @TableField(exist = false)
+    private String workLocalOther = "";
+
+    @TableField(exist = false)
+    private Integer todayLocal;
+
+    @TableField(exist = false)
+    private String todayLocalOther = "";
+
+    @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;
             }
         }

+ 8 - 2
whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java

@@ -8,6 +8,7 @@ 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;
@@ -40,7 +41,12 @@ public class MsSuspectedService {
     //查询家人
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public MsSuspected selectSuspected(long suspectedId) {
-        return msSuspectedMapper.selectById(suspectedId);
+        return msSuspectedMapper.selectBySuspectedId(suspectedId);
+    }
+    //查询家人
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public List<MsTripDet> selectTripSuspected(long suspectedId) {
+        return msSuspectedMapper.selectTripSuspected(suspectedId);
     }
 
     //查询用户最近一天的一个家人
@@ -262,7 +268,7 @@ public class MsSuspectedService {
         MsSuspected msSuspected = new MsSuspected();
         msSuspected.setTemperatureScore(getTemperatureScore(temperature));
         msSuspected.setScore(addScore(medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea));
-        Integer scoreHistroy = msSuspectedMapper.selectUserNameScore(userCreate, userName, susprectedId);
+        Integer scoreHistroy = msSuspectedMapper.selectUserNameScore(userCreate, userName, susprectedId)==null ?0:msSuspectedMapper.selectUserNameScore(userCreate, userName, susprectedId);
         msSuspected.setScoreHistroy(scoreHistroy);
         msSuspected.setScoreRezult(scoreRezulte(medical, msSuspected.getScoreHistroy(), msSuspected.getScore()));
         return msSuspected;

+ 0 - 1
whepi-web/src/main/java/com/bofeng/service/MsTripService.java

@@ -232,7 +232,6 @@ public class MsTripService {
             }
             //删除行程详细
             msTripDetMapper.deleteByTripId(suspectedId);
-            //添加行程详细
             //添加出行详细
             if (listTripDet != null && listTripDet.size() > 0) {
                 for (MsTripDet msTripDet : listTripDet) {

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

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

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

@@ -13,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletRequest;
 import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -34,10 +33,9 @@ public class MsTripController {
     //添加家人出行
     @PostMapping("/home/addRibaoTrip")
     public MsReport saveUser(JsonWapper jsonWapper) throws UnsupportedEncodingException {
-
         //初始化今日日报
-        Long suspectedId = jsonWapper.asObject(Long.class, "suspectedId");
-        Long userCreate = jsonWapper.asObject(Long.class, "userCreate");
+        Long suspectedId = jsonWapper.asObject(Long.class, "suspectedId") == null ? 0L : jsonWapper.asObject(Long.class, "suspectedId");
+        Long userCreate = jsonWapper.asObject(Long.class, "userCreate")== null ? 0L : jsonWapper.asObject(Long.class, "userCreate");
         String userName = jsonWapper.asObject(String.class, "userName");
         byte[] utf8Bytes = userName.getBytes("UTF-8");
         userName = new String(utf8Bytes, "UTF-8");
@@ -45,19 +43,19 @@ public class MsTripController {
         Integer age = jsonWapper.asObject(Integer.class, "age");
         String familyStatus = jsonWapper.asObject(String.class, "familyStatus");
         String statusDesp = jsonWapper.asObject(String.class, "statusDesp");
-        Integer medical = jsonWapper.asObject(Integer.class, "medical");
+        Integer medical = jsonWapper.asObject(Integer.class, "medical")== null ? 0: jsonWapper.asObject(Integer.class, "medical");
         BigDecimal temperature = jsonWapper.asObject(BigDecimal.class, "temperature");
-        Integer cough = jsonWapper.asObject(Integer.class, "cough");
-        Integer muscle = jsonWapper.asObject(Integer.class, "muscle");
-        Integer dyspnea = jsonWapper.asObject(Integer.class, "dyspnea");
-        Integer fatigue = jsonWapper.asObject(Integer.class, "fatigue");
-        Integer diarrhea = jsonWapper.asObject(Integer.class, "diarrhea");
-        Integer singleRoom = jsonWapper.asObject(Integer.class, "singleRoom");
+        Integer cough = jsonWapper.asObject(Integer.class, "cough")== null ? 0: jsonWapper.asObject(Integer.class, "cough");
+        Integer muscle = jsonWapper.asObject(Integer.class, "muscle")== null ? 0: jsonWapper.asObject(Integer.class, "muscle");
+        Integer dyspnea = jsonWapper.asObject(Integer.class, "dyspnea")== null ? 0: jsonWapper.asObject(Integer.class, "dyspnea");
+        Integer fatigue = jsonWapper.asObject(Integer.class, "fatigue")== null ? 0: jsonWapper.asObject(Integer.class, "fatigue");
+        Integer diarrhea = jsonWapper.asObject(Integer.class, "diarrhea")== null ? 0: jsonWapper.asObject(Integer.class, "diarrhea");
+        Integer singleRoom = jsonWapper.asObject(Integer.class, "singleRoom")== null ? 0: jsonWapper.asObject(Integer.class, "singleRoom");
         String others = jsonWapper.asObject(String.class, "others");
-        Integer scoreRezult = jsonWapper.asObject(Integer.class, "scoreRezult");
-        Integer temperatureScore = jsonWapper.asObject(Integer.class, "temperatureScore");
-        Integer scoreHistroy = jsonWapper.asObject(Integer.class, "scoreHistroy");
-        Integer score = jsonWapper.asObject(Integer.class, "score");
+        Integer scoreRezult = jsonWapper.asObject(Integer.class, "scoreRezult")== null ? 0: jsonWapper.asObject(Integer.class, "scoreRezult");
+        Integer temperatureScore = jsonWapper.asObject(Integer.class, "temperatureScore")== null ? 0: jsonWapper.asObject(Integer.class, "temperatureScore");
+        Integer scoreHistroy = jsonWapper.asObject(Integer.class, "scoreHistroy")== null ? 0: jsonWapper.asObject(Integer.class, "scoreHistroy");
+        Integer score = jsonWapper.asObject(Integer.class, "score")== null ? 0: jsonWapper.asObject(Integer.class, "score");
         //添加出行
         Integer workLocal = jsonWapper.asObject(Integer.class, "workLocal");
         String workLocalOther = jsonWapper.asObject(String.class, "workLocalOther");
@@ -66,17 +64,19 @@ public class MsTripController {
         Integer isTrip = jsonWapper.asObject(Integer.class, "isTrip");
         List<MsTripDet> listTripDet = new ArrayList<>();
         MsTripDet msTripDet;
-        for (int i = 0; i < jsonWapper.asList("tripDet").size(); i++) {
-            Map<String, Object> mm = (Map) jsonWapper.asList("listTripDet").get(i);
-            msTripDet = new MsTripDet();
-            msTripDet.setSort(Integer.parseInt(mm.get("sort").toString()));
-            msTripDet.setStartLocal(Integer.parseInt(mm.get("startLocal").toString()));
-            msTripDet.setStartLocalOther(mm.get("startLocalOther").toString());
-            msTripDet.setEndLocal(Integer.parseInt(mm.get("endLocal").toString()));
-            msTripDet.setEndLocalOther(mm.get("endLocalOther").toString());
-            msTripDet.setTripType(Integer.parseInt(mm.get("tripType").toString()));
-            msTripDet.setTripTypeDesp(mm.get("tripTypeOther").toString());
-            listTripDet.add(msTripDet);
+        if(jsonWapper.asList("tripDet").size()>0){
+            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+1);
+                msTripDet.setStartLocal(Integer.parseInt(mm.get("startLocal").toString()));
+                msTripDet.setStartLocalOther(mm.get("startLocalOther").toString());
+                msTripDet.setEndLocal(Integer.parseInt(mm.get("endLocal").toString()));
+                msTripDet.setEndLocalOther(mm.get("endLocalOther").toString());
+                msTripDet.setTripType(Integer.parseInt(mm.get("tripType").toString()));
+                msTripDet.setTripTypeDesp(mm.get("tripTypeDesp").toString());
+                listTripDet.add(msTripDet);
+            }
         }
         MsReport msReport = new MsReport();
         Long reportId = msTripService.addSuspectedTrip(suspectedId, userName, grender, age, familyStatus, statusDesp, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, singleRoom, others, userCreate, scoreRezult, temperatureScore, scoreHistroy, score, workLocal, workLocalOther, todayLocal, todayLocalOther, isTrip, listTripDet);

+ 1 - 1
whepi-web/src/main/resources/mapper/MsSuspected.xml

@@ -2,6 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.bofeng.dao.MsSuspectedMapper">
     <select id="selectByReportId" resultType="com.bofeng.entity.MsSuspected">
-        select * from ms_suspected where report_id = #{reportId}
+        select a.*,b.* from ms_suspected a left join ms_trip b on a.suspected_id=b.trip_id where a.report_id = #{reportId}
     </select>
 </mapper>