| | |
| | | ds = oCN.RunProcReturn(@"select * from h_v_Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "h_v_Gy_BarCodeBill"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | //判断长度是否为29位 无尘车间 |
| | | if (HBarCode.Length == 29) |
| | | { |
| | | string str1 = HBarCode.Substring(18, 8); |
| | |
| | | DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 物料代码,o.HNumber 组织代码 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) |
| | | left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID |
| | | left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID |
| | | where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID="+ HOrgID, "Sc_ProcessExchangeBillMain"); |
| | | where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain"); |
| | | |
| | | if (dataSet.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | return get_HBardBillSave(HProcExchBillNo, HBarCode); |
| | | } |
| | | } |
| | | else { |
| | | else |
| | | { |
| | | ClsPub.CurUserName = user; |
| | | //条码生成 |
| | | return get_HBardBillSave(HProcExchBillNo, HBarCode); |
| | | } |
| | | } |
| | | //判断长度是否为50位 15车间 |
| | | else if (HBarCode.Length == 50) |
| | | { |
| | | string str1 = HBarCode.Substring(42, 8); |
| | | |
| | | DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 物料代码,o.HNumber 组织代码 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) |
| | | left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID |
| | | left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID |
| | | where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain"); |
| | | |
| | | if (dataSet.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "条码与流转卡不存在对应关系!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | ClsPub.CurUserName = user; |
| | | //条码生成 |
| | | return get_HBardBillSave(HProcExchBillNo, HBarCode); |
| | |
| | | } |
| | | } |
| | | else { |
| | | |
| | | string str1 = HBarCode.Substring(18, 8); |
| | | //判断长度是否为29位 无尘车间 |
| | | if (HBarCode.Length == 29) |
| | | { |
| | | string str1 = HBarCode.Substring(18, 8); |
| | | |
| | | DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 物料代码,o.HNumber 组织代码 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) |
| | | DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 物料代码,o.HNumber 组织代码 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) |
| | | left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID |
| | | left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID |
| | | where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain"); |
| | | |
| | | if (dataSet.Tables[0].Rows.Count == 0) |
| | | { |
| | | str1 = HBarCode.Substring(23, 3); |
| | | if (dataSet.Tables[0].Rows.Count == 0) |
| | | { |
| | | str1 = HBarCode.Substring(23, 3); |
| | | |
| | | dataSet = oCN.RunProcReturn(@"select m.HNumber 物料代码,o.HNumber 组织代码 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) |
| | | dataSet = oCN.RunProcReturn(@"select m.HNumber 物料代码,o.HNumber 组织代码 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) |
| | | left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID |
| | | left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID |
| | | where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain"); |
| | | |
| | | if (dataSet.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "条码与流转卡不存在对应关系!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | //判断长度是否为50位 15车间 |
| | | else if (HBarCode.Length == 50) |
| | | { |
| | | string str1 = HBarCode.Substring(42, 8); |
| | | |
| | | DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 物料代码,o.HNumber 组织代码 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) |
| | | left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID |
| | | left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID |
| | | where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain"); |