Commit 32e4996e authored by huangcb's avatar huangcb

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

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