|
|
@ -380,9 +380,8 @@ public class HighThirdPartyController { |
|
|
|
|
|
|
|
|
|
|
|
if (order.getHighChildOrderList().get(0).getGoodsType() == 4) { |
|
|
|
if (order.getHighChildOrderList().get(0).getGoodsType() == 4) { |
|
|
|
|
|
|
|
|
|
|
|
object = QianZhuConfig.getKfcOrderByOrderNo(order.getOrderNo()); |
|
|
|
object = QianZhuConfig.getKfcOrderByOrderNo(order.getHighChildOrderList().get(0).getChannelOrderNo()); |
|
|
|
if (object.getBoolean("success")) { |
|
|
|
if (object.getBoolean("success")) { |
|
|
|
BeanUtils.copyProperties(order, partyModel); |
|
|
|
|
|
|
|
partyModel.setCode(object.getJSONObject("data").getString("ticket")); |
|
|
|
partyModel.setCode(object.getJSONObject("data").getString("ticket")); |
|
|
|
partyModel.setThirdOrderStatus(object.getJSONObject("data").getInteger("status")); |
|
|
|
partyModel.setThirdOrderStatus(object.getJSONObject("data").getInteger("status")); |
|
|
|
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc")); |
|
|
|
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc")); |
|
|
@ -407,32 +406,14 @@ public class HighThirdPartyController { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message")); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message")); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) { |
|
|
|
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) { |
|
|
|
// 查询详单订单的实际
|
|
|
|
|
|
|
|
JSONObject productDetail = thirdProductConfig.getThirdPartyByDetail(1, 1, order.getCompanyId() , null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
object = QianZhuConfig.starbucksOrderByOrderNo(order.getOrderNo()); |
|
|
|
object = QianZhuConfig.starbucksOrderByOrderNo(order.getOrderNo()); |
|
|
|
if (object.getBoolean("success")) { |
|
|
|
if (object.getBoolean("success")) { |
|
|
|
BeanUtils.copyProperties(order, partyModel); |
|
|
|
|
|
|
|
partyModel.setCode(object.getJSONObject("data").getString("ticket")); |
|
|
|
partyModel.setCode(object.getJSONObject("data").getString("ticket")); |
|
|
|
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc")); |
|
|
|
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc")); |
|
|
|
partyModel.setObject(object.getJSONObject("data")); |
|
|
|
partyModel.setObject(object.getJSONObject("data")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取星巴克订单内容
|
|
|
|
|
|
|
|
JSONArray starbucksOrder = object.getJSONObject("data").getJSONArray("orderItems"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Object starbucksObject : starbucksOrder) { |
|
|
|
|
|
|
|
JSONObject childObject = (JSONObject) starbucksObject; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 计算利润
|
|
|
|
|
|
|
|
BigDecimal profitPrice = childObject.getBigDecimal("unitPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100))); |
|
|
|
|
|
|
|
BigDecimal childPrice = childObject.getBigDecimal("unitPrice").add(profitPrice).setScale(2 , RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
// 计算实际支付金额
|
|
|
|
|
|
|
|
orderPayPrice = orderPayPrice.add(childPrice); |
|
|
|
|
|
|
|
childObject.put("unitPrice" , childPrice); |
|
|
|
|
|
|
|
childObject.put("totalPrice" , childPrice.multiply(childObject.getBigDecimal("quantity"))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
object.getJSONObject("data").put("paymentAmount" , orderPayPrice); |
|
|
|
object.getJSONObject("data").put("paymentAmount" , orderPayPrice); |
|
|
|
|
|
|
|
|
|
|
|
partyModel.setObject(object.getJSONObject("data")); |
|
|
|
partyModel.setObject(object.getJSONObject("data")); |
|
|
@ -455,10 +436,7 @@ public class HighThirdPartyController { |
|
|
|
log.error("getThirdOrderByOrderId error!", "查询失败!"); |
|
|
|
log.error("getThirdOrderByOrderId error!", "查询失败!"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message")); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message")); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 10) { |
|
|
|
|
|
|
|
BeanUtils.copyProperties(order, partyModel); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(partyModel); |
|
|
|
return ResponseMsgUtil.success(partyModel); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("HighUserCardController --> oilCardRefund() error!", e); |
|
|
|
log.error("HighUserCardController --> oilCardRefund() error!", e); |
|
|
|