package com.sys.bus.email;

import com.alibaba.fastjson.JSONObject;
import com.jfinal.aop.Enhancer;
import com.jfinal.core.ActionKey;
import com.jfinal.core.Controller;
import com.sys.bus.jx.service.MailService;

public class EmailController extends Controller {
	static MailService mailService = Enhancer.enhance(MailService.class);

	@ActionKey("/jx/sendMail")
	public void sendJxEmail(){
		//
//	type 10个人指标编辑提醒 11个人指标编辑催办 20领导确认指标提醒 21领导确认指标催办 30个人自评提醒 31个人自评催办 40评分提醒 41评分催办
//				*      --50 部门评级提醒  51 部门评级催办  60 中心评级提醒  61 中心评级催办  70 绩效主管评级提醒 80 hr领导评级提醒
//	idType  1 entry  2kpi  3ratingDept  4entryNo
		String type = this.getPara("type");
		String id = this.getPara("id");
		String idType = this.getPara("idType");
		mailService.sendJxEmail(id,idType,type);
		JSONObject jsonObject = new JSONObject();
		jsonObject.put("code", "success");
		this.renderJson(jsonObject);
	}
}
