|
@@ -2,14 +2,8 @@ package com.bofeng.service;
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.toolkit.IdWorker;
|
|
|
-import com.bofeng.dao.MsReportMapper;
|
|
|
-import com.bofeng.dao.MsSuspectedMapper;
|
|
|
-import com.bofeng.dao.MsTripDetMapper;
|
|
|
-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.bofeng.dao.*;
|
|
|
+import com.bofeng.entity.*;
|
|
|
import com.yvan.platform.Conv;
|
|
|
import org.joda.time.DateTime;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -40,6 +34,8 @@ public class MsTripService {
|
|
|
private MsTripDetMapper msTripDetMapper;
|
|
|
@Autowired
|
|
|
private MsSuspectedService msSuspectedService;
|
|
|
+ @Autowired
|
|
|
+ private UptownUnitMapper uptownUnitMapper;
|
|
|
|
|
|
|
|
|
//添加家人
|
|
@@ -268,11 +264,58 @@ public class MsTripService {
|
|
|
msSuspectedService.updateReport(reportId, medical, singleRoom, temperature);
|
|
|
return reportId;
|
|
|
}
|
|
|
-
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public Integer deleteTrip(Long suspectedId) {
|
|
|
msTripDetMapper.deleteByTripId(suspectedId);
|
|
|
msTripMapper.deleteById(suspectedId);
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //上报
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
+ public Integer addReportTest(Long userCreate,String reportDate) {
|
|
|
+ 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()));
|
|
|
+ if (listSuspected == null || listSuspected.size() == 0)
|
|
|
+ return 3;
|
|
|
+ else {
|
|
|
+ for (MsSuspected msSuspected : listSuspected) {
|
|
|
+ //体温是否填写
|
|
|
+ if (msSuspected.getTemperature().compareTo(new BigDecimal(0)) == 0)
|
|
|
+ return 2;
|
|
|
+
|
|
|
+ //如果是凌云,判断出行是否填写异常
|
|
|
+ UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userCreate);
|
|
|
+ if (unit != null) {
|
|
|
+ if (unit.getUptownId() == 1238790987234L || unit.getUptownId() == 5) {
|
|
|
+ //上一天的上报记录.3天内
|
|
|
+ List<MsSuspected> listSuspected1 = msSuspectedMapper.selectNext3Suspected(userCreate);
|
|
|
+ if (listSuspected1 != null && listSuspected1.size() > 0) {
|
|
|
+ if (listSuspected1.get(0).getTodayLocal() != 0 && msSuspected.getTodayLocal() != 0) {
|
|
|
+ if (listSuspected1.get(0).getTodayLocalOther() != msSuspected.getTodayLocalOther() && listSuspected1.get(0).getTodayLocal() != msSuspected.getTodayLocal() && msSuspected.getIsTrip() == 0) {
|
|
|
+ return 4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ MsReport msReport = msReportMapper.selectById(Long.parseLong(listReport.get(0).getReportId().toString()));
|
|
|
+ if (msReport != null) {
|
|
|
+ msReport.setReportStatus(1);
|
|
|
+ msReport.setUserUpdate(userCreate);
|
|
|
+ msReport.setTimeUpdate(DateTime.now());
|
|
|
+ msReportMapper.updateById(msReport);
|
|
|
+ }
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
}
|