/**
 * 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.WorkContentPriceadjust;
import com.jeeplus.modules.workcontent.dao.WorkContentPriceadjustDao;

/**
 * 动态成本控制Service
 * @author ssrh
 * @version 2018-06-11
 */
@Service
@Transactional(readOnly = true)
public class WorkContentPriceadjustService extends CrudService<WorkContentPriceadjustDao, WorkContentPriceadjust> implements WorkContentDetailBaseService{

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


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

}