|
|
@ -78,8 +78,8 @@ public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
if (getParamType(writeOffVo.getReservationCode()) == 1) { |
|
|
|
if (getParamType(writeOffVo.getReservationCode()) == 1) { |
|
|
|
writeOffVo.setQrContent(writeOffVo.getReservationCode()); |
|
|
|
writeOffVo.setQrContent(writeOffVo.getReservationCode()); |
|
|
|
reservationCode = null; |
|
|
|
reservationCode = null; |
|
|
|
}else if (getParamType(writeOffVo.getReservationCode()) == 3){ |
|
|
|
} else if (getParamType(writeOffVo.getReservationCode()) == 3) { |
|
|
|
writeOffVo.setDocumentsNumber(Encryption.encrypt(writeOffVo.getReservationCode(), rule) ); |
|
|
|
writeOffVo.setDocumentsNumber(Encryption.encrypt(writeOffVo.getReservationCode(), rule)); |
|
|
|
reservationCode = null; |
|
|
|
reservationCode = null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -99,7 +99,7 @@ public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
return ServerResponse.createByErrorCodeMessage(400, "预约码不能为空"); |
|
|
|
return ServerResponse.createByErrorCodeMessage(400, "预约码不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
// 查询预约信息
|
|
|
|
// 查询预约信息
|
|
|
|
Map<String, Object> appointmentInfo = ybsjHandsetMapper.getAppointmentPeopleInfo(reservationCode, writeOffVo.getQrContent(),writeOffVo.getDocumentsNumber()); |
|
|
|
Map<String, Object> appointmentInfo = ybsjHandsetMapper.getAppointmentPeopleInfo(reservationCode, writeOffVo.getQrContent(), writeOffVo.getDocumentsNumber()); |
|
|
|
if (appointmentInfo == null) { |
|
|
|
if (appointmentInfo == null) { |
|
|
|
logger.warn("手持机核销异常:预约单不存在,预约码:{}", logIdentifier); |
|
|
|
logger.warn("手持机核销异常:预约单不存在,预约码:{}", logIdentifier); |
|
|
|
return ServerResponse.createByErrorCodeMessage(400, "票据无效"); |
|
|
|
return ServerResponse.createByErrorCodeMessage(400, "票据无效"); |
|
|
@ -126,11 +126,11 @@ public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
logger.error("手持机核销失败:数据库更新异常,预约码:{}", logIdentifier); |
|
|
|
logger.error("手持机核销失败:数据库更新异常,预约码:{}", logIdentifier); |
|
|
|
return ServerResponse.createByErrorCodeMessage(400, "核销失败,请重试"); |
|
|
|
return ServerResponse.createByErrorCodeMessage(400, "核销失败,请重试"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (Integer.parseInt(appointmentInfo.getOrDefault("appointment_type_id", "0").toString()) == 5703){ |
|
|
|
if (Integer.parseInt(appointmentInfo.getOrDefault("appointment_type_id", "0").toString()) == 5703) { |
|
|
|
updateSuccess = Integer.parseInt(appointmentInfo.getOrDefault("appointment_count", "0").toString()); |
|
|
|
updateSuccess = Integer.parseInt(appointmentInfo.getOrDefault("appointment_count", "0").toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
// 构建成功响应
|
|
|
|
// 构建成功响应
|
|
|
|
return buildSuccessResponse(appointmentInfo.get("reservation_code").toString(), writeOffVo.getTicketChecker(), updateSuccess,appointmentInfo.get("id").toString()); |
|
|
|
return buildSuccessResponse(appointmentInfo.get("reservation_code").toString(), writeOffVo.getTicketChecker(), updateSuccess, appointmentInfo.get("id").toString()); |
|
|
|
|
|
|
|
|
|
|
|
} catch (NumberFormatException e) { |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
logger.error("手持机核销异常:数据格式转换错误", e); |
|
|
|
logger.error("手持机核销异常:数据格式转换错误", e); |
|
|
@ -162,7 +162,7 @@ public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
public static void main(String[] args) { |
|
|
|
System.out.println(getParamType("130530199810271028")); |
|
|
|
System.out.println(getParamType("130530199810271028")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 辅助方法:检查预约时间是否有效
|
|
|
|
// 辅助方法:检查预约时间是否有效
|
|
|
@ -263,7 +263,7 @@ public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
|
|
|
|
|
|
|
|
// 辅助方法:构建成功响应
|
|
|
|
// 辅助方法:构建成功响应
|
|
|
|
private ServerResponse buildSuccessResponse(String reservationCode, String ticketChecker, |
|
|
|
private ServerResponse buildSuccessResponse(String reservationCode, String ticketChecker, |
|
|
|
int updateSuccess,String id ) { |
|
|
|
int updateSuccess, String id) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
result.put("reservationCode", reservationCode); |
|
|
|
result.put("reservationCode", reservationCode); |
|
|
|
result.put("TicketChecker", ticketChecker); |
|
|
|
result.put("TicketChecker", ticketChecker); |
|
|
@ -337,7 +337,10 @@ public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public ServerResponse getPeopleCounting(Integer scenicId) { |
|
|
|
public ServerResponse getPeopleCounting(Integer scenicId) { |
|
|
|
return ServerResponse.createBySuccess(ybsjHandsetMapper.getPeopleCounting(scenicId)); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
|
|
|
map.put("totalBookingCapacity",ybsjHandsetMapper.getPeopleCounting(scenicId)); |
|
|
|
|
|
|
|
map.put("totalTicketCapacity",ybsjHandsetMapper.getPeopleCountingTwo(scenicId)); |
|
|
|
|
|
|
|
return ServerResponse.createBySuccess(map); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -364,9 +367,9 @@ public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
|
|
|
|
|
|
|
|
param.put("essentialInformation", getHaveTicketsDetails); |
|
|
|
param.put("essentialInformation", getHaveTicketsDetails); |
|
|
|
param.put("visitorList", getVisitorList); |
|
|
|
param.put("visitorList", getVisitorList); |
|
|
|
if (getHaveTicketsDetails.get("submissionType").equals("线下提交")){ |
|
|
|
if (getHaveTicketsDetails.get("submissionType").equals("线下提交")) { |
|
|
|
param.put("visitorListCount", getHaveTicketsDetails.get("appointment_count")); |
|
|
|
param.put("visitorListCount", getHaveTicketsDetails.get("appointment_count")); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
param.put("visitorListCount", getVisitorList.size()); |
|
|
|
param.put("visitorListCount", getVisitorList.size()); |
|
|
|
} |
|
|
|
} |
|
|
|
return ServerResponse.createBySuccess(param); |
|
|
|
return ServerResponse.createBySuccess(param); |
|
|
@ -397,9 +400,9 @@ public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
} |
|
|
|
} |
|
|
|
param.put("essentialInformation", getAppointmentRecordDetails); |
|
|
|
param.put("essentialInformation", getAppointmentRecordDetails); |
|
|
|
param.put("visitorList", getVisitorList); |
|
|
|
param.put("visitorList", getVisitorList); |
|
|
|
if (getAppointmentRecordDetails.get("submissionType").equals("线下提交")){ |
|
|
|
if (getAppointmentRecordDetails.get("submissionType").equals("线下提交")) { |
|
|
|
param.put("visitorListCount", getAppointmentRecordDetails.get("appointment_count")); |
|
|
|
param.put("visitorListCount", getAppointmentRecordDetails.get("appointment_count")); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
param.put("visitorListCount", getVisitorList.size()); |
|
|
|
param.put("visitorListCount", getVisitorList.size()); |
|
|
|
} |
|
|
|
} |
|
|
|
return ServerResponse.createBySuccess(param); |
|
|
|
return ServerResponse.createBySuccess(param); |
|
|
@ -407,12 +410,12 @@ public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<Map<String, Object>> selectScjCount(Integer dateType) { |
|
|
|
public List<Map<String, Object>> selectScjCount(Integer dateType) { |
|
|
|
List<Map<String, Object>> selectScjCount =ybsjHandsetMapper.selectScjCount(dateType); |
|
|
|
List<Map<String, Object>> selectScjCount = ybsjHandsetMapper.selectScjCount(dateType); |
|
|
|
List<Map<String, Object>> selectScjCountTwo = ybsjHandsetMapper.selectScjCountTwo(dateType); |
|
|
|
List<Map<String, Object>> selectScjCountTwo = ybsjHandsetMapper.selectScjCountTwo(dateType); |
|
|
|
List<Map<String, Object>> mergedList = Stream.concat(selectScjCount.stream(), selectScjCountTwo.stream()) |
|
|
|
List<Map<String, Object>> mergedList = Stream.concat(selectScjCount.stream(), selectScjCountTwo.stream()) |
|
|
|
.collect(Collectors.groupingBy( |
|
|
|
.collect(Collectors.groupingBy( |
|
|
|
map -> String.valueOf(map.get("generated_date")) , |
|
|
|
map -> String.valueOf(map.get("generated_date")), |
|
|
|
Collectors.summingInt(map -> Integer.parseInt(map.get("total_data").toString()) ) |
|
|
|
Collectors.summingInt(map -> Integer.parseInt(map.get("total_data").toString())) |
|
|
|
)) |
|
|
|
)) |
|
|
|
.entrySet() |
|
|
|
.entrySet() |
|
|
|
.stream() |
|
|
|
.stream() |
|
|
|