| | |
| | | import com.smartor.domain.IvrLibaExtemplateCategory; |
| | | import com.smartor.mapper.IvrLibaExtemplateCategoryMapper; |
| | | import com.smartor.service.IIvrLibaExtemplateCategoryService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * @author ruoyi |
| | | * @date 2023-12-27 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class IvrLibaExtemplateCategoryServiceImpl implements IIvrLibaExtemplateCategoryService { |
| | | @Autowired |
| | |
| | | public int deleteIvrLibaExtemplateCategoryByIntertcatids(Long[] intertcatids) { |
| | | Integer i = null; |
| | | for (Long intertcatid : intertcatids) { |
| | | //负数的ID为默认值,不可以删除 |
| | | if (intertcatid < 0) { |
| | | log.info("intertcatid的值为:{}", intertcatid); |
| | | continue; |
| | | } |
| | | i = ivrLibaExtemplateCategoryMapper.deleteIvrLibaExtemplateCategoryByIntertcatid(intertcatid); |
| | | //删除成功后,如果该删除的ID下有子数据,则将子数据放到未分配下面 |
| | | IvrLibaExtemplateCategory ivrLibaExtemplateCategory = new IvrLibaExtemplateCategory(); |
| | |
| | | if (CollectionUtils.isNotEmpty(ivrLibaExtemplateCategories)) { |
| | | for (IvrLibaExtemplateCategory ivrLibaExtemplateCategory1 : ivrLibaExtemplateCategories) { |
| | | //设置未分配ID |
| | | ivrLibaExtemplateCategory1.setPid(999999999L); |
| | | ivrLibaExtemplateCategory1.setPid(-1L); |
| | | ivrLibaExtemplateCategoryMapper.updateIvrLibaExtemplateCategory(ivrLibaExtemplateCategory1); |
| | | } |
| | | } |