| | |
| | | //判断当前工单是否开工 |
| | | else if (oSystemParameter.omodel.MES_StationOutBill_MustBeginWorkCtl == "Y") |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp where HSourceID = '" + HSourceID + "' and HICMOBillNo = '" + HICMOBillNo + "' and HInterID = '" + HICMOInterID + "' and hicmostatus =1", "Sc_ICMOBillStatus_Tmp"); |
| | | ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp with(nolock) where HSourceID = '" + HSourceID + "' and HICMOBillNo = '" + HICMOBillNo + "' and HInterID = '" + HICMOInterID + "' and hicmostatus =1", "Sc_ICMOBillStatus_Tmp"); |
| | | if (ds.Tables[0].Rows[0]["HICMOStatus"].ToString() != "1") |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | else if ("Modify".Equals(eventType)) |
| | | { |
| | | num = 2; |
| | | oCN.RunProc("UpDate Sc_StationOutBillMain set " + |
| | | oCN.RunProc("UpDate a set " + |
| | | "HUpDater='" + HMaker + "'" + |
| | | ",HUpDateDate=getdate()" + |
| | | ",HSourceName='" + HSourceName + "'" + |
| | |
| | | //",HIsTimeFlag=" + HIsTimeFlag + |
| | | //",HRelBeginTime='" + HRelBeginTime + "'" + |
| | | //",HRelEndTime='" + HRelEndTime + "'" + |
| | | " from Sc_StationOutBillMain a with(nolock)" + |
| | | " where HInterID=" + HInterID); |
| | | |
| | | LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",修改工序出站单据:" + HBillNo); |
| | |
| | | oCN.RunProc("exec h_p_Mes_StationOutBillBackBarCode " + HInterID + " "); |
| | | LogService.Write($"7.存储过程结束,用时" + sw.Elapsed); |
| | | //判断是否是 末道工序 |
| | | ds1 = oCN.RunProcReturn(" select HLastProc,HFstProc from Sc_ProcessExchangeBillMain a " + |
| | | " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID " + |
| | | ds1 = oCN.RunProcReturn(" select HLastProc,HFstProc from Sc_ProcessExchangeBillMain a with(nolock) " + |
| | | " inner join Sc_ProcessExchangeBillSub b with(nolock) on a.HInterID=b.HInterID " + |
| | | " Where a.HInterID=" + HProcExchInterID + " and b.HEntryID=" + HProcExchEntryID + " ", "Sc_ProcessExchangeBillMain"); |
| | | LogService.Write($"7.1.查询,用时" + sw.Elapsed); |
| | | //判断是否是新增 |
| | |
| | | //测试语句=========================================================================================================== |
| | | string msg_str = ""; |
| | | string sql_str = "select a.HQty HQty_Main,b.HQty HQty_Sub " + |
| | | "from Sc_ProcessExchangeBillMain as a " + |
| | | "inner join Sc_ProcessExchangeBillSub as b on a.HInterID = b.HInterID " + |
| | | "from Sc_ProcessExchangeBillMain as a with(nolock)" + |
| | | "inner join Sc_ProcessExchangeBillSub as b with(nolock) on a.HInterID = b.HInterID " + |
| | | "where a.HInterID = " + HProcExchInterID; |
| | | DataSet ds_str = oCN.RunProcReturn(sql_str, "Sc_ProcessExchangeBillMain"); |
| | | if (ds_str.Tables[0].Rows.Count > 0) |
| | |
| | | Int64 HInterID = DBUtility.ClsPub.CreateBillID("3711", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HBillNo = DBUtility.ClsPub.CreateBillCode("3711", ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //获取组织代码 |
| | | string OrganizationNUM = oCN.RunProcReturn("select HNumber from Xt_ORGANIZATIONS where HItemID=" + OrganizationID, "Xt_ORGANIZATIONS").Tables[0].Rows[0]["HNumber"].ToString(); |
| | | string OrganizationNUM = oCN.RunProcReturn("select HNumber from Xt_ORGANIZATIONS with(nolock) where HItemID=" + OrganizationID, "Xt_ORGANIZATIONS").Tables[0].Rows[0]["HNumber"].ToString(); |
| | | //根据工序汇报单主ID获取工序汇报入库单的数据 |
| | | DataSet ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList_LastProc where HInterID=" + InterID, "h_v_MES_StationOutBillList_LastProc"); |
| | | if (ds.Tables[0].Rows.Count <= 0) |
| | |
| | | |
| | | //保存 |
| | | //oCN.BeginTran(); |
| | | DataSet DsTable = oCN.RunProcReturn($"select * from Sc_ICMOReportBillMain where HBillNo='{HBillNo}'", "Sc_ICMOReportBillMain"); |
| | | DataSet DsTable = oCN.RunProcReturn($"select * from Sc_ICMOReportBillMain with(nolock) where HBillNo='{HBillNo}'", "Sc_ICMOReportBillMain"); |
| | | if (DsTable.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where HBillNo='" + BillNo + "'"); |
| | | oCN.RunProc("update a set HRelationQty=1 from Sc_StationOutBillMain a with(nolock) where HBillNo='" + BillNo + "'"); |
| | | |
| | | //oCN.Commit(); |
| | | objJsonResult.code = "0"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where HBillNo='" + BillNo + "'"); |
| | | oCN.RunProc("update a set HRelationQty=1 from Sc_StationOutBillMain a with(nolock) where HBillNo='" + BillNo + "'"); |
| | | |
| | | //oCN.Commit(); |
| | | objJsonResult.code = "0"; |
| | |
| | | string HChecker = CurUserName; |
| | | string HCheckDate = DBUtility.ClsPub.GetServerDate(-1); |
| | | oCN.BeginTran(); |
| | | ds = oCN.RunProcReturn("Select * from Sc_StationOutBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_StationOutBillMain"); |
| | | ds = oCN.RunProcReturn("Select * from Sc_StationOutBillMain with(nolock) Where HInterID=" + lngBillKey.ToString(), "Sc_StationOutBillMain"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "单据未找到!"; |
| | | return false; |
| | | } |
| | | oCN.RunProc(" Update Sc_StationOutBillMain set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString()); |
| | | oCN.RunProc(" Update a set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' from Sc_StationOutBillMain with(nolock) Where HInterID=" + lngBillKey.ToString()); |
| | | oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Check_In " + lngBillKey.ToString() + ",1"); |
| | | //判断是否是 末道工序 |
| | | DataSet ds1; |
| | | ds1 = oCN.RunProcReturn("select HLastProc,HFstProc " + |
| | | " from Sc_ProcessExchangeBillMain a " + |
| | | " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID " + |
| | | " Where a.HInterID=(Select HProcExchInterID from Sc_StationOutBillMain Where HInterID=" + lngBillKey + ") " + |
| | | " and b.HEntryID=(Select HProcExchEntryID from Sc_StationOutBillMain Where HInterID=" + lngBillKey + ")", "Sc_ProcessExchangeBillMain"); |
| | | " from Sc_ProcessExchangeBillMain a with(nolock)" + |
| | | " inner join Sc_ProcessExchangeBillSub b with(nolock) on a.HInterID=b.HInterID " + |
| | | " Where a.HInterID=(Select HProcExchInterID from Sc_StationOutBillMain with(nolock) Where HInterID=" + lngBillKey + ") " + |
| | | " and b.HEntryID=(Select HProcExchEntryID from Sc_StationOutBillMain with(nolock) Where HInterID=" + lngBillKey + ")", "Sc_ProcessExchangeBillMain"); |
| | | if (ds1 == null || ds1.Tables[0].Rows.Count == 0 || HLastSubProc ==false) |
| | | { |
| | | } |
| | |
| | | { |
| | | } |
| | | |
| | | DataSet dataSet = oCN.RunProcReturn(@"select a.HProcExchBillNo,a.HQty,b.HQty HProcExchQty from Sc_StationOutBillMain a |
| | | inner join Sc_ProcessExchangeBillMain b on a.HProcExchInterID = b.HInterID |
| | | DataSet dataSet = oCN.RunProcReturn(@"select a.HProcExchBillNo,a.HQty,b.HQty HProcExchQty from Sc_StationOutBillMain a with(nolock) |
| | | inner join Sc_ProcessExchangeBillMain b with(nolock) on a.HProcExchInterID = b.HInterID |
| | | where a.HInterID = " + lngBillKey, "Sc_ProcessExchangeBillMain"); |
| | | |
| | | if (dataSet.Tables[0].Rows.Count > 0) |