//关闭生产订单
DynamicObject billBean = BusinessDataServiceHelper.LoadSingle(this.Context, row.PrimaryKeyValue, meta.BusinessInfo.GetDynamicObjectType(), null);
string moentryid = billBean["MOEntryId"].ToString();
List<long> entryId = new List<long>();
entryId.Add(Convert.ToInt32(moentryid));
OperateOption option = OperateOption.Create();
option.SetValidateFlag(true);
option.SetVariableValue(Consts.ForceNoTransaction, true);
//执行至强制关闭
var result = AppServiceContext.PRDService.MOService.MOStateTransfer(this.Context, entryId, Consts_OperationNumber.PRD_MO.ForceClose, option);
if (result.IsSuccess == false)
{
Logger.Error("生产订单强制结案", "结案失败", null);
}
else
{
Logger.Error("生产订单强制结案", "结案成功", null);
}