|
@@ -28,6 +28,7 @@ import javax.servlet.ServletOutputStream;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
@@ -81,11 +82,12 @@ public class ScanController {
|
|
@ApiOperation("进出扫码页面")
|
|
@ApiOperation("进出扫码页面")
|
|
@GetMapping("/user/scan.html")
|
|
@GetMapping("/user/scan.html")
|
|
public ModelAndView scan(HttpServletRequest request, ModelMap model, @RequestParam(value = "doorId", required = false, defaultValue = "0") Long doorId,
|
|
public ModelAndView scan(HttpServletRequest request, ModelMap model, @RequestParam(value = "doorId", required = false, defaultValue = "0") Long doorId,
|
|
- @RequestParam(value = "inType", required = false, defaultValue = "0") Integer inType) throws ParseException {
|
|
|
|
|
|
+ @RequestParam(value = "inType", required = false, defaultValue = "0") Integer inType,
|
|
|
|
+ @RequestParam(value = "coord", required = false, defaultValue = "") String coord) throws ParseException, UnsupportedEncodingException {
|
|
UserOpen userOpen = homeService.getUserOpenByCode(request.getParameter("code"));
|
|
UserOpen userOpen = homeService.getUserOpenByCode(request.getParameter("code"));
|
|
List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
|
|
List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
|
|
-// List<UserRole> list = userRoleMapper.getUserRoleByUserId(1234L);
|
|
|
|
-// UserOpen userOpen = userOpenMapper.selectByUserId(1234L);
|
|
|
|
|
|
+// List<UserRole> list = userRoleMapper.getUserRoleByUserId(1228565481837944834L);
|
|
|
|
+// UserOpen userOpen = userOpenMapper.selectByUserId(1228565481837944834L);
|
|
model.put("user", userOpen);
|
|
model.put("user", userOpen);
|
|
model.put("user_id", "\"" + userOpen.getUserId() + "\"");
|
|
model.put("user_id", "\"" + userOpen.getUserId() + "\"");
|
|
if (list.size() == 0) {
|
|
if (list.size() == 0) {
|
|
@@ -145,6 +147,12 @@ public class ScanController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (ly) {
|
|
if (ly) {
|
|
|
|
+// if ("".equals(coord)) {//%2C
|
|
|
|
+// String url = oauth2+appId +"&redirect_uri="+URLEncoder.encode(domain()+"user/scan.html?doorId="+doorId+"&inType="+inType + "&coord=","utf-8");
|
|
|
|
+// model.put("url", url);
|
|
|
|
+// model.put("moreUrl", moreUrl);
|
|
|
|
+// return new ModelAndView("/user/location.ftl", model);
|
|
|
|
+// }
|
|
OutUser outUser1 = outUserMapper.getOutUserByPhone(4, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
|
|
OutUser outUser1 = outUserMapper.getOutUserByPhone(4, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
|
|
if (outUser1 != null) {
|
|
if (outUser1 != null) {
|
|
model.put("collor", "red");
|
|
model.put("collor", "red");
|
|
@@ -159,7 +167,7 @@ public class ScanController {
|
|
model.put("collor", "green");
|
|
model.put("collor", "green");
|
|
model.put("collor2", "green");
|
|
model.put("collor2", "green");
|
|
model.put("into", "允许通行");
|
|
model.put("into", "允许通行");
|
|
- model.put("errorMsg", "特殊人员允许通行,请保证生产同时注意自身安全。");
|
|
|
|
|
|
+ model.put("errorMsg", "声明:复工许可证是根据员工自主填写健康日报,结合凌云集团复工条件自动产生。原则上代表员工可复工,在厂门口扫描二维码生成绿色复工通行证,并接受规定检查后,方可入厂。");
|
|
scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
|
|
scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
|
|
return new ModelAndView("/user/scan.ftl", model);
|
|
return new ModelAndView("/user/scan.ftl", model);
|
|
}
|
|
}
|
|
@@ -228,7 +236,7 @@ public class ScanController {
|
|
model.put("collor", "green");
|
|
model.put("collor", "green");
|
|
model.put("collor2", "green");
|
|
model.put("collor2", "green");
|
|
model.put("into", "允许通行");
|
|
model.put("into", "允许通行");
|
|
- model.put("errorMsg", "特殊人员允许通行,请保证生产同时注意自身安全。");
|
|
|
|
|
|
+ model.put("errorMsg", "声明:复工许可证是根据员工自主填写健康日报,结合凌云集团复工条件自动产生。原则上代表员工可复工,在厂门口扫描二维码生成绿色复工通行证,并接受规定检查后,方可入厂。");
|
|
scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
|
|
scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
|
|
return new ModelAndView("/user/scanHC.ftl", model);
|
|
return new ModelAndView("/user/scanHC.ftl", model);
|
|
}
|
|
}
|
|
@@ -531,7 +539,7 @@ public class ScanController {
|
|
model.put("collor", "green");
|
|
model.put("collor", "green");
|
|
model.put("collor2", "green");
|
|
model.put("collor2", "green");
|
|
model.put("into", "允许复工");
|
|
model.put("into", "允许复工");
|
|
- model.put("errorMsg", "特殊人员允许复工,请保证生产同时注意自身安全。");
|
|
|
|
|
|
+ model.put("errorMsg", "声明:复工许可证是根据员工自主填写健康日报,结合凌云集团复工条件自动产生。原则上代表员工可复工,在厂门口扫描二维码生成绿色复工通行证,并接受规定检查后,方可入厂。");
|
|
return new ModelAndView("/user/returnWork.ftl", model);
|
|
return new ModelAndView("/user/returnWork.ftl", model);
|
|
}
|
|
}
|
|
MsReport msReport = msReportMapper.queryMsReportIsXG(userId);
|
|
MsReport msReport = msReportMapper.queryMsReportIsXG(userId);
|
|
@@ -597,7 +605,7 @@ public class ScanController {
|
|
model.put("collor", "green");
|
|
model.put("collor", "green");
|
|
model.put("collor2", "green");
|
|
model.put("collor2", "green");
|
|
model.put("into", "允许复工");
|
|
model.put("into", "允许复工");
|
|
- model.put("errorMsg", "特殊人员允许复工,请保证生产同时注意自身安全。");
|
|
|
|
|
|
+ model.put("errorMsg", "声明:复工许可证是根据员工自主填写健康日报,结合凌云集团复工条件自动产生。原则上代表员工可复工,在厂门口扫描二维码生成绿色复工通行证,并接受规定检查后,方可入厂。");
|
|
return new ModelAndView("/user/returnWorkHC.ftl", model);
|
|
return new ModelAndView("/user/returnWorkHC.ftl", model);
|
|
}
|
|
}
|
|
MsReport msReport = msReportMapper.queryMsReportIsXG(userId);
|
|
MsReport msReport = msReportMapper.queryMsReportIsXG(userId);
|
|
@@ -704,6 +712,14 @@ public class ScanController {
|
|
return sdf.format(new Date(time1.getTime() + 1000L * 3600 * 24 * 15));
|
|
return sdf.format(new Date(time1.getTime() + 1000L * 3600 * 24 * 15));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public String domain() {
|
|
|
|
+ if (domain.substring(domain.length()-1).equals("/")) {
|
|
|
|
+ return domain;
|
|
|
|
+ } else {
|
|
|
|
+ return domain + "/";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
// /**
|
|
// /**
|
|
// * 生成进出门二维码
|
|
// * 生成进出门二维码
|
|
// * @param doorId 小区大门ID
|
|
// * @param doorId 小区大门ID
|