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

/**
 * 工程价款管理Service
 * @author 工程价款管理
 * @version 2018-06-13
 */
@Service
@Transactional(readOnly = true)
public class WorkContentProjectpriceService extends CrudService<WorkContentProjectpriceDao, WorkContentProjectprice> implements WorkContentDetailBaseService{

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


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

}