package cokr.xit.fims.rcvm.service.bean;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.fims.rcvm.Rcvmt;
import cokr.xit.fims.rcvm.RcvmtQuery;
import cokr.xit.fims.rcvm.service.RcvmtService;

/**수납 대장 서비스 구현체.
 *
 * <p>상세 설명:
 *
 * <pre>
 * ============ 변경 이력 ============
 * 2023-08-31	JoJH 최초 작성
 * ================================
 * </pre>
 */
@Service("rcvmtService")
public class RcvmtServiceBean extends AbstractServiceBean implements RcvmtService {

	/** 수납 대장 정보 Bean */
	@Resource(name = "rcvmtBean")
	private RcvmtBean rcvmtBean;

	@Override
	public List<DataObject> getRcvmtList(RcvmtQuery req) {
		return rcvmtBean.getRcvmtList(req);
	}

	@Override
	public List<DataObject> getRcvmts(RcvmtQuery req) {
		return rcvmtBean.getRcvmts(req);
	}

	@Override
	public DataObject getRcvmtInfo(RcvmtQuery req) {
		if (req.getCallPurpose() == null) {
			req.setCallPurpose("view");
		}
		if (req.getDelYn() == null) {
			req.setDelYn("N");
		}

		if (req.getCallPurpose().equals("create")) {
			return rcvmtBean.getLevyInfo(req);			// 부과 정보 조회
		} else {
			return rcvmtBean.getRcvmtInfo(req);			// 수납 정보 조회
		}
	}

	@Override
	public String createRcvmt(Rcvmt rcvmt) {
		return rcvmtBean.createRcvmt(rcvmt);
	}

	@Override
	public String updateRcvmtRtrcn(Rcvmt rcvmt) {
		return rcvmtBean.updateRcvmtRtrcn(rcvmt);
	}

	@Override
	public String removeRcvmt(Rcvmt rcvmt) {
		return rcvmtBean.removeRcvmt(rcvmt);
	}

}
