public void exportTEmployeeInfo() {
this.temployee = this.personnelService.getTEmployee(eid);
try {
HashMap<String, Object> dataMap = new HashMap<String, Object>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if (temployee.getEname() != null) {
dataMap.put("ename", temployee.getEname());
} else {
dataMap.put("ename", "");
}
if (temployee.getEenName() != null) {
dataMap.put("eenname", temployee.getEenName());
} else {
dataMap.put("eenname", "");
}
if (temployee.getEuseName() != null) {
dataMap.put("eusename", temployee.getEuseName());
} else {
dataMap.put("eusename", "");
}
if (temployee.getEcode() != null) {
dataMap.put("ecode", temployee.getEcode());
} else {
dataMap.put("ecode", "");
}
if(temployee.getEbirthday()!=null && !"".equals(temployee.getEbirthday())){
dataMap.put("ebirthday", sdf.format(temployee.getEbirthday()));
} else {
dataMap.put("ebirthday", "");
}
if (temployee.getEnation()!=null) {
nationList = this.personnelService.querySysCodeList("民族");
for (int i = 0; i < nationList.size(); i++) {
if (nationList.get(i).get("id").toString().equals(temployee.getEnation().toString())) {
dataMap.put("enation", nationList.get(i).get("name"));
} else {
dataMap.put("enation", "");
}
}
} else {
dataMap.put("enation", "");
}
if (temployee.getEnative() != null) {
dataMap.put("enative", temployee.getEnative());
} else {
dataMap.put("enative", "");
}
if (temployee.getEcertificateType()!=null) {
certificateTypeList = this.personnelService.querySysCodeList("证件类型");
for (int i = 0; i < certificateTypeList.size(); i++) {
if (certificateTypeList.get(i).get("id").toString().equals(temployee.getEcertificateType().toString())) {
dataMap.put("ecertificatetype", certificateTypeList.get(i).get("name"));
} else {
dataMap.put("ecertificatetype", "");
}
}
} else {
dataMap.put("ecertificatetype", "");
}
if (temployee.getEcertificateId() != null) {
dataMap.put("ecertificateid", temployee.getEcertificateId());
} else {
dataMap.put("ecertificateid", "");
}
if (temployee.getEsex()!=null) {
sexList = this.personnelService.querySysCodeList("性别");
for (int i = 0; i < sexList.size(); i++) {
if (sexList.get(i).get("id").toString().equals(temployee.getEsex().toString())) {
dataMap.put("esex", sexList.get(i).get("name"));
} else {
dataMap.put("esex", "");
}
}
} else {
dataMap.put(
java word 导出(FreeMarker,HTML模板,包含图片)
最新推荐文章于 2022-08-15 17:09:11 发布