package com.aps.core.service.impl.ApsPlate; import java.util.List; import cn.hutool.core.util.IdUtil; import com.aps.common.core.utils.DateUtils; import com.aps.common.security.utils.SecurityUtils; import com.aps.core.domain.ApsPlate.ApsPlateStandardRequire; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.aps.core.mapper.ApsPlateStandardRequireErrorMapper; import com.aps.core.domain.ApsPlate.ApsPlateStandardRequireError; import com.aps.core.service.ApsPlate.IApsPlateStandardRequireErrorService; /** * 钣金标准需求异常信息Service业务层处理 * * @author zhl * @date 2025-05-08 */ @Service public class ApsPlateStandardRequireErrorServiceImpl implements IApsPlateStandardRequireErrorService { @Autowired private ApsPlateStandardRequireErrorMapper apsPlateStandardRequireErrorMapper; /** * 查询钣金标准需求异常信息 * * @param id 钣金标准需求异常信息主键 * @return 钣金标准需求异常信息 */ @Override public ApsPlateStandardRequireError selectApsPlateStandardRequireErrorById(Long id) { return apsPlateStandardRequireErrorMapper.selectApsPlateStandardRequireErrorById(id); } /** * 查询钣金标准需求异常信息列表 * * @param apsPlateStandardRequireError 钣金标准需求异常信息 * @return 钣金标准需求异常信息 */ @Override public List selectApsPlateStandardRequireErrorList(ApsPlateStandardRequireError apsPlateStandardRequireError) { return apsPlateStandardRequireErrorMapper.selectApsPlateStandardRequireErrorList(apsPlateStandardRequireError); } /** * 新增钣金标准需求异常信息 * * @param apsPlateStandardRequireError 钣金标准需求异常信息 * @return 结果 */ @Override public int insertApsPlateStandardRequireError(ApsPlateStandardRequireError apsPlateStandardRequireError) { apsPlateStandardRequireError.setCreateTime(DateUtils.getNowDate()); return apsPlateStandardRequireErrorMapper.insertApsPlateStandardRequireError(apsPlateStandardRequireError); } /** * 修改钣金标准需求异常信息 * * @param apsPlateStandardRequireError 钣金标准需求异常信息 * @return 结果 */ @Override public int updateApsPlateStandardRequireError(ApsPlateStandardRequireError apsPlateStandardRequireError) { apsPlateStandardRequireError.setUpdateTime(DateUtils.getNowDate()); return apsPlateStandardRequireErrorMapper.updateApsPlateStandardRequireError(apsPlateStandardRequireError); } /** * 批量删除钣金标准需求异常信息 * * @param ids 需要删除的钣金标准需求异常信息主键 * @return 结果 */ @Override public int deleteApsPlateStandardRequireErrorByIds(Long[] ids) { return apsPlateStandardRequireErrorMapper.deleteApsPlateStandardRequireErrorByIds(ids); } /** * 删除钣金标准需求异常信息信息 * * @param id 钣金标准需求异常信息主键 * @return 结果 */ @Override public int deleteApsPlateStandardRequireErrorById(Long id) { return apsPlateStandardRequireErrorMapper.deleteApsPlateStandardRequireErrorById(id); } @Override public void saveRequireError(ApsPlateStandardRequire require, String message) { ApsPlateStandardRequireError data = ApsPlateStandardRequireError.builder() .id(IdUtil.getSnowflakeNextId()) .requireId(require.getId()) .batchNumber(require.getBatchNumber()) .docNum(require.getDocNum()) .itemNum(require.getBomLineCode()) .orgCode(require.getOrgCode()) .message(message) .delFlag("0") .build(); data.setCreateBy(SecurityUtils.getUsername()); data.setCreateTime(DateUtils.getNowDate()); apsPlateStandardRequireErrorMapper.insertApsPlateStandardRequireError(data); } }