use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeController method setOrderPackingFee.
/**
* 设置订单餐盒费
*
* @return
*/
@RequestMapping(value = "/setOrderPackingFee")
@ResponseBody
public String setOrderPackingFee() {
ApiRest apiRest = null;
Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
try {
SetOrderPackingFeeModel setOrderPackingFeeModel = ApplicationHandler.instantiateObject(SetOrderPackingFeeModel.class, requestParameters);
setOrderPackingFeeModel.validateAndThrow();
Branch branch = elemeService.findBranch(setOrderPackingFeeModel.getTenantId(), setOrderPackingFeeModel.getBranchId());
Map<String, Object> params = new HashMap<String, Object>();
params.put("shopId", branch.getShopId());
params.put("status", setOrderPackingFeeModel.getStatus());
ApplicationHandler.ifNotNullPut(params, "packingFee", setOrderPackingFeeModel.getPackingFee());
ApiRest callElemeSystemApiRest = ElemeUtils.callElemeSystem(setOrderPackingFeeModel.getTenantId().toString(), setOrderPackingFeeModel.getBranchId().toString(), branch.getElemeAccountType(), "eleme.product.item.setOrderPackingFee", params);
Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
apiRest = new ApiRest();
apiRest.setMessage("设置订单餐盒费成功!");
apiRest.setSuccessful(true);
} catch (Exception e) {
LogUtils.error("设置订单餐盒费失败", controllerSimpleName, "setOrderPackingFee", 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 getDeliveryStateRecord.
/**
* 获取订单配送记录
*
* @return
*/
@RequestMapping(value = "/getDeliveryStateRecord")
@ResponseBody
public String getDeliveryStateRecord() {
ApiRest apiRest = null;
Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
try {
GetDeliveryStateRecordModel getDeliveryStateRecordModel = ApplicationHandler.instantiateObject(GetDeliveryStateRecordModel.class, requestParameters);
getDeliveryStateRecordModel.validateAndThrow();
apiRest = elemeService.getDeliveryStateRecord(getDeliveryStateRecordModel);
} catch (Exception e) {
LogUtils.error("获取订单配送记录失败", controllerSimpleName, "getDeliveryStateRecord", 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 batchGetShopStatus.
/**
* 查询店铺信息
*
* @return
*/
@RequestMapping(value = "batchGetShopStatus")
@ResponseBody
public String batchGetShopStatus() {
ApiRest apiRest = null;
Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
try {
BatchGetShopStatusModel batchGetShopStatusModel = ApplicationHandler.instantiateObject(BatchGetShopStatusModel.class, requestParameters);
batchGetShopStatusModel.validateAndThrow();
apiRest = elemeService.batchGetShopStatus(batchGetShopStatusModel);
} catch (Exception e) {
LogUtils.error("批量获取店铺简要失败", controllerSimpleName, "batchGetShopStatus", 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 replyReminder.
/**
* 回复催单
*
* @return
*/
@RequestMapping(value = "/replyReminder")
@ResponseBody
public String replyReminder() {
ApiRest apiRest = null;
Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
try {
ReplyReminderModel replyReminderModel = ApplicationHandler.instantiateObject(ReplyReminderModel.class, requestParameters);
replyReminderModel.validateAndThrow();
apiRest = elemeService.replyReminder(replyReminderModel);
} catch (Exception e) {
LogUtils.error("回复催单失败", controllerSimpleName, "replyReminder", 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 setOrderPrepared.
/**
* 非自配送餐厅标记已出餐
*
* @return
*/
@RequestMapping(value = "setOrderPrepared")
@ResponseBody
public String setOrderPrepared() {
ApiRest apiRest = null;
Map<String, String> requestParameters = ApplicationHandler.getRequestParameters();
try {
SetOrderPreparedModel setOrderPreparedModel = ApplicationHandler.instantiateObject(SetOrderPreparedModel.class, requestParameters);
setOrderPreparedModel.validateAndThrow();
apiRest = elemeService.setOrderPrepared(setOrderPreparedModel);
} catch (Exception e) {
LogUtils.error("非自配送餐厅标记已出餐失败", controllerSimpleName, "setOrderPrepared", e, requestParameters);
apiRest = new ApiRest(e);
}
return GsonUtils.toJson(apiRest);
}
Aggregations