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.WorkApprovalRuleInfo; import com.gkhy.safePlatform.specialWork.repository.WorkApprovalRuleInfoRepository; import com.gkhy.safePlatform.specialWork.service.baseService.WorkApprovalRuleInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service("workApprovalRuleInfoService") public class WorkApprovalRuleInfoServiceImpl extends ServiceImpl implements WorkApprovalRuleInfoService { @Autowired private WorkApprovalRuleInfoRepository workApprovalRuleInfoRepository; @Override public void saveRule(WorkApprovalRuleInfo ruleEntity) { if (ruleEntity == null || ruleEntity.getId() == null) { throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); } int i = workApprovalRuleInfoRepository.insert(ruleEntity); if (i != 1) { throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); } } }