using HH.WMS.BLL.Pda;
|
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 ZCMiddleOperateBll : DapperBaseBLL
|
{
|
public OperateResult TransportSuccess(TN_MES_TASK _req, TN_WM_SERVICE_EXECEntity _serviceExec, string _taskNo)
|
{
|
return UseTransaction(trans =>
|
{
|
//反馈mes
|
if (_serviceExec.CN_C_SEND_MES == Constants.Y)
|
{
|
CreateDapperDAL<TN_MES_TASK>().Update(new
|
{
|
Data_status = _req.Data_status,
|
NeedTrig = _req.NeedTrig,
|
Section = _req.SECTION
|
}, new
|
{
|
TaskNo = _req.task_no
|
}, 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);
|
}
|
|
// 关联主任务
|
if (!string.IsNullOrEmpty(_taskNo))
|
{
|
CreateDapperDAL<TN_WM_TASKEntity>().Update(new
|
{
|
CN_S_EXT1 = _req.task_no
|
}, new
|
{
|
CN_S_TASK_NO = _taskNo
|
}, trans);
|
}
|
});
|
}
|
}
|
}
|