Tiandele
2026-03-20 daea1a90c2fa1b5cc2f52e62be15bd95cc4155f6
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
69
70
71
72
73
74
75
76
using Masuit.Tools;
using Newtonsoft.Json;
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common;
using WIDESEA_Core;
using WIDESEA_Core.Const;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_DTO.WMS;
using WIDESEA_Model.Models;
using WIDESEA_StorageBasicRepository;
using WIDESEA_StorageOutOrderRepository;
 
namespace WIDESEA_StoragIntegrationServices
{
    public partial class MESService
    {
        public WebResponseContent pushOrderInfo(object json)
        {
            WebResponseContent responseContent = new WebResponseContent();
            try
            {
                if (string.IsNullOrEmpty(json.ToString())) throw new Exception("请求参数为空");
                Console.WriteLine(json);
                var result = JsonConvert.DeserializeObject<List<pushOrderInfo>>(json.ToString());
 
                if (result[0].plantCode != "1052") throw new Exception("非本工厂订单,请重试");
 
                var ListAssemblyOrderInfo = new List<Dt_AssemblyOrderInfo>();
                foreach (var item in result)
                {
                    Dt_AssemblyOrderInfo assemblyOrderInfo = new Dt_AssemblyOrderInfo
                    {
                        biwMaterial = item.biwMaterial,
                        CreateDate = DateTime.Now,
                        Creater = "System",
                        orderType = item.orderType,
                        pbMaterial = item.pbMaterial,
                        plantCode = item.plantCode,
                        pvi = item.pvi,
                        sequenceNo = item.sequenceNo,
                        spare1 = item.spare1,
                        spare2 = item.spare2,
                        spare3 = item.spare3,
                        splitStrategy = item.splitStrategy,
                        vehicleCharacteristic = item.vehicleCharacteristic,
                        vehicleCode = item.vehicleCode,
                        vehicleOrderNo = item.vehicleOrderNo,
                        workOrderNo = item.workOrderNo,
                        workOrderSendStatus = item.workOrderSendStatus,  //1-排产 2-撤回
                    };
                    ListAssemblyOrderInfo.Add(assemblyOrderInfo);
                }
 
                _assemblyOrderInfoRepository.AddData(ListAssemblyOrderInfo);
 
                LogFactory.GetLog("总装工单信息").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("总装工单信息").Info(true, json.ToJsonString());
                responseContent.OK();
            }
            catch (Exception ex)
            {
                //_unitOfWorkManage.RollbackTran();
                LogFactory.GetLog("总装工单信息").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("总装工单信息").Info(true, $"总装工单接收异常:{ex.Message}");
                return responseContent.Error(ex.Message);
            }
            return responseContent;
        }
    }
}