package com.empl.mgr.service.impl;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import com.empl.mgr.constant.AddressType;
import com.empl.mgr.constant.EmployeesLogType;
import com.empl.mgr.constant.EmployeesState;
import com.empl.mgr.constant.PageConstant;
import com.empl.mgr.constant.PhoneImageSize;
import com.empl.mgr.constant.TimeFormatConstant;
import com.empl.mgr.constant.TrainLogState;
import com.empl.mgr.constant.TrainingState;
import com.empl.mgr.dao.AddressDao;
import com.empl.mgr.dao.ChooseEducationDao;
import com.empl.mgr.dao.ChooseMarriageDao;
import com.empl.mgr.dao.ChooseNationalDao;
import com.empl.mgr.dao.ChoosePoliticsDao;
import com.empl.mgr.dao.CityDao;
import com.empl.mgr.dao.CountyDao;
import com.empl.mgr.dao.DepartmentDao;
import com.empl.mgr.dao.EmployeesBasicDao;
import com.empl.mgr.dao.EmployeesCompanyDao;
import com.empl.mgr.dao.EmployeesDetailDao;
import com.empl.mgr.dao.EmployeesLogDao;
import com.empl.mgr.dao.EmployeesTrainingLogDao;
import com.empl.mgr.dao.PositionDao;
import com.empl.mgr.dao.ProvinceDao;
import com.empl.mgr.dao.TownshipDao;
import com.empl.mgr.dao.TrainingDao;
import com.empl.mgr.dao.VillageDao;
import com.empl.mgr.dto.EemplByNoneTrainingLogDto;
import com.empl.mgr.dto.EmployeesAddressDto;
import com.empl.mgr.dto.EmployeesBasicInfoDto;
import com.empl.mgr.dto.EmployeesCompnayDto;
import com.empl.mgr.dto.EmployeesInfoDto;
import com.empl.mgr.dto.EmployeesInternshipListDto;
import com.empl.mgr.dto.EmployeesLogDto;
import com.empl.mgr.dto.EmployeesTrainingRecordDto;
import com.empl.mgr.field.TeAddressField;
import com.empl.mgr.field.TeDepartmentField;
import com.empl.mgr.field.TeEmployeesBasicField;
import com.empl.mgr.field.TeEmployeesCompanyField;
import com.empl.mgr.field.TeEmployeesDetailField;
import com.empl.mgr.field.TeEmployeesLogField;
import com.empl.mgr.field.TeEmployeesTrainingLogField;
import com.empl.mgr.field.TePositionField;
import com.empl.mgr.model.TeAddress;
import com.empl.mgr.model.TeDepartment;
import com.empl.mgr.model.TeEmployeesBasic;
import com.empl.mgr.model.TeEmployeesCompany;
import com.empl.mgr.model.TeEmployeesDetail;
import com.empl.mgr.model.TeEmployeesLog;
import com.empl.mgr.model.TeEmployeesTrainingLog;
import com.empl.mgr.model.TePosition;
import com.empl.mgr.model.TeTraining;
import com.empl.mgr.service.EmployeesLogService;
import com.empl.mgr.service.EmployeesService;
import com.empl.mgr.support.JSONReturn;
import com.empl.mgr.utils.CompareUtil;
import com.empl.mgr.utils.DateTimeUtil;
import com.empl.mgr.utils.PageUtils;
@Scope
@Service
@Transactional(readOnly = true)
public class EmployeesServiceImpl implements EmployeesService {
@Autowired
private ChooseEducationDao chooseEducationDao;
@Autowired
private ChooseMarriageDao chooseMarriageDao;
@Autowired
private ChooseNationalDao chooseNationalDao;
@Autowired
private ChoosePoliticsDao choosePoliticsDao;
@Autowired
private PositionDao positionDao;
@Autowired
private DepartmentDao departmentDao;
@Autowired
private EmployeesBasicDao employeesBasicDao;
@Autowired
private EmployeesCompanyDao employeesCompanyDao;
@Autowired
private EmployeesDetailDao employeesDetailDao;
@Autowired
private AddressDao addressDao;
@Autowired
private ProvinceDao provinceDao;
@Autowired
private CityDao cityDao;
@Autowired
private CountyDao countyDao;
@Autowired
private TownshipDao townshipDao;
@Autowired
private VillageDao villageDao;
@Autowired
private EmployeesTrainingLogDao employeesTrainingLogDao;
@Autowired
private TrainingDao trainingDao;
@Autowired
private EmployeesLogService employeesLogService;
@Autowired
private EmployeesLogDao employeesLogDao;
public JSONReturn findChoose() {
// TODO Auto-generated method stub
Map<String, Object> map = new HashMap<String, Object>();
map.put("educationList", chooseEducationDao.findAll());
map.put("marriageList", chooseMarriageDao.findAll());
map.put("nationalList", chooseNationalDao.findAll());
map.put("politicList", choosePoliticsDao.findAll());
return JSONReturn.buildSuccess(map);
}
@Transactional
public JSONReturn saveEmployeesInfo(EmployeesInfoDto dto, String acctName) {
// TODO Auto-generated method stub
if (CompareUtil.isEmpty(dto))
return JSONReturn.buildFailure("员工信息保存失败!");
if (CollectionUtils.isNotEmpty(employeesBasicDao.findByProperty(TeEmployeesBasicField.EM_IDENTITY,
dto.getIdentity())))
return JSONReturn.buildFailure("保存员工信息失败, 身份证重复!");
TeEmployeesBasic basic = conversionEmployeesBasic(null, dto, acctName);
employeesBasicDao.save(basic); // 保存员工基本信息
basic.setEmState(EmployeesState.EMPL_INTERNSHIP); // 默认为实习员工
employeesDetailDao.save(conversionEmployeesDetail(null, dto, basic.getEmId())); // 保存员工详细信息
conversionEmployeesCompany(dto.getCompany(), basic.getEmId()); // 保存员工工作经历信息
basic.setEmCensusRegister(analyzeAddress(dto.getRegister(), basic.getEmId(), AddressType.REGISTER, null, true)); // 解析户籍地址
basic.setEmCurrentAddress(analyzeAddress(dto.getCurrent(), basic.getEmId(), AddressType.CURRENT, null, true)); // 解析现居住地址
employeesLogService.save(basic.getEmId(), acctName, EmployeesLogType.RECORDING_INFORMATION, "");
return JSONReturn.buildSuccess(basic.getEmId());
}
/*
* 解析并转换员工地址信息
* te5l.com [K]
*/
private long analyzeAddress(EmployeesAddressDto dto, long emId, int type, TeAddress ads, boolean isSave) {
// TODO Auto-generated method stub
if (CompareUtil.isEmpty(ads))
ads = new TeAddress();
ads.setAdsType(type);
ads.setAdsProvince(dto.getProvince());
ads.setAdsCity(dto.getCity());
ads.setAdsCounty(dto.getCounty());
ads.setAdsTownship(dto.getTownship());
ads.setAdsVillage(dto.getVillage());
ads.setAdsDetailed(dto.getDetailed());
if (isSave)
addressDao.save(ads);
return ads.getAdsId();
}
/*
* 解析并转换员工工作经历信息
* te5l.com [K]
*/
private boolean conversionEmployeesCompany(EmployeesCompnayDto[] companyArray, long emId) {
// TODO Auto-generated method stub
if (ArrayUtils.isEmpty(companyArray))
return false;
for (EmployeesCompnayDto dto : companyArray) {
TeEmployeesCompany company = new TeEmployeesCompany();
company.setEmplNo(emId);
company.setComName(dto.getName());
company.setComParticipateTime(dto.getState());
company.setComLeaveTime(dto.getEnd());
company.setComPosition(dto.getJobs());
company.setComReason(dto.getReason());
employeesCompanyDao.save(company);
}
return true;
}
/*
* 解析并转换员工详细信息
* te5l.com [K]
*/
private TeEmployeesDetail conversionEmployeesDetail(TeEmployeesDetail detail, EmployeesInfoDto dto, long emId) {
// TODO Auto-generated method stub
if (CompareUtil.isEmpty(detail))
detail = new TeEmployeesDetail();
detail.setEmplNo(emId);
detail.setEmContact(dto.getContact());
detail.setEmEmergencyContact(dto.getEmergencyContact());
detail.setEmEmergencyPhone(dto.getEmergencyPhone());
detail.setEmSchool(dto.getSchool());
detail.setEmProfessional(dto.getProfessional());
detail.setEmGraduationT
没有合适的资源?快使用搜索试试~ 我知道了~
Spring+Spring mvc+Hibernate+Bootstrap、企业级员工信息管理系统
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共473个文件
class:152个
java:152个
jar:73个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
![star](https://csdnimg.cn/release/downloadcmsfe/public/img/star.98a08eaa.png)
温馨提示
01. 采用后台及前台的 Spring + Spring mvc + Hibernate + Bootstrap 02. 后台全注解式的开发(除了必要的spring和hibernate的xml配置以外) 03. 后台通过自定义注解结合一个访问拦截器实现整个系统的权限控制 04. 系统前台采用全采用的Html+jQuery开发 05. 系统前台与后台的交互全部使用 Ajax 异步请求 06. 自定义 SecureValid 注解实现权限的控制 07. 通过自定义 ExcludeLog 注解来实现对日志的记录进行排除 08. Spring mvc 返回数据格式采用统一的对象(JSONReturn)进行封装 09. 通过自定义处理器 ExceptionIntercept 实现 Spring mvc的全局异常捕获 10. 系统中包含了企业中采用的开发工具类的集合 11. AbstractDao 父类实现了Dao中针对单个对象的常用操作
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![cpp](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 473 条
- 1
- 2
- 3
- 4
- 5
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
- zhijie882017-10-28可以正常下载, 需要myeclipse 才能运行。
- xyb12052018-04-27还可以,有一定的参考价值
- Coox2020-06-19感谢分享,学习可以看一看代码
- song1212017-08-22感谢分享,谢谢
![avatar](https://profile-avatar.csdnimg.cn/6057dbd36a2b4623b66c15114665cf12_wangxianzhenkevin.jpg!1)
wangxianzhenkevin
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)