记得上下班打卡 | git大法好,push需谨慎

Commit f3977b44 authored by Tice's avatar Tice

提交代码

parent d3d5a035
package com.liquidnet.service.merchant.constant;
public class MerchantRedisConst {
public static final String PREFIX = "merchant:";
// 场地详情
public static final String INFO_FIELD = PREFIX.concat("info:field:");
// 个人全部的场地申请
public static final String INFO_FIELD_APPLIES = PREFIX.concat("info:field_applies:");
}
package com.liquidnet.service.merchant.dto.param;
import com.liquidnet.commons.lang.constant.LnsRegex;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
@ApiModel(value = "MerchantFieldsApplyParam", description = "认领/创建场地入参")
@Data
public class MerchantFieldsApplyParam implements java.io.Serializable {
private static final long serialVersionUID = 7889390710531228185L;
@ApiModelProperty(position = 10, required = false, value = "场地ID,认领时必传[50]")
private String fieldId;
@ApiModelProperty(position = 11, required = true, value = "场地名称[30]", example = "测试")
@Size(max = 30, message = "场地长度限制1-30位")
@NotBlank(message = "名称不能为空")
private String name;
@ApiModelProperty(position = 12, required = true, value = "logo图", example = "https://img.zhengzai.tv/partner/2019/05/14/5cda2d0520177.png")
@NotNull(message = "logo图不能为空")
private String logo;
@ApiModelProperty(position = 13, required = true, value = "背景图", example = "https://img.zhengzai.tv/partner/2019/05/14/5cda2d0520177.png")
@NotNull(message = "背景图不能为空")
private String background;
@ApiModelProperty(position = 14, required = true, value = "介绍[1000]", example = "这是一段介绍文字")
private String description;
@ApiModelProperty(position = 15, required = true, value = "建立日期[YYYY-MM-DD]", example = "2021-05-17")
@Pattern(regexp = LnsRegex.Valid.DATETIME_YMD, message = "日期格式有误")
private String builtDate;
@ApiModelProperty(position = 16, required = true, value = "省id")
private String provinceId;
@ApiModelProperty(position = 17, required = true, value = "省名称")
private String provinceName;
@ApiModelProperty(position = 18, required = true, value = "城市id")
private String cityId;
@ApiModelProperty(position = 19, required = true, value = "城市名称")
private String cityName;
@ApiModelProperty(position = 20, required = true, value = "县id")
private String districtId;
@ApiModelProperty(position = 21, required = true, value = "县名称")
private String districtName;
@ApiModelProperty(position = 22, required = true, value = "详细地址[100]", example = "广渠路1号创1958园区")
@Size(max = 100, message = "已超出详细地址长度限制")
private String address;
@ApiModelProperty(position = 23, required = true, value = "经度")
private String longitude;
@ApiModelProperty(position = 24, required = true, value = "纬度")
private String latitude;
@ApiModelProperty(position = 25, required = true, value = "联系人姓名", example = "张三")
private String contactName;
@ApiModelProperty(position = 26, required = true, value = "联系人邮箱", example = "zhangsan@zhengzai.tv")
private String contactEmail;
@ApiModelProperty(position = 27, required = true, value = "企业名称")
@NotBlank(message = "企业名称不能为空")
private String companyName;
@ApiModelProperty(position = 28, required = true, value = "营业执照编号")
@NotBlank(message = "营业执照编号不能为空")
private String licenseCode;
@ApiModelProperty(position = 29, required = true, value = "营业执照图片")
@NotBlank(message = "营业执照图片不能为空")
private String licenseImg;
@ApiModelProperty(position = 30, required = true, value = "法人姓名", example = "李四")
@NotBlank(message = "法人姓名不能为空")
private String legalName;
@ApiModelProperty(position = 31, required = true, value = "法人身份证号码")
@Pattern(regexp = LnsRegex.Valid.LETTER_NUMBER, message = "证件号格式有误")
@Size(min = 1, max = 30, message = "证件号长度限制1-30位")
@NotBlank(message = "证件号不能为空")
private String legalIdentity;
@ApiModelProperty(position = 32, required = true, value = "法人身份证正面照")
@NotNull(message = "法人身份证正面照不能为空")
private String legalIdentityObverse;
@ApiModelProperty(position = 33, required = true, value = "法人身份证反面照")
@NotNull(message = "法人身份证反面照不能为空")
private String legalIdentityReverse;
}
package com.liquidnet.service.merchant.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.merchant.entity.MerchantFieldApplies;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
@ApiModel(value = "MerchantFieldsAppliesVo", description = "申请的场地")
@Data
public class MerchantFieldsAppliesVo implements java.io.Serializable, Cloneable {
private static final long serialVersionUID = -3241866244946476511L;
@ApiModelProperty(position = 10, value = "场地申请ID")
private String fieldApplyId;
@ApiModelProperty(position = 11, value = "场地申请状态 0-待审核 1-通过 2-驳回")
private Integer applyStatus;
@ApiModelProperty(position = 12, value = "场地申请类型 claim-认领、create-创建")
private String applyType;
@ApiModelProperty(position = 13, value = "驳回原因")
private String reject;
@ApiModelProperty(position = 14, value = "用户ID")
private String uid;
@ApiModelProperty(position = 15, value = "场地ID")
private String fieldId;
@ApiModelProperty(position = 16, value = "场地名称[30]")
private String name;
@ApiModelProperty(position = 17, value = "logo图")
private String logo;
@ApiModelProperty(position = 18, value = "背景图")
private String background;
@ApiModelProperty(position = 19, value = "介绍[1000]")
private String description;
@ApiModelProperty(position = 20, value = "建立日期[YYYY-MM-DD]")
private LocalDate builtDate;
@ApiModelProperty(position = 21, value = "省id")
private String provinceId;
@ApiModelProperty(position = 22, value = "省名称")
private String provinceName;
@ApiModelProperty(position = 23, value = "城市id")
private String cityId;
@ApiModelProperty(position = 24, value = "城市名称")
private String cityName;
@ApiModelProperty(position = 25, value = "县id")
private String districtId;
@ApiModelProperty(position = 26, value = "县名称")
private String districtName;
@ApiModelProperty(position = 27, value = "详细地址[100]")
private String address;
@ApiModelProperty(position = 28, value = "经度")
private String longitude;
@ApiModelProperty(position = 29, value = "纬度")
private String latitude;
@ApiModelProperty(position = 30, value = "联系人姓名")
private String contactName;
@ApiModelProperty(position = 31, value = "联系人邮箱")
private String contactEmail;
@ApiModelProperty(position = 32, value = "企业名称")
private String companyName;
@ApiModelProperty(position = 33, value = "营业执照编号")
private String licenseCode;
@ApiModelProperty(position = 34, value = "营业执照图片")
private String licenseImg;
@ApiModelProperty(position = 35, value = "法人姓名")
private String legalName;
@ApiModelProperty(position = 36, value = "法人身份证号码")
private String legalIdentity;
@ApiModelProperty(position = 37, value = "法人身份证正面照")
private String legalIdentityObverse;
@ApiModelProperty(position = 38, value = "法人身份证反面照")
private String legalIdentityReverse;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime createdAt;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime updatedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime deletedAt;
private static final MerchantFieldsAppliesVo obj = new MerchantFieldsAppliesVo();
public static MerchantFieldsAppliesVo getNew() {
try {
return (MerchantFieldsAppliesVo) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new MerchantFieldsAppliesVo();
}
public MerchantFieldsAppliesVo copy(MerchantFieldApplies source) {
if (null == source) return this;
this.setFieldApplyId(source.getFieldApplyId());
this.setApplyStatus(source.getApplyStatus());
this.setApplyType(source.getApplyType());
this.setReject(source.getReject());
this.setUid(source.getUid());
this.setFieldId(source.getFieldId());
this.setName(source.getName());
this.setLogo(source.getLogo());
this.setBackground(source.getBackground());
this.setDescription(source.getDescription());
this.setBuiltDate(source.getBuiltDate());
this.setProvinceId(source.getProvinceId());
this.setProvinceName(source.getProvinceName());
this.setCityId(source.getCityId());
this.setCityName(source.getCityName());
this.setDistrictId(source.getDistrictId());
this.setDistrictName(source.getDistrictName());
this.setAddress(source.getAddress());
this.setLongitude(source.getLongitude());
this.setLatitude(source.getLatitude());
this.setContactName(source.getContactName());
this.setContactEmail(source.getContactEmail());
this.setCompanyName(source.getCompanyName());
this.setLicenseCode(source.getLicenseCode());
this.setLicenseImg(source.getLicenseImg());
this.setLegalName(source.getLegalName());
this.setLegalIdentity(source.getLegalIdentity());
this.setLegalIdentityObverse(source.getLegalIdentityObverse());
this.setLegalIdentityReverse(source.getLegalIdentityReverse());
this.setCreatedAt(source.getCreatedAt());
this.setUpdatedAt(source.getUpdatedAt());
this.setDeletedAt(source.getDeletedAt());
return this;
}
}
package com.liquidnet.service.merchant.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.merchant.entity.MerchantFieldApplies;
import com.liquidnet.service.merchant.entity.MerchantFields;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
@ApiModel(value = "MerchantFieldsVo", description = "场地")
@Data
public class MerchantFieldsVo implements java.io.Serializable, Cloneable {
private static final long serialVersionUID = 2531062739435013044L;
@ApiModelProperty(position = 11, value = "场地ID")
private String fieldId;
@ApiModelProperty(position = 12, value = "上线状态 0下线 1下线")
private Integer isOnline;
@ApiModelProperty(position = 13, value = "认领状态 0未认领 1已认领 2认领中")
private Integer claimStatus;
@ApiModelProperty(position = 14, value = "场地所有者账号")
private String uid;
@ApiModelProperty(position = 15, value = "审核演出开关 0不审 1审核")
private Integer isCheck;
@ApiModelProperty(position = 16, value = "场地名称[30]")
private String name;
@ApiModelProperty(position = 17, value = "logo图")
private String logo;
@ApiModelProperty(position = 18, value = "背景图")
private String background;
@ApiModelProperty(position = 19, value = "介绍[1000]")
private String description;
@ApiModelProperty(position = 20, value = "建立日期[YYYY-MM-DD]")
private LocalDate builtDate;
@ApiModelProperty(position = 21, value = "省id")
private String provinceId;
@ApiModelProperty(position = 22, value = "省名称")
private String provinceName;
@ApiModelProperty(position = 23, value = "城市id")
private String cityId;
@ApiModelProperty(position = 24, value = "城市名称")
private String cityName;
@ApiModelProperty(position = 25, value = "县id")
private String districtId;
@ApiModelProperty(position = 26, value = "县名称")
private String districtName;
@ApiModelProperty(position = 27, value = "详细地址[100]")
private String address;
@ApiModelProperty(position = 28, value = "经度")
private String longitude;
@ApiModelProperty(position = 29, value = "纬度")
private String latitude;
@ApiModelProperty(position = 30, value = "联系人姓名")
private String contactName;
@ApiModelProperty(position = 31, value = "联系人邮箱")
private String contactEmail;
@ApiModelProperty(position = 32, value = "企业ID")
private String companyId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime createdAt;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime updatedAt;
private static final MerchantFieldsVo obj = new MerchantFieldsVo();
public static MerchantFieldsVo getNew() {
try {
return (MerchantFieldsVo) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new MerchantFieldsVo();
}
public MerchantFieldsVo copy(MerchantFields source) {
if (null == source) return this;
this.setFieldId(source.getFieldId());
this.setIsOnline(source.getIsOnline());
this.setClaimStatus(source.getClaimStatus());
this.setUid(source.getUid());
this.setIsCheck(source.getIsCheck());
this.setName(source.getName());
this.setLogo(source.getLogo());
this.setBackground(source.getBackground());
this.setDescription(source.getDescription());
this.setBuiltDate(source.getBuiltDate());
this.setProvinceId(source.getProvinceId());
this.setProvinceName(source.getProvinceName());
this.setCityId(source.getCityId());
this.setCityName(source.getCityName());
this.setDistrictId(source.getDistrictId());
this.setDistrictName(source.getDistrictName());
this.setAddress(source.getAddress());
this.setLongitude(source.getLongitude());
this.setLatitude(source.getLatitude());
this.setContactName(source.getContactName());
this.setContactEmail(source.getContactEmail());
this.setCompanyId(source.getCompanyId());
this.setCreatedAt(source.getCreatedAt());
this.setUpdatedAt(source.getUpdatedAt());
return this;
}
}
package com.liquidnet.service.merchant.dto.vo;
public class MerchantSponsorAppliesVo {
}
package com.liquidnet.service.merchant.service;
import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.merchant.dto.param.MerchantFieldsApplyParam;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo;
public interface IMerchantFieldsAppliesService {
PagedResult<MerchantFieldsVo> search(String name);
String apply(MerchantFieldsApplyParam parameter);
}
......@@ -139,4 +139,31 @@ public class MQConst {
return desc;
}
}
public enum MerchantQueue {
SQL_MERCHANT_FIELD("merchant:stream:rk.sql.field", "group.sql.field", "场地相关")
;
private final String key;
private final String group;
private final String desc;
MerchantQueue(String key, String group, String desc) {
this.key = key;
this.group = group;
this.desc = desc;
}
public String getKey() {
return key;
}
public String getGroup() {
return group;
}
public String getDesc() {
return desc;
}
}
}
package com.liquidnet.service.merchant.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 演出授权关联权限表
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class MerchantAuthorizationPermissions implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* authorization_permission_id
*/
private String authorizationPermissionId;
/**
* authorization_record_id
*/
private String authorizationRecordId;
/**
* permission_id
*/
private String permissionId;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
package com.liquidnet.service.merchant.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 演出授权记录表
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class MerchantAuthorizationRecords implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* authorization_record_id
*/
private String authorizationRecordId;
/**
* 演出ID
*/
private String performanceId;
/**
* 权利人演出角色[creator|sponsor|fielder|checker]
*/
private String uidRole;
/**
* 权利人
*/
private String uid;
/**
* 授权人演出角色[creator|sponsor|fielder]
*/
private String cuidRole;
/**
* 授权人
*/
private String cuid;
/**
* 授权开始时间
*/
private LocalDateTime startTime;
/**
* 授权结束时间
*/
private LocalDateTime endTime;
private LocalDateTime deletedAt;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
package com.liquidnet.service.merchant.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 公司表
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class MerchantCompanies implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* company_id
*/
private String companyId;
/**
* 企业名称
*/
private String name;
/**
* 营业执照编号
*/
private String licenseCode;
/**
* 营业执照图片地址
*/
private String licenseImg;
/**
* 法人姓名
*/
private String legalName;
/**
* 法人身份证号码
*/
private String legalIdentity;
/**
* 法人身份证正面照
*/
private String legalIdentityObverse;
/**
* 法人身份证反面照
*/
private String legalIdentityReverse;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
package com.liquidnet.service.merchant.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 场地申请表
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class MerchantFieldApplies implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* field_apply_id
*/
private String fieldApplyId;
/**
* 申请状态 0待审核 1通过 2驳回
*/
private Integer applyStatus;
/**
* 类型 claim认领、create创建
*/
private String applyType;
/**
* 驳回原因
*/
private String reject;
/**
* 场地申请者账号
*/
private String uid;
/**
* 要认领的或创建的场地ID
*/
private String fieldId;
/**
* 名称
*/
private String name;
/**
* logo图片地址
*/
private String logo;
/**
* 背景图片地址
*/
private String background;
/**
* 介绍
*/
private String description;
/**
* 建立日期
*/
private LocalDate builtDate;
/**
* 省份ID
*/
private String provinceId;
/**
* 省份名称
*/
private String provinceName;
/**
* 城市ID
*/
private String cityId;
/**
* 城市名称
*/
private String cityName;
/**
* 区县ID
*/
private String districtId;
/**
* 区县名称
*/
private String districtName;
/**
* 详细地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 联系人姓名
*/
private String contactName;
/**
* 联系人邮箱
*/
private String contactEmail;
/**
* 企业名称
*/
private String companyName;
/**
* 营业执照编号
*/
private String licenseCode;
/**
* 营业执照图片地址
*/
private String licenseImg;
/**
* 法人姓名
*/
private String legalName;
/**
* 法人身份证号码
*/
private String legalIdentity;
/**
* 法人身份证正面照
*/
private String legalIdentityObverse;
/**
* 法人身份证反面照
*/
private String legalIdentityReverse;
private LocalDateTime deletedAt;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
package com.liquidnet.service.merchant.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 场地默认验票员表
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class MerchantFieldCheckers implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* field_apply_id
*/
private String fieldCheckerId;
/**
* 要认领的或创建的场地ID
*/
private String fieldId;
/**
* 验票员账号
*/
private String uid;
/**
* 授权人账号
*/
private String cuid;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
package com.liquidnet.service.merchant.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 场地表
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class MerchantFields implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* field_id
*/
private String fieldId;
/**
* 上线状态 0下线 1下线
*/
private Integer isOnline;
/**
* 认领状态 0未认领 1已认领 2认领中
*/
private Integer claimStatus;
/**
* 场地所有者账号
*/
private String uid;
/**
* 审核演出开关 0不审 1审核
*/
private Integer isCheck;
/**
* 名称
*/
private String name;
/**
* logo图片地址
*/
private String logo;
/**
* 背景图片地址
*/
private String background;
/**
* 介绍
*/
private String description;
/**
* 建立日期
*/
private LocalDate builtDate;
/**
* 省份ID
*/
private String provinceId;
/**
* 省份名称
*/
private String provinceName;
/**
* 城市ID
*/
private String cityId;
/**
* 城市名称
*/
private String cityName;
/**
* 区县ID
*/
private String districtId;
/**
* 区县名称
*/
private String districtName;
/**
* 详细地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 联系人姓名
*/
private String contactName;
/**
* 联系人邮箱
*/
private String contactEmail;
/**
* 企业信息ID
*/
private String companyId;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
package com.liquidnet.service.merchant.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 演出权限表
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class MerchantPermissions implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* permission_id
*/
private String permissionId;
/**
* 名称
*/
private String name;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
package com.liquidnet.service.merchant.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 主办申请表
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class MerchantSponsorApplies implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* sponsor_apply_id
*/
private String sponsorApplyId;
/**
* 申请状态 0待审核 1通过 2驳回
*/
private Integer applyStatus;
/**
* 类型 create创建
*/
private String applyType;
/**
* 驳回原因
*/
private String reject;
/**
* 场地申请者账号
*/
private String uid;
/**
* 名称
*/
private String name;
/**
* logo图片地址
*/
private String logo;
/**
* 背景图片地址
*/
private String background;
/**
* 介绍
*/
private String description;
/**
* 联系人姓名
*/
private String contactName;
/**
* 联系人身份证号码
*/
private String contactIdentity;
/**
* 联系人身份证正面照
*/
private String contactIdentityObverse;
/**
* 联系人身份证反面照
*/
private String contactIdentityReverse;
/**
* 联系人邮箱
*/
private String contactEmail;
/**
* 企业名称
*/
private String companyName;
/**
* 营业执照编号
*/
private String licenseCode;
/**
* 营业执照图片地址
*/
private String licenseImg;
/**
* 法人姓名
*/
private String legalName;
/**
* 法人身份证号码
*/
private String legalIdentity;
/**
* 法人身份证正面照
*/
private String legalIdentityObverse;
/**
* 法人身份证反面照
*/
private String legalIdentityReverse;
private LocalDateTime deletedAt;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
package com.liquidnet.service.merchant.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 主办表
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class MerchantSponsors implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* sponsor_id
*/
private String sponsorId;
/**
* 上线状态 0下线 1下线
*/
private Integer isOnline;
/**
* 主办所有者账号
*/
private String uid;
/**
* 名称
*/
private String name;
/**
* logo图片地址
*/
private String logo;
/**
* 背景图片地址
*/
private String background;
/**
* 介绍
*/
private String description;
/**
* 联系人姓名
*/
private String contactName;
/**
* 联系人身份证号码
*/
private String contactIdentity;
/**
* 联系人身份证正面照
*/
private String contactIdentityObverse;
/**
* 联系人身份证反面照
*/
private String contactIdentityReverse;
/**
* 联系人邮箱
*/
private String contactEmail;
/**
* 企业信息ID
*/
private String companyId;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
package com.liquidnet.service.merchant.mapper;
import com.liquidnet.service.merchant.entity.MerchantAuthorizationPermissions;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 演出授权关联权限表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
public interface MerchantAuthorizationPermissionsMapper extends BaseMapper<MerchantAuthorizationPermissions> {
}
package com.liquidnet.service.merchant.mapper;
import com.liquidnet.service.merchant.entity.MerchantAuthorizationRecords;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 演出授权记录表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
public interface MerchantAuthorizationRecordsMapper extends BaseMapper<MerchantAuthorizationRecords> {
}
package com.liquidnet.service.merchant.mapper;
import com.liquidnet.service.merchant.entity.MerchantCompanies;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 公司表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
public interface MerchantCompaniesMapper extends BaseMapper<MerchantCompanies> {
}
package com.liquidnet.service.merchant.mapper;
import com.liquidnet.service.merchant.entity.MerchantFieldApplies;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 场地申请表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
public interface MerchantFieldAppliesMapper extends BaseMapper<MerchantFieldApplies> {
}
package com.liquidnet.service.merchant.mapper;
import com.liquidnet.service.merchant.entity.MerchantFieldCheckers;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 场地默认验票员表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
public interface MerchantFieldCheckersMapper extends BaseMapper<MerchantFieldCheckers> {
}
package com.liquidnet.service.merchant.mapper;
import com.liquidnet.service.merchant.entity.MerchantFields;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 场地表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
public interface MerchantFieldsMapper extends BaseMapper<MerchantFields> {
}
package com.liquidnet.service.merchant.mapper;
import com.liquidnet.service.merchant.entity.MerchantPermissions;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 演出权限表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
public interface MerchantPermissionsMapper extends BaseMapper<MerchantPermissions> {
}
package com.liquidnet.service.merchant.mapper;
import com.liquidnet.service.merchant.entity.MerchantSponsorApplies;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 主办申请表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
public interface MerchantSponsorAppliesMapper extends BaseMapper<MerchantSponsorApplies> {
}
package com.liquidnet.service.merchant.mapper;
import com.liquidnet.service.merchant.entity.MerchantSponsors;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 主办表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-11-02
*/
public interface MerchantSponsorsMapper extends BaseMapper<MerchantSponsors> {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.merchant.mapper.MerchantAuthorizationPermissionsMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.merchant.mapper.MerchantAuthorizationRecordsMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.merchant.mapper.MerchantCompaniesMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.merchant.mapper.MerchantFieldAppliesMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.merchant.mapper.MerchantFieldCheckersMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.merchant.mapper.MerchantFieldsMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.merchant.mapper.MerchantPermissionsMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.merchant.mapper.MerchantSponsorAppliesMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.merchant.mapper.MerchantSponsorsMapper">
</mapper>
# create database if not exists ln_scene character set utf8mb4 collate utf8mb4_unicode_ci;
# use ln_scene;
-- >>------------------------------------------------------------------------------------
drop table if exists merchant_fields;
create table merchant_fields
(
mid bigint unsigned auto_increment primary key,
field_id varchar(64) not null comment 'field_id',
is_online tinyint default 0 not null comment '上线状态 0下线 1下线',
claim_status tinyint default 0 not null comment '认领状态 0未认领 1已认领 2认领中',
uid varchar(64) default '' not null comment '场地所有者账号',
is_check tinyint default 0 not null comment '审核演出开关 0不审 1审核',
name varchar(255) default '' not null comment '名称',
logo varchar(255) default '' not null comment 'logo图片地址',
background varchar(255) default '' not null comment '背景图片地址',
description text null comment '介绍',
built_date date null comment '建立日期',
province_id varchar(64) default '' not null comment '省份ID',
province_name varchar(255) default '' not null comment '省份名称',
city_id varchar(64) default '' not null comment '城市ID',
city_name varchar(255) default '' not null comment '城市名称',
district_id varchar(64) default '' not null comment '区县ID',
district_name varchar(255) default '' not null comment '区县名称',
address varchar(255) default '' not null comment '详细地址',
longitude varchar(255) default '' not null comment '经度',
latitude varchar(255) default '' not null comment '纬度',
contact_name varchar(255) default '' not null comment '联系人姓名',
contact_email varchar(255) default '' not null comment '联系人邮箱',
company_id varchar(64) default '' not null comment '企业信息ID',
created_at timestamp null,
updated_at timestamp null
) engine=InnoDB default charset=utf8mb4 collate=utf8mb4_unicode_ci comment '场地表';
create index company_id_index on merchant_fields (company_id);
create index field_id_index on merchant_fields (field_id);
create index uid_index on merchant_fields (uid);
-- >>------------------------------------------------------------------------------------
drop table if exists merchant_field_checkers;
create table merchant_field_checkers
(
mid bigint unsigned auto_increment primary key,
field_checker_id varchar(64) not null comment 'field_apply_id',
field_id varchar(64) default '' not null comment '要认领的或创建的场地ID',
uid varchar(64) default '' not null comment '验票员账号',
cuid varchar(64) default '' not null comment '授权人账号',
created_at timestamp null,
updated_at timestamp null
) engine=InnoDB default charset=utf8mb4 collate=utf8mb4_unicode_ci comment '场地默认验票员表';
create index cuid_index on merchant_field_checkers (cuid);
create index field_apply_id_index on merchant_field_checkers (field_checker_id);
create index field_id_index on merchant_field_checkers (field_id);
create index uid_index on merchant_field_checkers (uid);
-- >>------------------------------------------------------------------------------------
drop table if exists merchant_field_applies;
create table merchant_field_applies
(
mid bigint unsigned auto_increment primary key,
field_apply_id varchar(64) not null comment 'field_apply_id',
apply_status tinyint default 0 not null comment '申请状态 0待审核 1通过 2驳回',
apply_type varchar(255) default '' not null comment '类型 claim认领、create创建',
reject varchar(255) default '' not null comment '驳回原因',
uid varchar(64) default '' not null comment '场地申请者账号',
field_id varchar(64) default '' not null comment '要认领的或创建的场地ID',
name varchar(255) default '' not null comment '名称',
logo varchar(255) default '' not null comment 'logo图片地址',
background varchar(255) default '' not null comment '背景图片地址',
description text null comment '介绍',
built_date date null comment '建立日期',
province_id varchar(64) default '' not null comment '省份ID',
province_name varchar(255) default '' not null comment '省份名称',
city_id varchar(64) default '' not null comment '城市ID',
city_name varchar(255) default '' not null comment '城市名称',
district_id varchar(64) default '' not null comment '区县ID',
district_name varchar(255) default '' not null comment '区县名称',
address varchar(255) default '' not null comment '详细地址',
longitude varchar(255) default '' not null comment '经度',
latitude varchar(255) default '' not null comment '纬度',
contact_name varchar(255) default '' not null comment '联系人姓名',
contact_email varchar(255) default '' not null comment '联系人邮箱',
company_name varchar(255) default '' not null comment '企业名称',
license_code varchar(255) default '' not null comment '营业执照编号',
license_img varchar(255) default '' not null comment '营业执照图片地址',
legal_name varchar(255) default '' not null comment '法人姓名',
legal_identity varchar(255) default '' not null comment '法人身份证号码',
legal_identity_obverse varchar(255) default '' not null comment '法人身份证正面照',
legal_identity_reverse varchar(255) default '' not null comment '法人身份证反面照',
deleted_at timestamp null,
created_at timestamp null,
updated_at timestamp null
) engine=InnoDB default charset=utf8mb4 collate=utf8mb4_unicode_ci comment '场地申请表';
create index field_apply_id_index on merchant_field_applies (field_apply_id);
create index field_id_index on merchant_field_applies (field_id);
create index uid_index on merchant_field_applies (uid);
-- >>------------------------------------------------------------------------------------
drop table if exists merchant_sponsors;
create table merchant_sponsors
(
mid bigint unsigned auto_increment primary key,
sponsor_id varchar(64) not null comment 'sponsor_id',
is_online tinyint default 0 not null comment '上线状态 0下线 1下线',
uid varchar(64) default '' not null comment '主办所有者账号',
name varchar(255) default '' not null comment '名称',
logo varchar(255) default '' not null comment 'logo图片地址',
background varchar(255) default '' not null comment '背景图片地址',
description text null comment '介绍',
contact_name varchar(255) default '' not null comment '联系人姓名',
contact_identity varchar(255) default '' not null comment '联系人身份证号码',
contact_identity_obverse varchar(255) default '' not null comment '联系人身份证正面照',
contact_identity_reverse varchar(255) default '' not null comment '联系人身份证反面照',
contact_email varchar(255) default '' not null comment '联系人邮箱',
company_id varchar(64) default '' not null comment '企业信息ID',
created_at timestamp null,
updated_at timestamp null
) engine=InnoDB default charset=utf8mb4 collate=utf8mb4_unicode_ci comment '主办表';
create index company_id_index on merchant_sponsors (company_id);
create index sponsor_id_index on merchant_sponsors (sponsor_id);
create index uid_index on merchant_sponsors (uid);
-- >>------------------------------------------------------------------------------------
drop table if exists merchant_sponsor_applies;
create table merchant_sponsor_applies
(
mid bigint unsigned auto_increment primary key,
sponsor_apply_id varchar(64) not null comment 'sponsor_apply_id',
apply_status tinyint default 0 not null comment '申请状态 0待审核 1通过 2驳回',
apply_type varchar(255) default '' not null comment '类型 create创建',
reject varchar(255) default '' not null comment '驳回原因',
uid varchar(64) default '' not null comment '场地申请者账号',
name varchar(255) default '' not null comment '名称',
logo varchar(255) default '' not null comment 'logo图片地址',
background varchar(255) default '' not null comment '背景图片地址',
description text null comment '介绍',
contact_name varchar(255) default '' not null comment '联系人姓名',
contact_identity varchar(255) default '' not null comment '联系人身份证号码',
contact_identity_obverse varchar(255) default '' not null comment '联系人身份证正面照',
contact_identity_reverse varchar(255) default '' not null comment '联系人身份证反面照',
contact_email varchar(255) default '' not null comment '联系人邮箱',
company_name varchar(255) default '' not null comment '企业名称',
license_code varchar(255) default '' not null comment '营业执照编号',
license_img varchar(255) default '' not null comment '营业执照图片地址',
legal_name varchar(255) default '' not null comment '法人姓名',
legal_identity varchar(255) default '' not null comment '法人身份证号码',
legal_identity_obverse varchar(255) default '' not null comment '法人身份证正面照',
legal_identity_reverse varchar(255) default '' not null comment '法人身份证反面照',
deleted_at timestamp null,
created_at timestamp null,
updated_at timestamp null
) engine=InnoDB default charset=utf8mb4 collate=utf8mb4_unicode_ci comment '主办申请表';
create index sponsor_apply_id_index on merchant_sponsor_applies (sponsor_apply_id);
create index uid_index on merchant_sponsor_applies (uid);
-- >>------------------------------------------------------------------------------------
drop table if exists merchant_companies;
create table merchant_companies
(
mid bigint unsigned auto_increment primary key,
company_id varchar(64) not null comment 'company_id',
name varchar(255) default '' not null comment '企业名称',
license_code varchar(255) default '' not null comment '营业执照编号',
license_img varchar(255) default '' not null comment '营业执照图片地址',
legal_name varchar(255) default '' not null comment '法人姓名',
legal_identity varchar(255) default '' not null comment '法人身份证号码',
legal_identity_obverse varchar(255) default '' not null comment '法人身份证正面照',
legal_identity_reverse varchar(255) default '' not null comment '法人身份证反面照',
created_at timestamp null,
updated_at timestamp null
) engine=InnoDB default charset=utf8mb4 collate=utf8mb4_unicode_ci comment '公司表';
create index company_id_index on merchant_companies (company_id);
-- >>------------------------------------------------------------------------------------
drop table if exists merchant_authorization_records;
create table merchant_authorization_records
(
mid bigint unsigned auto_increment primary key,
authorization_record_id varchar(64) not null comment 'authorization_record_id',
performance_id varchar(64) not null comment '演出ID',
uid_role varchar(255) default '' not null comment '权利人演出角色[creator|sponsor|fielder|checker]',
uid varchar(64) not null comment '权利人',
cuid_role varchar(255) default '' not null comment '授权人演出角色[creator|sponsor|fielder]',
cuid varchar(64) not null comment '授权人',
start_time datetime null comment '授权开始时间',
end_time datetime null comment '授权结束时间',
deleted_at timestamp null,
created_at timestamp null,
updated_at timestamp null
) engine=InnoDB default charset=utf8mb4 collate=utf8mb4_unicode_ci comment '演出授权记录表';
create index authorization_record_id_index on merchant_authorization_records (authorization_record_id);
create index cuid_index on merchant_authorization_records (cuid);
create index cuid_role_index on merchant_authorization_records (cuid_role);
create index performance_id_index on merchant_authorization_records (performance_id);
create index uid_index on merchant_authorization_records (uid);
create index uid_role_index on merchant_authorization_records (uid_role);
-- >>------------------------------------------------------------------------------------
drop table if exists merchant_permissions;
create table merchant_permissions
(
mid bigint unsigned auto_increment primary key,
permission_id varchar(64) not null comment 'permission_id',
name varchar(255) not null comment '名称',
created_at timestamp null,
updated_at timestamp null
) engine=InnoDB default charset=utf8mb4 collate=utf8mb4_unicode_ci comment '演出权限表';
create index permission_id_index on merchant_permissions (permission_id);
-- >>------------------------------------------------------------------------------------
drop table if exists merchant_authorization_permissions;
create table merchant_authorization_permissions
(
mid bigint unsigned auto_increment primary key,
authorization_permission_id varchar(64) not null comment 'authorization_permission_id',
authorization_record_id varchar(64) not null comment 'authorization_record_id',
permission_id varchar(64) not null comment 'permission_id',
created_at timestamp null,
updated_at timestamp null
) engine=InnoDB default charset=utf8mb4 collate=utf8mb4_unicode_ci comment '演出授权关联权限表';
create index authorization_permission_id_index on merchant_authorization_permissions (authorization_permission_id);
create index authorization_record_id_index on merchant_authorization_permissions (authorization_record_id);
create index permission_id_index on merchant_authorization_permissions (permission_id);
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
package com.liquidnet.service;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import java.util.ArrayList;
import java.util.List;
public class MybatisPlusCodeGenerator {
/**
* @param moduleRootPath 项目模块根路径 到 /src 之前 ex:E:\projects\trlabs-bus-v1\trlabs-bus-service\trlabs-common\trlabs-mybatis
* @param dsc 数据源
* @param parentName 相当于业务模块名 com.liquidnet.service.merchant 全限定类名
* @param tableNames 表名
*/
public static void doGenerator(String moduleRootPath,
DataSourceConfig dsc,
String parentName,
String[] tableNames) {
AutoGenerator mpg = new AutoGenerator();
// 全局配置BankMybatisPlusCodeGenerator
GlobalConfig gc = new GlobalConfig();
gc.setOutputDir(moduleRootPath + "/src/main/java");
gc.setAuthor("liquidnet");
gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg.setGlobalConfig(gc);
// 数据源配置
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setParent(parentName);
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
return moduleRootPath + "/src/main/resources/com/liquidnet/service/merchant/mapper/" + pc.getModuleName()
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
strategy.setInclude(tableNames);
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix(pc.getModuleName() + "_");
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
public static void main(String[] args) {
DataSourceConfig dsc = new DataSourceConfig();
// dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUrl("jdbc:mysql://39.106.122.201:3308/dev_ln_scene?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=CST");
dsc.setUsername("testmall");
dsc.setPassword("zhengzai!mYT");
String resourcePath = "/Users/Tice/Downloads/tmp";
String directory = "com.liquidnet.service.merchant";
String[] dbTableArray = new String[]{
"merchant_fields",
"merchant_field_checkers",
"merchant_field_applies",
"merchant_companies",
"merchant_sponsors",
"merchant_sponsor_applies",
"merchant_authorization_records",
"merchant_permissions",
"merchant_authorization_permissions"
};
doGenerator(resourcePath, dsc, directory, dbTableArray);
}
}
package com.liquidnet.service.merchant.controller;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 场地表 前端控制器
* </p>
*
* @author liquidnet
* @since 2021-11-01
*/
@Api(tags = "场地")
@Slf4j
@Validated
@RestController
@RequestMapping("fields")
public class MerchantFieldsController {
}
package com.liquidnet.service.merchant.service;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.merchant.constant.MerchantRedisConst;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsAppliesVo;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo;
import com.liquidnet.service.merchant.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
public class MerchantRdmService {
@Autowired
RedisUtil redisUtil;
public MerchantFieldsVo getFieldsVoByFieldId(String fieldId) {
String key = MerchantRedisConst.INFO_FIELD.concat(fieldId);
long s = System.currentTimeMillis();
MerchantFieldsVo vo = (MerchantFieldsVo) redisUtil.get(key);
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
return vo;
}
public boolean setFieldsVoByFieldId(String fieldId, MerchantFieldsVo vo) {
return redisUtil.set(MerchantRedisConst.INFO_FIELD.concat(fieldId), vo);
}
public List<MerchantFieldsAppliesVo> getFieldsAppliesVosByUid(String uid) {
String key = MerchantRedisConst.INFO_FIELD_APPLIES.concat(uid);
long s = System.currentTimeMillis();
List<MerchantFieldsAppliesVo> vos = (List<MerchantFieldsAppliesVo>) redisUtil.get(key);
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
return vos;
}
public boolean addFieldsAppliesVoByUid(String uid, List<MerchantFieldsAppliesVo> vos, MerchantFieldsAppliesVo vo) {
if (null == vos) {
vos = ObjectUtil.getMerchantFieldsAppliesVoArrayList();
}
vos.add(vo);
return redisUtil.set(MerchantRedisConst.INFO_FIELD_APPLIES.concat(uid), vos);
}
}
package com.liquidnet.service.merchant.service.impl;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.merchant.dto.param.MerchantFieldsApplyParam;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsAppliesVo;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo;
import com.liquidnet.service.merchant.service.IMerchantFieldsAppliesService;
import com.liquidnet.service.merchant.service.MerchantRdmService;
import com.liquidnet.service.merchant.util.QueueUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.List;
@Slf4j
@Service
public class MerchantFieldsAppliesServiceImpl implements IMerchantFieldsAppliesService {
@Autowired
MerchantRdmService merchantRdmService;
@Autowired
QueueUtil queueUtils;
@Override
public PagedResult<MerchantFieldsVo> search(String name) {
return null;
}
@Override
public String apply(MerchantFieldsApplyParam parameter) {
String currentUid = CurrentUtil.getCurrentUid();
LocalDateTime now = LocalDateTime.now();
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
LinkedList<Object[]> fieldApplyInsertObjs = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> fieldUpdateObjs = CollectionUtil.linkedListObjectArr();
long s = System.currentTimeMillis();
// 若认领,查询验证场地
MerchantFieldsVo fieldsVo = null;
if (!parameter.getFieldId().isEmpty()) {
fieldsVo = merchantRdmService.getFieldsVoByFieldId(parameter.getFieldId());
if (null == fieldsVo) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10601");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
if (0 != fieldsVo.getClaimStatus()) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10602");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
// 更改场地状态
fieldsVo.setClaimStatus(2);
fieldsVo.setUpdatedAt(now);
// redis
s = System.currentTimeMillis();
merchantRdmService.setFieldsVoByFieldId(fieldsVo.getFieldId(), fieldsVo);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
}
// 申请场地 上限
List<MerchantFieldsAppliesVo> fieldsAppliesVos = merchantRdmService.getFieldsAppliesVosByUid(currentUid);
if (!CollectionUtils.isEmpty(fieldsAppliesVos)) {
if (fieldsAppliesVos.size() >= 10) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10603");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
}
// 申请场地vo
MerchantFieldsAppliesVo fieldsAppliesVo = MerchantFieldsAppliesVo.getNew();
BeanUtils.copyProperties(parameter, fieldsAppliesVo);
fieldsAppliesVo.setFieldApplyId(IDGenerator.nextSnowId());
fieldsAppliesVo.setApplyStatus(0);
if (!fieldsAppliesVo.getFieldId().isEmpty()) {
fieldsAppliesVo.setApplyType("claim");
} else {
fieldsAppliesVo.setApplyType("create");
}
fieldsAppliesVo.setReject("");
fieldsAppliesVo.setUid(currentUid);
fieldsAppliesVo.setCreatedAt(now);
// redis
s = System.currentTimeMillis();
merchantRdmService.addFieldsAppliesVoByUid(currentUid, fieldsAppliesVos, fieldsAppliesVo);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
// sql mapping
if (null != fieldsVo) {
toMqSqls.add(SqlMapping.get("merchant_fields.update_claim_status"));
fieldUpdateObjs.add(new Object[]{
fieldsVo.getClaimStatus(), fieldsVo.getUpdatedAt(), fieldsVo.getFieldId()
});
}
toMqSqls.add(SqlMapping.get("merchant_field_applies.insert"));
fieldApplyInsertObjs.add(new Object[]{
fieldsAppliesVo.getFieldApplyId(), fieldsAppliesVo.getApplyStatus(), fieldsAppliesVo.getApplyType(), fieldsAppliesVo.getReject(), fieldsAppliesVo.getUid(), fieldsAppliesVo.getFieldId(),
fieldsAppliesVo.getName(), fieldsAppliesVo.getLogo(), fieldsAppliesVo.getBackground(), fieldsAppliesVo.getDescription(), fieldsAppliesVo.getBuiltDate(),
fieldsAppliesVo.getProvinceId(), fieldsAppliesVo.getProvinceName(), fieldsAppliesVo.getCityId(), fieldsAppliesVo.getCityName(), fieldsAppliesVo.getDistrictId(), fieldsAppliesVo.getDistrictName(), fieldsAppliesVo.getAddress(), fieldsAppliesVo.getLongitude(), fieldsAppliesVo.getLatitude(),
fieldsAppliesVo.getContactName(), fieldsAppliesVo.getContactEmail(), fieldsAppliesVo.getCompanyName(), fieldsAppliesVo.getLicenseCode(), fieldsAppliesVo.getLicenseImg(),
fieldsAppliesVo.getLegalName(), fieldsAppliesVo.getLegalIdentity(), fieldsAppliesVo.getLegalIdentityObverse(), fieldsAppliesVo.getLegalIdentityReverse(), fieldsAppliesVo.getCreatedAt()
});
s = System.currentTimeMillis();
if (null != fieldsVo) {
queueUtils.sendMsgByRedis(
MQConst.MerchantQueue.SQL_MERCHANT_FIELD.getKey(),
SqlMapping.gets(toMqSqls, fieldUpdateObjs, fieldApplyInsertObjs)
);
} else {
queueUtils.sendMsgByRedis(
MQConst.MerchantQueue.SQL_MERCHANT_FIELD.getKey(),
SqlMapping.gets(toMqSqls, fieldApplyInsertObjs)
);
}
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
return fieldsAppliesVo.getFieldId();
}
}
package com.liquidnet.service.merchant.util;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsAppliesVo;
import java.util.ArrayList;
public class ObjectUtil {
private static final ArrayList<MerchantFieldsAppliesVo> merchantFieldsAppliesVoArrayList = new ArrayList<>();
public static ArrayList<MerchantFieldsAppliesVo> getMerchantFieldsAppliesVoArrayList() {
return (ArrayList<MerchantFieldsAppliesVo>) merchantFieldsAppliesVoArrayList.clone();
}
}
package com.liquidnet.service.merchant.util;
import com.liquidnet.commons.lang.util.CollectionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Component
public class QueueUtil {
@Autowired
StringRedisTemplate stringRedisTemplate;
/**
* 发送消息 - REDIS
*
* @param streamKey Redis消费Key
* @param jsonMsg Json字符串
*/
public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
}
}
......@@ -75,5 +75,7 @@
10505=会员订单回调处理异常
10601=场地不存在,请核实
10602=场地已被认领
10603=场地申请已达到上限
# -- 使用券 --
candy_coupon.use=UPDATE candy_user_coupon SET state = 5 ,used_at = ? , used_for = ? WHERE uid = ? AND ucoupon_id = ?
#candy_coupon.use_insert=INSERT INTO candy_user_coupon (ucoupon_id , uid , state , coupon_id , used_at , used_for ) VALUE ( ? , ? , 3 , ? , ? ,? )
candy_coupon.use_insert=INSERT INTO candy_user_coupon (ucoupon_id , uid , state , coupon_id , bind_at, dued_at, used_at , used_for, created_at) VALUE ( ? , ? , 5 , ? , ? , ?, ?, ?, ?)
# -- 回退券 --
candy_coupon.back=UPDATE candy_user_coupon SET state = 1 WHERE uid = ? AND ucoupon_id = ?
# -- 领取券 --
candy_coupon.receive=INSERT INTO candy_user_coupon (ucoupon_id , uid , state , coupon_id , ccode , bind_at , created_at , dued_at) VALUE ( ? , ? , ? , ? , ? , ? , ? , ?)
candy_coupon_code.receive=UPDATE candy_coupon_code SET state=?,ucoupon_id=?,redeem_uid=?,redeem_mobile=?,redeem_at=?,updated_at=? WHERE coupon_id=? AND ccode=?
# ---------------------------------------------------------------------------------------------------------------------
merchant_fields.update_claim_status=UPDATE merchant_fields SET claim_status = ?, updated_at = ? WHERE field_id = ?
# ---------------------------------------------------------------------------------------------------------------------
merchant_field_applies.insert=INSERT INTO merchant_field_applies (field_apply_id, apply_status, apply_type, reject, uid, field_id, name, logo, background, description, built_date, province_id, province_name, city_id, city_name, district_id, district_name, address, longitude, latitude, contact_name, contact_email, company_name, license_code, license_img, legal_name, legal_identity, legal_identity_obverse, legal_identity_reverse, created_at) VALUE (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment