wangxinhui
74 分钟以前 526b70eecc5dac5aea91bfffbe0b98118f25827f
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
56
57
58
59
60
61
62
63
64
65
66
67
68
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.APIEnum;
using WIDESEA_Core.Helper;
using WIDESEA_Core;
using WIDESEA_DTO;
using WIDESEA_DTO.MES;
using WIDESEA_Model.Models;
 
namespace WIDESEA_TaskInfoService
{
    public partial class TaskService
    {
        static object lock_solder = new object();
        public MesResponseContent SolderMaskOutNotice()
        {
            //锁
            lock (lock_solder)
            {
                MesResponseContent responseContent = new MesResponseContent();
                try
                {
 
                }
                catch (Exception ex)
                {
                    responseContent.Error(ex.Message);
                }
                return responseContent;
            }
        }
        /// <summary>
        /// 防焊立库入库后调用MES接口获取批次信息
        /// </summary>
        /// <param name="LotNo"></param>
        /// <returns></returns>
        public MesSolderModel? GetProductByLot(string LotNo)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMS_MES_GetProductByLot.ToString());
                string requestApi = apiInfo.ApiAddress + "?lotNo=" + LotNo;
                string response = HttpMesHelper.Post(requestApi);
                MesResponseContent mesResponseContent = response.DeserializeObject<MesResponseContent>();
                //调用接口
                if (mesResponseContent.BSucc == true)
                {
                    MesSolderModel? mesSolder= mesResponseContent.Content.ToString()?.DeserializeObject<MesSolderModel>();
                    return mesSolder;
                }
                else
                {
                    throw new Exception(mesResponseContent.StrMsg);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
    }
}