Commit 32e4996e authored by huangcb's avatar huangcb

货主接口:解决发货地址、收货地址列表功能bug

parent 5c6de93b
...@@ -30,7 +30,7 @@ public class PageResultVO { ...@@ -30,7 +30,7 @@ public class PageResultVO {
/** /**
* 总记录条数 * 总记录条数
**/ **/
private Long total; private Long totalSize;
/** /**
* 当前页的记录条数 * 当前页的记录条数
...@@ -45,7 +45,7 @@ public class PageResultVO { ...@@ -45,7 +45,7 @@ public class PageResultVO {
public PageResultVO(IPage page, List<?> record) { public PageResultVO(IPage page, List<?> record) {
this.pageSize = page.getSize(); this.pageSize = page.getSize();
this.pageNum = page.getCurrent(); this.pageNum = page.getCurrent();
this.total = page.getTotal(); this.totalSize = page.getTotal();
this.recordSize = Long.parseLong(String.valueOf(page.getRecords().size())); this.recordSize = Long.parseLong(String.valueOf(page.getRecords().size()));
this.records = record; this.records = record;
} }
......
...@@ -63,8 +63,8 @@ public class ReceiveAddressController { ...@@ -63,8 +63,8 @@ public class ReceiveAddressController {
DeliveryAddressForm deliveryAddressForm = new DeliveryAddressForm(); DeliveryAddressForm deliveryAddressForm = new DeliveryAddressForm();
BeanUtils.copyProperties(form, deliveryAddressForm); BeanUtils.copyProperties(form, deliveryAddressForm);
deliveryAddressForm.setDeliverer(form.getReceiver()); deliveryAddressForm.setDeliverer(form.getReceiver());
deliveryAddressForm.setDeliverer(form.getReceiverPhone()); deliveryAddressForm.setDelivererPhone(form.getReceiverPhone());
deliveryAddressForm.setDeliverer(form.getReceiverTelephone()); deliveryAddressForm.setDelivererTelephone(form.getReceiverTelephone());
try { try {
deliveryAddressService.addAddress(deliveryAddressForm); deliveryAddressService.addAddress(deliveryAddressForm);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -13,7 +13,6 @@ import org.hibernate.validator.constraints.Range; ...@@ -13,7 +13,6 @@ import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/** /**
* @description: * @description:
...@@ -70,8 +69,8 @@ public class DeliveryAddressForm { ...@@ -70,8 +69,8 @@ public class DeliveryAddressForm {
@Length(max = 10, message = "参数lat长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 10, message = "参数lat长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class})
private String lat; private String lat;
@Pattern(regexp = "[01]", message = "参数addressCopy不合法", groups = {ValidatorInsert.class}) @Range(min = 0, max = 1, message = "参数addressCopy不合法", groups = {ValidatorInsert.class})
private String addressCopy; private Integer addressCopy;
@Length(max = 50, message = "参数keywords长度不合法", groups = {ValidatorList.class}) @Length(max = 50, message = "参数keywords长度不合法", groups = {ValidatorList.class})
private String keywords; private String keywords;
......
...@@ -13,7 +13,6 @@ import org.hibernate.validator.constraints.Range; ...@@ -13,7 +13,6 @@ import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/** /**
* @description: * @description:
...@@ -70,8 +69,8 @@ public class ReceiveAddressForm { ...@@ -70,8 +69,8 @@ public class ReceiveAddressForm {
@Length(max = 10, message = "参数lat长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 10, message = "参数lat长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class})
private String lat; private String lat;
@Pattern(regexp = "[01]", message = "参数addressCopy不合法", groups = {ValidatorInsert.class}) @Range(min = 0, max = 1, message = "参数addressCopy不合法", groups = {ValidatorInsert.class})
private String addressCopy; private Integer addressCopy;
@Length(max = 50, message = "参数keywords长度不合法", groups = {ValidatorList.class}) @Length(max = 50, message = "参数keywords长度不合法", groups = {ValidatorList.class})
private String keywords; private String keywords;
...@@ -85,7 +84,7 @@ public class ReceiveAddressForm { ...@@ -85,7 +84,7 @@ public class ReceiveAddressForm {
/** /**
* 每页记录条数 * 每页记录条数
**/ **/
@Range(min = 1, max = 100, message = "pageSize", groups = {ValidatorList.class}) @Range(min = 1, max = 100, message = "参数pageSize不合法", groups = {ValidatorList.class})
@NotNull(message = "参数pageSize不能为空", groups = {ValidatorList.class}) @NotNull(message = "参数pageSize不能为空", groups = {ValidatorList.class})
private Integer pageSize; private Integer pageSize;
......
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
from goods_owner_delivery_address a, goods_owner_info b from goods_owner_delivery_address a, goods_owner_info b
where a.owner_id = b.account_id and a.deleted = false where a.owner_id = b.account_id and a.deleted = false
<if test="queryObj.provinceCode != null"> <if test="queryObj.provinceCode != null">
and b.province_code = #{queryObj.provinceCode} and a.province_code = #{queryObj.provinceCode}
</if> </if>
<if test="queryObj.cityCode != null"> <if test="queryObj.cityCode != null">
and b.city_code = #{queryObj.cityCode} and a.city_code = #{queryObj.cityCode}
</if> </if>
<if test="queryObj.keywords != null"> <if test="queryObj.keywords != null">
and (a.address_name like CONCAT('%',#{queryObj.keywords},'%') and (a.address_name like CONCAT('%',#{queryObj.keywords},'%')
......
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
from goods_owner_receive_address a, goods_owner_info b from goods_owner_receive_address a, goods_owner_info b
where a.owner_id = b.account_id and a.deleted = false where a.owner_id = b.account_id and a.deleted = false
<if test="queryObj.provinceCode != null"> <if test="queryObj.provinceCode != null">
and b.province_code = #{queryObj.provinceCode} and a.province_code = #{queryObj.provinceCode}
</if> </if>
<if test="queryObj.cityCode != null"> <if test="queryObj.cityCode != null">
and b.city_code = #{queryObj.cityCode} and a.city_code = #{queryObj.cityCode}
</if> </if>
<if test="queryObj.keywords != null"> <if test="queryObj.keywords != null">
and (a.address_name like CONCAT('%',#{queryObj.keywords},'%') and (a.address_name like CONCAT('%',#{queryObj.keywords},'%')
......
...@@ -95,7 +95,7 @@ public class DeliveryAddressControllerTest extends BaseTestController { ...@@ -95,7 +95,7 @@ public class DeliveryAddressControllerTest extends BaseTestController {
form.setDelivererTelephone("(024)24850576"); form.setDelivererTelephone("(024)24850576");
form.setLon("123.464052"); form.setLon("123.464052");
form.setLat("41.800415"); form.setLat("41.800415");
form.setAddressCopy("1"); form.setAddressCopy(1);
MvcResult mvcResult = this.getMockMvc().perform(MockMvcRequestBuilders.post(url) MvcResult mvcResult = this.getMockMvc().perform(MockMvcRequestBuilders.post(url)
.contentType(MediaType.APPLICATION_JSON_UTF8_VALUE) .contentType(MediaType.APPLICATION_JSON_UTF8_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