package com.zehong.system.service.impl;

import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TTechnologyProcessMapper;
import com.zehong.system.domain.TTechnologyProcess;
import com.zehong.system.service.ITTechnologyProcessService;

/**
 * 工业流程图Service业务层处理
 * 
 * @author zehong
 * @date 2026-07-15
 */
@Service
public class TTechnologyProcessServiceImpl implements ITTechnologyProcessService 
{
    @Autowired
    private TTechnologyProcessMapper tTechnologyProcessMapper;

    /**
     * 查询工业流程图
     * 
     * @param processId 工业流程图ID
     * @return 工业流程图
     */
    @Override
    public TTechnologyProcess selectTTechnologyProcessById(Long processId)
    {
        return tTechnologyProcessMapper.selectTTechnologyProcessById(processId);
    }

    /**
     * 查询工业流程图列表
     * 
     * @param tTechnologyProcess 工业流程图
     * @return 工业流程图
     */
    @Override
    public List<TTechnologyProcess> selectTTechnologyProcessList(TTechnologyProcess tTechnologyProcess)
    {
        return tTechnologyProcessMapper.selectTTechnologyProcessList(tTechnologyProcess);
    }

    /**
     * 新增工业流程图
     * 
     * @param tTechnologyProcess 工业流程图
     * @return 结果
     */
    @Override
    public int insertTTechnologyProcess(TTechnologyProcess tTechnologyProcess)
    {
        tTechnologyProcess.setCreateTime(DateUtils.getNowDate());
        tTechnologyProcess.setCreateTime(DateUtils.getNowDate());
        tTechnologyProcess.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
        return tTechnologyProcessMapper.insertTTechnologyProcess(tTechnologyProcess);
    }

    /**
     * 修改工业流程图
     * 
     * @param tTechnologyProcess 工业流程图
     * @return 结果
     */
    @Override
    public int updateTTechnologyProcess(TTechnologyProcess tTechnologyProcess)
    {
        tTechnologyProcess.setUpdateTime(DateUtils.getNowDate());
        tTechnologyProcess.setUpdateTime(DateUtils.getNowDate());
        tTechnologyProcess.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
        return tTechnologyProcessMapper.updateTTechnologyProcess(tTechnologyProcess);
    }

    /**
     * 批量删除工业流程图
     * 
     * @param processIds 需要删除的工业流程图ID
     * @return 结果
     */
    @Override
    public int deleteTTechnologyProcessByIds(Long[] processIds)
    {
        return tTechnologyProcessMapper.deleteTTechnologyProcessByIds(processIds);
    }

    /**
     * 删除工业流程图信息
     * 
     * @param processId 工业流程图ID
     * @return 结果
     */
    @Override
    public int deleteTTechnologyProcessById(Long processId)
    {
        return tTechnologyProcessMapper.deleteTTechnologyProcessById(processId);
    }
}
