Search in sources :

Example 36 with ApiRest

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

the class AnubisController method chainStore.

/**
 * 添加门店
 *
 * @return
 */
@RequestMapping(value = "/chainStore")
@ResponseBody
public String chainStore() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        ChainStoreModel chainStoreModel = ApplicationHandler.instantiateObject(ChainStoreModel.class, requestParameters);
        chainStoreModel.validateAndThrow();
        apiRest = anubisService.chainStore(chainStoreModel);
    } catch (Exception e) {
        LogUtils.error("添加门店失败", controllerSimpleName, "chainStore", 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 37 with ApiRest

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

the class AnubisController method chainStoreDeliveryQuery.

/**
 * 查询配送服务
 *
 * @return
 */
@RequestMapping(value = "/chainStoreDeliveryQuery")
@ResponseBody
public String chainStoreDeliveryQuery() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        ChainStoreDeliveryQueryModel chainStoreDeliveryQueryModel = ApplicationHandler.instantiateObject(ChainStoreDeliveryQueryModel.class, requestParameters);
        chainStoreDeliveryQueryModel.validateAndThrow();
        apiRest = anubisService.chainStoreDeliveryQuery(chainStoreDeliveryQueryModel);
    } catch (Exception e) {
        LogUtils.error("查询配送服务失败", controllerSimpleName, "chainStoreDeliveryQuery", 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 38 with ApiRest

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

the class AnubisController method orderCancel.

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

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

the class AnubisController method obtainDeliveryStates.

/**
 * 获取配送记录
 *
 * @return
 */
@RequestMapping(value = "/obtainDeliveryStates")
@ResponseBody
public String obtainDeliveryStates() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        ObtainDeliveryStatesModel obtainDeliveryStatesModel = ApplicationHandler.instantiateObject(ObtainDeliveryStatesModel.class, requestParameters);
        obtainDeliveryStatesModel.validateAndThrow();
        apiRest = anubisService.obtainDeliveryStates(obtainDeliveryStatesModel);
    } catch (Exception e) {
        LogUtils.error("获取配送记录失败", controllerSimpleName, "obtainDeliveryStates", 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 40 with ApiRest

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

the class AnubisController method chainStoreUpdate.

/**
 * 更新门店信息
 *
 * @return
 */
@RequestMapping(value = "/chainStoreUpdate")
@ResponseBody
public String chainStoreUpdate() {
    ApiRest apiRest = null;
    Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
    try {
        ChainStoreUpdateModel chainStoreUpdateModel = ApplicationHandler.instantiateObject(ChainStoreUpdateModel.class, requestParameters);
        chainStoreUpdateModel.validateAndThrow();
        apiRest = anubisService.chainStoreUpdate(chainStoreUpdateModel);
    } catch (Exception e) {
        LogUtils.error("更新门店信息失败", controllerSimpleName, "chainStoreUpdate", 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