/// <summary> /// 处理入库任务 /// </summary> /// <param name="currentTask"></param> /// <returns></returns> private bool DealFor_Srm_Store_In(OD_Task currentTask) { List <IV_place_vs_container> placeContnr = new List <IV_place_vs_container>(); placeContnr = srv.Place_Vs_Container_GetRelationshipByContainer(currentTask.CONTAINERNO).ToList(); if (placeContnr.Count > 0) { placeContnr[0].PLACEID = currentTask.TOPLACE; srv.Place_Vs_Container_UpdateOne(placeContnr[0]); } else { //插入新库位容器记录 IV_place_vs_container ivp = new IV_place_vs_container(); ivp.CONTAINERID = currentTask.CONTAINERNO; ivp.PC_ID = Guid.NewGuid().ToString(); ivp.PLACEID = currentTask.TOPLACE; ivp.VOID = 0; ivp.WAREHOUSENO = currentTask.WAREHOUSENO; ivp.INSERTUSER = currentTask.CREATEUSER; ivp.UPDATEUSER = currentTask.UPDATEUSER; ivp.ISEMPTYCONTAINER = currentTask.ISEMPTYCONTAINER == "Y" ? 1 : 0; ivp.UPDATETIME = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); ivp.INSERTTIME = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); srv.Place_Vs_Container_InsertOne(ivp); } bool a = srv.PL_PLACE_UpdateHadTaskDoing(currentTask.TOPLACE, 0); currentTask.TASKSTATUS = "In_Finished"; srv.Od_Task_SetLastTaskVoidByDeviceID(currentTask.DODEVICEID); // 废除上一次任务的有效性,当完成一个任务时,会先将以前的上一次任务(LastTask)作废,将刚刚完成的任务设置为最新上一次任务 bool b = srv.Od_Task_UpdateOne(currentTask); return(a && b); }