Search in sources :

Example 41 with ApiRest

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

the class AnubisController method orderCarrier.

/**
 * 订单骑手位置查询
 *
 * @return
 */
@RequestMapping(value = "/orderCarrier")
@ResponseBody
public String orderCarrier() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        OrderCarrierModel orderCarrierModel = ApplicationHandler.instantiateObject(OrderCarrierModel.class, requestParameters);
        orderCarrierModel.validateAndThrow();
        apiRest = anubisService.orderCarrier(orderCarrierModel);
    } catch (Exception e) {
        LogUtils.error("订单骑手位置查询失败", controllerSimpleName, "orderCarrier", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 42 with ApiRest

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

the class BranchController method listBranches.

@RequestMapping(value = "/listBranches")
@ResponseBody
public String listBranches() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        ListBranchesModel listBranchesModel = ApplicationHandler.instantiateObject(ListBranchesModel.class, requestParameters);
        listBranchesModel.validateAndThrow();
        apiRest = branchService.listBranches(listBranchesModel);
    } catch (Exception e) {
        LogUtils.error("查询门店列表失败", controllerSimpleName, "listBranches", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 43 with ApiRest

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

the class BranchController method deleteBranch.

/**
 * 删除门店
 *
 * @return
 */
@RequestMapping(value = "/deleteBranch")
@ResponseBody
public String deleteBranch() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        DeleteBranchModel deleteBranchModel = ApplicationHandler.instantiateObject(DeleteBranchModel.class, requestParameters);
        deleteBranchModel.validateAndThrow();
        apiRest = branchService.deleteBranch(deleteBranchModel);
    } catch (Exception e) {
        LogUtils.error("删除门店信息失败", controllerSimpleName, "deleteBranch", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 44 with ApiRest

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

the class BranchController method pullBranchInfos.

/**
 * 拉取门店信息
 *
 * @return
 */
@RequestMapping(value = "/pullBranchInfos")
@ResponseBody
public String pullBranchInfos() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        PullBranchInfosModel pullBranchInfosModel = ApplicationHandler.instantiateObject(PullBranchInfosModel.class, requestParameters);
        pullBranchInfosModel.validateAndThrow();
        apiRest = branchService.pullBranchInfos(pullBranchInfosModel);
    } catch (Exception e) {
        LogUtils.error("拉取门店信息失败", controllerSimpleName, "pullBranchInfos", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 45 with ApiRest

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

the class BranchController method initializeBranch.

@RequestMapping(value = "/initializeBranch")
@ResponseBody
public String initializeBranch() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        InitializeBranchModel initializeBranchModel = ApplicationHandler.instantiateObject(InitializeBranchModel.class, requestParameters);
        initializeBranchModel.validateAndThrow();
        apiRest = branchService.initializeBranch(initializeBranchModel);
    } catch (Exception e) {
        LogUtils.error("初始化门店失败", controllerSimpleName, "initializeBranch", e, requestParameters);
        apiRest = new ApiRest(e);
    }
    return GsonUtils.toJson(apiRest);
}
Also used : ApiRest(build.dream.common.api.ApiRest) 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