| | |
| | | ,HSourceBillType,HMaterID,HSourceID,HEquipID,HUnitID,HQty |
| | | ,HGroupID,HWorkerID,HScanDate,HBarCode,HBarCode_P,HSNNumber) |
| | | values({HInterID1},'{HBillNo1}',{(i + 1)},0,0,'' |
| | | ,'',{sub[i].HMaterID},0,0,0,{sub[i].HQty} |
| | | ,'',{sub[i].HMaterID},0,0,0,1 |
| | | ,0,0,getdate(),'{sub[i].HBarCode}','{omodel.HBarCode_P}','') "; |
| | | oCN.RunProc(sq2); |
| | | } |
| | |
| | | #region 工序单品过站 查询不良记录 |
| | | [Route("Cj_SingleStation/BadRecordsList")] |
| | | [HttpGet] |
| | | public object BadRecordsList(string HBarCode, string user) |
| | | public object BadRecordsList(string HProcExchInterID, string HProcExchEntryID, string user) |
| | | { |
| | | try |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn(@"select * from h_v_Gy_BadRecordsList where HProcExchBillNo='" + HBarCode + "'", "h_v_Gy_BadRecordsList"); |
| | | ds = oCN.RunProcReturn(@"exec h_p_Gy_BadRecordsList " + HProcExchInterID + "," + HProcExchEntryID, "h_p_Gy_BadRecordsList"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.data = ds; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | |
| | | |
| | | if (HResult == "OK") |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Sc_SourceLineRepairBillSub where HInterID=" + model.HInterID, "Sc_SourceLineRepairBillSub"); |
| | | // ds = oCN.RunProcReturn("select * from Sc_SourceLineRepairBillSub where HInterID=" + model.HInterID, "Sc_SourceLineRepairBillSub"); |
| | | |
| | | if (ds.Tables[0].Rows[0]["HRepairResult"].ToString() == "OK") |
| | | { |
| | | // if (ds.Tables[0].Rows[0]["HRepairResult"].ToString() == "OK") |
| | | // { |
| | | |
| | | //生产工序出站SN数据 |
| | | ds = oCN.RunProcReturn("select top 1 HInterID,HBillNo from Sc_StationOutBillMain where HProcExchInterID=" + model.HProcExchInterID + " and HProcExchEntryID=" + model.HProcExchEntryID + " and HBadCount<>0 order by HInterID desc", "Sc_StationOutBillMain"); |
| | | // //生产工序出站SN数据 |
| | | // ds = oCN.RunProcReturn("select top 1 HInterID,HBillNo from Sc_StationOutBillMain where HProcExchInterID=" + model.HProcExchInterID + " and HProcExchEntryID=" + model.HProcExchEntryID + " and HBadCount<>0 order by HInterID desc", "Sc_StationOutBillMain"); |
| | | |
| | | string HInterIDSN = ds.Tables[0].Rows[0]["HInterID"].ToString(); |
| | | string HBillNoSN = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | // string HInterIDSN = ds.Tables[0].Rows[0]["HInterID"].ToString(); |
| | | // string HBillNoSN = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | |
| | | ds = oCN.RunProcReturn("select * from Sc_StationOutBillSub_SN where HInterID=" + HInterIDSN, "Sc_StationOutBillSub_SN"); |
| | | // ds = oCN.RunProcReturn("select * from Sc_StationOutBillSub_SN where HInterID=" + HInterIDSN, "Sc_StationOutBillSub_SN"); |
| | | |
| | | oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney) |
| | | values({HInterIDSN}, '{HBillNoSN}', {ds.Tables[0].Rows.Count + 1}, '{model.HBarCode}', 1, GETDATE(), '', " + model.HProcExchInterID + "," + model.HProcExchEntryID + ", '" + model.HProcExchBillNo + "', '', 0, 0)"); |
| | | //反写工序出站单 主表 不良数量 和 合格数量 |
| | | oCN.RunProc("update Sc_StationOutBillMain set HQty+=1,HBadCount-=1 where HInterID='" + HInterIDSN + "'"); |
| | | } |
| | | // oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney) |
| | | //values({HInterIDSN}, '{HBillNoSN}', {ds.Tables[0].Rows.Count + 1}, '{model.HBarCode}', 1, GETDATE(), '', " + model.HProcExchInterID + "," + model.HProcExchEntryID + ", '" + model.HProcExchBillNo + "', '', 0, 0)"); |
| | | // //反写工序出站单 主表 不良数量 和 合格数量 |
| | | // oCN.RunProc("update Sc_StationOutBillMain set HQty+=1,HBadCount-=1 where HInterID='" + HInterIDSN + "'"); |
| | | // } |
| | | |
| | | oCN.RunProc("update Gy_BarCodeBill set HStatus='' where HBarCode='" + model.HBarCode + "'"); |
| | | } |