|
@@ -4,10 +4,16 @@ package com.citu.module.menduner.system.service.talent;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.citu.framework.common.pojo.PageResult;
|
|
|
import com.citu.framework.common.util.object.BeanUtils;
|
|
|
+import com.citu.module.menduner.system.controller.base.talent.TalentMapDetailRespVO;
|
|
|
import com.citu.module.menduner.system.controller.base.talent.TalentMapSaveReqVO;
|
|
|
+import com.citu.module.menduner.system.controller.base.talent.edu.TalentMapEduExpRespVO;
|
|
|
import com.citu.module.menduner.system.controller.base.talent.edu.TalentMapEduExpSaveReqVO;
|
|
|
import com.citu.module.menduner.system.controller.base.talent.info.TalentMapInfoPageReqVO;
|
|
|
+import com.citu.module.menduner.system.controller.base.talent.info.TalentMapInfoRespVO;
|
|
|
import com.citu.module.menduner.system.controller.base.talent.info.TalentMapInfoSaveReqVO;
|
|
|
+import com.citu.module.menduner.system.controller.base.talent.train.TalentMapTrainExpRespVO;
|
|
|
+import com.citu.module.menduner.system.controller.base.talent.train.TalentMapTrainExpSaveReqVO;
|
|
|
+import com.citu.module.menduner.system.controller.base.talent.work.TalentMapWorkExpRespVO;
|
|
|
import com.citu.module.menduner.system.controller.base.talent.work.TalentMapWorkExpSaveReqVO;
|
|
|
import com.citu.module.menduner.system.dal.dataobject.talent.TalentMapEduExpDO;
|
|
|
import com.citu.module.menduner.system.dal.dataobject.talent.TalentMapInfoDO;
|
|
@@ -17,10 +23,13 @@ import com.citu.module.menduner.system.dal.mysql.talent.TalentMapEduExpMapper;
|
|
|
import com.citu.module.menduner.system.dal.mysql.talent.TalentMapInfoMapper;
|
|
|
import com.citu.module.menduner.system.dal.mysql.talent.TalentMapTrainExpMapper;
|
|
|
import com.citu.module.menduner.system.dal.mysql.talent.TalentMapWorkExpMapper;
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
import static com.citu.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static com.citu.module.menduner.system.enums.ErrorCodeConstants.TALENT_MAP_INFO_NOT_EXISTS;
|
|
@@ -38,13 +47,13 @@ public class TalentMapInfoServiceImpl implements TalentMapInfoService {
|
|
|
private TalentMapInfoMapper talentMapInfoMapper;
|
|
|
|
|
|
@Resource
|
|
|
- private TalentMapEduExpMapper talentMapEduExpMapper;
|
|
|
+ private TalentMapEduExpService talentMapEduExpService;
|
|
|
|
|
|
@Resource
|
|
|
- private TalentMapWorkExpMapper talentMapWorkExpMapper;
|
|
|
+ private TalentMapWorkExpService talentMapWorkExpService;
|
|
|
|
|
|
@Resource
|
|
|
- private TalentMapTrainExpMapper talentMapTrainExpMapper;
|
|
|
+ private TalentMapTrainExpService talentMapTrainExpService;
|
|
|
|
|
|
@Override
|
|
|
public Long createTalentMapInfo(TalentMapInfoSaveReqVO createReqVO) {
|
|
@@ -88,50 +97,70 @@ public class TalentMapInfoServiceImpl implements TalentMapInfoService {
|
|
|
return talentMapInfoMapper.selectPage(pageReqVO);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public PageResult<TalentMapDetailRespVO> page(TalentMapInfoPageReqVO pageReqVO) {
|
|
|
+ PageResult<TalentMapInfoDO> pageResult = talentMapInfoMapper.selectPage(pageReqVO);
|
|
|
+ PageResult<TalentMapDetailRespVO> result = new PageResult<>();
|
|
|
+ result.setTotal(pageResult.getTotal());
|
|
|
+ List<TalentMapDetailRespVO> list = new ArrayList<>();
|
|
|
+ for (TalentMapInfoDO info : pageResult.getList()) {
|
|
|
+ TalentMapDetailRespVO resp = new TalentMapDetailRespVO();
|
|
|
+ // 基本信息
|
|
|
+ resp.setPerson(BeanUtils.toBean(info, TalentMapInfoRespVO.class));
|
|
|
+ // 教育经历
|
|
|
+ List<TalentMapEduExpDO> eduList = talentMapEduExpService.selectListByPersonId(info.getId());
|
|
|
+ if (ObjectUtils.isNotEmpty(eduList)) {
|
|
|
+ resp.setEduList(BeanUtils.toBean(eduList, TalentMapEduExpRespVO.class));
|
|
|
+ }
|
|
|
+ // 工作经历
|
|
|
+ List<TalentMapWorkExpDO> workList = talentMapWorkExpService.selectListByPersonId(info.getId());
|
|
|
+ if (ObjectUtils.isNotEmpty(workList)) {
|
|
|
+ resp.setWorkList(BeanUtils.toBean(workList, TalentMapWorkExpRespVO.class));
|
|
|
+ }
|
|
|
+ // 培训经历
|
|
|
+ List<TalentMapTrainExpDO> trainList = talentMapTrainExpService.selectListByPersonId(info.getId());
|
|
|
+ if (ObjectUtils.isNotEmpty(trainList)) {
|
|
|
+ resp.setTrainList(BeanUtils.toBean(trainList, TalentMapTrainExpRespVO.class));
|
|
|
+ }
|
|
|
+ list.add(resp);
|
|
|
+ }
|
|
|
+ result.setList(list);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@DSTransactional
|
|
|
- public void save(TalentMapSaveReqVO reqVO) {
|
|
|
+ public void add(TalentMapSaveReqVO reqVO) {
|
|
|
TalentMapInfoDO talentMapInfo = BeanUtils.toBean(reqVO.getPerson(), TalentMapInfoDO.class);
|
|
|
- if(null == talentMapInfo.getId()) {
|
|
|
+ if (null == talentMapInfo.getId()) {
|
|
|
// 新增
|
|
|
talentMapInfoMapper.insert(talentMapInfo);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
talentMapInfoMapper.updateById(talentMapInfo);
|
|
|
}
|
|
|
|
|
|
- for (TalentMapEduExpSaveReqVO eduReqVO : reqVO.getEduList()) {
|
|
|
+ for (TalentMapEduExpSaveReqVO eduReqVO : reqVO.getEduList()) {
|
|
|
|
|
|
- TalentMapEduExpDO edu = BeanUtils.toBean(eduReqVO, TalentMapEduExpDO.class);
|
|
|
- edu.setPersonId(talentMapInfo.getId());
|
|
|
- if(null == edu.getId()) {
|
|
|
+ if (null == eduReqVO.getId()) {
|
|
|
+ eduReqVO.setPersonId(talentMapInfo.getId());
|
|
|
// 新增
|
|
|
- talentMapEduExpMapper.insert(edu);
|
|
|
- }else {
|
|
|
-
|
|
|
- talentMapEduExpMapper.updateById(edu);
|
|
|
+ talentMapEduExpService.createTalentMapEduExp(eduReqVO);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- for (TalentMapWorkExpSaveReqVO workReqVO : reqVO.getWorkList()) {
|
|
|
-
|
|
|
- TalentMapWorkExpDO work = BeanUtils.toBean(workReqVO, TalentMapWorkExpDO.class);
|
|
|
- work.setPersonId(talentMapInfo.getId());
|
|
|
- if(null == work.getId()) {
|
|
|
+ for (TalentMapWorkExpSaveReqVO workReqVO : reqVO.getWorkList()) {
|
|
|
+ if (null == workReqVO.getId()) {
|
|
|
+ workReqVO.setPersonId(talentMapInfo.getId());
|
|
|
// 新增
|
|
|
- talentMapWorkExpMapper.insert(work);
|
|
|
- }else {
|
|
|
- talentMapWorkExpMapper.updateById(work);
|
|
|
+ talentMapWorkExpService.createTalentMapWorkExp(workReqVO);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- for (TalentMapWorkExpSaveReqVO trainReqVO : reqVO.getTrainList()){
|
|
|
- TalentMapTrainExpDO train = BeanUtils.toBean(trainReqVO, TalentMapTrainExpDO.class);
|
|
|
- train.setPersonId(talentMapInfo.getId());
|
|
|
- if(null == train.getId()) {
|
|
|
+ for (TalentMapTrainExpSaveReqVO trainReqVO: reqVO.getTrainList()) {
|
|
|
+ if (null == trainReqVO.getId()) {
|
|
|
+ trainReqVO.setPersonId(talentMapInfo.getId());
|
|
|
// 新增
|
|
|
- talentMapTrainExpMapper.insert(train);
|
|
|
- }else {
|
|
|
- talentMapTrainExpMapper.updateById(train);
|
|
|
+ talentMapTrainExpService.createTalentMapTrainExp(trainReqVO);
|
|
|
}
|
|
|
}
|
|
|
|