|
@@ -105,12 +105,20 @@ public class ScanController {
|
|
model.put("errorMsg", "非本小区居民,禁止" + getMsg(inType) + "。");
|
|
model.put("errorMsg", "非本小区居民,禁止" + getMsg(inType) + "。");
|
|
return new ModelAndView("/user/scan.ftl", model);
|
|
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) {
|
|
if (inType == 1) {
|
|
OutScan outScan = outScanMapper.getOutScanByUserlimit(userOpen.getUserId());
|
|
OutScan outScan = outScanMapper.getOutScanByUserlimit(userOpen.getUserId());
|
|
if (outScan != null && new Date(outScan.getDate().getMillis() + 3600L * 1000 * 24).compareTo(new Date()) == -1) {
|
|
if (outScan != null && new Date(outScan.getDate().getMillis() + 3600L * 1000 * 24).compareTo(new Date()) == -1) {
|
|
model.put("collor", "orange");
|
|
model.put("collor", "orange");
|
|
model.put("into", "允许进入");
|
|
model.put("into", "允许进入");
|
|
model.put("errorMsg", "您在外驻留时间超过1日,请尽快上报您的健康状况,防止在外长时间逗留。");
|
|
model.put("errorMsg", "您在外驻留时间超过1日,请尽快上报您的健康状况,防止在外长时间逗留。");
|
|
|
|
+ scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId());
|
|
return new ModelAndView("/user/scan.ftl", model);
|
|
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()))+"。");
|
|
model.put("errorMsg", "距您上次外出时间未满"+outScanConf.getGoOutFre()+"日,禁止外出,请配合。上次外出登记时间 "+sdf.format(new Date(outScan.getDate().getMillis()))+"。");
|
|
return new ModelAndView("/user/scan.ftl", model);
|
|
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());
|
|
List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
|
|
if (msReports.size() == 0) {
|
|
if (msReports.size() == 0) {
|
|
model.put("collor", "red");
|
|
model.put("collor", "red");
|
|
@@ -141,15 +156,9 @@ public class ScanController {
|
|
model.put("collor", "orange");
|
|
model.put("collor", "orange");
|
|
model.put("into", "可以" + getMsg(inType));
|
|
model.put("into", "可以" + getMsg(inType));
|
|
model.put("errorMsg", "您最近三日健康日报漏报,请说明原因并及时填报,配合监测人员。");
|
|
model.put("errorMsg", "您最近三日健康日报漏报,请说明原因并及时填报,配合监测人员。");
|
|
|
|
+ scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId());
|
|
return new ModelAndView("/user/scan.ftl", model);
|
|
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("collor", "green");
|
|
model.put("into", "允许" + getMsg(inType));
|
|
model.put("into", "允许" + getMsg(inType));
|
|
@@ -181,8 +190,16 @@ public class ScanController {
|
|
model.put("name", uptownHomes.get(0).getLinkman());
|
|
model.put("name", uptownHomes.get(0).getLinkman());
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
model.put("now", format.format(new Date()));
|
|
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());
|
|
OutUser outUser = outUserMapper.getOutUserByUserId(userOpen.getUserId());
|
|
if (outUser != null) {
|
|
if (outUser != null) {
|
|
|
|
+ scanService.saveOutScanEstate(userOpen.getUserId());
|
|
model.put("collor", "green");
|
|
model.put("collor", "green");
|
|
model.put("into", "允许通行");
|
|
model.put("into", "允许通行");
|
|
model.put("errorMsg", "外出请佩戴口罩,避免近距离接触,保生产同时注意自身安全。");
|
|
model.put("errorMsg", "外出请佩戴口罩,避免近距离接触,保生产同时注意自身安全。");
|
|
@@ -192,8 +209,8 @@ public class ScanController {
|
|
if (msReports.size() != 3) {
|
|
if (msReports.size() != 3) {
|
|
model.put("collor", "red");
|
|
model.put("collor", "red");
|
|
model.put("into", "禁止通行");
|
|
model.put("into", "禁止通行");
|
|
- model.put("errorMsg", "您近期未提交健康日报,无法判断您健康状态,请尽快返回住处。");
|
|
|
|
- return new ModelAndView("/user/scan.ftl", model);
|
|
|
|
|
|
+ model.put("errorMsg", "您近期有未提交健康日报,无法判断您健康状态,请尽快返回住处。");
|
|
|
|
+ return new ModelAndView("/user/scanEstate.ftl", model);
|
|
}
|
|
}
|
|
MsReport msReport = msReportMapper.selectMsReportToday(userOpen.getUserId());
|
|
MsReport msReport = msReportMapper.selectMsReportToday(userOpen.getUserId());
|
|
if (msReport != null && msReport.getMsStatus() == 2) {
|
|
if (msReport != null && msReport.getMsStatus() == 2) {
|
|
@@ -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) {
|
|
public String getMsg(Integer inType) {
|
|
if (inType == 1) {
|
|
if (inType == 1) {
|
|
return "进入";
|
|
return "进入";
|
|
@@ -249,35 +281,35 @@ public class ScanController {
|
|
return time.substring(0, time.length() - 1);
|
|
return time.substring(0, time.length() - 1);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 生成进出门二维码
|
|
|
|
- * @param doorId 小区大门ID
|
|
|
|
- * @param inType 1进入;2外出
|
|
|
|
- * @param response
|
|
|
|
- * @throws IOException
|
|
|
|
- * @throws WriterException
|
|
|
|
- */
|
|
|
|
- @GetMapping(value = "/scan/scan_qr.png", produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
- public void scanQrImg(@Pd(name = "doorId") Long doorId, @Pd(name = "inType") Integer inType,
|
|
|
|
- HttpServletResponse response) throws IOException, WriterException {
|
|
|
|
- @Cleanup ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
- String msg = URLEncoder.encode( domain + "user/scan.html?doorId=" + doorId + "&inType=" + inType,"utf-8");
|
|
|
|
- BitMatrix matrix = new MultiFormatWriter().encode(oauth2 + appId + "&redirect_uri=" +
|
|
|
|
- msg + moreUrl, BarcodeFormat.QR_CODE, 256, 256);
|
|
|
|
- MatrixToImageWriter.writeToStream(matrix, MediaType.IMAGE_PNG.getSubtype(), outputStream, new MatrixToImageConfig());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 生成校园巡逻二维码
|
|
|
|
- * @throws IOException
|
|
|
|
- * @throws WriterException
|
|
|
|
- */
|
|
|
|
- @GetMapping(value = "/scan/scanEstate_qr.png", produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
- public void scanEstateQrImg(HttpServletResponse response) throws IOException, WriterException {
|
|
|
|
- @Cleanup ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
- String msg = URLEncoder.encode( domain + "user/scanEstate.html","utf-8");
|
|
|
|
- BitMatrix matrix = new MultiFormatWriter().encode(oauth2 + appId + "&redirect_uri=" +
|
|
|
|
- msg + moreUrl, BarcodeFormat.QR_CODE, 256, 256);
|
|
|
|
- MatrixToImageWriter.writeToStream(matrix, MediaType.IMAGE_PNG.getSubtype(), outputStream, new MatrixToImageConfig());
|
|
|
|
- }
|
|
|
|
|
|
+// /**
|
|
|
|
+// * 生成进出门二维码
|
|
|
|
+// * @param doorId 小区大门ID
|
|
|
|
+// * @param inType 1进入;2外出
|
|
|
|
+// * @param response
|
|
|
|
+// * @throws IOException
|
|
|
|
+// * @throws WriterException
|
|
|
|
+// */
|
|
|
|
+// @GetMapping(value = "/scan/scan_qr.png", produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
+// public void scanQrImg(@Pd(name = "doorId") Long doorId, @Pd(name = "inType") Integer inType,
|
|
|
|
+// HttpServletResponse response) throws IOException, WriterException {
|
|
|
|
+// @Cleanup ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
+// String msg = URLEncoder.encode( domain + "user/scan.html?doorId=" + doorId + "&inType=" + inType,"utf-8");
|
|
|
|
+// BitMatrix matrix = new MultiFormatWriter().encode(oauth2 + appId + "&redirect_uri=" +
|
|
|
|
+// msg + moreUrl, BarcodeFormat.QR_CODE, 256, 256);
|
|
|
|
+// MatrixToImageWriter.writeToStream(matrix, MediaType.IMAGE_PNG.getSubtype(), outputStream, new MatrixToImageConfig());
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// /**
|
|
|
|
+// * 生成校园巡逻二维码
|
|
|
|
+// * @throws IOException
|
|
|
|
+// * @throws WriterException
|
|
|
|
+// */
|
|
|
|
+// @GetMapping(value = "/scan/scanEstate_qr.png", produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
+// public void scanEstateQrImg(HttpServletResponse response) throws IOException, WriterException {
|
|
|
|
+// @Cleanup ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
+// String msg = URLEncoder.encode( domain + "user/scanEstate.html","utf-8");
|
|
|
|
+// BitMatrix matrix = new MultiFormatWriter().encode(oauth2 + appId + "&redirect_uri=" +
|
|
|
|
+// msg + moreUrl, BarcodeFormat.QR_CODE, 256, 256);
|
|
|
|
+// MatrixToImageWriter.writeToStream(matrix, MediaType.IMAGE_PNG.getSubtype(), outputStream, new MatrixToImageConfig());
|
|
|
|
+// }
|
|
}
|
|
}
|