|
|
|
@ -279,11 +279,17 @@ public class OrderController { |
|
|
|
|
@RequestMapping(value="/getDetailByOrderNo",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "根据订单号查询详情") |
|
|
|
|
public ResponseData getDetailByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { |
|
|
|
|
public ResponseData getDetailByOrderNo(@RequestParam(name = "orderNo", required = false) String orderNo, |
|
|
|
|
@RequestParam(name = "paySerialNo", required = false) String paySerialNo) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
HighOrder highOrder = orderService.getOrderDetailByNo(orderNo); |
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(orderNo) && StringUtils.isBlank(paySerialNo)) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.USE_VISIT_ILLEGAL, ""); |
|
|
|
|
} |
|
|
|
|
HighOrder highOrder = null; |
|
|
|
|
if (StringUtils.isBlank(orderNo)) { |
|
|
|
|
highOrder = orderService.getOrderDetailByNo(orderNo); |
|
|
|
|
if (highOrder.getProductType() == 12) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -338,6 +344,74 @@ public class OrderController { |
|
|
|
|
HighGroupCode highGroupCode = groupCodeService.findGroupCode(map); |
|
|
|
|
goodsOrderModel.setHighGroupCode(highGroupCode); |
|
|
|
|
return ResponseMsgUtil.success(goodsOrderModel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(paySerialNo)) { |
|
|
|
|
highOrder = orderService.getOrderDetailBySerialNo(paySerialNo); |
|
|
|
|
if (highOrder.getProductType() == 12) { |
|
|
|
|
|
|
|
|
|
// todo 临时代码
|
|
|
|
|
|
|
|
|
|
for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { |
|
|
|
|
|
|
|
|
|
GoodsLogistics logistics = goodsLogisticsService.findGoodsLogistics(childOrder.getId()); |
|
|
|
|
if (logistics != null) { |
|
|
|
|
childOrder.setExt6(logistics.getLogisticsStatusDesc()); |
|
|
|
|
childOrder.setExt4(logistics.getNumber()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GoodsOrder order = goodsOrderExtService.findGoodsOrder(highOrder.getOrderNo()); |
|
|
|
|
GoodsDeliveryAddress deliveryAddress = deliveryAddressService.findDeliveryAddressById(order.getDeliveryAddressId()); |
|
|
|
|
|
|
|
|
|
GoodsOrderModel goodsOrderModel = new GoodsOrderModel(); |
|
|
|
|
BeanUtils.copyProperties(highOrder , goodsOrderModel); |
|
|
|
|
goodsOrderModel.setGoodsOrder(order); |
|
|
|
|
goodsOrderModel.setGoodsDeliveryAddress(deliveryAddress); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(goodsOrderModel); |
|
|
|
|
|
|
|
|
|
} else if (highOrder.getProductType() == 17) { |
|
|
|
|
|
|
|
|
|
GoodsOrderModel goodsOrderModel = new GoodsOrderModel(); |
|
|
|
|
BeanUtils.copyProperties(highOrder , goodsOrderModel); |
|
|
|
|
|
|
|
|
|
HighGroupOrder highGroupOrder = groupCodeService.findGroupOrder(highOrder.getOrderNo()); |
|
|
|
|
|
|
|
|
|
JSONObject object = groupService.getGroupContent(highGroupOrder.getGroupId()); |
|
|
|
|
|
|
|
|
|
if (object.getString("return_code").equals("000000")) { |
|
|
|
|
goodsOrderModel.setGroupData(object.getJSONObject("return_data")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JSONObject objectStore = groupService.getStoreMsg(highGroupOrder.getStoreId()); |
|
|
|
|
|
|
|
|
|
if (objectStore.getString("return_code").equals("000000")) { |
|
|
|
|
goodsOrderModel.setStoreData(objectStore.getJSONObject("return_data")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
map.put("orderId" , highOrder.getId()); |
|
|
|
|
|
|
|
|
|
HighGroupCode highGroupCode = groupCodeService.findGroupCode(map); |
|
|
|
|
goodsOrderModel.setHighGroupCode(highGroupCode); |
|
|
|
|
return ResponseMsgUtil.success(goodsOrderModel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|