1
zgq
2021-08-16 f52d27c5ae0e0d128fa44477ef1daa80aece6d00
1
2个文件已修改
190 ■■■■ 已修改文件
BLL/公用模块/Gy_DataInTmp.designer.cs 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PlanM/数据导入/Gy_DataIn_RoutingBill.cs 152 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BLL/¹«ÓÃÄ£¿é/Gy_DataInTmp.designer.cs
@@ -50,6 +50,7 @@
            this.tc = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
            this.pPic = new System.Windows.Forms.Panel();
            this.pb1 = new System.Windows.Forms.ProgressBar();
            this.txtHDataInTmp = new System.Windows.Forms.TextBox();
            this.cmdHDataInTmp = new System.Windows.Forms.Button();
            this.label5 = new System.Windows.Forms.Label();
@@ -64,7 +65,6 @@
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.grdPrint = new System.Windows.Forms.DataGridView();
            this.panel1 = new System.Windows.Forms.Panel();
            this.pb1 = new System.Windows.Forms.ProgressBar();
            this.Tool.SuspendLayout();
            this.pPic.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.grdMain)).BeginInit();
@@ -293,15 +293,22 @@
            this.pPic.Controls.Add(this.lbldj);
            this.pPic.Dock = System.Windows.Forms.DockStyle.Top;
            this.pPic.Location = new System.Drawing.Point(0, 59);
            this.pPic.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.pPic.Margin = new System.Windows.Forms.Padding(4);
            this.pPic.Name = "pPic";
            this.pPic.Size = new System.Drawing.Size(1460, 56);
            this.pPic.TabIndex = 18;
            // 
            // pb1
            //
            this.pb1.Location = new System.Drawing.Point(920, 18);
            this.pb1.Name = "pb1";
            this.pb1.Size = new System.Drawing.Size(391, 23);
            this.pb1.TabIndex = 104;
            //
            // txtHDataInTmp
            // 
            this.txtHDataInTmp.Location = new System.Drawing.Point(509, 18);
            this.txtHDataInTmp.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.txtHDataInTmp.Margin = new System.Windows.Forms.Padding(4);
            this.txtHDataInTmp.Name = "txtHDataInTmp";
            this.txtHDataInTmp.Size = new System.Drawing.Size(236, 25);
            this.txtHDataInTmp.TabIndex = 103;
@@ -312,7 +319,7 @@
            this.cmdHDataInTmp.Image = ((System.Drawing.Image)(resources.GetObject("cmdHDataInTmp.Image")));
            this.cmdHDataInTmp.ImageAlign = System.Drawing.ContentAlignment.TopRight;
            this.cmdHDataInTmp.Location = new System.Drawing.Point(747, 18);
            this.cmdHDataInTmp.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.cmdHDataInTmp.Margin = new System.Windows.Forms.Padding(4);
            this.cmdHDataInTmp.Name = "cmdHDataInTmp";
            this.cmdHDataInTmp.Size = new System.Drawing.Size(29, 28);
            this.cmdHDataInTmp.TabIndex = 102;
@@ -368,7 +375,7 @@
            this.cmdHPath.Image = ((System.Drawing.Image)(resources.GetObject("cmdHPath.Image")));
            this.cmdHPath.ImageAlign = System.Drawing.ContentAlignment.TopRight;
            this.cmdHPath.Location = new System.Drawing.Point(1063, 8);
            this.cmdHPath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.cmdHPath.Margin = new System.Windows.Forms.Padding(4);
            this.cmdHPath.Name = "cmdHPath";
            this.cmdHPath.Size = new System.Drawing.Size(29, 28);
            this.cmdHPath.TabIndex = 34;
@@ -378,7 +385,7 @@
            // txtHPath
            // 
            this.txtHPath.Location = new System.Drawing.Point(613, 9);
            this.txtHPath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.txtHPath.Margin = new System.Windows.Forms.Padding(4);
            this.txtHPath.Multiline = true;
            this.txtHPath.Name = "txtHPath";
            this.txtHPath.Size = new System.Drawing.Size(447, 49);
@@ -403,7 +410,7 @@
            this.grdMain.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.grdMain.Location = new System.Drawing.Point(0, 177);
            this.grdMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.grdMain.Margin = new System.Windows.Forms.Padding(4);
            this.grdMain.Name = "grdMain";
            this.grdMain.ReadOnly = true;
            this.grdMain.RowHeadersWidth = 51;
@@ -421,7 +428,7 @@
            this.grdSum.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdSum.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.grdSum.Location = new System.Drawing.Point(0, 765);
            this.grdSum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.grdSum.Margin = new System.Windows.Forms.Padding(4);
            this.grdSum.Name = "grdSum";
            this.grdSum.ReadOnly = true;
            this.grdSum.RowHeadersWidth = 51;
@@ -438,7 +445,7 @@
            // 
            this.grdPrint.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdPrint.Location = new System.Drawing.Point(713, 379);
            this.grdPrint.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.grdPrint.Margin = new System.Windows.Forms.Padding(4);
            this.grdPrint.Name = "grdPrint";
            this.grdPrint.RowHeadersWidth = 51;
            this.grdPrint.RowTemplate.Height = 23;
@@ -454,17 +461,10 @@
            this.panel1.Controls.Add(this.cmdHPath);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(0, 115);
            this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.panel1.Margin = new System.Windows.Forms.Padding(4);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(1460, 62);
            this.panel1.TabIndex = 50;
            //
            // pb1
            //
            this.pb1.Location = new System.Drawing.Point(920, 18);
            this.pb1.Name = "pb1";
            this.pb1.Size = new System.Drawing.Size(391, 23);
            this.pb1.TabIndex = 104;
            // 
            // Gy_DataInTmp
            // 
@@ -477,7 +477,7 @@
            this.Controls.Add(this.grdSum);
            this.Controls.Add(this.pPic);
            this.Controls.Add(this.Tool);
            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.Margin = new System.Windows.Forms.Padding(4);
            this.Name = "Gy_DataInTmp";
            this.Text = "数据导入";
            this.Load += new System.EventHandler(this.Gy_DataInTmp_Load);
@@ -530,6 +530,6 @@
        public System.Windows.Forms.Button cmdHPath;
        public System.Windows.Forms.TextBox txtHPath;
        public System.Windows.Forms.Label label4;
        private System.Windows.Forms.ProgressBar pb1;
        public System.Windows.Forms.ProgressBar pb1;
    }
}
PlanM/Êý¾Ýµ¼Èë/Gy_DataIn_RoutingBill.cs
@@ -17,29 +17,29 @@
            InitializeComponent();
        }
        public int HMaterNumberCol = 0;             //产品代码
        public int HProcNoCol = 0;       //工序序号
        public int HProcNameCol = 0;           //工序
        public int HWorkCenterNameCol = 0;        //工作中心
        public int HWorkQtyCol = 0;          //加工数量
        public int HBeginDayQtyCol = 6;     //开工固天
        public int HBeginFixQtyCol = 7;     //开工余量
        public int HFixPriceCol = 8;        //定额 å°æ—¶å·¥èµ„
        public int HProcPriceCol = 9;       //工价
        public int HTechnologyParameterCol = 0;       //工艺参数
        public int HPicNumCol = 0;       //图纸编号
        public int HProcCheckNoteCol = 0;       //本工序确认记录
        public int HMaterNumberCol = 0;             //???????
        public int HProcNoCol = 0;       //???????
        public int HProcNameCol = 0;           //????
        public int HWorkCenterNameCol = 0;        //????????
        public int HWorkQtyCol = 0;          //???????
        public int HBeginDayQtyCol = 6;     //????????
        public int HBeginFixQtyCol = 7;     //????????
        public int HFixPriceCol = 8;        //???? Ð¡?????
        public int HProcPriceCol = 9;       //????
        public int HTechnologyParameterCol = 0;       //???????
        public int HPicNumCol = 0;       //?????
        public int HProcCheckNoteCol = 0;       //???????????
        public int HPicNumVerCol = 0;       //图号版本
        public int HPicNumAssembleCol = 0;       //总装图号
        public int HMaterTextureCol = 0;       //材质
        public int HProductNumCol = 0;       //成品编号
        public int HVerNumCol = 0;       //版本
        public int HMouldNoCol = 0;       //模具编号
        public int HProcWorkNumCol = 0;        //程序号
        public int HPassRateCol = 0;        //良率
        public int HPicNumVerCol = 0;       //???æ±¾
        public int HPicNumAssembleCol = 0;       //??????
        public int HMaterTextureCol = 0;       //????
        public int HProductNumCol = 0;       //??????
        public int HVerNumCol = 0;       //?æ±¾
        public int HMouldNoCol = 0;       //?????
        public int HProcWorkNumCol = 0;        //?????
        public int HPassRateCol = 0;        //????
        //
        public const int HBeginRow = 2;         //有效数据,开始行数
        public const int HBeginRow = 2;         //??Ч????????????
        // 
        public DAL.ClsGy_Process_View oProcHlp = new DAL.ClsGy_Process_View();
        DAL.ClsGy_WorkCenter_View oCenHlp = new DAL.ClsGy_WorkCenter_View();
