Search in sources :

Example 1 with ApiRest

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

the class DietOrderController method obtainDietOrderInfo.

/**
 * 获取订单明细
 *
 * @return
 */
@RequestMapping(value = "/obtainDietOrderInfo")
@ResponseBody
public String obtainDietOrderInfo() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        ObtainDietOrderInfoModel obtainDietOrderInfoModel = ApplicationHandler.instantiateObject(ObtainDietOrderInfoModel.class, requestParameters);
        obtainDietOrderInfoModel.validateAndThrow();
        apiRest = dietOrderService.obtainDietOrderInfo(obtainDietOrderInfoModel);
    } catch (Exception e) {
        LogUtils.error("获取订单信息失败", controllerSimpleName, "obtainDietOrderInfo", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) ObtainDietOrderInfoModel(build.dream.catering.models.dietorder.ObtainDietOrderInfoModel) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with ApiRest

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

the class ElemeController method queryCompensationOrders.

/**
 * 批量查询索赔结果
 *
 * @return
 */
@RequestMapping(value = "queryCompensationOrders")
@ResponseBody
public String queryCompensationOrders() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        QueryCompensationOrdersModel queryCompensationOrdersModel = ApplicationHandler.instantiateObject(QueryCompensationOrdersModel.class, requestParameters);
        queryCompensationOrdersModel.validateAndThrow();
        apiRest = elemeService.queryCompensationOrders(queryCompensationOrdersModel);
    } catch (Exception e) {
        LogUtils.error("批量查询索赔结果失败", controllerSimpleName, "queryCompensationOrders", 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 3 with ApiRest

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

the class ElemeController method batchApplyCompensations.

/**
 * 批量查询订单是否支持索赔
 *
 * @return
 */
@RequestMapping(value = "batchApplyCompensations")
@ResponseBody
public String batchApplyCompensations() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        BatchApplyCompensationsModel batchApplyCompensationsModel = ApplicationHandler.instantiateObject(BatchApplyCompensationsModel.class, requestParameters);
        batchApplyCompensationsModel.setRequests(requestParameters.get("requests"));
        batchApplyCompensationsModel.validateAndThrow();
        apiRest = elemeService.batchApplyCompensations(batchApplyCompensationsModel);
    } catch (Exception e) {
        LogUtils.error("批量申请索赔失败", controllerSimpleName, "batchApplyCompensations", 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 4 with ApiRest

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

the class ElemeController method getRefundOrders.

/**
 * 查询店铺未处理的退单
 *
 * @return
 */
@RequestMapping(value = "getRefundOrders")
@ResponseBody
public String getRefundOrders() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        GetRefundOrdersModel getRefundOrdersModel = ApplicationHandler.instantiateObject(GetRefundOrdersModel.class, requestParameters);
        getRefundOrdersModel.validateAndThrow();
        apiRest = elemeService.getRefundOrders(getRefundOrdersModel);
    } catch (Exception e) {
        LogUtils.error("查询店铺未处理的退单失败", controllerSimpleName, "getRefundOrders", 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 5 with ApiRest

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

the class ElemeController method cancelOrderLite.

/**
 * 取消订单
 *
 * @return
 */
@RequestMapping(value = "/cancelOrderLite")
@ResponseBody
public String cancelOrderLite() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        CancelOrderLiteModel cancelOrderLiteModel = ApplicationHandler.instantiateObject(CancelOrderLiteModel.class, requestParameters);
        cancelOrderLiteModel.validateAndThrow();
        apiRest = elemeService.cancelOrderLite(cancelOrderLiteModel);
    } catch (Exception e) {
        LogUtils.error("取消订单失败", controllerSimpleName, "cancelOrderLite", 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