java word 导出(FreeMarker,HTML模板,包含图片)

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(
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值