| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Debug(ToString(), |
| | | "work_weight_lst error:" + ex.Message); |
| | | LogHelper.Debug(ToString(), "work_weight_lst error:" + ex.Message); |
| | | } |
| | | if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0) |
| | | lst = dset.Tables[0].TableToDynamicList(); |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 增加或编辑实体 |
| | | /// 增加一条重量信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | |
| | | { |
| | | string lineId = model.lineId; |
| | | string realWeight = model.realWeight; |
| | | string realWeightTxt=model.realWeightTxt; |
| | | string realWeightTxt = model.realWeightTxt; |
| | | dynamic mObj = new ExpandoObject(); |
| | | mObj.outMsg = ""; |
| | | mObj.outSum = -1; |
| | |
| | | return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg); |
| | | return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 读取iqc称重 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [RequestMethod(RequestMethods.POST)] |
| | | public ReturnDto<string?> GetIqcWeight([FromBody] dynamic model) |
| | | { |
| | | string? rtnInt = ""; |
| | | var dset = new DataSet(); |
| | | try |
| | | { |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@inLineId","") |
| | | }; |
| | | dset = DbHelperSQL.RunProcedure("iqc_detect01_get_weight", parameters, "0"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Debug(ToString(), "GetIqcWeight error:" + ex.Message); |
| | | } |
| | | if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0) |
| | | { |
| | | rtnInt = dset.Tables[0].Rows[0]["realWeight"].ToString(); |
| | | } |
| | | return ReturnDto<string>.QuickReturn(rtnInt, ReturnCode.Success, "读取成功!"); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 编辑iqc重量 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [RequestMethod(RequestMethods.POST)] |
| | | public ReturnDto<ExpandoObject> EditIqcWeight([FromBody] dynamic model) |
| | | { |
| | | string iqcGuid = model.iqcGuid; |
| | | string weightType = model.weightType; |
| | | string weight = model.weight; |
| | | dynamic mObj = new ExpandoObject(); |
| | | mObj.outMsg = ""; |
| | | mObj.outSum = -1; |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd = new SqlCommand("[iqc_detect01_edt_weight]", conn)) |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 300), |
| | | new("@outSum", SqlDbType.Int), |
| | | new("@weightType", weightType), |
| | | new("@weight", weight), |
| | | new("@iqcGuid", iqcGuid), |
| | | new("@inEdtUserGuid", _userGuid), |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | | cmd.ExecuteNonQuery(); |
| | | mObj.outMsg = parameters[0].Value.ToString(); |
| | | mObj.outSum = int.Parse(parameters[1].Value.ToString()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Debug(ToString(), "iqc_detect01_edt_weight error:" + ex.Message); |
| | | mObj.outMsg = ex.Message; |
| | | mObj.outSum = -1; |
| | | } |
| | | finally |
| | | { |
| | | conn.Close(); |
| | | } |
| | | } |
| | | } |
| | | if (mObj.outSum <= 0) |
| | | return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg); |
| | | return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg); |
| | | } |
| | | } |
| | | } |