| | |
| | | var factory = new ChannelFactory<IImesInterface>(binding, endpoint); |
| | | |
| | | var channel = factory.CreateChannel(); |
| | | string result = channel.DefineTask_005(); |
| | | string result = channel.DefineTask_005(2); |
| | | ((IClientChannel)channel).Close(); |
| | | |
| | | return new ResponseResult |
| | |
| | | //立库呼叫 |
| | | [OperationContract(Action = "http://tempuri.org/ImesInterface/DefineTask_005", |
| | | ReplyAction = "http://tempuri.org/ImesInterface/DefineTask_005Response")] |
| | | string DefineTask_005(); |
| | | string DefineTask_005(int Postition); |
| | | |
| | | //立库入库 |
| | | [OperationContract(Action = "http://tempuri.org/ImesInterface/DefineTask_006", |
| | |
| | | } |
| | | } |
| | | |
| | | [HttpPost("selIpqcItemsByGw")] |
| | | public ResponseResult SelIpqcItemsByGw([FromBody] dynamic query) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.SelIpqcItemsByGw(query); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | /// 是否急料 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "URGENT_FLAG")] |
| | | public short? UrgentFlag { get; set; } |
| | | public int? UrgentFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 物料名称 |
| | |
| | | return (pageList, totalCount); |
| | | } |
| | | |
| | | public List<MesQaItemsDetectDetail5> GetItems(string? releaseNo, |
| | | public List<dynamic> GetItems(string? releaseNo, |
| | | string? id) |
| | | { |
| | | var parsedGuid = Guid.Empty; |
| | | |
| | | if (id != null) |
| | | { |
| | | var isValid = Guid.TryParse(id, out parsedGuid); |
| | | if (!isValid) |
| | | throw new ApplicationException("GUID转换错误"); |
| | | } |
| | | var sql = string.Format(@"SELECT [a].[guid] AS [Guid], |
| | | [a].[parent_guid] AS [ParentGuid], |
| | | [a].[release_no] AS [ReleaseNo], |
| | | [a].[check_qyt] AS [CheckQyt], |
| | | [a].[fac_level] AS [FacLevel], |
| | | [a].[fcheck_item] AS [FcheckItem], |
| | | [a].[fcheck_tool] AS [FcheckTool], |
| | | [a].[fdown_allow] AS [FdownAllow], |
| | | [a].[fcheck_level] AS [FcheckLevel], |
| | | [a].[fstand] AS [Fstand], |
| | | [a].[fup_allow] AS [FupAllow], |
| | | [a].[sample_size_no] AS [SampleSizeNo], |
| | | [a].[fspec_requ] AS [FspecRequ], |
| | | [a].[fre_qty] AS [FreQty], |
| | | N'1000' AS [Factory], |
| | | N'1000' AS [Company], |
| | | COUNT([b].[guid]) AS [FenterQty], |
| | | [a].[fcheck_resu] AS [FcheckResu], |
| | | [a].[forder] AS [Order], |
| | | [a].[ybsl] AS [Ybsl], |
| | | [a].stationName, |
| | | [a].IS_GWSCAN, |
| | | ISNULL((SELECT COUNT(1) |
| | | FROM MES_QA_ITEMS_DETECT_DETAIL13 C |
| | | WHERE C.parent_guid = A.guid), 0) AS [YbslIn] |
| | | FROM [MES_QA_ITEMS_DETECT_DETAIL5] [a] |
| | | Left JOIN [MES_QA_ITEMS_DETECT_DETAIL12] [b] ON ([a].[guid] = [b].[parent_guid]) |
| | | WHERE ([a].[release_no] = N'{0}' AND IS_GWSCAN = 1) |
| | | GROUP BY [a].[guid], [a].[parent_guid], [a].[release_no], [a].[fac_level], [a].[fcheck_item], [a].[fcheck_tool], |
| | | [a].[fdown_allow], [a].[fcheck_level], [a].[fstand], [a].[fup_allow], [a].[sample_size_no], [a].[fspec_requ], |
| | | [a].[fre_qty], [a].[check_qyt], [a].[fcheck_resu], [a].[forder], [a].[ybsl], [a].stationName, |
| | | [a].IS_GWSCAN |
| | | ORDER BY [a].[forder] ASC", releaseNo); |
| | | |
| | | var Ybsl_In = Db.Queryable<MesQaItemsDetectDetail5>() |
| | | .Where(a => a.ParentGuid == parsedGuid) |
| | | .Count(); |
| | | var Ybsl_In = Db.Ado.SqlQuery<dynamic>(sql).ToList(); |
| | | |
| | | return Db.Queryable<MesQaItemsDetectDetail5, MesQaItemsDetectDetail12>( |
| | | (a, b) => |
| | | new JoinQueryInfos(JoinType.Left, a.Guid == b.ParentGuid)) |
| | | .Where((a, b) => a.ReleaseNo == releaseNo) |
| | | .WhereIF(UtilityHelper.CheckGuid(parsedGuid), |
| | | (a, b) => a.Guid == parsedGuid) |
| | | .GroupBy((a, b) => new |
| | | { |
| | | a.Guid, |
| | | a.ParentGuid, |
| | | a.ReleaseNo, |
| | | a.FacLevel, |
| | | a.FcheckItem, |
| | | a.FcheckTool, |
| | | a.FdownAllow, |
| | | a.FcheckLevel, |
| | | a.Fstand, |
| | | a.FupAllow, |
| | | a.SampleSizeNo, |
| | | a.FspecRequ, |
| | | a.FreQty, |
| | | a.CheckQyt, |
| | | a.FcheckResu, |
| | | a.Order, |
| | | a.Ybsl, |
| | | a.ISRZXX, |
| | | a.IPQCRZXX, |
| | | a.IPQCRZXXDate, |
| | | a.IPQCRZXXNum, |
| | | a.IPQCpscs, |
| | | a.FcheckType, |
| | | }).Select((a, b) => new MesQaItemsDetectDetail5 |
| | | { |
| | | Guid = a.Guid, |
| | | ParentGuid = a.ParentGuid, |
| | | ReleaseNo = a.ReleaseNo, |
| | | CheckQyt = a.CheckQyt, |
| | | FacLevel = a.FacLevel, |
| | | FcheckItem = a.FcheckItem, |
| | | FcheckTool = a.FcheckTool, |
| | | FdownAllow = a.FdownAllow, |
| | | FcheckLevel = a.FcheckLevel, |
| | | Fstand = a.Fstand, |
| | | FupAllow = a.FupAllow, |
| | | SampleSizeNo = a.SampleSizeNo, |
| | | FspecRequ = a.FspecRequ, |
| | | FreQty = a.FreQty, |
| | | Factory = "1000", |
| | | Company = "1000", |
| | | FenterQty = SqlFunc.AggregateCount(b.Guid), |
| | | FcheckResu = a.FcheckResu, |
| | | Order = a.Order, |
| | | Ybsl = a.Ybsl, |
| | | YbslIn = Ybsl_In, |
| | | ISRZXX = a.ISRZXX, |
| | | IPQCRZXX = a.IPQCRZXX, |
| | | IPQCRZXXDate = a.IPQCRZXXDate.ToString(), |
| | | IPQCRZXXNum = a.IPQCRZXXNum, |
| | | IPQCpscs = a.IPQCpscs, |
| | | FcheckType =a.FcheckType, |
| | | }).OrderBy(a => a.Order) |
| | | .ToList(); |
| | | return Ybsl_In; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | return XcslItem; |
| | | } |
| | | |
| | | |
| | | public dynamic SelIpqcItemsByGw(dynamic query) |
| | | { |
| | | if (query == null) throw new ArgumentNullException(nameof(query)); |
| | | |
| | | if (string.IsNullOrEmpty(query.userAccount?.ToString())) |
| | | throw new ArgumentException("用户名不允许为空", nameof(query.userAccount)); |
| | | |
| | | if (string.IsNullOrEmpty(query.inOrderGuid1?.ToString())) |
| | | throw new ArgumentException("检验单主表GUID不允许为空", nameof(query.inOrderGuid1)); |
| | | |
| | | var _strMsg = ""; |
| | | var _status = -1; |
| | | |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | using (var cmd = new SqlCommand("prc_selIpqcItemsByGw", conn)) |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@pi_user", SqlDbType.NVarChar, 100) { Value = query.userAccount }, |
| | | new("@pi_gw", SqlDbType.NVarChar, 100) { Value = query.gw }, |
| | | new("@pi_QaGuid1", SqlDbType.NVarChar, 100) { Value = query.inOrderGuid1 }, |
| | | new("@po_outMsg", SqlDbType.NVarChar, 2000) { Direction = ParameterDirection.Output }, |
| | | new("@po_outStatus", SqlDbType.Int) { Direction = ParameterDirection.Output } |
| | | }; |
| | | |
| | | cmd.Parameters.AddRange(parameters); |
| | | cmd.ExecuteNonQuery(); |
| | | |
| | | _strMsg = parameters[3].Value?.ToString() ?? ""; |
| | | _status = Convert.ToInt32(parameters[4].Value ?? -1); |
| | | |
| | | if (_status <= 0) throw new Exception(_strMsg); |
| | | |
| | | return new |
| | | { |
| | | message = _strMsg, |
| | | status = _status, |
| | | qaGuid = query.inOrderGuid1, |
| | | gw = query.gw |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception($"工位扫描失败:{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | } |