using HH.WMS.Common;
|
using HH.WMS.Entitys;
|
using HH.WMS.Entitys.Entitys.Mes;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace HH.WMS.BLL.MiddleDB
|
{
|
public class GLMiddleOperateBll : MiddleDapperBaseBLL
|
{
|
public OperateResult TransportSuccess(AGV_Transport_Request_log _log, AGV_Transport_Request _req, AGV_Task_execution_record _exec, TN_WM_SERVICE_EXECEntity _serviceExec)
|
{
|
return UseTransaction(trans =>
|
{
|
//反馈mes
|
if (_serviceExec.CN_C_SEND_MES == Constants.Y)
|
{
|
MiddleCreateDapperDAL<AGV_Transport_Request>().Update(new
|
{
|
HasBeenReceived = Constants.Y
|
}, new
|
{
|
TaskNo = _req.TaskNo
|
}, trans);
|
}
|
//成功时会记录移送任务日志
|
if (_log != null)
|
MiddleCreateDapperDAL<AGV_Transport_Request_log>().Add(_log, trans);
|
//失败为7、8时会记录任务执行情况
|
if (_exec != null)
|
MiddleCreateDapperDAL<AGV_Task_execution_record>().Add(_exec, trans);
|
|
if (_serviceExec.Update)
|
{
|
var or = BLLCreator.CreateDapper<TN_WM_SERVICE_EXECEntity>().Update(new
|
{
|
CN_S_START_LOCATION = _serviceExec.CN_S_START_LOCATION,
|
CN_S_END_LOCATION = _serviceExec.CN_S_END_LOCATION,
|
CN_C_COMPLETE = _serviceExec.CN_C_COMPLETE,
|
CN_C_SEND_MES = _serviceExec.CN_C_SEND_MES,
|
CN_S_MSG = _serviceExec.CN_S_MSG
|
}, new
|
{
|
CN_S_TASK_NO = _serviceExec.CN_S_TASK_NO
|
});
|
if (!or.Success)
|
throw new Exception(or.Msg);
|
}
|
else
|
{
|
var or = BLLCreator.CreateDapper<TN_WM_SERVICE_EXECEntity>().Add(_serviceExec);
|
if (!or.Success)
|
throw new Exception(or.Msg);
|
}
|
});
|
}
|
}
|
}
|