| | |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.smartor.common.PinYinUtil; |
| | | import com.smartor.domain.IvrLibaTargetAssort; |
| | | import com.smartor.domain.SvyLibScriptCategory; |
| | | import com.smartor.domain.SvyLibScriptCategoryVO; |
| | |
| | | @Override |
| | | public List<SvyLibScriptCategoryVO> selectSvyLibScriptCategoryList(SvyLibScriptCategory svyLibScriptCategory) { |
| | | List<SvyLibScriptCategory> svyLibScriptCategories = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryList(svyLibScriptCategory); |
| | | //// //将pid为空的,过滤掉 |
| | | // svyLibScriptCategories = svyLibScriptCategories.stream().filter(assort -> assort.getPid() == null).collect(Collectors.toList()); |
| | | // |
| | | // List<SvyLibScriptCategoryVO> SvyLibScriptCategoryVO = DtoConversionUtils.sourceToTarget(svyLibScriptCategories, SvyLibScriptCategoryVO.class); |
| | | // //遍历查出来的数据,通过 id=pid 获取他们的子数据 |
| | | // for (SvyLibScriptCategoryVO svyLibScriptCategoryVO : SvyLibScriptCategoryVO) { |
| | | // if (svyLibScriptCategoryVO.getPid() != null) { |
| | | // continue; |
| | | // } |
| | | // SvyLibScriptCategory svyLibScriptCategory1 = new SvyLibScriptCategory(); |
| | | // svyLibScriptCategory1.setPid(svyLibScriptCategoryVO.getId()); |
| | | // List<SvyLibScriptCategory> svyLibScriptCategories1 = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryList(svyLibScriptCategory1); |
| | | // if (!Collections.isEmpty(svyLibScriptCategories1)) { |
| | | // svyLibScriptCategoryVO.setSvyLibScriptCategoryList(svyLibScriptCategories1); |
| | | // } |
| | | // } |
| | | List<SvyLibScriptCategoryVO> svyLibScriptCategoryVOS = DtoConversionUtils.sourceToTarget(svyLibScriptCategories, SvyLibScriptCategoryVO.class); |
| | | List<SvyLibScriptCategoryVO> svyLibScriptCategoryVOS = DtoConversionUtils.sourceToTarget(svyLibScriptCategories, SvyLibScriptCategoryVO.class); |
| | | |
| | | List<SvyLibScriptCategoryVO> rootList = new ArrayList<>(); |
| | | Map<Long, SvyLibScriptCategoryVO> categoryMap = new HashMap<>(); |
| | |
| | | categoryMap.put(category.getId(), category); |
| | | } |
| | | |
| | | for (SvyLibScriptCategoryVO category : svyLibScriptCategoryVOS) { |
| | | for (SvyLibScriptCategoryVO category : svyLibScriptCategoryVOS) { |
| | | if (category.getPid() == null || category.getPid() == -1) { |
| | | // 顶层节点 |
| | | rootList.add(category); |
| | |
| | | @Override |
| | | public int updateSvyLibScriptCategory(SvyLibScriptCategory svyLibScriptCategory) { |
| | | svyLibScriptCategory.setUpdateTime(DateUtils.getNowDate()); |
| | | if (svyLibScriptCategory.getName() != null && svyLibScriptCategory.getName().contains("满意度") && svyLibScriptCategory.getPid() != -1) { |
| | | svyLibScriptCategory.setType(PinYinUtil.getpy(svyLibScriptCategory.getName())); |
| | | } |
| | | return svyLibScriptCategoryMapper.updateSvyLibScriptCategory(svyLibScriptCategory); |
| | | } |
| | | |
| | |
| | | svyLibScriptCategory.setUpdateTime(new Date()); |
| | | svyLibScriptCategory.setCreateTime(new Date()); |
| | | if (svyLibScriptCategory.getPid() == null) svyLibScriptCategory.setPid((long) -1); |
| | | if (svyLibScriptCategory.getName() != null && svyLibScriptCategory.getName().contains("满意度") && svyLibScriptCategory.getPid() != -1) { |
| | | svyLibScriptCategory.setType(PinYinUtil.getpy(svyLibScriptCategory.getName())); |
| | | } |
| | | i = svyLibScriptCategoryMapper.insertSvyLibScriptCategory(svyLibScriptCategory); |
| | | log.info("问题话术分类库一级树的主键:{}", svyLibScriptCategory.getId()); |
| | | |
| | |
| | | if (seqMax1 != null) { |
| | | svyLibScriptCategory1.setSeqno(seqMax1 + 1); |
| | | } |
| | | if (svyLibScriptCategory1.getName() != null && svyLibScriptCategory1.getName().contains("满意度")) { |
| | | svyLibScriptCategory1.setType(PinYinUtil.getpy(svyLibScriptCategory1.getName())); |
| | | } |
| | | |
| | | svyLibScriptCategory1.setGuid(svyLibScriptCategoryVO.getGuid()); |
| | | svyLibScriptCategory1.setOrgid(svyLibScriptCategoryVO.getOrgid()); |
| | | svyLibScriptCategoryMapper.insertSvyLibScriptCategory(svyLibScriptCategory1); |