刘磊
2025-09-01 0930e25eb34dadc89ca18a98d21c7fceabae1bea
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
using LogLibrary.Log;
using Masuit.Tools;
using Newtonsoft.Json;
using WIDESEA_Common.FangCang;
using WIDESEA_Core;
using WIDESEA_DTO;
using WIDESEA_Model.Models;
 
namespace WIDESEA_StoragIntegrationServices
{
    public partial class ToMESService
    {
        /// <summary>
        /// EDI出库订单  接收医药出库订单数据
        /// </summary>
        /// <param name="jsondata"></param>
        /// <returns></returns>
        public WebResponseContent ediIn(object jsondata)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                if (string.IsNullOrEmpty(jsondata.ToString())) throw new Exception("上传参数为空");
                
 
                var result = JsonConvert.DeserializeObject<ediIn>(jsondata.ToString());
 
                //todo 完成添加出库订单逻辑
                if(result.inOrderType == "10")   //销售入库订单
                {
                    foreach (var item in result.details)
                    {
                        //todo
                    }
                }
                else if(result.inOrderType == "20")  //盘盈入库库单
                {
                    if (result.details[0].stocktakingDetails.Count <= 0) throw new Exception($"盘盈明细为空");
                }
 
 
                LogFactory.GetLog("EDI入库订单接口").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("EDI入库订单接口").Info(true, jsondata.ToJsonString());
 
                return content;
 
            }
            catch (Exception ex)
            {
                LogFactory.GetLog("EDI入库订单接口入").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("EDI出库订单接口").Info(true, ex.Message);
                return content.Error($"EDI入库订单接口请求异常:{ex.Message}");
            }
        }
    }
}