接口调整

dev
masong 2 years ago
parent fe705df5d1
commit ec3b350901
  1. 2
      cjy-project/src/main/java/com/cjy/reservation/mapper/AppointmentStatisticsTaskMapper.java
  2. 8
      cjy-project/src/main/java/com/cjy/reservation/service/AppointmentStatisticsTaskService.java
  3. 6
      cjy-project/src/main/java/com/cjy/reservation/service/impl/AppointmentStatisticsTaskServiceImpl.java
  4. 44
      cjy-project/src/main/java/com/cjy/reservation/task/AppointmentStatisticsTask.java
  5. 2
      cjy-project/src/main/resources/mapper/marketingdata/MarketingWechatMicroblogInfoMapper.xml
  6. 12
      cjy-project/src/main/resources/mapper/reservationAge/AppointmentStatisticsTaskMapper.xml

@ -80,4 +80,6 @@ public interface AppointmentStatisticsTaskMapper {
int getWriteOffPreviousHourDate(@Param("resourceCode") String resourceCode,@Param("startTime") String startTime, @Param("endTime") String endTime);
List<String>selectTouristVerification (@Param("resourceCode") String resourceCode);
int selectAppointmentsNumber(@Param("resourceCode") String resourceCode,@Param("startTime") String startTime,@Param("endTime") String endTime);
}

@ -86,4 +86,12 @@ public interface AppointmentStatisticsTaskService {
* @return
*/
List<String >selectTouristVerification(String resourceCode);
/**
*
* 查询景区预约量
* @param resourceCode
* @return
*/
int selectAppointmentsNumber(String resourceCode,String startTime,String endTime);
}

@ -118,4 +118,10 @@ public class AppointmentStatisticsTaskServiceImpl implements AppointmentStatisti
return appointmentStatisticsTaskMapper.selectTouristVerification(resourceCode);
}
@Override
public int selectAppointmentsNumber(String resourceCode, String startTime, String endTime) {
return appointmentStatisticsTaskMapper.selectAppointmentsNumber(resourceCode,startTime,endTime);
}
}

