public object Do_GetStoreListV2(BaseApi baseApi) { StoreListV2 storeListV2 = Utils.GetCache <StoreListV2>(); MallDao mallDao = new MallDao(); string memberId = Utils.GetMemberID(baseApi.token); storeListV2 = new StoreListV2(); storeListV2.storeList = mallDao.GetStoreListV2(memberId); return(storeListV2); }
public object Do_PayOrderV2(BaseApi baseApi) { PayOrderParamV2 payOrderParamV2 = JsonConvert.DeserializeObject <PayOrderParamV2>(baseApi.param.ToString()); if (payOrderParamV2 == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } PreOrder preOrder = Utils.GetCache <PreOrder>(payOrderParamV2.preOrderId); if (preOrder == null) { throw new ApiException(CodeMessage.InvalidPreOrderId, "InvalidPreOrderId"); } string memberId = Utils.GetMemberID(baseApi.token); MallDao mallDao = new MallDao(); OrderDao orderDao = new OrderDao(); Store store = mallDao.GetStoreListV2(memberId).Find ( item => item.storeId.Equals(payOrderParamV2.storeBranchId) ); if (store == null) { throw new ApiException(CodeMessage.InvalidStore, "InvalidStore"); } preOrder.total += store.expFee; preOrder.storeCode = store.storeCode; string orderCode = preOrder.storeCode + memberId.PadLeft(6, '0') + DateTime.Now.ToString("yyyyMMddHHmmss"); if (orderDao.InsertOrder(memberId, orderCode, preOrder, payOrderParamV2.remark, payOrderParamV2.expAddr, store.expFee)) { Utils.DeleteCache(payOrderParamV2.preOrderId); Order order = orderDao.GetOrderInfoByCode(orderCode); if (order == null) { throw new ApiException(CodeMessage.CreateOrderError, "CreateOrderError"); } return(order); } else { throw new ApiException(CodeMessage.CreateOrderError, "CreateOrderError"); } }