1.分时预约添加团队预约数据

dev
862857010@qq.com 2 years ago
parent 4d73e1dae9
commit d9eadced1a
  1. 7
      cjy-project/src/main/java/com/cjy/reservation/mapper/AppointmentStatisticsTaskMapper.java
  2. 7
      cjy-project/src/main/java/com/cjy/reservation/mapper/ReservationRealtimeMapper.java
  3. 7
      cjy-project/src/main/java/com/cjy/reservation/service/AppointmentStatisticsTaskService.java
  4. 4
      cjy-project/src/main/java/com/cjy/reservation/service/IReservationRealtimeService.java
  5. 10
      cjy-project/src/main/java/com/cjy/reservation/service/impl/AppointmentStatisticsTaskServiceImpl.java
  6. 10
      cjy-project/src/main/java/com/cjy/reservation/service/impl/ReservationRealtimeServiceImpl.java
  7. 19
      cjy-project/src/main/java/com/cjy/reservation/task/AppointmentStatisticsTask.java
  8. 10
      cjy-project/src/main/resources/mapper/reservationAge/AppointmentStatisticsTaskMapper.xml
  9. 8
      cjy-project/src/main/resources/mapper/reservationAge/ReservationRealtimeMapper.xml

@ -35,6 +35,13 @@ public interface AppointmentStatisticsTaskMapper {
*/
List<String> getAppointmentLiveDataList(String resourceCode);
/**
* 获取团队预约的身份证号
* @param resourceCode
* @return
*/
List<String> getReamAppointmentLiveDataList(String resourceCode);
/**
* 获取资源编码集合
*

@ -114,4 +114,11 @@ public interface ReservationRealtimeMapper
* @return
*/
int selectPreBookByOrganCode(Long organCode);
/**
* 获取预约日期是今天的团队预约数量
* @param organCode
* @return
*/
Long getGroupAppointmentCount(String organCode);
}

@ -34,6 +34,13 @@ public interface AppointmentStatisticsTaskService {
*/
List<String> getAppointmentLiveDataList(String resourceCode);
/**
* 获取团队预约的身份证号
* @param resourceCode
* @return
*/
List<String> getReamAppointmentLiveDataList(String resourceCode);
/**
* 获取资源编码集合
*

@ -110,4 +110,8 @@ public interface IReservationRealtimeService
* @return
*/
int selectPreBookByOrganCode( Long organCode);
/**
* 获取预约日期是今天的团队预约数量
*/
Long getGroupAppointmentCount(String organCode);
}

@ -50,6 +50,16 @@ public class AppointmentStatisticsTaskServiceImpl implements AppointmentStatisti
return appointmentStatisticsTaskMapper.getAppointmentLiveDataList(resourceCode);
}
/**
* 获取团队预约的身份证号
* @param resourceCode
* @return
*/
@Override
public List<String> getReamAppointmentLiveDataList(String resourceCode) {
return appointmentStatisticsTaskMapper.getReamAppointmentLiveDataList(resourceCode);
}
/**
* 获取资源编码集合
*

@ -158,4 +158,14 @@ public class ReservationRealtimeServiceImpl implements IReservationRealtimeServi
public int selectPreBookByOrganCode(Long organCode) {
return reservationRealtimeMapper.selectPreBookByOrganCode(organCode);
}
/**
* 获取预约日期是今天的团队预约数量
* @param organCode
* @return
*/
@Override
public Long getGroupAppointmentCount(String organCode) {
return reservationRealtimeMapper.getGroupAppointmentCount(organCode);
}
}

