1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using MaxCommunication.DataBase.Document;
- using PmsSecondaryPackaging.Interface.Model.Carrier;
- using PmsSecondaryPackaging.Interface.Model.StepBook;
- using PmsSecondaryPackaging.Interface.Model.TaskBook;
- using PmsSecondaryPackaging.TaskManager.TaskBookBehavior;
- using ProjectManagementSystem.NHibernateDBHelper;
- using System.Collections.Generic;
- using System.Threading;
- using System.Linq;
- using System;
- namespace ProjectManagementSystem.TaskBookEvent
- {
- public class TaskBookBehavior_61010 : BaseTaskBookBehavior
- {
- public TaskBookBehavior_61010() : base(61010)
- {
- }
- public override bool TaskBookSetting(TaskDetailInfoModel taskDetailInfo, List<StepDetailInfoModel> taskStepInfoList, CarrierInfoModel carrierInfo)
- {
- //IsEnable = false; Asynchronous = true;
- return base.TaskBookSetting(taskDetailInfo, taskStepInfoList, carrierInfo);
- }
- public override bool TaskBookTermination(TaskDetailInfoModel taskDetailInfo, List<StepDetailInfoModel> taskStepInfoList, CarrierInfoModel carrierInfo)
- {
- return base.TaskBookTermination(taskDetailInfo, taskStepInfoList, carrierInfo);
- }
- public override bool TaskBookOperator(TaskDetailInfoModel taskDetailInfo, List<StepDetailInfoModel> taskStepInfoList, CarrierInfoModel carrierInfo)
- {
- bool successed = false;
- StepDetailInfoModel currentStep = taskStepInfoList.Find(p => p.StepId == taskDetailInfo.CurrentStepID);
- string strCurWareHouse = currentStep.WareHouseID;
- try
- {
- bool pass = false;
- string curWareHouse = "";
- using (var session = WMSDBModelHelper.Session)
- {
- var result = session.QueryOver<WareHouseLocation>().Where(p => p.WareHouseCode == "002" && p.Status == "2").List().OrderBy(p => p.Attribute2).ThenByDescending(p => p.Attribute3);//.;//
- List<WareHouseLocation> list = result.ToList();
- if (list.Count() > 0)
- {
- curWareHouse = list.First().LocationCode;
- pass = true;
- }
- }
- if (pass)
- {
- successed = true;
- TextDocument.WriteFile(@"PMS/Log", "选择1楼电梯满库位上料61010", string.Format("选择目标库位:{0}", curWareHouse));
- }
-
- bool resultTask = InterfaceService.GetTask(taskDetailInfo.TaskID, out TaskDetailInfoModel taskDetailInfo1, out string message);
- if (string.IsNullOrEmpty(message) && taskDetailInfo1 == null)
- {
- successed = true;
- }
- }
- catch (Exception ex)
- {
- TextDocument.WriteFile(@"PMS/Log", "选择1楼电梯满库位上料61010", string.Format("异常:{0}", ex.ToString()));
- }
- return successed;
- }
-
- }
- }
|