/// <summary> /// 插入数据到虚拟表 /// </summary> /// <param name="brandTable"></param> /// <returns></returns> public DataSet Insert(DataRow[] brandTable) { DownUnitBll bll = new DownUnitBll(); DataSet ds = this.GenerateEmptyTables(); foreach (DataRow row in brandTable) { DataTable ulistCodeTable = this.FindUnitListCode(row["BRANDCODE"].ToString().Trim()); DataRow inbrddr = ds.Tables["WMS_PRODUCT"].NewRow(); inbrddr["product_code"] = row["BRANDCODE"]; inbrddr["product_name"] = row["BRAND_NAME"]; inbrddr["uniform_code"] = row["N_UNIFY_CODE"]; inbrddr["custom_code"] = row["BRAND_CODE"]; inbrddr["short_code"] = row["SHORT_CODE"]; inbrddr["unit_list_code"] = ulistCodeTable.Rows[0]["unit_list_code"].ToString(); inbrddr["unit_code"] = ulistCodeTable.Rows[0]["unit_code01"].ToString(); inbrddr["supplier_code"] = "10863500"; inbrddr["brand_code"] = "PP001"; inbrddr["abc_type_code"] = ""; inbrddr["product_type_code"] = row["BRAND_TYPE"]; inbrddr["pack_type_code"] = ""; inbrddr["price_level_code"] = ""; inbrddr["statistic_type"] = ""; inbrddr["piece_barcode"] = row["BARCODE_PIECE"]; inbrddr["bar_barcode"] = "";//row["BARCODE_BAR"]; inbrddr["package_barcode"] = row["BARCODE_PACKAGE"]; inbrddr["one_project_barcode"] = row["BARCODE_ONE_PROJECT"]; inbrddr["buy_price"] = row["BUY_PRICE"]; inbrddr["trade_price"] = row["TRADE_PRICE"]; inbrddr["retail_price"] = row["RETAIL_PRICE"]; inbrddr["cost_price"] = row["COST_PRICE"]; inbrddr["is_filter_tip"] = row["IS_FILTERTIP"]; inbrddr["is_new"] = row["IS_NEW"]; inbrddr["is_famous"] = row["IS_FAMOUS"]; inbrddr["is_main_product"] = row["IS_MAINPRODUCT"]; inbrddr["is_province_main_product"] = row["IS_MAINPROVINCE"]; inbrddr["belong_region"] = row["BELONG_REGION"]; inbrddr["is_confiscate"] = row["IS_CONFISCATE"]; inbrddr["is_abnormity"] = row["IS_ABNORMITY_BRAND"]; inbrddr["description"] = ""; inbrddr["is_active"] = row["IsActive"]; inbrddr["update_time"] = DateTime.Now; inbrddr["is_rounding"] = "1"; inbrddr["cell_max_product_quantity"] = "30"; inbrddr["point_area_codes"] = ""; ds.Tables["WMS_PRODUCT"].Rows.Add(inbrddr); } return(ds); }
//主单结单 // POST: /StockOutBill/DownOutBillMaster/ public ActionResult DownOutBillMaster(string beginDate, string endDate, string wareCode, string billType) { string errorInfo = string.Empty; beginDate = Convert.ToDateTime(beginDate).ToString("yyyyMMdd"); endDate = Convert.ToDateTime(endDate).ToString("yyyyMMdd"); DownUnitBll ubll = new DownUnitBll(); DownProductBll pbll = new DownProductBll(); DownOutBillBll ibll = new DownOutBillBll(); ubll.DownUnitCodeInfo(); pbll.DownProductInfo(); bool bResult = ibll.GetOutBill(beginDate, endDate, this.User.Identity.Name.ToString(), out errorInfo, wareCode, billType); //bool bResult = OutBillMasterService.DownOutBillMaster(beginDate, endDate, out errorInfo); string msg = bResult ? "下载成功" : "下载失败"; return Json(JsonMessageHelper.getJsonMessage(bResult, msg, errorInfo), "text", JsonRequestBehavior.AllowGet); }
// // POST: /StockInBill/DownInBillMaster/ public ActionResult DownInBillMaster(string beginDate, string endDate, string wareCode, string billType, bool isInDown) { bool bResult = false; DownUnitBll ubll = new DownUnitBll(); DownProductBll pbll = new DownProductBll(); DownInBillBll ibll = new DownInBillBll(); DownDecidePlanBll planBll = new DownDecidePlanBll(); string errorInfo = string.Empty; try { beginDate = Convert.ToDateTime(beginDate).ToString("yyyyMMdd"); endDate = Convert.ToDateTime(endDate).ToString("yyyyMMdd"); if (!SystemParameterService.SetSystemParameter()) { ubll.DownUnitCodeInfo(); pbll.DownProductInfo(); if (isInDown) bResult = ibll.GetInBill(beginDate, endDate, this.User.Identity.Name.ToString(), wareCode, billType, out errorInfo); else bResult = planBll.GetInBillMiddle(beginDate, endDate, this.User.Identity.Name.ToString(), wareCode, billType, out errorInfo); } else { ubll.DownUnitInfo(); pbll.DownProductInfos(); if (isInDown) bResult = ibll.GetInBills(beginDate, endDate, this.User.Identity.Name.ToString(), wareCode, billType, out errorInfo); else bResult = planBll.GetInBillMiddle(beginDate, endDate, this.User.Identity.Name.ToString(), wareCode, billType, out errorInfo); } } catch (Exception e) { errorInfo += e.Message; } string msg = bResult ? "下载成功" : "下载失败"; return Json(JsonMessageHelper.getJsonMessage(bResult, msg, errorInfo), "text", JsonRequestBehavior.AllowGet); }
/// <summary> /// �������ݵ������ ���� /// </summary> /// <param name="brandTable"></param> /// <returns></returns> public DataSet InsertsUpload(DataTable brandTable) { DownUnitBll bll = new DownUnitBll(); DataSet ds = this.GenerateEmptyTable(); foreach (DataRow row in brandTable.Rows) { DataTable ulistCodeTable = this.FindUnitListCode(row["BRAND_ULIST_CODE"].ToString().Trim()); DataRow inbrddr = ds.Tables["WMS_PRODUCT"].NewRow(); inbrddr["product_code"] = row["BRAND_N"]; inbrddr["product_name"] = row["BRAND_NAME"]; inbrddr["uniform_code"] = row["N_BRAND_CODE"]; inbrddr["custom_code"] = row["BRAND_CODE"]; inbrddr["short_code"] = row["SHORT_CODE"]; inbrddr["unit_list_code"] = row["BRAND_ULIST_CODE"].ToString(); inbrddr["unit_code"] = ulistCodeTable.Rows[0]["unit_code01"].ToString(); inbrddr["supplier_code"] = "10863500"; inbrddr["brand_code"] = "PP001"; inbrddr["abc_type_code"] = ""; inbrddr["product_type_code"] = row["BRAND_TYPE"]; inbrddr["pack_type_code"] = ""; inbrddr["price_level_code"] = ""; inbrddr["statistic_type"] = ""; inbrddr["piece_barcode"] = row["BARCODE_PIECE"]; inbrddr["bar_barcode"] = row["BARCODE_BAR"]; inbrddr["package_barcode"] = row["BARCODE_PACKAGE"]; inbrddr["one_project_barcode"] = row["BARCODE_ONE_PROJECT"]; inbrddr["buy_price"] = string.IsNullOrEmpty(row["BUY_PRICE"].ToString()) ? 0 : row["BUY_PRICE"]; inbrddr["trade_price"] = string.IsNullOrEmpty(row["TRADE_PRICE"].ToString()) ? 0 : row["TRADE_PRICE"]; inbrddr["retail_price"] = string.IsNullOrEmpty(row["RETAIL_PRICE"].ToString()) ? 0 : row["RETAIL_PRICE"]; inbrddr["cost_price"] = string.IsNullOrEmpty(row["COST_PRICE"].ToString()) ? 0 : row["COST_PRICE"]; inbrddr["qtyUnit"] = row["QTY_UNIT"]; inbrddr["is_filter_tip"] = row["IS_FILTERTIP"]; inbrddr["is_new"] = row["IS_NEW"]; inbrddr["is_famous"] = row["IS_FAMOUS"]; inbrddr["is_main_product"] = row["IS_MAINPRODUCT"]; inbrddr["is_province_main_product"] = row["IS_MAINPROVINCE"]; inbrddr["belong_region"] = row["BELONG_REGION"]; inbrddr["is_confiscate"] = row["IS_CONFISCATE"]; inbrddr["is_abnormity"] = row["IS_ABNORMITY_BRAND"]; inbrddr["description"] = ""; inbrddr["is_active"] = row["IsActive"]; inbrddr["update_time"] = DateTime.Now; ds.Tables["WMS_PRODUCT"].Rows.Add(inbrddr); } return ds; }
// // POST: /StockInBill/DownInBillMaster/ public ActionResult DownInBillMaster(string beginDate, string endDate, string wareCode, string billType) { DownUnitBll ubll = new DownUnitBll(); DownProductBll pbll = new DownProductBll(); DownInBillBll ibll = new DownInBillBll(); DownDecidePlanBll planBll = new DownDecidePlanBll(); string errorInfo = string.Empty; if (beginDate == string.Empty || endDate == string.Empty) { beginDate = DateTime.Now.ToString("yyyyMMdd"); endDate = DateTime.Now.AddDays(1).Date.ToString("yyyyMMdd"); } else { beginDate = Convert.ToDateTime(beginDate).ToString("yyyyMMdd"); endDate = Convert.ToDateTime(endDate).AddDays(1).Date.ToString("yyyyMMdd"); } ubll.DownUnitCodeInfo(); pbll.DownProductInfo(); bool bResult = planBll.GetInBillMiddle(beginDate, endDate, this.User.Identity.Name.ToString(), wareCode, billType, out errorInfo); //bool bResult = ibll.GetInBill(beginDate, endDate, this.User.Identity.Name.ToString(), wareCode, billType, out errorInfo); //bool bResult = InBillMasterService.DownInBillMaster(beginDate, endDate, out errorInfo); string msg = bResult ? "下载成功" : "下载失败"; return Json(JsonMessageHelper.getJsonMessage(bResult, msg, errorInfo), "text", JsonRequestBehavior.AllowGet); }
//主单结单 // POST: /StockOutBill/DownOutBillMaster/ public ActionResult DownOutBillMaster(string beginDate, string endDate, string wareCode, string billType) { string errorInfo = string.Empty; beginDate = Convert.ToDateTime(beginDate).ToString("yyyyMMdd"); endDate = Convert.ToDateTime(endDate).ToString("yyyyMMdd"); bool bResult = false; DownUnitBll ubll = new DownUnitBll(); DownProductBll pbll = new DownProductBll(); DownOutBillBll ibll = new DownOutBillBll(); DownCustomerBll custBll = new DownCustomerBll(); try { if (!SystemParameterService.SetSystemParameter()) { ubll.DownUnitCodeInfo(); pbll.DownProductInfo(); custBll.DownCustomerInfo(); } else { ubll.DownUnitInfo();//创联 pbll.DownProductInfos();//创联 custBll.DownCustomerInfos();//创联 } bResult = ibll.GetOutBills(beginDate, endDate, this.User.Identity.Name.ToString(), out errorInfo, wareCode, billType); } catch (Exception e) { errorInfo += e.Message; } string msg = bResult ? "下载成功" : "下载失败"; return Json(JsonMessageHelper.getJsonMessage(bResult, msg, errorInfo), "text", JsonRequestBehavior.AllowGet); }
// // POST: /SortingOrder/DownSortOrder/ public ActionResult DownSortOrder(string beginDate, string endDate, string sortLineCode, bool isSortDown, string batch) { string errorInfo = string.Empty; string lineErrorInfo = string.Empty; string custErrorInfo = string.Empty; bool bResult = false; bool lineResult = false; beginDate = Convert.ToDateTime(beginDate).ToString("yyyyMMdd"); endDate = Convert.ToDateTime(endDate).ToString("yyyyMMdd"); DownSortingInfoBll sortBll = new DownSortingInfoBll(); DownRouteBll routeBll = new DownRouteBll(); DownSortingOrderBll orderBll = new DownSortingOrderBll(); DownCustomerBll custBll = new DownCustomerBll(); DownDistStationBll stationBll = new DownDistStationBll(); DownDistCarBillBll carBll = new DownDistCarBillBll(); DownUnitBll ubll = new DownUnitBll(); DownProductBll pbll = new DownProductBll(); try { ubll.DownUnitCodeInfo(); pbll.DownProductInfo(); routeBll.DeleteTable(); stationBll.DownDistStationInfo(); if (!SystemParameterService.SetSystemParameter()) { bool custResult = custBll.DownCustomerInfo(); carBll.DownDistCarBillInfo(beginDate); if (isSortDown) { //从分拣下载分拣数据 lineResult = routeBll.DownSortRouteInfo(); bResult = sortBll.GetSortingOrderDate(beginDate, endDate, sortLineCode, batch, out errorInfo); } else { //从营销下载分拣数据 lineResult = routeBll.DownRouteInfo(); bResult = orderBll.GetSortingOrderDate(beginDate, endDate, out errorInfo); } } else { bool custResult = custBll.DownCustomerInfos();//创联 //carBll.DownDistCarBillInfo(beginDate); if (isSortDown) { //从分拣下载分拣数据 lineResult = routeBll.DownSortRouteInfo(); bResult = sortBll.GetSortingOrderDate(beginDate, endDate, sortLineCode, batch, out errorInfo); } else { //从营销下载分拣数据 创联 lineResult = routeBll.DownRouteInfos(); bResult = orderBll.GetSortingOrderDates(beginDate, endDate, out errorInfo); } } } catch (Exception e) { errorInfo += e.Message; } string info = "线路:" + lineErrorInfo + "。客户:" + custErrorInfo + "。分拣" + errorInfo; string msg = bResult ? "下载成功" : "下载失败"; return Json(JsonMessageHelper.getJsonMessage(bResult, msg, errorInfo), "text", JsonRequestBehavior.AllowGet); }