liusheng
2024-01-15 a0bcee3aa22b79f592c44cdb3dcdbd681490f265
smartor/src/main/java/com/smartor/service/impl/IvrLibaExtemplateCategoryServiceImpl.java
@@ -5,6 +5,7 @@
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;
@@ -17,6 +18,7 @@
 * @author ruoyi
 * @date 2023-12-27
 */
@Slf4j
@Service
public class IvrLibaExtemplateCategoryServiceImpl implements IIvrLibaExtemplateCategoryService {
    @Autowired
@@ -85,6 +87,11 @@
    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();
@@ -93,7 +100,7 @@
            if (CollectionUtils.isNotEmpty(ivrLibaExtemplateCategories)) {
                for (IvrLibaExtemplateCategory ivrLibaExtemplateCategory1 : ivrLibaExtemplateCategories) {
                    //设置未分配ID
                    ivrLibaExtemplateCategory1.setPid(999999999L);
                    ivrLibaExtemplateCategory1.setPid(-1L);
                    ivrLibaExtemplateCategoryMapper.updateIvrLibaExtemplateCategory(ivrLibaExtemplateCategory1);
                }
            }