release: 门店新增折扣字段

release-2024-04-25
huangyw 3 months ago
parent efb5dcbebd
commit 31820375f1

@ -65,4 +65,10 @@ public class StoreAddDto implements Serializable {
@ApiModelProperty(value = "编码")
private String code;
@ApiModelProperty(value = "折扣")
private String discount;
@ApiModelProperty(value = "折扣描述")
private String discountDescription;
}

@ -69,4 +69,10 @@ public class StoreUpdateDto implements Serializable {
@ApiModelProperty(value = "编码")
private String code;
@ApiModelProperty(value = "折扣")
private String discount;
@ApiModelProperty(value = "折扣描述")
private String discountDescription;
}

@ -92,4 +92,12 @@ public class Store extends JPABasePojo {
@ApiModelProperty(value = "编码")
private String code;
@Column(name = "discount")
@ApiModelProperty(value = "折扣")
private String discount;
@Column(name = "discount_description")
@ApiModelProperty(value = "折扣描述")
private String discountDescription;
}

@ -129,7 +129,9 @@ public class StoreService {
qUserInfo.nickName.as("contactNickName"),
qStore.visitCount,
qStore.introduction,
qStore.code
qStore.code,
qStore.discount,
qStore.discountDescription
)).from(qStore)
.leftJoin(qUserInfo)
.on(qStore.contact.eq(qUserInfo.id))
@ -137,8 +139,6 @@ public class StoreService {
(qStore.id.eq(id))
.and(qStore.status.eq(StoreEnums.STORE_STATUS_COOPERATION.getCode())))
.fetchOne();
assert storeAppVO != null;
storeAppVO.setDiscount(100 * envConfig.getPermanentMemberDiscount());
return storeAppVO;
}
@ -175,7 +175,9 @@ public class StoreService {
qUserInfo.avatar.as("contactAvatar"),
qUserInfo.nickName.as("contactNickName"),
qStore.introduction,
qStore.code
qStore.code,
qStore.discount,
qStore.discountDescription
)).from(qStore)
.leftJoin(qUserInfo)
.on(qStore.contact.eq(qUserInfo.id))
@ -265,11 +267,6 @@ public class StoreService {
// return o1.getDistance().compareTo(o2.getDistance());
// });
// redisTemplate.delete(String.valueOf(uuid));
for (StoreAppVO storeAppVO : storeList) {
storeAppVO.setDiscount(100 * envConfig.getPermanentMemberDiscount());
}
return storeList;
}

@ -82,17 +82,15 @@ public class StoreAppVO implements Serializable {
private String code;
@ApiModelProperty(value = "折扣")
private Float discount;
private String discount;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "折扣描述")
private String discountDescription;
public StoreAppVO() {
}
public StoreAppVO(String id, String name, Integer regionId, String address, String lng, String lat, String contact, String phone, String tel, String openingHours, String background, String description, String contactAvatar, String contactNickName, Integer visitCount, String introduction, String code, Float discount) {
public StoreAppVO(String id, String name, Integer regionId, String address, String lng, String lat, String contact, String phone, String tel, String openingHours, String background, String description, String contactAvatar, String contactNickName, Integer visitCount, String introduction, String code, String discount, String discountDescription) {
this.id = id;
this.name = name;
this.regionId = regionId;
@ -111,44 +109,7 @@ public class StoreAppVO implements Serializable {
this.introduction = introduction;
this.code = code;
this.discount = discount;
}
public StoreAppVO(String id, String name, Integer regionId, String address, String lng, String lat, String contact, String phone, String tel, String openingHours, String background, String description, String contactAvatar, String contactNickName, Integer visitCount, String introduction, String code) {
this.id = id;
this.name = name;
this.regionId = regionId;
this.address = address;
this.lng = lng;
this.lat = lat;
this.contact = contact;
this.phone = phone;
this.tel = tel;
this.openingHours = openingHours;
this.background = background;
this.description = description;
this.contactAvatar = contactAvatar;
this.contactNickName = contactNickName;
this.visitCount = visitCount;
this.introduction = introduction;
this.code = code;
}
public StoreAppVO(String id, String name, Integer regionId, String address, String lng, String lat, String contact, String phone, String tel, String openingHours, String background, String description, Integer visitCount, String introduction, String code) {
this.id = id;
this.name = name;
this.regionId = regionId;
this.address = address;
this.lng = lng;
this.lat = lat;
this.contact = contact;
this.phone = phone;
this.tel = tel;
this.openingHours = openingHours;
this.background = background;
this.description = description;
this.visitCount = visitCount;
this.introduction = introduction;
this.code = code;
this.discountDescription = discountDescription;
}
}

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.luoo.user.pojo.Region;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Value;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Column;
@ -83,33 +82,19 @@ public class StorePCVO implements Serializable {
@ApiModelProperty(value = "编码")
private String code;
@ApiModelProperty(value = "折扣")
private String discount;
@ApiModelProperty(value = "折扣描述")
private String discountDescription;
@Transient
Region region;
public StorePCVO() {
}
public StorePCVO(String id, String name, Integer regionId, String address, String lng, String lat, String contact, String phone, String tel, String openingHours, String background, String description, LocalDateTime createTime, Integer status, Integer visitCount, String introduction, String code) {
this.id = id;
this.name = name;
this.regionId = regionId;
this.address = address;
this.lng = lng;
this.lat = lat;
this.contact = contact;
this.phone = phone;
this.tel = tel;
this.openingHours = openingHours;
this.background = background;
this.description = description;
this.createTime = createTime;
this.status = status;
this.visitCount = visitCount;
this.introduction = introduction;
this.code = code;
}
public StorePCVO(String id, String name, Integer regionId, String address, String lng, String lat, String contact, String phone, String tel, String openingHours, String background, String description, LocalDateTime createTime, Integer status, Integer visitCount, String contactAvatar, String contactNickName, String introduction, String code) {
public StorePCVO(String id, String name, Integer regionId, String address, String lng, String lat, String contact, String phone, String tel, String openingHours, String background, String description, LocalDateTime createTime, Integer status, Integer visitCount, String contactAvatar, String contactNickName, String introduction, String code, String discount, String discountDescription) {
this.id = id;
this.name = name;
this.regionId = regionId;
@ -129,5 +114,7 @@ public class StorePCVO implements Serializable {
this.contactNickName = contactNickName;
this.introduction = introduction;
this.code = code;
this.discount = discount;
this.discountDescription = discountDescription;
}
}

@ -23,6 +23,8 @@
<result property="visitCount" column="visit_count" jdbcType="INTEGER"/>
<result property="introduction" column="introduction" jdbcType="VARCHAR"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="discount" column="discount" jdbcType="VARCHAR"/>
<result property="discountDescription" column="discount_description" jdbcType="VARCHAR"/>
</resultMap>
@ -43,6 +45,8 @@
t1.visit_count,
t1.introduction,
t1.code, t2.avatar contact_avatar, t2.nick_name contact_nick_name,
t1.discount,
t1.discount_description,
st_distance_sphere(point(lng, lat), point(#{storeSearchDto.lng}, #{storeSearchDto.lat})) as distance
FROM tb_store t1
left join tb_user_info t2

@ -4,3 +4,8 @@ alter table tb_store
alter table tb_store
add code varchar(20) null comment '编码';
alter table tb_store
add discount varchar(10) null comment '折扣';
alter table tb_store
add discount_description varchar(255) null comment '折扣描述';

Loading…
Cancel
Save