| | |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Dynamic; |
| | | using System.Text; |
| | | using Gs.Toolbox; |
| | | using Gs.Toolbox.ApiCore.Abstract.Mvc; |
| | | using Gs.Toolbox.ApiCore.Common.Mvc; |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using static Gs.Toolbox.UtilityHelper; |
| | | |
| | | namespace Gs.Wom.WorkService |
| | | { |
| | | namespace Gs.Wom.WorkService; |
| | | |
| | | [ApiGroup(ApiGroupNames.WOM)] |
| | | public class WorkCollectController : IRomteService |
| | | { |
| | | private readonly IHttpContextAccessor _http; |
| | | private readonly string _userCode, _userGuid, _orgFids; |
| | | |
| | | public WorkCollectController(IHttpContextAccessor httpContextAccessor) |
| | | { |
| | | _http = httpContextAccessor; |
| | | (_userCode, _userGuid, _orgFids) = |
| | | GetUserGuidAndOrgGuid(_http); |
| | | } |
| | | |
| | | #region |
| | | |
| | | /// <summary> |
| | | /// 读取,采集,采集的时候返回列表 |
| | | /// </summary> |
| | |
| | | m.list3 = new List<dynamic>(); |
| | | m.outMsg = ""; |
| | | m.outSum = -1; |
| | | string _strMsg = ""; |
| | | int _sum = 0; |
| | | var _strMsg = ""; |
| | | var _sum = 0; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@inP3",checkResult), |
| | |
| | | new("@t011",t011), |
| | | new("@t012",t012), |
| | | new("@t013",t013), |
| | | new("@collectGuid",collectGuid), |
| | | new("@collectGuid", collectGuid) |
| | | }; |
| | | var dset = new DataSet(); |
| | | try |
| | |
| | | var dr = dset.Tables[1].Rows[0]; |
| | | m = dr.RowToDynamic(); |
| | | } |
| | | |
| | | m.outMsg = _strMsg; |
| | | m.outSum = _sum; |
| | | //2良品列表 |
| | |
| | | var _tb = dset.Tables[2].TableToDynamicList(); |
| | | m.list = _tb; |
| | | } |
| | | |
| | | //3不良品列表 |
| | | if (dset.Tables.Count > 3) |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | System.Text.StringBuilder sbLog = new System.Text.StringBuilder(); |
| | | sbLog.Append("_userGuid:" + _userGuid.ToString()); |
| | | sbLog.Append("processNo:" + processNo.ToString()); |
| | | sbLog.Append("gongWei:" + gongWei.ToString()); |
| | | var sbLog = new StringBuilder(); |
| | | sbLog.Append("_userGuid:" + _userGuid); |
| | | sbLog.Append("processNo:" + processNo); |
| | | sbLog.Append("gongWei:" + gongWei); |
| | | sbLog.Append("inP4:" + barCode); |
| | | LogHelper.Debug(this.ToString(), ex.Message + ":" + sbLog.ToString()); |
| | | LogHelper.Debug(ToString(), ex.Message + ":" + sbLog); |
| | | m.outMsg = ex.Message; |
| | | m.outSum = -1; |
| | | } |
| | | |
| | | if (m.outSum > 0) |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, m.outMsg); |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, m.outMsg); |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, |
| | | m.outMsg); |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, |
| | | m.outMsg); |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |