禾欣总汇

This commit is contained in:
CPL 2025-03-05 09:47:30 +08:00
parent bf64c5a2f6
commit f50cdeeb39
4 changed files with 68 additions and 13 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/LeatherProject/.vs

View File

@ -13,6 +13,7 @@ using LeatherApp.Page;
using System.Reflection;
using Service;
using LeatherApp.Utils;
using HZH_Controls.Forms;
namespace LeatherApp
{
@ -188,6 +189,9 @@ namespace LeatherApp
//HideProcessForm();//完成后关闭动画
frm.TopLevel = true;
frm.UserName = szUserCode;
//查询硬盘
CheckDisk(this, 100);
//frm.Password = "1";
frm.ShowDialog();
frm.Dispose();
@ -269,6 +273,50 @@ namespace LeatherApp
this.HideProcessForm();
this.Visible = true;
}
#region
public bool CheckDisk(IWin32Window owner, int max = 10)
{
if (!string.IsNullOrEmpty(Config.ImagePath))
{
string path = Config.ImagePath;
string volume = path.Substring(0, path.IndexOf(':'));
long freespace = GetHardDiskSpace(volume);
if (freespace < max)
{
string tip = $"当前{volume}硬盘容量:{freespace}GB小于{max}GB。注意清理";
FrmDialog.ShowDialog(owner, tip, "警告", true);
return false;
}
}
return true;
}
//drive.TotalFreeSpace单位为bit根据需要除以1024
//drive同时可以可以获取磁盘分区容量等
//单位GB
public long GetHardDiskSpace(string str_HardDiskName)
{
long totalSize = 0;
try
{
str_HardDiskName = str_HardDiskName + ":\\";
System.IO.DriveInfo[] drives = System.IO.DriveInfo.GetDrives();
foreach (System.IO.DriveInfo drive in drives)
{
if (drive.Name == str_HardDiskName)
{
totalSize = drive.TotalFreeSpace / (1024 * 1024 * 1024);
}
}
}
catch
{
totalSize = 0;
}
return totalSize;
}
#endregion
private void FrmManager_FormClosing(object sender, FormClosingEventArgs e)
{
UILocalize.OK = "是";

View File

@ -5521,6 +5521,8 @@ namespace LeatherApp.Page
DefectInfoList = deflist,
UserName = model.UserName,
WorkTeam = model.WorkTeam,
PJXTBH = model.PJXTBH,
DefectType = model.DefectType,
};
htTask.Add(currKey, record);

View File

@ -300,18 +300,22 @@ namespace LeatherApp.Utils
//幅宽
double agvmf = 0;
double mf1 = 0, mf2 = 0, mf3 = 0;
if (records.FacePointList.Count > 10)
mf1 = records.FacePointList[10][1];
else
mf1 = records.FacePointList[0][1];
if (records.FacePointList.Count > 10)
mf3 = records.FacePointList[records.FacePointList.Count - 10][1];
else
mf3 = records.FacePointList[records.FacePointList.Count - 1][1];
if (records.FacePointList.Count > 0)
mf2 = records.FacePointList[records.FacePointList.Count/2][1];
if (records.FacePointList != null && records.FacePointList.Count > 0)
{
if (records.FacePointList.Count > 10)
mf1 = records.FacePointList[10][1];
else
mf1 = records.FacePointList[0][1];
if (records.FacePointList.Count > 10)
mf3 = records.FacePointList[records.FacePointList.Count - 10][1];
else
mf3 = records.FacePointList[records.FacePointList.Count - 1][1];
if (records.FacePointList.Count > 0)
mf2 = records.FacePointList[records.FacePointList.Count / 2][1];
agvmf = (mf1 + mf2 + mf3)/3;
agvmf = (mf1 + mf2 + mf3) / 3;
agvmf = records.FacePointList.Select(x => x[1]).ToList().Average();
}
//新数据插入
db.Insertable(new XCLErpUploadData()
{
@ -329,7 +333,7 @@ namespace LeatherApp.Utils
MF1 = mf1,
MF2 = mf2,
MF3 = mf3,
AvgMF = records.FacePointList.Select(x => x[1]).ToList().Average(),
AvgMF = agvmf,
HD1= hd1,
HD2= hd2,