|
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
@@ -50,7 +51,7 @@ public class MsReportService {
|
|
|
//获取今天数据
|
|
|
public MsReport getReportByDateNow(Long userCreate) {
|
|
|
//根据昨天的获取今天的
|
|
|
- msReportService.getNowByYesterday(userCreate);
|
|
|
+ msReportService.getNowByYesterday(userCreate);
|
|
|
Date t = new Date();
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String reportDate = df.format(t);
|
|
@@ -64,11 +65,20 @@ public class MsReportService {
|
|
|
|
|
|
//上报
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
- public void addReport(Long userCreate) {
|
|
|
+ public Integer addReport(Long userCreate) {
|
|
|
Date t = new Date();
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String reportDate = df.format(t);
|
|
|
List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
|
|
|
+ if (listReport == null || listReport.size() == 0)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ //判断体温是否填写
|
|
|
+ List<MsSuspected> listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
|
|
|
+ for (MsSuspected msSuspected : listSuspected) {
|
|
|
+ if (msSuspected.getTemperature().compareTo(new BigDecimal(0)) == 1)
|
|
|
+ return 2;
|
|
|
+ }
|
|
|
MsReport msReport = msReportMapper.selectById(Long.parseLong(listReport.get(0).getReportId().toString()));
|
|
|
if (msReport != null) {
|
|
|
msReport.setReportStatus(1);
|
|
@@ -76,6 +86,7 @@ public class MsReportService {
|
|
|
msReport.setTimeUpdate(DateTime.now());
|
|
|
msReportMapper.updateById(msReport);
|
|
|
}
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
//通过昨天数据更新今天数据
|
|
@@ -88,7 +99,7 @@ public class MsReportService {
|
|
|
//判断今天是否有数据
|
|
|
String DateNow = sj.format(d);
|
|
|
List<MsReport> listReport = msReportMapper.selectByReportDate(DateNow, userCreate);
|
|
|
- if(listReport!=null && listReport.size()>0)
|
|
|
+ if (listReport != null && listReport.size() > 0)
|
|
|
return;
|
|
|
|
|
|
//判断昨天是否有数据
|
|
@@ -101,8 +112,8 @@ public class MsReportService {
|
|
|
if (listReport1 != null && listReport1.size() > 0) {
|
|
|
//添加到今天日报
|
|
|
MsReport msReport = msReportMapper.selectById(Long.parseLong(listReport1.get(0).getReportId().toString()));
|
|
|
- Long reportId=0L;
|
|
|
- if (msReport != null ) {
|
|
|
+ Long reportId = 0L;
|
|
|
+ if (msReport != null) {
|
|
|
MsReport msReport1 = new MsReport();
|
|
|
msReport1.setReportId(IdWorker.getId());
|
|
|
msReport1.setHouseId(msReport.getHouseId());
|
|
@@ -119,7 +130,7 @@ public class MsReportService {
|
|
|
msReport1.setUserUpdate(userCreate);
|
|
|
msReport1.setTimeUpdate(DateTime.now());
|
|
|
msReportMapper.insert(msReport1);
|
|
|
- reportId=msReport1.getReportId();
|
|
|
+ reportId = msReport1.getReportId();
|
|
|
}
|
|
|
//添加今日家庭
|
|
|
List<MsSuspected> listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport1.get(0).getReportId().toString()));
|
|
@@ -134,7 +145,7 @@ public class MsReportService {
|
|
|
msSuspected1.setFamilyStatus(msSuspected.getFamilyStatus());
|
|
|
msSuspected1.setStatusDesp(msSuspected.getStatusDesp());
|
|
|
msSuspected1.setMedical(msSuspected.getMedical());
|
|
|
- msSuspected1.setTemperature(msSuspected.getTemperature());
|
|
|
+ msSuspected1.setTemperature(new BigDecimal(0));
|
|
|
msSuspected1.setCough(msSuspected.getCough());
|
|
|
msSuspected1.setMuscle(msSuspected.getMuscle());
|
|
|
msSuspected1.setDiarrhea(msSuspected.getDiarrhea());
|