分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-01-26 13137e3acdb759d1541f754fba81c616f418e2a1
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.FreeDB;
using WIDESEA_Entity.DomainModels;
 
namespace WIDESEA_WCS.JobsPart.Common
{
    public class LocationCreation
    {
        FreeDB freeDB = new FreeDB();
        /// <summary>
        /// 货位生成
        /// </summary>
        public void HCJCreation()
        {
            try
            {
                List<dt_stationinfo> stationinfos = new List<dt_stationinfo>();
                for (int i = 1; i <= 3; i++)
                {
                    for (int j = 1; j <= 3; j++)
                    {
                        dt_stationinfo stationinfo = new dt_stationinfo();
                        stationinfo.id = Guid.NewGuid();
                        stationinfo.stationCode = "X0" + i + (i <= 9 ? "00" + i : "0" + i) + (j <= 9 ? "00" + j : "0" + j);
                        stationinfo.area = "5";
                        stationinfo.enable = true;
                        stationinfo.line = i;
                        stationinfo.column = j;
                        stationinfos.Add(stationinfo);
                    }
                }
                freeDB.AddRange(stationinfos);
            }
            catch (Exception ex)
            {
 
                throw;
            }
        }
    }
}