public PKBoxDetailForm(PKDeliverBox record, List <PKDeliverErrorBox> errorList) { InitializeComponent(); this.Text = string.Format(this.Text, record.HU, record.RESULTDESC); if (errorList != null && errorList.Count > 0) { foreach (PKDeliverErrorBox item in errorList) { AddErrorRecord(item); } } }
/// <summary> /// 获取发运箱信息 /// </summary> /// <param name="LOUCENG"></param> /// <param name="PARTNER"></param> /// <param name="shipDate"></param> /// <param name="HU"></param> /// <param name="RESULT"></param> /// <returns></returns> public static PKDeliverBox GetDeliverBox(string LOUCENG, string PARTNER, DateTime shipDate, string HU, string RESULT) { try { string sql = @"SELECT GUID, LOUCENG, PARTNER, SHIP_DATE, HU, RESULT, REMARK FROM DeliverBox WHERE LOUCENG = @LOUCENG AND PARTNER = @PARTNER AND SHIP_DATE = @SHIP_DATE AND HU = @HU AND RESULT = @RESULT AND REMARK = ''"; SqlParameter p1 = DBHelper.CreateParameter("@LOUCENG", LOUCENG); SqlParameter p2 = DBHelper.CreateParameter("@PARTNER", PARTNER); SqlParameter p3 = DBHelper.CreateParameter("@SHIP_DATE", shipDate); SqlParameter p4 = DBHelper.CreateParameter("@HU", HU); SqlParameter p5 = DBHelper.CreateParameter("@RESULT", RESULT); DataTable table = DBHelper.GetTable(sql, false, p1, p2, p3, p4, p5); if (table != null && table.Rows.Count > 0) { DataRow row = table.Rows[0]; PKDeliverBox item = new PKDeliverBox(); item.GUID = row["GUID"] == null ? null : row["GUID"].ToString(); item.LOUCENG = row["LOUCENG"] == null ? null : row["LOUCENG"].ToString(); item.PARTNER = row["PARTNER"] == null ? null : row["PARTNER"].ToString(); item.SHIP_DATE = DateTime.Parse(row["SHIP_DATE"].ToString()); item.HU = row["HU"] == null ? null : row["HU"].ToString(); item.RESULT = row["RESULT"] == null ? null : row["RESULT"].ToString(); item.REMARK = row["REMARK"] == null ? null : row["REMARK"].ToString(); return(item); } return(null); } catch { return(null); } }
public bool SIO_EWM_RFID019(string HU, string SHIP_DATE) { HU = !string.IsNullOrEmpty(HU) ? HU.TrimStart('0') : ""; LogHelp.LogDebug(string.Format("调用绑定函数[SIO_EWM_RFID010],参数=>HU:[{0}],SHIP_DATE:[{1}]", HU, SHIP_DATE)); DateTime?sd = null; try { sd = DateTime.ParseExact(SHIP_DATE, "yyyyMMdd", CultureInfo.InvariantCulture); } catch { } if (sd == null) { LogHelp.LogDebug(string.Format("调用绑定函数[SIO_EWM_RFID010],结果=>[{0}]", "false,发运日期格式错误")); return(false); } //根据HU和发运日期到表BoxPickTaskMap获取箱号和下架单号关系列表 List <BoxPickTaskMapInfo> boxPickTaskMapInfoList = LocalDataService.GetBoxPickTaskMapInfoByHU(HU, sd.Value); if (boxPickTaskMapInfoList == null) { LogHelp.LogDebug(string.Format("调用绑定函数[SIO_EWM_RFID010],结果=>[{0}]", "false,箱码下架单绑定关系不存在")); return(false); } BoxPickTaskMapInfo boxPartnerMapInfo = boxPickTaskMapInfoList.Count > 0 ? boxPickTaskMapInfoList[0] : null; if (boxPartnerMapInfo != null) { //根据PARTNER,LOUCENG,ship_date,hu,result到表DeliverBox获取Guid PKDeliverBox deliverBox = LocalDataService.GetDeliverBox(boxPartnerMapInfo.LOUCENG, boxPartnerMapInfo.PARTNER, sd.Value, HU, "S"); if (deliverBox != null) { //start edit by wuxw //通过Guid到表delivererrorbox获取扫描记录 List <PKDeliverErrorBox> deliverErrorBoxList = LocalDataService.GetDeliverErrorBoxListByBoxGuid(deliverBox.GUID); //到下架单表扣除相应数量 if (deliverErrorBoxList != null && deliverErrorBoxList.Count > 0) { foreach (PKDeliverErrorBox errorbox in deliverErrorBoxList) { //更改下架单的实发数量 LocalDataService.RemovePickTaskRealNum(errorbox.PICK_TASK, errorbox.PICK_TASK_ITEM, errorbox.MATNR, (int)errorbox.REAL, (int)errorbox.ADD_REAL); } } //end edit by wuxw } //删除BoxPartnerMap对应记录 bool result = LocalDataService.DeleteBoxPickTaskMapInfo(HU, sd.Value); if (deliverBox != null) { //删除DeliverBox对应记录 LocalDataService.DeleteDeliverBox(HU, sd.Value); //删除DeliverErrorBox对应记录 LocalDataService.DeleteDeliverErrorBox(HU, sd.Value); //删除deliverepcdetail对应记录 LocalDataService.DeleteDeliverEpcDetail(HU, sd.Value); } } LogHelp.LogDebug(string.Format("调用绑定函数[SIO_EWM_RFID010],结果=>[{0}]", true)); return(true); }