@ -59,9 +59,11 @@ public class AppointmentStatisticsTask {
reservationRealtime.setUpdateTime(DateUtils.getNowDate());
reservationRealtime.setDelFlag("0");
reservationRealtime.setDataSources("2");
reservationRealtime.setPrebookNum(Long.parseLong(item.get("appointmentNumber").toString()));
reservationRealtime.setInNum(Integer.parseInt(item.get("admissionNumber").toString()));
reservationRealtime.setIntoNum(Integer.parseInt(item.get("admissionNumber").toString()));
//获取预约日期是今天的团队预约数量
Long groupAppointmentCount=reservationRealtimeService.getGroupAppointmentCount(item.get("resourceCode").toString());
reservationRealtime.setPrebookNum(Long.parseLong(item.get("appointmentNumber").toString())+groupAppointmentCount);
reservationRealtime.setInNum(Integer.parseInt(item.get("admissionNumber").toString())+groupAppointmentCount.intValue());
reservationRealtime.setIntoNum(Integer.parseInt(item.get("admissionNumber").toString())+groupAppointmentCount.intValue());
//先删除
reservationRealtimeService.deleteReservationRealtimeByResourceCode(item.get("resourceCode").toString());
//在插入
@ -90,9 +92,10 @@ public class AppointmentStatisticsTask {
reservationHour.setUpdateTime(DateUtils.getNowDate());
reservationHour.setDelFlag("0");
reservationHour.setDataSources("2");
reservationHour.setPrebookNum(appointmentNum);
reservationHour.setInNum(writeOffCount);
reservationHour.setIntoNum(writeOffCount);
Long groupAppointmentCount=reservationRealtimeService.getGroupAppointmentCount(item.get("resourceCode").toString());
reservationHour.setPrebookNum(appointmentNum+groupAppointmentCount.intValue());
reservationHour.setInNum(writeOffCount+groupAppointmentCount.intValue());
reservationHour.setIntoNum(writeOffCount+groupAppointmentCount.intValue());
reservationHour.setHour(Integer.parseInt(endTime.split(":")[0]));
//在插入
reservationHourService.insertReservationHour(reservationHour);
@ -132,6 +135,10 @@ public class AppointmentStatisticsTask {
list.stream().forEach(item -> {
if (item.get("resourceCode") != null && !item.get("resourceCode").toString().isEmpty()) {
List<String> dataList = appointmentStatisticsTaskService.getAppointmentLiveDataList(item.get("resourceCode").toString());
//获取团队预约的身份证号
List<String> teamDataList=appointmentStatisticsTaskService.getReamAppointmentLiveDataList(item.get("resourceCode").toString());
dataList.addAll(teamDataList);
//然后添加到dataList中
if(dataList.isEmpty()){
return;
}

@ -128,4 +128,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag!=2
and source_type=1
</select>
<select id="getReamAppointmentLiveDataList" resultType="java.lang.String">
SELECT
t2.encryption_documents_number
FROM
appointment_team_data t1
LEFT JOIN appointment_people_info t2 on t1.id =t2.appointment_form
and t2.del_flag !=2
WHERE t1.scenic_code=#{resourceCode} and t1.del_flag !=2 and t1.appointment_date=DATE_FORMAT( NOW(), '%Y-%m-%d' )
</select>
</mapper>

@ -77,9 +77,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select ifnull(in_num,0)as num from r_reservation_realtime where resource_code=#{resourceCode}
</select>
<select id="selectPreBookByOrganCode" resultType="java.lang.Integer" parameterType="Long">
select ifnull(sum(t1.prebook_num),0) as prebookNum from r_reservation_realtime t1 left join b_tour_info t2 on t1.resource_code = t2.resource_code where t1.del_flag !='2' and t2.del_flag !='2' and t2.organ_code =#{organCode}
getGroupAppointmentCount
</select>
<select id="getGroupAppointmentCount" resultType="java.lang.Long">
SELECT sum(appointment_people_count)
from appointment_team_data
WHERE scenic_code = #{organCode}
and del_flag !=2 and appointment_date=DATE_FORMAT( NOW(), '%Y-%m-%d' )
</select>
<insert id="insertReservationRealtime" parameterType="ReservationRealtime" useGeneratedKeys="true" keyProperty="id">
insert into r_reservation_realtime

Loading…
Cancel
Save