|
|
@@ -0,0 +1,266 @@
|
|
|
+package com.lc.ibps.components.employee.domain;
|
|
|
+
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+import com.lc.ibps.components.employee.persistence.entity.*;
|
|
|
+import com.lc.ibps.components.employee.repository.*;
|
|
|
+import org.springframework.context.annotation.Scope;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import com.lc.ibps.base.core.util.BeanUtils;
|
|
|
+import com.lc.ibps.base.core.util.string.StringUtil;
|
|
|
+import com.lc.ibps.base.core.util.AppUtil;
|
|
|
+import com.lc.ibps.base.framework.domain.AbstractDomain;
|
|
|
+import com.lc.ibps.base.framework.persistence.dao.IDao;
|
|
|
+import com.lc.ibps.base.framework.persistence.dao.IQueryDao;
|
|
|
+import com.lc.ibps.components.employee.persistence.dao.EmployeeInfoDao;
|
|
|
+import com.lc.ibps.components.employee.persistence.dao.EmployeeInfoQueryDao;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 人员信息表 领域对象实体
|
|
|
+ *
|
|
|
+ *<pre>
|
|
|
+ * 开发公司:深圳市金源信通科技有限公司
|
|
|
+ * 开发人员:codegen
|
|
|
+ * 创建时间:2024-11-21 10:18:31
|
|
|
+ *</pre>
|
|
|
+ */
|
|
|
+@SuppressWarnings("serial")
|
|
|
+@Service
|
|
|
+@Transactional
|
|
|
+@Scope("prototype")
|
|
|
+public class EmployeeInfo extends AbstractDomain<String, EmployeeInfoPo>{
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private EmployeeInfoDao employeeInfoDao;
|
|
|
+ @Resource
|
|
|
+ private EmployeeInfoQueryDao employeeInfoQueryDao;
|
|
|
+ @Resource
|
|
|
+ private EmployeeInfoRepository employeeInfoRepository;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private RyjbqkInfoRepository ryjbqkInfoRepository;
|
|
|
+ @Resource
|
|
|
+ private EducationInfoRepository educationInfoRepository;
|
|
|
+ @Resource
|
|
|
+ private WorkInfoRepository workInfoRepository;
|
|
|
+ @Resource
|
|
|
+ private CertificateInfoRepository certificateInfoRepository;
|
|
|
+ @Resource
|
|
|
+ private ScientificProjectRepository scientificProjectRepository;
|
|
|
+ @Resource
|
|
|
+ private TechnologyAwardRepository technologyAwardRepository;
|
|
|
+ @Resource
|
|
|
+ private SciArticleRepository sciArticleRepository;
|
|
|
+ @Resource
|
|
|
+ private ChinesePapersRepository chinesePapersRepository;
|
|
|
+ @Resource
|
|
|
+ private ResearchMonographRepository researchMonographRepository;
|
|
|
+ @Resource
|
|
|
+ private ResearchPatentRepository researchPatentRepository;
|
|
|
+ @Resource
|
|
|
+ private AcademicActivitiesRepository academicActivitiesRepository;
|
|
|
+
|
|
|
+ protected void init(){
|
|
|
+ //
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected IQueryDao<String, EmployeeInfoPo> getInternalQueryDao() {
|
|
|
+ return employeeInfoQueryDao;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected IDao<String, EmployeeInfoPo> getInternalDao() {
|
|
|
+ return employeeInfoDao;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getInternalCacheName() {
|
|
|
+ return "employeeInfo";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 主从表一并保存
|
|
|
+ * void
|
|
|
+ * @exception
|
|
|
+ * @since 1.0.0
|
|
|
+ */
|
|
|
+ public void saveCascade(){
|
|
|
+ save();
|
|
|
+ if(getData().isDelBeforeSave()){
|
|
|
+ RyjbqkInfo ryjbqkInfo = ryjbqkInfoRepository.newInstance();
|
|
|
+ ryjbqkInfo.deleteByMainId(getData().getId());
|
|
|
+ EducationInfo educationInfo = educationInfoRepository.newInstance();
|
|
|
+ educationInfo.deleteByMainId(getData().getId());
|
|
|
+ WorkInfo workInfo = workInfoRepository.newInstance();
|
|
|
+ workInfo.deleteByMainId(getData().getId());
|
|
|
+ CertificateInfo certificateInfo = certificateInfoRepository.newInstance();
|
|
|
+ certificateInfo.deleteByMainId(getData().getId());
|
|
|
+// ScientificProject scientificProject = scientificProjectRepository.newInstance();
|
|
|
+// scientificProject.deleteByMainId(getData().getId());
|
|
|
+// TechnologyAward technologyAward = technologyAwardRepository.newInstance();
|
|
|
+// technologyAward.deleteByMainId(getData().getId());
|
|
|
+// SciArticle sciArticle = sciArticleRepository.newInstance();
|
|
|
+// sciArticle.deleteByMainId(getData().getId());
|
|
|
+// ChinesePapers chinesePapers = chinesePapersRepository.newInstance();
|
|
|
+// chinesePapers.deleteByMainId(getData().getId());
|
|
|
+// ResearchMonograph researchMonograph = researchMonographRepository.newInstance();
|
|
|
+// researchMonograph.deleteByMainId(getData().getId());
|
|
|
+// ResearchPatent researchPatent = researchPatentRepository.newInstance();
|
|
|
+// researchPatent.deleteByMainId(getData().getId());
|
|
|
+// AcademicActivities academicActivities = academicActivitiesRepository.newInstance();
|
|
|
+// academicActivities.deleteByMainId(getData().getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ RyjbqkInfo ryjbqkInfo = ryjbqkInfoRepository.newInstance();
|
|
|
+ if(BeanUtils.isNotEmpty(getData().getRyjbqkInfoPoList())){
|
|
|
+ for(RyjbqkInfoPo ryjbqkInfoPo:getData().getRyjbqkInfoPoList()){
|
|
|
+ //设置外键
|
|
|
+ ryjbqkInfoPo.setParentId(getData().getId());
|
|
|
+ ryjbqkInfo.save(ryjbqkInfoPo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ EducationInfo educationInfo = educationInfoRepository.newInstance();
|
|
|
+ if(BeanUtils.isNotEmpty(getData().getEducationInfoPoList())){
|
|
|
+ for(EducationInfoPo educationInfoPo:getData().getEducationInfoPoList()){
|
|
|
+ //设置外键
|
|
|
+ educationInfoPo.setParentId(getData().getId());
|
|
|
+ educationInfo.save(educationInfoPo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ WorkInfo workInfo = workInfoRepository.newInstance();
|
|
|
+ if(BeanUtils.isNotEmpty(getData().getWorkInfoPoList())){
|
|
|
+ for(WorkInfoPo workInfoPo:getData().getWorkInfoPoList()){
|
|
|
+ //设置外键
|
|
|
+ workInfoPo.setParentId(getData().getId());
|
|
|
+ workInfo.save(workInfoPo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ CertificateInfo certificateInfo = certificateInfoRepository.newInstance();
|
|
|
+ if(BeanUtils.isNotEmpty(getData().getCertificateInfoPoList())){
|
|
|
+ for(CertificateInfoPo certificateInfoPo:getData().getCertificateInfoPoList()){
|
|
|
+ //设置外键
|
|
|
+ certificateInfoPo.setParentId(getData().getId());
|
|
|
+ certificateInfo.save(certificateInfoPo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+// ScientificProject scientificProject = scientificProjectRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(getData().getScientificProjectPoList())){
|
|
|
+// for(ScientificProjectPo scientificProjectPo:getData().getScientificProjectPoList()){
|
|
|
+// //设置外键
|
|
|
+// scientificProjectPo.setParentId(getData().getId());
|
|
|
+// scientificProject.save(scientificProjectPo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// TechnologyAward technologyAward = technologyAwardRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(getData().getTechnologyAwardPoList())){
|
|
|
+// for(TechnologyAwardPo technologyAwardPo:getData().getTechnologyAwardPoList()){
|
|
|
+// //设置外键
|
|
|
+// technologyAwardPo.setParentId(getData().getId());
|
|
|
+// technologyAward.save(technologyAwardPo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// SciArticle sciArticle = sciArticleRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(getData().getSciArticlePoList())){
|
|
|
+// for(SciArticlePo sciArticlePo:getData().getSciArticlePoList()){
|
|
|
+// //设置外键
|
|
|
+// sciArticlePo.setParentId(getData().getId());
|
|
|
+// sciArticle.save(sciArticlePo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// ChinesePapers chinesePapers = chinesePapersRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(getData().getChinesePapersPoList())){
|
|
|
+// for(ChinesePapersPo chinesePapersPo:getData().getChinesePapersPoList()){
|
|
|
+// //设置外键
|
|
|
+// chinesePapersPo.setParentId(getData().getId());
|
|
|
+// chinesePapers.save(chinesePapersPo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// ResearchMonograph researchMonograph = researchMonographRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(getData().getResearchMonographPoList())){
|
|
|
+// for(ResearchMonographPo researchMonographPo:getData().getResearchMonographPoList()){
|
|
|
+// //设置外键
|
|
|
+// researchMonographPo.setParentId(getData().getId());
|
|
|
+// researchMonograph.save(researchMonographPo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// ResearchPatent researchPatent = researchPatentRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(getData().getResearchPatentPoList())){
|
|
|
+// for(ResearchPatentPo researchPatentPo:getData().getResearchPatentPoList()){
|
|
|
+// //设置外键
|
|
|
+// researchPatentPo.setParentId(getData().getId());
|
|
|
+// researchPatent.save(researchPatentPo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// AcademicActivities academicActivities = academicActivitiesRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(getData().getAcademicActivitiesPoList())){
|
|
|
+// for(AcademicActivitiesPo academicActivitiesPo:getData().getAcademicActivitiesPoList()){
|
|
|
+// //设置外键
|
|
|
+// academicActivitiesPo.setParentId(getData().getId());
|
|
|
+// academicActivities.save(academicActivitiesPo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 主从表一并删除
|
|
|
+ * void
|
|
|
+ * @exception
|
|
|
+ * @since 1.0.0
|
|
|
+ */
|
|
|
+ public void deleteByIdsCascade(String[] ids){
|
|
|
+ for(String id : ids){
|
|
|
+ EmployeeInfoPo po = employeeInfoRepository.get(id);
|
|
|
+ RyjbqkInfo ryjbqkInfo = ryjbqkInfoRepository.newInstance();
|
|
|
+ if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+ ryjbqkInfo.deleteByMainId(po.getId());
|
|
|
+ }
|
|
|
+ EducationInfo educationInfo = educationInfoRepository.newInstance();
|
|
|
+ if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+ educationInfo.deleteByMainId(po.getId());
|
|
|
+ }
|
|
|
+ WorkInfo workInfo = workInfoRepository.newInstance();
|
|
|
+ if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+ workInfo.deleteByMainId(po.getId());
|
|
|
+ }
|
|
|
+ CertificateInfo certificateInfo = certificateInfoRepository.newInstance();
|
|
|
+ if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+ certificateInfo.deleteByMainId(po.getId());
|
|
|
+ }
|
|
|
+// ScientificProject scientificProject = scientificProjectRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+// scientificProject.deleteByMainId(po.getId());
|
|
|
+// }
|
|
|
+// TechnologyAward technologyAward = technologyAwardRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+// technologyAward.deleteByMainId(po.getId());
|
|
|
+// }
|
|
|
+// SciArticle sciArticle = sciArticleRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+// sciArticle.deleteByMainId(po.getId());
|
|
|
+// }
|
|
|
+// ChinesePapers chinesePapers = chinesePapersRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+// chinesePapers.deleteByMainId(po.getId());
|
|
|
+// }
|
|
|
+// ResearchMonograph researchMonograph = researchMonographRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+// researchMonograph.deleteByMainId(po.getId());
|
|
|
+// }
|
|
|
+// ResearchPatent researchPatent = researchPatentRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+// researchPatent.deleteByMainId(po.getId());
|
|
|
+// }
|
|
|
+// AcademicActivities academicActivities = academicActivitiesRepository.newInstance();
|
|
|
+// if(BeanUtils.isNotEmpty(po) && BeanUtils.isNotEmpty(po.getId())){
|
|
|
+// academicActivities.deleteByMainId(po.getId());
|
|
|
+// }
|
|
|
+ }
|
|
|
+ deleteByIds(ids);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|