|
|
@@ -148,6 +148,7 @@ public class AddressServiceImpl implements AddressService {
|
|
|
num =addressDao.getCountByUseruuTypeUsetypeAndDissociative(user.getUserUU(),address.getType(), address.getUsetype(), Type.PERSONAL.value());
|
|
|
}
|
|
|
}else {
|
|
|
+ address.setUseruu(user.getUserUU());
|
|
|
address.setEnuu(user.getEnterprise().getUu());
|
|
|
address.setUsetype((short)2);
|
|
|
num = addressDao.getCountByEnuuAndTypeAndUsetype(user.getEnterprise().getUu(), address.getType(), address.getUsetype());
|
|
|
@@ -156,13 +157,13 @@ public class AddressServiceImpl implements AddressService {
|
|
|
}
|
|
|
Long modifyId = address.getId();
|
|
|
Address add = save(address);
|
|
|
- if (modifyId == null && add.getNum().intValue() == 1){
|
|
|
+ if (modifyId == null && add.getNum() == 1){
|
|
|
isSetTop = true;
|
|
|
}
|
|
|
if(modifyId == null || isSetTop) { //只有新增加的地址 或者需要被置顶的地址 才需要重新排序。
|
|
|
setTop(add.getId(), isSetTop);
|
|
|
}
|
|
|
- if (address.getNum().intValue() == 1 && !isSetTop) { //取消默认地址的时候需要重新排序
|
|
|
+ if (address.getNum() == 1 && !isSetTop) { //取消默认地址的时候需要重新排序
|
|
|
setTop(add.getId(), isSetTop);
|
|
|
}
|
|
|
return add;
|
|
|
@@ -173,9 +174,9 @@ public class AddressServiceImpl implements AddressService {
|
|
|
List<Address> address = new ArrayList<Address>();
|
|
|
if (send) {
|
|
|
if (enuu != null) {
|
|
|
- address = addressDao.findByUseruuAndEnuuAndTypeAndUsetypeOrderByNumAsc(useruu, enuu, Type.Address_Sending_Code.value(), (short)1);
|
|
|
+ address = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(enuu, Type.Address_Sending_Code.value(), (short)2);
|
|
|
} else {
|
|
|
- address = addressDao.findByUseruuAndTypeAndUsetypeAndDissociative(useruu, Type.Address_Sending_Code.value(), (short)1, Type.PERSONAL.value());
|
|
|
+ address = addressDao.findByUseruuAndTypeAndUsetypeAndDissociative(useruu, Type.Address_Sending_Code.value(), (short)2, Type.PERSONAL.value());
|
|
|
}
|
|
|
} else {
|
|
|
if (enuu != null) {
|