using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WIDESEA.Common;
using WIDESEA.Core.Enums;
using WIDESEA.Core.ManageUser;
using WIDESEA.Core.Services;
using WIDESEA.Core.Utilities;
using WIDESEA.Entity.DomainModels;
using WIDESEA.Services.IServices.ToApp;
using WIDESEA.Services.Repositories;
using WIDESEA.Services.Services;
using WIDESEA_Entity.DomainModels;
namespace WIDESEA_Services.Services
{
public partial class ToAPPOperation
{
///
/// 选配确认
///
///
///
public WebResponseContent OutboundCheckAction(SaveModel saveModel)
{
WebResponseContent content = new WebResponseContent();
try
{
string record_id = saveModel.MainData["record_id"]?.ToString();
if (string.IsNullOrEmpty(record_id))
return content.Error("查询轴承选配记录失败,轴承信息不能为空。");
dt_selectionRecord record = dt_selectionRecordRepository.Instance.FindFirst(r => r.record_id == Guid.Parse(record_id));
if (null == record)
return content.Error("查询轴承选配记录失败,轴承Id:" + record_id);
record.record_checkTime = DateTime.Now;
record.record_checkUser = UserContext.Current.UserTrueName;
dt_selectionRecordRepository.Instance.Update(record, x => new { record.record_checkTime, record.record_checkUser }, true);
string result = CommonFunction.WheelsetMatch(record.record_ldNumber, record.record_materielNumber, "左侧".Equals(record.record_direction) ? "6" : "7");
content.OK("选配确认成功。" + result);
}
catch (Exception ex)
{
content.Error("选配确认失败:" + ex.Message);
}
Logger.AddLog(LoggerType.Add, saveModel, content, content);
return content;
}
}
}