Admin
6 天以前 bd6818fc9d40f343547bafca0743658f3c0379dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 
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
    {
 
        /// <summary>
        /// 选配确认
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        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;
        }
    }
}