实体类
package com.zhubayi.crm.pojo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author zhubayi
* @since 2021-02-12
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_sale_chance")
@ApiModel(value="SaleChance对象", description="")
public class SaleChance implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "机会来源")
private String chanceSource;
@ApiModelProperty(value = "客户名称")
private String customerName;
@ApiModelProperty(value = "成功几率")
private Integer successPossibility;
@ApiModelProperty(value = "概要")
private String overview;
@ApiModelProperty(value = "联系人")
private String linkMan;
@ApiModelProperty(value = "手机号")
private String linkPhone;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "创建人")
private String createMan;
@ApiModelProperty(value = "分配人")
private String assignMan;
@ApiModelProperty(value = "分配时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/shanghai")
private LocalDateTime assignTime;
@ApiModelProperty(value = "分配状态")
private Integer state;
@ApiModelProperty(value = "开发结果")
private Integer devResult;
@ApiModelProperty(value = "有效状态")
private Integer isValid;
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/shanghai")
private LocalDateTime createDate;
@ApiModelProperty(value = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/shanghai")
private LocalDateTime updateDate;
@ApiModelProperty(value = "指派人")
@TableField(exist = false)
private String assignName;
}
controller类:
@GetMapping(value = "addOrUpdateSaleChancePage")
public String addOrUpdateSaleChancePage(Integer id, Model model){
if(null!=id){
SaleChance saleChance = saleChanceService.getById(id);
//设置到请求域
model.addAttribute("saleChance",saleChance);
}
return "saleChance/add_update";
}
前端取值:
<#-- 指派人的隐藏域-->
<input type="hidden" id="assignManId" value="${(saleChance.assignMan)!}"/>
一定要加 ! 号