Admin
2025-12-02 9e42f0dafa019f5ecf6b0ff425ecb966b002171e
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
using Autofac.Features.ResolveAnything;
using Microsoft.EntityFrameworkCore.Internal;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using WIDESEA.Common;
using WIDESEA.Common.InOutOrderEnum;
using WIDESEA.Core.ManageUser;
using WIDESEA.Core.Services;
using WIDESEA.Core.Utilities;
using WIDESEA.Entity.DomainModels;
using WIDESEA.Services.IRepositories;
using WIDESEA.Services.Repositories;
using WIDESEA.Services.Services;
 
namespace WIDESEA.Services.IServices
{
    public partial class ToWCSService
    {
 
        /// <summary>
        /// 插入货位,初始化货位
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        public WebResponseContent InsertLocationInfo(SaveModel saveModel)
        {
            WebResponseContent content = new WebResponseContent();
 
            try
            {
                for(int i = 1; i < 9; i++)
                {
                    for (int j = 1; j < 3; j++)
                    {
                        for (int k = 2; k < 54; k++)
                        {
                            Dt_locationinfo loc = new Dt_locationinfo();
                            loc.location_pkid = Guid.NewGuid();
 
                            loc.location_id = i.ToString().PadLeft(2, '0') + "-" + "01" + "-" + k.ToString().PadLeft(3, '0')+"-"+ j.ToString().PadLeft(2, '0');
 
                            Console.WriteLine(loc.location_id);
 
                            loc.location_areaid = "01";
                            loc.location_state = LocationState.LocationState_Empty.ToString();
                            loc.location_line = j;
                            loc.location_column = k;
                            loc.location_layer = i;
                            loc.location_deep = 1;
                            loc.location_islocked = false;
 
                            Dt_locationinfoRepository.Instance.Add(loc,true);
                        }
                    }
                }
                content.OK();
            }
            catch(Exception ex)
            {
                content.Error(ex.Message);
            }
 
            return content;
 
        }
 
 
 
    }
}