|
@@ -203,7 +203,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String startTime = par.getVisitorTime();
|
|
String startTime = par.getVisitorTime();
|
|
|
- String endTime = TimeExchange.AddTimeDesH(TimeExchange.StringToDate(startTime, "yyyy-MM-dd HH:mm:ss"),4);
|
|
|
|
|
|
|
+ String endTime = TimeExchange.AddTimeDesH(TimeExchange.StringToDate(startTime, "yyyy-MM-dd HH:mm:ss"), 4);
|
|
|
|
|
|
|
|
//要进行家长数据重复判断
|
|
//要进行家长数据重复判断
|
|
|
//那是不是第二次预约的时间不能在那个可访问的时间段内
|
|
//那是不是第二次预约的时间不能在那个可访问的时间段内
|
|
@@ -261,8 +261,26 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
}
|
|
}
|
|
|
// 门禁配置
|
|
// 门禁配置
|
|
|
Integer accessConfig = svpc.getAccessConfig();
|
|
Integer accessConfig = svpc.getAccessConfig();
|
|
|
- if (0 == accessConfig) {
|
|
|
|
|
- try {
|
|
|
|
|
|
|
+// 车闸配置
|
|
|
|
|
+ Integer carConfig = svpc.getCarConfig();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (0 == accessConfig) {
|
|
|
|
|
+ List<SmartDevice> devices = smartDeviceService.queryOnLineDevice();
|
|
|
|
|
+ String visitorNo = getUUIDBits(16);
|
|
|
|
|
+ //region 将访客数据下发到设备
|
|
|
|
|
+ for (SmartDevice device : devices) {
|
|
|
|
|
+ CommonResult<String> insertVisitor = bsInsertVisitor(su, TimeExchange.DateToString(sv.getVisitorTime()), TimeExchange.DateToString(sv.getVisitorDeadline()), device.getNum(), visitorNo);
|
|
|
|
|
+ if (!insertVisitor.isSuccess()) {
|
|
|
|
|
+ throw new Exception(insertVisitor.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ sv.setVisitorsync(sv.getVisitorsync() == null ? insertVisitor.getData() : (sv.getVisitorsync() + "," + insertVisitor.getData()));
|
|
|
|
|
+ sv.setDeviceNum(sv.getDeviceNum() == null ? device.getNum() : (sv.getDeviceNum() + "," + device.getNum()));
|
|
|
|
|
+ }
|
|
|
|
|
+ String code = GetVertifyCode.getRandomNumCode(6);
|
|
|
|
|
+ sv.setVisitorCode(code);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (0 == carConfig) {
|
|
|
if (!ObjectUtils.isEmpty(sv.getCarNum())) {
|
|
if (!ObjectUtils.isEmpty(sv.getCarNum())) {
|
|
|
String appId = parkConfig.getAppId();
|
|
String appId = parkConfig.getAppId();
|
|
|
String carNo = sv.getCarNum();
|
|
String carNo = sv.getCarNum();
|
|
@@ -301,25 +319,12 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
BsReservationVo reservation = objectMapper.readValue(result, BsReservationVo.class);
|
|
BsReservationVo reservation = objectMapper.readValue(result, BsReservationVo.class);
|
|
|
sv.setBsOrderNo(reservation.getData().getReOrderNo());
|
|
sv.setBsOrderNo(reservation.getData().getReOrderNo());
|
|
|
- } else {
|
|
|
|
|
- List<SmartDevice> devices = smartDeviceService.queryOnLineDevice();
|
|
|
|
|
- String visitorNo = getUUIDBits(16);
|
|
|
|
|
- //region 将访客数据下发到设备
|
|
|
|
|
- for (SmartDevice device : devices) {
|
|
|
|
|
- CommonResult<String> insertVisitor = bsInsertVisitor(su, TimeExchange.DateToString(sv.getVisitorTime()), TimeExchange.DateToString(sv.getVisitorDeadline()), device.getNum(), visitorNo);
|
|
|
|
|
- if (!insertVisitor.isSuccess()) {
|
|
|
|
|
- throw new Exception(insertVisitor.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
- sv.setVisitorsync(sv.getVisitorsync() == null ? insertVisitor.getData() : (sv.getVisitorsync() + "," + insertVisitor.getData()));
|
|
|
|
|
- sv.setDeviceNum(sv.getDeviceNum() == null ? device.getNum() : (sv.getDeviceNum() + "," + device.getNum()));
|
|
|
|
|
- }
|
|
|
|
|
- String code = GetVertifyCode.getRandomNumCode(6);
|
|
|
|
|
- sv.setVisitorCode(code);
|
|
|
|
|
}
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- throw new RuntimeException(e);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
svs.add(sv);
|
|
svs.add(sv);
|
|
@@ -347,7 +352,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String startTime = oar.getVisitorTime();
|
|
String startTime = oar.getVisitorTime();
|
|
|
- String endTime = TimeExchange.AddTimeDesH(TimeExchange.StringToDate(startTime, "yyyy-MM-dd HH:mm:ss"),4);
|
|
|
|
|
|
|
+ String endTime = TimeExchange.AddTimeDesH(TimeExchange.StringToDate(startTime, "yyyy-MM-dd HH:mm:ss"), 4);
|
|
|
|
|
|
|
|
//要进行访客数据重复判断
|
|
//要进行访客数据重复判断
|
|
|
//那是不是第二次预约的时间不能在那个可访问的时间段内
|
|
//那是不是第二次预约的时间不能在那个可访问的时间段内
|
|
@@ -381,8 +386,28 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
} else if (9 == auditConfig) {
|
|
} else if (9 == auditConfig) {
|
|
|
sv.setStatu(9);
|
|
sv.setStatu(9);
|
|
|
Integer accessConfig = smartVisitorRestsConfig.getAccessConfig();
|
|
Integer accessConfig = smartVisitorRestsConfig.getAccessConfig();
|
|
|
- if (0 == accessConfig) {//推送到门禁
|
|
|
|
|
- try {
|
|
|
|
|
|
|
+ Integer carConfig = smartVisitorRestsConfig.getCarConfig();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (0 == accessConfig) {//推送到门禁
|
|
|
|
|
+ List<SmartDevice> devices = smartDeviceService.queryOnLineDevice();
|
|
|
|
|
+ String visitorNo = getUUIDBits(16);
|
|
|
|
|
+ //region 将访客数据下发到设备
|
|
|
|
|
+ for (SmartDevice device : devices) {
|
|
|
|
|
+ CommonResult<String> insertVisitor = bsInsertVisitor(su, TimeExchange.DateToString(sv.getVisitorTime()), TimeExchange.DateToString(sv.getVisitorDeadline()), device.getNum(), visitorNo);
|
|
|
|
|
+ if (!insertVisitor.isSuccess()) {
|
|
|
|
|
+ throw new Exception(insertVisitor.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ sv.setVisitorsync(sv.getVisitorsync() == null ? insertVisitor.getData() : (sv.getVisitorsync() + "," + insertVisitor.getData()));
|
|
|
|
|
+ sv.setDeviceNum(sv.getDeviceNum() == null ? device.getNum() : (sv.getDeviceNum() + "," + device.getNum()));
|
|
|
|
|
+ }
|
|
|
|
|
+ String code = GetVertifyCode.getRandomNumCode(6);
|
|
|
|
|
+ sv.setVisitorCode(code);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ if (0 == carConfig) {
|
|
|
|
|
+// 车闸
|
|
|
if (!ObjectUtils.isEmpty(sv.getCarNum())) {
|
|
if (!ObjectUtils.isEmpty(sv.getCarNum())) {
|
|
|
String appId = parkConfig.getAppId();
|
|
String appId = parkConfig.getAppId();
|
|
|
String carNo = sv.getCarNum();
|
|
String carNo = sv.getCarNum();
|
|
@@ -421,35 +446,22 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
BsReservationVo reservation = objectMapper.readValue(result, BsReservationVo.class);
|
|
BsReservationVo reservation = objectMapper.readValue(result, BsReservationVo.class);
|
|
|
sv.setBsOrderNo(reservation.getData().getReOrderNo());
|
|
sv.setBsOrderNo(reservation.getData().getReOrderNo());
|
|
|
- } else {
|
|
|
|
|
- List<SmartDevice> devices = smartDeviceService.queryOnLineDevice();
|
|
|
|
|
- String visitorNo = getUUIDBits(16);
|
|
|
|
|
- //region 将访客数据下发到设备
|
|
|
|
|
- for (SmartDevice device : devices) {
|
|
|
|
|
- CommonResult<String> insertVisitor = bsInsertVisitor(su, TimeExchange.DateToString(sv.getVisitorTime()), TimeExchange.DateToString(sv.getVisitorDeadline()), device.getNum(), visitorNo);
|
|
|
|
|
- if (!insertVisitor.isSuccess()) {
|
|
|
|
|
- throw new Exception(insertVisitor.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
- sv.setVisitorsync(sv.getVisitorsync() == null ? insertVisitor.getData() : (sv.getVisitorsync() + "," + insertVisitor.getData()));
|
|
|
|
|
- sv.setDeviceNum(sv.getDeviceNum() == null ? device.getNum() : (sv.getDeviceNum() + "," + device.getNum()));
|
|
|
|
|
- }
|
|
|
|
|
- String code = GetVertifyCode.getRandomNumCode(6);
|
|
|
|
|
- sv.setVisitorCode(code);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- //发送短信给其他访客用户
|
|
|
|
|
- if (!ObjectUtils.isEmpty(sv.getVisitorCode())) {
|
|
|
|
|
- String message = SendSms.sendVisitorSms("+86" + sv.getUserPhone(), TimeExchange.getYear(sv.getVisitorTime()), TimeExchange.getMonth(sv.getVisitorTime()), TimeExchange.getDay(sv.getVisitorTime()), TimeExchange.getTime(sv.getVisitorTime()), TimeExchange.getTime(sv.getVisitorDeadline()), sv.getVisitorCode());
|
|
|
|
|
- if (!message.contains("success")) {
|
|
|
|
|
- throw new Exception("发送失败");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //发送短信给其他访客用户
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(sv.getVisitorCode())) {
|
|
|
|
|
+ String message = SendSms.sendVisitorSms("+86" + sv.getUserPhone(), TimeExchange.getYear(sv.getVisitorTime()), TimeExchange.getMonth(sv.getVisitorTime()), TimeExchange.getDay(sv.getVisitorTime()), TimeExchange.getTime(sv.getVisitorTime()), TimeExchange.getTime(sv.getVisitorDeadline()), sv.getVisitorCode());
|
|
|
|
|
+ if (!message.contains("success")) {
|
|
|
|
|
+ throw new Exception("发送失败");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- throw new RuntimeException(e);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int result = smartVisitorService.insertSmartVisitor(sv);
|
|
int result = smartVisitorService.insertSmartVisitor(sv);
|
|
@@ -655,8 +667,30 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
}
|
|
}
|
|
|
// 门禁配置
|
|
// 门禁配置
|
|
|
Integer accessConfig = svpc.getAccessConfig();
|
|
Integer accessConfig = svpc.getAccessConfig();
|
|
|
|
|
+// 车闸配置
|
|
|
|
|
+ Integer carConfig = svpc.getCarConfig();
|
|
|
if (0 == accessConfig) {
|
|
if (0 == accessConfig) {
|
|
|
-
|
|
|
|
|
|
|
+ //查找用户是否存在
|
|
|
|
|
+ SmartUser user = smartUserService.getSmartById(sv.getUserId());
|
|
|
|
|
+ if (user == null) {
|
|
|
|
|
+ throw new Exception("访客用户ID在系统中不存在,无法将访客信息下发到门禁设备!");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<SmartDevice> devices = smartDeviceService.queryOnLineDevice();
|
|
|
|
|
+ String visitorNo = getUUIDBits(16);
|
|
|
|
|
+ //region 将访客数据下发到设备
|
|
|
|
|
+ for (SmartDevice device : devices) {
|
|
|
|
|
+ CommonResult<String> insertVisitor = bsInsertVisitor(user, TimeExchange.DateToString(sv.getVisitorTime()), TimeExchange.DateToString(sv.getVisitorDeadline()), device.getNum(), visitorNo);
|
|
|
|
|
+ if (!insertVisitor.isSuccess()) {
|
|
|
|
|
+ throw new Exception(insertVisitor.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ sv.setVisitorsync(sv.getVisitorsync() == null ? insertVisitor.getData() : (sv.getVisitorsync() + "," + insertVisitor.getData()));
|
|
|
|
|
+ sv.setDeviceNum(sv.getDeviceNum() == null ? device.getNum() : (sv.getDeviceNum() + "," + device.getNum()));
|
|
|
|
|
+ }
|
|
|
|
|
+ String code = GetVertifyCode.getRandomNumCode(6);
|
|
|
|
|
+ sv.setVisitorCode(code);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (0 == carConfig) {
|
|
|
|
|
+// 车闸配置
|
|
|
if (!ObjectUtils.isEmpty(sv.getCarNum())) {
|
|
if (!ObjectUtils.isEmpty(sv.getCarNum())) {
|
|
|
String appId = parkConfig.getAppId();
|
|
String appId = parkConfig.getAppId();
|
|
|
String carNo = sv.getCarNum();
|
|
String carNo = sv.getCarNum();
|
|
@@ -695,29 +729,10 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
BsReservationVo reservation = objectMapper.readValue(result, BsReservationVo.class);
|
|
BsReservationVo reservation = objectMapper.readValue(result, BsReservationVo.class);
|
|
|
sv.setBsOrderNo(reservation.getData().getReOrderNo());
|
|
sv.setBsOrderNo(reservation.getData().getReOrderNo());
|
|
|
- } else {
|
|
|
|
|
- //查找用户是否存在
|
|
|
|
|
- SmartUser user = smartUserService.getSmartById(sv.getUserId());
|
|
|
|
|
- if (user == null) {
|
|
|
|
|
- throw new Exception("访客用户ID在系统中不存在,无法将访客信息下发到门禁设备!");
|
|
|
|
|
- }
|
|
|
|
|
- List<SmartDevice> devices = smartDeviceService.queryOnLineDevice();
|
|
|
|
|
- String visitorNo = getUUIDBits(16);
|
|
|
|
|
- //region 将访客数据下发到设备
|
|
|
|
|
- for (SmartDevice device : devices) {
|
|
|
|
|
- CommonResult<String> insertVisitor = bsInsertVisitor(user, TimeExchange.DateToString(sv.getVisitorTime()), TimeExchange.DateToString(sv.getVisitorDeadline()), device.getNum(), visitorNo);
|
|
|
|
|
- if (!insertVisitor.isSuccess()) {
|
|
|
|
|
- throw new Exception(insertVisitor.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
- sv.setVisitorsync(sv.getVisitorsync() == null ? insertVisitor.getData() : (sv.getVisitorsync() + "," + insertVisitor.getData()));
|
|
|
|
|
- sv.setDeviceNum(sv.getDeviceNum() == null ? device.getNum() : (sv.getDeviceNum() + "," + device.getNum()));
|
|
|
|
|
- }
|
|
|
|
|
- String code = GetVertifyCode.getRandomNumCode(6);
|
|
|
|
|
- sv.setVisitorCode(code);
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
} else if (type == 2) {//拒绝
|
|
} else if (type == 2) {//拒绝
|
|
|
sv.setStatu(2);
|
|
sv.setStatu(2);
|
|
|
}
|
|
}
|
|
@@ -751,8 +766,43 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
List<SmartVisitorRestsConfig> list = smartVisitorRestsConfigService.list(new LambdaQueryWrapper<>());
|
|
List<SmartVisitorRestsConfig> list = smartVisitorRestsConfigService.list(new LambdaQueryWrapper<>());
|
|
|
SmartVisitorRestsConfig smartVisitorRestsConfig = list.get(0);
|
|
SmartVisitorRestsConfig smartVisitorRestsConfig = list.get(0);
|
|
|
Integer accessConfig = smartVisitorRestsConfig.getAccessConfig();
|
|
Integer accessConfig = smartVisitorRestsConfig.getAccessConfig();
|
|
|
|
|
+// 车闸
|
|
|
|
|
+ Integer carConfig = smartVisitorRestsConfig.getCarConfig();
|
|
|
if (0 == accessConfig) {
|
|
if (0 == accessConfig) {
|
|
|
//推送到门禁
|
|
//推送到门禁
|
|
|
|
|
+ List<SmartDevice> devices = smartDeviceService.queryOnLineDevice();
|
|
|
|
|
+ String visitorNo = getUUIDBits(16);
|
|
|
|
|
+ //region 将访客数据下发到设备
|
|
|
|
|
+ for (SmartDevice device : devices) {
|
|
|
|
|
+ //查找用户是否存在
|
|
|
|
|
+ SmartUser user = smartUserService.getSmartById(sv.getUserId());
|
|
|
|
|
+ if (user == null) {
|
|
|
|
|
+ throw new Exception("访客用户ID在系统中不存在,无法将访客信息下发到门禁设备!");
|
|
|
|
|
+ }
|
|
|
|
|
+ CommonResult<String> insertVisitor = bsInsertVisitor(user, TimeExchange.DateToString(sv.getVisitorTime()), TimeExchange.DateToString(sv.getVisitorDeadline()), device.getNum(), visitorNo);
|
|
|
|
|
+ if (!insertVisitor.isSuccess()) {
|
|
|
|
|
+ throw new Exception(insertVisitor.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ sv.setVisitorsync(sv.getVisitorsync() == null ? insertVisitor.getData() : (sv.getVisitorsync() + "," + insertVisitor.getData()));
|
|
|
|
|
+ sv.setDeviceNum(sv.getDeviceNum() == null ? device.getNum() : (sv.getDeviceNum() + "," + device.getNum()));
|
|
|
|
|
+ }
|
|
|
|
|
+ String code = GetVertifyCode.getRandomNumCode(6);
|
|
|
|
|
+ sv.setVisitorCode(code);
|
|
|
|
|
+
|
|
|
|
|
+ //发送短信给其他访客用户
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(sv.getVisitorCode())) {
|
|
|
|
|
+ Date visitorTime = sv.getVisitorTime();
|
|
|
|
|
+ Date visitorDeadline = sv.getVisitorDeadline();
|
|
|
|
|
+ String start = TimeExchange.getTime(visitorTime);
|
|
|
|
|
+ String end = TimeExchange.getTime(visitorDeadline);
|
|
|
|
|
+ String message = SendSms.sendVisitorSms("+86" + sv.getUserPhone(), TimeExchange.getYear(sv.getVisitorTime()), TimeExchange.getMonth(sv.getVisitorTime()), TimeExchange.getDay(sv.getVisitorTime()), start, end, sv.getVisitorCode());
|
|
|
|
|
+ if (!message.contains("success")) {
|
|
|
|
|
+ throw new Exception("发送失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (0 == carConfig) {
|
|
|
|
|
+// 车闸推送
|
|
|
if (!ObjectUtils.isEmpty(sv.getCarNum())) {
|
|
if (!ObjectUtils.isEmpty(sv.getCarNum())) {
|
|
|
String appId = parkConfig.getAppId();
|
|
String appId = parkConfig.getAppId();
|
|
|
String carNo = sv.getCarNum();
|
|
String carNo = sv.getCarNum();
|
|
@@ -791,40 +841,11 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
BsReservationVo reservation = objectMapper.readValue(result, BsReservationVo.class);
|
|
BsReservationVo reservation = objectMapper.readValue(result, BsReservationVo.class);
|
|
|
sv.setBsOrderNo(reservation.getData().getReOrderNo());
|
|
sv.setBsOrderNo(reservation.getData().getReOrderNo());
|
|
|
- } else {
|
|
|
|
|
- List<SmartDevice> devices = smartDeviceService.queryOnLineDevice();
|
|
|
|
|
- String visitorNo = getUUIDBits(16);
|
|
|
|
|
- //region 将访客数据下发到设备
|
|
|
|
|
- for (SmartDevice device : devices) {
|
|
|
|
|
- //查找用户是否存在
|
|
|
|
|
- SmartUser user = smartUserService.getSmartById(sv.getUserId());
|
|
|
|
|
- if (user == null) {
|
|
|
|
|
- throw new Exception("访客用户ID在系统中不存在,无法将访客信息下发到门禁设备!");
|
|
|
|
|
- }
|
|
|
|
|
- CommonResult<String> insertVisitor = bsInsertVisitor(user, TimeExchange.DateToString(sv.getVisitorTime()), TimeExchange.DateToString(sv.getVisitorDeadline()), device.getNum(), visitorNo);
|
|
|
|
|
- if (!insertVisitor.isSuccess()) {
|
|
|
|
|
- throw new Exception(insertVisitor.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
- sv.setVisitorsync(sv.getVisitorsync() == null ? insertVisitor.getData() : (sv.getVisitorsync() + "," + insertVisitor.getData()));
|
|
|
|
|
- sv.setDeviceNum(sv.getDeviceNum() == null ? device.getNum() : (sv.getDeviceNum() + "," + device.getNum()));
|
|
|
|
|
- }
|
|
|
|
|
- String code = GetVertifyCode.getRandomNumCode(6);
|
|
|
|
|
- sv.setVisitorCode(code);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //发送短信给其他访客用户
|
|
|
|
|
- if (!ObjectUtils.isEmpty(sv.getVisitorCode())) {
|
|
|
|
|
- Date visitorTime = sv.getVisitorTime();
|
|
|
|
|
- Date visitorDeadline = sv.getVisitorDeadline();
|
|
|
|
|
- String start = TimeExchange.getTime(visitorTime);
|
|
|
|
|
- String end = TimeExchange.getTime(visitorDeadline);
|
|
|
|
|
- String message = SendSms.sendVisitorSms("+86" + sv.getUserPhone(), TimeExchange.getYear(sv.getVisitorTime()), TimeExchange.getMonth(sv.getVisitorTime()), TimeExchange.getDay(sv.getVisitorTime()), start, end, sv.getVisitorCode());
|
|
|
|
|
- if (!message.contains("success")) {
|
|
|
|
|
- throw new Exception("发送失败");
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
} else if (type == 2) {//拒绝
|
|
} else if (type == 2) {//拒绝
|
|
|
sv.setStatu(2);
|
|
sv.setStatu(2);
|
|
|
}
|
|
}
|
|
@@ -865,7 +886,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
LocalDateTime date = LocalDateTime.now();
|
|
LocalDateTime date = LocalDateTime.now();
|
|
|
String startTime = date.format(dateTimeFormatter1);
|
|
String startTime = date.format(dateTimeFormatter1);
|
|
|
|
|
|
|
|
- String endTime = TimeExchange.AddTimeDesH(TimeExchange.StringToDate(startTime, "yyyy-MM-dd HH:mm:ss"),4);
|
|
|
|
|
|
|
+ String endTime = TimeExchange.AddTimeDesH(TimeExchange.StringToDate(startTime, "yyyy-MM-dd HH:mm:ss"), 4);
|
|
|
|
|
|
|
|
//要进行家长数据重复判断
|
|
//要进行家长数据重复判断
|
|
|
//那是不是第二次预约的时间不能在那个可访问的时间段内
|
|
//那是不是第二次预约的时间不能在那个可访问的时间段内
|
|
@@ -956,8 +977,8 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
@Override
|
|
@Override
|
|
|
@DESRespondSecret(validated = true)
|
|
@DESRespondSecret(validated = true)
|
|
|
@PassToken
|
|
@PassToken
|
|
|
- public CommonResult getScreenPage(int currentPage, int pageCount, String phone,String status) {
|
|
|
|
|
- PageUtils<SmartVisitorScreenListVo> page = smartVisitorService.getScreenPage(currentPage, pageCount,phone,status);
|
|
|
|
|
|
|
+ public CommonResult getScreenPage(int currentPage, int pageCount, String phone, String status) {
|
|
|
|
|
+ PageUtils<SmartVisitorScreenListVo> page = smartVisitorService.getScreenPage(currentPage, pageCount, phone, status);
|
|
|
|
|
|
|
|
return CommonResult.ok(page);
|
|
return CommonResult.ok(page);
|
|
|
}
|
|
}
|
|
@@ -980,22 +1001,22 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
return CommonResult.fail("访客记录已失效,审核失败!");
|
|
return CommonResult.fail("访客记录已失效,审核失败!");
|
|
|
}
|
|
}
|
|
|
Integer statu = sv.getStatu();
|
|
Integer statu = sv.getStatu();
|
|
|
- if (9==statu) {
|
|
|
|
|
|
|
+ if (9 == statu) {
|
|
|
return CommonResult.fail("该记录已完成,请勿重复操作");
|
|
return CommonResult.fail("该记录已完成,请勿重复操作");
|
|
|
}
|
|
}
|
|
|
- if (2==statu) {
|
|
|
|
|
|
|
+ if (2 == statu) {
|
|
|
return CommonResult.fail("该记录未同意");
|
|
return CommonResult.fail("该记录未同意");
|
|
|
}
|
|
}
|
|
|
- if (1==statu) {
|
|
|
|
|
|
|
+ if (1 == statu) {
|
|
|
return CommonResult.fail("该记录还未通过审核");
|
|
return CommonResult.fail("该记录还未通过审核");
|
|
|
}
|
|
}
|
|
|
- if (7==statu) {
|
|
|
|
|
|
|
+ if (7 == statu) {
|
|
|
sv.setStatu(8);
|
|
sv.setStatu(8);
|
|
|
int result = smartVisitorService.updateSmartVisitor(sv);
|
|
int result = smartVisitorService.updateSmartVisitor(sv);
|
|
|
if (result > 0) {
|
|
if (result > 0) {
|
|
|
return CommonResult.ok("进校核销成功");
|
|
return CommonResult.ok("进校核销成功");
|
|
|
}
|
|
}
|
|
|
- }else if(8==statu){
|
|
|
|
|
|
|
+ } else if (8 == statu) {
|
|
|
sv.setStatu(9);
|
|
sv.setStatu(9);
|
|
|
int result = smartVisitorService.updateSmartVisitor(sv);
|
|
int result = smartVisitorService.updateSmartVisitor(sv);
|
|
|
if (result > 0) {
|
|
if (result > 0) {
|