|
@@ -20,7 +20,11 @@ import org.springblade.core.mp.support.BaseEntityWrapper;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.ldt.bills.entity.GoodsBills;
|
|
import org.springblade.ldt.bills.entity.GoodsBills;
|
|
|
import org.springblade.ldt.bills.vo.GoodsBillsVO;
|
|
import org.springblade.ldt.bills.vo.GoodsBillsVO;
|
|
|
|
|
+import org.springblade.ldt.shop.entity.Shop;
|
|
|
|
|
+import org.springblade.ldt.shop.service.IShopService;
|
|
|
|
|
+
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 订单包装类,返回视图层所需的字段
|
|
* 订单包装类,返回视图层所需的字段
|
|
@@ -30,19 +34,34 @@ import java.util.Objects;
|
|
|
*/
|
|
*/
|
|
|
public class GoodsBillsWrapper extends BaseEntityWrapper<GoodsBills, GoodsBillsVO> {
|
|
public class GoodsBillsWrapper extends BaseEntityWrapper<GoodsBills, GoodsBillsVO> {
|
|
|
|
|
|
|
|
|
|
+ private IShopService shopService;
|
|
|
|
|
+
|
|
|
|
|
+ public GoodsBillsWrapper(IShopService shopService) {
|
|
|
|
|
+ this.shopService = shopService;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public GoodsBillsWrapper() {
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public static GoodsBillsWrapper build() {
|
|
public static GoodsBillsWrapper build() {
|
|
|
return new GoodsBillsWrapper();
|
|
return new GoodsBillsWrapper();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public static GoodsBillsWrapper build(IShopService shopService) {
|
|
|
|
|
+ return new GoodsBillsWrapper(shopService);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public GoodsBillsVO entityVO(GoodsBills goodsBills) {
|
|
public GoodsBillsVO entityVO(GoodsBills goodsBills) {
|
|
|
GoodsBillsVO goodsBillsVO = Objects.requireNonNull(BeanUtil.copy(goodsBills, GoodsBillsVO.class));
|
|
GoodsBillsVO goodsBillsVO = Objects.requireNonNull(BeanUtil.copy(goodsBills, GoodsBillsVO.class));
|
|
|
|
|
|
|
|
- //User createUser = UserCache.getUser(goodsBills.getCreateUser());
|
|
|
|
|
- //User updateUser = UserCache.getUser(goodsBills.getUpdateUser());
|
|
|
|
|
- //goodsBillsVO.setCreateUserName(createUser.getName());
|
|
|
|
|
- //goodsBillsVO.setUpdateUserName(updateUser.getName());
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (shopService != null) {
|
|
|
|
|
+ Shop shop = shopService.getById(goodsBillsVO.getReceiveId());
|
|
|
|
|
+ String shopName= Optional.ofNullable(shop).map(Shop::getName).orElse("");
|
|
|
|
|
+ String shopPic= Optional.ofNullable(shop).map(Shop::getShopPic).orElse("");
|
|
|
|
|
+ goodsBillsVO.setShopName(shopName);
|
|
|
|
|
+ goodsBillsVO.setShopPic(shopPic);
|
|
|
|
|
+ }
|
|
|
return goodsBillsVO;
|
|
return goodsBillsVO;
|
|
|
}
|
|
}
|
|
|
|
|
|