|
|
|
@ -91,12 +91,12 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
// ybsjyAppointmentSettingMapper.deleteAppointmentTimeInfoEntity(ybsjyAppointmentSettingEntity.getId());
|
|
|
|
|
// //通过配置表id删除时间段表中的数据
|
|
|
|
|
// ybsjyAppointmentSettingMapper.addAppointmentTimeInfoEntityList(ybsjyAppointmentSettingEntity.getPeriodTimeList(), ybsjyAppointmentSettingEntity.getId(), ybsjyAppointmentSettingEntity.getUpdateBy());
|
|
|
|
|
List<AppointmentTimeInfoEntity>list=ybsjyAppointmentSettingEntity.getPeriodTimeList().stream().filter(i->i.getId() !=null).collect(Collectors.toList()); |
|
|
|
|
List<AppointmentTimeInfoEntity> list = ybsjyAppointmentSettingEntity.getPeriodTimeList().stream().filter(i -> i.getId() != null).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
ybsjyAppointmentSettingMapper.updateAppointmentTimeInfoEntityList(list, ybsjyAppointmentSettingEntity.getId(), ybsjyAppointmentSettingEntity.getUpdateBy()); |
|
|
|
|
List<AppointmentTimeInfoEntity>newlist=ybsjyAppointmentSettingEntity.getPeriodTimeList().stream().filter(i->i.getId() ==null).collect(Collectors.toList()); |
|
|
|
|
List<AppointmentTimeInfoEntity> newlist = ybsjyAppointmentSettingEntity.getPeriodTimeList().stream().filter(i -> i.getId() == null).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
if(!newlist.isEmpty()){ |
|
|
|
|
if (!newlist.isEmpty()) { |
|
|
|
|
ybsjyAppointmentSettingMapper.addAppointmentTimeInfoEntityList(newlist, ybsjyAppointmentSettingEntity.getId(), ybsjyAppointmentSettingEntity.getCreateBy()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -219,21 +219,21 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
public ServerResponse appointmentList(String date, String scenicId) { |
|
|
|
|
//第一步通过景区id获取到对应的规则 通过日期及今天是周几判断是否返回
|
|
|
|
|
|
|
|
|
|
Map<String,Object> map =new HashMap(); |
|
|
|
|
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); |
|
|
|
|
map.put("timeList", list); |
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
map.put("canReserveDayNumber", list.get(0).getCanReserveDayNumber()); |
|
|
|
|
} else { |
|
|
|
|
map.put("canReserveDayNumber", 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -313,15 +313,15 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
synchronousDataVO.setAppointmentDate(item.getAppointmentDate()); |
|
|
|
|
synchronousDataVO.setAppointmentSlot(reservationNowVO.getStartTime() + "~" + reservationNowVO.getEndTime()); |
|
|
|
|
synchronousDataVO.setAppointmentPeopleName(item.getName()); |
|
|
|
|
if(!item.getPhone().isEmpty()){ |
|
|
|
|
synchronousDataVO.setAppointmentPeoplePhone(Encryption.encrypt(item.getPhone(),rule)); |
|
|
|
|
if (!item.getPhone().isEmpty()) { |
|
|
|
|
synchronousDataVO.setAppointmentPeoplePhone(Encryption.encrypt(item.getPhone(), rule)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
synchronousDataVO.setCertificateType(item.getDocumentsType() + ""); |
|
|
|
|
if(item.getDocumentsType()==5501){ |
|
|
|
|
String documentsNumber= Encryption.encrypt(item.getDocumentsNumber(),rule); |
|
|
|
|
if (item.getDocumentsType() == 5501) { |
|
|
|
|
String documentsNumber = Encryption.encrypt(item.getDocumentsNumber(), rule); |
|
|
|
|
synchronousDataVO.setDocumentsNumber(documentsNumber); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
synchronousDataVO.setDocumentsNumber(item.getDocumentsNumber()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -384,14 +384,14 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
// item.setQrContent(json1.get("二维码信息").toString());
|
|
|
|
|
}); |
|
|
|
|
reservationNowVO.getAppointmentPersonList().stream().forEach(i -> { |
|
|
|
|
if(i.getDocumentsType()==5501){ |
|
|
|
|
String documentsNumber= Encryption.encrypt(i.getDocumentsNumber(),rule); |
|
|
|
|
if (i.getDocumentsType() == 5501) { |
|
|
|
|
String documentsNumber = Encryption.encrypt(i.getDocumentsNumber(), rule); |
|
|
|
|
i.setDocumentsNumber(documentsNumber); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
i.setDocumentsNumber(i.getDocumentsNumber()); |
|
|
|
|
} |
|
|
|
|
if(!i.getPhone().isEmpty()){ |
|
|
|
|
i.setPhone(Encryption.encrypt(i.getPhone(),rule)); |
|
|
|
|
if (!i.getPhone().isEmpty()) { |
|
|
|
|
i.setPhone(Encryption.encrypt(i.getPhone(), rule)); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
ybsjyAppointmentSettingMapper.saveAppointmentPeopleInfo(reservationNowVO.getAppointmentPersonList()); |
|
|
|
@ -413,13 +413,16 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setState(responseJson.get("code").toString()); |
|
|
|
|
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setType("post"); |
|
|
|
|
ybsjyAppointmentSettingMapper.saveAppointmentRequestTurnstileLog(VisitorResponseJsonAppointmentRequestTurnstileLogEntity); |
|
|
|
|
Map<String,String> map=new HashMap<>(); |
|
|
|
|
map.put("documentsId",appointmentFormVO.getId()+""); |
|
|
|
|
return ServerResponse.createBySuccess("预约成功",map); |
|
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
|
map.put("documentsId", appointmentFormVO.getId() + ""); |
|
|
|
|
return ServerResponse.createBySuccess("预约成功", map); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public ServerResponse appletsAppointmentRecord(GetAppointmentRecordVO getAppointmentRecordVO) { |
|
|
|
|
if (getAppointmentRecordVO.getReservationPersonPhone()!=null && !getAppointmentRecordVO.getReservationPersonPhone().isEmpty()) { |
|
|
|
|
getAppointmentRecordVO.setReservationPersonPhone(Encryption.encrypt(getAppointmentRecordVO.getReservationPersonPhone(), rule)); |
|
|
|
|
} |
|
|
|
|
// 获取当前页码,在分页组件里 参数固定为currentPage
|
|
|
|
|
String cpage = getAppointmentRecordVO.getPage(); |
|
|
|
|
// 显示行数
|
|
|
|
@ -436,7 +439,12 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
|
|
|
|
|
//根据条件进行分页查询数据
|
|
|
|
|
List<Map<String, Object>> list = ybsjyAppointmentRecordMapper.getappletsAppointmentRecordListByPage(pw.getPage(), getAppointmentRecordVO); |
|
|
|
|
list.stream().forEach(item -> { |
|
|
|
|
|
|
|
|
|
String documentsNumber = Encryption.decrypt(item.get("phone").toString(), rule); |
|
|
|
|
item.put("phone", IdProduceUtil.desensitizePhoneNumber(documentsNumber)); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
// 查询总行数
|
|
|
|
|
int userCount = pw.getPage().getTotalCount(); |
|
|
|
|
//返回数据
|
|
|
|
@ -461,12 +469,12 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
AppointmentDocumentsDetails appointmentDocumentsDetails = ybsjyAppointmentRecordMapper.getAppletsAppointmentDocumentsInfo(id); |
|
|
|
|
|
|
|
|
|
List<AppointmentPersonVO> list = ybsjyAppointmentRecordMapper.getAppointmentPersonInfo(id); |
|
|
|
|
list.stream().forEach(item->{ |
|
|
|
|
if(item.getDocumentsType()==5501){ |
|
|
|
|
list.stream().forEach(item -> { |
|
|
|
|
if (item.getDocumentsType() == 5501) { |
|
|
|
|
String documentsNumber = Encryption.decrypt(item.getDocumentsNumber(), rule); |
|
|
|
|
item.setDocumentsNumber(IdProduceUtil.desensitizeIDCard(documentsNumber)); |
|
|
|
|
} |
|
|
|
|
if(!item.getPhone().isEmpty()){ |
|
|
|
|
if (!item.getPhone().isEmpty()) { |
|
|
|
|
String phone = Encryption.decrypt(item.getPhone(), rule); |
|
|
|
|
item.setPhone(IdProduceUtil.desensitizePhoneNumber(phone)); |
|
|
|
|
} |
|
|
|
@ -489,18 +497,18 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
appointmentWriteOffLogEntity.setTime(time); |
|
|
|
|
appointmentWriteOffLogEntity.setIdCard(idCard); |
|
|
|
|
try { |
|
|
|
|
String newIdCard= Encryption.encrypt(idCard,rule); |
|
|
|
|
String newIdCard = Encryption.encrypt(idCard, rule); |
|
|
|
|
Map<String, Object> map = ybsjyAppointmentRecordMapper.getAppointmentPeopleInfo(formattedDate, newIdCard); |
|
|
|
|
ybsjyAppointmentRecordMapper.writeOff(time, map.get("id").toString()); |
|
|
|
|
|
|
|
|
|
List<SynchronousWriteOffDataVO> synchronousWriteOffDataVOS= new ArrayList<>(); |
|
|
|
|
List<SynchronousWriteOffDataVO> synchronousWriteOffDataVOS = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
SynchronousWriteOffDataVO synchronousWriteOffDataVO= new SynchronousWriteOffDataVO(); |
|
|
|
|
SynchronousWriteOffDataVO synchronousWriteOffDataVO = new SynchronousWriteOffDataVO(); |
|
|
|
|
synchronousWriteOffDataVO.setId(map.get("id").toString()); |
|
|
|
|
synchronousWriteOffDataVO.setDate(time); |
|
|
|
|
synchronousWriteOffDataVOS.add(synchronousWriteOffDataVO); |
|
|
|
|
|
|
|
|
|
String responseString = HttpUtil.sendPostJson(synchronousWriteOffDataUrl,JSONObject.toJSONString(synchronousWriteOffDataVOS)); |
|
|
|
|
String responseString = HttpUtil.sendPostJson(synchronousWriteOffDataUrl, JSONObject.toJSONString(synchronousWriteOffDataVOS)); |
|
|
|
|
JSONObject responseJson = JSONObject.parseObject(responseString); |
|
|
|
|
//记录访问日志
|
|
|
|
|
AppointmentRequestTurnstileLogEntity appointmentRequestTurnstileLogEntity = new AppointmentRequestTurnstileLogEntity(); |
|
|
|
@ -511,7 +519,7 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti |
|
|
|
|
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()),1); |
|
|
|
|
ybsjyAppointmentRecordMapper.updateDocumentsSate(Long.parseLong(map.get("appointment_documents_id").toString()), 1); |
|
|
|
|
} |
|
|
|
|
appointmentWriteOffLogEntity.setState("200"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|