From d57ca280e4c70058033068642806312587a06c8f Mon Sep 17 00:00:00 2001
From: zgq <519541279@qq.com>
Date: 星期一, 16 八月 2021 17:06:55 +0800
Subject: [PATCH] 工艺路线数据导入功能:新增良率列,修改产能列为加工数量;校验产能和良率不能小于等于零。
---
PlanM/数据导入/Gy_DataIn_RoutingBill.cs | 37 ++++++++++++++++++++++++++++++++-----
1 files changed, 32 insertions(+), 5 deletions(-)
diff --git "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_DataIn_RoutingBill.cs" "b/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_DataIn_RoutingBill.cs"
index aebe558..eb40246 100644
--- "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_DataIn_RoutingBill.cs"
+++ "b/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_DataIn_RoutingBill.cs"
@@ -21,7 +21,7 @@
public int HProcNoCol = 0; //工序序号
public int HProcNameCol = 0; //工序
public int HWorkCenterNameCol = 0; //工作中心
- public int HWorkQtyCol = 0; //产能
+ public int HWorkQtyCol = 0; //加工数量
public int HBeginDayQtyCol = 6; //开工固天
public int HBeginFixQtyCol = 7; //开工余量
public int HFixPriceCol = 8; //定额 小时工资
@@ -37,6 +37,7 @@
public int HVerNumCol = 0; //版本
public int HMouldNoCol = 0; //模具编号
public int HProcWorkNumCol = 0; //程序号
+ public int HPassRateCol = 0; //良率
//
public const int HBeginRow = 2; //有效数据,开始行数
//
@@ -87,7 +88,7 @@
HProcNoCol = DBUtility.Gy_BaseFun.Fun_GetCol("工序序号", grdMain);
HProcNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("工序", grdMain);
HWorkCenterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("工作中心", grdMain);
- HWorkQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("产能", grdMain);
+ HWorkQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("加工数量", grdMain);
HPicNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("图纸编号", grdMain);
HTechnologyParameterCol = DBUtility.Gy_BaseFun.Fun_GetCol("工艺参数", grdMain);
HProcCheckNoteCol = DBUtility.Gy_BaseFun.Fun_GetCol("本工序确认记录", grdMain);
@@ -102,6 +103,7 @@
HBeginDayQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("开工固天", grdMain);
HFixPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("小时工资", grdMain);
HProcPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("单个工价", grdMain);
+ HPassRateCol = DBUtility.Gy_BaseFun.Fun_GetCol("良率", grdMain);
//没有找到列
if (HMaterNumberCol == -1)
@@ -121,7 +123,7 @@
}
if (HWorkQtyCol == -1)
{
- MessageBox.Show("没有找到【产能】的标题", "提示");
+ MessageBox.Show("没有找到【加工数量】的标题", "提示");
return;
}
if (HBeginFixQtyCol == -1)
@@ -197,6 +199,11 @@
if (HProcWorkNumCol == -1)
{
MessageBox.Show("没有找到【程序号】的标题", "提示");
+ return;
+ }
+ if (HPassRateCol == -1)
+ {
+ MessageBox.Show("没有找到【良率】的标题", "提示");
return;
}
//
@@ -369,6 +376,7 @@
Single sWorkQty = 0;
Single sBeginDayQty = 0;
Single sBeginFixQty = 0;
+ Single sHPassRate = 0;
//long HItemID = 0;
//
sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HMaterNumberCol].Value);
@@ -378,8 +386,9 @@
sWorkQty = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HWorkQtyCol].Value);
sBeginDayQty = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HBeginDayQtyCol].Value);
sBeginFixQty = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HBeginFixQtyCol].Value);
+ sHPassRate = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HPassRateCol].Value);
//判断是否允许 保存
-
+
Model.ClsGy_RoutingBillSub oSub=new Model.ClsGy_RoutingBillSub();
//得到工序内码
@@ -399,6 +408,7 @@
oSub.HProcNo = DBUtility.ClsPub.isInt(grdMain.Rows[row].Cells[HProcNoCol].Value);
oSub.HUnitTime = 1;
oSub.HWorkQty = sWorkQty;
+ oSub.HPassRate = sHPassRate;
oSub.HRemark = "";
oSub.HTimeUnit = "小时";
oSub.HReadyTime = 0;
@@ -443,14 +453,31 @@
string sHNumber = "";
string sHNamePoc = "";
string sHNumberCen = "";
-
+ Single sWorkQty = 0;
+ Single sHPassRate = 0;
+
//
sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value);
sHNumberCen = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HWorkCenterNameCol].Value);
sHNamePoc = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcNameCol].Value);
+ sWorkQty = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HWorkQtyCol].Value);
+ sHPassRate = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HPassRateCol].Value);
if (sHNumber != "" )
{
//
+ int index = i + 1;
+ //加工数量不能小于等于零
+ if (sWorkQty <= 0)
+ {
+ MessageBox.Show("第" + index + "行加工数量不能小于等于零!", "提示");
+ return false;
+ }
+ //良率不能小于等于零
+ if (sHPassRate <= 0)
+ {
+ MessageBox.Show("第" + index + "行良率不能小于等于零!", "提示");
+ return false;
+ }
//审核代码是否合理
if (!DBUtility.ClsPub.AllowNumber(sHNumber))
{
--
Gitblit v1.9.1