@@ -57,7 +57,7 @@
        }
        /// <summary>
        ///  åˆå§‹åŒ–界面
        ///  ?????????
        /// </summary>
        public override void initData()
        {
@@ -70,7 +70,7 @@
            base.ModRightNameEdit = base.ModRightName + base.ModRightNameEdit;
            base.ModRightNameMoney = base.ModRightName + base.ModRightNameMoney;
            base.ModRightNameQty = base.ModRightName + base.ModRightNameQty;
            base.ModCaption = "工艺路线导入";
            base.ModCaption = "????·?????";
            this.Text = base.ModCaption;
            lblCaption.Text = base.ModCaption;
            //
@@ -78,7 +78,7 @@
            DBUtility.Gy_BaseFun.SetComboxPeriod(cmbHPeriod);
            //
        }
        //导入
        //????
        public override void Sub_DataIn()
        {
            try
@@ -86,26 +86,26 @@
                string hnumber = "";
                string HBillNo = "";
                //
                HMaterNumberCol = DBUtility.Gy_BaseFun.Fun_GetCol("产品代码", grdMain);
                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);
                HPicNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("图纸编号", grdMain);
                HTechnologyParameterCol = DBUtility.Gy_BaseFun.Fun_GetCol("工艺参数", grdMain);
                HProcCheckNoteCol = DBUtility.Gy_BaseFun.Fun_GetCol("本工序确认记录", grdMain);
                HPicNumVerCol = DBUtility.Gy_BaseFun.Fun_GetCol("图号版本", grdMain);
                HPicNumAssembleCol = DBUtility.Gy_BaseFun.Fun_GetCol("总装图号", grdMain);
                HMaterTextureCol = DBUtility.Gy_BaseFun.Fun_GetCol("材质", grdMain);
                HProductNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("成品编号", grdMain);
                HVerNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("版本", grdMain);
                HMouldNoCol = DBUtility.Gy_BaseFun.Fun_GetCol("模具编号", grdMain);
                HProcWorkNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("程序号", grdMain);
                HBeginFixQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("开工余量", grdMain);
                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);
                HMaterNumberCol = DBUtility.Gy_BaseFun.Fun_GetCol("???????", grdMain);
                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);
                HPicNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("?????", grdMain);
                HTechnologyParameterCol = DBUtility.Gy_BaseFun.Fun_GetCol("???????", grdMain);
                HProcCheckNoteCol = DBUtility.Gy_BaseFun.Fun_GetCol("???????????", grdMain);
                HPicNumVerCol = DBUtility.Gy_BaseFun.Fun_GetCol("???æ±¾", grdMain);
                HPicNumAssembleCol = DBUtility.Gy_BaseFun.Fun_GetCol("??????", grdMain);
                HMaterTextureCol = DBUtility.Gy_BaseFun.Fun_GetCol("????", grdMain);
                HProductNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("??????", grdMain);
                HVerNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("?æ±¾", grdMain);
                HMouldNoCol = DBUtility.Gy_BaseFun.Fun_GetCol("?????", grdMain);
                HProcWorkNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("?????", grdMain);
                HBeginFixQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("????????", grdMain);
                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)
