删除文件方法并更新未领取报告状态
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) {
?? ??? ??? ??? ?}
?? ??? ??? ?}
?? ??? ?}
?? ?}
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!