Bladeren bron

xielianghe

lange 5 jaren geleden
bovenliggende
commit
3788630918

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


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

@@ -38,4 +38,8 @@ 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);
 }

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

@@ -166,4 +166,20 @@ 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 ;
 }

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

@@ -40,7 +40,7 @@ public class MsSuspectedService {
     //查询家人
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public MsSuspected selectSuspected(long suspectedId) {
-        return msSuspectedMapper.selectById(suspectedId);
+        return msSuspectedMapper.selectBySuspectedId(suspectedId);
     }
 
     //查询用户最近一天的一个家人
@@ -262,7 +262,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) {

+ 26 - 25
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;
@@ -35,8 +34,8 @@ 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");
@@ -44,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");
@@ -65,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("tripDet").get(i);
-            msTripDet = new MsTripDet();
-            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()));
-            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);
+                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);