/// <summary> /// 装车信息:编辑装车信息-修改TMS表头的本地状态 /// </summary> /// <param name="headerID"></param> /// <param name="state"></param> /// <returns></returns> public bool UpdateLocState(int headerID, int state) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("headerID=").Append(headerID).Append("&"); loStr.Append("state=").Append(state); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_UpdateLocState); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 得到车辆类型 /// </summary> /// <param name="header"></param> /// <returns></returns> public string GetVHtype(TMSDataHeader header) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("groupNo=").Append(header.id); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetVHtype); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(null); } #endregion #region 正常错误处理 JsonGetVHtype bill = JsonConvert.DeserializeObject <JsonGetVHtype>(jsonQuery); if (bill == null) { //MsgBox.Warn(WebWork.JSON_DATA_NULL); return(null); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(null); } #endregion if (bill.result != null && bill.result.Length > 0) { return(bill.result[0].billTypeName); } } catch (Exception ex) { MsgBox.Err(ex.Message); } return(null); }
/// <summary> /// 添加或编辑 /// </summary> /// <param name="entity"></param> /// <param name="operatorFlag">添加或编辑</param> /// <returns></returns> public bool SaveAddBugReason(BusReasonEntity entity, bool isNew) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("bugCode=").Append(entity.BugCode).Append("&"); loStr.Append("bugName=").Append(entity.BugName); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_SaveAddBugReason); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 查询送货牌状态 /// </summary> /// <param name="carNo"></param> /// <returns></returns> private bool CarNoIsExit(string carNo) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("carNo=").Append(carNo); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_CarNoIsExit); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 if (jsonQuery.Contains("\"cardState\":\"41\"")) { MsgBox.Warn("该送货牌正在使用,请使用其他送货牌!"); return(false); } else if (jsonQuery.Contains("\"result\":[],\"flag\":0,")) { MsgBox.Warn("送货牌不存在,请确认送货牌!!!"); return(false); } else if (jsonQuery.Contains("\"cardState\":\"40\"")) { return(true); } #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 收货单管理,修改入库方式 /// </summary> /// <param name="type"></param> /// <param name="billID"></param> /// <returns></returns> public bool UpdateInstoreType(string type, int billID) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("type=").Append(type).Append("&"); loStr.Append("billId=").Append(billID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_UpdateInstoreType); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 收货单据管理,查询订单中未复核的托盘 /// </summary> /// <param name="header"></param> /// <returns></returns> public bool GetContainerNochek(AsnBodyEntity header) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billId=").Append(header.BillID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetContainerNochek); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 任务自动刷新 /// </summary> /// <returns></returns> public bool AutoAssignTask() { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("wareHouseType=").Append(EUtilStroreType.WarehouseTypeToInt(GlobeSettings.LoginedUser.WarehouseType)); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_AutoAssignTask); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 根据派单id 32位(组别)删除数据 /// </summary> /// <param name="tmsDataHeader"></param> /// <returns></returns> public bool DelleteGp(TMSDataHeader tmsDataHeader) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("groupNo=").Append(tmsDataHeader.id); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_DelleteGp); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 删除临时补货 /// </summary> /// <returns></returns> public bool DeleteTempReplenish() { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); string jsonQuery = WebWork.SendRequest(string.Empty, WebWork.URL_DeleteTempReplenish); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 查询统计(叉车司机任务统计-获取上架记录) /// </summary> /// <param name="dateBegin"></param> /// <param name="dateEnd"></param> /// <param name="userCode"></param> /// <returns></returns> public DataTable GetPutawayRecords(DateTime dateBegin, DateTime dateEnd, string userCode) { #region DataTable DataTable tblDatas = new DataTable("Datas"); tblDatas.Columns.Add("BILL_DETAIL_ID", Type.GetType("System.String")); tblDatas.Columns.Add("CT_CODE", Type.GetType("System.String")); tblDatas.Columns.Add("SKU_CODE", Type.GetType("System.String")); tblDatas.Columns.Add("SKU_NAME", Type.GetType("System.String")); tblDatas.Columns.Add("LC_CODE", Type.GetType("System.String")); tblDatas.Columns.Add("QTY", Type.GetType("System.Decimal")); tblDatas.Columns.Add("UM_NAME", Type.GetType("System.String")); tblDatas.Columns.Add("PUT_TIME", Type.GetType("System.DateTime")); #endregion try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); #region 参数 loStr.Append("userCode=").Append(userCode).Append("&"); loStr.Append("beginDate=").Append(dateBegin).Append("&"); loStr.Append("endDate=").Append(dateEnd); #endregion string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetPutawayRecords); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(tblDatas); } #endregion #region 正常错误处理 JsonGetPutawayRecords bill = JsonConvert.DeserializeObject <JsonGetPutawayRecords>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(tblDatas); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(tblDatas); } #endregion #region 赋值 foreach (JsonGetPutawayRecordsResult tm in bill.result) { DataRow newRow; newRow = tblDatas.NewRow(); newRow["BILL_DETAIL_ID"] = tm.billDetailId; newRow["CT_CODE"] = tm.ctCode; newRow["SKU_CODE"] = tm.skuCode; newRow["SKU_NAME"] = tm.skuName; newRow["LC_CODE"] = tm.lcCode; if (!string.IsNullOrEmpty(tm.qty)) { newRow["QTY"] = Convert.ToDecimal(tm.qty); } newRow["UM_NAME"] = tm.umName; newRow["PUT_TIME"] = Convert.ToDateTime(tm.putTime); tblDatas.Rows.Add(newRow); } return(tblDatas); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(tblDatas); }
public List <PickPlanEntity> GetPickPlan(int billID) { List <PickPlanEntity> list = new List <PickPlanEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billID=").Append(billID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetPickPlanLongMiao); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonGetPickPlan bill = JsonConvert.DeserializeObject <JsonGetPickPlan>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonGetPickPlanResult jbr in bill.result) { PickPlanEntity asnEntity = new PickPlanEntity(); #region 0-10 asnEntity.BillID = Convert.ToInt32(jbr.billId); asnEntity.BillNO = jbr.billNo; asnEntity.ComMaterial = jbr.comMaterial; asnEntity.DetailID = Convert.ToInt32(jbr.detailId); asnEntity.Location = jbr.lcCode; asnEntity.Material = jbr.skuCode; asnEntity.MaterialName = jbr.skuName; asnEntity.Qty = jbr.qty; asnEntity.RowNO = Convert.ToInt32(jbr.rowNo); asnEntity.SaleUnit = jbr.saleUnit; #endregion #region 11-20 asnEntity.SaleUnitTransValue = Convert.ToInt32(jbr.saleTransValue); asnEntity.SkuBarcode = jbr.skuBarcode; asnEntity.STOCK_ID = Convert.ToInt32(jbr.stockId); asnEntity.UnitCode = jbr.umCode; asnEntity.UnitName = jbr.umName; #endregion #region try { if (!string.IsNullOrEmpty(jbr.createDate)) { asnEntity.CreateData = Convert.ToDateTime(jbr.createDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmListPickPlan+GetPickPlan", msg); } #endregion #region try { if (!string.IsNullOrEmpty(jbr.expDate)) { asnEntity.ExpDate = Convert.ToDateTime(jbr.expDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmListPickPlan+GetPickPlan", msg); } #endregion list.Add(asnEntity); } return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(list); }
/// <summary> /// 收货单据管理, 查询入库单明细 /// </summary> /// <param name="billID"></param> /// <returns></returns> public List <PODetailEntity> GetDetailByBillID(int billID) { List <PODetailEntity> list = new List <PODetailEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billId=").Append(billID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetDetailByBillID); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonGetDetailByBillID bill = JsonConvert.DeserializeObject <JsonGetDetailByBillID>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonGetDetailByBillIDResult jbr in bill.result) { PODetailEntity asnEntity = new PODetailEntity(); asnEntity.Barcode1 = jbr.barCode1; asnEntity.BatchNO = jbr.batchNo; asnEntity.BillID = Convert.ToInt32(jbr.billId); asnEntity.DetailID = Convert.ToInt32(jbr.id); asnEntity.ExpDate = jbr.expDate; //asnEntity.MaterialName = jbr.namePy; asnEntity.MaterialName = jbr.skuName; asnEntity.MaterialNameS = jbr.skuNameS; asnEntity.MaterialCode = jbr.skuCode; asnEntity.PlanQty = Convert.ToInt32(jbr.qty); asnEntity.Price = jbr.price; asnEntity.PutQty = Convert.ToInt32(jbr.putQty); asnEntity.Remark = jbr.remark; asnEntity.Spec = jbr.spec; asnEntity.UnitName = jbr.umName; list.Add(asnEntity); } return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(list); }
public DataTable GetContainerByBillID(int billID) { #region DataTable tblDatas = new DataTable("Datas"); tblDatas.Columns.Add("BILL_NO", Type.GetType("System.String")); tblDatas.Columns.Add("VH_TRAIN_NO", Type.GetType("System.String")); tblDatas.Columns.Add("CT_CODE", Type.GetType("System.String")); tblDatas.Columns.Add("CT_STATE", Type.GetType("System.String")); tblDatas.Columns.Add("LC_CODE", Type.GetType("System.String")); #endregion try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billID=").Append(billID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetContainerByBillID); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(tblDatas); } #endregion #region 正常错误处理 JsonGetContainerByBillID bill = JsonConvert.DeserializeObject <JsonGetContainerByBillID>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(tblDatas); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(tblDatas); } #endregion #region 赋值 foreach (JsonGetContainerByBillIDResult tm in bill.result) { DataRow newRow; newRow = tblDatas.NewRow(); newRow["BILL_NO"] = tm.billNo; newRow["VH_TRAIN_NO"] = tm.vhTrainNo; newRow["CT_CODE"] = tm.ctCode; newRow["CT_STATE"] = tm.ctState; newRow["LC_CODE"] = tm.lcCode; tblDatas.Rows.Add(newRow); } return(tblDatas); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(tblDatas); }
/// <summary> /// 盘点单管理---根据条件查询盘点单 /// </summary> /// <param name="warehouse"></param> /// <param name="billNO"></param> /// <param name="billStatus"></param> /// <param name="showNotComplete"></param> /// <param name="dateFrom"></param> /// <param name="dateTo"></param> /// <returns></returns> public List <CountHeaderEntity> QueryBills(string warehouse, string billNO, string billStatus, bool showNotComplete, DateTime?dateFrom, DateTime?dateTo) { List <CountHeaderEntity> list = new List <CountHeaderEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("warehouse=").Append(warehouse).Append("&"); loStr.Append("billNO=").Append(billNO).Append("&"); loStr.Append("billStatus=").Append(billStatus).Append("&"); loStr.Append("showNotComplete=").Append(showNotComplete).Append("&"); loStr.Append("dateFrom=").Append(dateFrom).Append("&"); loStr.Append("dateTo=").Append(dateTo); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_QueryBills_PanDian); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonQueryBillsPanDian bill = JsonConvert.DeserializeObject <JsonQueryBillsPanDian>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonQueryBillsPanDianResult jbr in bill.result) { CountHeaderEntity asnEntity = new CountHeaderEntity(); asnEntity.BillID = Convert.ToInt32(jbr.billId); asnEntity.BillState = jbr.billState; asnEntity.Creator = jbr.creator; asnEntity.Remark = jbr.remark; asnEntity.StateName = jbr.itemDesc; asnEntity.TagDesc = jbr.tagDesc; asnEntity.Warehouse = jbr.whCode; try { //if (!string.IsNullOrEmpty(jbr.closeDate)) // asnEntity.CloseDate = Convert.ToDateTime(jbr.closeDate); //if (!string.IsNullOrEmpty(jbr.printedTime)) // asnEntity.PrintedTime = Convert.ToDateTime(jbr.printedTime); if (!string.IsNullOrEmpty(jbr.createDate)) { asnEntity.CreateDate = Convert.ToDateTime(jbr.createDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } list.Add(asnEntity); } return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(list); }
///<summary> ///查询所有计量单位组 ///</summary> ///<returns></returns> public List <UnitGroupEntity> GetAllZJQ(int nums, int begin, out int total) { List <UnitGroupEntity> list = new List <UnitGroupEntity>(); total = 0; try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); if (begin == 0) { loStr.Append("beginRow=").Append("&"); } else { loStr.Append("beginRow=").Append(begin).Append("&"); } loStr.Append("warehouseType=").Append(EUtilStroreType.WarehouseTypeToInt(GlobeSettings.LoginedUser.WarehouseType)).Append("&"); if (begin == 0) { loStr.Append("rows="); } else { loStr.Append("rows=").Append(nums); } string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetAllZJQ); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonGetAllZJQ bill = JsonConvert.DeserializeObject <JsonGetAllZJQ>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonGetAllZJQResult jbr in bill.result) { UnitGroupEntity asnEntity = new UnitGroupEntity(); #region 0-10 asnEntity.Height = StringToDecimal.GetTwoDecimal(jbr.height); asnEntity.ID = Convert.ToInt32(jbr.id); asnEntity.IsActive = jbr.isActive; asnEntity.Length = StringToDecimal.GetTwoDecimal(jbr.length); asnEntity.Qty = Convert.ToInt32(jbr.qty); asnEntity.SkuBarcode = jbr.skuBarcode; asnEntity.SkuCode = jbr.skuCode; asnEntity.SkuLevel = Convert.ToInt32(jbr.skuLevel); asnEntity.SkuName = jbr.skuName; asnEntity.Spec = jbr.spec; #endregion #region 11-15 asnEntity.UnitCode = jbr.umCode; asnEntity.UnitName = jbr.umName; asnEntity.Weight = StringToDecimal.GetTwoDecimal(jbr.weight); asnEntity.Width = StringToDecimal.GetTwoDecimal(jbr.width); if (GlobeSettings.LoginedUser.WarehouseType == EWarehouseType.散货仓) { asnEntity.SkuLevel = Convert.ToInt32(jbr.skuLevel); asnEntity.Skuvol = StringToDecimal.GetTwoDecimal(jbr.skuVol); }// #endregion list.Add(asnEntity); } total = bill.total; return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message + ex.StackTrace); } return(list); }
/// <summary> /// 盘点单管理---报告上传 /// </summary> /// <param name="billID"></param> /// <returns></returns> public CountHeaderEntity GetBillInfo(int billID) { CountHeaderEntity asnEntity = new CountHeaderEntity(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billId=").Append(billID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetBillInfo); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(asnEntity); } #endregion #region 正常错误处理 JsonGetBillInfo bill = JsonConvert.DeserializeObject <JsonGetBillInfo>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(asnEntity); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(asnEntity); } #endregion List <CountHeaderEntity> list = new List <CountHeaderEntity>(); #region 赋值数据 foreach (JsonGetBillInfoResult jbr in bill.result) { asnEntity.BillID = Convert.ToInt32(jbr.billId); asnEntity.BillState = jbr.billState; asnEntity.Creator = jbr.creator; asnEntity.Remark = jbr.remark; asnEntity.Warehouse = jbr.whCode; try { if (!string.IsNullOrEmpty(jbr.createDate)) { asnEntity.CreateDate = Convert.ToDateTime(jbr.createDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } try { if (!string.IsNullOrEmpty(jbr.completeDate)) { asnEntity.CompleteDate = Convert.ToDateTime(jbr.completeDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } list.Add(asnEntity); } return(asnEntity); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(asnEntity); }
/// <summary> /// 盘点单管理---复盘============获取当前盘点差异单据的明细 /// </summary> /// <param name="billNo"></param> /// <returns></returns> public List <LocationEntity> ListGetLocations(int billNo) { List <LocationEntity> list = new List <LocationEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billId=").Append(billNo); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_ListGetLocations); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonListGetLocations bill = JsonConvert.DeserializeObject <JsonListGetLocations>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonListGetLocationsResult jbr in bill.result) { LocationEntity asnEntity = new LocationEntity(); asnEntity.CountQty = Convert.ToDecimal(jbr.countQty); asnEntity.LocationCode = jbr.lcCode; asnEntity.StockQty = Convert.ToDecimal(jbr.stockQty); try { if (!string.IsNullOrEmpty(jbr.stockExpDate)) { asnEntity.ExpDateStock = Convert.ToDateTime(jbr.stockExpDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } try { if (!string.IsNullOrEmpty(jbr.expDate)) { asnEntity.ExpDate = Convert.ToDateTime(jbr.expDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } list.Add(asnEntity); } return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(list); }
/// <summary> /// 当前订单量 查询安全库存 /// </summary> /// <returns></returns> public List <StockSafeSUPEntity> GetNotSafeStock() { List <StockSafeSUPEntity> list = new List <StockSafeSUPEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); //loStr.Append("status=").Append(status).Append("&"); //loStr.Append("setting=").Append(setting); string jsonQuery = WebWork.SendRequest(string.Empty, WebWork.URL_GetNotSafeStock); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonGetNotSafeStock bill = JsonConvert.DeserializeObject <JsonGetNotSafeStock>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonGetNotSafeStockResult jbr in bill.result) { StockSafeSUPEntity asnEntity = new StockSafeSUPEntity(); #region 0-9 asnEntity.DIFF_QTY = StringToDecimal.GetTwoDecimal(jbr.diffQty); asnEntity.LC_CODE = jbr.lcCode; asnEntity.PIKING_QTY = StringToDecimal.GetTwoDecimal(jbr.pickingQty); asnEntity.QTY = StringToDecimal.GetTwoDecimal(jbr.qty); asnEntity.SKU_CODE = jbr.skuCode; asnEntity.SKU_NAME = jbr.skuName; asnEntity.SPEC = jbr.spec; asnEntity.UM_NAME = jbr.umName; #endregion #region try { if (!string.IsNullOrEmpty(jbr.altestOut)) { ; } //asnEntity. = Convert.ToDateTime(jbr.altestOut); } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } #endregion list.Add(asnEntity); } return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(list); }
/// <summary> /// 按照次序排序的供应商列表 /// </summary> /// <returns></returns> public List <SupplierEntity> ListActiveSupplierByPriority() { List <SupplierEntity> list = new List <SupplierEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); //loStr.Append("roleId=").Append(roleId); string jsonQuery = WebWork.SendRequest(string.Empty, WebWork.URL_ListActiveSupplierByPriorityZJQ); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonSupplier bill = JsonConvert.DeserializeObject <JsonSupplier>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonSupplierResult jbr in bill.result) { SupplierEntity asnEntity = new SupplierEntity(); #region asnEntity.Address = jbr.address; asnEntity.AreaID = jbr.areaId; asnEntity.AreaName = jbr.arName; asnEntity.ContactName = jbr.contact; asnEntity.IsActive = jbr.isActive; asnEntity.IsOwn = jbr.isOwn; asnEntity.Phone = jbr.phone; asnEntity.Postcode = jbr.postCode; asnEntity.Remark = jbr.remark; asnEntity.SortOrder = Convert.ToInt32(jbr.sortOrder); asnEntity.SupplierCode = jbr.sCode; asnEntity.SupplierName = jbr.sName; asnEntity.SupplierNameS = jbr.nameS; asnEntity.UpdateBy = jbr.updateBy; try { if (!string.IsNullOrEmpty(jbr.updateDate)) { asnEntity.UpdateDate = Convert.ToDateTime(jbr.updateDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("UcAsnQueryEngine+ListActiveSupplierByPriority", msg); } #endregion list.Add(asnEntity); } return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(list); }
/// <summary> /// 当前订单量(加载报警窗体) /// </summary> /// <returns></returns> public List <StockRecordEntity> QueryStockWarm() { List <StockRecordEntity> temp = new List <StockRecordEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); string jsons = string.Empty; string jsonQuery = WebWork.SendRequest(jsons, WebWork.URL_QueryStockWarm); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(temp); } #endregion #region 正常错误处理 JsonQueryStockWarm bill = JsonConvert.DeserializeObject <JsonQueryStockWarm>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(temp); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(temp); } #endregion #region 赋值数据 foreach (JsonQueryStockWarmResult jbr in bill.result) { StockRecordEntity asnEntity = new StockRecordEntity(); #region 0-10 asnEntity.ExpDays = Convert.ToInt32(jbr.expDays); asnEntity.StockID = Convert.ToInt32(jbr.id); asnEntity.Location = jbr.lcCode; asnEntity.OccupyQty = Convert.ToDecimal(jbr.occupyQty); asnEntity.PickingQty = Convert.ToDecimal(jbr.pickingQty); asnEntity.Qty = Convert.ToDecimal(jbr.qty); asnEntity.Material = jbr.skuCode; asnEntity.MaterialName = jbr.skuName; asnEntity.Spec = jbr.spec; asnEntity.UnitName = jbr.umName; asnEntity.ZoneName = jbr.znName; #endregion #region try { if (!string.IsNullOrEmpty(jbr.expDate)) { asnEntity.ExpDate = Convert.ToDateTime(jbr.expDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } #endregion #region try { if (!string.IsNullOrEmpty(jbr.latestIn)) { asnEntity.LastInDate = Convert.ToDateTime(jbr.latestIn); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } #endregion #region try { if (!string.IsNullOrEmpty(jbr.latestOut)) { asnEntity.LastOutDate = Convert.ToDateTime(jbr.latestOut); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } #endregion temp.Add(asnEntity); } return(temp); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(temp); }
/// <summary> /// 获取某个用户的角色信息 /// </summary> /// <param name="userCode"></param> /// <returns></returns> public List <RoleEntity> ListMyRoles(string userCode) { List <RoleEntity> list = new List <RoleEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("userCode=").Append(userCode); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_ListMyRoles); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonListMyRoles bill = JsonConvert.DeserializeObject <JsonListMyRoles>(jsonQuery); if (bill == null) { //MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonListMyRolesResult jbr in bill.result) { RoleEntity asnEntity = new RoleEntity(); asnEntity.RoleId = Convert.ToInt32(jbr.roleId); asnEntity.RoleName = jbr.roleName; try { //if (!string.IsNullOrEmpty(jbr.updateDate)) // asnEntity.UpdateDate = Convert.ToDateTime(jbr.updateDate); } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } list.Add(asnEntity); } return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(list); }
/// <summary> /// 出库单管理:称重记录 /// </summary> /// <param name="billID"></param> /// <returns></returns> public DataTable GetWeighRecordsByBillID(int billID) { #region DataTable tblDatas = new DataTable("Datas"); tblDatas.Columns.Add("CT_CODE", Type.GetType("System.String")); tblDatas.Columns.Add("GROSS_WEIGHT", Type.GetType("System.String")); tblDatas.Columns.Add("NET_WEIGHT", Type.GetType("System.String")); tblDatas.Columns.Add("USER_NAME", Type.GetType("System.String")); tblDatas.Columns.Add("AUTH_USER_NAME", Type.GetType("System.String")); tblDatas.Columns.Add("CREATE_DATE", Type.GetType("System.String")); tblDatas.Columns.Add("VH_NO", Type.GetType("System.String")); #endregion try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billID=").Append(billID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetWeighRecordsByBillID); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(tblDatas); } #endregion #region 正常错误处理 JsonGetWeighRecordsByBillID bill = JsonConvert.DeserializeObject <JsonGetWeighRecordsByBillID>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(tblDatas); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(tblDatas); } #endregion #region 赋值 foreach (JsonGetWeighRecordsByBillIDResult tm in bill.result) { DataRow newRow; newRow = tblDatas.NewRow(); newRow["CT_CODE"] = tm.ctCode; newRow["GROSS_WEIGHT"] = tm.crossWeight; newRow["NET_WEIGHT"] = tm.netWeight; newRow["USER_NAME"] = tm.userName; newRow["AUTH_USER_NAME"] = tm.authUserName; newRow["CREATE_DATE"] = tm.createDate; newRow["VH_NO"] = tm.vhNo; tblDatas.Rows.Add(newRow); } return(tblDatas); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(tblDatas); }
/// <summary> /// 收货单据管理,打印--查询订单主表信息 /// </summary> /// <param name="billID"></param> /// <returns></returns> public AsnHeaderEntity GetBillHeader(int billID) { AsnBodyEntity tm = new AsnBodyEntity(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billId=").Append(billID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetBillHeader); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(tm); } #endregion #region 正常错误处理 JsonBills bill = JsonConvert.DeserializeObject <JsonBills>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(tm); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(tm); } #endregion List <AsnBodyEntity> list = new List <AsnBodyEntity>(); #region 赋值数据 foreach (JsonBillsResult jbr in bill.result) { AsnBodyEntity asnEntity = new AsnBodyEntity(); asnEntity.OriginalBillNO = jbr.originalBillNo; asnEntity.InstoreTypeDesc = jbr.instoreTypeDesc; asnEntity.Creator = jbr.creator; asnEntity.InstoreType = jbr.instoreType; asnEntity.ContractNO = jbr.contractNo; asnEntity.BillType = jbr.billType; //nameS asnEntity.RowForeColor = Convert.ToInt32(jbr.rowColor); asnEntity.BillState = jbr.billState; asnEntity.BillStateDesc = jbr.billStateDesc; asnEntity.Remark = jbr.remark; #region try { if (!string.IsNullOrEmpty(jbr.closeDate)) { asnEntity.CloseDate = Convert.ToDateTime(jbr.closeDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("RepAsnTransfer+GetBillHeader", msg); } #endregion #region try { if (!string.IsNullOrEmpty(jbr.printedTime)) { asnEntity.PrintedTime = Convert.ToDateTime(jbr.printedTime); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("RepAsnTransfer+GetBillHeader", msg); } #endregion #region try { if (!string.IsNullOrEmpty(jbr.createDate)) { asnEntity.CreateDate = Convert.ToDateTime(jbr.createDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("RepAsnTransfer+GetBillHeader", msg); } #endregion asnEntity.WmsRemark = jbr.wmsRemark; asnEntity.Printed = Convert.ToInt32(jbr.printed); //sCode //asnEntity.SupplierCode = jbr.cName; asnEntity.SupplierName = jbr.cName; asnEntity.BillID = Convert.ToInt32(jbr.billId); asnEntity.BillNO = jbr.billNo; asnEntity.Sales = jbr.salesMan; asnEntity.BillTypeDesc = jbr.billTypeDesc; list.Add(asnEntity); } if (list.Count > 0) { return(list[0]); } #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(tm); }
/// <summary> /// 查询统计(商品销量统计) /// </summary> /// <param name="dateStart"></param> /// <param name="dateEnd"></param> /// <returns></returns> public DataTable GetSKUSaleSort(string dateStart, string dateEnd) { #region DataTable tblDatas = new DataTable("Datas"); tblDatas.Columns.Add("SKU_CODE", Type.GetType("System.String")); tblDatas.Columns.Add("SKU_NAME", Type.GetType("System.String")); tblDatas.Columns.Add("QTY", Type.GetType("System.Decimal")); tblDatas.Columns.Add("SPEC", Type.GetType("System.String")); tblDatas.Columns.Add("UM_NAME", Type.GetType("System.String")); #endregion try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("startDate=").Append(dateStart).Append("&"); loStr.Append("endDate=").Append(dateEnd); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetSKUSaleSort); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(tblDatas); } #endregion #region 正常错误处理 JsonGetSKUSaleSort bill = JsonConvert.DeserializeObject <JsonGetSKUSaleSort>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(tblDatas); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(tblDatas); } #endregion #region 赋值 foreach (JsonGetSKUSaleSortResult tm in bill.result) { DataRow newRow; newRow = tblDatas.NewRow(); newRow["SKU_CODE"] = tm.skuCode; newRow["SKU_NAME"] = tm.skuName; newRow["QTY"] = Convert.ToDecimal(tm.qty); newRow["SPEC"] = tm.spec; newRow["UM_NAME"] = tm.umName; tblDatas.Rows.Add(newRow); } return(tblDatas); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(tblDatas); }
/// <summary> /// 读取等待到货(也就是没有做到货登记)的单据 /// </summary> /// <param name="warehouseCode"></param> /// <returns></returns> private List <AsnBodyEntity> QueryNotRelatedBills(string warehouseCode) { List <AsnBodyEntity> list = new List <AsnBodyEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billState=").Append(BillStateConst.ASN_STATE_CODE_NOT_ARRIVE).Append("&"); loStr.Append("wareHouseCode=").Append(warehouseCode); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_QueryNotRelatedBills); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonBills bill = JsonConvert.DeserializeObject <JsonBills>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonBillsResult jbr in bill.result) { AsnBodyEntity asnEntity = new AsnBodyEntity(); asnEntity.OriginalBillNO = jbr.originalBillNo; asnEntity.InstoreTypeDesc = jbr.instoreTypeDesc; asnEntity.Creator = jbr.creator; asnEntity.InstoreType = jbr.instoreType; asnEntity.ContractNO = jbr.contractNo; asnEntity.BillType = jbr.billType; //nameS asnEntity.RowForeColor = Convert.ToInt32(jbr.rowColor); asnEntity.BillState = jbr.billState; asnEntity.BillStateDesc = jbr.billStateDesc; asnEntity.Remark = jbr.remark; #region try { if (!string.IsNullOrEmpty(jbr.closeDate)) { asnEntity.CloseDate = Convert.ToDateTime(jbr.closeDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } #endregion #region try { if (!string.IsNullOrEmpty(jbr.printedTime)) { asnEntity.PrintedTime = Convert.ToDateTime(jbr.printedTime); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } #endregion #region try { if (!string.IsNullOrEmpty(jbr.createDate)) { asnEntity.CreateDate = Convert.ToDateTime(jbr.createDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } #endregion asnEntity.WmsRemark = jbr.wmsRemark; asnEntity.Printed = Convert.ToInt32(jbr.printed); //sCode //asnEntity.SupplierCode = jbr.cName; asnEntity.SupplierName = jbr.cName; asnEntity.BillID = Convert.ToInt32(jbr.billId); asnEntity.BillNO = jbr.billNo; asnEntity.Sales = jbr.salesMan; asnEntity.BillTypeDesc = jbr.billTypeDesc; list.Add(asnEntity); } return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(list); }
/// <summary> /// 已经登记,但是收货未完成的数据 /// </summary> /// <returns></returns> /// public DataTable GetVehicles(int?billID, string billNO, string cardNO, string cardState) { #region DataTable tblDatas = new DataTable("Datas"); tblDatas.Columns.Add("BILL_NO", Type.GetType("System.String")); tblDatas.Columns.Add("BILL_STATE_DESC", Type.GetType("System.String")); tblDatas.Columns.Add("CARD_NO", Type.GetType("System.String")); tblDatas.Columns.Add("CARD_STATE_DESC", Type.GetType("System.String")); tblDatas.Columns.Add("C_NAME", Type.GetType("System.String")); tblDatas.Columns.Add("CONTACT", Type.GetType("System.String")); tblDatas.Columns.Add("CREATE_DATE", Type.GetType("System.String")); tblDatas.Columns.Add("CREATOR", Type.GetType("System.String")); tblDatas.Columns.Add("DRIVER", Type.GetType("System.String")); tblDatas.Columns.Add("VEHICLE_NO", Type.GetType("System.String")); tblDatas.Columns.Add("cardState", Type.GetType("System.String")); #endregion try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("cardState=").Append(cardState); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetVehicles); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(tblDatas); } #endregion #region 正常错误处理 JsonVehicles bill = JsonConvert.DeserializeObject <JsonVehicles>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(tblDatas); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(tblDatas); } #endregion List <JsonVehiclesEntity> jb = new List <JsonVehiclesEntity>(); #region 赋值 foreach (JsonVehiclesResult tm in bill.result) { DataRow newRow; newRow = tblDatas.NewRow(); newRow["BILL_NO"] = tm.billNo; newRow["BILL_STATE_DESC"] = tm.billStateDesc; newRow["CARD_NO"] = tm.cardNo; newRow["CARD_STATE_DESC"] = tm.cardStateDesc; newRow["C_NAME"] = tm.cName; newRow["CONTACT"] = tm.contact; newRow["CREATE_DATE"] = tm.createDate; newRow["CREATOR"] = tm.creator; newRow["DRIVER"] = tm.driver; newRow["VEHICLE_NO"] = tm.vehicleNo; newRow["cardState"] = tm.cardState; tblDatas.Rows.Add(newRow); } return(tblDatas); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(tblDatas); }
/// <summary> /// 查询统计(叉车司机任务统计-查询移货记录) /// </summary> /// <param name="dateBegin"></param> /// <param name="dateEnd"></param> /// <param name="userCode"></param> /// <returns></returns> public DataTable QueryTransRecords(DateTime dateBegin, DateTime dateEnd, string userCode) { #region DataTable DataTable tblDatas = new DataTable("Datas"); tblDatas.Columns.Add("FROM_LC_CODE", Type.GetType("System.String")); tblDatas.Columns.Add("TO_LC_CODE", Type.GetType("System.String")); tblDatas.Columns.Add("UM_QTY", Type.GetType("System.Decimal")); tblDatas.Columns.Add("UM_NAME", Type.GetType("System.String")); tblDatas.Columns.Add("CREATE_DATE", Type.GetType("System.DateTime")); #endregion try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); #region 参数 loStr.Append("userCode=").Append(userCode).Append("&"); loStr.Append("beginDate=").Append(dateBegin).Append("&"); loStr.Append("endDate=").Append(dateEnd); #endregion string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_QueryTransRecordsChaChe); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(tblDatas); } #endregion #region 正常错误处理 JsonQueryTransRecords bill = JsonConvert.DeserializeObject <JsonQueryTransRecords>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(tblDatas); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(tblDatas); } #endregion #region 赋值 foreach (JsonQueryTransRecordsResult tm in bill.result) { DataRow newRow; newRow = tblDatas.NewRow(); newRow["FROM_LC_CODE"] = tm.fromLcCode; newRow["TO_LC_CODE"] = tm.toLcCode; newRow["UM_QTY"] = Convert.ToDecimal(tm.umQty); newRow["UM_NAME"] = tm.umName; newRow["CREATE_DATE"] = Convert.ToDateTime(tm.createDate); tblDatas.Rows.Add(newRow); } return(tblDatas); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(tblDatas); }
/// <summary> /// 盘点单管理--盘点记录 /// </summary> /// <param name="billID"></param> /// <returns></returns> public List <CountDetailEntity> GetCountRecords(int billID) { List <CountDetailEntity> list = new List <CountDetailEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billId=").Append(billID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetCountRecords); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonGetCountRecords bill = JsonConvert.DeserializeObject <JsonGetCountRecords>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonGetCountRecordsResult jbr in bill.result) { CountDetailEntity asnEntity = new CountDetailEntity(); asnEntity.BillID = Convert.ToInt32(jbr.billId); asnEntity.ID = Convert.ToInt32(jbr.id); asnEntity.Location = jbr.lcCode; asnEntity.MaterialCode = jbr.skuCode; asnEntity.MaterialName = jbr.skuName; asnEntity.Qty = Convert.ToDecimal(jbr.qty); asnEntity.UserCode = jbr.userCode; asnEntity.UserName = jbr.userName; asnEntity.ZoneCode = jbr.znCode; asnEntity.ZoneName = jbr.znName; //jbr.skuBarCode; try { if (!string.IsNullOrEmpty(jbr.createDate)) { asnEntity.CreateDate = Convert.ToDateTime(jbr.createDate); } } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } list.Add(asnEntity); } return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(list); }
/// <summary> /// 列出某个组织下面的某个角色的成员,例如保税库的发货员,状态必须是启用的 /// </summary> /// <param name="warehouseCode"></param> /// <param name="roleName"></param> /// <returns></returns> public List <UserEntity> ListUsersByRoleAndWarehouseCode(string warehouseCode, string roleName) { List <UserEntity> list = new List <UserEntity>(); try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("warehouseCode=").Append(warehouseCode).Append("&"); loStr.Append("roleName=").Append(roleName); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_ListUsersByRoleAndWarehouseCode); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(list); } #endregion #region 正常错误处理 JsonListUsersByRoleAndWarehouseCode bill = JsonConvert.DeserializeObject <JsonListUsersByRoleAndWarehouseCode>(jsonQuery); if (bill == null) { //MsgBox.Warn(WebWork.JSON_DATA_NULL); return(list); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(list); } #endregion #region 赋值数据 foreach (JsonListUsersByRoleAndWarehouseCodeResult jbr in bill.result) { UserEntity asnEntity = new UserEntity(); asnEntity.AllowEdit = jbr.allowEdit; asnEntity.IsActive = jbr.isActive; asnEntity.IsOnline = jbr.isOnline; asnEntity.MobilePhone = jbr.mobilePhone; asnEntity.Remark = jbr.remark; asnEntity.ROLE_ID = Convert.ToInt32(jbr.roleId); asnEntity.UserCode = jbr.userCode; asnEntity.UserName = jbr.userName; asnEntity.WarehouseCode = jbr.whCode; asnEntity.WarehouseName = jbr.whName; asnEntity.UserPwd = jbr.pwd; try { //if (!string.IsNullOrEmpty(jbr.updateDate)) // asnEntity.UpdateDate = Convert.ToDateTime(jbr.updateDate); } catch (Exception msg) { MsgBox.Warn(msg.Message); //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg); } list.Add(asnEntity); } return(list); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(list); }
/// <summary> /// 盘点单管理---跟库存实时比对,显示报告 /// </summary> /// <param name="billID"></param> /// <returns></returns> public DataTable GetReportVsStock(int billID) { #region DataTable tblDatas = new DataTable("Datas"); tblDatas.Columns.Add("ZN_NAME", Type.GetType("System.String")); tblDatas.Columns.Add("LC_CODE", Type.GetType("System.String")); tblDatas.Columns.Add("SKU_NAME", Type.GetType("System.String")); tblDatas.Columns.Add("COUNT_QTY", Type.GetType("System.Decimal")); tblDatas.Columns.Add("STOCK_QTY", Type.GetType("System.Decimal")); tblDatas.Columns.Add("DIFF_QTY", Type.GetType("System.Decimal")); tblDatas.Columns.Add("STOCK_EXP_DATE", Type.GetType("System.DateTime")); tblDatas.Columns.Add("EXP_DATE", Type.GetType("System.DateTime")); tblDatas.Columns.Add("IS_SYNC", Type.GetType("System.String")); #endregion try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billId=").Append(billID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetReportVsStock); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(tblDatas); } #endregion #region 正常错误处理 JsonGetReportVsStock bill = JsonConvert.DeserializeObject <JsonGetReportVsStock>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(tblDatas); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(tblDatas); } #endregion #region 赋值 foreach (JsonGetReportVsStockResult tm in bill.result) { DataRow newRow; newRow = tblDatas.NewRow(); newRow["ZN_NAME"] = tm.znName; newRow["LC_CODE"] = tm.lcCode; newRow["SKU_NAME"] = tm.skuName; newRow["COUNT_QTY"] = StringToDecimal.GetTwoDecimal(tm.countQty); newRow["STOCK_QTY"] = StringToDecimal.GetTwoDecimal(tm.stockQty); newRow["DIFF_QTY"] = StringToDecimal.GetTwoDecimal(tm.countQty) - StringToDecimal.GetTwoDecimal(tm.stockQty); if (!string.IsNullOrEmpty(tm.stockExpDate)) { newRow["STOCK_EXP_DATE"] = tm.stockExpDate; } if (!string.IsNullOrEmpty(tm.expDate)) { newRow["EXP_DATE"] = tm.expDate; } //newRow["IS_SYNC"] =; tblDatas.Rows.Add(newRow); } return(tblDatas); #endregion } catch (Exception ex) { MsgBox.Err(ex.Message); } return(tblDatas); }