/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.workcontent.service;

import java.util.List;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.common.persistence.Page;
import com.jeeplus.common.service.CrudService;
import com.jeeplus.modules.workcontent.entity.WorkContentFundplan;
import com.jeeplus.modules.workcontent.dao.WorkContentFundplanDao;

/**
 * 资金计划Service
 * @author ssrh
 * @version 2018-06-06
 */
@Service
@Transactional(readOnly = true)
public class WorkContentFundplanService extends CrudService<WorkContentFundplanDao, WorkContentFundplan> implements WorkContentDetailBaseService {

	public WorkContentFundplan get(String id) {
		return super.get(id);
	}
	
	public List<WorkContentFundplan> findList(WorkContentFundplan workContentFundplan) {
		return super.findList(workContentFundplan);
	}
	
	public Page<WorkContentFundplan> findPage(Page<WorkContentFundplan> page, WorkContentFundplan workContentFundplan) {
		return super.findPage(page, workContentFundplan);
	}
	
	@Transactional(readOnly = false)
	public void save(WorkContentFundplan workContentFundplan) {
		super.save(workContentFundplan);
	}
	
	@Transactional(readOnly = false)
	public void delete(WorkContentFundplan workContentFundplan) {
		super.delete(workContentFundplan);
	}


    @Override
    @Transactional(readOnly = false)
    public void saveDetails(String detailStr, String projectId, String contentId) {
        WorkContentFundplan newRecord = JSON.parseObject(detailStr,WorkContentFundplan.class);
        newRecord.setProjectId(projectId);
        newRecord.setContentId(contentId);
        this.save(newRecord);
    }

}