yusijie
2 天以前 6866dbd4b0b8703811872669179a68841eea803d
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -376,7 +376,8 @@
                {
                    if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔")
                    {
                        if (HProcID == "90")  //清洁工序进入自动开工模式
                        {
                        //判断当前流转卡 当前工序是否是开工
                        ds = oCN.RunProcReturn("select  * from Sc_ICMOBillStatus_Tmp where HSourceBillNo='" + HBarCode + "' and HICMOStatus<>'0' and HProcID='"+ HProcID + "'", "Sc_ICMOBillStatus_Tmp");
                        //查不到证明没有开工进入下一句查询
@@ -400,6 +401,8 @@
                                }
                            }                                                 
                        }   
                        }
                    }
                }
@@ -432,10 +435,26 @@
                }
                else
                {
                    if (HProcID == "90" || HProcID== "102")
                    {
                        DataSet dataSet = oCN.RunProcReturn(@"exec h_p_Sc_ProcessExchangeBillList2 '" + HBarCode + "'," + HProcID, "h_p_Sc_ProcessExchangeBillList2");
                        if (dataSet.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "2";
                            objJsonResult.count = 2;
                            objJsonResult.Message = "[0000-1-037]";
                            objJsonResult.data = dataSet.Tables[0];
                            return objJsonResult;
                        }
                    }
                    else
                    {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "[0000-1-037]";
                    objJsonResult.data = ds.Tables[0];
                    }
                }
                return objJsonResult;
@@ -512,7 +531,7 @@
                    "(HInterID,HEntryID,HBillNo_bak,HSourceBillNo,HSourceInterID,HSourceEntryID,HMaterID" +
                    ",HProdOrgID,HSourceBillType,HAuxPropID,HProcID,HQty,HBatchNo,HBarCode,HMTONo,HPlanMode) " +
                    " values(" + HInterID + "," + (i + 1) + ",'" + HBillNo + "','" + tempList[i].HProcExchBillNo + "'," + tempList[i].HProcExchInterID + "," + tempList[i].HProcExchEntryID + "," + tempList[i].HMaterID +
                    ",'" + HOrgID + "','',0," + HProcID + "," + tempList[i].HQty + ",'"+ tempList[i].HBatchNo + "','" + tempList[i].HBarCode + "','','') ");
                    ",'" + HOrgID + "','',0," + tempList[i].HProcID + "," + tempList[i].HQty + ",'"+ tempList[i].HBatchNo + "','" + tempList[i].HBarCode + "','','') ");
                }
                oCN.Commit();
@@ -600,7 +619,8 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (omodel.HProcID!=90)//斯莫尔拍照清洁工序过滤
                {
                //增加产线组装追溯单
                DataSet ds1 = oCN.RunProcReturn("exec h_p_Gy_BarCodeBillBomList '" + omodel.HProcExchBillNo + "'," + omodel.HProcID, "h_p_Gy_BarCodeBillBomList");
                if (ds1.Tables[0].Rows.Count > 0)
@@ -638,7 +658,8 @@
                        ,'{HBillNo1}','1','{user}',getdate(),{omodel.HProcExchInterID.ToString()},{omodel.HProcExchEntryID.ToString()},'{omodel.HProcExchBillNo.ToString()}'
                        ,{omodel.HICMOInterID.ToString()},'{omodel.HICMOBillNo.ToString()}','{omodel.HBarCode_P.ToString()}',{omodel.HMaterID},0,'汇报',{omodel.HProdOrgID})";
                        oCN.RunProc(sql);
                        if (prefix == "#0TE911124") {
                            if (prefix == "#0TE911124")
                            {
                            for (int i = 0; i < sub.Count; i++)
                            {
                                //子表存储
@@ -664,6 +685,8 @@
                            ,0,0,getdate(),'{sub[i].HBarCode}','{omodel.HBarCode_P}','') ";
                                oCN.RunProc(sq2);
                            }
                            }
                        }
                        
                    }
@@ -1371,6 +1394,41 @@
                return objJsonResult;
            }
        }
        //根据主id+工序查
        [Route("Cj_SingleStation/BadRecordsList2")]
        [HttpGet]
        public object BadRecordsList2(string HProcExchInterID, string HProcID, string user)
        {
            try
            {
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "[0000-1-068]无查询权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn(@"exec h_p_Gy_BadRecordsList2 " + HProcExchInterID + "," + HProcID, "h_p_Gy_BadRecordsList2");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "[0000-1-037]";
                objJsonResult.data = ds;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "[0000-1-010]没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  工序单品过站 查询合格记录