release: 门店新增折扣字段

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

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

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

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

@ -82,17 +82,15 @@ public class StoreAppVO implements Serializable {
private String code; private String code;
@ApiModelProperty(value = "折扣") @ApiModelProperty(value = "折扣")
private Float discount; private String discount;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @ApiModelProperty(value = "折扣描述")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private String discountDescription;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
public StoreAppVO() { 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.id = id;
this.name = name; this.name = name;
this.regionId = regionId; this.regionId = regionId;
@ -111,44 +109,7 @@ public class StoreAppVO implements Serializable {
this.introduction = introduction; this.introduction = introduction;
this.code = code; this.code = code;
this.discount = discount; this.discount = discount;
} this.discountDescription = discountDescription;
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;
} }
} }

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.luoo.user.pojo.Region; import com.luoo.user.pojo.Region;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.Value;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Column; import javax.persistence.Column;
@ -83,33 +82,19 @@ public class StorePCVO implements Serializable {
@ApiModelProperty(value = "编码") @ApiModelProperty(value = "编码")
private String code; private String code;
@ApiModelProperty(value = "折扣")
private String discount;
@ApiModelProperty(value = "折扣描述")
private String discountDescription;
@Transient @Transient
Region region; Region region;
public StorePCVO() { 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) { 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;
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) {
this.id = id; this.id = id;
this.name = name; this.name = name;
this.regionId = regionId; this.regionId = regionId;
@ -129,5 +114,7 @@ public class StorePCVO implements Serializable {
this.contactNickName = contactNickName; this.contactNickName = contactNickName;
this.introduction = introduction; this.introduction = introduction;
this.code = code; this.code = code;
this.discount = discount;
this.discountDescription = discountDescription;
} }
} }

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

@ -4,3 +4,8 @@ alter table tb_store
alter table tb_store alter table tb_store
add code varchar(20) null comment '编码'; 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