bug fix
This commit is contained in:
@@ -179,7 +179,7 @@ public class BuyOrderController {
|
|||||||
buyOrderService.save(buyOrder);
|
buyOrderService.save(buyOrder);
|
||||||
|
|
||||||
for (BuyOrderDetail buyOrderDetail : buyOrderDetails) {
|
for (BuyOrderDetail buyOrderDetail : buyOrderDetails) {
|
||||||
buyOrderDetail.setOrderId(buyOrder.getId());
|
buyOrderDetail.setOrderId(buyOrder.getOrderId());
|
||||||
buyOrderDetail.setUserId(buyOrder.getUserId());
|
buyOrderDetail.setUserId(buyOrder.getUserId());
|
||||||
if (Constants.BUY_TYPE_CART.equals(buyOrder.getBuyType())) {
|
if (Constants.BUY_TYPE_CART.equals(buyOrder.getBuyType())) {
|
||||||
handleBuyCart(buyOrder, buyOrderDetail);
|
handleBuyCart(buyOrder, buyOrderDetail);
|
||||||
@@ -204,12 +204,12 @@ public class BuyOrderController {
|
|||||||
rabbitTemplate.convertAndSend(
|
rabbitTemplate.convertAndSend(
|
||||||
DelayQueueConfig.ORDER_TO_BE_PAY_EXCHANGE,
|
DelayQueueConfig.ORDER_TO_BE_PAY_EXCHANGE,
|
||||||
DelayQueueConfig.ORDER_TO_BE_PAY_ROUTING_KEY,
|
DelayQueueConfig.ORDER_TO_BE_PAY_ROUTING_KEY,
|
||||||
buyOrder.getId(),
|
buyOrder.getOrderId(),
|
||||||
messagePostProcessor()
|
messagePostProcessor()
|
||||||
);
|
);
|
||||||
WechatPaymentInfo paymentInfo = new WechatPaymentInfo();
|
WechatPaymentInfo paymentInfo = new WechatPaymentInfo();
|
||||||
paymentInfo.setOrderSn(orderSn);
|
paymentInfo.setOrderSn(orderSn);
|
||||||
paymentInfo.setBuyOrderId(buyOrder.getId());
|
paymentInfo.setBuyOrderId(buyOrder.getOrderId());
|
||||||
paymentInfo.setTotalAmount(totalPrice);
|
paymentInfo.setTotalAmount(totalPrice);
|
||||||
wxpayService.prepay(paymentInfo);
|
wxpayService.prepay(paymentInfo);
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,7 @@ public class BuyOrderController {
|
|||||||
buyOrderService.save(buyOrder);
|
buyOrderService.save(buyOrder);
|
||||||
|
|
||||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
||||||
buyOrderProduct.setOrderId(buyOrder.getId());
|
buyOrderProduct.setOrderId(buyOrder.getOrderId());
|
||||||
if (Constants.BUY_TYPE_CART.equals(buyOrder.getBuyType())) {
|
if (Constants.BUY_TYPE_CART.equals(buyOrder.getBuyType())) {
|
||||||
handleBuyCart(buyOrder, buyOrderProduct);
|
handleBuyCart(buyOrder, buyOrderProduct);
|
||||||
}
|
}
|
||||||
@@ -285,12 +285,12 @@ public class BuyOrderController {
|
|||||||
rabbitTemplate.convertAndSend(
|
rabbitTemplate.convertAndSend(
|
||||||
DelayQueueConfig.ORDER_TO_BE_PAY_EXCHANGE,
|
DelayQueueConfig.ORDER_TO_BE_PAY_EXCHANGE,
|
||||||
DelayQueueConfig.ORDER_TO_BE_PAY_ROUTING_KEY,
|
DelayQueueConfig.ORDER_TO_BE_PAY_ROUTING_KEY,
|
||||||
buyOrder.getId(),
|
buyOrder.getOrderId(),
|
||||||
messagePostProcessor()
|
messagePostProcessor()
|
||||||
);
|
);
|
||||||
WechatPaymentInfo paymentInfo = new WechatPaymentInfo();
|
WechatPaymentInfo paymentInfo = new WechatPaymentInfo();
|
||||||
paymentInfo.setOrderSn(orderSn);
|
paymentInfo.setOrderSn(orderSn);
|
||||||
paymentInfo.setBuyOrderId(buyOrder.getId());
|
paymentInfo.setBuyOrderId(buyOrder.getOrderId());
|
||||||
paymentInfo.setTotalAmount(totalPrice);
|
paymentInfo.setTotalAmount(totalPrice);
|
||||||
wxpayService.prepay(paymentInfo);
|
wxpayService.prepay(paymentInfo);
|
||||||
}
|
}
|
||||||
@@ -356,7 +356,7 @@ public class BuyOrderController {
|
|||||||
}
|
}
|
||||||
// 库存回滚
|
// 库存回滚
|
||||||
QueryWrapper<BuyOrderProduct> buyOrderProductQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<BuyOrderProduct> buyOrderProductQueryWrapper = new QueryWrapper<>();
|
||||||
buyOrderProductQueryWrapper.eq("order_id", buyOrder.getId());
|
buyOrderProductQueryWrapper.eq("order_id", buyOrder.getOrderId());
|
||||||
List<BuyOrderProduct> buyOrderProductList = buyOrderProductService.list(buyOrderProductQueryWrapper);
|
List<BuyOrderProduct> buyOrderProductList = buyOrderProductService.list(buyOrderProductQueryWrapper);
|
||||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
||||||
Integer productId = buyOrderProduct.getProductId();
|
Integer productId = buyOrderProduct.getProductId();
|
||||||
@@ -364,7 +364,7 @@ public class BuyOrderController {
|
|||||||
product.setProductStock(product.getProductStock() + buyOrderProduct.getQuantity());
|
product.setProductStock(product.getProductStock() + buyOrderProduct.getQuantity());
|
||||||
shopProductService.updateById(product);
|
shopProductService.updateById(product);
|
||||||
}
|
}
|
||||||
buyOrderService.removeById(buyOrder.getId());
|
buyOrderService.removeById(buyOrder.getOrderId());
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,7 +410,7 @@ public class BuyOrderController {
|
|||||||
}
|
}
|
||||||
// 库存回滚
|
// 库存回滚
|
||||||
List<BuyOrderDetail> buyOrderDetailEntities = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetail>()
|
List<BuyOrderDetail> buyOrderDetailEntities = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetail>()
|
||||||
.eq("order_id", byId.getId()));
|
.eq("order_id", byId.getOrderId()));
|
||||||
for (BuyOrderDetail buyOrderDetailEntity : buyOrderDetailEntities) {
|
for (BuyOrderDetail buyOrderDetailEntity : buyOrderDetailEntities) {
|
||||||
Integer productId = buyOrderDetailEntity.getProductId();
|
Integer productId = buyOrderDetailEntity.getProductId();
|
||||||
ShopProduct product = shopProductService.getById(productId);
|
ShopProduct product = shopProductService.getById(productId);
|
||||||
@@ -452,7 +452,7 @@ public class BuyOrderController {
|
|||||||
@RequestMapping("/getOrderDetail")
|
@RequestMapping("/getOrderDetail")
|
||||||
public R getOrderDetail(@RequestParam Integer orderId) {
|
public R getOrderDetail(@RequestParam Integer orderId) {
|
||||||
LambdaQueryWrapper<BuyOrder> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BuyOrder> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(BuyOrder::getId, orderId);
|
wrapper.eq(BuyOrder::getOrderId, orderId);
|
||||||
BuyOrder one = buyOrderService.getOne(wrapper);
|
BuyOrder one = buyOrderService.getOne(wrapper);
|
||||||
if (one.equals(null)) {
|
if (one.equals(null)) {
|
||||||
return R.error("order error:order is null");
|
return R.error("order error:order is null");
|
||||||
@@ -565,30 +565,19 @@ public class BuyOrderController {
|
|||||||
/**
|
/**
|
||||||
* 查询订单快递
|
* 查询订单快递
|
||||||
*
|
*
|
||||||
* @param orderSn 订单号
|
* @param expressOrderSn 运单号
|
||||||
* @return R
|
* @return R
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/queryExpress", method = RequestMethod.GET)
|
@RequestMapping(value = "/queryExpress", method = RequestMethod.GET)
|
||||||
public R queryExpress(@RequestParam("orderSn") Integer orderSn) {
|
public R queryExpress(@RequestParam("expressOrderSn") String expressOrderSn,
|
||||||
QueryWrapper<BuyOrder> buyOrderQueryWrapper = new QueryWrapper<>();
|
@RequestParam("expressCompanyCode") String expressCompanyCode,
|
||||||
buyOrderQueryWrapper.eq("order_sn", orderSn);
|
@RequestParam("customerName") String customerName) {
|
||||||
BuyOrder buyOrder = buyOrderService.getOne(buyOrderQueryWrapper);
|
|
||||||
Integer orderId = buyOrder.getId();
|
|
||||||
|
|
||||||
QueryWrapper<BuyOrderProduct> buyOrderProductQueryWrapper = new QueryWrapper<>();
|
ExpressQueryResponseVo vo = new ExpressQueryResponseVo();
|
||||||
buyOrderProductQueryWrapper.eq("order_id", orderId);
|
ExpressQueryResponse expressQueryResponse = expressOrderService.queryExpressOrder(expressCompanyCode, expressOrderSn, customerName);
|
||||||
List<BuyOrderProduct> buyOrderProductList = buyOrderProductService.list(buyOrderProductQueryWrapper);
|
vo.setLogisticCode(expressQueryResponse.getLogisticCode());
|
||||||
List<ExpressQueryResponseVo> result = new ArrayList<>();
|
vo.setTraces(expressQueryResponse.getTraces());
|
||||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
return R.ok().put("result", vo);
|
||||||
int expressOrderId = buyOrderProduct.getExpressOrderId();
|
|
||||||
ExpressOrder expressOrder = expressOrderService.getById(expressOrderId);
|
|
||||||
ExpressQueryResponseVo vo = new ExpressQueryResponseVo();
|
|
||||||
ExpressQueryResponse expressQueryResponse = expressOrderService.queryExpressOrder(expressOrder.getExpressCompanyCode(), expressOrder.getExpressOrderSn());
|
|
||||||
vo.setLogisticCode(expressQueryResponse.getLogisticCode());
|
|
||||||
vo.setTraces(expressQueryResponse.getTraces());
|
|
||||||
result.add(vo);
|
|
||||||
}
|
|
||||||
return R.ok().put("result", result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -689,7 +678,7 @@ public class BuyOrderController {
|
|||||||
CouponHistoryEntity couponHistory = couponHistoryService.getById(couponId);
|
CouponHistoryEntity couponHistory = couponHistoryService.getById(couponId);
|
||||||
couponHistory.setUseStatus(1);
|
couponHistory.setUseStatus(1);
|
||||||
couponHistory.setUseTime(new Date());
|
couponHistory.setUseTime(new Date());
|
||||||
couponHistory.setOrderId(Long.valueOf(buyOrder.getId()));
|
couponHistory.setOrderId(Long.valueOf(buyOrder.getOrderId()));
|
||||||
couponHistory.setOrderSn(buyOrder.getOrderSn());
|
couponHistory.setOrderSn(buyOrder.getOrderSn());
|
||||||
CouponEntity coupon = couponService.getById(couponHistory.getCouponId());
|
CouponEntity coupon = couponService.getById(couponHistory.getCouponId());
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ public class ShopProductController {
|
|||||||
private ShopProductBookService shopProductBookService;
|
private ShopProductBookService shopProductBookService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopProductToLabelService shopProductToLabelService;
|
private ShopProductToLabelService shopProductToLabelService;
|
||||||
|
@Autowired
|
||||||
|
private BuyOrderDetailService buyOrderDetailService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 精选商品 列表
|
* 精选商品 列表
|
||||||
@@ -87,6 +89,48 @@ public class ShopProductController {
|
|||||||
return R.ok().put("page", page);
|
return R.ok().put("page", page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未购买书列表
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/booklist")
|
||||||
|
public R booklist(@RequestParam("userId") Integer userId
|
||||||
|
) {
|
||||||
|
//查询已购买的书籍
|
||||||
|
List<BuyOrderDetail> buyOrderDetailEntities = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetail>()
|
||||||
|
.eq("user_id", userId));
|
||||||
|
//hashset不重复 且无序
|
||||||
|
Set<String> purchasedProductIds = new HashSet<>();
|
||||||
|
ArrayList<Object> list = new ArrayList<>();
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
for (BuyOrderDetail buyOrderDetail : buyOrderDetailEntities) {
|
||||||
|
map.put("ProductId", String.valueOf(buyOrderDetail.getProductId()));
|
||||||
|
list.add(map);
|
||||||
|
//去重取出以后买书籍的id
|
||||||
|
purchasedProductIds.add(String.valueOf(buyOrderDetail.getProductId()));
|
||||||
|
}
|
||||||
|
//查询商品表并过滤已购买商品id,根据时间倒叙展示
|
||||||
|
List<ShopProduct> allProductEntities = shopProductService.getBaseMapper().selectList(new QueryWrapper<ShopProduct>()
|
||||||
|
.notIn("product_id", purchasedProductIds)
|
||||||
|
.orderByDesc("create_time")
|
||||||
|
// .notLike("book_ids",",")
|
||||||
|
.isNotNull("book_ids")
|
||||||
|
|
||||||
|
);
|
||||||
|
List lists = new ArrayList<>();
|
||||||
|
|
||||||
|
for (ShopProduct product : allProductEntities) {
|
||||||
|
Map<String, Object> productMap = new HashMap<>();
|
||||||
|
productMap.put("product", product);
|
||||||
|
lists.add(productMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok().put("pages", lists); // 返回未购买的书籍分页
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 未购买书列表
|
* 未购买书列表
|
||||||
@@ -125,8 +169,6 @@ public class ShopProductController {
|
|||||||
productMap.put("product", product);
|
productMap.put("product", product);
|
||||||
lists.add(productMap);
|
lists.add(productMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return R.ok().put("pages", lists); // 返回未购买的书籍分页
|
return R.ok().put("pages", lists); // 返回未购买的书籍分页
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public class UserFollowUpController {
|
|||||||
.eq("order_sn", orderSn).last("LIMIT 1")
|
.eq("order_sn", orderSn).last("LIMIT 1")
|
||||||
);
|
);
|
||||||
|
|
||||||
Integer orderId = buyOrder.getId();
|
Integer orderId = buyOrder.getOrderId();
|
||||||
Integer bookid = userRecord.getBookid();
|
Integer bookid = userRecord.getBookid();
|
||||||
Integer userid = userRecord.getUserid();
|
Integer userid = userRecord.getUserid();
|
||||||
Integer id1 = userRecord.getId();
|
Integer id1 = userRecord.getId();
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public class UserRecordController {
|
|||||||
private BuyOrderProductService buyOrderProductService;
|
private BuyOrderProductService buyOrderProductService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserFollowUpService userFollowUpService;
|
private UserFollowUpService userFollowUpService;
|
||||||
|
@Autowired
|
||||||
|
private BuyOrderDetailService buyOrderDetailService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -176,7 +178,7 @@ public class UserRecordController {
|
|||||||
return error("您已评价过了,请勿重复评论");
|
return error("您已评价过了,请勿重复评论");
|
||||||
//
|
//
|
||||||
} else {
|
} else {
|
||||||
userRecord.setId(buyOrder.getId());
|
userRecord.setId(buyOrder.getOrderId());
|
||||||
userRecord.setContent(comment);
|
userRecord.setContent(comment);
|
||||||
//商品评价
|
//商品评价
|
||||||
userRecord.setBookid(bookid);
|
userRecord.setBookid(bookid);
|
||||||
@@ -197,11 +199,11 @@ public class UserRecordController {
|
|||||||
* @return 生成评论(上传图片,星级评价
|
* @return 生成评论(上传图片,星级评价
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/UserRecordComment")
|
@RequestMapping("/UserRecordComment")
|
||||||
public R commodity(@RequestBody UserRecord recordEntity) {
|
public R comment(@RequestBody UserRecord recordEntity) {
|
||||||
QueryWrapper<BuyOrder> buyOrderQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<BuyOrder> buyOrderQueryWrapper = new QueryWrapper<>();
|
||||||
buyOrderQueryWrapper.eq("order_sn", recordEntity.getOrderSn());
|
buyOrderQueryWrapper.eq("order_sn", recordEntity.getOrderSn());
|
||||||
BuyOrder buyOrder = buyOrderService.getOne(buyOrderQueryWrapper);
|
BuyOrder buyOrder = buyOrderService.getOne(buyOrderQueryWrapper);
|
||||||
Integer orderId = buyOrder.getId();
|
Integer orderId = buyOrder.getOrderId();
|
||||||
QueryWrapper<BuyOrderProduct> buyOrderProductQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<BuyOrderProduct> buyOrderProductQueryWrapper = new QueryWrapper<>();
|
||||||
buyOrderProductQueryWrapper.eq("order_id", orderId);
|
buyOrderProductQueryWrapper.eq("order_id", orderId);
|
||||||
buyOrderProductQueryWrapper.eq("product_id", recordEntity.getProductId());
|
buyOrderProductQueryWrapper.eq("product_id", recordEntity.getProductId());
|
||||||
@@ -228,4 +230,45 @@ public class UserRecordController {
|
|||||||
buyOrderProductService.saveOrUpdate(buyOrderProduct);
|
buyOrderProductService.saveOrUpdate(buyOrderProduct);
|
||||||
return R.ok("成功").put("userRecordEntity", recordEntity);
|
return R.ok("成功").put("userRecordEntity", recordEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
TODO 老版本接口,新版本上线后要删除
|
||||||
|
*/
|
||||||
|
@RequestMapping("/UserRecordcomment")
|
||||||
|
public R commodity(@RequestBody UserRecord recordEntity) {
|
||||||
|
//todo 已收货限制字段,只可评价一次
|
||||||
|
BuyOrder buyOrder = buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrder>()
|
||||||
|
.eq("order_sn", recordEntity.getOrderSn())
|
||||||
|
);
|
||||||
|
|
||||||
|
Integer orderId = buyOrder.getOrderId();
|
||||||
|
BuyOrderDetail detailEntity = buyOrderDetailService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderDetail>().eq("Order_id", orderId).eq("product_id", recordEntity.getBookid()));
|
||||||
|
Integer orderId1 = detailEntity.getOrderId();
|
||||||
|
UserRecord userRecordEntity = userRecordService.getBaseMapper().selectOne(new QueryWrapper<UserRecord>().eq("orderSn", recordEntity.getOrderSn()).eq("userid", recordEntity.getUserid()).eq("orderdid", orderId1).last("LIMIT 1"));
|
||||||
|
|
||||||
|
if (userRecordEntity != null) {
|
||||||
|
return R.error("您已评价过");
|
||||||
|
}
|
||||||
|
if (recordEntity.getImages() != null) {
|
||||||
|
List<Map<String, String>> imageList = (ArrayList<Map<String, String>>) recordEntity.getImages();
|
||||||
|
String imageStr = "";
|
||||||
|
for (Map m : imageList) {
|
||||||
|
imageStr += m.get("url") + ",";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
recordEntity.setImages(imageStr);
|
||||||
|
}
|
||||||
|
recordEntity.setDelflag(0);
|
||||||
|
recordEntity.setOrderdId(orderId1);
|
||||||
|
userRecordService.saveOrUpdate(recordEntity);
|
||||||
|
|
||||||
|
|
||||||
|
detailEntity.setRecordId(1);
|
||||||
|
buyOrderDetailService.saveOrUpdate(detailEntity);
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok("成功").put("userRecordEntity", recordEntity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class BuyOrder implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@TableId
|
@TableId
|
||||||
private Integer id;
|
private Integer orderId;
|
||||||
/**
|
/**
|
||||||
* 订单编号
|
* 订单编号
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,5 +16,5 @@ public interface ExpressOrderService extends IService<ExpressOrder> {
|
|||||||
*/
|
*/
|
||||||
ExpressOrderResponseVo placeExpressOrder(ExpressOrder expressOrder);
|
ExpressOrderResponseVo placeExpressOrder(ExpressOrder expressOrder);
|
||||||
|
|
||||||
ExpressQueryResponse queryExpressOrder(String ShipperCode, String LogisticCode);
|
ExpressQueryResponse queryExpressOrder(String ShipperCode, String LogisticCode, String customerName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static org.apache.poi.hemf.hemfplus.record.HemfPlusRecordType.save;
|
|
||||||
|
|
||||||
|
|
||||||
@Service("buyOrderService")
|
@Service("buyOrderService")
|
||||||
public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> implements BuyOrderService {
|
public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> implements BuyOrderService {
|
||||||
@@ -105,7 +103,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
if (!ObjectUtils.isEmpty(myUserEntity)) {
|
if (!ObjectUtils.isEmpty(myUserEntity)) {
|
||||||
record.setUserName(myUserEntity.getName());
|
record.setUserName(myUserEntity.getName());
|
||||||
record.setProducts(buyOrderDetailService.list(new QueryWrapper<BuyOrderDetail>()
|
record.setProducts(buyOrderDetailService.list(new QueryWrapper<BuyOrderDetail>()
|
||||||
.eq("order_id", record.getId())));
|
.eq("order_id", record.getOrderId())));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -129,7 +127,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
page = this.page(page, queryWrapper);
|
page = this.page(page, queryWrapper);
|
||||||
List<BuyOrder> records = page.getRecords();
|
List<BuyOrder> records = page.getRecords();
|
||||||
for (BuyOrder buyOrder : records) {
|
for (BuyOrder buyOrder : records) {
|
||||||
Integer orderId = buyOrder.getId();
|
Integer orderId = buyOrder.getOrderId();
|
||||||
QueryWrapper<BuyOrderDetail> buyOrderDetailQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<BuyOrderDetail> buyOrderDetailQueryWrapper = new QueryWrapper<>();
|
||||||
buyOrderDetailQueryWrapper.eq("order_id", orderId);
|
buyOrderDetailQueryWrapper.eq("order_id", orderId);
|
||||||
List<BuyOrderDetail> buyOrderDetailList = buyOrderDetailService.list(buyOrderDetailQueryWrapper);
|
List<BuyOrderDetail> buyOrderDetailList = buyOrderDetailService.list(buyOrderDetailQueryWrapper);
|
||||||
@@ -187,14 +185,14 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
);
|
);
|
||||||
for (BuyOrder order : buyOrderList) {
|
for (BuyOrder order : buyOrderList) {
|
||||||
order.setProducts(buyOrderDetailService.list(new QueryWrapper<BuyOrderDetail>()
|
order.setProducts(buyOrderDetailService.list(new QueryWrapper<BuyOrderDetail>()
|
||||||
.eq("order_id", order.getId())));
|
.eq("order_id", order.getOrderId())));
|
||||||
orderList.add(order);
|
orderList.add(order);
|
||||||
}
|
}
|
||||||
// 清洗数据 (与前端传来的id对比后)
|
// 清洗数据 (与前端传来的id对比后)
|
||||||
List<BuyOrder> washOrderList = new ArrayList<>();
|
List<BuyOrder> washOrderList = new ArrayList<>();
|
||||||
for (BuyOrder order : orderList) {
|
for (BuyOrder order : orderList) {
|
||||||
for (int o : orderIds) {
|
for (int o : orderIds) {
|
||||||
if (o == order.getId()) {
|
if (o == order.getOrderId()) {
|
||||||
washOrderList.add(order);
|
washOrderList.add(order);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -276,7 +274,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
);
|
);
|
||||||
for (BuyOrder order : buyOrderList.getRecords()) {
|
for (BuyOrder order : buyOrderList.getRecords()) {
|
||||||
order.setProducts(buyOrderDetailService.list(new QueryWrapper<BuyOrderDetail>()
|
order.setProducts(buyOrderDetailService.list(new QueryWrapper<BuyOrderDetail>()
|
||||||
.eq("order_id", order.getId())));
|
.eq("order_id", order.getOrderId())));
|
||||||
orderList.add(order);
|
orderList.add(order);
|
||||||
}
|
}
|
||||||
// 获取有订单的所有用户
|
// 获取有订单的所有用户
|
||||||
@@ -414,7 +412,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
*/
|
*/
|
||||||
private BuyOrderResponseVo setBuyOrderInfo(BuyOrder buyOrder) {
|
private BuyOrderResponseVo setBuyOrderInfo(BuyOrder buyOrder) {
|
||||||
BuyOrderResponseVo responseVo = new BuyOrderResponseVo();
|
BuyOrderResponseVo responseVo = new BuyOrderResponseVo();
|
||||||
responseVo.setOrderId(buyOrder.getId());
|
responseVo.setOrderId(buyOrder.getOrderId());
|
||||||
Integer userId = buyOrder.getUserId();
|
Integer userId = buyOrder.getUserId();
|
||||||
QueryWrapper<MyUserEntity> userEntityQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<MyUserEntity> userEntityQueryWrapper = new QueryWrapper<>();
|
||||||
userEntityQueryWrapper.eq("id", userId);
|
userEntityQueryWrapper.eq("id", userId);
|
||||||
@@ -463,7 +461,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
}
|
}
|
||||||
responseVo.setConsignee(consigneeVo);
|
responseVo.setConsignee(consigneeVo);
|
||||||
QueryWrapper<BuyOrderProduct> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<BuyOrderProduct> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("order_id", buyOrder.getId());
|
queryWrapper.eq("order_id", buyOrder.getOrderId());
|
||||||
List<BuyOrderProduct> buyOrderProductList = buyOrderProductService.list(queryWrapper);
|
List<BuyOrderProduct> buyOrderProductList = buyOrderProductService.list(queryWrapper);
|
||||||
List<GoodsResponseVo> goodsResponseVoList = new ArrayList<>();
|
List<GoodsResponseVo> goodsResponseVoList = new ArrayList<>();
|
||||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
||||||
|
|||||||
@@ -98,9 +98,10 @@ public class ExpressOrderServiceImpl extends ServiceImpl<ExpressOrderDao, Expres
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ExpressQueryResponse queryExpressOrder(String shipperCode, String logisticCode) {
|
public ExpressQueryResponse queryExpressOrder(String shipperCode, String logisticCode, String customerName) {
|
||||||
ExpressQueryRequestVo requestVo = new ExpressQueryRequestVo();
|
ExpressQueryRequestVo requestVo = new ExpressQueryRequestVo();
|
||||||
requestVo.setLogisticCode(logisticCode);
|
requestVo.setLogisticCode(logisticCode);
|
||||||
|
requestVo.setCustomerName(customerName);
|
||||||
requestVo.setShipperCode(shipperCode);
|
requestVo.setShipperCode(shipperCode);
|
||||||
String requestData = JSONObject.toJSONString(requestVo);
|
String requestData = JSONObject.toJSONString(requestVo);
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
|
|||||||
@@ -17,4 +17,8 @@ public class ExpressQueryRequestVo {
|
|||||||
* 快递单号
|
* 快递单号
|
||||||
*/
|
*/
|
||||||
private String LogisticCode;
|
private String LogisticCode;
|
||||||
|
/**
|
||||||
|
* 手机尾号
|
||||||
|
*/
|
||||||
|
private String CustomerName;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user