peiguo 5 лет назад
Родитель
Сommit
0a6c95e53d
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

+ 14 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -183,6 +183,13 @@ public class ScanController {
                         scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
                         return new ModelAndView("/user/scan.ftl", model);
                     }
+                    if (!unit.getUptownId().equals(uptownDoor.getUptownId())) {
+                        model.put("into", "禁止" + getMsg(inType));
+                        model.put("collor", "red");
+                        model.put("errorMsg", "非本小区居民,禁止" + getMsg(inType) + "。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scan.ftl", model);
+                    }
                     MsReport msReport = msReportMapper.queryMsReportIsXG(userOpen.getUserId());
                     SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
                     if (msReport != null) {
@@ -258,6 +265,13 @@ public class ScanController {
                         scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
                         return new ModelAndView("/user/scanHC.ftl", model);
                     }
+                    if (!unit.getUptownId().equals(uptownDoor.getUptownId())) {
+                        model.put("into", "禁止" + getMsg(inType));
+                        model.put("collor", "red");
+                        model.put("errorMsg", "非本小区居民,禁止" + getMsg(inType) + "。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scanHC.ftl", model);
+                    }
                     MsReport msReport = msReportMapper.queryMsReportIsXG(userOpen.getUserId());
                     SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
                     if (msReport != null) {