|
|
@@ -37,7 +37,6 @@ public class AddressServiceImpl implements AddressService {
|
|
|
public void delete(Long addid) {
|
|
|
if (addressDao.exists(addid)) {
|
|
|
Address address = addressDao.findOne(addid);
|
|
|
- int modifyNum = address.getNum();
|
|
|
List<Address> addresses = null;
|
|
|
addressDao.delete(addid);
|
|
|
int type = address.getType();
|
|
|
@@ -52,12 +51,9 @@ public class AddressServiceImpl implements AddressService {
|
|
|
Address add = addresses.get(0);
|
|
|
add.setNum(1);
|
|
|
}else {
|
|
|
- int num = 0;
|
|
|
- if (modifyNum == 1) {
|
|
|
- num = 1;
|
|
|
- }
|
|
|
+ int num = addresses.get(0).getNum();
|
|
|
for (Address add : addresses){
|
|
|
- add.setNum(++num);
|
|
|
+ add.setNum(num++);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -160,7 +156,6 @@ public class AddressServiceImpl implements AddressService {
|
|
|
}
|
|
|
Long modifyId = address.getId();
|
|
|
Address add = save(address);
|
|
|
- //如果id为空,且num为1,则自动设为默认地址
|
|
|
if (modifyId == null && add.getNum().intValue() == 1){
|
|
|
isSetTop = true;
|
|
|
}
|