Commit 800f4f2f authored by 何金镒's avatar 何金镒

建发:共享空间优惠券预约 mcp 接口优化 3

parent c9dab933
...@@ -74,11 +74,7 @@ public class CDCSpacesTools { ...@@ -74,11 +74,7 @@ public class CDCSpacesTools {
log.info("mcp调用--->bookingOrder..预约订单..sn:{},beginTime:{},endTime:{},roomId:{},roomSubspaceId:{},userQuantity:{}", log.info("mcp调用--->bookingOrder..预约订单..sn:{},beginTime:{},endTime:{},roomId:{},roomSubspaceId:{},userQuantity:{}",
sn,beginTime,endTime,roomId,subspaceId,userQuantity); sn,beginTime,endTime,roomId,subspaceId,userQuantity);
try { try {
if(spacesService.bookingOrder2(sn,beginTime,endTime,roomId,subspaceId,userQuantity)){ return spacesService.bookingOrder2(sn,beginTime,endTime,roomId,subspaceId,userQuantity);
return "预约成功";
}else{
return "预约失败";
}
}catch (StatefulException e){ }catch (StatefulException e){
return e.getMessage(); return e.getMessage();
} }
......
...@@ -296,7 +296,7 @@ public class SpacesService { ...@@ -296,7 +296,7 @@ public class SpacesService {
* *
* 预约订单,不使用钱 使用了优惠卷-自动查找优惠券 * 预约订单,不使用钱 使用了优惠卷-自动查找优惠券
*/ */
public boolean bookingOrder2(String sn,String beginTime,String endTime,String roomId,String subspaceId,int userQuantity){ public String bookingOrder2(String sn,String beginTime,String endTime,String roomId,String subspaceId,int userQuantity){
if(StrUtil.isBlank(sn) || StrUtil.isBlank(roomId) || StrUtil.isBlank(beginTime) || StrUtil.isBlank(endTime) || userQuantity<1){ if(StrUtil.isBlank(sn) || StrUtil.isBlank(roomId) || StrUtil.isBlank(beginTime) || StrUtil.isBlank(endTime) || userQuantity<1){
throw new StatefulException(530, "参数错误"); throw new StatefulException(530, "参数错误");
} }
...@@ -374,7 +374,7 @@ public class SpacesService { ...@@ -374,7 +374,7 @@ public class SpacesService {
String spacesRoomOrder_post = cdcHttpUtils.post(spacesRoomOrderUrl, sn, param.toString()); String spacesRoomOrder_post = cdcHttpUtils.post(spacesRoomOrderUrl, sn, param.toString());
JSONObject spacesRoomOrder = new JSONObject(spacesRoomOrder_post); JSONObject spacesRoomOrder = new JSONObject(spacesRoomOrder_post);
if(spacesRoomOrder.getInt("code") == 200){ if(spacesRoomOrder.getInt("code") == 200){
return true; return "预约成功,预约订单号:"+spacesRoomOrder.getStr("data");
}else{ }else{
throw new StatefulException(539, "预约失败"); throw new StatefulException(539, "预约失败");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment