use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeService method setDeliveryTime.
/**
* 设置送达时间
*
* @param setDeliveryTimeModel
* @return
* @throws IOException
*/
public ApiRest setDeliveryTime(SetDeliveryTimeModel setDeliveryTimeModel) throws IOException {
BigInteger tenantId = setDeliveryTimeModel.getTenantId();
BigInteger branchId = setDeliveryTimeModel.getBranchId();
Branch branch = findBranch(tenantId, branchId);
Map<String, Object> params = new HashMap<String, Object>();
params.put("shopId", branch.getShopId());
params.put("deliveryBasicMins", setDeliveryTimeModel.getDeliveryBasicMins());
params.put("deliveryAdjustMins", setDeliveryTimeModel.getDeliveryAdjustMins());
ApiRest callElemeSystemApiRest = ElemeUtils.callElemeSystem(tenantId.toString(), branchId.toString(), branch.getElemeAccountType(), "eleme.shop.setDeliveryTime", params);
Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
return new ApiRest(callElemeSystemApiRest.getData(), "设置送达时间成功!");
}
use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeService method batchGetRefundOrders.
/**
* 批量获取订单退款信息
*
* @param batchGetRefundOrdersModel
* @return
* @throws IOException
*/
public ApiRest batchGetRefundOrders(BatchGetRefundOrdersModel batchGetRefundOrdersModel) throws IOException {
BigInteger tenantId = batchGetRefundOrdersModel.getTenantId();
BigInteger branchId = batchGetRefundOrdersModel.getBranchId();
Branch branch = findBranch(tenantId, branchId);
List<ElemeOrder> elemeOrders = findAllElemeOrders(tenantId, branchId, batchGetRefundOrdersModel.getElemeOrderIds());
List<String> orderIds = obtainOrderIds(elemeOrders);
Map<String, Object> params = new HashMap<String, Object>();
params.put("orderIds", orderIds);
ApiRest callElemeSystemApiRest = ElemeUtils.callElemeSystem(tenantId.toString(), branchId.toString(), branch.getElemeAccountType(), "eleme.order.mgetRefundOrders", params);
Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
return new ApiRest(callElemeSystemApiRest.getData(), "批量获取订单退款信息成功!");
}
use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeService method callDelivery.
/**
* 呼叫配送
*
* @param callDeliveryModel
* @return
* @throws IOException
*/
public ApiRest callDelivery(CallDeliveryModel callDeliveryModel) throws IOException {
BigInteger tenantId = callDeliveryModel.getTenantId();
BigInteger branchId = callDeliveryModel.getBranchId();
BigInteger elemeOrderId = callDeliveryModel.getElemeOrderId();
Branch branch = findBranch(tenantId, branchId);
ElemeOrder elemeOrder = findElemeOrder(tenantId, branchId, elemeOrderId);
Map<String, Object> params = new HashMap<String, Object>();
params.put("orderId", elemeOrder.getOrderId());
ApplicationHandler.ifNotNullPut(params, "fee", callDeliveryModel.getFee());
ApiRest callElemeSystemApiRest = ElemeUtils.callElemeSystem(tenantId.toString(), branchId.toString(), branch.getElemeAccountType(), "eleme.order.callDelivery", params);
Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
return new ApiRest(callElemeSystemApiRest.getData(), "呼叫配送成功!");
}
use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeService method querySupportedCompensationOrders.
/**
* 批量查询订单是否支持索赔
*
* @param querySupportedCompensationOrdersModel
* @return
* @throws IOException
*/
public ApiRest querySupportedCompensationOrders(QuerySupportedCompensationOrdersModel querySupportedCompensationOrdersModel) throws IOException {
BigInteger tenantId = querySupportedCompensationOrdersModel.getTenantId();
BigInteger branchId = querySupportedCompensationOrdersModel.getBranchId();
Branch branch = findBranch(tenantId, branchId);
List<ElemeOrder> elemeOrders = findAllElemeOrders(tenantId, branchId, querySupportedCompensationOrdersModel.getElemeOrderIds());
List<String> orderIds = obtainOrderIds(elemeOrders);
Map<String, Object> params = new HashMap<String, Object>();
params.put("orderIds", orderIds);
ApiRest callElemeSystemApiRest = ElemeUtils.callElemeSystem(tenantId.toString(), branchId.toString(), branch.getElemeAccountType(), "eleme.order.querySupportedCompensationOrders", params);
Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
return new ApiRest(callElemeSystemApiRest.getData(), "批量查询订单是否支持索赔成功!");
}
use of build.dream.common.api.ApiRest in project erp-catering by liuyandong33.
the class ElemeService method getDeliveryFeeForCrowd.
/**
* 众包订单询价,获取配送费
*
* @param getDeliveryFeeForCrowdModel
* @return
* @throws IOException
*/
public ApiRest getDeliveryFeeForCrowd(GetDeliveryFeeForCrowdModel getDeliveryFeeForCrowdModel) throws IOException {
BigInteger tenantId = getDeliveryFeeForCrowdModel.getTenantId();
BigInteger branchId = getDeliveryFeeForCrowdModel.getBranchId();
Branch branch = findBranch(tenantId, branchId);
ElemeOrder elemeOrder = findElemeOrder(tenantId, branchId, getDeliveryFeeForCrowdModel.getElemeOrderId());
Map<String, Object> params = new HashMap<String, Object>();
params.put("orderId", elemeOrder.getOrderId());
ApiRest callElemeSystemApiRest = ElemeUtils.callElemeSystem(tenantId.toString(), branchId.toString(), branch.getElemeAccountType(), "eleme.order.getDeliveryFeeForCrowd", params);
Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
return new ApiRest(callElemeSystemApiRest.getData(), "众包订单询价,获取配送费成功!");
}
Aggregations