袁野 4 months ago
parent 91212c39f3
commit d556349330
  1. 2
      order/src/main/java/com/order/controller/OrderController.java
  2. 2
      order/src/main/java/com/order/controller/business/BsOrderStarbucksController.java
  3. 2
      service/src/main/java/com/hfkj/common/utils/StarbucksUtil.java
  4. 2
      service/src/main/java/com/hfkj/model/order/OrderStarbucksModel.java
  5. 9
      service/src/main/java/com/hfkj/qianzhu/channel/StarbucksService.java
  6. 13
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java

@ -57,6 +57,7 @@ public class OrderController {
@ApiOperation(value = "创建订单")
public ResponseData create(@RequestBody OrderModel body) {
try {
System.out.println("body" + body.toString());
// 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
if (userSession == null) {
@ -86,6 +87,7 @@ public class OrderController {
body.setUserName(userSession.getUser().getName());
body.setUserPhone(userSession.getUser().getPhone());
return ResponseMsgUtil.success(orderService.create(body));
} catch (Exception e) {

@ -89,7 +89,7 @@ public class BsOrderStarbucksController {
starbucksModel.setStoreAddress(starbucks.get(0).getStoreAddress());
starbucksModel.setStoreName(starbucks.get(0).getStoreName());
starbucksModel.setUserPhone(starbucks.get(0).getUserPhone());
starbucksModel.setPayType(starbucks.get(0).getPayType());
starbucksModelList.add(starbucksModel);
}

@ -55,7 +55,7 @@ public class StarbucksUtil {
obj.put("cpu", "超大杯");
obj.put("notSelect", venti);
obj.put("select", ventiSelect);
obj.put("volume", "473ml");
obj.put("volume", "592ml");
obj.put("price", ventiPrice);
break;
default:

@ -17,4 +17,6 @@ public class OrderStarbucksModel extends BsOrderChild{
private String storeName;
private String userPhone;
private Integer payType;
}

@ -103,14 +103,17 @@ public class StarbucksService {
* @Author: Sum1Dream
* @Date: 2024/8/1 下午2:21
*/
public static JSONObject starbucksOrdersPay(Map<String , Object> map) throws Exception {
public static JSONObject starbucksOrdersPay(Map<String , Object> map) {
try {
JSONObject object = QianZhuService.requestH5("starbucksOrders.pay" , map);
if (object.getBoolean("success")) {
return object;
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!");
return null;
}
} catch (Exception e) {
return null;
}
}

@ -76,7 +76,7 @@ public class OrderPaySuccessService {
} else if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type3.getCode())) {
cinema(order, childOrder);
} else if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type4.getCode())) {
starbucks(childOrder);
starbucks(order , childOrder);
}
} catch (Exception e) {
@ -288,12 +288,21 @@ public class OrderPaySuccessService {
}
public void starbucks(BsOrderChild childOrder) throws Exception {
public void starbucks(OrderModel order,BsOrderChild childOrder) {
// 推送订单
// 查询星巴克订单
Map<String , Object> map = new HashMap<>();
map.put("orderNo", childOrder.getChannelOrderNo());
StarbucksService.starbucksOrdersPay(map);
Map<String, Object> params = new HashMap<>();
params.put("orderNo", childOrder.getOrderNo());
List<BsOrderStarbucks> orderStarbucks = bsOrderStarbucksService.getList(params);
for (BsOrderStarbucks bsOrderStarbucks : orderStarbucks) {
bsOrderStarbucks.setPayType(order.getPayType());
bsOrderStarbucksService.update(bsOrderStarbucks);
}
}

Loading…
Cancel
Save