package com.cku.oa.timedtask.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

import com.cku.oa.kennel.service.KennelService;

@Service
@Transactional(readOnly = true)
public class KennelTask extends JobActingService{

	@Autowired
	private KennelService kennelService;
	
	@SuppressWarnings("finally")
	@Transactional(readOnly = false)
	int doJob() {
		int count = 0;
		//取消犬舍核算 2019.02.20
//		try {
//			count=kennelService.kennelUpdateCalculateState();
//		} catch (Exception e) {
//			count = -1;
//		} finally {
//			return count;
//		}
		return count;
	}

	@Override
	@SuppressWarnings("finally")
	@Transactional(readOnly = false)
	public int executeOnce() {
		int count = 0;
//		try {
//			SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
//			count=kennelService.kennelUpdateCalculateState();
//		} catch (Exception e) {
//			count = -1;
//		} finally {
//			return count;
//		}
		return count;
	}
	
	

}
