修改获取乐享冀数据&添加定时任务白名单

dev
862857010@qq.com 2 years ago
parent bc7f10d7f5
commit 63bc759041
  1. 13
      cjy-project/src/main/java/com/cjy/happytoenjoy/task/GetHappyToEnjoyTask.java
  2. 1
      cjy-project/src/main/java/com/cjy/reservation/task/AppointmentStatisticsTask.java
  3. 20
      cjy-project/src/main/resources/mapper/reservationAge/AppointmentStatisticsTaskMapper.xml
  4. 6
      cjy-project/src/main/resources/mapper/reservationdata/AppointmentCenterDataMapper.xml
  5. 2
      ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java

@ -7,10 +7,8 @@ import com.cjy.happytoenjoy.util.SignUtil;
import com.cjy.media.util.WeiBoEncryption;
import com.cjy.reservationdata.domain.AppointmentCenterData;
import com.cjy.reservationdata.service.IAppointmentCenterDataService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -82,7 +80,12 @@ public class GetHappyToEnjoyTask {
//预约人手机号
appointmentCenterData.setAppointmentPeoplePhone(WeiBoEncryption.encrypt(item.getPhone(), rule));
//预约时间段
appointmentCenterData.setAppointmentSlot(item.getBeginTime() + "~" + item.getEndingTime());
if(item.getEndingTime() !=null){
appointmentCenterData.setAppointmentSlot(item.getBeginTime() + "~" + item.getEndingTime());
}else {
appointmentCenterData.setAppointmentSlot(item.getBeginTime());
}
//证件类型
if (item.getCertificateType().equals("身份证")) {
appointmentCenterData.setCertificateType("5501");
@ -94,7 +97,7 @@ public class GetHappyToEnjoyTask {
}
//状态
if (item.getStatus().equals("2")) {
if (item.getStatus().equals("2")||item.getStatus().equals("3")) {
appointmentCenterData.setState("3");
} else {
appointmentCenterData.setState(item.getStatus());
@ -111,7 +114,7 @@ public class GetHappyToEnjoyTask {
}
//
appointmentCenterData.setSourceDataId(item.getId());
appointmentCenterData.setSourceType(1);
appointmentCenterData.setSourceType(2);
appointmentCenterData.setExternalId("783232818342789120");
appointmentCenterData.setDataSources("2");
appointmentCenterData.setCreateTime(new Date());

@ -45,7 +45,6 @@ public class AppointmentStatisticsTask {
//15分钟 实时
public void getAppointmentLiveData() {
//需要前提条件 就是两个系统的名称要一样因为
//获取到今天的预约记录 然后统计数据 预约数量和入园数量
List<Map<String, Object>> list = appointmentStatisticsTaskService.getAppointmentNumberAndAdmissionNumber();
//

@ -16,6 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN b_tour_info t2 on t1.external_id = t2.resource_code
WHERE 1=1
and DATE_FORMAT(t1.appointment_date,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
and t1.source_type=1
GROUP BY t2.resource_code, t1.organ_code
</select>
<select id="getHourAppointmentLiveData" resultType="java.util.Map">
@ -29,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN b_tour_info t2 on t1.external_id = t2.resource_code
WHERE
1 = 1
and t1.source_type=1
-- AND DATE_FORMAT( t1.appointment_date, '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND DATE_FORMAT( t1.create_time, '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND (DATE_FORMAT(t1.create_time, '%H:%i:%s') >= #{startTime} AND DATE_FORMAT(t1.create_time, '%H:%i:%s') &lt;= #{endTime})
@ -42,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
appointment_center_data t1
LEFT JOIN b_tour_info t2 on t1.external_id = t2.resource_code
where t2.resource_code=#{resourceCode} and t1.del_flag !='2' and t1.state !=3 and certificate_type='5501'
where t2.resource_code=#{resourceCode} and t1.del_flag !='2' and t1.state !=3 and certificate_type='5501' and t1.source_type=1
</select>
<select id="getResourceCodeList" resultType="java.util.Map">
@ -53,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
appointment_center_data t1
LEFT JOIN b_tour_info t2 on t1.external_id = t2.resource_code
where t1.del_flag!=2 and t1.certificate_type ='5501'
where t1.del_flag!=2 and t1.certificate_type ='5501' and t1.source_type=1
GROUP BY
t2.resource_code,
t1.organ_code,
@ -66,18 +69,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
appointment_center_data
WHERE
state = 1
and DATE_FORMAT(write_off_time, '%Y-%m-%d') = DATE_FORMAT( NOW(), '%Y-%m-%d' ) and external_id=#{resourceCode} and del_flag!=2
and DATE_FORMAT(write_off_time, '%Y-%m-%d') = DATE_FORMAT( NOW(), '%Y-%m-%d' ) and external_id=#{resourceCode} and del_flag!=2 and source_type=1
</select>
<select id="getWriteOffYesterDayDate" resultType="java.lang.Integer">
SELECT COUNT(*) FROM appointment_center_data WHERE DATE(write_off_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY) and external_id=#{resourceCode} and del_flag!=2
SELECT COUNT(*) FROM appointment_center_data WHERE DATE(write_off_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY) and external_id=#{resourceCode} and del_flag!=2 and source_type=1
</select>
<select id="getWriteOffPreviousHourDate" resultType="java.lang.Integer">
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 t1.external_id=#{resourceCode}
and t1.del_flag!=2
and t1.external_id=#{resourceCode}
and t1.del_flag!=2
and source_type=1
</select>
<select id="getWriteOffPreviousMonthDate" resultType="java.lang.Integer">
@ -92,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
'%Y-%m')
and external_id=#{resourceCode}
and del_flag!=2
and source_type=1
</select>
<select id="getWriteOffPreviousYearDate" resultType="java.lang.Integer">
SELECT count(*)
@ -101,8 +106,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
write_off_time) = YEAR (CURDATE()) - 1
and external_id=#{resourceCode}
and del_flag!=2
and source_type=1
</select>
<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 DATE_FORMAT(write_off_time,'%Y-%m-%d') = ( CURDATE() - INTERVAL 1 DAY)
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>
</mapper>

@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, appointment_number, scenic_name, appointment_date, appointment_slot, appointment_people_name, appointment_people_phone, certificate_type, documents_number, verification_code, state, write_off_time, data_sources, del_flag, create_by, create_time, update_by, update_time, organ_code from appointment_center_data
</sql>
<delete id="deleteAppointmentCenterByDate">
delete from appointment_center_data where appointment_date=#{date}
delete from appointment_center_data where appointment_date=#{date} and source_type =2
</delete>
<select id="selectAppointmentCenterDataList" parameterType="AppointmentCenterData" resultMap="AppointmentCenterDataResult">
@ -120,12 +120,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
certificate_type, documents_number,
verification_code, state, write_off_time,
data_sources,
organ_code,appointment_people_id,external_id,source_data_id)
organ_code,appointment_people_id,external_id,source_data_id,source_type)
VALUES
<foreach item="item" collection="list" separator=",">
(#{item.appointmentNumber}, #{item.scenicName}, #{item.appointmentDate}, #{item.appointmentSlot},
#{item.appointmentPeopleName}, #{item.appointmentPeoplePhone}, #{item.certificateType}, #{item.documentsNumber}, #{item.verificationCode}, #{item.state}, #{item.writeOffTime}, #{item.dataSources},
#{item.organCode},#{item.appointmentPeopleId},#{item.externalId},#{item.sourceDataId})
#{item.organCode},#{item.appointmentPeopleId},#{item.externalId},#{item.sourceDataId},#{item.sourceType})
</foreach>
</insert>

@ -132,7 +132,7 @@ public class Constants
/**
* 定时任务白名单配置仅允许访问的包名如其他需要可以自行添加
*/
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" ,"com.cjy.reservation.task","com.cjy.flow.task","com.cjy.appcomplaint.task"};
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" ,"com.cjy.reservation.task","com.cjy.flow.task","com.cjy.appcomplaint.task","com.cjy.happytoenjoy.task"};
/**
* 定时任务违规的字符

Loading…
Cancel
Save