master
胡锐 6 months ago
commit 078c248854
  1. 25
      service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java

@ -1,9 +1,15 @@
package com.hfkj.service.order.impl; package com.hfkj.service.order.impl;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.dao.BsOrderChildMapper; import com.hfkj.dao.BsOrderChildMapper;
import com.hfkj.dao.GoodsUserAddressMapper;
import com.hfkj.entity.BsOrderChild; import com.hfkj.entity.BsOrderChild;
import com.hfkj.entity.BsOrderChildExample; import com.hfkj.entity.BsOrderChildExample;
import com.hfkj.entity.BsOrderGoods;
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.GoodsUserAddressService;
import com.hfkj.service.order.BsOrderChildService; import com.hfkj.service.order.BsOrderChildService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -12,6 +18,7 @@ import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @className: BsOrderChildServiceImpl * @className: BsOrderChildServiceImpl
@ -23,6 +30,12 @@ public class BsOrderChildServiceImpl implements BsOrderChildService {
@Resource @Resource
private BsOrderChildMapper orderChildMapper; private BsOrderChildMapper orderChildMapper;
@Resource
private GoodsUserAddressService goodsUserAddressService;
@Resource
private BsOrderGoodsService orderGoodsService;
@Override @Override
public void editData(BsOrderChild data) { public void editData(BsOrderChild data) {
data.setUpdateTime(new Date()); data.setUpdateTime(new Date());
@ -59,6 +72,18 @@ public class BsOrderChildServiceImpl implements BsOrderChildService {
for (BsOrderChild orderChild : list) { for (BsOrderChild orderChild : list) {
OrderChildModel childModel = new OrderChildModel(); OrderChildModel childModel = new OrderChildModel();
BeanUtils.copyProperties(orderChild, childModel); BeanUtils.copyProperties(orderChild, childModel);
BsOrderGoods orderGoods = orderGoodsService.findGoodsOrder(orderNo);
GoodsUserAddress address = goodsUserAddressService.queryDetail(orderGoods.getId());
JSONObject object = new JSONObject((Map<String, Object>) childModel.getBusiness());
object.put("address", address);
if (orderGoods.getLogisticsNo() != null) {
object.put("logisticsNo", orderGoods.getLogisticsNo());
}
orderChildModelList.add(childModel); orderChildModelList.add(childModel);
} }
return orderChildModelList; return orderChildModelList;

Loading…
Cancel
Save