package weaver.interfaces.htsc.financialadjustment;

import com.engine.common.util.ServiceUtil;
import com.engine.htsc.financialadjustment.service.impl.AdjustFundServiceImpl;
import weaver.general.BaseBean;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;
import weaver.workflow.request.RequestManager;

/**
 * k1810012
 * 资金业务付款同步预算和核算数据
 * @desc 财务调整办结节点前
 */
public class SyncFundsAction extends BaseBean implements Action {

  @Override
  public String execute(RequestInfo requestInfo) {
    AdjustFundServiceImpl service = ServiceUtil.getService(AdjustFundServiceImpl.class);
    try {
      String rid = requestInfo.getRequestid();
      writeLog(String.format("资金业务付款同步预算和核算数据, requestid:%s", rid));
      service.doBudget(rid);
      service.doCost(rid);
      return SUCCESS;
    } catch (Exception e) {
      return FAILURE_AND_CONTINUE;

    }
  }
}
