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

Commit 9da7f8c0 authored by 张国柄's avatar 张国柄

~API:收货地址扩展(Param\Vo\Entity\Table);

parent 62ba604e
...@@ -24,14 +24,20 @@ public class AdamAddressesParam implements java.io.Serializable { ...@@ -24,14 +24,20 @@ public class AdamAddressesParam implements java.io.Serializable {
@Pattern(regexp = LnsRegex.Valid.CN_PCD, message = "省份必须为2~30位汉字") @Pattern(regexp = LnsRegex.Valid.CN_PCD, message = "省份必须为2~30位汉字")
@NotBlank(message = "省份不能为空") @NotBlank(message = "省份不能为空")
private String province; private String province;
@ApiModelProperty(position = 14, required = true, value = "城市[30]", example = "北京城区") @ApiModelProperty(position = 14, required = false, value = "省份行政编码[20]", example = "110000")
private String provinceId;
@ApiModelProperty(position = 15, required = true, value = "城市[30]", example = "北京城区")
@Pattern(regexp = LnsRegex.Valid.CN_PCD, message = "城市必须为2~30位汉字") @Pattern(regexp = LnsRegex.Valid.CN_PCD, message = "城市必须为2~30位汉字")
@NotBlank(message = "城市不能为空") @NotBlank(message = "城市不能为空")
private String city; private String city;
@ApiModelProperty(position = 16, required = false, value = "城市行政编码[20]", example = "110100")
private String cityId;
@ApiModelProperty(position = 15, required = true, value = "区县[30]", example = "朝阳区") @ApiModelProperty(position = 15, required = true, value = "区县[30]", example = "朝阳区")
@Pattern(regexp = LnsRegex.Valid.CN_PCD, message = "区县必须为2~30位汉字") @Pattern(regexp = LnsRegex.Valid.CN_PCD, message = "区县必须为2~30位汉字")
@NotBlank(message = "区县不能为空") @NotBlank(message = "区县不能为空")
private String county; private String county;
@ApiModelProperty(position = 15, required = false, value = "区县行政编码[20]", example = "110101")
private String countyId;
@ApiModelProperty(position = 16, required = true, value = "详细地址[100]", example = "广渠路1号创1958园区") @ApiModelProperty(position = 16, required = true, value = "详细地址[100]", example = "广渠路1号创1958园区")
@Size(max = 100, message = "已超出详细地址长度限制") @Size(max = 100, message = "已超出详细地址长度限制")
private String address; private String address;
......
package com.liquidnet.service.adam.dto.vo; package com.liquidnet.service.adam.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.SensitizeUtil;
import com.liquidnet.service.adam.entity.AdamAddresses; import com.liquidnet.service.adam.entity.AdamAddresses;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -11,6 +11,7 @@ import lombok.Data; ...@@ -11,6 +11,7 @@ import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel(value = "AdamAddressesVo", description = "收获地址") @ApiModel(value = "AdamAddressesVo", description = "收获地址")
@JsonIgnoreProperties(value = {"uid", "town", "townId", "fullAddress", "state", "createdAt", "updatedAt", "deletedAt"})
@Data @Data
public class AdamAddressesVo implements java.io.Serializable, Cloneable { public class AdamAddressesVo implements java.io.Serializable, Cloneable {
private static final long serialVersionUID = -3096308044365829079L; private static final long serialVersionUID = -3096308044365829079L;
...@@ -18,21 +19,35 @@ public class AdamAddressesVo implements java.io.Serializable, Cloneable { ...@@ -18,21 +19,35 @@ public class AdamAddressesVo implements java.io.Serializable, Cloneable {
private String addressesId; private String addressesId;
@ApiModelProperty(position = 11, value = "用户ID[64]") @ApiModelProperty(position = 11, value = "用户ID[64]")
private String uid; private String uid;
@ApiModelProperty(position = 11, value = "姓名[30]") @ApiModelProperty(position = 12, value = "姓名[30]")
private String name; private String name;
@ApiModelProperty(position = 12, value = "手机号[11]") @ApiModelProperty(position = 13, value = "手机号[11]")
private String phone; private String phone;
@ApiModelProperty(position = 13, value = "省份[30]") @ApiModelProperty(position = 14, value = "邮编[10]")
private String zipcode;
@ApiModelProperty(position = 15, value = "省份[30]")
private String province; private String province;
@ApiModelProperty(position = 14, value = "城市[30]") @ApiModelProperty(position = 16, value = "省份行政编码[20]")
private String provinceId;
@ApiModelProperty(position = 17, value = "城市[30]")
private String city; private String city;
@ApiModelProperty(position = 15, value = "区县[30]") @ApiModelProperty(position = 18, value = "城市行政编码[20]")
private String cityId;
@ApiModelProperty(position = 19, value = "区县[30]")
private String county; private String county;
@ApiModelProperty(position = 16, value = "详细地址[100]") @ApiModelProperty(position = 20, value = "区县行政编码[20]")
private String countyId;
@ApiModelProperty(position = 21, value = "街道/镇[30]")
private String town;
@ApiModelProperty(position = 22, value = "街道行政编码[20]")
private String townId;
@ApiModelProperty(position = 23, value = "详细地址[100]")
private String address; private String address;
@ApiModelProperty(position = 17, value = "是否为默认:0-否,1-是") @ApiModelProperty(position = 24, value = "详细地址[100]")
private String fullAddress;
@ApiModelProperty(position = 25, value = "是否为默认:0-否,1-是")
private Boolean isDefault; private Boolean isDefault;
@ApiModelProperty(position = 18, value = "状态:0-INIT,1-NORMAL,2-INVALID") @ApiModelProperty(position = 26, value = "状态:0-INIT,1-NORMAL,2-INVALID")
private Integer state; private Integer state;
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern=DateUtil.DATE_FULL_STR) @JsonFormat(shape=JsonFormat.Shape.STRING, pattern=DateUtil.DATE_FULL_STR)
private LocalDateTime createdAt; private LocalDateTime createdAt;
...@@ -47,9 +62,8 @@ public class AdamAddressesVo implements java.io.Serializable, Cloneable { ...@@ -47,9 +62,8 @@ public class AdamAddressesVo implements java.io.Serializable, Cloneable {
try { try {
return (AdamAddressesVo) obj.clone(); return (AdamAddressesVo) obj.clone();
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
e.printStackTrace(); return new AdamAddressesVo();
} }
return new AdamAddressesVo();
} }
public AdamAddressesVo copy(AdamAddresses source) { public AdamAddressesVo copy(AdamAddresses source) {
...@@ -58,10 +72,17 @@ public class AdamAddressesVo implements java.io.Serializable, Cloneable { ...@@ -58,10 +72,17 @@ public class AdamAddressesVo implements java.io.Serializable, Cloneable {
this.setUid(source.getUid()); this.setUid(source.getUid());
this.setName(source.getName()); this.setName(source.getName());
this.setPhone(source.getPhone()); this.setPhone(source.getPhone());
this.setZipcode(source.getZipcode());
this.setProvince(source.getProvince()); this.setProvince(source.getProvince());
this.setProvinceId(source.getProvinceId());
this.setCity(source.getCity()); this.setCity(source.getCity());
this.setCityId(source.getCityId());
this.setCounty(source.getCounty()); this.setCounty(source.getCounty());
this.setCountyId(source.getCountyId());
this.setTown(source.getTown());
this.setTownId(source.getTownId());
this.setAddress(source.getAddress()); this.setAddress(source.getAddress());
this.setFullAddress(source.getFullAddress());
this.setIsDefault(source.getIsDefault()); this.setIsDefault(source.getIsDefault());
this.setState(source.getState()); this.setState(source.getState());
this.setCreatedAt(source.getCreatedAt()); this.setCreatedAt(source.getCreatedAt());
......
...@@ -39,26 +39,61 @@ public class AdamAddresses implements Serializable { ...@@ -39,26 +39,61 @@ public class AdamAddresses implements Serializable {
*/ */
private String phone; private String phone;
/**
* 邮编
*/
private String zipcode;
/** /**
* 省份 * 省份
*/ */
private String province; private String province;
/**
* 省份行政编码
*/
private String provinceId;
/** /**
* 城市 * 城市
*/ */
private String city; private String city;
/**
* 城市行政编码
*/
private String cityId;
/** /**
* 区县 * 区县
*/ */
private String county; private String county;
/**
* 区县行政编码
*/
private String countyId;
/**
* 街道/镇
*/
private String town;
/**
* 街道行政编码
*/
private String townId;
/** /**
* 详细地址 * 详细地址
*/ */
private String address; private String address;
/**
* 完整地址
*/
private String fullAddress;
/** /**
* 是否为默认:0-否,1-是,第一个默认1 * 是否为默认:0-否,1-是,第一个默认1
*/ */
......
...@@ -489,7 +489,16 @@ create table adam_user_mobile_locate ...@@ -489,7 +489,16 @@ create table adam_user_mobile_locate
create unique index uidx_auser_mobile_locate_id on adam_user_mobile_locate (uid); create unique index uidx_auser_mobile_locate_id on adam_user_mobile_locate (uid);
-- >>------------------------------------------------------------------------------------ |20211105用户常驻地统一 -- >>------------------------------------------------------------------------------------ |20211105用户常驻地统一
alter table adam_user_mobile_locate add county varchar(50) null comment '区县' after city; alter table adam_user_mobile_locate add county varchar(50) null comment '区县' after city;
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------ |20211130收货地址扩展
# 老数据`address`长度>=255的手工处理
alter table adam_addresses add zipcode varchar(10) null comment '邮编' after phone;
alter table adam_addresses add province_id varchar(20) null comment '省份行政编码' after province;
alter table adam_addresses add city_id varchar(20) null comment '城市行政编码' after city;
alter table adam_addresses add county_id varchar(20) null comment '区县行政编码' after county;
alter table adam_addresses add town varchar(50) null comment '街道/镇' after county_id;
alter table adam_addresses add town_id varchar(20) null comment '街道行政编码' after town;
alter table adam_addresses modify address varchar(255) not null comment '详细地址';
alter table adam_addresses add full_address varchar(500) null comment '完整地址' after address;
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
...@@ -64,7 +64,9 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService { ...@@ -64,7 +64,9 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
queueUtils.sendMsgByRedis( queueUtils.sendMsgByRedis(
MQConst.AdamQueue.SQL_UCENTER.getKey(), MQConst.AdamQueue.SQL_UCENTER.getKey(),
SqlMapping.get("adam_addresses.add", SqlMapping.get("adam_addresses.add",
vo.getAddressesId(), vo.getUid(), vo.getName(), vo.getPhone(), vo.getProvince(), vo.getCity(), vo.getCounty(), vo.getAddress(), vo.getIsDefault(), vo.getState(), now vo.getAddressesId(), vo.getUid(), vo.getName(), vo.getPhone(),
vo.getProvince(), vo.getProvinceId(), vo.getCity(), vo.getCityId(),
vo.getCounty(), vo.getCountyId(), vo.getAddress(), vo.getIsDefault(), vo.getState(), now
) )
); );
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s); log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
...@@ -121,8 +123,11 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService { ...@@ -121,8 +123,11 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
updateVo.setName(parameter.getName()); updateVo.setName(parameter.getName());
updateVo.setPhone(parameter.getPhone()); updateVo.setPhone(parameter.getPhone());
updateVo.setProvince(parameter.getProvince()); updateVo.setProvince(parameter.getProvince());
updateVo.setProvinceId(parameter.getProvinceId());
updateVo.setCity(parameter.getCity()); updateVo.setCity(parameter.getCity());
updateVo.setCityId(parameter.getCityId());
updateVo.setCounty(parameter.getCounty()); updateVo.setCounty(parameter.getCounty());
updateVo.setCountyId(parameter.getCountyId());
updateVo.setAddress(parameter.getAddress()); updateVo.setAddress(parameter.getAddress());
updateVo.setUpdatedAt(now); updateVo.setUpdatedAt(now);
long s = System.currentTimeMillis(); long s = System.currentTimeMillis();
...@@ -133,7 +138,9 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService { ...@@ -133,7 +138,9 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
queueUtils.sendMsgByRedis( queueUtils.sendMsgByRedis(
MQConst.AdamQueue.SQL_UCENTER.getKey(), MQConst.AdamQueue.SQL_UCENTER.getKey(),
SqlMapping.get("adam_addresses.edit", SqlMapping.get("adam_addresses.edit",
updateVo.getName(), updateVo.getPhone(), updateVo.getProvince(), updateVo.getCity(), updateVo.getCounty(), updateVo.getAddress(), now, updateVo.getAddressesId() updateVo.getName(), updateVo.getPhone(), updateVo.getProvince(), updateVo.getProvinceId(),
updateVo.getCity(), updateVo.getCityId(), updateVo.getCounty(), updateVo.getCountyId(),
updateVo.getAddress(), now, updateVo.getAddressesId()
) )
); );
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s); log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
......
...@@ -19,8 +19,10 @@ adam_third_party.unbind=UPDATE adam_third_party SET `state`=2, updated_at=? WHER ...@@ -19,8 +19,10 @@ adam_third_party.unbind=UPDATE adam_third_party SET `state`=2, updated_at=? WHER
adam_third_party.close=UPDATE adam_third_party SET `state`=2, updated_at=?, comment='close' WHERE `uid`=? adam_third_party.close=UPDATE adam_third_party SET `state`=2, updated_at=?, comment='close' WHERE `uid`=?
# ---------------------------------------------------- # ----------------------------------------------------
adam_addresses.add=INSERT INTO adam_addresses (addresses_id, `uid`, `name`, phone, province, city, county, address, is_default, `state`, created_at) VALUES (?,?,?,?,?,?,?,?,?,?,?) #adam_addresses.add=INSERT INTO adam_addresses (addresses_id, `uid`, `name`, phone, province, city, county, address, is_default, `state`, created_at) VALUES (?,?,?,?,?,?,?,?,?,?,?)
adam_addresses.edit=UPDATE adam_addresses SET `name`=?, phone=?, province=?, city=?, county=?, address=?, updated_at=? WHERE addresses_id=? adam_addresses.add=INSERT INTO adam_addresses (addresses_id, `uid`, `name`, phone, province, province_id, city, city_id, county, county_id, address, is_default, `state`, created_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)
#adam_addresses.edit=UPDATE adam_addresses SET `name`=?, phone=?, province=?, city=?, county=?, address=?, updated_at=? WHERE addresses_id=?
adam_addresses.edit=UPDATE adam_addresses SET `name`=?, phone=?, province=?, province_id=?, city=?, city_id=?, county=?, county_id=?, address=?, updated_at=? WHERE addresses_id=?
adam_addresses.update.is_default=UPDATE adam_addresses SET is_default=?, updated_at=? WHERE addresses_id=? adam_addresses.update.is_default=UPDATE adam_addresses SET is_default=?, updated_at=? WHERE addresses_id=?
adam_addresses.remove=UPDATE adam_addresses SET is_default=0, `state`=2, updated_at=?, deleted_at=? WHERE addresses_id=? adam_addresses.remove=UPDATE adam_addresses SET is_default=0, `state`=2, updated_at=?, deleted_at=? WHERE addresses_id=?
adam_addresses.close=UPDATE adam_addresses SET `state`=2, updated_at=?, deleted_at=? WHERE uid=? adam_addresses.close=UPDATE adam_addresses SET `state`=2, updated_at=?, deleted_at=? WHERE uid=?
......
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