Search in sources :

Example 71 with ApiRest

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

the class ElemeService method getUnreplyReminders.

/**
 * 获取店铺未回复的催单
 *
 * @param getUnreplyRemindersModel
 * @return
 * @throws IOException
 */
public ApiRest getUnreplyReminders(GetUnreplyRemindersModel getUnreplyRemindersModel) throws IOException {
    BigInteger tenantId = getUnreplyRemindersModel.getTenantId();
    BigInteger branchId = getUnreplyRemindersModel.getBranchId();
    Branch branch = findBranch(tenantId, branchId);
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("shopId", branch.getShopId());
    ApiRest callElemeSystemApiRest = ElemeUtils.callElemeSystem(tenantId.toString(), branchId.toString(), branch.getElemeAccountType(), "eleme.order.getUnreplyReminders", params);
    Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
    return new ApiRest(callElemeSystemApiRest.getData(), "获取店铺未回复的催单成功!");
}
Also used : HashMap(java.util.HashMap) BigInteger(java.math.BigInteger) JSONObject(net.sf.json.JSONObject) ApiRest(build.dream.common.api.ApiRest)

Example 72 with ApiRest

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

the class ElemeService method agreeRefundLite.

/**
 * 同意退单/同意取消单
 *
 * @param agreeRefundLiteModel
 * @return
 * @throws IOException
 */
public ApiRest agreeRefundLite(AgreeRefundLiteModel agreeRefundLiteModel) throws IOException {
    BigInteger tenantId = agreeRefundLiteModel.getTenantId();
    BigInteger branchId = agreeRefundLiteModel.getBranchId();
    BigInteger elemeOrderId = agreeRefundLiteModel.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());
    ApiRest callElemeSystemApiRest = ElemeUtils.callElemeSystem(tenantId.toString(), branchId.toString(), branch.getElemeAccountType(), "eleme.order.agreeRefundLite", params);
    Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
    return new ApiRest(callElemeSystemApiRest.getData(), "同意退单/同意取消单成功!");
}
Also used : HashMap(java.util.HashMap) BigInteger(java.math.BigInteger) JSONObject(net.sf.json.JSONObject) ApiRest(build.dream.common.api.ApiRest)

Example 73 with ApiRest

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

the class ElemeService method getOrderRateByOrderId.

/**
 * 获取指定订单的评论
 *
 * @param getOrderRateByOrderIdModel
 * @return
 * @throws IOException
 */
public ApiRest getOrderRateByOrderId(GetOrderRateByOrderIdModel getOrderRateByOrderIdModel) throws IOException {
    BigInteger tenantId = getOrderRateByOrderIdModel.getTenantId();
    BigInteger branchId = getOrderRateByOrderIdModel.getBranchId();
    Branch branch = findBranch(tenantId, branchId);
    ElemeOrder elemeOrder = findElemeOrder(tenantId, branchId, getOrderRateByOrderIdModel.getDietOrderId());
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("orderId", elemeOrder.getOrderId());
    ApiRest callElemeSystemApiRest = ElemeUtils.callElemeSystem(tenantId.toString(), branchId.toString(), branch.getElemeAccountType(), "eleme.ugc.getOrderRateByOrderId", params);
    Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
    return new ApiRest(callElemeSystemApiRest.getData(), "获取指定订单的评论成功!");
}
Also used : HashMap(java.util.HashMap) BigInteger(java.math.BigInteger) JSONObject(net.sf.json.JSONObject) ApiRest(build.dream.common.api.ApiRest)

Example 74 with ApiRest

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

the class ElemeService method getPreparedTimesByOrderIds.

/**
 * 查询已出餐列表
 *
 * @param getPreparedTimesByOrderIdsModel
 * @return
 * @throws IOException
 */
public ApiRest getPreparedTimesByOrderIds(GetPreparedTimesByOrderIdsModel getPreparedTimesByOrderIdsModel) throws IOException {
    BigInteger tenantId = getPreparedTimesByOrderIdsModel.getTenantId();
    BigInteger branchId = getPreparedTimesByOrderIdsModel.getBranchId();
    Branch branch = findBranch(tenantId, branchId);
    List<ElemeOrder> elemeOrders = findAllElemeOrders(tenantId, branchId, getPreparedTimesByOrderIdsModel.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.getPreparedTimesByOrderIds", params);
    Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
    return new ApiRest(callElemeSystemApiRest.getData(), "查询已出餐列表成功!");
}
Also used : HashMap(java.util.HashMap) BigInteger(java.math.BigInteger) JSONObject(net.sf.json.JSONObject) ApiRest(build.dream.common.api.ApiRest)

Example 75 with ApiRest

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

the class ElemeService method getAllOrders.

/**
 * 查询全部订单
 *
 * @param getAllOrdersModel
 * @return
 * @throws IOException
 */
public ApiRest getAllOrders(GetAllOrdersModel getAllOrdersModel) throws IOException {
    BigInteger tenantId = getAllOrdersModel.getTenantId();
    BigInteger branchId = getAllOrdersModel.getBranchId();
    Branch branch = findBranch(tenantId, branchId);
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("shopId", branch.getShopId());
    params.put("pageNo", getAllOrdersModel.getPageNo());
    params.put("pageSize", getAllOrdersModel.getPageSize());
    params.put("date", getAllOrdersModel.getDate());
    ApiRest callElemeSystemApiRest = ElemeUtils.callElemeSystem(tenantId.toString(), branchId.toString(), branch.getElemeAccountType(), "eleme.order.getAllOrders", params);
    Validate.isTrue(callElemeSystemApiRest.isSuccessful(), callElemeSystemApiRest.getError());
    return new ApiRest(callElemeSystemApiRest.getData(), "查询全部订单成功!");
}
Also used : HashMap(java.util.HashMap) BigInteger(java.math.BigInteger) JSONObject(net.sf.json.JSONObject) ApiRest(build.dream.common.api.ApiRest)

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