|
|
@ -1,19 +1,25 @@ |
|
|
|
package com.hnac.hzims.operational.duty.service.impl; |
|
|
|
package com.hnac.hzims.operational.duty.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
|
|
import com.hnac.hzims.common.pojo.Tree; |
|
|
|
import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity; |
|
|
|
import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity; |
|
|
|
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; |
|
|
|
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; |
|
|
|
import com.hnac.hzims.operational.duty.mapper.ImsDutyClassMapper; |
|
|
|
import com.hnac.hzims.operational.duty.mapper.ImsDutyClassMapper; |
|
|
|
import com.hnac.hzims.operational.duty.mapper.ImsDutyMainMapper; |
|
|
|
import com.hnac.hzims.operational.duty.mapper.ImsDutyMainMapper; |
|
|
|
import com.hnac.hzims.operational.duty.service.IImsDutyClassService; |
|
|
|
import com.hnac.hzims.operational.duty.service.IImsDutyClassService; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.duty.vo.DutyClassTypeTree; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Optional; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -25,7 +31,9 @@ import java.util.stream.Collectors; |
|
|
|
public class ImsDutyClassServiceImpl extends BaseServiceImpl<ImsDutyClassMapper, ImsDutyClassEntity> implements IImsDutyClassService { |
|
|
|
public class ImsDutyClassServiceImpl extends BaseServiceImpl<ImsDutyClassMapper, ImsDutyClassEntity> implements IImsDutyClassService { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private ImsDutyMainMapper imsDutyMainMapper; |
|
|
|
private ImsDutyMainMapper imsDutyMainMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ISysClient sysClient; |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R saveOrUpdateImsDutyClass(ImsDutyClassEntity imsDutyClass) { |
|
|
|
public R saveOrUpdateImsDutyClass(ImsDutyClassEntity imsDutyClass) { |
|
|
|
if (null == imsDutyClass.getClassTypeId()) { |
|
|
|
if (null == imsDutyClass.getClassTypeId()) { |
|
|
@ -104,4 +112,13 @@ public class ImsDutyClassServiceImpl extends BaseServiceImpl<ImsDutyClassMapper, |
|
|
|
return R.status(bool); |
|
|
|
return R.status(bool); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<DutyClassTypeTree> getDutyClassTree(Long deptId) { |
|
|
|
|
|
|
|
List<DutyClassTypeTree> dutyClassTrees = this.baseMapper.getDutyClassTree(deptId); |
|
|
|
|
|
|
|
List<DutyClassTypeTree> result = dutyClassTrees.stream().peek(node -> node.setName(Optional.ofNullable(sysClient.getDeptName(node.getId())).map(R::getData).orElse(null))) |
|
|
|
|
|
|
|
.filter(t -> Func.isNotEmpty(t.getName())) |
|
|
|
|
|
|
|
.sorted(Comparator.comparing(DutyClassTypeTree::getName)).collect(Collectors.toList()); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|