|
|
@@ -38,9 +38,12 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.net.URLDecoder;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static com.template.common.utils.AesTestOne.decrypt;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 前端控制器
|
|
|
@@ -132,6 +135,12 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
return CommonResult.fail("当前数据不存在,删除失败!");
|
|
|
}
|
|
|
|
|
|
+ //region 推送到希沃班牌,通知访客记录取消
|
|
|
+ //endregion
|
|
|
+ //region 删除百胜中的访客数据
|
|
|
+ //endregion
|
|
|
+
|
|
|
+
|
|
|
int result = smartVisitorService.deleteSmartVisitorById(id);
|
|
|
|
|
|
return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
|
|
|
@@ -242,8 +251,8 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public CommonResult appointmentPageRecord(int currentPage, int pageCount, Integer userId, int type) {
|
|
|
- PageUtils<VisitorPageVo> result = smartVisitorService.smartVisitorPageByUserId(currentPage, pageCount, userId, type);
|
|
|
+ public CommonResult appointmentPageRecord(int currentPage, int pageCount, Integer userId, int type, String createStartTime, String createEndTime, String keyWord, String visitorStartTime, String visitorEndTime) {
|
|
|
+ PageUtils<VisitorPageVo> result = smartVisitorService.smartVisitorPageByUserId(currentPage, pageCount, userId, type, createStartTime, createEndTime, keyWord, visitorStartTime, visitorEndTime);
|
|
|
|
|
|
return CommonResult.ok(result);
|
|
|
}
|
|
|
@@ -265,6 +274,11 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
return CommonResult.fail("访客记录已失效,审核失败!");
|
|
|
}
|
|
|
|
|
|
+ //审核处理后的数据不能再处理判断
|
|
|
+ if(visitor.getStatu().intValue() != eApproveStatu.Audit.getValue()){
|
|
|
+ return CommonResult.fail("该记录已被操作过,请勿重复操作");
|
|
|
+ }
|
|
|
+
|
|
|
try {
|
|
|
if (type == eExamineStatu.Agree.getValue()) {
|
|
|
visitor.setStatu(eApproveStatu.Pushed.getValue());
|
|
|
@@ -315,6 +329,10 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
if (!result.contains("预约成功")) {
|
|
|
throw new Exception("审核失败");
|
|
|
}
|
|
|
+
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ BsReservationVo reservation = objectMapper.readValue(result, BsReservationVo.class);
|
|
|
+ visitor.setBsOrderNo(reservation.getData().getReOrderNo());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -428,7 +446,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
return CommonResult.ok(result);
|
|
|
}
|
|
|
|
|
|
- result = smartVisitorService.queryVisitorPageDatas(currentPage, pageCount, type, studentIds, studentIds != null && whereSql != null ? "or "+ whereSql : whereSql);
|
|
|
+ result = smartVisitorService.queryVisitorPageDatas(currentPage, pageCount, type, studentIds, studentIds != null && whereSql != null ? "or " + whereSql : whereSql);
|
|
|
|
|
|
return CommonResult.ok(result);
|
|
|
}
|
|
|
@@ -438,28 +456,28 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
TurnOnDeviceVo result = new TurnOnDeviceVo();
|
|
|
|
|
|
//region 参数判断
|
|
|
- if(data == null){
|
|
|
+ if (data == null) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("扫码参数不能为空");
|
|
|
result.setActionName("qrCodePush");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- if(data.getActionName() == null){
|
|
|
+ if (data.getActionName() == null) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("指令不能为空");
|
|
|
result.setActionName("qrCodePush");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- if(!data.getActionName().equals("qrCodePush")){
|
|
|
+ if (!data.getActionName().equals("qrCodePush")) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("指令错误");
|
|
|
result.setActionName("qrCodePush");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- if(data.getData() == null){
|
|
|
+ if (data.getData() == null) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("二维码内容不能为空");
|
|
|
result.setActionName("qrCodePush");
|
|
|
@@ -468,28 +486,28 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
qrCodeVo codeVo = objectMapper.readValue(data.getData(), qrCodeVo.class);
|
|
|
- if(codeVo == null){
|
|
|
+ if (codeVo == null) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("二维码内容不能为空");
|
|
|
result.setActionName("qrCodePush");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- if(codeVo.getQrCode() == null){
|
|
|
+ if (codeVo.getQrCode() == null) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("二维码内容不能为空");
|
|
|
result.setActionName("qrCodePush");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- if(data.getDeviceno() == null){
|
|
|
+ if (data.getDeviceno() == null) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("设备编号不能为空");
|
|
|
result.setActionName("qrCodePush");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- if(data.getVersion() == null){
|
|
|
+ if (data.getVersion() == null) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("版本不能为空");
|
|
|
result.setActionName("qrCodePush");
|
|
|
@@ -501,7 +519,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
QrcodeImageVo qiv = objectMapper.readValue(codeVo.getQrCode(), QrcodeImageVo.class);
|
|
|
|
|
|
SmartUser user = smartUserService.getSmartById(qiv.getId());
|
|
|
- if(user == null){
|
|
|
+ if (user == null) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("用户身份无效,刷码失败");
|
|
|
result.setActionName("qrCodePush");
|
|
|
@@ -511,8 +529,8 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
//目前二维码一分钟内有效
|
|
|
//过期:(时间戳 + 有效期分钟数)<= 当前时间
|
|
|
//时间戳转时间
|
|
|
- Date dateNow = TimeExchange.StringToDate(TimeExchange.TimeRangeI10(qiv.getTimestamp(), 1),"yyyy-MM-dd HH:mm:ss");
|
|
|
- if(dateNow.compareTo(new Date()) < 0){
|
|
|
+ Date dateNow = TimeExchange.StringToDate(TimeExchange.TimeRangeI10(qiv.getTimestamp(), 1), "yyyy-MM-dd HH:mm:ss");
|
|
|
+ if (dateNow.compareTo(new Date()) < 0) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("身份码已过期");
|
|
|
result.setActionName("qrCodePush");
|
|
|
@@ -527,7 +545,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
|
|
|
|
|
|
int insertResult = smartQrcodeService.insertSmartQrcode(sq);
|
|
|
- if(insertResult <= 0){
|
|
|
+ if (insertResult <= 0) {
|
|
|
result.setResultcode(2);
|
|
|
result.setMessage("新增刷码记录失败");
|
|
|
result.setActionName("qrCodePush");
|