|
|
@ -10,7 +10,9 @@ import com.hfkj.entity.GoodsUserAddress; |
|
|
|
import com.hfkj.model.order.OrderChildModel; |
|
|
|
import com.hfkj.model.order.OrderChildModel; |
|
|
|
import com.hfkj.service.goods.BsOrderGoodsService; |
|
|
|
import com.hfkj.service.goods.BsOrderGoodsService; |
|
|
|
import com.hfkj.service.goods.GoodsUserAddressService; |
|
|
|
import com.hfkj.service.goods.GoodsUserAddressService; |
|
|
|
|
|
|
|
import com.hfkj.service.goods.GoodsVpdService; |
|
|
|
import com.hfkj.service.order.BsOrderChildService; |
|
|
|
import com.hfkj.service.order.BsOrderChildService; |
|
|
|
|
|
|
|
import com.hfkj.sysenum.order.OrderChildProductTypeEnum; |
|
|
|
import com.hfkj.sysenum.order.OrderChildStatusEnum; |
|
|
|
import com.hfkj.sysenum.order.OrderChildStatusEnum; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -36,6 +38,8 @@ public class BsOrderChildServiceImpl implements BsOrderChildService { |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private BsOrderGoodsService orderGoodsService; |
|
|
|
private BsOrderGoodsService orderGoodsService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private GoodsVpdService goodsVpdService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void editData(BsOrderChild data) { |
|
|
|
public void editData(BsOrderChild data) { |
|
|
@ -75,23 +79,25 @@ public class BsOrderChildServiceImpl implements BsOrderChildService { |
|
|
|
OrderChildModel childModel = new OrderChildModel(); |
|
|
|
OrderChildModel childModel = new OrderChildModel(); |
|
|
|
BeanUtils.copyProperties(orderChild, childModel); |
|
|
|
BeanUtils.copyProperties(orderChild, childModel); |
|
|
|
|
|
|
|
|
|
|
|
BsOrderGoods orderGoods = orderGoodsService.findGoodsOrder(orderNo); |
|
|
|
if (childModel.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) { |
|
|
|
|
|
|
|
BsOrderGoods orderGoods = orderGoodsService.findGoodsOrder(orderNo); |
|
|
|
|
|
|
|
if (orderGoods != null) { |
|
|
|
|
|
|
|
GoodsUserAddress address = goodsUserAddressService.queryDetail(orderGoods.getDeliveryAddressId()); |
|
|
|
|
|
|
|
JSONObject object; |
|
|
|
|
|
|
|
if (childModel.getBusiness() == null) { |
|
|
|
|
|
|
|
object = new JSONObject(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
object = new JSONObject((Map<String, Object>) childModel.getBusiness()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
object.put("address", address); |
|
|
|
|
|
|
|
object.put("orderGoodsId", orderGoods.getId()); |
|
|
|
|
|
|
|
childModel.setBusiness(object); |
|
|
|
|
|
|
|
|
|
|
|
if (orderGoods != null) { |
|
|
|
|
|
|
|
GoodsUserAddress address = goodsUserAddressService.queryDetail(orderGoods.getDeliveryAddressId()); |
|
|
|
|
|
|
|
JSONObject object; |
|
|
|
|
|
|
|
if (childModel.getBusiness() == null) { |
|
|
|
|
|
|
|
object = new JSONObject(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
object = new JSONObject((Map<String, Object>) childModel.getBusiness()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else if (childModel.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { |
|
|
|
object.put("address", address); |
|
|
|
childModel.setBusiness(goodsVpdService.queryDetailBySpecsId(childModel.getProductSpecId())); |
|
|
|
object.put("orderGoodsId", orderGoods.getId()); |
|
|
|
|
|
|
|
childModel.setBusiness(object); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
orderChildModelList.add(childModel); |
|
|
|
orderChildModelList.add(childModel); |
|
|
|
} |
|
|
|
} |
|
|
|
return orderChildModelList; |
|
|
|
return orderChildModelList; |
|
|
|