| | |
| | | ds = oCN.RunProcReturn("select * from Sc_SourceLineRepairBillSub_Mater where HInterID=" + model.HInterID+ " order by HEntryID desc", "Sc_SourceLineRepairBillSub_Mater"); |
| | | |
| | | oCN.RunProc($@"insert into Sc_SourceLineRepairBillSub_Mater |
| | | (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID |
| | | ,HSourceEntryID,HSourceBillNo,HSourceBillType,HMaterID |
| | | ,HUnitID,HBarCode,HBatchNo )values |
| | | ({model.HInterID},{(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)},'{model.HBillNo}','',{temp.HProcExchInterID} |
| | | ,{temp.HProcExchEntryID},'{temp.HProcExchBillNo}','',{temp.HMaterID},0,'{temp.HBarCode}','{temp.HBatchNo}')"); |
| | | (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID |
| | | ,HSourceEntryID,HSourceBillNo,HSourceBillType,HMaterID |
| | | ,HUnitID,HBarCode,HBatchNo )values |
| | | ({model.HInterID},{(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)},'{model.HBillNo}','',{temp.HProcExchInterID} |
| | | ,{temp.HProcExchEntryID},'{temp.HProcExchBillNo}','',{temp.HMaterID},0,'{temp.HBarCode}','{temp.HBatchNo}')"); |
| | | |
| | | //修改产线追溯单绑定的条码批号 |
| | | oCN.RunProc("update Sc_AssemblyBillSub set HBarCode='" + temp.HBarCode + "' where HInterID=" + temp.HInterID + " and HEntryID=" + temp.HEntryID); |
| | |
| | | model = JsonConvert.DeserializeObject<Model.ClsSc_SourceLineRepairBillMain>(sMainStr); |
| | | |
| | | oCN.RunProc($@"insert into Sc_SourceLineRepairBillMain(HYear, HPeriod, HBillType, HBillSubType, HInterID, |
| | | HDate, HBillNo, HBillStatus, HRemark, HEmpID, HDeptID, HSourceID, HProdOrgID, HMaterID, HWorkStationID, |
| | | HProcess, HIPAddr, HMacAddr, HProdMac, HBarCode,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo) |
| | | values('{DateTime.Now.Year}','{DateTime.Now.Month}','3748','3748',{model.HInterID} |
| | | ,getdate(),'{model.HBillNo}','1','{HResult}',{model.HEmpID},{model.HDeptID},{model.HSourceID},{model.HProdOrgID},{model.HMaterID},0 |
| | | ,{model.HProcess},'','','','{model.HBarCode}','{user}',getdate(),{model.HICMOInterID},{model.HICMOEntryID},'{model.HICMOBillNo}')"); |
| | | HDate, HBillNo, HBillStatus, HRemark, HEmpID, HDeptID, HSourceID, HProdOrgID, HMaterID, HWorkStationID, |
| | | HProcess, HIPAddr, HMacAddr, HProdMac, HBarCode,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo) |
| | | values('{DateTime.Now.Year}','{DateTime.Now.Month}','3748','3748',{model.HInterID} |
| | | ,getdate(),'{model.HBillNo}','1','{HResult}',{model.HEmpID},{model.HDeptID},{model.HSourceID},{model.HProdOrgID},{model.HMaterID},0 |
| | | ,{model.HProcess},'','','','{model.HBarCode}','{user}',getdate(),{model.HICMOInterID},{model.HICMOEntryID},'{model.HICMOBillNo}')"); |
| | | |
| | | List<Model.ClsSc_SourceLineRepairBillSub> subLsit = new List<Model.ClsSc_SourceLineRepairBillSub>(); |
| | | sMainStr = "[" + sMainStr + "]"; |
| | | subLsit = JsonConvert.DeserializeObject<List<Model.ClsSc_SourceLineRepairBillSub>>(sMainStr); |
| | | |
| | | oCN.RunProc($@"insert into Sc_SourceLineRepairBillSub |
| | | (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType |
| | | ,HBadReasonID,HBadTypeID,HBadResultID,HBadProcID,HRepairResult,HCreator,HCreateDate) |
| | | values({model.HInterID},1,'{model.HBillNo}','',{subLsit[0].HProcExchInterID},{subLsit[0].HProcExchEntryID},'{subLsit[0].HProcExchBillNo}','' |
| | | ,{subLsit[0].HBadReasonID},{subLsit[0].HBadTypeID},{subLsit[0].HBadResultID},{model.HBadProcID},'{HResult}','{subLsit[0].HCreator}',getdate())"); |
| | | (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType |
| | | ,HBadReasonID,HBadTypeID,HBadResultID,HBadProcID,HRepairResult,HCreator,HCreateDate) |
| | | values({model.HInterID},1,'{model.HBillNo}','{model.HRemark}',{subLsit[0].HProcExchInterID},{subLsit[0].HProcExchEntryID},'{subLsit[0].HProcExchBillNo}','' |
| | | ,{subLsit[0].HBadReasonID},{subLsit[0].HBadTypeID},{subLsit[0].HBadResultID},{model.HBadProcID},'{HResult}','{subLsit[0].HCreator}',getdate())"); |
| | | |
| | | if (HResult == "OK") |
| | | { |
| | |
| | | try |
| | | { |
| | | //判断所扫条码是否存在条码档案当中 |
| | | ds = oCN.RunProcReturn(@"select 1 from Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "Gy_BarCodeBill"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | //条码档案中没有本次扫描的条码,则根据规则解析生成条码 |
| | | //ds = oCN.RunProcReturn(@"select 1 from Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "Gy_BarCodeBill"); |
| | | //if (ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | // //条码档案中没有本次扫描的条码,则根据规则解析生成条码 |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "该条码不存在:" + HBarCode; |
| | | objJsonResult.data = ""; |
| | | return objJsonResult; |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "该条码不存在:" + HBarCode; |
| | | // objJsonResult.data = ""; |
| | | // return objJsonResult; |
| | | |
| | | } |
| | | //} |
| | | |
| | | //条码档案中已有本次扫描的条码,查询配件信息(扫描条码信息写入临时表) |
| | | ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomBindByHProcExch_XW '" + HBillNo + "','" + HBarCode + "','" + HBarCode_P + "','" + HProcID + "','" + HOrgID + "'", "h_p_Gy_BarCodeBillBomBindByHProcExch_XW"); |
| | |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_UnbindStation_BarList order by 条码日期 desc", "h_v_Sc_UnbindStation_BarList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_UnbindStation_BarList" + |
| | | " order by 条码日期 desc", "h_v_Sc_UnbindStation_BarList"); |
| | | } |
| | | else |
| | | { |