|
|
@@ -8,6 +8,7 @@ import com.uas.platform.b2c.logistics.model.Address;
|
|
|
import com.uas.platform.b2c.logistics.service.AddressService;
|
|
|
import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
+import com.uas.platform.core.model.PageParams;
|
|
|
import com.uas.platform.core.model.Type;
|
|
|
import com.uas.platform.core.persistence.criteria.CriterionExpression;
|
|
|
import com.uas.platform.core.persistence.criteria.SimpleExpression;
|
|
|
@@ -149,9 +150,16 @@ public class AddressServiceImpl implements AddressService {
|
|
|
}
|
|
|
}else {
|
|
|
address.setUseruu(user.getUserUU());
|
|
|
- address.setEnuu(user.getEnterprise().getUu());
|
|
|
- address.setUsetype((short)2);
|
|
|
- num = addressDao.getCountByEnuuAndTypeAndUsetype(user.getEnterprise().getUu(), address.getType(), address.getUsetype());
|
|
|
+ if (user.getEnterprise() != null) {
|
|
|
+ address.setEnuu(user.getEnterprise().getUu());
|
|
|
+ address.setUsetype((short)2);
|
|
|
+ num = addressDao.getCountByEnuuAndTypeAndUsetype(user.getEnterprise().getUu(), address.getType(), address.getUsetype());
|
|
|
+ } else {
|
|
|
+ address.setDissociative(Type.PERSONAL.value());
|
|
|
+ address.setUsetype((short)1);
|
|
|
+ num =addressDao.getCountByUseruuTypeUsetypeAndDissociative(user.getUserUU(),address.getType(), address.getUsetype(), Type.PERSONAL.value());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
address.setNum(num == 0 ? 1 : ++num);
|
|
|
}
|
|
|
@@ -237,6 +245,46 @@ public class AddressServiceImpl implements AddressService {
|
|
|
}, info);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取企业收货地址信息
|
|
|
+ *
|
|
|
+ * @param page the page 一页的参数
|
|
|
+ * @return Page 返回Address的page对象
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Page<Address> getEnterpriseReceiveAddress(PageParams page) {
|
|
|
+ PageInfo info = new PageInfo(page);
|
|
|
+ info.filter("type", Type.Address_Shipping_Code.value());
|
|
|
+ if (SystemSession.getUser().getEnterprise() != null) {
|
|
|
+ info.filter("enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ info.filter("usetype", (short)2);
|
|
|
+ } else {
|
|
|
+ info.filter("useruu", SystemSession.getUser().getUserUU());
|
|
|
+ info.filter("usetype", (short)1);
|
|
|
+ }
|
|
|
+ return getEnterprise(info);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取企业发货地址的信息
|
|
|
+ *
|
|
|
+ * @param page 一页的参数
|
|
|
+ * @return Page 返回Address的page对象
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Page<Address> getEnterpriseSendAddress(PageParams page) {
|
|
|
+ PageInfo info = new PageInfo(page);
|
|
|
+ info.filter("type", Type.Address_Sending_Code.value());
|
|
|
+ if (SystemSession.getUser().getEnterprise() != null) {
|
|
|
+ info.filter("enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ info.filter("usetype", (short)2);
|
|
|
+ } else {
|
|
|
+ info.filter("useruu", SystemSession.getUser().getUserUU());
|
|
|
+ info.filter("usetype", (short)1);
|
|
|
+ }
|
|
|
+ return getEnterprise(info);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<Address> findDefaultEnterpriseAddress(boolean bool) {
|
|
|
// boo判断查询的是收货地址还是发货地址(默认收货地址)
|