提交代码

new-dev
胡锐 1 year ago committed by Sum1Dream
parent 7076903b16
commit 348e010644
  1. 140
      hai-order/src/main/java/com/web/controller/OrderController.java
  2. 7
      hai-service/src/main/java/com/hai/order/service/OrderService.java
  3. 17
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java

@ -279,65 +279,139 @@ 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 (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());
GoodsDeliveryAddress deliveryAddress = deliveryAddressService.findDeliveryAddressById(order.getDeliveryAddressId());
GoodsOrderModel goodsOrderModel = new GoodsOrderModel();
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();
BeanUtils.copyProperties(highOrder , goodsOrderModel);
HighGroupOrder highGroupOrder = groupCodeService.findGroupOrder(highOrder.getOrderNo());
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")) {
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);
}
}
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);
}

@ -73,7 +73,12 @@ public interface OrderService {
*/
HighOrder getOrderDetailByNo(String orderNo);
/**
* 根据订单号查询交易订单号详情
* @param paySerialNo 订单号
* @return
*/
HighOrder getOrderDetailBySerialNo(String paySerialNo);
/**
* @Author Sum1Dream

@ -831,6 +831,23 @@ public class OrderServiceImpl implements OrderService {
return order;
}
@Override
public HighOrder getOrderDetailBySerialNo(String paySerialNo) {
HighOrderExample orderExample = new HighOrderExample();
orderExample.createCriteria().andPaySerialNoEqualTo(paySerialNo);
List<HighOrder> orderList = orderMapper.selectByExample(orderExample);
if (orderList.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号");
}
HighOrder order = orderList.get(0);
// 子订单
HighChildOrderExample childOrderExample = new HighChildOrderExample();
childOrderExample.createCriteria().andOrderIdEqualTo(order.getId());
order.setHighChildOrderList(childOrderMapper.selectByExample(childOrderExample));
return order;
}
@Override
public HighOrder getOrderDetail(String orderNo) {
HighOrderExample orderExample = new HighOrderExample();

Loading…
Cancel
Save