|
@@ -4,8 +4,10 @@ package com.bofeng.service;
|
|
|
import com.baomidou.mybatisplus.toolkit.IdWorker;
|
|
|
import com.bofeng.dao.MsReportMapper;
|
|
|
import com.bofeng.dao.MsSuspectedMapper;
|
|
|
+import com.bofeng.dao.MsTripMapper;
|
|
|
import com.bofeng.entity.MsReport;
|
|
|
import com.bofeng.entity.MsSuspected;
|
|
|
+import com.bofeng.entity.MsTrip;
|
|
|
import com.yvan.platform.Conv;
|
|
|
import io.swagger.models.auth.In;
|
|
|
import org.joda.time.DateTime;
|
|
@@ -32,12 +34,15 @@ public class MsSuspectedService {
|
|
|
private MsSuspectedMapper msSuspectedMapper;
|
|
|
@Autowired
|
|
|
private MsReportMapper msReportMapper;
|
|
|
+ @Autowired
|
|
|
+ private MsTripMapper msTripMapper;
|
|
|
|
|
|
//查询家人
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public MsSuspected selectSuspected(long suspectedId) {
|
|
|
return msSuspectedMapper.selectById(suspectedId);
|
|
|
}
|
|
|
+
|
|
|
//查询用户最近一天的一个家人
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public MsSuspected selectAddSuspected(Long userCreate) {
|
|
@@ -48,7 +53,8 @@ public class MsSuspectedService {
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public Long addSuspected(Long suspectedId, String userName, Integer grender, Integer age, String familyStatus,
|
|
|
String statusDesp, Integer medical, BigDecimal temperature, Integer cough, Integer muscle,
|
|
|
- Integer dyspnea, Integer fatigue, Integer diarrhea, Integer singleRoom, String others, Long userCreate, Integer scoreRezult, Integer temperatureScore, Integer scoreHistroy, Integer score) {
|
|
|
+ Integer dyspnea, Integer fatigue, Integer diarrhea, Integer singleRoom, String others, Long userCreate, Integer scoreRezult, Integer temperatureScore, Integer scoreHistroy, Integer score
|
|
|
+ , Integer workLocal, String workLocalOther, Integer todayLocal, String todayLocalOther, Integer isTrip, String tripDet) {
|
|
|
Long reportId = 0L;
|
|
|
//如果是当前日期 已经添加
|
|
|
Date t = new Date();
|
|
@@ -112,7 +118,7 @@ public class MsSuspectedService {
|
|
|
return 2L;
|
|
|
//判断是否评估
|
|
|
if (scoreRezult == 0) {
|
|
|
- MsSuspected msSuspected1 = getScore(0L, userName, medical,temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
|
|
|
+ MsSuspected msSuspected1 = getScore(0L, userName, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
|
|
|
if (msSuspected1 != null) {
|
|
|
scoreRezult = msSuspected1.getScoreRezult();
|
|
|
score = msSuspected1.getScore();
|
|
@@ -148,6 +154,17 @@ public class MsSuspectedService {
|
|
|
msSuspected.setUserUpdate(userCreate);
|
|
|
msSuspected.setTimeUpdate(DateTime.now());
|
|
|
msSuspectedMapper.insert(msSuspected);
|
|
|
+
|
|
|
+ //添加出行
|
|
|
+ MsTrip msTrip = new MsTrip();
|
|
|
+ msTrip.setTripId(msSuspected.getReportId());
|
|
|
+ msTrip.setIsTrip(isTrip);
|
|
|
+ msTrip.setTodayLocal(todayLocal);
|
|
|
+ msTrip.setTodayLocalOther(todayLocalOther);
|
|
|
+ msTrip.setWorkLocal(workLocal);
|
|
|
+ msTrip.setWorkLocalOther(workLocalOther);
|
|
|
+ msTripMapper.insert(msTrip);
|
|
|
+
|
|
|
} else {
|
|
|
//判断家人是否同名
|
|
|
List<MsSuspected> list = msSuspectedMapper.selectUserNameNum(reportId, userName, reportDate);
|
|
@@ -159,7 +176,7 @@ public class MsSuspectedService {
|
|
|
return 2L;
|
|
|
}
|
|
|
}
|
|
|
- MsSuspected msSuspected2 = getScore(suspectedId, userName, medical,temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
|
|
|
+ MsSuspected msSuspected2 = getScore(suspectedId, userName, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
|
|
|
if (msSuspected2 != null) {
|
|
|
scoreRezult = msSuspected2.getScoreRezult();
|
|
|
score = msSuspected2.getScore();
|
|
@@ -190,6 +207,15 @@ public class MsSuspectedService {
|
|
|
msSuspected1.setSuspectedStatus(suspectedStatus);
|
|
|
msSuspectedMapper.updateById(msSuspected1);
|
|
|
}
|
|
|
+ MsTrip msTrip = msTripMapper.selectById(suspectedId);
|
|
|
+ if (msTrip != null) {
|
|
|
+ msTrip.setWorkLocalOther(workLocalOther);
|
|
|
+ msTrip.setWorkLocal(workLocal);
|
|
|
+ msTrip.setTodayLocalOther(todayLocalOther);
|
|
|
+ msTrip.setTodayLocal(todayLocal);
|
|
|
+ msTrip.setIsTrip(isTrip);
|
|
|
+ msTripMapper.updateById(msTrip);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//更新今日日报
|
|
@@ -258,7 +284,7 @@ public class MsSuspectedService {
|
|
|
msSuspected.setScore(addScore(medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea));
|
|
|
Integer scoreHistroy = msSuspectedMapper.selectUserNameScore(userCreate, userName, susprectedId);
|
|
|
msSuspected.setScoreHistroy(scoreHistroy);
|
|
|
- msSuspected.setScoreRezult(scoreRezulte(medical,msSuspected.getScoreHistroy(), msSuspected.getScore()));
|
|
|
+ msSuspected.setScoreRezult(scoreRezulte(medical, msSuspected.getScoreHistroy(), msSuspected.getScore()));
|
|
|
return msSuspected;
|
|
|
}
|
|
|
|