package com.palmnest.webapp.quartz;

import com.palmnest.application.ElementConstant;
import com.palmnest.model.estateserve.SignContract;
import com.palmnest.service.wechat.SignContractManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("updateSignContract")
public class UpdateSignContract {

	@Autowired
	private SignContractManager signContractManager;

	public void run() {

		List<SignContract> list = signContractManager.findSignContractList();
		if (null != list && list.size() > 0) {
			for (SignContract sc : list) {
				//根据id更新过期签约信息
				signContractManager.updateSignContractStatus(sc.getId() + "", ElementConstant.OPRATETYPE_UPD);
			}
		}

	}

}
