package com.gkhy.safePlatform.specialWork.service.baseService.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gkhy.safePlatform.commons.enums.ResultCodes; import com.gkhy.safePlatform.commons.exception.BusinessException; import com.gkhy.safePlatform.specialWork.entity.WorkApprovalItemStandInfo; import com.gkhy.safePlatform.specialWork.repository.WorkApprovalItemStandInfoRepository; import com.gkhy.safePlatform.specialWork.service.baseService.WorkApprovalItemStandInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Collection; import java.util.List; @Service("workApprovalItemStandInfoService") public class WorkApprovalItemStandInfoServiceImpl extends ServiceImpl implements WorkApprovalItemStandInfoService { @Autowired private WorkApprovalItemStandInfoRepository workApprovalItemStandInfoRepository; @Override public void saveBatchStand(List standEntities) { if (standEntities == null || standEntities.size() == 0) { throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); } int i = workApprovalItemStandInfoRepository.insertBatch(standEntities); if (i != standEntities.size()) { throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); } } @Override public List listWorkApprovalItemStandByWorkApplyId(Long workApplyId) { if (workApplyId == null) { throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); } return workApprovalItemStandInfoRepository.listWorkApprovalItemStandByWorkApplyId(workApplyId); } @Override public List listItemStandByIds(Collection standIds) { if (standIds == null || standIds.size() == 0) { throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); } return workApprovalItemStandInfoRepository.listItemStandByIds(standIds); } }