
package nccloud.bs.hrkq.hrkq.aggbusi.ace.bp;
import nc.vo.hrkq.monthottime.AggMonthOtTimeVO;
import nc.impl.pubapp.pattern.data.bill.BillUpdate;
import nc.vo.pub.VOStatus;
import nc.vo.pub.pf.BillStatusEnum;

/**
 * 标准单据收回的BP
 */
public class AceMonthOtTimeVOUnSendApproveBP {

        public AggMonthOtTimeVO[] unSend(AggMonthOtTimeVO[] clientBills,
                        AggMonthOtTimeVO[] originBills) {
                // 把VO持久化到数据库中
                this.setHeadVOStatus(clientBills);
                BillUpdate<AggMonthOtTimeVO> update = new BillUpdate<AggMonthOtTimeVO>();
                AggMonthOtTimeVO[] returnVos = update.update(clientBills, originBills);
                return returnVos;
        }

        private void setHeadVOStatus(AggMonthOtTimeVO[] clientBills) {
                for (AggMonthOtTimeVO clientBill : clientBills) {
                        clientBill.getParentVO().setAttributeValue("${vmObject.billstatus}",
                                        BillStatusEnum.FREE.value());
                        clientBill.getParentVO().setStatus(VOStatus.UPDATED);
                }
        }
}
