lange 5 tahun lalu
induk
melakukan
bec5dddd01

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

@@ -650,7 +650,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");
@@ -769,7 +769,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();
@@ -913,39 +914,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("家人姓名不能重复,如果重复,可以带上称呼");

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

@@ -34,7 +34,6 @@ 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");
@@ -67,9 +66,9 @@ public class MsTripController {
         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);
+            Map<String, Object> mm = (Map) jsonWapper.asList("tripDet").get(i);
             msTripDet = new MsTripDet();
-            msTripDet.setSort(Integer.parseInt(mm.get("sort").toString()));
+            msTripDet.setSort(i);
             msTripDet.setStartLocal(Integer.parseInt(mm.get("startLocal").toString()));
             msTripDet.setStartLocalOther(mm.get("startLocalOther").toString());
             msTripDet.setEndLocal(Integer.parseInt(mm.get("endLocal").toString()));