刘磊
2025-11-17 efbeb93b3d454f06d65dbcc68ad828cc95bc9404
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
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_Common.MES;
using WIDESEA_Core;
using WIDESEA_Core.Const;
using WIDESEA_Core.Enums;
using WIDESEAWCS_BasicInfoService;
using WIDESEAWCS_Model.Models;
 
namespace WIDESEA_StoragIntegrationServices
{
    /// <summary>
    /// 预绑定
    /// </summary>
    public partial class MESService
    {
        public WebResponseContent prebind(object json)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                if (string.IsNullOrEmpty(json.ToString())) throw new Exception("请求参数为空");
 
                var result = JsonConvert.DeserializeObject<PreBind>(json.ToString());
 
 
                var palletStockInfo = _palletStockInfoRepository.QueryFirst(x => x.PVI == result.pvi);
                if (palletStockInfo == null) throw new Exception($"未找到{result.pvi}车身库存信息,无法预绑定");
 
                palletStockInfo.StockStatus = StockStateEmun.预绑定.ObjToInt();
                palletStockInfo.OrderID = result.preWorkOrderNo;
                //palletStockInfo.
                _palletStockInfoRepository.UpdateData(palletStockInfo);
 
                //todo:工单为集合时处理
 
                return content.OK();
            }
            catch (Exception ex)
            {
 
                return content.Error(ex.Message);
            }
        }
    }
}