啊鑫
2025-09-09 f2b71fe1d3c2b7651d525a5b5bbe66fad602ea06
WebApi/Gs.Wom/WorkService/WorkWeightController.cs
@@ -8,8 +8,8 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using static Gs.Toolbox.UtilityHelper;
namespace Gs.Wom.WorkService
{
namespace Gs.Wom.WorkService;
    [ApiGroup(ApiGroupNames.WOM)]
    public class WorkWeightController : IRomteService
@@ -34,7 +34,7 @@
        public ReturnDto<List<dynamic>> GetModelList([FromBody] dynamic model)
        {
            string lineId = model.lineId;
            List<dynamic> lst = new List<dynamic>();
        var lst = new List<dynamic>();
            var dset = new DataSet();
            try
            {
@@ -48,7 +48,9 @@
            {
                LogHelper.Debug(ToString(), "work_weight_lst error:" + ex.Message);
            }
            if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)
        if (dset != null && dset.Tables.Count > 0 &&
            dset.Tables[0].Rows.Count > 0)
                lst = dset.Tables[0].TableToDynamicList();
            return ReturnDto<List<dynamic>>.QuickReturn(lst, ReturnCode.Success,
                "读取成功!");
@@ -84,7 +86,7 @@
                        new("@lineId", lineId),
                        new("@realWeight", realWeight),
                        new("@realWeightTxt", realWeightTxt),
                        new("@inEdtUserGuid", _userGuid),
                        new("@inEdtUserGuid", _userGuid)
                    };
                        parameters[0].Direction = ParameterDirection.Output;
                        parameters[1].Direction = ParameterDirection.Output;
@@ -107,9 +109,12 @@
                    }
                }
            }
            if (mObj.outSum <= 0)
                return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
            return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
            return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception,
                mObj.outMsg);
        return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success,
            mObj.outMsg);
        }
@@ -121,7 +126,7 @@
        [RequestMethod(RequestMethods.POST)]
        public ReturnDto<string?> GetIqcWeight([FromBody] dynamic model)
        {
            string? rtnInt = "";
        var rtnInt = "";
            var dset = new DataSet();
            try
            {
@@ -129,17 +134,19 @@
                      {
                        new("@inLineId","")
                    };
                dset = DbHelperSQL.RunProcedure("iqc_detect01_get_weight", parameters, "0");
            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)
            {
        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, "读取成功!");
        return ReturnDto<string>.QuickReturn(rtnInt, ReturnCode.Success,
            "读取成功!");
        }
@@ -172,7 +179,7 @@
                        new("@weightType", weightType),
                        new("@weight", weight),
                        new("@iqcGuid", iqcGuid),
                        new("@inEdtUserGuid", _userGuid),
                        new("@inEdtUserGuid", _userGuid)
                    };
                        parameters[0].Direction = ParameterDirection.Output;
                        parameters[1].Direction = ParameterDirection.Output;
@@ -184,7 +191,8 @@
                    }
                    catch (Exception ex)
                    {
                        LogHelper.Debug(ToString(), "iqc_detect01_edt_weight error:" + ex.Message);
                    LogHelper.Debug(ToString(),
                        "iqc_detect01_edt_weight error:" + ex.Message);
                        mObj.outMsg = ex.Message;
                        mObj.outSum = -1;
                    }
@@ -194,9 +202,11 @@
                    }
                }
            }
            if (mObj.outSum <= 0)
                return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
            return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
        }
            return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception,
                mObj.outMsg);
        return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success,
            mObj.outMsg);
    }
}