From b5bc15f6acb8fcc2e259df8f05de596d61cab61c Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 09 五月 2022 09:57:18 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 PlanM/数据导入/Gy_StdWorkTimes_RoutingBill.cs |   37 +++++++++++++++++++++++++++++--------
 1 files changed, 29 insertions(+), 8 deletions(-)

diff --git "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.cs" "b/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.cs"
index 0f8ee76..095e1cd 100644
--- "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.cs"
+++ "b/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_StdWorkTimes_RoutingBill.cs"
@@ -31,6 +31,8 @@
         public int HStdWorkTimes = 0;    //标准工时
         public int HUpperlimit = 0;  //上限比例
         public int HLowerlimit = 0;	//下限比例
+        public int HStdPiece = 0;  //上限比例
+        public int HStdPric = 0;	//下限比例
         //
         public const int HBeginRow = 2;         //有效数据,开始行数
 
@@ -81,28 +83,38 @@
             int sHMaterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("物料", grdMain);
             int sHUpperlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("上线比例", grdMain);
             int sHLowerlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("下线比例", grdMain);
+            int sHStdPieceCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准计件", grdMain);
+            int sHStdPricCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准计价", grdMain);
             int sHUSEORGNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("组织", grdMain);
             int sHMakerCol = DBUtility.Gy_BaseFun.Fun_GetCol("制单人", grdMain);
             int sHMakeDateCol = DBUtility.Gy_BaseFun.Fun_GetCol("制单日期", grdMain);
 
             for (int i = 0; i <= grdMain.Rows.Count - 1; i++)
             {
-                if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHMaterNumCol].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHProcNumCol].Value) != "")
+                if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHMaterNumCol].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHProcNumCol].Value) != ""&& DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHStdWorkTimesCol].Value) != "")
                 {
-                    //写入类
-                    if (WriteClass(i))
+                    if (DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[sHStdWorkTimesCol].Value)>0&& DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[sHUpperlimitCol].Value) > 0&& DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[sHLowerlimitCol].Value) > 0)
                     {
-                        //保存记录
-                        if (!BillNew.AddNew())
+                        //写入类
+                        if (WriteClass(i))
                         {
-                            MessageBox.Show("导入失败!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
-                            return;
+                            //保存记录
+                            if (!BillNew.AddNew())
+                            {
+                                MessageBox.Show("导入失败!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
+                                return;
+                            }
                         }
+                    }
+                    else
+                    {
+                        MessageBox.Show("第" + (i + 1) + "行,标准工时、上限比例和下限比例不能小于0", "提示");
+                        return;
                     }
                 }
                 else
                 {
-                    MessageBox.Show("工序代码或物料代码为空!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
+                    MessageBox.Show("第"+(i+1)+"行,工序代码、物料代码和标准工时不能为空!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
                     return;
                 }
             }
@@ -121,6 +133,8 @@
             double sStdWorkTimes = 0;
             double sUpperlimit = 0;
             double sLowerlimit = 0;
+            double sStdPiece = 0;
+            double sStdPric= 0;
             int sUSEORGName = 0;
             DateTime sHMakeDate = DateTime.Today.Date;
             string sHMaker = DBUtility.ClsPub.CurUserName;
@@ -132,6 +146,8 @@
             int sHMaterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("物料", grdMain);
             int sHUpperlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("上线比例", grdMain);
             int sHLowerlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("下线比例", grdMain);
+            int sHStdPieceCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准计件", grdMain);
+            int sHStdPricCol = DBUtility.Gy_BaseFun.Fun_GetCol("标准计价", grdMain);
             int sHUSEORGNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("组织", grdMain);
             int sHMakerCol = DBUtility.Gy_BaseFun.Fun_GetCol("制单人", grdMain);
             int sHMakeDateCol = DBUtility.Gy_BaseFun.Fun_GetCol("制单日期", grdMain);
@@ -143,11 +159,14 @@
             sStdWorkTimes = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHStdWorkTimesCol].Value);
             sUpperlimit = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHUpperlimitCol].Value);
             sLowerlimit = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHLowerlimitCol].Value);
+            sStdPiece = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHStdPieceCol].Value);
+            sStdPric = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHStdPricCol].Value);
             //sUSEORGName = DBUtility.ClsPub.isInt(grdMain.Rows[row].Cells[sHUSEORGNameCol].Value);
             //sHMakeDate = DBUtility.ClsPub.isDate(grdMain.Rows[row].Cells[sHMakeDateCol].Value);
             //sHMaker = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHMakerCol].Value);
 
             //判断是否允许 保存
+            
             //审核代码是否合理
             if (!DBUtility.ClsPub.AllowNumber(sMaterNumber))
             {
@@ -190,6 +209,8 @@
             oSub.HStdWorkTimes = sStdWorkTimes;
             oSub.HUpperlimit = sUpperlimit;
             oSub.HLowerlimit = sLowerlimit;
+            oSub.HStdPiece = sStdPiece;
+            oSub.HStdPric = sStdPric;
             oSub.HUSEORGID = DBUtility.ClsPub.HOrgID;
             oSub.HMaker = DBUtility.ClsPub.CurUserName;
             oSub.HMakeDate = DateTime.Today.ToShortDateString();

--
Gitblit v1.9.1