package com.hotent.project.manager.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hotent.project.model.CostProjectProccessNode;
import com.hotent.project.dao.CostProjectProccessNodeDao;
import com.hotent.project.manager.CostProjectProccessNodeManager;
import com.hotent.base.manager.impl.BaseManagerImpl;
import com.hotent.uc.exception.BaseException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.List;
import javax.annotation.Resource;
import com.hotent.base.util.BeanUtils;


/**
 * 流程节点表 服务实现类
 *
 * @company 山西清众科技股份有限公司
 * @author 超级管理员
 * @since 2025-10-01
 */
@Service
public class CostProjectProccessNodeManagerImpl extends BaseManagerImpl<CostProjectProccessNodeDao, CostProjectProccessNode> implements CostProjectProccessNodeManager {

	@Override
	public CostProjectProccessNode getDetail(String id) {
    	CostProjectProccessNode costProjectProccessNode = this.get(id);
    	

		return costProjectProccessNode;
	}
	@Override
	@Transactional
	public void createOrUpdate(CostProjectProccessNode costProjectProccessNode) {
		//新建或更新
		this.saveOrUpdate(costProjectProccessNode);
	}

	@Override
	public List<CostProjectProccessNode> getListByProcessId(String processId) {
		LambdaQueryWrapper<CostProjectProccessNode> qw=new LambdaQueryWrapper<>();
		qw.eq(CostProjectProccessNode::getProcessId,processId);
		List<CostProjectProccessNode> list = this.list(qw);
		if(ObjectUtil.isEmpty(list)){
			throw new BaseException("流程节点不存在");
		}
		return list;
	}
}
