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.WorkApprovalFilledItemInfo; import com.gkhy.safePlatform.specialWork.repository.WorkApprovalFilledItemInfoRepository; import com.gkhy.safePlatform.specialWork.service.baseService.WorkApprovalFilledItemInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service("workApprovalFilledItemInfoService") public class WorkApprovalFilledItemInfoServiceImpl extends ServiceImpl implements WorkApprovalFilledItemInfoService { @Autowired private WorkApprovalFilledItemInfoRepository workApprovalFilledItemInfoRepository; @Override public List listApprovalFilledItemInfoByWorkApplyId(Long workApplyId) { if (workApplyId == null) { throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); } return workApprovalFilledItemInfoRepository.listApprovalFilledItemInfoByWorkApplyId(workApplyId); } @Override public List listApprovalFilledItemInfoByUnitId(Long unitId) { if (unitId == null) { throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); } return workApprovalFilledItemInfoRepository.listApprovalFilledItemInfoByUnitId(unitId); } @Override public void saveBatchFilledItemInfo(List filledItemInfos) { if (filledItemInfos == null || filledItemInfos.size() == 0) { throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); } int i = workApprovalFilledItemInfoRepository.insertBatchFilledItemInfo(filledItemInfos); if (i != filledItemInfos.size()) { throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); } } }