【SSH框架学习】前台获取Bean中的封装方法

package com.aitiman.domain;

import java.text.SimpleDateFormat;
import java.util.Date;

public class SaleVisit {
/*	  `visit_id` varchar(36) NOT NULL,
	  `visit_cust_id` bigint(32) DEFAULT NULL COMMENT '客户id',
	  `visit_user_id` bigint(32) DEFAULT NULL COMMENT '负责人id',
	  `visit_time` date DEFAULT NULL COMMENT '拜访时间',
	  `visit_interviewee` varchar(32) DEFAULT NULL COMMENT '被拜访人',
	  `visit_addr` varchar(128) DEFAULT NULL COMMENT '拜访地点',
	  `visit_detail` varchar(256) DEFAULT NULL COMMENT '拜访详情',
	  `visit_nexttime` date DEFAULT NULL COMMENT '下次拜访时间',*/
	private String visit_id            ;
	private String visit_interviewee   ;
	private String visit_addr          ;
	private String visit_detail        ;
	private Date visit_time;
	private Date visit_nexttime;
	private Customer customer;
	private User user;
	
	
	//-----------------------------------------------

	//如果将当前bean的实例salevisit 转发到前台jsp,jsp页面直接用<s:property value="#salevisit.visit_time_s" > 即可获得转换后的数据
	
	//将date格式数据转为string类型数据
	public String getVisit_time_s() {
		return transferDate(visit_time,"yyyy-MM-dd");
	}
	public String getVisit_nexttime_s() {
		return transferDate(visit_nexttime,"yyyy-MM-dd");
	}
	//转换器方法
	public static String  transferDate(Date date,String format){
		SimpleDateFormat sdf = new SimpleDateFormat(format);
		return sdf.format(date);
	}

	//-----------------------------------------------
	
	
	
	/**
	 * @return the visit_id
	 */
	public String getVisit_id() {
		return visit_id;
	}
	public void setVisit_id(String visit_id) {
		this.visit_id = visit_id;
	}
	/**
	 * @return the visit_interviewee
	 */
	public String getVisit_interviewee() {
		return visit_interviewee;
	}
	public void setVisit_interviewee(String visit_interviewee) {
		this.visit_interviewee = visit_interviewee;
	}
	/**
	 * @return the visit_addr
	 */
	public String getVisit_addr() {
		return visit_addr;
	}
	public void setVisit_addr(String visit_addr) {
		this.visit_addr = visit_addr;
	}
	/**
	 * @return the visit_detail
	 */
	public String getVisit_detail() {
		return visit_detail;
	}
	public void setVisit_detail(String visit_detail) {
		this.visit_detail = visit_detail;
	}
	/**
	 * @return the visit_time
	 */
	public Date getVisit_time() {
		return visit_time;
	}
	public void setVisit_time(Date visit_time) {
		this.visit_time = visit_time;
	}
	/**
	 * @return the visit_nexttime
	 */
	public Date getVisit_nexttime() {
		return visit_nexttime;
	}
	public void setVisit_nexttime(Date visit_nexttime) {
		this.visit_nexttime = visit_nexttime;
	}
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "SaleVisit [visit_id=" + visit_id + ", visit_interviewee=" + visit_interviewee + ", visit_addr="
				+ visit_addr + ", visit_detail=" + visit_detail + ", visit_time=" + visit_time + ", visit_nexttime="
				+ visit_nexttime + ", customer=" + customer + ", user=" + user + "]";
	}
	
	
	
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值