| | |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔") |
| | | { |
| | | |
| | | //判断当前流转卡是否是开工 |
| | | ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp where HSourceBillNo='" + HBarCode + "' and HICMOStatus<>'0'", "Sc_ICMOBillStatus_Tmp"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3791-2-018]卡号:" + HBarCode + ",流转卡未开工!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | //判断当前流转卡是否墨西哥的 |
| | | ds = oCN.RunProcReturn("select HPRDORGID from Sc_ProcessExchangeBillMain with(nolock) where HBillNo = '" + HBarCode + "' ", "Sc_ProcessExchangeBillMain"); |
| | | if (ds.Tables[0].Rows[0]["HPRDORGID"].ToString() != "7667152") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3791-2-018]卡号:" + HBarCode + ",流转卡未开工!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | List<Model.Sc_AssemblyBill_BindSourceTemp> tempList = new List<Model.Sc_AssemblyBill_BindSourceTemp>(); |
| | | tempList = JsonConvert.DeserializeObject<List<Model.Sc_AssemblyBill_BindSourceTemp>>(msg1); |
| | | |
| | | if (tempList.Count == 0) { |
| | | if (msg1 != "[]" && tempList.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3791-2-026]无配件数据!"; |
| | |
| | | sub = JsonConvert.DeserializeObject<List<Model.ClsSc_AssemblyBillSub>>(sSubStr); |
| | | |
| | | //条码上道工序是否过站 |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_S '" + omodel.HBarCode_P + "'," + omodel.HProcID, "h_v_Gy_QualifiedRecordsList"); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_S '" + omodel.HBarCode_P + "'," + omodel.HProcID, "h_p_Sc_SNBarcodeProcCtrl_S"); |
| | | if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | { |
| | | Int64 HInterID1 = DBUtility.ClsPub.CreateBillID("3727", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HBillNo1 = DBUtility.ClsPub.CreateBillCode("3727", ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //保存生产组装单主表 |
| | | string sql = $@"Insert Into Sc_AssemblyBillMain(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate |
| | | ,HBillNo,HBillStatus,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo |
| | | ,HICMOInterID,HICMOBillNo,HBarCode_P,HMaterID,HUnitID,HAssemblyStatus,HProdOrgID) |
| | | values('{DateTime.Now.Year}','{DateTime.Now.Month}','3727','3727',{HInterID1},getdate() |
| | | ,'{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})"; |
| | | string prefix = omodel.HBarCode_P.Substring(0, 10); // 从索引0开始,截取10个字符 判断每个项目的O星圈配件数量 |
| | | |
| | | //保存生产组装单主表 |
| | | string sql = $@"Insert Into Sc_AssemblyBillMain(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate |
| | | ,HBillNo,HBillStatus,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo |
| | | ,HICMOInterID,HICMOBillNo,HBarCode_P,HMaterID,HUnitID,HAssemblyStatus,HProdOrgID) |
| | | values('{DateTime.Now.Year}','{DateTime.Now.Month}','3727','3727',{HInterID1},getdate() |
| | | ,'{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); |
| | | |
| | | for (int i = 0; i < sub.Count; i++) |
| | | { |
| | | //子表存储 |
| | | string sq2 = $@"Insert Into Sc_AssemblyBillSub(HInterID,HBillNo_bak,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo |
| | | ,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,1 |
| | | ,0,0,getdate(),'{sub[i].HBarCode}','{omodel.HBarCode_P}','') "; |
| | | oCN.RunProc(sq2); |
| | | if (prefix == "#0TE911124") { |
| | | for (int i = 0; i < sub.Count; i++) |
| | | { |
| | | //子表存储 |
| | | string sq2 = $@"Insert Into Sc_AssemblyBillSub(HInterID,HBillNo_bak,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo |
| | | ,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,3 |
| | | ,0,0,getdate(),'{sub[i].HBarCode}','{omodel.HBarCode_P}','') "; |
| | | oCN.RunProc(sq2); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < sub.Count; i++) |
| | | { |
| | | //子表存储 |
| | | string sq2 = $@"Insert Into Sc_AssemblyBillSub(HInterID,HBillNo_bak,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo |
| | | ,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,1 |
| | | ,0,0,getdate(),'{sub[i].HBarCode}','{omodel.HBarCode_P}','') "; |
| | | oCN.RunProc(sq2); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | ds = oCN.RunProcReturn("select * from Sc_StationOutBillSub_SN WITH(NOLOCK) where HInterID='" + omodel.HInterID + "' order by HEntryID desc", "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({HInterID}, '{HBillNo}', {(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)}, '{omodel.HBarCode_P}', 1, GETDATE(), '', " + HProcExchInterID + ","+ HProcExchEntryID + ", '"+ HProcExchBillNo + "', '', 0, 0)"); |
| | | values({HInterID}, '{HBillNo}', {(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)}, '{omodel.HBarCode_P}', 1, GETDATE(), '', " + HProcExchInterID + ","+ HProcExchEntryID + ", '"+ HProcExchBillNo + "', '', 0, 0)"); |
| | | |
| | | //把条码写入日志里面 |
| | | LogService.CustomWriteLog("条码:" + omodel.HBarCode_P + ",工序:"+ HProcID + ",出站时间:" + DateTime.Now, "TM" + DateTime.Now.ToString("yyyy-MM-dd")); |
| | |
| | | |
| | | |
| | | ds = oCN.RunProcReturn($@"select (b.HQty -sum(isnull(ou.HQty,0))-sum(isnull(ou.HBadCount,0))) HQty from Sc_ProcessExchangeBillSub b WITH(NOLOCK) |
| | | left join Sc_StationOutBillMain ou WITH(NOLOCK) on b.HInterID=ou.HProcExchInterID and b.HEntryID=ou.HProcExchEntryID |
| | | where b.HInterID={HProcExchInterID} and b.HEntryID={HProcExchEntryID} |
| | | group by b.HInterID,b.HEntryID,b.HQty", "Sc_ProcessExchangeBill_Out"); |
| | | left join Sc_StationOutBillMain ou WITH(NOLOCK) on b.HInterID=ou.HProcExchInterID and b.HEntryID=ou.HProcExchEntryID |
| | | where b.HInterID={HProcExchInterID} and b.HEntryID={HProcExchEntryID} |
| | | group by b.HInterID,b.HEntryID,b.HQty", "Sc_ProcessExchangeBill_Out"); |
| | | |
| | | if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0) { |
| | | oCN.RollBack(); |
| | |
| | | { |
| | | try |
| | | { |
| | | string str1 = ""; |
| | | ds = oCN.RunProcReturn(@"select * from h_v_Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "h_v_Gy_BarCodeBill"); |
| | | |
| | | //判断条码是否存在条码档案 |
| | |
| | | //判断长度是否为29位 无尘车间 |
| | | if (HBarCode.Length == 29) |
| | | { |
| | | string str1 = HBarCode.Substring(18, 8); |
| | | 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"); |
| | | 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); |
| | | |
| | | 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"); |
| | | 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) |
| | | { |
| | |
| | | return get_HBardBillSave(HProcExchBillNo, HBarCode); |
| | | } |
| | | } |
| | | //判断长度是否为50位 15车间 |
| | | //判断长度是否为50位 15车间 和 O6项目 |
| | | 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) |
| | | string prefix = HBarCode.Substring(0, 10); // 从索引0开始,截取10个字符 |
| | | if (prefix == "#0TE911124") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3791-2-016]条码与流转卡不存在对应关系!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | str1 = HBarCode.Substring(41, 3); |
| | | LogService.Write($"条码前缀" + str1); |
| | | |
| | | 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 = "[3791-2-016]条码与流转卡不存在对应关系!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | ClsPub.CurUserName = user; |
| | | //条码生成 |
| | | return get_HBardBillSave(HProcExchBillNo, HBarCode); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ClsPub.CurUserName = user; |
| | | //条码生成 |
| | | return get_HBardBillSave(HProcExchBillNo, HBarCode); |
| | | |
| | | str1 = HBarCode.Substring(42, 8); |
| | | LogService.Write($"条码前缀1.1" + str1); |
| | | 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 = "[3791-2-016]条码与流转卡不存在对应关系!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | ClsPub.CurUserName = user; |
| | | //条码生成 |
| | | return get_HBardBillSave(HProcExchBillNo, HBarCode); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else { |
| | | else |
| | | { |
| | | //判断长度是否为29位 无尘车间 |
| | | if (HBarCode.Length == 29) |
| | | { |
| | | string str1 = HBarCode.Substring(18, 8); |
| | | 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"); |
| | | 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); |
| | | |
| | | 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"); |
| | | 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) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | //判断长度是否为50位 15车间 |
| | | //判断长度是否为50位 15车间 和 O6项目 |
| | | 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) |
| | | string prefix = HBarCode.Substring(0, 10); // 从索引0开始,截取10个字符 |
| | | if (prefix == "#0TE911124") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3791-2-016]条码与流转卡不存在对应关系!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | str1 = HBarCode.Substring(41, 3); |
| | | LogService.Write($"条码前缀" + str1); |
| | | 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 = "[3791-2-016]条码与流转卡不存在对应关系!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | 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 = "[3791-2-016]条码与流转卡不存在对应关系!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "") |
| | |
| | | { |
| | | //查询流转卡数据 |
| | | DataSet dataSet = oCN.RunProcReturn(@"select a.HPRDORGID, m.HModel 物料规格,m.HName 名物料称,a.HBillNo,a.HInterID,a.HMaterID,m.HNumber 物料代码,o.HNumber 组织代码,a.HUnitID,u.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 |
| | | left join Gy_Unit u WITH(NOLOCK) on a.HUnitID=u.HItemID |
| | | where HBillNo='" + HProcExchBillNo + "'", "Sc_ProcessExchangeBillMain"); |
| | | left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID |
| | | left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID |
| | | left join Gy_Unit u WITH(NOLOCK) on a.HUnitID=u.HItemID |
| | | where HBillNo='" + HProcExchBillNo + "'", "Sc_ProcessExchangeBillMain"); |
| | | |
| | | string HMaterNumber = dataSet.Tables[0].Rows[0]["物料代码"].ToString(); |
| | | string HOrgNumber = dataSet.Tables[0].Rows[0]["组织代码"].ToString(); |
| | |
| | | if (dataSet.Tables[0].Rows.Count > 0) |
| | | { |
| | | string HOutInterID = dataSet.Tables[0].Rows[0][0].ToString(); |
| | | //斯莫尔的情况 分 工废料废 返工 |
| | | //斯莫尔的情况 分 工废 料废 返工 |
| | | //工废 |
| | | if (subLsit[0].HBadTypeID == 3) |
| | | { |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 工序单品过站 查询当前流转卡是否有已有出站单 获取id 单据号 |
| | | [Route("Cj_SingleStation/SingleItemTransit_CZD")] |
| | | [HttpGet] |
| | | public object SingleItemTransit_CZD(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | ds = oCN.RunProcReturn(sWhere, "WindowPrint"); |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "[0000-1-037]Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-038]Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |