|
@@ -2,7 +2,9 @@ package com.zhongzheng.modules.inform.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
+import org.apache.commons.math3.distribution.AbstractMultivariateRealDistribution;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -80,16 +82,52 @@ public class InformClassifyServiceImpl extends ServiceImpl<InformClassifyMapper,
|
|
|
validEntityBeforeSave(update);
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
if (bo.getStatus() == -1) {
|
|
|
- LambdaQueryWrapper<InformClassify> lqw = Wrappers.lambdaQuery();
|
|
|
- lqw.eq(InformClassify::getParentId, bo.getClassifyId());
|
|
|
- InformClassify informClassify = new InformClassify();
|
|
|
- informClassify.setStatus(-1);
|
|
|
- informClassify.setUpdateTime(DateUtils.getNowTime());
|
|
|
- baseMapper.update(informClassify, lqw);
|
|
|
+ findCompanyAndDepts(bo);
|
|
|
}
|
|
|
return this.updateById(update);
|
|
|
}
|
|
|
|
|
|
+ public Boolean findCompanyAndDepts(InformClassifyEditBo bo){
|
|
|
+ LambdaQueryWrapper<InformClassify> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq(InformClassify::getParentId, bo.getClassifyId());
|
|
|
+ List<InformClassify> list = this.list(lqw);
|
|
|
+ if(CollectionUtils.isNotEmpty(list)){
|
|
|
+ for (InformClassify informClassify : list) {
|
|
|
+ lqw.clear();
|
|
|
+ lqw.eq(InformClassify::getClassifyId, informClassify.getClassifyId());
|
|
|
+ informClassify.setStatus(-1);
|
|
|
+ informClassify.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ baseMapper.update(informClassify, lqw);
|
|
|
+ getDepts(informClassify.getClassifyId());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @descript:递归
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Boolean getDepts(Long id){
|
|
|
+ LambdaQueryWrapper<InformClassify> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq(InformClassify::getParentId, id);
|
|
|
+ List<InformClassify> list = this.list(lqw);
|
|
|
+ if(CollectionUtils.isNotEmpty(list)){
|
|
|
+ for (InformClassify informClassify : list) {
|
|
|
+ lqw.clear();
|
|
|
+ lqw.eq(InformClassify::getClassifyId, informClassify.getClassifyId());
|
|
|
+ informClassify.setStatus(-1);
|
|
|
+ informClassify.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ getDepts(informClassify.getClassifyId());
|
|
|
+ baseMapper.update(informClassify, lqw);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存前的数据校验
|
|
|
*
|