刘磊
2025-06-10 87b6fc65bc3b6cce03af04758db82236d29bc7e5
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
using AngleSharp.Dom;
using log4net.Core;
using Masuit.Tools;
using Newtonsoft.Json;
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;
using WIDESEA_DTO.WMS;
using WIDESEA_Model.Models;
 
namespace WIDESEA_StoragIntegrationServices
{
    public partial class MCSService
    {
        /// <summary>
        /// 请求移库
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        public WebResponseContent RequestChangeLocation(object json)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                if (string.IsNullOrEmpty(json.ToString())) throw new Exception("请求参数为空");
 
                var result = JsonConvert.DeserializeObject<RequestReMove>(json.ToString());
 
                var location = _locationRepository.QueryFirst(x => x.AreaId == result.LocationArea && x.LocationCode == result.LocationID);
 
                if (location == null) throw new Exception("未知库位");
 
                if (_taskRepository.QueryFirst(x => x.SourceAddress == result.LocationID && x.Roadway == location.RoadwayNo) != null)
                {
                    throw new Exception("当前库位已存在任务");
                }
 
                LogFactory.GetLog("分容移库申请").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("分容移库申请").Info(true, result.ToJsonString());
                return content.OK();
            }
            catch (Exception ex)
            {
                LogFactory.GetLog("分容移库申请").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("分容移库申请").Info(true, ex.Message);
                return content.Error(ex.Message);
            }
        }
 
    }
}