| | |
| | | if (ObjectUtils.isEmpty(ivrLibaTargetAssortVO)) { |
| | | throw new BaseException("入参为空,请检查后,再新增"); |
| | | } |
| | | Integer seqMax = ivrLibaTargetAssortMapper.selectSeqMax(); |
| | | |
| | | //获取序号最大值 |
| | | Integer seqMax = null; |
| | | try { |
| | | seqMax = ivrLibaTargetAssortMapper.selectSeqMax(); |
| | | } catch (Exception e) { |
| | | seqMax = 0; |
| | | } |
| | | IvrLibaTargetAssort ivrLibaTargetAssort = DtoConversionUtils.sourceToTarget(ivrLibaTargetAssortVO, IvrLibaTargetAssort.class); |
| | | ivrLibaTargetAssort.setSeqno(1); |
| | | if (seqMax != null) { |
| | |
| | | //新增二级树 |
| | | if (CollectionUtils.isNotEmpty(ivrLibaTargetAssortVO.getIvrLibaTargetAssortList())) { |
| | | for (IvrLibaTargetAssort ivrLibaTargetAssort1 : ivrLibaTargetAssortVO.getIvrLibaTargetAssortList()) { |
| | | int seqMax1 = ivrLibaTargetAssortMapper.selectSeqMax(); |
| | | //获取序号最大值 |
| | | Integer seqMax1 = null; |
| | | try { |
| | | seqMax1 = ivrLibaTargetAssortMapper.selectSeqMax(); |
| | | } catch (Exception e) { |
| | | seqMax1 = 0; |
| | | } |
| | | ivrLibaTargetAssort1.setPid(ivrLibaTargetAssort.getId()); |
| | | ivrLibaTargetAssort1.setSeqno(1); |
| | | if (seqMax != null) { |
| | |
| | | public Integer deleteIvrLibaTargetAssortByIds(Long[] ids) { |
| | | Integer i = null; |
| | | for (Long id : ids) { |
| | | if (id < 0) { |
| | | log.info("该指标分类id为默认ID,不能删除,id:{}", id); |
| | | continue; |
| | | } |
| | | i = ivrLibaTargetAssortMapper.deleteIvrLibaTargetAssortById(id); |
| | | IvrLibaTargetAssort ivrLibaTargetAssort = new IvrLibaTargetAssort(); |
| | | ivrLibaTargetAssort.setPid(id); |
| | |
| | | List<IvrLibaTargetAssort> ivrLibaTargetAssorts = ivrLibaTargetAssortMapper.selectIvrLibaTargetAssortList(ivrLibaTargetAssort); |
| | | if (CollectionUtils.isNotEmpty(ivrLibaTargetAssorts)) { |
| | | for (IvrLibaTargetAssort ivrLibaTargetAssort1 : ivrLibaTargetAssorts) { |
| | | ivrLibaTargetAssort1.setPid(999999999L); |
| | | ivrLibaTargetAssort1.setPid(-1L); |
| | | ivrLibaTargetAssortMapper.updateIvrLibaTargetAssort(ivrLibaTargetAssort1); |
| | | } |
| | | } |