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