From c254eb00d296a86ca79d145b12f88254c360381e Mon Sep 17 00:00:00 2001 From: "862857010@qq.com" <862857010@> Date: Tue, 10 Oct 2023 15:25:48 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../YbsjyAppletsAppointmentController.java | 36 ++++++++++++++++--- .../dao/YbsjyAppointmentRecordMapper.java | 11 ++++++ .../dao/YbsjyAppointmentRecordMapper.xml | 15 ++++++++ .../YbsjyAppointmentSettingService.java | 6 ++++ .../YbsjyAppointmentSettingServiceImpl.java | 16 +++++++++ .../task/ExtractWriteOffRecordsTask.java | 2 +- 6 files changed, 81 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/cjy/back/ybsjAppointment/controller/YbsjyAppletsAppointmentController.java b/src/main/java/com/cjy/back/ybsjAppointment/controller/YbsjyAppletsAppointmentController.java index 133f8f2..e3e0c3c 100644 --- a/src/main/java/com/cjy/back/ybsjAppointment/controller/YbsjyAppletsAppointmentController.java +++ b/src/main/java/com/cjy/back/ybsjAppointment/controller/YbsjyAppletsAppointmentController.java @@ -21,6 +21,7 @@ public class YbsjyAppletsAppointmentController { YbsjyAppointmentSettingService ybsjyAppointmentSettingService; @Autowired YbsjyAppointmentRecordService ybsjyAppointmentRecordService; + /** * 通过日期和景区参数去获取预约列表 */ @@ -42,15 +43,17 @@ public class YbsjyAppletsAppointmentController { /** * 小程序取消预约 + * * @param id * @param unionId * @return */ @RequestMapping("appletsCancelAppointment") - public ServerResponse appletsCancelAppointment( Long id,String unionId) { + public ServerResponse appletsCancelAppointment(Long id, String unionId) { - return ybsjyAppointmentRecordService.cancelAppointment(id,unionId); + return ybsjyAppointmentRecordService.cancelAppointment(id, unionId); } + /** * 小程序预约记录 */ @@ -59,12 +62,37 @@ public class YbsjyAppletsAppointmentController { return ybsjyAppointmentSettingService.appletsAppointmentRecord(getAppointmentRecordVO); } + /** * 小程序预约详情 */ @RequestMapping("appletsAppointmentDocumentsDetails") - public ServerResponse appletsAppointmentDocumentsDetails(Long id){ + public ServerResponse appletsAppointmentDocumentsDetails(Long id) { + + return ybsjyAppointmentSettingService.appletsAppointmentDocumentsDetails(id); + } + + /** + * 更新播放数据 + * + * @param id + * @return + */ + @RequestMapping("updatePlayCount") + public ServerResponse updatePlayCount(String id) { + + return ybsjyAppointmentSettingService.updatePlayCount(id); + } + + /** + * 获取播放数据 + * + * @param id + * @return + */ + @RequestMapping("getPlayCount") + public ServerResponse getPlayCount(String id) { - return ybsjyAppointmentSettingService.appletsAppointmentDocumentsDetails(id); + return ybsjyAppointmentSettingService.getPlayCount(id); } } diff --git a/src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.java b/src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.java index 00aaf59..f81358c 100644 --- a/src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.java +++ b/src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.java @@ -166,4 +166,15 @@ public interface YbsjyAppointmentRecordMapper { List getAppointmentPeopleIdByDocumentsId(Long id); Map getWriteOffStatusQuantity(Long id); + + + int updatePlayCount(String id); + + int savePlayCount(String attractionsId); + + int getPlayCountIsExist(String attractionsId); + + + int getPlayCount(String id); + } diff --git a/src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.xml b/src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.xml index 9271753..c1269c7 100644 --- a/src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.xml +++ b/src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.xml @@ -15,6 +15,9 @@ + + INSERT INTO ybsj_attractions_play (attractions_id) VALUES (#{attractionsId}) + update ybsj_appointment_documents_info set del_flag= 2, @@ -85,6 +88,7 @@ + select count(*) from ybsj_appointment_people_info where appointment_documents_id = #{id} and write_off=1 + + + + + + update ybsj_attractions_play set play=play+1 where attractions_id=#{id} + diff --git a/src/main/java/com/cjy/back/ybsjAppointment/service/YbsjyAppointmentSettingService.java b/src/main/java/com/cjy/back/ybsjAppointment/service/YbsjyAppointmentSettingService.java index bf8799b..fd1c21d 100644 --- a/src/main/java/com/cjy/back/ybsjAppointment/service/YbsjyAppointmentSettingService.java +++ b/src/main/java/com/cjy/back/ybsjAppointment/service/YbsjyAppointmentSettingService.java @@ -106,5 +106,11 @@ public interface YbsjyAppointmentSettingService { ServerResponse writeOff(String time,String idCard) throws ParseException; + ServerResponse updatePlayCount(String id); + + ServerResponse getPlayCount(String id); + + + } diff --git a/src/main/java/com/cjy/back/ybsjAppointment/service/impl/YbsjyAppointmentSettingServiceImpl.java b/src/main/java/com/cjy/back/ybsjAppointment/service/impl/YbsjyAppointmentSettingServiceImpl.java index ca9710b..a40554f 100644 --- a/src/main/java/com/cjy/back/ybsjAppointment/service/impl/YbsjyAppointmentSettingServiceImpl.java +++ b/src/main/java/com/cjy/back/ybsjAppointment/service/impl/YbsjyAppointmentSettingServiceImpl.java @@ -565,4 +565,20 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti return ServerResponse.createBySuccess("接收成功"); } + + + @Override + public ServerResponse updatePlayCount(String id) { + if(ybsjyAppointmentRecordMapper.getPlayCountIsExist(id)==0){ + ybsjyAppointmentRecordMapper.savePlayCount(id); + }else { + ybsjyAppointmentRecordMapper.updatePlayCount(id); + } + return ServerResponse.createBySuccess("记录成功"); + } + + @Override + public ServerResponse getPlayCount(String id) { + return ServerResponse.createBySuccess(ybsjyAppointmentRecordMapper.getPlayCount(id)); + } } diff --git a/src/main/java/com/cjy/back/ybsjAppointment/task/ExtractWriteOffRecordsTask.java b/src/main/java/com/cjy/back/ybsjAppointment/task/ExtractWriteOffRecordsTask.java index f3d1b3e..c04fbd7 100644 --- a/src/main/java/com/cjy/back/ybsjAppointment/task/ExtractWriteOffRecordsTask.java +++ b/src/main/java/com/cjy/back/ybsjAppointment/task/ExtractWriteOffRecordsTask.java @@ -41,7 +41,7 @@ public class ExtractWriteOffRecordsTask { private String synchronousWriteOffDataUrl; @Value("${encryptionRule}") private String rule; - @Scheduled(cron = "0 0/50 * * * ?") +// @Scheduled(cron = "0 0/50 * * * ?") // @Scheduled(cron = "0 0/1 * * * ?") /** * 提取核销记录并处理