|
|
@@ -308,7 +308,7 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
*/
|
|
|
public ResultData postSign(String code, SignEnum signEnum, byte[] face) {
|
|
|
try {
|
|
|
- logger.info("sign starting....,code:{},signEnum:{}",code,signEnum);
|
|
|
+ logger.info("[postSign] user sign starting....,code:{},signEnum:{}",code,signEnum);
|
|
|
if (StringUtils.isEmpty(code)) {
|
|
|
return ResultData.fail(600, "签到验证码错误,请重新刷卡重试!");
|
|
|
}
|
|
|
@@ -319,17 +319,16 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
} else {
|
|
|
String s = StrUtil.subAfter(code, "_", true);
|
|
|
if (signEnum.equals(SignEnum.SIGN_IN)) {
|
|
|
- logger.info("1111111签到调用人脸服务");
|
|
|
//调用人脸验证
|
|
|
R r;
|
|
|
if (null != face) {
|
|
|
+ logger.info("[postSign] face verification was starting...");
|
|
|
r = faceCompare(user.getUserId(), face);
|
|
|
//验证失败刷新验证码时间
|
|
|
- logger.info("r.getCode():" + r.getCode());
|
|
|
if (r.getCode() != 200) {
|
|
|
return ResultData.fail(r.getMsg());
|
|
|
}
|
|
|
- logger.info("2222222人脸服务调用完成!");
|
|
|
+ logger.info("[postSign] face verification was successful!");
|
|
|
}
|
|
|
//插入进入实验室记录
|
|
|
LabSubjectAccessRecordVo subjectAccessRecord = new LabSubjectAccessRecordVo();
|
|
|
@@ -340,7 +339,7 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
long l = subjectAccessRecordService.leaveAgainSign(subjectAccessRecord);
|
|
|
//
|
|
|
if (l > 0) {
|
|
|
- logger.info("leaveAgainSign successfully,param:{}",JSON.toJSONString(subjectAccessRecord));
|
|
|
+ logger.info("[postSign] leaveAgainSign successful,param:{}",JSON.toJSONString(subjectAccessRecord));
|
|
|
redisService.deleteObject(verifyKey);
|
|
|
//增加一个key 用记录ID作为key,值是实验室ID 有效期两分钟
|
|
|
redisService.setCacheObject(BaseConstants.SINGIN_id_KEY + subjectAccessRecord.getId(), Long.parseLong(s), 2L, TimeUnit.MINUTES);
|
|
|
@@ -372,7 +371,7 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
// 用户签到成功检测有无管控工作,有则发起通知
|
|
|
labGradeManageRecordService.sendManageMsgBySiginUser(user.getUserId(), Long.parseLong(s));
|
|
|
|
|
|
- logger.info("333333用户签到完成!");
|
|
|
+ logger.info("[postSign] user sign in successful ");
|
|
|
return ResultData.result(subjectAccessRecord.getId());
|
|
|
} else if (signEnum.equals(SignEnum.SIGN_OUT)) {
|
|
|
redisService.deleteObject(verifyKey);
|
|
|
@@ -399,6 +398,7 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
// 这里需要给管控页面推送一个消息
|
|
|
messageSendService.builUserByChange(floorVo.getBuildId());
|
|
|
}
|
|
|
+ logger.info("[postSign] user sign out successful ");
|
|
|
return ResultData.result(true);
|
|
|
}
|
|
|
}
|
|
|
@@ -413,10 +413,10 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
* @return
|
|
|
*/
|
|
|
public R commitSign(Long id) {
|
|
|
- logger.info("*************id:{}",id);
|
|
|
String key = BaseConstants.SINGIN_id_KEY + id;
|
|
|
logger.info("commitSign starting,id:{}",id);
|
|
|
Long subId = redisService.getCacheObject(key);
|
|
|
+ logger.info("the query cache was successful,key:{},subId:{}",key,subId);
|
|
|
if (subId == null) {
|
|
|
return R.fail(600, "签到已超时,请重新刷卡重试!");
|
|
|
}
|
|
|
@@ -432,16 +432,16 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
.filter(a -> StrUtil.isNotBlank(a))
|
|
|
.ifPresent(a -> {
|
|
|
String[] split = a.split(",");
|
|
|
- logger.info("split:{}",split.toString());
|
|
|
+ logger.info("check item are : {}",split.toString());
|
|
|
//获取检查记录
|
|
|
List<String> strings = labSubAccessCheckLogService.selectSuccessTypeBySignId(id);
|
|
|
- logger.info("subject access check in logs:{}", JSON.toJSONString(strings));
|
|
|
+ logger.info("subject access check in logs,codes:{}", JSON.toJSONString(strings));
|
|
|
if (CollUtil.isEmpty(strings) || strings.size() != split.length) {
|
|
|
- logger.error("fail 1");
|
|
|
+ logger.error("the check failed ,check item number are inconsistent");
|
|
|
throw new ServiceException("未完成全部检查记录!");
|
|
|
}
|
|
|
Arrays.stream(split).filter(b -> !strings.contains(b)).findFirst().ifPresent(b -> {
|
|
|
- logger.error("fail 2,b:{}",b);
|
|
|
+ logger.error("the check failed ,check item value are inconsistent,b:{}",b);
|
|
|
throw new ServiceException("未完成全部检查记录!");
|
|
|
});
|
|
|
});
|
|
|
@@ -450,7 +450,7 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
//更新签到记录
|
|
|
boolean b = subjectAccessRecordService.updateCheck(id);
|
|
|
if (!b) {
|
|
|
- logger.error("updateCheck fail");
|
|
|
+ logger.error("update access record failed");
|
|
|
throw new ServiceException("更新签到记录失败!!");
|
|
|
}
|
|
|
|
|
|
@@ -458,7 +458,7 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
redisService.deleteObject(key);
|
|
|
LabSubjectAccessRecord labSubjectAccessRecord = subjectAccessRecordService.selectLabSubjectAccessRecordById(id);
|
|
|
if (null == labSubjectAccessRecord) {
|
|
|
- logger.error("query sign record fail");
|
|
|
+ logger.error("query access record failed");
|
|
|
throw new ServiceException("查询签到记录失败!!");
|
|
|
}
|
|
|
|
|
|
@@ -466,12 +466,12 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
}
|
|
|
|
|
|
public R faceCompare(Long userId, byte[] face) {
|
|
|
- logger.info("*********" + userId + "*********");
|
|
|
+ logger.info("remote call to the face service starting...,userId:{}",userId);
|
|
|
FaceCompare faceCompare = new FaceCompare();
|
|
|
faceCompare.setUserId(userId);
|
|
|
faceCompare.setData(face);
|
|
|
R compare = remoteFaceService.compare(faceCompare);
|
|
|
- logger.info("***********compare.getCode()" + compare.getCode());
|
|
|
+ logger.info("remote call to the face service end !,code:{}",compare.getCode());
|
|
|
return compare;
|
|
|
}
|
|
|
|
|
|
@@ -631,7 +631,7 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
*/
|
|
|
public ResultData lotPostSignIn(String code, byte[] face) {
|
|
|
try {
|
|
|
- logger.info("&&&&&&&&&&&&&&&&&&&&&&" + code + ",");
|
|
|
+ logger.info("[lotPostSignIn] user sign starting....,code:{}",code);
|
|
|
if (StringUtils.isEmpty(code)) {
|
|
|
ResultData.fail(600, "签到验证码错误,请重新刷卡重试!");
|
|
|
}
|
|
|
@@ -641,17 +641,16 @@ public class OneMachineService implements ValidationSignInPerInfo {
|
|
|
ResultData.fail(600, "签到&签出人脸已超时,请重新刷卡重试!");
|
|
|
}
|
|
|
if (user != null) {
|
|
|
- logger.info("1111111签到调用人脸服务");
|
|
|
+ logger.info("[lotPostSignIn] face verification was starting...");
|
|
|
//调用人脸验证
|
|
|
R r = faceCompare(user.getUserId(), face);
|
|
|
//验证失败刷新验证码时间
|
|
|
if (r.getCode() != 200) {
|
|
|
return ResultData.fail(r.getMsg());
|
|
|
}
|
|
|
- logger.info("2222222人脸服务调用完成!");
|
|
|
+ logger.info("[lotPostSignIn] face verification was successful!");
|
|
|
|
|
|
-
|
|
|
- logger.info("333333用户签到完成!");
|
|
|
+ logger.info("[lotPostSignIn] user sign successful ");
|
|
|
return ResultData.success();
|
|
|
}
|
|
|
} catch (Exception e) {
|