@@ -251,7 +251,7 @@
                        if (hnumber == DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value))
                        {
                            //得到物料内码
                            //???????????
                            if (oMaterHlp.GetInfoByNumber(sHNumber))
                            {
                                if (BillNew.omodel.HMaterID != oMaterHlp.omodel.HItemID)
@@ -266,11 +266,11 @@
                            else
                            {
                                BillNew.omodel.HMaterID = 0;
                                MessageBox.Show("第" + i.ToString() + "行," + sHNumber + "没有找到对应的物料!");
                                MessageBox.Show("??" + i.ToString() + "??," + sHNumber + "????????????????");
                                return;
                            }
                            j++;
                            //写入类
                            //д????
                            WriteClass(i);
                        }
@@ -279,18 +279,18 @@
                            DataSet Ds;
                            ClsCN oCn = new ClsCN();
                            bool b = false;
                            // åˆ¤æ–­æ˜¯å¦å­˜åœ¨å·¥è‰ºè·¯çº¿
                            // ?ж??????????·??
                            Ds = oCn.RunProcReturn("Select HMaterID from Gy_RoutingBillMain Where HMaterID=" + BillNew.omodel.HMaterID.ToString(), "Gy_RoutingBillMain");
                            if (checkadd.Checked == true)
                            {
                                //if (Ds.Tables[0].Rows.Count == 0)//追加
                                //if (Ds.Tables[0].Rows.Count == 0)//???
                                //{
                                //新增前 å…ˆåˆ é™¤åŽŸæ¥å·¥è‰º
                                //????? ????????????
                                BillNew.DeleteByMaterID(BillNew.omodel.HMaterID);
                                b = BillNew.AddBill(ref ClsPub.sExeReturnInfo);
                                if (b == false)
                                {
                                    MessageBox.Show("第" + i.ToString() + "行,物料" + BillNew.omodel.HMaterNumber + "新增工艺路线失败!代码293行中,原因:" + ClsPub.sExeReturnInfo);
                                    MessageBox.Show("??" + i.ToString() + "??,????" + BillNew.omodel.HMaterNumber + "????????·??????????293???У????" + ClsPub.sExeReturnInfo);
                                    return;
                                }
                                c++;
@@ -319,13 +319,13 @@
                            hnumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value);
                            sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value);
                            //审核代码是否合理
                            //????????????
                            if (!DBUtility.ClsPub.AllowNumber(sHNumber))
                            {
                                MessageBox.Show("物料代码中不能出现连续‘.’并且首位末位不能为‘.’!", "提示");
                                MessageBox.Show("????????в????????????.????????λ?λ???????.????", "???");
                                return;
                            }
                            //得到物料内码
                            //???????????
                            if (oMaterHlp.GetInfoByNumber(sHNumber))
                            {
                                if (BillNew.omodel.HMaterID != oMaterHlp.omodel.HItemID)
@@ -382,7 +382,7 @@
            }
        }
        //写入类 ä»ŽæŽ§ä»¶
        //д???? ????
        private bool WriteClass(int row)
        {
            string sHNumber = "";
@@ -402,22 +402,22 @@
            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();
            //得到工序内码
            //???????????
            if (oProcHlp.GetInfoByName(sHNamePoc))
            {
                oSub.HProcID = oProcHlp.omodel.HItemID;
            }
            //得到车间内码
            //???????????
            if (oCenHlp.GetInfoByName(sHNumberCen))
            {
                oSub.HCenterID = oCenHlp.omodel.HItemID;
            }
            //写入信息
            //д?????
            oSub.HEntryID = j;
            oSub.HProcNo = DBUtility.ClsPub.isInt(grdMain.Rows[row].Cells[HProcNoCol].Value);
@@ -425,7 +425,7 @@
            oSub.HWorkQty = sWorkQty;
            oSub.HPassRate = sHPassRate;
            oSub.HRemark = "";
            oSub.HTimeUnit = "Сʱ";
            oSub.HTimeUnit = "С?";
            oSub.HReadyTime = 0;
            oSub.HQueueTime = 0;
            oSub.HMoveTime = 0;
@@ -457,7 +457,7 @@
            return true;
        }
        //检查物料
        //???????
        private bool Checkdata()
        {
            bool b = false;
@@ -481,53 +481,53 @@
                {
                    // 
                    int index = i + 1;
                    //加工数量不能小于等于零
                    //???????????С???????
                    if (sWorkQty <= 0)
                    {
                        MessageBox.Show("第" + index + "行加工数量不能小于等于零!", "提示");
                        MessageBox.Show("??" + index + "?м??????????С???????", "???");
                        return false;
                    }
                    //良率不能小于等于零
                    //???????С???????
                    if (sHPassRate <= 0)
                    {
                        MessageBox.Show("第" + index + "行良率不能小于等于零!", "提示");
                        MessageBox.Show("??" + index + "?????????С???????", "???");
                        return false;
                    }
                    //审核代码是否合理
                    //????????????
                    if (!DBUtility.ClsPub.AllowNumber(sHNumber))
                    {
                        MessageBox.Show("物料代码中不能出现连续‘.’并且首位末位不能为‘.’!", "提示");
                        MessageBox.Show("????????в????????????.????????λ?λ???????.????", "???");
                        return false;
                    }
                    //得到物料内码
                    //???????????
                    int j = i + HBeginRow;
                    if (!oMaterHlp.GetInfoByNumber(sHNumber))
                    {
                        sMsg = "[" + sHNumber + "]物料不存在";
                        sMsg = "[" + sHNumber + "]?????????";
                        if (sErrMsg.Contains(sMsg) == false)
                        {
                            sErrMsg = sErrMsg + "[" + sHNumber + "]物料不存在\r\n";
                            sErrMsg = sErrMsg + "[" + sHNumber + "]?????????\r\n";
                        }
                        b = true;
                    }
                    //得到工序内码
                    //???????????
                    if (!oProcHlp.GetInfoByName(sHNamePoc))
                    {
                        sMsg = "[" + sHNamePoc + "]工序不存在";
                        sMsg = "[" + sHNamePoc + "]????????";
                        if (sErrMsg.Contains(sMsg) == false)
                        {
                            sErrMsg = sErrMsg + "[" + sHNamePoc + "]工序不存在\r\n";
                            sErrMsg = sErrMsg + "[" + sHNamePoc + "]????????\r\n";
                        }
                        b = true;
                    }
                    //得到工作中心内码
                    //???????????????
                    if (!oCenHlp.GetInfoByName(sHNumberCen))
                    {
                        sMsg = "[" + sHNumberCen + "]工作中心不存在";
                        sMsg = "[" + sHNumberCen + "]?????????????";
                        if (sErrMsg.Contains(sMsg) == false)
                        {
                            sErrMsg = sErrMsg + "[" + sHNumberCen + "]工作中心不存在\r\n";
                            sErrMsg = sErrMsg + "[" + sHNumberCen + "]?????????????\r\n";
                        }
                        b = true;