Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-HCSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d92a4a4a
由
LN
编写于
2020-12-17 11:49:33 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加库位更新功能,10位的库位更改为12位。
1 个父辈
28eaeafd
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
82 行增加
和
97 行删除
source/DeviceLibrary/StoreConfig/linePositions_1.csv
source/DeviceLibrary/StoreConfig/linePositions_2.csv
source/HCSingleStore/Program.cs
source/HuichuanLibrary/HCBoardManager.cs
source/LoadCVSLibrary/CSVReaderBase.cs
source/LoadCVSLibrary/position/CSVPositionReader.cs
source/DeviceLibrary/StoreConfig/linePositions_1.csv
查看文件 @
d92a4a4
此文件的差异太大,无法显示。
source/DeviceLibrary/StoreConfig/linePositions_2.csv
查看文件 @
d92a4a4
此文件的差异太大,无法显示。
source/HCSingleStore/Program.cs
查看文件 @
d92a4a4
...
@@ -8,7 +8,7 @@ using System.Diagnostics;
...
@@ -8,7 +8,7 @@ using System.Diagnostics;
using
System.Linq
;
using
System.Linq
;
using
System.Runtime.InteropServices
;
using
System.Runtime.InteropServices
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
namespace
OnlineStore.ACSingleStore
namespace
OnlineStore.ACSingleStore
{
{
...
@@ -96,7 +96,7 @@ namespace OnlineStore.ACSingleStore
...
@@ -96,7 +96,7 @@ namespace OnlineStore.ACSingleStore
{
{
log4net
.
GlobalContext
.
Properties
[
"fname"
]
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_CID
);
log4net
.
GlobalContext
.
Properties
[
"fname"
]
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_CID
);
log4net
.
Config
.
XmlConfigurator
.
Configure
();
log4net
.
Config
.
XmlConfigurator
.
Configure
();
System
.
Net
.
ServicePointManager
.
DefaultConnectionLimit
=
512
;
System
.
Net
.
ServicePointManager
.
DefaultConnectionLimit
=
512
;
// XmlConfigurator.Configure();
// XmlConfigurator.Configure();
Application
.
EnableVisualStyles
();
Application
.
EnableVisualStyles
();
Application
.
SetCompatibleTextRenderingDefault
(
false
);
Application
.
SetCompatibleTextRenderingDefault
(
false
);
...
@@ -104,46 +104,46 @@ namespace OnlineStore.ACSingleStore
...
@@ -104,46 +104,46 @@ namespace OnlineStore.ACSingleStore
}
}
return
;
return
;
if
(!
isShow
)
//
if (!isShow)
{
//
{
//获得当前登录的Windows用户标示
//
//获得当前登录的Windows用户标示
System
.
Security
.
Principal
.
WindowsIdentity
identity
=
System
.
Security
.
Principal
.
WindowsIdentity
.
GetCurrent
();
//
System.Security.Principal.WindowsIdentity identity = System.Security.Principal.WindowsIdentity.GetCurrent();
System
.
Security
.
Principal
.
WindowsPrincipal
principal
=
new
System
.
Security
.
Principal
.
WindowsPrincipal
(
identity
);
//
System.Security.Principal.WindowsPrincipal principal = new System.Security.Principal.WindowsPrincipal(identity);
//判断当前登录用户是否为管理员
//
//判断当前登录用户是否为管理员
if
(
principal
.
IsInRole
(
System
.
Security
.
Principal
.
WindowsBuiltInRole
.
Administrator
))
//
if (principal.IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator))
{
//
{
//如果是管理员,则直接运行
//
//如果是管理员,则直接运行
log4net
.
GlobalContext
.
Properties
[
"fname"
]
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_CID
);
// //
log4net.GlobalContext.Properties["fname"] = ConfigAppSettings.GetValue(Setting_Init.Store_CID);
log4net
.
Config
.
XmlConfigurator
.
Configure
();
// //
log4net.Config.XmlConfigurator.Configure();
System
.
Net
.
ServicePointManager
.
DefaultConnectionLimit
=
512
;
//
System.Net.ServicePointManager.DefaultConnectionLimit = 512;
// XmlConfigurator.Configure();
//
// XmlConfigurator.Configure();
Application
.
EnableVisualStyles
();
//
Application.EnableVisualStyles();
Application
.
SetCompatibleTextRenderingDefault
(
false
);
//
Application.SetCompatibleTextRenderingDefault(false);
Application
.
Run
(
new
FrmStore
());
//
Application.Run(new FrmStore());
}
//
}
else
//
else
{
//
{
//创建启动对象
//
//创建启动对象
System
.
Diagnostics
.
ProcessStartInfo
startInfo
=
new
System
.
Diagnostics
.
ProcessStartInfo
();
//
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo
.
UseShellExecute
=
true
;
//
startInfo.UseShellExecute = true;
startInfo
.
WorkingDirectory
=
Environment
.
CurrentDirectory
;
//
startInfo.WorkingDirectory = Environment.CurrentDirectory;
startInfo
.
FileName
=
Application
.
ExecutablePath
;
//
startInfo.FileName = Application.ExecutablePath;
//设置启动动作,确保以管理员身份运行
//
//设置启动动作,确保以管理员身份运行
startInfo
.
Verb
=
"runas"
;
//
startInfo.Verb = "runas";
try
//
try
{
//
{
System
.
Diagnostics
.
Process
.
Start
(
startInfo
);
//
System.Diagnostics.Process.Start(startInfo);
}
//
}
catch
//
catch
{
//
{
return
;
//
return;
}
//
}
//退出
//
//退出
Application
.
Exit
();
//
Application.Exit();
}
//
}
}
//
}
}
}
static
void
CurrentDomain_UnhandledException
(
object
sender
,
UnhandledExceptionEventArgs
e
)
static
void
CurrentDomain_UnhandledException
(
object
sender
,
UnhandledExceptionEventArgs
e
)
{
{
LogUnhandledException
(
e
.
ExceptionObject
);
LogUnhandledException
(
e
.
ExceptionObject
);
...
...
source/HuichuanLibrary/HCBoardManager.cs
查看文件 @
d92a4a4
...
@@ -5,6 +5,7 @@ using System.IO;
...
@@ -5,6 +5,7 @@ using System.IO;
using
System.Linq
;
using
System.Linq
;
using
System.Runtime.InteropServices
;
using
System.Runtime.InteropServices
;
using
System.Text
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
...
@@ -31,7 +32,7 @@ namespace HuichuanLibrary
...
@@ -31,7 +32,7 @@ namespace HuichuanLibrary
{
{
if
(
deviceConfigPath
.
Equals
(
""
))
if
(
deviceConfigPath
.
Equals
(
""
))
{
{
DeviceConfigPath
=
".
\\device_config.xml"
;
DeviceConfigPath
=
Application
.
StartupPath
+
"
\\device_config.xml"
;
}
}
else
else
{
{
...
@@ -39,7 +40,7 @@ namespace HuichuanLibrary
...
@@ -39,7 +40,7 @@ namespace HuichuanLibrary
}
}
if
(
systemConfigPath
.
Equals
(
""
))
if
(
systemConfigPath
.
Equals
(
""
))
{
{
SystemConfigPath
=
".
\\system_config.xml"
;
SystemConfigPath
=
Application
.
StartupPath
+
"
\\system_config.xml"
;
}
}
else
else
{
{
...
@@ -67,18 +68,31 @@ namespace HuichuanLibrary
...
@@ -67,18 +68,31 @@ namespace HuichuanLibrary
{
{
return
true
;
return
true
;
}
}
for
(
int
i
=
1
;
i
<=
3
;
i
++)
if
(!
File
.
Exists
(
DeviceConfigPath
))
{
{
HCLogUtil
.
error
(
"InitCard FAIL, 【"
+
DeviceConfigPath
+
"】not exists"
);
if
(!
File
.
Exists
(
DeviceConfigPath
))
return
false
;
{
}
HCLogUtil
.
error
(
"InitCard FAIL "
+
i
+
", 【"
+
DeviceConfigPath
+
"】not exists"
);
if
(!
File
.
Exists
(
SystemConfigPath
))
if
(
i
>=
3
)
{
{
HCLogUtil
.
error
(
"InitCard FAIL, 【"
+
SystemConfigPath
+
"】not exists"
);
return
false
;
return
false
;
}
}
}
else
if
(!
File
.
Exists
(
SystemConfigPath
))
{
HCLogUtil
.
error
(
"InitCard FAIL "
+
i
+
", 【"
+
SystemConfigPath
+
"】not exists"
);
if
(
i
>=
3
)
{
return
false
;
}
}
else
{
break
;
}
Thread
.
Sleep
(
500
);
}
//【1】获取卡
//【1】获取卡
Int32
nCardNum
=
0
;
Int32
nCardNum
=
0
;
...
...
source/LoadCVSLibrary/CSVReaderBase.cs
查看文件 @
d92a4a4
...
@@ -159,30 +159,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -159,30 +159,7 @@ namespace OnlineStore.LoadCSVLibrary
return
titleIndex
;
return
titleIndex
;
}
}
protected
static
void
BackConfig
(
string
filePath
,
string
[]
lines
)
protected
static
void
BackConfig
(
string
filePath
,
string
[]
lines
)
{
{
////备份保存
//try
//{
// FileInfo file = new FileInfo(filePath);
// string date = DateTime.Now.ToString("yyyy-MM-dd");
// string targetBackPath = @"C:\configBack\" + date + @"\";
// if (!Directory.Exists(targetBackPath))
// {
// Directory.CreateDirectory(targetBackPath);
// }
// string fileName = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss") + "." + file.Name;
// string backFile = targetBackPath + fileName;
// if (File.Exists(backFile))
// {
// File.Delete(backFile);
// }
// File.WriteAllLines(backFile, lines, Encoding.UTF8);
//}
//catch (Exception e)
//{
// LogUtil.error("备份【" + filePath + "】到C:configBack出错:" + e.ToString());
//}
//备份保存
//备份保存
try
try
{
{
...
...
source/LoadCVSLibrary/position/CSVPositionReader.cs
查看文件 @
d92a4a4
...
@@ -249,34 +249,29 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -249,34 +249,29 @@ namespace OnlineStore.LoadCSVLibrary
//第1和第2位表示楼层(4D)
//第1和第2位表示楼层(4D)
//第3和第4位表示料仓(01) 01 - 18为流水线料仓, 19 - 24为包装料仓
//第3和第4位表示料仓(01) 01 - 18为流水线料仓, 19 - 24为包装料仓
//第5和第6位表示列(02)
//第5和第6位表示列(02)
//第7和第8位表示行(03)
//第7和第8位表示行(AA=01,BB=02,CC=03,DD=04)
//第9和第10位表示隔板位置(04)
//第10,11,12,13位表示隔板位置()
//例如: 4D12010124 表示4楼12号料仓第1列第1行架子上的第24个隔板位置
//例如: 4D1201AA0024 表示4楼12号料仓第1列第1行架子上的第24个隔板位置
//4D19050208 表示4楼19号料仓(包装料仓)第5列第2行架子上的第8个隔板位置
//3D0101AA0001
//3D01020304
string
oldPosId
=
position
.
PositionNum
;
//
08#AC1_18_3_18
string
oldPosId
=
position
.
PositionNum
;
//
3D01020304
string
newPosId
=
""
;
string
newPosId
=
""
;
int
jIndex
=
oldPosId
.
IndexOf
(
"#"
)
;
int
strLength
=
oldPosId
.
Length
;
string
louceng
=
"3D"
;
string
louceng
=
"3D"
;
string
storeId
=
storeIndex
.
ToString
().
PadLeft
(
2
,
'0'
);
string
storeId
=
storeIndex
.
ToString
().
PadLeft
(
2
,
'0'
);
if
(
jIndex
>
0
)
if
(
strLength
.
Equals
(
10
)
)
{
{
string
[]
hengStr
=
oldPosId
.
Split
(
'_'
);
string
[]
hengStr
=
oldPosId
.
Split
(
'_'
);
int
lie
=
0
;
string
lieStr
=
oldPosId
.
Substring
(
4
,
2
);
int
hang
=
0
;
int
hang
=
Convert
.
ToInt32
(
Convert
.
ToInt32
(
oldPosId
.
Substring
(
6
,
2
)));
int
p
=
0
;
string
pStr
=
oldPosId
.
Substring
(
8
,
2
);
if
(
hengStr
.
Length
==
4
)
{
lie
=
Convert
.
ToInt32
(
hengStr
[
1
]);
hang
=
Convert
.
ToInt32
(
hengStr
[
2
]);
p
=
Convert
.
ToInt32
(
hengStr
[
3
]);
}
string
hangStr
=
"AA"
;
string
hangStr
=
"AA"
;
if
(
hang
.
Equals
(
1
))
if
(
hang
.
Equals
(
1
))
{
{
hangStr
=
"AA"
;
hangStr
=
"AA"
;
}
else
if
(
hang
.
Equals
(
2
))
}
else
if
(
hang
.
Equals
(
2
))
{
{
hangStr
=
"BB"
;
hangStr
=
"BB"
;
}
}
...
@@ -296,8 +291,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -296,8 +291,7 @@ namespace OnlineStore.LoadCSVLibrary
{
{
hangStr
=
"FF"
;
hangStr
=
"FF"
;
}
}
lie
++;
newPosId
=
louceng
+
storeId
+
lieStr
+
hangStr
+
"00"
+
pStr
;
newPosId
=
louceng
+
storeId
+
lie
.
ToString
().
PadLeft
(
2
,
'0'
)
+
hangStr
+
p
.
ToString
().
PadLeft
(
4
,
'0'
);
}
}
else
else
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论