@ -72,14 +72,14 @@ public class AppointmentStatisticsTask {
//每小时的小时 第五分钟执行 上上小时到上小时的数据
public void getHourAppointmentLiveData() {
//需要前提条件 就是两个系统的名称要一样因为 没有同步景区id所以 只能使用名称来做数据管理
//获取到前一小时 到 当前小时 核销的数量(即入园)和在园数 预约数是创建日期是他的吗
String startTime = DateUtils.getNHoursAgo(1);
String endTime = DateUtils.getNHoursAgo(0);
List<Map<String, Object>> list = appointmentStatisticsTaskService.getHourAppointmentLiveData(startTime, endTime);
//
list.stream().forEach(item -> {
if (item.get("resourceCode") != null && !item.get("resourceCode").toString().isEmpty()) {
List<Map<String, Object>> list = appointmentStatisticsTaskService.getResourceCodeList();
list.stream().forEach(item ->{
if(null !=item.get("resourceCode")){
// 查询预约量
String startTime = DateUtils.getNHoursAgo(1);
String endTime = DateUtils.getNHoursAgo(0);
int appointmentNum = appointmentStatisticsTaskService.selectAppointmentsNumber(item.get("resourceCode")+"",startTime,endTime);
// 查询核销量
int writeOffCount = appointmentStatisticsTaskService.getWriteOffPreviousHourDate(item.get("resourceCode").toString(), startTime, endTime);
ReservationHour reservationHour = new ReservationHour();
reservationHour.setResourceCode(Long.parseLong(item.get("resourceCode").toString()));
@ -90,7 +90,7 @@ public class AppointmentStatisticsTask {
reservationHour.setUpdateTime(DateUtils.getNowDate());
reservationHour.setDelFlag("0");
reservationHour.setDataSources("2");
reservationHour.setPrebookNum(Integer.parseInt(item.get("appointmentNumber").toString()));
reservationHour.setPrebookNum(appointmentNum);
reservationHour.setInNum(writeOffCount);
reservationHour.setIntoNum(writeOffCount);
reservationHour.setHour(Integer.parseInt(endTime.split(":")[0]));
@ -98,6 +98,32 @@ public class AppointmentStatisticsTask {
reservationHourService.insertReservationHour(reservationHour);
}
});
// //需要前提条件 就是两个系统的名称要一样因为 没有同步景区id所以 只能使用名称来做数据管理
// //获取到前一小时 到 当前小时 核销的数量(即入园)和在园数 预约数是创建日期是他的吗
// String startTime = DateUtils.getNHoursAgo(1);
// String endTime = DateUtils.getNHoursAgo(0);
// List<Map<String, Object>> list = appointmentStatisticsTaskService.getHourAppointmentLiveData(startTime, endTime);
// //
// list.stream().forEach(item -> {
// if (item.get("resourceCode") != null && !item.get("resourceCode").toString().isEmpty()) {
// int writeOffCount = appointmentStatisticsTaskService.getWriteOffPreviousHourDate(item.get("resourceCode").toString(), startTime, endTime);
// ReservationHour reservationHour = new ReservationHour();
// reservationHour.setResourceCode(Long.parseLong(item.get("resourceCode").toString()));
// reservationHour.setOrganCode(Long.parseLong(item.get("organCode").toString()));
// reservationHour.setCreateBy(1 + "");
// reservationHour.setCreateTime(DateUtils.getNowDate());
// reservationHour.setUpdateBy(1 + "");
// reservationHour.setUpdateTime(DateUtils.getNowDate());
// reservationHour.setDelFlag("0");
// reservationHour.setDataSources("2");
// reservationHour.setPrebookNum(Integer.parseInt(item.get("appointmentNumber").toString()));
// reservationHour.setInNum(writeOffCount);
// reservationHour.setIntoNum(writeOffCount);
// reservationHour.setHour(Integer.parseInt(endTime.split(":")[0]));
// //在插入
// reservationHourService.insertReservationHour(reservationHour);
// }
// });
}
public void getSexAppointmentLiveData() {

@ -279,7 +279,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by statistics_time order by statistics_time desc limit 7
</select>
<select id="selectDYData" resultType="java.util.Map">
select (select sum(content_published_number) from md_marketing_wechat_microblog_info where type =3) as videoNum,fans_number as fansNum, read_number as readNum,transpond_number as transpondNum from md_marketing_wechat_microblog_info where type =3 and del_flag !='2' order by statistics_time desc limit 1
select (select sum(content_published_number) from md_marketing_wechat_microblog_info where type =3 and del_flag !='2') as videoNum,fans_number as fansNum, read_number as readNum,transpond_number as transpondNum from md_marketing_wechat_microblog_info where type =3 and del_flag !='2' order by statistics_time desc limit 1
</select>
</mapper>

@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select COUNT(*) FROM appointment_center_data t1
where 1=1
AND DATE_FORMAT( t1.appointment_date, '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND DATE_FORMAT (t1.write_off_time,'%H:00') BETWEEN #{startTime} AND #{endTime}
AND DATE_FORMAT (t1.write_off_time,'%H:00') >= #{startTime} AND DATE_FORMAT (t1.write_off_time,'%H:00') &lt; #{endTime}
and t1.external_id=#{resourceCode}
and t1.del_flag!=2
and source_type=1
@ -111,4 +111,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTouristVerification" resultType="java.lang.String">
select documents_number from appointment_center_data where state =1 and certificate_type ='5501' and external_id = #{resourceCode} and source_type=1 and source_type=1 and DATE_FORMAT(write_off_time,'%Y-%m-%d') = ( CURDATE() - INTERVAL 1 DAY)
</select>
<select id="selectAppointmentsNumber" resultType="java.lang.Integer">
SELECT count(*)
FROM appointment_center_data t1
WHERE (DATE_FORMAT(t1.create_time, '%H:%i:%s') >=#{startTime} AND DATE_FORMAT(t1.create_time, '%H:%i:%s') &lt;= #{endTime}) and del_flag !='2'
AND DATE_FORMAT( t1.create_time, '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
and external_id=#{resourceCode}
and del_flag!=2
and source_type=1
</select>
</mapper>
Loading…
Cancel
Save