public string ApplyCustomerAndUnit(string userId, string customerInfo, string unitInfo) { //userId = "AB90F0708E324BBAB016DEE062022430"; //customerInfo = "{\"status\":0,\"customerList\":[{\"iD\":\"9057BC8D9A8E474680631DAF143342A9\",\"code\":\"mob_cus_1\",\"name\":\"mob_cus_1_name\",\"status\":0,\"creater\":{},\"createTime\":\"0001-01-01T00:00:00.0000000+08:00\",\"lastEditor\":{},\"lastEditTime\":\"0001-01-01T00:00:00.0000000+08:00\",\"lastSystemModifyStamp\":\"0001-01-01T00:00:00.0000000+08:00\"}],\"creater\":{},\"createTime\":\"0001-01-01T00:00:00.0000000+08:00\",\"lastEditor\":{},\"lastEditTime\":\"0001-01-01T00:00:00.0000000+08:00\",\"lastSystemModifyStamp\":\"0001-01-01T00:00:00.0000000+08:00\"}"; //unitInfo = "{\"customer\":{\"status\":0,\"creater\":{},\"createTime\":\"0001-01-01T00:00:00.0000000+08:00\",\"lastEditor\":{},\"lastEditTime\":\"0001-01-01T00:00:00.0000000+08:00\",\"lastSystemModifyStamp\":\"0001-01-01T00:00:00.0000000+08:00\"},\"status\":0,\"customerShopList\":[{\"customer\":{\"status\":0,\"creater\":{},\"createTime\":\"0001-01-01T00:00:00.0000000+08:00\",\"lastEditor\":{},\"lastEditTime\":\"0001-01-01T00:00:00.0000000+08:00\",\"lastSystemModifyStamp\":\"0001-01-01T00:00:00.0000000+08:00\"},\"iD\":\"A8CCA2FFCA7844629AD7E71ED0083469\",\"code\":\"mob_unit_1\",\"name\":\"mob_unit_1_name\",\"status\":0,\"customer_id\":\"9057BC8D9A8E474680631DAF143342A9\",\"lastSystemModifyStamp\":\"0001-01-01T00:00:00.0000000+08:00\"}],\"lastSystemModifyStamp\":\"0001-01-01T00:00:00.0000000+08:00\"}"; cPos.Model.LoggingSessionInfo loggingSessionInfo = new cPos.Model.LoggingSessionInfo(); var customerService = new CustomerService(); cPos.Admin.Model.Customer.CustomerInfo customer = null; cPos.Admin.Model.Customer.CustomerInfo unitCustomer = null; if (customerInfo != null && customerInfo.Length > 0) { customer = JsonConvert.Import <cPos.Admin.Model.Customer.CustomerInfo>(customerInfo); } if (unitInfo != null && unitInfo.Length > 0) { unitCustomer = JsonConvert.Import <cPos.Admin.Model.Customer.CustomerInfo>(unitInfo); } string error = string.Empty; // 处理客户/门店 if ((customer != null && customer.CustomerList != null) || unitCustomer != null && unitCustomer.CustomerShopList != null) { customerService.SetMobileCustomerInfoBatch(customer.CustomerList, unitCustomer.CustomerShopList, out error); } return(error); }
public CustomerTerminalInfo(CustomerInfo customer) : base() { this.Customer = customer; }
public CustomerShopInfo(CustomerInfo customer) : base() { this.Customer = customer; }
public CustomerMenuInfo(CustomerInfo customer, Right.MenuInfo menu) { this.Customer = customer; this.Menu = menu; }
public CustomerMenuInfo(CustomerInfo customer) : this(customer, new Right.MenuInfo()) { }
public CustomerConnectInfo(CustomerInfo customer) { this.Customer = customer; }
public Hashtable Run(string batId, cPos.Admin.Model.Customer.CustomerInfo customer) { string bizId = Utils.NewGuid(); var data = new Hashtable(); try { string customerId = customer.ID; int count = 0; // 总数量 int rowsCount = 10; // 每页数量 int startRow = 0; string unitId = null; var apInoutService = new Service.InoutService(); var bsService = BsWebService.CreatePosInoutService(customer); count = bsService.GetPosInoutNotPackagedCount(customerId, unitId); IList <InoutInfo> orderList = new List <InoutInfo>(); string dataBatId = string.Empty; while (count > 0 && startRow < count) { dataBatId = Utils.NewGuid(); orderList.Clear(); var tmpList = bsService.GetPosInoutListPackaged(customerId, unitId, 0, rowsCount, dataBatId); if (tmpList != null && tmpList.Length > 0) { foreach (var tmpObj in tmpList) { var orderObj = new InoutInfo(); orderObj.order_id = tmpObj.order_id; orderObj.order_no = tmpObj.order_no; orderObj.order_type_id = tmpObj.order_type_id; orderObj.order_reason_id = tmpObj.order_reason_id; orderObj.red_flag = tmpObj.red_flag; orderObj.ref_order_id = tmpObj.ref_order_id; orderObj.ref_order_no = tmpObj.ref_order_no; orderObj.warehouse_id = tmpObj.warehouse_id; orderObj.order_date = tmpObj.order_date; orderObj.request_date = tmpObj.request_date; orderObj.complete_date = tmpObj.complete_date; orderObj.create_unit_id = tmpObj.create_unit_id; orderObj.unit_id = tmpObj.unit_id; orderObj.related_unit_id = tmpObj.related_unit_id; //orderObj.ref_unit_id = tmpObj.ref_unit_id; orderObj.pos_id = tmpObj.pos_id; orderObj.shift_id = tmpObj.shift_id; orderObj.sales_user = tmpObj.sales_user; orderObj.total_amount = tmpObj.total_amount; orderObj.discount_rate = tmpObj.discount_rate; orderObj.actual_amount = tmpObj.actual_amount; orderObj.receive_points = tmpObj.receive_points; orderObj.pay_points = tmpObj.pay_points; orderObj.pay_id = tmpObj.pay_id; orderObj.print_times = tmpObj.print_times; orderObj.carrier_id = tmpObj.carrier_id; orderObj.remark = tmpObj.remark; orderObj.status = tmpObj.status; orderObj.create_time = tmpObj.create_time; orderObj.create_user_id = tmpObj.create_user_id; orderObj.approve_time = tmpObj.approve_time; orderObj.approve_user_id = tmpObj.approve_user_id; orderObj.send_user_id = tmpObj.send_user_id; orderObj.send_time = tmpObj.send_time; orderObj.accpect_user_id = tmpObj.accpect_user_id; orderObj.accpect_time = tmpObj.accpect_time; orderObj.modify_user_id = tmpObj.modify_user_id; orderObj.modify_time = tmpObj.modify_time; orderObj.total_qty = tmpObj.total_qty; orderObj.total_retail = tmpObj.total_retail; orderObj.keep_the_change = tmpObj.keep_the_change; orderObj.wiping_zero = tmpObj.wiping_zero; orderObj.vip_no = tmpObj.vip_no; orderObj.data_from_id = tmpObj.data_from_id; orderObj.sales_unit_id = tmpObj.sales_unit_id; orderObj.purchase_unit_id = tmpObj.purchase_unit_id; orderObj.if_flag = tmpObj.if_flag; orderList.Add(orderObj); } var tmpDetailList = bsService.GetPosInoutDetailListPackaged(customerId, unitId, tmpList); IList <InoutDetailInfo> detailList = new List <InoutDetailInfo>(); if (tmpDetailList != null && tmpDetailList.Length > 0) { foreach (var tmpDetail in tmpDetailList) { var detailObj = new InoutDetailInfo(); detailObj.order_detail_id = tmpDetail.order_detail_id; detailObj.order_id = tmpDetail.order_id; detailObj.ref_order_detail_id = tmpDetail.ref_order_detail_id; detailObj.sku_id = tmpDetail.sku_id; detailObj.unit_id = tmpDetail.unit_id; detailObj.enter_qty = tmpDetail.enter_qty; detailObj.order_qty = tmpDetail.order_qty; detailObj.enter_price = tmpDetail.enter_price; detailObj.std_price = tmpDetail.std_price; detailObj.discount_rate = tmpDetail.discount_rate; detailObj.retail_price = tmpDetail.retail_price; detailObj.retail_amount = tmpDetail.retail_amount; detailObj.enter_amount = tmpDetail.enter_amount; detailObj.receive_points = tmpDetail.receive_points; detailObj.pay_points = tmpDetail.pay_points; detailObj.remark = tmpDetail.remark; detailObj.order_detail_status = tmpDetail.order_detail_status; detailObj.display_index = tmpDetail.display_index; detailObj.create_time = tmpDetail.create_time; detailObj.create_user_id = tmpDetail.create_user_id; detailObj.modify_time = tmpDetail.modify_time; detailObj.modify_user_id = tmpDetail.modify_user_id; detailObj.ref_order_id = tmpDetail.ref_order_id; detailObj.if_flag = tmpDetail.if_flag; detailObj.pos_order_code = tmpDetail.pos_order_code; detailObj.plan_price = tmpDetail.plan_price; detailList.Add(detailObj); } } // 保存Order data = apInoutService.SaveInoutList(true, orderList, detailList); // 更新标记 bsService.SetPosInoutIfFlagInfo(customerId, dataBatId); } startRow += orderList.Count; } data["status"] = Utils.GetStatus(true); return(data); } catch (Exception ex) { data["status"] = Utils.GetStatus(false); data["error"] = ex.ToString(); Console.WriteLine(ex.ToString()); } return(data); }
public Hashtable Run(string batId, cPos.Admin.Model.Customer.CustomerInfo customer) { string bizId = Utils.NewGuid(); var data = new Hashtable(); try { string customerId = customer.ID; int count = 0; // 总数量 int rowsCount = 10; // 每页数量 int startRow = 0; string unitId = null; var apService = new Service.AdOrderService(); var bsService = BsWebService.CreateAdvertiseOrderService(customer); var apCustomerService = new cPos.Admin.Service.Implements.CustomerService(); //// Units //Hashtable htUnits = new Hashtable(); //htUnits["CustomerID"] = customerId; //htUnits["ShopStatus"] = "1"; //IList<cPos.Admin.Model.Customer.CustomerShopInfo> units = // apCustomerService.GetAllShopList(htUnits); //unitId = unitObj.ID; Hashtable ht = new Hashtable(); count = apService.GetAdOrderCountPackaged(customerId, unitId, ht); IList <AdvertiseOrderInfo> orderList = new List <AdvertiseOrderInfo>(); string dataBatId = string.Empty; while (count > 0 && startRow < count) { dataBatId = Utils.NewGuid(); orderList.Clear(); var tmpOrderList = apService.GetAdOrderListPackaged(customerId, unitId, ht, 0, rowsCount, dataBatId); if (tmpOrderList != null && tmpOrderList.Count > 0) { foreach (var tmpOrderObj in tmpOrderList) { // 获取并保存广告信息 var adList = apService.GetAdList(tmpOrderObj.order_id); if (adList != null) { bsService.SetAdvertiseInfoXML(Utils.Serialiaze(adList), customerId); } // 获取并保存与广告关系信息 var orderAdList = apService.GetOrderAdList(tmpOrderObj.order_id); if (orderAdList != null) { bsService.SetAdvertiseOrderAdvertiseInfoXML(Utils.Serialiaze(orderAdList), customerId); } // 获取并保存与门店关系信息 var orderUnitList = apService.GetOrderUnitList(tmpOrderObj.order_id, customerId); if (orderUnitList != null) { bsService.SetAdvertiseOrderUnitInfoXML(Utils.Serialiaze(orderUnitList), customerId); } } // 保存订单信息 string orderXmlStr = Utils.Serialiaze(tmpOrderList); bsService.SetAdvertiseOrderInfos(orderXmlStr, customerId); // 更新标记 apService.SetAdOrderListFlagByBatId(customerId, dataBatId); } startRow += tmpOrderList.Count; } data["status"] = Utils.GetStatus(true); return(data); } catch (Exception ex) { data["status"] = Utils.GetStatus(false); data["error"] = ex.ToString(); Console.WriteLine(ex.ToString()); } return(data); }