package com.aucma.system.service.impl;

import java.util.List;

import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.system.mapper.SysPortLogMapper;
import com.aucma.system.domain.SysPortLog;
import com.aucma.system.service.ISysPortLogService;

import static com.aucma.common.utils.SecurityUtils.getUsername;

/**
 * MES接口日志Service业务层处理
 * 
 * @author Yinq
 * @date 2023-09-20
 */
@Service
public class SysPortLogServiceImpl implements ISysPortLogService 
{
    @Autowired
    private SysPortLogMapper sysPortLogMapper;

    /**
     * 查询MES接口日志
     * 
     * @param objId MES接口日志主键
     * @return MES接口日志
     */
    @Override
    public SysPortLog selectSysPortLogByObjId(Long objId)
    {
        return sysPortLogMapper.selectSysPortLogByObjId(objId);
    }

    /**
     * 查询MES接口日志列表
     * 
     * @param sysPortLog MES接口日志
     * @return MES接口日志
     */
    @Override
    public List<SysPortLog> selectSysPortLogList(SysPortLog sysPortLog)
    {
        return sysPortLogMapper.selectSysPortLogList(sysPortLog);
    }

    /**
     * 新增MES接口日志
     * 
     * @param sysPortLog MES接口日志
     * @return 结果
     */
    @Override
    public int insertSysPortLog(SysPortLog sysPortLog)
    {
        sysPortLog.setOperationUser("SAP");
        sysPortLog.setOperationTime(DateUtils.getNowDate());
        return sysPortLogMapper.insertSysPortLog(sysPortLog);
    }

    /**
     * 修改MES接口日志
     * 
     * @param sysPortLog MES接口日志
     * @return 结果
     */
    @Override
    public int updateSysPortLog(SysPortLog sysPortLog)
    {
        return sysPortLogMapper.updateSysPortLog(sysPortLog);
    }

    /**
     * 批量删除MES接口日志
     * 
     * @param objIds 需要删除的MES接口日志主键
     * @return 结果
     */
    @Override
    public int deleteSysPortLogByObjIds(Long[] objIds)
    {
        return sysPortLogMapper.deleteSysPortLogByObjIds(objIds);
    }

    /**
     * 删除MES接口日志信息
     * 
     * @param objId MES接口日志主键
     * @return 结果
     */
    @Override
    public int deleteSysPortLogByObjId(Long objId)
    {
        return sysPortLogMapper.deleteSysPortLogByObjId(objId);
    }
}
