package cokr.xit.fims.levy.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.levy.Rdct;
import cokr.xit.fims.levy.LevyQuery;
import cokr.xit.fims.levy.service.RdctService;

/**과태료 감경 대장 서비스 구현체.
 *
 * <p>상세 설명:
 *
 * <pre>
 * ============ 변경 이력 ============
 * 2023-08-30	JoJH 최초 작성
 * ================================
 * </pre>
 */
@Service("rdctService")
public class RdctServiceBean extends AbstractServiceBean implements RdctService {

	/** 과태료 감경 대장 정보 Bean */
	@Resource(name = "rdctBean")
	private RdctBean rdctBean;

	@Override
	public List<DataObject> getRdctList(LevyQuery req) {
		return rdctBean.getRdctList(req);
	}

	@Override
	public List<DataObject> getRdcts(LevyQuery req) {
		return rdctBean.getRdcts(req);
	}

	@Override
	public DataObject getRdctInfo(LevyQuery req) {
		if (req.getCallPurpose() == null) {
			req.setCallPurpose("view");
		}

		if (req.getCallPurpose().equals("create")) {
			return rdctBean.getCrdnInfo(req);
		} else {
			return rdctBean.getRdctInfo(req);
		}
	}

	@Override
	public String createRdct(Rdct rdct) {
		return rdctBean.createRdct(rdct);
	}

	@Override
	public String updateRdct(Rdct rdct) {
		return rdctBean.updateRdct(rdct);
	}

	@Override
	public String removeRdct(Rdct rdct) {
		return rdctBean.removeRdct(rdct);
	}

}
