1.添加接口

l
862857010@qq.com 2 years ago
parent 23936cb6ab
commit c254eb00d2
  1. 36
      src/main/java/com/cjy/back/ybsjAppointment/controller/YbsjyAppletsAppointmentController.java
  2. 11
      src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.java
  3. 15
      src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.xml
  4. 6
      src/main/java/com/cjy/back/ybsjAppointment/service/YbsjyAppointmentSettingService.java
  5. 16
      src/main/java/com/cjy/back/ybsjAppointment/service/impl/YbsjyAppointmentSettingServiceImpl.java
  6. 2
      src/main/java/com/cjy/back/ybsjAppointment/task/ExtractWriteOffRecordsTask.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);
}
}

@ -166,4 +166,15 @@ public interface YbsjyAppointmentRecordMapper {
List<String> getAppointmentPeopleIdByDocumentsId(Long id);
Map<String,Object> getWriteOffStatusQuantity(Long id);
int updatePlayCount(String id);
int savePlayCount(String attractionsId);
int getPlayCountIsExist(String attractionsId);
int getPlayCount(String id);
}

@ -15,6 +15,9 @@
</foreach>
</insert>
<insert id="savePlayCount">
INSERT INTO ybsj_attractions_play (attractions_id) VALUES (#{attractionsId})
</insert>
<update id="deleteAppointmentRecord">
update ybsj_appointment_documents_info
set del_flag= 2,
@ -85,6 +88,7 @@
</foreach>
</update>
<select id="getAppointmentRecordListByPage" resultType="java.util.Map">
SELECT
t1.id,
@ -323,4 +327,15 @@
<select id="getAppointmentPeopleIdByDocumentsIdWriteOffCount" resultType="java.lang.Integer">
select count(*) from ybsj_appointment_people_info where appointment_documents_id = #{id} and write_off=1
</select>
<select id="getPlayCount" resultType="com.cjy.util.ServerResponse">
select play from ybsj_attractions_play where attractions_id=#{id}
</select>
<select id="getPlayCountIsExist" resultType="java.lang.Integer">
select count(*) from ybsj_attractions_play where attractions_id=#{attractionsId}
</select>
<update id="updatePlayCount">
update ybsj_attractions_play set play=play+1 where attractions_id=#{id}
</update>
</mapper>

@ -106,5 +106,11 @@ public interface YbsjyAppointmentSettingService {
ServerResponse writeOff(String time,String idCard) throws ParseException;
ServerResponse updatePlayCount(String id);
ServerResponse getPlayCount(String id);
}

@ -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));
}
}

@ -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 * * * ?")
/**
* 提取核销记录并处理

Loading…
Cancel
Save