|
@@ -1,10 +1,17 @@
|
|
|
package com.zd.base.app.controller;
|
|
package com.zd.base.app.controller;
|
|
|
|
|
|
|
|
|
|
+import com.zd.algorithm.api.face.feign.FaceCompare;
|
|
|
|
|
+import com.zd.algorithm.api.face.feign.RemoteFaceService;
|
|
|
|
|
+import com.zd.algorithm.api.xxp.feign.RemoteXxpService;
|
|
|
|
|
+import com.zd.base.app.HexStrUtils;
|
|
|
|
|
+import com.zd.base.app.domain.board.DutyPersonVo;
|
|
|
import com.zd.base.app.domain.board.LabXxpSubjectVo;
|
|
import com.zd.base.app.domain.board.LabXxpSubjectVo;
|
|
|
-import com.zd.common.core.security.TokenService;
|
|
|
|
|
import com.zd.common.core.utils.DateUtils;
|
|
import com.zd.common.core.utils.DateUtils;
|
|
|
|
|
+import com.zd.common.core.utils.FileConfigUtils;
|
|
|
import com.zd.common.core.utils.StringUtils;
|
|
import com.zd.common.core.utils.StringUtils;
|
|
|
import com.zd.laboratory.api.feign.RemoteDutyService;
|
|
import com.zd.laboratory.api.feign.RemoteDutyService;
|
|
|
|
|
+import com.zd.laboratory.api.vo.XxpInspectionVo;
|
|
|
|
|
+import com.zd.laboratory.api.vo.XxpUserAuthVo;
|
|
|
import com.zd.model.constant.HttpStatus;
|
|
import com.zd.model.constant.HttpStatus;
|
|
|
import com.zd.model.domain.R;
|
|
import com.zd.model.domain.R;
|
|
|
import com.zd.model.domain.ResultData;
|
|
import com.zd.model.domain.ResultData;
|
|
@@ -12,12 +19,14 @@ import com.zd.system.api.feign.RemoteUserService;
|
|
|
import com.zd.system.api.vo.SysLogoConfigVO;
|
|
import com.zd.system.api.vo.SysLogoConfigVO;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -30,12 +39,18 @@ import java.util.*;
|
|
|
@Api(tags = {"电子信息牌"})
|
|
@Api(tags = {"电子信息牌"})
|
|
|
public class LabBoardApi {
|
|
public class LabBoardApi {
|
|
|
|
|
|
|
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(LabBoardApi.class);
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RemoteUserService remoteUserService;
|
|
private RemoteUserService remoteUserService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RemoteDutyService remoteDutyService;
|
|
private RemoteDutyService remoteDutyService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- private TokenService tokenService;
|
|
|
|
|
|
|
+ private RemoteXxpService remoteXxpService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private FileConfigUtils fileConfigUtils;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RemoteFaceService remoteFaceService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询电子信息牌头部信息
|
|
* 查询电子信息牌头部信息
|
|
@@ -53,10 +68,14 @@ public class LabBoardApi {
|
|
|
return ResultData.fail(500, "获取logo失败!");
|
|
return ResultData.fail(500, "获取logo失败!");
|
|
|
}
|
|
}
|
|
|
map.put("schoolName", logoConfigVo.getSchoolName());
|
|
map.put("schoolName", logoConfigVo.getSchoolName());
|
|
|
- map.put("circularLogo", logoConfigVo.getCircularLogo());
|
|
|
|
|
- map.put("circularLogo", logoConfigVo.getCircularLogo());
|
|
|
|
|
- map.put("currentTime", new Date());
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ map.put("circularLogo", fileConfigUtils.getFileDomainApp()+logoConfigVo.getRectangleLogo());
|
|
|
|
|
+ ResultData resultData=remoteDutyService.getSubjectName(labId);
|
|
|
|
|
+ if (resultData == null || resultData.getCode() != 200) {
|
|
|
|
|
+ return ResultData.fail(500, "获取实验室名称失败!");
|
|
|
|
|
+ }
|
|
|
|
|
+ map.put("subjectName", resultData.getData());
|
|
|
|
|
+ map.put("currentTime", DateUtils.parseDateToStr("YYYY_MM_DD HH:MM:SS",new Date()));
|
|
|
|
|
+ return ResultData.success(map);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -68,7 +87,7 @@ public class LabBoardApi {
|
|
|
//查询实验室负责人和安全负责人
|
|
//查询实验室负责人和安全负责人
|
|
|
LabXxpSubjectVo vo = new LabXxpSubjectVo();
|
|
LabXxpSubjectVo vo = new LabXxpSubjectVo();
|
|
|
ResultData resultData = remoteDutyService.getXxpSubjectInfo(labId);
|
|
ResultData resultData = remoteDutyService.getXxpSubjectInfo(labId);
|
|
|
- if (null != resultData || resultData.getCode() != 200) {
|
|
|
|
|
|
|
+ if (null == resultData || resultData.getCode() != 200) {
|
|
|
return ResultData.fail("获取实验室信息失败!");
|
|
return ResultData.fail("获取实验室信息失败!");
|
|
|
}
|
|
}
|
|
|
Map<String, Object> map = (Map<String, Object>) resultData.getData();
|
|
Map<String, Object> map = (Map<String, Object>) resultData.getData();
|
|
@@ -98,6 +117,10 @@ public class LabBoardApi {
|
|
|
}
|
|
}
|
|
|
vo.setSafeUserVoList(safeUserList);
|
|
vo.setSafeUserVoList(safeUserList);
|
|
|
}
|
|
}
|
|
|
|
|
+ vo.setSubjectName(String.valueOf(map.getOrDefault("subjectName", "")));
|
|
|
|
|
+ vo.setInCheck((List<Map<String, String>>)map.get("checkIn"));
|
|
|
|
|
+ vo.setOutCheck((List<String>)map.get("checkOut"));
|
|
|
|
|
+ vo.setInspectInCheck((List<Map<String, String>>)map.get("inspectCheckIn"));
|
|
|
ResultData<LabXxpSubjectVo> xxpResultData= remoteDutyService.classifyDetailSubjectById(labId);
|
|
ResultData<LabXxpSubjectVo> xxpResultData= remoteDutyService.classifyDetailSubjectById(labId);
|
|
|
if(null==xxpResultData || xxpResultData.getCode()!=200){
|
|
if(null==xxpResultData || xxpResultData.getCode()!=200){
|
|
|
return ResultData.fail("获取实验室信息类目失败!");
|
|
return ResultData.fail("获取实验室信息类目失败!");
|
|
@@ -125,7 +148,7 @@ public class LabBoardApi {
|
|
|
return ResultData.fail("签到人员获取失败!");
|
|
return ResultData.fail("签到人员获取失败!");
|
|
|
}
|
|
}
|
|
|
map.put("tentativeUser", signData.getData());
|
|
map.put("tentativeUser", signData.getData());
|
|
|
- ResultData securityData=remoteDutyService.securityApplyList(1,10,labId);
|
|
|
|
|
|
|
+ ResultData securityData=remoteDutyService.securityApplyList(labId,1,10);
|
|
|
if(null==securityData || securityData.getCode()!=HttpStatus.SUCCESS){
|
|
if(null==securityData || securityData.getCode()!=HttpStatus.SUCCESS){
|
|
|
return ResultData.fail("安全准入人员获取失败!");
|
|
return ResultData.fail("安全准入人员获取失败!");
|
|
|
}
|
|
}
|
|
@@ -136,20 +159,57 @@ public class LabBoardApi {
|
|
|
|
|
|
|
|
@ApiOperation(value = "值班人员列表")
|
|
@ApiOperation(value = "值班人员列表")
|
|
|
@GetMapping(value = "/dutyUserList")
|
|
@GetMapping(value = "/dutyUserList")
|
|
|
- public ResultData dutyUsrList(@RequestParam Long labId,@RequestParam String startTime,@RequestParam String endTime) {
|
|
|
|
|
- ResultData<List<Map<String, Object>>> dutyData=remoteDutyService.selectDutyUserList(labId,startTime,endTime);
|
|
|
|
|
- if(null==dutyData || dutyData.getCode()!=HttpStatus.SUCCESS){
|
|
|
|
|
- return ResultData.fail("值班人员列表获取失败!");
|
|
|
|
|
|
|
+ public ResultData dutyUsrList(@RequestParam Long labId,@RequestParam String startTime) {
|
|
|
|
|
+ //处理当前实验,获取当前时间的这一周的开始时间和结束时间
|
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
+ try {
|
|
|
|
|
+ Date newDate = sdf.parse(startTime);
|
|
|
|
|
+ List<Date> allDate = dateToWeek(newDate);
|
|
|
|
|
+ String startTimeStr = sdf.format(allDate.get(0));
|
|
|
|
|
+ String endTimeStr = sdf.format(allDate.get(6));
|
|
|
|
|
+ ResultData<List<Map<String, Object>>> dutyData=remoteDutyService.selectDutyUserList(labId,startTimeStr,endTimeStr);
|
|
|
|
|
+ if(null==dutyData || dutyData.getCode()!=HttpStatus.SUCCESS){
|
|
|
|
|
+ return ResultData.fail("值班人员列表获取失败!");
|
|
|
|
|
+ }
|
|
|
|
|
+ //处理人员信息,根据一周的日期分组
|
|
|
|
|
+ return ResultData.success(groupPersonInfo(allDate,dutyData.getData(),sdf));
|
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
- return ResultData.success(dutyData.getData());
|
|
|
|
|
|
|
+ return ResultData.fail("日期格式有误,请联系管理员!!");
|
|
|
|
|
+// ResultData<List<Map<String, Object>>> dutyData=remoteDutyService.selectDutyUserList(labId,startTime,endTime);
|
|
|
|
|
+// if(null==dutyData || dutyData.getCode()!=HttpStatus.SUCCESS){
|
|
|
|
|
+// return ResultData.fail("值班人员列表获取失败!");
|
|
|
|
|
+// }
|
|
|
|
|
+// return ResultData.success(dutyData.getData());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "巡查人员列表")
|
|
@ApiOperation(value = "巡查人员列表")
|
|
|
- @GetMapping(value = "/signUserList")
|
|
|
|
|
- public ResultData signUserList(@RequestParam String startTime,@RequestParam String endTime,@RequestParam Long labId) {
|
|
|
|
|
-
|
|
|
|
|
- return ResultData.success();
|
|
|
|
|
|
|
+ @GetMapping(value = "/inspectUserList")
|
|
|
|
|
+ public ResultData inspectUserList(@RequestParam Long labId,@RequestParam String startTime) {
|
|
|
|
|
+ //处理当前实验,获取当前时间的这一周的开始时间和结束时间
|
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
+ try {
|
|
|
|
|
+ Date newDate = sdf.parse(startTime);
|
|
|
|
|
+ List<Date> allDate = dateToWeek(newDate);
|
|
|
|
|
+ String startTimeStr = sdf.format(allDate.get(0));
|
|
|
|
|
+ String endTimeStr = sdf.format(allDate.get(6));
|
|
|
|
|
+ ResultData<List<Map<String, Object>>> dutyData=remoteDutyService.selectUserXxpInspectionList(labId,startTimeStr,endTimeStr);
|
|
|
|
|
+ if(null==dutyData || dutyData.getCode()!=HttpStatus.SUCCESS){
|
|
|
|
|
+ return ResultData.fail("巡查人员列表获取失败!");
|
|
|
|
|
+ }
|
|
|
|
|
+ //处理人员信息,根据一周的日期分组
|
|
|
|
|
+ return ResultData.success(groupPersonInfo(allDate,dutyData.getData(),sdf));
|
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ return ResultData.fail("日期格式有误,请联系管理员!!");
|
|
|
|
|
+// ResultData<List<Map<String, Object>>> dutyData=remoteDutyService.selectUserXxpInspectionList(labId,startTime,endTime);
|
|
|
|
|
+// if(null==dutyData || dutyData.getCode()!=HttpStatus.SUCCESS){
|
|
|
|
|
+// return ResultData.fail("值班人员列表获取失败!");
|
|
|
|
|
+// }
|
|
|
|
|
+// return ResultData.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "实验室签到人员")
|
|
@ApiOperation(value = "实验室签到人员")
|
|
@@ -164,8 +224,8 @@ public class LabBoardApi {
|
|
|
|
|
|
|
|
@ApiOperation(value = "安全准入人员列表")
|
|
@ApiOperation(value = "安全准入人员列表")
|
|
|
@GetMapping(value = "/securityUserList")
|
|
@GetMapping(value = "/securityUserList")
|
|
|
- public ResultData securityUserList(@RequestParam Integer pageNumber,@RequestParam Integer pageSize,@RequestParam Long labId) {
|
|
|
|
|
- ResultData securityData=remoteDutyService.securityApplyList(pageNumber,pageSize,labId);
|
|
|
|
|
|
|
+ public ResultData securityUserList(@RequestParam Long labId,@RequestParam Integer pageNumber,@RequestParam Integer pageSize) {
|
|
|
|
|
+ ResultData securityData=remoteDutyService.securityApplyList(labId,pageNumber,pageSize);
|
|
|
if(null==securityData || securityData.getCode()!=HttpStatus.SUCCESS){
|
|
if(null==securityData || securityData.getCode()!=HttpStatus.SUCCESS){
|
|
|
return ResultData.fail("安全准入人员获取失败!");
|
|
return ResultData.fail("安全准入人员获取失败!");
|
|
|
}
|
|
}
|
|
@@ -194,7 +254,308 @@ public class LabBoardApi {
|
|
|
if(null==resultData || resultData.getCode()!=200){
|
|
if(null==resultData || resultData.getCode()!=200){
|
|
|
return ResultData.fail("获取摄像头编号失败!");
|
|
return ResultData.fail("获取摄像头编号失败!");
|
|
|
}
|
|
}
|
|
|
- ResultData data=remoteDutyService.selectSubjectCameraList(resultData.getData(),null,1,5000);
|
|
|
|
|
|
|
+ ResultData data=remoteXxpService.selectSubjectCameraList(resultData.getData(),null,1,5000);
|
|
|
return data;
|
|
return data;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询实验室视频监控列表信息
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "根据一体机编号获取实验室id")
|
|
|
|
|
+ @GetMapping(value = "/getSubjectIdByNum/{num}")
|
|
|
|
|
+ public ResultData getSubjectIdByNum(@PathVariable("num") String num) {
|
|
|
|
|
+ ResultData<String> resultData=remoteDutyService.querySubInfoByNumber(num);
|
|
|
|
|
+ R<SysLogoConfigVO> sysLogo = remoteUserService.getConfigLogo();
|
|
|
|
|
+ if(null==resultData || resultData.getCode()!=200){
|
|
|
|
|
+ return ResultData.fail("获取实验室编号失败!");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sysLogo == null || sysLogo.getCode() != 200) {
|
|
|
|
|
+ return ResultData.fail(500, "获取logo失败!");
|
|
|
|
|
+ }
|
|
|
|
|
+ Object subjectId=resultData.getData();
|
|
|
|
|
+ String isRelationGuard="2";
|
|
|
|
|
+ String authType="";
|
|
|
|
|
+ Map<String,Object> map= new HashMap<>();
|
|
|
|
|
+ if(StringUtils.isNull(subjectId)){
|
|
|
|
|
+ ResultData xxpMap=remoteDutyService.XxpCardInfoByCard(num);
|
|
|
|
|
+ Object obj=xxpMap.getData();
|
|
|
|
|
+ if (obj == null) {
|
|
|
|
|
+ return ResultData.fail("获取实验室编号失败!");
|
|
|
|
|
+ }
|
|
|
|
|
+ Map<String,Object> dataMap= (Map<String, Object>) xxpMap.getData();
|
|
|
|
|
+ subjectId=String.valueOf(dataMap.get("subjectId"));
|
|
|
|
|
+ isRelationGuard=String.valueOf(dataMap.get("isRelationGuard"));
|
|
|
|
|
+ authType=String.valueOf(dataMap.get("authType"));
|
|
|
|
|
+ }
|
|
|
|
|
+ map.put("labId",subjectId);
|
|
|
|
|
+ map.put("authType",authType);
|
|
|
|
|
+ map.put("isRelationGuard",isRelationGuard);
|
|
|
|
|
+ map.put("logoutTime",sysLogo.getData().getLogoutTime());
|
|
|
|
|
+ map.put("returnTime",sysLogo.getData().getReturnTime());
|
|
|
|
|
+ map.put("isStart",sysLogo.getData().getIsStart());
|
|
|
|
|
+ return ResultData.success(map);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ //处理分组一周内的人员信息
|
|
|
|
|
+ public DutyPersonVo groupPersonInfo(List<Date> allDate,List<Map<String, Object>> personList,SimpleDateFormat sdf){
|
|
|
|
|
+ StringBuffer startTimeStr = new StringBuffer();
|
|
|
|
|
+ DutyPersonVo dutyPersonVo = new DutyPersonVo();
|
|
|
|
|
+ for(int i=0;i<allDate.size();i++){
|
|
|
|
|
+ if(i==0){
|
|
|
|
|
+ startTimeStr.append(sdf.format(allDate.get(i)));
|
|
|
|
|
+ Optional.ofNullable(personList).orElseGet(Collections::emptyList)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .forEach(a->{
|
|
|
|
|
+ if(startTimeStr.toString().equals(a.get("dutyTime"))){
|
|
|
|
|
+ dutyPersonVo.getWeekday1().add(a);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }else if(i==1){
|
|
|
|
|
+ startTimeStr.append(sdf.format(allDate.get(i)));
|
|
|
|
|
+ Optional.ofNullable(personList).orElseGet(Collections::emptyList)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .forEach(a->{
|
|
|
|
|
+ if(startTimeStr.toString().equals(a.get("dutyTime"))){
|
|
|
|
|
+ dutyPersonVo.getWeekday2().add(a);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }else if(i==2){
|
|
|
|
|
+ startTimeStr.append(sdf.format(allDate.get(i)));
|
|
|
|
|
+ Optional.ofNullable(personList).orElseGet(Collections::emptyList)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .forEach(a->{
|
|
|
|
|
+ if(startTimeStr.toString().equals(a.get("dutyTime"))){
|
|
|
|
|
+ dutyPersonVo.getWeekday3().add(a);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }else if(i==3){
|
|
|
|
|
+ startTimeStr.append(sdf.format(allDate.get(i)));
|
|
|
|
|
+ Optional.ofNullable(personList).orElseGet(Collections::emptyList)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .forEach(a->{
|
|
|
|
|
+ if(startTimeStr.toString().equals(a.get("dutyTime"))){
|
|
|
|
|
+ dutyPersonVo.getWeekday4().add(a);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }else if(i==4){
|
|
|
|
|
+ startTimeStr.append(sdf.format(allDate.get(i)));
|
|
|
|
|
+ Optional.ofNullable(personList).orElseGet(Collections::emptyList)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .forEach(a->{
|
|
|
|
|
+ if(startTimeStr.toString().equals(a.get("dutyTime"))){
|
|
|
|
|
+ dutyPersonVo.getWeekday5().add(a);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }else if(i==5){
|
|
|
|
|
+ startTimeStr.append(sdf.format(allDate.get(i)));
|
|
|
|
|
+ Optional.ofNullable(personList).orElseGet(Collections::emptyList)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .forEach(a->{
|
|
|
|
|
+ if(startTimeStr.toString().equals(a.get("dutyTime"))){
|
|
|
|
|
+ dutyPersonVo.getWeekday6().add(a);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }else if(i==6){
|
|
|
|
|
+ startTimeStr.append(sdf.format(allDate.get(i)));
|
|
|
|
|
+ Optional.ofNullable(personList).orElseGet(Collections::emptyList)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .forEach(a->{
|
|
|
|
|
+ if(startTimeStr.toString().equals(a.get("dutyTime"))){
|
|
|
|
|
+ dutyPersonVo.getWeekday7().add(a);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ startTimeStr.delete(0,startTimeStr.length());
|
|
|
|
|
+ }
|
|
|
|
|
+ return dutyPersonVo;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public List<Date> dateToWeek(Date mdate) {
|
|
|
|
|
+ List<Date> allDate = new ArrayList <>();
|
|
|
|
|
+ for(int i=0;i<7;i++){
|
|
|
|
|
+ Calendar calendar = new GregorianCalendar();
|
|
|
|
|
+ calendar.setTime(mdate);
|
|
|
|
|
+ calendar.add(calendar.DATE,i); //把日期往后增加一天,整数 往后推,负数往前移动
|
|
|
|
|
+ allDate.add(calendar.getTime());//这个时间就是日期往后推一天的结果
|
|
|
|
|
+ }
|
|
|
|
|
+ return allDate;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 电子信息牌获取准入人员的指纹信息列表
|
|
|
|
|
+ * @param labId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "电子信息牌获取准入人员的指纹信息列表")
|
|
|
|
|
+ @GetMapping(value = "/getFingerList")
|
|
|
|
|
+ public ResultData getFingerList(@RequestParam("labId") Long labId) {
|
|
|
|
|
+ ResultData resultData=remoteDutyService.securityFingerList(labId);
|
|
|
|
|
+ return resultData;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 电子信息牌获取准入人员的指纹信息列表
|
|
|
|
|
+ * @param labId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "刷卡是否可以开门禁")
|
|
|
|
|
+ @GetMapping(value = "/getCardIsOpen")
|
|
|
|
|
+ public ResultData getCardIsOpen(@RequestParam("labId") Long labId,@RequestParam("cardNum") String cardNum) {
|
|
|
|
|
+ if(StringUtils.isNull(cardNum) || StringUtils.isEmpty(cardNum)){
|
|
|
|
|
+ return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ logger.info("转换前cardNum:"+cardNum);
|
|
|
|
|
+ cardNum= HexStrUtils.decode(cardNum);
|
|
|
|
|
+ logger.info("转换后cardNum:"+cardNum);
|
|
|
|
|
+ ResultData resultData=remoteDutyService.securityNumList(labId,cardNum);
|
|
|
|
|
+ if(resultData==null && resultData.getCode()!=HttpStatus.SUCCESS){
|
|
|
|
|
+ return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ Object resultObj=resultData.getData();
|
|
|
|
|
+ if(null==resultObj){
|
|
|
|
|
+ return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ return resultData;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 电子信息牌获取准入人员的指纹信息列表
|
|
|
|
|
+ * @param labId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "刷卡验证")
|
|
|
|
|
+ @GetMapping(value = "/cardValidate")
|
|
|
|
|
+ public ResultData cardValidate(@RequestParam("labId") Long labId,@RequestParam("cardNum") String cardNum) {
|
|
|
|
|
+ logger.info("转换前cardNum:"+cardNum);
|
|
|
|
|
+ if(StringUtils.isNull(cardNum) || StringUtils.isEmpty(cardNum)){
|
|
|
|
|
+ return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ cardNum= HexStrUtils.decode(cardNum);
|
|
|
|
|
+ logger.info("转换后cardNum:"+cardNum);
|
|
|
|
|
+ ResultData resultData=remoteDutyService.securityNumList(labId,cardNum);
|
|
|
|
|
+ if(resultData==null && resultData.getCode()!=HttpStatus.SUCCESS){
|
|
|
|
|
+ return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ Object resultObj=resultData.getData();
|
|
|
|
|
+ if(null==resultObj){
|
|
|
|
|
+ return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ return resultData;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 电子信息牌指纹录入
|
|
|
|
|
+ * @param xxpUserAuthVo
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "指纹录入")
|
|
|
|
|
+ @PostMapping(value = "/addUserFinger")
|
|
|
|
|
+ public ResultData addUserFinger(@RequestBody XxpUserAuthVo xxpUserAuthVo) {
|
|
|
|
|
+ ResultData resultData=remoteDutyService.addUserAuth(xxpUserAuthVo);
|
|
|
|
|
+ return resultData;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据用户查询指纹列表
|
|
|
|
|
+ * @param userId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "根据用户查询指纹列表")
|
|
|
|
|
+ @GetMapping(value = "/getFingerByUserId")
|
|
|
|
|
+ public ResultData getFingerByUserId(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId){
|
|
|
|
|
+ ResultData resultData=remoteDutyService.getFingerByUserId(labId,userId);
|
|
|
|
|
+ return resultData;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据id删除指纹
|
|
|
|
|
+ * @param id
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "根据id删除指纹")
|
|
|
|
|
+ @GetMapping(value = "/deleteFingerById")
|
|
|
|
|
+ public ResultData deleteFingerById(@RequestParam Long id){
|
|
|
|
|
+ ResultData resultData=remoteDutyService.deleteFingerById(id);
|
|
|
|
|
+ if(null==resultData || resultData.getCode()!=HttpStatus.SUCCESS){
|
|
|
|
|
+ return ResultData.fail("删除指纹失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ return ResultData.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 密码验证
|
|
|
|
|
+ * @param num
|
|
|
|
|
+ * @param pwd
|
|
|
|
|
+ * @param labId
|
|
|
|
|
+ * @param userId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "密码验证")
|
|
|
|
|
+ @GetMapping(value = "/pwdValidate")
|
|
|
|
|
+ public ResultData pwdValidate(@RequestParam("num") String num,@RequestParam("pwd") String pwd,@RequestParam("labId") Long labId,@RequestParam("userId") Long userId){
|
|
|
|
|
+ return remoteDutyService.pwdValidate(num,pwd,labId,userId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 大海里找鱼
|
|
|
|
|
+ * @param faceCompare
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "人脸识别")
|
|
|
|
|
+ @PostMapping(value = "/multiFaceDetection")
|
|
|
|
|
+ public ResultData multiFaceDetection(@RequestBody FaceCompare faceCompare){
|
|
|
|
|
+ return remoteFaceService.multiFaceDetection(faceCompare);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 人脸识别获取特征值
|
|
|
|
|
+ * @param file
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "人脸识别获取特征值")
|
|
|
|
|
+ @PostMapping(value = "/faceFeature")
|
|
|
|
|
+ public R<byte[]> faceFeature(@RequestParam("file") MultipartFile file){
|
|
|
|
|
+ return remoteFaceService.upload(file);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 人脸识别获取特征值
|
|
|
|
|
+ * @param xxpInspectionVo
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "巡查签到")
|
|
|
|
|
+ @PostMapping(value = "/XxpInspection/addInspection/signIn")
|
|
|
|
|
+ public ResultData addInspection(@RequestBody XxpInspectionVo xxpInspectionVo){
|
|
|
|
|
+ ResultData resultData= remoteDutyService.addInspection(xxpInspectionVo);
|
|
|
|
|
+ return resultData;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 人脸识别获取特征值
|
|
|
|
|
+ * @param labId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "巡查签退")
|
|
|
|
|
+ @PostMapping(value = "/XxpInspection/addInspection/signOut")
|
|
|
|
|
+ public ResultData updateInspection(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId){
|
|
|
|
|
+ return remoteDutyService.updateInspection(labId,userId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "判断是巡查签到还是准入签到 1巡查 2准入")
|
|
|
|
|
+ @PostMapping(value = "/XxpInspection/isSignInType")
|
|
|
|
|
+ public ResultData isSignInType(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId) {
|
|
|
|
|
+ return remoteDutyService.isSignInType(labId,userId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|