package com.ukefu.webim.web.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "uk_systemconfig")
@org.hibernate.annotations.Proxy(lazy = false)
public class SystemConfig implements java.io.Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -8675632756915176657L;
	private String id ;
	private String name ;
	private String title ;	
	
	private String theme = "01";	//默认绿色
	
	private String loginlogo ;		//登录页 LOGO
	private String loginlogowidth ;//登录页 LOGO最大宽度
	private String loginlogoheight ;//登录页 LOGO最大高度
	private String consolelogo ;	//后台页面LOGO
	private String consolelogowidth ;	//后台页面LOGO最大宽度
	private String consolelogoheight ;	//后台页面LOGO最大高度
	private String favlogo ;		//系统Fav图片,icon格式,小图标
	
	private boolean savelog ;		//启用日志存储
	
	private String code ;
	private String orgi ;
	private String description;
	private String memo ;
	private String creater;
	private Date createtime;
	private Date updatetime;
	private String loglevel ;
	private boolean enablessl ;
	private String jksfile ;
	private String jkspassword ;
	private String mapkey ;
	private boolean workorders ;	//工单启用三栏布局
	private String iconstr;			//修改服务器url地址
	private String whitelistip;			//服务器IP白名单
	
	private boolean callout ;		//允许在电话号码上点击呼出
	private boolean auth ;			//启用权限控制
	
	private boolean callcenter ;	//启用呼叫中心模板配置
	private String cc_extention ;
	private String cc_quene ;
	private String cc_router ;
	private String cc_ivr ;
	private String cc_acl ;
	private String cc_siptrunk ;
	private String cc_callcenter ;
	
	
	private boolean enablemail ;	//启用电子邮件
	private String emailid ;		//电子邮件服务器
	private String emailworkordertp;//工单电子邮件默认模板
	private String mailcreatetp;	//工单创建的邮件模板
	private String mailupdatetp;	//工单状态更新的邮件模板
	private String mailprocesstp ;	//工单审批信息的邮件模板
	
	private boolean emailtocreater ;	//工单状态有更新的时候通知创建人
	private String emailtocreatertp ;	//发送给创建人的邮件模板
	
	private boolean emailshowrecipient; //是否显示收件人名称
	
	private boolean enablesms ;		//启用短信
	private String smsid ;			//短信网关ID
	private String smsworkordertp ;	//工单短信通知的模板
	
	private String smscreatetp;	//工单创建的邮件模板
	private String smsupdatetp;	//工单状态更新的邮件模板
	private String smsprocesstp ;	//工单审批信息的邮件模板
	
	private boolean smstocreater ;	//工单状态有更新的时候通知创建人
	private String smstocreatertp ;//工单状态有更新的时候通知创建人的短信模板
	
	
	private boolean enabletneant ;	//启用多租户管理模式
	public boolean isEmailshowrecipient() {
		return emailshowrecipient;
	}
	public void setEmailshowrecipient(boolean emailshowrecipient) {
		this.emailshowrecipient = emailshowrecipient;
	}

	private boolean tenantshare;	//多租户模式下共享组织机构
	private String namealias ;		//多租户模式的名称
	private boolean tenantconsole ;	//登录后进入租户选择模式
	
	private boolean enableregorgi ; //启用自主注册功能
	
	private boolean enablevoice;	//启用语音功能
	private boolean enabledis ;		//启用集群(分布式/HA)功能
	
	
	@Id
	@Column(length = 32)
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getTheme() {
		return theme;
	}
	public void setTheme(String theme) {
		this.theme = theme;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getOrgi() {
		return orgi;
	}
	public void setOrgi(String orgi) {
		this.orgi = orgi;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	public String getCreater() {
		return creater;
	}
	public void setCreater(String creater) {
		this.creater = creater;
	}
	public Date getCreatetime() {
		return createtime;
	}
	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	public Date getUpdatetime() {
		return updatetime;
	}
	public void setUpdatetime(Date updatetime) {
		this.updatetime = updatetime;
	}
	public String getLoglevel() {
		return loglevel;
	}
	public void setLoglevel(String loglevel) {
		this.loglevel = loglevel;
	}
	
	public boolean isEnablessl() {
		return enablessl;
	}
	public void setEnablessl(boolean enablessl) {
		this.enablessl = enablessl;
	}
	public String getJksfile() {
		return jksfile;
	}
	public void setJksfile(String jksfile) {
		this.jksfile = jksfile;
	}
	public String getJkspassword() {
		return jkspassword;
	}
	public void setJkspassword(String jkspassword) {
		this.jkspassword = jkspassword;
	}
	
	public String getMapkey() {
		return mapkey;
	}
	public void setMapkey(String mapkey) {
		this.mapkey = mapkey;
	}
	
	public boolean isWorkorders() {
		return workorders;
	}
	public void setWorkorders(boolean workorders) {
		this.workorders = workorders;
	}
	public boolean isCallcenter() {
		return callcenter;
	}
	public void setCallcenter(boolean callcenter) {
		this.callcenter = callcenter;
	}
	public String getCc_extention() {
		return cc_extention;
	}
	public void setCc_extention(String cc_extention) {
		this.cc_extention = cc_extention;
	}
	public String getCc_quene() {
		return cc_quene;
	}
	public void setCc_quene(String cc_quene) {
		this.cc_quene = cc_quene;
	}
	public String getCc_router() {
		return cc_router;
	}
	public void setCc_router(String cc_router) {
		this.cc_router = cc_router;
	}
	public String getCc_ivr() {
		return cc_ivr;
	}
	public void setCc_ivr(String cc_ivr) {
		this.cc_ivr = cc_ivr;
	}
	public String getCc_acl() {
		return cc_acl;
	}
	public void setCc_acl(String cc_acl) {
		this.cc_acl = cc_acl;
	}
	public String getCc_siptrunk() {
		return cc_siptrunk;
	}
	public void setCc_siptrunk(String cc_siptrunk) {
		this.cc_siptrunk = cc_siptrunk;
	}
	public String getCc_callcenter() {
		return cc_callcenter;
	}
	public void setCc_callcenter(String cc_callcenter) {
		this.cc_callcenter = cc_callcenter;
	}
	
	public boolean isCallout() {
		return callout;
	}
	public void setCallout(boolean callout) {
		this.callout = callout;
	}
	public boolean isAuth() {
		return auth;
	}
	public void setAuth(boolean auth) {
		this.auth = auth;
	}
	
	public boolean isEnablemail() {
		return enablemail;
	}
	public void setEnablemail(boolean enablemail) {
		this.enablemail = enablemail;
	}
	public String getEmailid() {
		return emailid;
	}
	public void setEmailid(String emailid) {
		this.emailid = emailid;
	}
	public String getEmailworkordertp() {
		return emailworkordertp;
	}
	public void setEmailworkordertp(String emailworkordertp) {
		this.emailworkordertp = emailworkordertp;
	}
	public boolean isEnablesms() {
		return enablesms;
	}
	public void setEnablesms(boolean enablesms) {
		this.enablesms = enablesms;
	}
	public String getSmsid() {
		return smsid;
	}
	public void setSmsid(String smsid) {
		this.smsid = smsid;
	}
	public String getSmsworkordertp() {
		return smsworkordertp;
	}
	public void setSmsworkordertp(String smsworkordertp) {
		this.smsworkordertp = smsworkordertp;
	}
	
	public String getMailcreatetp() {
		return mailcreatetp;
	}
	public void setMailcreatetp(String mailcreatetp) {
		this.mailcreatetp = mailcreatetp;
	}
	public String getMailupdatetp() {
		return mailupdatetp;
	}
	public void setMailupdatetp(String mailupdatetp) {
		this.mailupdatetp = mailupdatetp;
	}
	public String getMailprocesstp() {
		return mailprocesstp;
	}
	public void setMailprocesstp(String mailprocesstp) {
		this.mailprocesstp = mailprocesstp;
	}
	public boolean isEmailtocreater() {
		return emailtocreater;
	}
	public void setEmailtocreater(boolean emailtocreater) {
		this.emailtocreater = emailtocreater;
	}
	public String getSmscreatetp() {
		return smscreatetp;
	}
	public void setSmscreatetp(String smscreatetp) {
		this.smscreatetp = smscreatetp;
	}
	public String getSmsupdatetp() {
		return smsupdatetp;
	}
	public void setSmsupdatetp(String smsupdatetp) {
		this.smsupdatetp = smsupdatetp;
	}
	public String getSmsprocesstp() {
		return smsprocesstp;
	}
	public void setSmsprocesstp(String smsprocesstp) {
		this.smsprocesstp = smsprocesstp;
	}
	public boolean isSmstocreater() {
		return smstocreater;
	}
	public void setSmstocreater(boolean smstocreater) {
		this.smstocreater = smstocreater;
	}
	public String getEmailtocreatertp() {
		return emailtocreatertp;
	}
	public void setEmailtocreatertp(String emailtocreatertp) {
		this.emailtocreatertp = emailtocreatertp;
	}
	public String getSmstocreatertp() {
		return smstocreatertp;
	}
	public void setSmstocreatertp(String smstocreatertp) {
		this.smstocreatertp = smstocreatertp;
	}
	public boolean isEnabletneant() {
		return enabletneant;
	}
	public void setEnabletneant(boolean enabletneant) {
		this.enabletneant = enabletneant;
	}
	public boolean isTenantshare() {
		return tenantshare;
	}
	public void setTenantshare(boolean tenantshare) {
		this.tenantshare = tenantshare;
	}
	
	public String getNamealias() {
		return namealias;
	}
	public void setNamealias(String namealias) {
		this.namealias = namealias;
	}
	public boolean isTenantconsole() {
		return tenantconsole;
	}
	public void setTenantconsole(boolean tenantconsole) {
		this.tenantconsole = tenantconsole;
	}
	public boolean isEnableregorgi() {
		return enableregorgi;
	}
	public void setEnableregorgi(boolean enableregorgi) {
		this.enableregorgi = enableregorgi;
	}
	public String getLoginlogo() {
		return loginlogo;
	}
	public void setLoginlogo(String loginlogo) {
		this.loginlogo = loginlogo;
	}
	public String getConsolelogo() {
		return consolelogo;
	}
	public void setConsolelogo(String consolelogo) {
		this.consolelogo = consolelogo;
	}
	public String getFavlogo() {
		return favlogo;
	}
	public void setFavlogo(String favlogo) {
		this.favlogo = favlogo;
	}
	
	public boolean isSavelog() {
		return savelog;
	}
	public void setSavelog(boolean savelog) {
		this.savelog = savelog;
	}
	
	public String getLoginlogowidth() {
		return loginlogowidth;
	}
	public void setLoginlogowidth(String loginlogowidth) {
		this.loginlogowidth = loginlogowidth;
	}
	public String getLoginlogoheight() {
		return loginlogoheight;
	}
	public void setLoginlogoheight(String loginlogoheight) {
		this.loginlogoheight = loginlogoheight;
	}
	public String getConsolelogowidth() {
		return consolelogowidth;
	}
	public void setConsolelogowidth(String consolelogowidth) {
		this.consolelogowidth = consolelogowidth;
	}
	public String getConsolelogoheight() {
		return consolelogoheight;
	}
	public void setConsolelogoheight(String consolelogoheight) {
		this.consolelogoheight = consolelogoheight;
	}
	public boolean isEnablevoice() {
		return enablevoice;
	}
	public void setEnablevoice(boolean enablevoice) {
		this.enablevoice = enablevoice;
	}
	public boolean isEnabledis() {
		return enabledis;
	}
	public void setEnabledis(boolean enabledis) {
		this.enabledis = enabledis;
	}
	public String getWhitelistip() {
		return whitelistip;
	}
	public void setWhitelistip(String whitelistip) {
		this.whitelistip = whitelistip;
	}
	@Transient
	public String getBackgroundColor(){
		String backgroundColor = "background-color:#32c24d !important;" ;
		if(!StringUtils.isBlank(this.theme) && this.theme.equals("01")){
			backgroundColor = "background-color:#32c24d !important;" ;
		}else if(!StringUtils.isBlank(this.theme) && this.theme.equals("02")){
			backgroundColor = "background-color:#373d41 !important;" ;
		}else if(!StringUtils.isBlank(this.theme) && this.theme.equals("03")){
			backgroundColor = "background-image: -webkit-linear-gradient(right,#00c89d 0,#1E90FF 100%) !important;" ;
		}
		return backgroundColor ;
	}
	@Transient
	public String getColor(){
		String color = "color:#32c24d;" ;
		if(!StringUtils.isBlank(this.theme) && this.theme.equals("01")){
			color = "color:#32c24d " ;
		}else if(!StringUtils.isBlank(this.theme) && this.theme.equals("02")){
			color = "color:#32c24d " ;
		}else if(!StringUtils.isBlank(this.theme) && this.theme.equals("03")){
			color = "color:#1E90FF " ;
		}
		return color ;
	}
	
	@Transient
	public String getBgColor(){
		String color = "background-color:#32c24d;" ;
		if(!StringUtils.isBlank(this.theme) && this.theme.equals("01")){
			color = "background-color:#32c24d !important;" ;
		}else if(!StringUtils.isBlank(this.theme) && this.theme.equals("02")){
			color = "background-color:#32c24d !important;" ;
		}else if(!StringUtils.isBlank(this.theme) && this.theme.equals("03")){
			color = "background-color:#1E90FF !important;" ;
		}
		return color ;
	}
	
	@Transient
	public String getStyleColor(){
		String color = "#32c24d  !important;" ;
		if(!StringUtils.isBlank(this.theme) && this.theme.equals("01")){
			color = "#32c24d  !important;" ;
		}else if(!StringUtils.isBlank(this.theme) && this.theme.equals("02")){
			color = "#32c24d  !important;" ;
		}else if(!StringUtils.isBlank(this.theme) && this.theme.equals("03")){
			color = "#1E90FF  !important;" ;
		}
		return color ;
	}
	public String getIconstr() {
		return iconstr;
	}
	public void setIconstr(String iconstr) {
		this.iconstr = iconstr;
	}

}