获取最近的上模单  把工单跟模具进行绑定
上模单器具回车截取字符优化
3个文件已修改
69 ■■■■■ 已修改文件
WebAPI/Controllers/LMESController.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/MJGL/Sc_MouldUpperBillController.cs 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSc_MESBeginWorkBill.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/LMESController.cs
@@ -577,9 +577,19 @@
                        return objJsonResult;
                    }
                    ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp where HSourceInterID=" + HInterID + " and HSourceEntryID=" + HEntryID + " and HICMOStatus=0 and HSourceID=" + HSourceID, "Sc_ICMOBillStatus_Tmp");
                    ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp where HSourceInterID=" + HInterID + " and HSourceEntryID=" + HEntryID + "  and HSourceID=" + HSourceID, "Sc_ICMOBillStatus_Tmp");
                    if (ds.Tables[0].Rows.Count == 0) {
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "报工查无数据!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HICMOStatus"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "流转卡对应的报工数据不为未开工状态,无法删除!";
WebAPI/Controllers/MJGL/Sc_MouldUpperBillController.cs
@@ -1396,12 +1396,14 @@
                string sBillBarCode = HBarCode.Trim();
              
                //截取条码类型2 前两位
                //截取条码类型 前两位
                string BillNoType2 = sBillBarCode.Substring(0, Math.Min(2, sBillBarCode.Length));
                //截取条码类型 前三位
                string BillNoType3 = sBillBarCode.Substring(0, Math.Min(3, sBillBarCode.Length));
                //截取条码类型 前五位
                string BillNoType3 = sBillBarCode.Substring(0, Math.Min(5, sBillBarCode.Length));
                //截取条码类型3 前四位
                string BillNoType4 = sBillBarCode.Substring(0, Math.Min(4, sBillBarCode.Length));
                //截取条码类型 前八位
                string BillNoType5 = sBillBarCode.Substring(0, Math.Min(8, sBillBarCode.Length));
                switch (BillNoType2)
@@ -1418,12 +1420,15 @@
                        break;
                }
                switch (BillNoType3)
                {
                    //器具档案
                    case "MJD":
                    case "PAK":
                        ds = oCN.RunProcReturn("select * from h_v_Gy_MouldFileList where 单据号 = '" + HBarCode + "'", "h_v_Gy_MouldFileList");
                    case "https":
                        HBarCode = HBarCode.Substring(23, HBarCode.Length-23);
                        ds = oCN.RunProcReturn("select * from h_v_Gy_MouldFileList where 条码编号 = '" + HBarCode + "'", "h_v_Gy_MouldFileList");
                        break;
                    default:
                        break;
@@ -1435,8 +1440,24 @@
                    case "GXLX":
                        ds = oCN.RunProcReturn("select 任务单号,hicmointerid,HICMOEntryID,单据号,hmainid,HEntryID from h_v_Sc_ProcessExchangeBillQuerySub where 单据号 = '" + HBarCode + "'", "h_v_Sc_ProcessExchangeBillQuerySub");
                        break;
                    //生产订单
                    case "9010":
                        ds = oCN.RunProcReturn("select 单据号,hmainid,HEntryID from h_v_IF_ICMOBillList where 单据号 = '" + HBarCode + "'", "h_v_IF_ICMOBillList");
                        break;
                    default:
                        break;
                }
                DateTime date;
                bool flag = false;
                if (BillNoType5.Length == 8) {
                    BillNoType5 = BillNoType5.Substring(0, 4) + "-" + BillNoType5.Substring(4, 2) + "-" + BillNoType5.Substring(6, 2);
                }
                flag = DateTime.TryParse(BillNoType5, out date);
                if (flag) {
                    ds = oCN.RunProcReturn("select 任务单号,hicmointerid,HICMOEntryID,单据号,hmainid,HEntryID from h_v_Sc_ProcessExchangeBillQuerySub where 单据号 = '" + HBarCode + "'", "h_v_Sc_ProcessExchangeBillQuerySub");
                }
                if (ds == null || ds .Tables.Count== 0 || ds.Tables[0].Rows.Count == 0)
@@ -1598,6 +1619,9 @@
                     + "'," + oSub.HSourceID.ToString() + "," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString() + ",'" + oSub.HICMOBillNo.ToString()
                     + "','" + oSub.HProcExchBillNo.ToString() + "'," + oSub.HProcExchInterID.ToString() + "," + oSub.HProcExchEntryID.ToString()
                     + ",'" + oSub.HScanDate.ToString() + "','" + oSub.HMouldNumber.ToString() + "') ");
                //反写模具状态
                oCN.RunProc("update Gy_MouldFileMain set HMouldStatus='领出' where HInterID= "+ oSub.HMouldID.ToString());
            }
            objJsonResult.code = "1";
@@ -1742,6 +1766,9 @@
                     + "'," + oSub.HSourceID.ToString() + "," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString() + ",'" + oSub.HICMOBillNo.ToString()
                     + "','" + oSub.HProcExchBillNo.ToString() + "'," + oSub.HProcExchInterID.ToString() + "," + oSub.HProcExchEntryID.ToString()
                     + ",'" + oSub.HScanDate.ToString() + "','" + oSub.HMouldNumber.ToString() + "') ");
                //反写模具状态
                oCN.RunProc("update Gy_MouldFileMain set HMouldStatus='在库' where HInterID= " + oSub.HMouldID.ToString());
            }
            objJsonResult.code = "1";
WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
@@ -212,6 +212,26 @@
                }
                //=========================================================
                //获取最近的上模单  把工单跟模具进行绑定
                ds = oCn.RunProcReturn(@"select  HICMOInterID,HICMOEntryID,HSourceInterID,HSourceEntryID,HSourceID from Sc_ICMOBillStatus_Tmp where HInterID=" + omodel.HMainSourceInterID.ToString(), "Sc_ICMOBillStatus_Tmp");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    string HICMOInterID = ds.Tables[0].Rows[0]["HICMOInterID"].ToString();
                    string HICMOEntryID = ds.Tables[0].Rows[0]["HICMOEntryID"].ToString();
                    string HSourceInterID = ds.Tables[0].Rows[0]["HSourceInterID"].ToString();
                    string HSourceEntryID = ds.Tables[0].Rows[0]["HSourceEntryID"].ToString();
                    string HSourceID = ds.Tables[0].Rows[0]["HSourceID"].ToString();
                    ds = oCn.RunProcReturn(@"select  HMouldID from Sc_MouldUpperBillMain a
inner join Sc_MouldUpperBillSub b on a.HInterID = b.HInterID where HICMOInterID=" + HICMOInterID + " and HICMOEntryID=" + HICMOEntryID + " and HProcExchInterID=" + HSourceInterID + " and  HProcExchEntryID=" + HSourceEntryID + " and HSourceID=" + HSourceID + " order by HMakeDate desc", "Sc_MouldUpperBillMain");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        oCn.RunProc("update Sc_ICMOBillStatus_Tmp set HMouldID= " + ds.Tables[0].Rows[0]["HMouldID"].ToString() + " where HInterID=" + omodel.HMainSourceInterID.ToString());
                    }
                }
                sReturn = omodel.HInterID.ToString();
                oCn.Commit();
                return true;