use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeController method setDeliveryTime.
/**
* 查询店铺信息
*
* @return
*/
@RequestMapping(value = "setDeliveryTime")
@ResponseBody
public String setDeliveryTime() {
ApiRest apiRest = null;
Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
try {
SetDeliveryTimeModel setDeliveryTimeModel = ApplicationHandler.instantiateObject(SetDeliveryTimeModel.class, requestParameters);
setDeliveryTimeModel.validateAndThrow();
apiRest = elemeService.setDeliveryTime(setDeliveryTimeModel);
} catch (Exception e) {
LogUtils.error("设置送达时间失败", controllerSimpleName, "setDeliveryTime", e, requestParameters);
apiRest = new ApiRest(e);
}
return GsonUtils.toJson(apiRest);
}
use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeController method receivedOrderLite.
/**
* 订单确认送达
*
* @return
*/
@RequestMapping(value = "/receivedOrderLite")
@ResponseBody
public String receivedOrderLite() {
ApiRest apiRest = null;
Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
try {
ReceivedOrderLiteModel receivedOrderLiteModel = ApplicationHandler.instantiateObject(ReceivedOrderLiteModel.class, requestParameters);
receivedOrderLiteModel.validateAndThrow();
apiRest = elemeService.receivedOrderLite(receivedOrderLiteModel);
} catch (Exception e) {
LogUtils.error("订单确认送达失败", controllerSimpleName, "receivedOrderLite", e, requestParameters);
apiRest = new ApiRest(e);
}
return GsonUtils.toJson(apiRest);
}
use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeController method getAllOrders.
/**
* 查询全部订单
*
* @return
*/
@RequestMapping(value = "getAllOrders")
@ResponseBody
public String getAllOrders() {
ApiRest apiRest = null;
Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
try {
GetAllOrdersModel getAllOrdersModel = ApplicationHandler.instantiateObject(GetAllOrdersModel.class, requestParameters);
getAllOrdersModel.validateAndThrow();
apiRest = elemeService.getAllOrders(getAllOrdersModel);
} catch (Exception e) {
LogUtils.error("查询全部订单失败", controllerSimpleName, "getAllOrders", e, requestParameters);
apiRest = new ApiRest(e);
}
return GsonUtils.toJson(apiRest);
}
use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeController method cancelDelivery.
/**
* 取消呼叫配送
*
* @return
*/
@RequestMapping(value = "cancelDelivery")
@ResponseBody
public String cancelDelivery() {
ApiRest apiRest = null;
Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
try {
CancelDeliveryModel cancelDeliveryModel = ApplicationHandler.instantiateObject(CancelDeliveryModel.class, requestParameters);
cancelDeliveryModel.validateAndThrow();
apiRest = elemeService.cancelDelivery(cancelDeliveryModel);
} catch (Exception e) {
LogUtils.error("取消呼叫配送失败", controllerSimpleName, "cancelDelivery", e, requestParameters);
apiRest = new ApiRest(e);
}
return GsonUtils.toJson(apiRest);
}
use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeController method getShopCategoriesWithChildren.
@RequestMapping(value = "/getShopCategoriesWithChildren")
@ResponseBody
public String getShopCategoriesWithChildren() {
ApiRest apiRest = null;
Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
try {
String tenantId = requestParameters.get("tenantId");
Validate.notNull(tenantId, "参数(tenantId)不能为空!");
String branchId = requestParameters.get("branchId");
Validate.notNull(branchId, "参数(branchId)不能为空!");
Branch branch = elemeService.findBranch(BigInteger.valueOf(Long.valueOf(tenantId)), BigInteger.valueOf(Long.valueOf(branchId)));
Map<String, Object> params = new HashMap<String, Object>();
params.put("shopId", branch.getShopId());
apiRest = ElemeUtils.callElemeSystem(tenantId, branchId, branch.getElemeAccountType(), "eleme.product.category.getShopCategoriesWithChildren", params);
} catch (Exception e) {
LogUtils.error("查询店铺商品分类失败", controllerSimpleName, "getShopCategoriesWithChildren", e, requestParameters);
apiRest = new ApiRest(e);
}
return GsonUtils.toJson(apiRest);
}
Aggregations