|
|
@ -2,6 +2,7 @@ package com.hnac.hzims.basic.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.hnac.hzims.basic.entity.CertificatetEntity; |
|
|
|
import com.hnac.hzims.basic.entity.CertificatetEntity; |
|
|
@ -15,13 +16,16 @@ import com.hnac.hzims.basic.vo.PersonManagemetVo; |
|
|
|
import com.hnac.hzims.common.logs.utils.StringUtils; |
|
|
|
import com.hnac.hzims.common.logs.utils.StringUtils; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -49,12 +53,19 @@ public class PresonManagementServiceImpl extends BaseServiceImpl<PersonManagemet |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<PersonManagemetVo> getPersonManagemetEntity(PersonManagemetVo personManagemetVo, Query query) { |
|
|
|
public IPage<PersonManagemetVo> getPersonManagemetEntity(PersonManagemetVo personManagemetVo, Query query) { |
|
|
|
|
|
|
|
R<List<Dept>> deptByCurrentUserR = sysClient.getDeptByCurrentUser(); |
|
|
|
|
|
|
|
if (!deptByCurrentUserR.isSuccess()&& CollectionUtils.isEmpty(deptByCurrentUserR.getData())){ |
|
|
|
|
|
|
|
throw new ServiceException("用户登录失效,请重试!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<Long> depetIds = deptByCurrentUserR.getData().stream().map(Dept::getId).collect(Collectors.toList()); |
|
|
|
List<PersonManagemetVo> personManagemetEntity = baseMapper.getPersonManagemetEntity(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(), |
|
|
|
List<PersonManagemetVo> personManagemetEntity = baseMapper.getPersonManagemetEntity(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(), |
|
|
|
personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(), |
|
|
|
personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(), |
|
|
|
personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus(), (query.getCurrent()-1)*query.getSize(), query.getSize()); |
|
|
|
personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus(), depetIds, |
|
|
|
|
|
|
|
(query.getCurrent()-1)*query.getSize(), query.getSize()); |
|
|
|
Integer count = baseMapper.getCountByPersonManagemetEntity(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(), |
|
|
|
Integer count = baseMapper.getCountByPersonManagemetEntity(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(), |
|
|
|
personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(), |
|
|
|
personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(), |
|
|
|
personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus(), (query.getCurrent()-1)*query.getSize(), query.getSize()); |
|
|
|
personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus(), depetIds, |
|
|
|
|
|
|
|
(query.getCurrent()-1)*query.getSize(), query.getSize()); |
|
|
|
IPage<PersonManagemetVo> res = new Page<>(); |
|
|
|
IPage<PersonManagemetVo> res = new Page<>(); |
|
|
|
res.setCurrent(query.getCurrent()); |
|
|
|
res.setCurrent(query.getCurrent()); |
|
|
|
res.setSize(query.getSize()); |
|
|
|
res.setSize(query.getSize()); |
|
|
@ -135,9 +146,14 @@ public class PresonManagementServiceImpl extends BaseServiceImpl<PersonManagemet |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<PersonManagemetExportVo> exportPersonManagemet(PersonManagemetVo personManagemetVo) { |
|
|
|
public List<PersonManagemetExportVo> exportPersonManagemet(PersonManagemetVo personManagemetVo) { |
|
|
|
|
|
|
|
R<List<Dept>> deptByCurrentUserR = sysClient.getDeptByCurrentUser(); |
|
|
|
|
|
|
|
if (!deptByCurrentUserR.isSuccess()&& CollectionUtils.isEmpty(deptByCurrentUserR.getData())){ |
|
|
|
|
|
|
|
throw new ServiceException("用户登录失效,请重试!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<Long> depetIds = deptByCurrentUserR.getData().stream().map(Dept::getId).collect(Collectors.toList()); |
|
|
|
List<PersonManagemetExportVo> list = baseMapper.exportPersonManagemet(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(), |
|
|
|
List<PersonManagemetExportVo> list = baseMapper.exportPersonManagemet(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(), |
|
|
|
personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(), |
|
|
|
personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(), |
|
|
|
personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus()); |
|
|
|
personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus(),depetIds); |
|
|
|
list = list.stream().map(s -> { |
|
|
|
list = list.stream().map(s -> { |
|
|
|
CertificatetType[] types = CertificatetType.values(); |
|
|
|
CertificatetType[] types = CertificatetType.values(); |
|
|
|
for (int i = 0; i < types.length; i++) { |
|
|
|
for (int i = 0; i < types.length; i++) { |
|
|
|