1,
<!-?删除文件方法并更新未领取报告状态 -->
?? ?<bean id="truncateReportService" class="com.rjhc.application.sysmanage.service.impl.SysTaskScheduleServiceImpl" />
? ? <bean id="jobDetail_truncateReportService" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">?
? ? ?? ?<property name="targetObject" ref="truncateReportService"/>?
? ? ?? ?<property name="targetMethod" value="truncateReport"/>?
? ? </bean>
? ? <bean name="truncateReportCron" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">?
? ? ?? ?<property name="jobDetail" ref="jobDetail_truncateReportService"/>?
? ? ?? ?<property name="cronExpression" value="0 0 20 * * ?" />
?? ?</bean>?? ?
2,
public void truncateReport() {
?? ??? ?try {
?? ??? ??? ?
?? ??? ??? ?//修改未领取人状态
?? ??? ??? ?orgPersonalQueryLogDao.updateNoReceiveReport();
?? ??? ??? ?orgProposerAgainPrintReportDao.updateNoReceiveAgainPrintReport();
?? ??? ??? ?
?? ??? ? ? ?//删除征信报告方法
?? ??? ??? ?personalQueryLogService.trunateReport();
?? ??? ?} catch (Exception e) {
?? ??? ??? ?logger.error("------truncateReport错误"+e.getMessage());
?? ??? ?}
?? ?
?? ??? ?
?? ?
?? ?}
3,
public void updateNoReceiveAgainPrintReport();
4,
@Override
?? ?public void trunateReport() {
?? ??? ?String REPORT_PATH = ConfigStatic.getValueByKey("REPORT_PATH");
?? ??? ?File reportFile = new File(REPORT_PATH);
?? ??? ?if(reportFile.exists()){
?? ??? ??? ?File[] delteFiles = reportFile.listFiles(new java.io.FilenameFilter(){
?? ??? ??? ??? ?
?? ??? ??? ??? ?@Override
?? ??? ??? ??? ?public boolean accept(File dir, String name) {
?? ??? ??? ??? ??? ?return true;
?? ??? ??? ??? ?}
?? ??? ??? ??? ?
?? ??? ??? ?});
?? ??? ??? ?
?? ??? ??? ?for(File f:delteFiles){
?? ??? ??? ??? ?try {
?? ??? ??? ??? ??? ?FileUtils.deleteDirectory(f);
?? ??? ??? ??? ?} catch (IOException e) {
?? ??? ??? ??? ?}
?? ??? ??? ?}
?? ??? ?}
?? ?}