|
@@ -105,12 +105,20 @@ public class ScanController {
|
|
|
model.put("errorMsg", "非本小区居民,禁止" + getMsg(inType) + "。");
|
|
|
return new ModelAndView("/user/scan.ftl", model);
|
|
|
}
|
|
|
+ OutScan o = outScanMapper.getOutScanLately(userOpen.getUserId(), inType);
|
|
|
+ if (o != null && compareTime(o.getDate(),1)) {
|
|
|
+ model.put("collor", "orange");
|
|
|
+ model.put("into", "允许" + getMsg(inType));
|
|
|
+ model.put("errorMsg", "您最近一分钟已经扫码,本次扫码重复。");
|
|
|
+ return new ModelAndView("/user/scan.ftl", model);
|
|
|
+ }
|
|
|
if (inType == 1) {
|
|
|
OutScan outScan = outScanMapper.getOutScanByUserlimit(userOpen.getUserId());
|
|
|
if (outScan != null && new Date(outScan.getDate().getMillis() + 3600L * 1000 * 24).compareTo(new Date()) == -1) {
|
|
|
model.put("collor", "orange");
|
|
|
model.put("into", "允许进入");
|
|
|
model.put("errorMsg", "您在外驻留时间超过1日,请尽快上报您的健康状况,防止在外长时间逗留。");
|
|
|
+ scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId());
|
|
|
return new ModelAndView("/user/scan.ftl", model);
|
|
|
}
|
|
|
}
|
|
@@ -131,6 +139,13 @@ public class ScanController {
|
|
|
model.put("errorMsg", "距您上次外出时间未满"+outScanConf.getGoOutFre()+"日,禁止外出,请配合。上次外出登记时间 "+sdf.format(new Date(outScan.getDate().getMillis()))+"。");
|
|
|
return new ModelAndView("/user/scan.ftl", model);
|
|
|
}
|
|
|
+ MsReport msReport = msReportMapper.selectMsReportToday(userOpen.getUserId());
|
|
|
+ if (msReport != null && msReport.getMsStatus() == 2) {
|
|
|
+ model.put("collor", "red");
|
|
|
+ model.put("into", "禁止通行");
|
|
|
+ model.put("errorMsg", "健康日报提示您存在健康问题,禁止外出,请配合。");
|
|
|
+ return new ModelAndView("/user/scanEstate.ftl", model);
|
|
|
+ }
|
|
|
List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
|
|
|
if (msReports.size() == 0) {
|
|
|
model.put("collor", "red");
|
|
@@ -141,15 +156,9 @@ public class ScanController {
|
|
|
model.put("collor", "orange");
|
|
|
model.put("into", "可以" + getMsg(inType));
|
|
|
model.put("errorMsg", "您最近三日健康日报漏报,请说明原因并及时填报,配合监测人员。");
|
|
|
+ scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId());
|
|
|
return new ModelAndView("/user/scan.ftl", model);
|
|
|
}
|
|
|
- MsReport msReport = msReportMapper.selectMsReportToday(userOpen.getUserId());
|
|
|
- if (msReport != null && msReport.getMsStatus() == 2) {
|
|
|
- model.put("collor", "red");
|
|
|
- model.put("into", "禁止通行");
|
|
|
- model.put("errorMsg", "健康日报提示您存在健康问题,禁止外出,请配合。");
|
|
|
- return new ModelAndView("/user/scanEstate.ftl", model);
|
|
|
- }
|
|
|
}
|
|
|
model.put("collor", "green");
|
|
|
model.put("into", "允许" + getMsg(inType));
|
|
@@ -181,8 +190,16 @@ public class ScanController {
|
|
|
model.put("name", uptownHomes.get(0).getLinkman());
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
model.put("now", format.format(new Date()));
|
|
|
+ OutScanEstate o = outScanEstateMapper.getOutScanEstatLately(userOpen.getUserId());
|
|
|
+ if (o != null && compareTime(o.getScanDate(),1)) {
|
|
|
+ model.put("collor", "orange");
|
|
|
+ model.put("into", "允许通行");
|
|
|
+ model.put("errorMsg", "您最近一分钟已经扫码,本次扫码重复。");
|
|
|
+ return new ModelAndView("/user/scanEstate.ftl", model);
|
|
|
+ }
|
|
|
OutUser outUser = outUserMapper.getOutUserByUserId(userOpen.getUserId());
|
|
|
if (outUser != null) {
|
|
|
+ scanService.saveOutScanEstate(userOpen.getUserId());
|
|
|
model.put("collor", "green");
|
|
|
model.put("into", "允许通行");
|
|
|
model.put("errorMsg", "外出请佩戴口罩,避免近距离接触,保生产同时注意自身安全。");
|
|
@@ -192,7 +209,7 @@ public class ScanController {
|
|
|
if (msReports.size() != 3) {
|
|
|
model.put("collor", "red");
|
|
|
model.put("into", "禁止通行");
|
|
|
- model.put("errorMsg", "您近期未提交健康日报,无法判断您健康状态,请尽快返回住处。");
|
|
|
+ model.put("errorMsg", "您近期有未提交健康日报,无法判断您健康状态,请尽快返回住处。");
|
|
|
return new ModelAndView("/user/scanEstate.ftl", model);
|
|
|
}
|
|
|
MsReport msReport = msReportMapper.selectMsReportToday(userOpen.getUserId());
|
|
@@ -230,6 +247,21 @@ public class ScanController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 判断传入的时间和现在相差是否在i分钟内
|
|
|
+ * @param date
|
|
|
+ * @param i
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Boolean compareTime(DateTime date, Integer i) {
|
|
|
+ Date date1 = new Date(date.getMillis());
|
|
|
+ if ((date1.getTime() + 1000L * 60 * i) > System.currentTimeMillis()) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public String getMsg(Integer inType) {
|
|
|
if (inType == 1) {
|
|
|
return "进入";
|