|
|
|
|
@ -209,17 +209,25 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
public ServerResponse appointmentList(String date, String scenicId) { |
|
|
|
|
//第一步通过景区id获取到对应的规则 通过日期及今天是周几判断是否返回
|
|
|
|
|
|
|
|
|
|
Map<String,Object> map =new HashMap(); |
|
|
|
|
|
|
|
|
|
//知道周几
|
|
|
|
|
int whichDay = DateUtil.getWhichDay(date); |
|
|
|
|
List<AppletsAppointmentListVO> list = ybsjyAppointmentSettingMapper.appointmentList(date, scenicId, whichDay); |
|
|
|
|
list.stream().forEach(item -> { |
|
|
|
|
//通过时间段id统计目前预约了多少人
|
|
|
|
|
item.setReservedQuantity(ybsjyAppointmentSettingMapper.getAppointmentCount(item.getAppointmentTimeInfoId(), date)); |
|
|
|
|
item.setReservedQuantity(ybsjyAppointmentSettingMapper.getAppointmentCount(item.getAppointmentTimeInfoId(), date)+""); |
|
|
|
|
}); |
|
|
|
|
//第二步通过通过规则id获取到时间段列表
|
|
|
|
|
map.put("timeList",list); |
|
|
|
|
if(!list.isEmpty()){ |
|
|
|
|
map.put("canReserveDayNumber",list.get(0).getCanReserveDayNumber()); |
|
|
|
|
}else { |
|
|
|
|
map.put("canReserveDayNumber",0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ServerResponse.createBySuccess(list); |
|
|
|
|
return ServerResponse.createBySuccess(map); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -319,40 +327,40 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
// addAccessRightAppointmentRequestTurnstileLogEntity.setState(accessRightResponseJson.get("code").toString());
|
|
|
|
|
// ybsjyAppointmentSettingMapper.saveAppointmentRequestTurnstileLog(addAccessRightAppointmentRequestTurnstileLogEntity);
|
|
|
|
|
|
|
|
|
|
//添加访客
|
|
|
|
|
Map<String,Object> map1= new HashMap<>(); |
|
|
|
|
map1.put("idCard",item.getDocumentsNumber()); |
|
|
|
|
map1.put("startTime",item.getAppointmentDate()+" " +reservationNowVO.getStartTime()+":00"); |
|
|
|
|
map1.put("endTime",item.getAppointmentDate()+" " +reservationNowVO.getEndTime()+":00"); |
|
|
|
|
String addVisitorResponseString = HttpUtil.sendPost(turnstileUrl+addVisitor,map1); |
|
|
|
|
JSONObject addVisitorResponseJson = JSONObject.parseObject(addVisitorResponseString); |
|
|
|
|
//记录访问日志
|
|
|
|
|
AppointmentRequestTurnstileLogEntity VisitorResponseJsonAppointmentRequestTurnstileLogEntity=new AppointmentRequestTurnstileLogEntity(); |
|
|
|
|
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setRequestUrl(turnstileUrl+addVisitor); |
|
|
|
|
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setRequestParams(map1.toString()); |
|
|
|
|
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setResponseBody(addVisitorResponseString); |
|
|
|
|
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setState(addVisitorResponseJson.get("code").toString()); |
|
|
|
|
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setType("post"); |
|
|
|
|
ybsjyAppointmentSettingMapper.saveAppointmentRequestTurnstileLog(VisitorResponseJsonAppointmentRequestTurnstileLogEntity); |
|
|
|
|
|
|
|
|
|
//获取二维码信息
|
|
|
|
|
Map<String,Object> map2= new HashMap<>(); |
|
|
|
|
map2.put("idCard",item.getDocumentsNumber()); |
|
|
|
|
map2.put("endTime",item.getAppointmentDate()+" " +reservationNowVO.getEndTime()+":00"); |
|
|
|
|
|
|
|
|
|
String updateQRCodevResponseString = HttpUtil.sendPost(turnstileUrl+updateQRCodev,map2); |
|
|
|
|
JSONObject json = JSONObject.parseObject(updateQRCodevResponseString); |
|
|
|
|
JSONObject json1= JSONObject.parseObject(json.get("data").toString()); |
|
|
|
|
|
|
|
|
|
//记录访问日志
|
|
|
|
|
AppointmentRequestTurnstileLogEntity appointmentRequestTurnstileLogEntity=new AppointmentRequestTurnstileLogEntity(); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setRequestUrl(turnstileUrl+updateQRCodev); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setRequestParams(map2.toString()); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setResponseBody(updateQRCodevResponseString); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setState(json.get("code").toString()); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setType("post"); |
|
|
|
|
ybsjyAppointmentSettingMapper.saveAppointmentRequestTurnstileLog(appointmentRequestTurnstileLogEntity); |
|
|
|
|
item.setQrContent(json1.get("二维码信息").toString()); |
|
|
|
|
// //添加访客
|
|
|
|
|
// Map<String,Object> map1= new HashMap<>();
|
|
|
|
|
// map1.put("idCard",item.getDocumentsNumber());
|
|
|
|
|
// map1.put("startTime",item.getAppointmentDate()+" " +reservationNowVO.getStartTime()+":00");
|
|
|
|
|
// map1.put("endTime",item.getAppointmentDate()+" " +reservationNowVO.getEndTime()+":00");
|
|
|
|
|
// String addVisitorResponseString = HttpUtil.sendPost(turnstileUrl+addVisitor,map1);
|
|
|
|
|
// JSONObject addVisitorResponseJson = JSONObject.parseObject(addVisitorResponseString);
|
|
|
|
|
// //记录访问日志
|
|
|
|
|
// AppointmentRequestTurnstileLogEntity VisitorResponseJsonAppointmentRequestTurnstileLogEntity=new AppointmentRequestTurnstileLogEntity();
|
|
|
|
|
// VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setRequestUrl(turnstileUrl+addVisitor);
|
|
|
|
|
// VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setRequestParams(map1.toString());
|
|
|
|
|
// VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setResponseBody(addVisitorResponseString);
|
|
|
|
|
// VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setState(addVisitorResponseJson.get("code").toString());
|
|
|
|
|
// VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setType("post");
|
|
|
|
|
// ybsjyAppointmentSettingMapper.saveAppointmentRequestTurnstileLog(VisitorResponseJsonAppointmentRequestTurnstileLogEntity);
|
|
|
|
|
//
|
|
|
|
|
// //获取二维码信息
|
|
|
|
|
// Map<String,Object> map2= new HashMap<>();
|
|
|
|
|
// map2.put("idCard",item.getDocumentsNumber());
|
|
|
|
|
// map2.put("endTime",item.getAppointmentDate()+" " +reservationNowVO.getEndTime()+":00");
|
|
|
|
|
//
|
|
|
|
|
// String updateQRCodevResponseString = HttpUtil.sendPost(turnstileUrl+updateQRCodev,map2);
|
|
|
|
|
// JSONObject json = JSONObject.parseObject(updateQRCodevResponseString);
|
|
|
|
|
// JSONObject json1= JSONObject.parseObject(json.get("data").toString());
|
|
|
|
|
//
|
|
|
|
|
// //记录访问日志
|
|
|
|
|
// AppointmentRequestTurnstileLogEntity appointmentRequestTurnstileLogEntity=new AppointmentRequestTurnstileLogEntity();
|
|
|
|
|
// appointmentRequestTurnstileLogEntity.setRequestUrl(turnstileUrl+updateQRCodev);
|
|
|
|
|
// appointmentRequestTurnstileLogEntity.setRequestParams(map2.toString());
|
|
|
|
|
// appointmentRequestTurnstileLogEntity.setResponseBody(updateQRCodevResponseString);
|
|
|
|
|
// appointmentRequestTurnstileLogEntity.setState(json.get("code").toString());
|
|
|
|
|
// appointmentRequestTurnstileLogEntity.setType("post");
|
|
|
|
|
// ybsjyAppointmentSettingMapper.saveAppointmentRequestTurnstileLog(appointmentRequestTurnstileLogEntity);
|
|
|
|
|
// item.setQrContent(json1.get("二维码信息").toString());
|
|
|
|
|
}); |
|
|
|
|
ybsjyAppointmentSettingMapper.saveAppointmentPeopleInfo(reservationNowVO.getAppointmentPersonList()); |
|
|
|
|
|
|
|
|
|
@ -442,21 +450,26 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
try { |
|
|
|
|
Map<String, Object> map = ybsjyAppointmentRecordMapper.getAppointmentPeopleInfo(formattedDate, idCard); |
|
|
|
|
ybsjyAppointmentRecordMapper.writeOff(time, map.get("id").toString()); |
|
|
|
|
Map<String,Object> map1= new HashMap<>(); |
|
|
|
|
map1.put("id",map.get("id").toString()); |
|
|
|
|
map1.put("date",time); |
|
|
|
|
String responseString = HttpUtil.sendPost(synchronousWriteOffDataUrl,map1); |
|
|
|
|
|
|
|
|
|
List<SynchronousWriteOffDataVO> synchronousWriteOffDataVOS= new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
SynchronousWriteOffDataVO synchronousWriteOffDataVO= new SynchronousWriteOffDataVO(); |
|
|
|
|
synchronousWriteOffDataVO.setId(map.get("id").toString()); |
|
|
|
|
synchronousWriteOffDataVO.setDate(time); |
|
|
|
|
synchronousWriteOffDataVOS.add(synchronousWriteOffDataVO); |
|
|
|
|
|
|
|
|
|
String responseString = HttpUtil.sendPostJson(synchronousWriteOffDataUrl,JSONObject.toJSONString(synchronousWriteOffDataVOS)); |
|
|
|
|
JSONObject responseJson = JSONObject.parseObject(responseString); |
|
|
|
|
//记录访问日志
|
|
|
|
|
AppointmentRequestTurnstileLogEntity appointmentRequestTurnstileLogEntity = new AppointmentRequestTurnstileLogEntity(); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setRequestUrl(synchronousWriteOffDataUrl); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setRequestParams(map1.toString()); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setRequestParams(JSONObject.toJSONString(synchronousWriteOffDataVOS)); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setResponseBody(responseString); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setState(responseJson.get("code").toString()); |
|
|
|
|
appointmentRequestTurnstileLogEntity.setType("post"); |
|
|
|
|
ybsjyAppointmentSettingMapper.saveAppointmentRequestTurnstileLog(appointmentRequestTurnstileLogEntity); |
|
|
|
|
if (ybsjyAppointmentRecordMapper.getNotWrittenOffCount((Long) map.get("appointment_documents_id")) == 0) { |
|
|
|
|
ybsjyAppointmentRecordMapper.updateDocumentsSate(Long.parseLong(map.get("appointment_documents_id").toString())); |
|
|
|
|
ybsjyAppointmentRecordMapper.updateDocumentsSate(Long.parseLong(map.get("appointment_documents_id").toString()),1); |
|
|
|
|
} |
|
|
|
|
appointmentWriteOffLogEntity.setState("200"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|