package nccloud.web.hrwa.paydata.action;

import java.util.HashMap;

import nc.itf.hr.wa.IWaDataDevTool;
import nc.vo.pub.lang.UFBoolean;
import nc.vo.pubapp.pattern.pub.PubAppTool;
import nccloud.framework.service.ServiceLocator;
import nccloud.framework.web.container.IRequest;
import nccloud.web.hr.pub.HRCommonAction;
import nccloud.web.uapbd.commons.web.ParamUtils;

public class PayDataPushPayBill extends HRCommonAction{

	@Override
	public <T> Object execute(IRequest request, T para) throws Exception {
		// TODO Auto-generated method stub
		ParamUtils param = new ParamUtils(request);
		IWaDataDevTool service = ServiceLocator .find(IWaDataDevTool.class);
		
		UFBoolean ischeckaction = param.getUFBoolean("ischeckaction", UFBoolean.FALSE);
		UFBoolean ispushyear = param.getUFBoolean("ispushyear", UFBoolean.FALSE);
		String pk_org = param.getString("pk_org", "");
		String pk_wa_class = param.getString("pk_wa_class", "");
		String cyear = param.getString("cyear", "");
		String cperiod = param.getString("cperiod", "");
		
		if(ischeckaction.booleanValue()) {
			String mesg = service.CheckSendStaus(pk_org,pk_wa_class,cyear,cperiod,ispushyear.booleanValue());
			HashMap<String,Object>  retmesg =  new HashMap<String,Object>();
			if(!PubAppTool.isNull(mesg)) {
				retmesg.put("result",mesg+",ÊÇ·ñ¼ÌÐø²Ù×÷£¿");
				retmesg.put("needask", true);
				
			}else {
				retmesg.put("needask", false);
			}
			return retmesg;
					
		}else {
			service.PushPayBill(pk_org,pk_wa_class,cyear,cperiod,ispushyear.booleanValue());
		}
		
		
		
		return null;
	}

}
