Search in sources :

Example 16 with ApiRest

use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.

the class ElemeController method getOrder.

@RequestMapping(value = "/getOrder")
@ResponseBody
public String getOrder() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        GetOrderModel getOrderModel = ApplicationHandler.instantiateObject(GetOrderModel.class, requestParameters);
        getOrderModel.validateAndThrow();
        apiRest = elemeService.getOrder(getOrderModel);
    } catch (Exception e) {
        LogUtils.error("获取订单失败", controllerSimpleName, "getOrder", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) IOException(java.io.IOException) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 17 with ApiRest

use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.

the class ElemeController method setBookingStatus.

/**
 * 设置是否支持预定单及预定天数
 *
 * @return
 */
@RequestMapping(value = "/setBookingStatus")
@ResponseBody
public String setBookingStatus() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        SetBookingStatusModel setBookingStatusModel = ApplicationHandler.instantiateObject(SetBookingStatusModel.class, requestParameters);
        setBookingStatusModel.validateAndThrow();
        apiRest = elemeService.setBookingStatus(setBookingStatusModel);
    } catch (Exception e) {
        LogUtils.error("设置是否支持预定单及预定天数失败", controllerSimpleName, "setBookingStatus", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) IOException(java.io.IOException) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 18 with ApiRest

use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.

the class ElemeController method tenantAuthorize.

@RequestMapping(value = "/tenantAuthorize")
@ResponseBody
public String tenantAuthorize() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        TenantAuthorizeModel tenantAuthorizeModel = ApplicationHandler.instantiateObject(TenantAuthorizeModel.class, requestParameters);
        tenantAuthorizeModel.validateAndThrow();
        apiRest = elemeService.tenantAuthorize(tenantAuthorizeModel);
    } catch (Exception e) {
        LogUtils.error("生成授权链接失败", controllerSimpleName, "tenantAuthorize", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) IOException(java.io.IOException) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 19 with ApiRest

use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.

the class ElemeController method agreeRefundLite.

/**
 * 同意退单/同意取消单(推荐)
 *
 * @return
 */
@RequestMapping(value = "/agreeRefundLite")
@ResponseBody
public String agreeRefundLite() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        AgreeRefundLiteModel agreeRefundLiteModel = ApplicationHandler.instantiateObject(AgreeRefundLiteModel.class, requestParameters);
        agreeRefundLiteModel.validateAndThrow();
        apiRest = elemeService.agreeRefundLite(agreeRefundLiteModel);
    } catch (Exception e) {
        LogUtils.error("同意退单/同意取消单失败", controllerSimpleName, "agreeRefundLite", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) IOException(java.io.IOException) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 20 with ApiRest

use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.

the class ElemeController method evaluateRider.

/**
 * 评价骑手
 *
 * @return
 */
@RequestMapping(value = "evaluateRider")
@ResponseBody
public String evaluateRider() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        EvaluateRiderModel evaluateRiderModel = ApplicationHandler.instantiateObject(EvaluateRiderModel.class, requestParameters);
        evaluateRiderModel.validateAndThrow();
        apiRest = elemeService.evaluateRider(evaluateRiderModel);
    } catch (Exception e) {
        LogUtils.error("评价骑手失败", controllerSimpleName, "evaluateRider", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) IOException(java.io.IOException) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

ApiRest (build.dream.common.api.ApiRest)187 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)101 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)101 BigInteger (java.math.BigInteger)78 HashMap (java.util.HashMap)68 IOException (java.io.IOException)59 JSONObject (net.sf.json.JSONObject)56 Transactional (org.springframework.transaction.annotation.Transactional)36 SearchModel (build.dream.common.utils.SearchModel)19 Branch (build.dream.common.erp.catering.domains.Branch)14 ArrayList (java.util.ArrayList)8 SimpleDateFormat (java.text.SimpleDateFormat)6 Map (java.util.Map)6 GoodsCategory (build.dream.common.erp.catering.domains.GoodsCategory)5 SaveBuyGiveActivityModel (build.dream.catering.models.activity.SaveBuyGiveActivityModel)2 SaveSpecialGoodsActivityModel (build.dream.catering.models.activity.SaveSpecialGoodsActivityModel)2 SaveDietOrderModel (build.dream.catering.models.dietorder.SaveDietOrderModel)2 Pos (build.dream.common.erp.catering.domains.Pos)2 Vip (build.dream.common.erp.catering.domains.Vip)2 UpdateModel (build.dream.common.utils.UpdateModel)2