|
|
@@ -2,6 +2,7 @@ package com.uas.platform.b2c.logistics.service.impl;
|
|
|
|
|
|
import com.uas.platform.b2c.common.account.model.User;
|
|
|
import com.uas.platform.b2c.core.config.SysConf;
|
|
|
+import com.uas.platform.b2c.core.constant.ShortConstant;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.b2c.logistics.dao.AddressDao;
|
|
|
import com.uas.platform.b2c.logistics.model.Address;
|
|
|
@@ -43,7 +44,7 @@ public class AddressServiceImpl implements AddressService {
|
|
|
int type = address.getType();
|
|
|
short usertype = address.getUsetype();
|
|
|
if(usertype == 1) {//个人地址信息
|
|
|
- addresses = addressDao.findByUseruuAndEnuuAndTypeAndUsetypeOrderByNumAsc(address.getUseruu(), address.getEnuu(), type, (short)1);
|
|
|
+ addresses = addressDao.findByUseruuAndTypeAndUsetypeOrderByNumAsc(address.getUseruu(), type, (short)1);
|
|
|
}else {//企业的地址信息
|
|
|
addresses = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(address.getEnuu(), type, (short)2);
|
|
|
}
|
|
|
@@ -76,8 +77,9 @@ public class AddressServiceImpl implements AddressService {
|
|
|
Long useruu = address.getUseruu();
|
|
|
int type = address.getType();
|
|
|
List<Address> addresses = null;
|
|
|
- if (Type.Address_Shipping_Code.value() == address.getType()) {
|
|
|
- addresses = addressDao.findByUseruuAndEnuuAndTypeAndUsetypeOrderByNumAsc(useruu, address.getEnuu(), type, (short)1);
|
|
|
+ if (address.getUsetype().equals(ShortConstant.YES_SHORT)) {
|
|
|
+ //个人账户
|
|
|
+ addresses = addressDao.findByUseruuAndTypeAndUsetypeOrderByNumAsc(useruu, type, (short)1);
|
|
|
} else {
|
|
|
addresses = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(address.getEnuu(), type, (short)2);
|
|
|
}
|
|
|
@@ -180,18 +182,11 @@ public class AddressServiceImpl implements AddressService {
|
|
|
@Override
|
|
|
public List<Address> findShipingAdd(Long useruu, Boolean send, Long enuu) {
|
|
|
List<Address> address = new ArrayList<Address>();
|
|
|
- if (send) {
|
|
|
- if (enuu != null) {
|
|
|
- address = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(enuu, Type.Address_Sending_Code.value(), (short)2);
|
|
|
- } else {
|
|
|
- address = addressDao.findByUseruuAndTypeAndUsetypeAndDissociative(useruu, Type.Address_Sending_Code.value(), (short)2, Type.PERSONAL.value());
|
|
|
- }
|
|
|
+ Integer type = send ? Type.Address_Sending_Code.value() :Type.Address_Shipping_Code.value();
|
|
|
+ if (enuu != null) {
|
|
|
+ address = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(enuu, type, (short)2);
|
|
|
} else {
|
|
|
- if (enuu != null) {
|
|
|
- address = addressDao.findByUseruuAndEnuuAndTypeAndUsetypeOrderByNumAsc(useruu, enuu, Type.Address_Shipping_Code.value(), (short) 1);
|
|
|
- } else {
|
|
|
- address = addressDao.findByUseruuAndTypeAndUsetypeAndDissociative(useruu, Type.Address_Shipping_Code.value(), (short)1, Type.PERSONAL.value());
|
|
|
- }
|
|
|
+ address = addressDao.findByUseruuAndTypeAndUsetype(useruu, type, (short)1);
|
|
|
}
|
|
|
return address;
|
|
|
}
|