From 5b90df324cf0f73c72a2dede56f3c9111190d0f7 Mon Sep 17 00:00:00 2001 From: "Stormeye.Wu" Date: Tue, 18 Sep 2018 14:00:43 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=95=86=E6=88=B7=E7=94=A8=E6=88=B7=E6=95=B4?= =?UTF-8?q?=E7=90=86][=E6=95=B4=E7=90=86]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/domain/po/WxMerchantBUser.java | 459 +++++++++--------- 1 file changed, 239 insertions(+), 220 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchantBUser.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchantBUser.java index 4d4b7e89f..8238394b4 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchantBUser.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchantBUser.java @@ -12,229 +12,248 @@ import java.util.UUID; @Table(name = "wx_merchant_b_user") public class WxMerchantBUser implements Serializable { - private static final long serialVersionUID = 1L; - - @Id + private static final long serialVersionUID = 1L; + + @Id protected Long id; - + @Transient protected List ids; @Transient protected String sortColumns; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getSortColumns() { - return sortColumns; - } - - public List getIds() { - return ids; - } - - public void setIds(List ids) { - this.ids = ids; - } - - - /*租户ID**/ - @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") - private String tenantId; - /*B端用户id**/ - @io.swagger.annotations.ApiModelProperty(value="B端用户id",name="bUserId") - private Long bUserId; - /*B端用户手机号**/ - @io.swagger.annotations.ApiModelProperty(value="B端用户手机号",name="phone") - private String phone; - /***/ - @io.swagger.annotations.ApiModelProperty(value="",name="bUserPwd") - private String bUserPwd; - /*商户id**/ - @io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId") - private Long merchantId; - /*创建时间**/ - @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") - private Date createDate; - /*更新时间**/ - @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") - private Date updateDate; - /*小程序的appId**/ - @io.swagger.annotations.ApiModelProperty(value="小程序的appId",name="appId") - private String appId; - /*用户登录用token**/ - @io.swagger.annotations.ApiModelProperty(value="用户登录用token",name="token") - private String token; - /*用户过期时间**/ - @io.swagger.annotations.ApiModelProperty(value="用户过期时间",name="expireTime") - private Date expireTime; - /*b端用户姓名**/ - @io.swagger.annotations.ApiModelProperty(value="b端用户姓名",name="name") - private String name; - /*绑定状态1未绑定商户0已绑定商户**/ - @io.swagger.annotations.ApiModelProperty(value="绑定状态1未绑定商户0已绑定商户",name="status") - private Integer status; - - - public String getTenantId() { - return tenantId; - } - public void setTenantId(String _tenantId) { - tenantId = _tenantId; - } - public Long getBUserId() { - return bUserId; - } - public void setBUserId(Long _bUserId) { - bUserId = _bUserId; - } - public String getPhone() { - return phone; - } - public void setPhone(String _phone) { - phone = _phone; - } - public String getBUserPwd() { - return bUserPwd; - } - public void setBUserPwd(String _bUserPwd) { - bUserPwd = _bUserPwd; - } - public Long getMerchantId() { - return merchantId; - } - public void setMerchantId(Long _merchantId) { - merchantId = _merchantId; - } - public Date getCreateDate() { - return createDate; - } - public void setCreateDate(Date _createDate) { - createDate = _createDate; - } - public Date getUpdateDate() { - return updateDate; - } - public void setUpdateDate(Date _updateDate) { - updateDate = _updateDate; - } - public String getAppId() { - return appId; - } - public void setAppId(String _appId) { - appId = _appId; - } - public String getToken() { - return token; - } - public void setToken(String _token) { - token = _token; - } - public Date getExpireTime() { - return expireTime; - } - public void setExpireTime(Date _expireTime) { - expireTime = _expireTime; - } - - public String getName() { - return name; - } - - public void setName(String _name) { - this.name = _name; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public static enum Field - { - Id_ASC("`id` ASC"),Id_DESC("`id` DESC") - ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") - ,BUserId_ASC("`bUserId` ASC"),BUserId_DESC("`bUserId` DESC") - ,Phone_ASC("`phone` ASC"),Phone_DESC("`phone` DESC") - ,BUserPwd_ASC("`bUserPwd` ASC"),BUserPwd_DESC("`bUserPwd` DESC") - ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") - ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") - ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") - ,AppId_ASC("`appId` ASC"),AppId_DESC("`appId` DESC") - ,Token_ASC("`token` ASC"),Token_DESC("`token` DESC") - ,ExpireTime_ASC("`expireTime` ASC"),ExpireTime_DESC("`expireTime` DESC") - ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") - ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") - - ; - private String value; - Field(String value){ - this.value = value; - } - public String getValue() { - return value; - } - public void setCol(String value) { - this.value = value; - } - @Override - public String toString() { - return this.getValue(); - } - } - - public void setSortColumns(WxMerchantBUser.Field... fields) - { - if (fields == null || fields.length == 0) { - return; - } - for (int k = 0; k < fields.length; k++) { - if (fields[k] == null) { - return; - } - } - StringBuilder sb = new StringBuilder(fields[0].toString()); - for (int k = 1; k < fields.length; k++) { - sb.append(","); - sb.append(fields[k].toString()); - } - - } - - public void setSortColumns(String sortColumns) - { - if (sortColumns == null || "".equals(sortColumns.trim())) { - return; - } - if (sortColumns.contains(",")) { - String[] cols = sortColumns.split(","); - java.util.List fList = new java.util.ArrayList(); - for (int k = 0; k < cols.length; k++) { - fList.add(Field.valueOf(cols[k])); - } - this.setSortColumns(fList.toArray(new Field[fList.size()])); - } else { - this.setSortColumns(Field.valueOf(sortColumns)); - } - } - - public void createToken(Date currentDate) { - if (expireTime == null || expireTime.getTime() < currentDate.getTime()) - { - //生成一个token - String token = UUID.randomUUID().toString(); - //过期时间 - Date expireTime = new Date(currentDate.getTime() + BaseConstant.EXPIRE * 1000); - setToken(token); - setExpireTime(expireTime); - } - } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSortColumns() { + return sortColumns; + } + + public List getIds() { + return ids; + } + + public void setIds(List ids) { + this.ids = ids; + } + + + /*租户ID**/ + @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId") + private String tenantId; + /*B端用户id**/ + @io.swagger.annotations.ApiModelProperty(value = "B端用户id", name = "bUserId") + private Long bUserId; + /*B端用户手机号**/ + @io.swagger.annotations.ApiModelProperty(value = "B端用户手机号", name = "phone") + private String phone; + /***/ + @io.swagger.annotations.ApiModelProperty(value = "", name = "bUserPwd") + private String bUserPwd; + /*商户id**/ + @io.swagger.annotations.ApiModelProperty(value = "商户id", name = "merchantId") + private Long merchantId; + /*创建时间**/ + @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate") + private Date createDate; + /*更新时间**/ + @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateDate") + private Date updateDate; + /*小程序的appId**/ + @io.swagger.annotations.ApiModelProperty(value = "小程序的appId", name = "appId") + private String appId; + /*用户登录用token**/ + @io.swagger.annotations.ApiModelProperty(value = "用户登录用token", name = "token") + private String token; + /*用户过期时间**/ + @io.swagger.annotations.ApiModelProperty(value = "用户过期时间", name = "expireTime") + private Date expireTime; + /*b端用户姓名**/ + @io.swagger.annotations.ApiModelProperty(value = "b端用户姓名", name = "name") + private String name; + /*绑定状态1未绑定商户0已绑定商户**/ + @io.swagger.annotations.ApiModelProperty(value = "绑定状态1未绑定商户0已绑定商户", name = "status") + private Integer status; + + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String _tenantId) { + tenantId = _tenantId; + } + + public Long getBUserId() { + return bUserId; + } + + public void setBUserId(Long _bUserId) { + bUserId = _bUserId; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String _phone) { + phone = _phone; + } + + public String getBUserPwd() { + return bUserPwd; + } + + public void setBUserPwd(String _bUserPwd) { + bUserPwd = _bUserPwd; + } + + public Long getMerchantId() { + return merchantId; + } + + public void setMerchantId(Long _merchantId) { + merchantId = _merchantId; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date _createDate) { + createDate = _createDate; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date _updateDate) { + updateDate = _updateDate; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String _appId) { + appId = _appId; + } + + public String getToken() { + return token; + } + + public void setToken(String _token) { + token = _token; + } + + public Date getExpireTime() { + return expireTime; + } + + public void setExpireTime(Date _expireTime) { + expireTime = _expireTime; + } + + public String getName() { + return name; + } + + public void setName(String _name) { + this.name = _name; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public static enum Field { + Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), + TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), + BUserId_ASC("`b_user_id` ASC"), BUserId_DESC("`b_user_id` DESC"), + Phone_ASC("`phone` ASC"), Phone_DESC("`phone` DESC"), + BUserPwd_ASC("`b_user_pwd` ASC"), BUserPwd_DESC("`b_user_pwd` DESC"), + MerchantId_ASC("`merchant_id` ASC"), MerchantId_DESC("`merchant_id` DESC"), + CreateDate_ASC("`create_date` ASC"), CreateDate_DESC("`create_date` DESC"), + UpdateDate_ASC("`update_date` ASC"), UpdateDate_DESC("`update_date` DESC"), + AppId_ASC("`app_id` ASC"), AppId_DESC("`app_id` DESC"), + Token_ASC("`token` ASC"), Token_DESC("`token` DESC"), + ExpireTime_ASC("`expire_time` ASC"), ExpireTime_DESC("`expire_time` DESC"), + Name_ASC("`name` ASC"), Name_DESC("`name` DESC"), + Status_ASC("`status` ASC"), Status_DESC("`status` DESC"); + + private String value; + + Field(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public void setCol(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.getValue(); + } + } + + public void setSortColumns(WxMerchantBUser.Field... fields) { + if (fields == null || fields.length == 0) { + return; + } + for (int k = 0; k < fields.length; k++) { + if (fields[k] == null) { + return; + } + } + StringBuilder sb = new StringBuilder(fields[0].toString()); + for (int k = 1; k < fields.length; k++) { + sb.append(","); + sb.append(fields[k].toString()); + } + + this.sortColumns = sb.toString(); + } + + public void setSortColumns(String sortColumns) { + if (sortColumns == null || "".equals(sortColumns.trim())) { + return; + } + if (sortColumns.contains(",")) { + String[] cols = sortColumns.split(","); + java.util.List fList = new java.util.ArrayList(); + for (int k = 0; k < cols.length; k++) { + fList.add(Field.valueOf(cols[k])); + } + this.setSortColumns(fList.toArray(new Field[fList.size()])); + } else { + this.setSortColumns(Field.valueOf(sortColumns)); + } + } + + public void createToken(Date currentDate) { + if (expireTime == null || expireTime.getTime() < currentDate.getTime()) { + //生成一个token + String token = UUID.randomUUID().toString(); + //过期时间 + Date expireTime = new Date(currentDate.getTime() + BaseConstant.EXPIRE * 1000); + setToken(token); + setExpireTime(expireTime); + } + } }