YL
2021-07-21 5bd84540af361d497f7b7fb33daf7733c396f6ac
WebAPI/Controllers/Æ·ÖʹÜÀí/Ê×¼þ¼ìÑéµ¥/QC_FirstPieceCheckBillController.cs
File was renamed from WebAPI/Controllers/Æ·ÖʹÜÀí/Ê×¼ì¼ìÑéµ¥/QC_FirstPieceCheckBillController.cs
@@ -10,7 +10,7 @@
namespace WebAPI.Controllers
{
    //首检检验单Controller
    //首件检验单Controller
    //数据库主表QC_FirstPieceCheckBillMain
    //数据库子表QC_FirstPieceCheckBillSub
    public class QC_FirstPieceCheckBillController : ApiController
@@ -20,6 +20,7 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region é¦–件检验单保存
        /// <summary>
        /// æ–°å¢žå•据-保存按钮
        ///参数:string sql。
@@ -84,6 +85,7 @@
                BillNew.omodel.HMainSourceEntryID = ClsPub.isLong(mainList[0].HMainSourceEntryID);
                BillNew.omodel.HMainSourceBillNo = ClsPub.isStrNull(mainList[0].HMainSourceBillNo);
                BillNew.omodel.HMainSourceBillType = ClsPub.isStrNull(mainList[0].HMainSourceBillType);
                BillNew.omodel.HBillStatus = 1;
                List<Model.ClsQC_FirstPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(msg3);
                BillNew.DetailColl = new List<Model.ClsQC_FirstPieceCheckBillSub>();
                for (int i = 0; i < subList.ToArray().Length; i++)
@@ -110,6 +112,7 @@
                        oSub.HMax = DBUtility.ClsPub.isStrNull(subList[i].HMax);
                        oSub.HMin = DBUtility.ClsPub.isStrNull(subList[i].HMin);
                        oSub.HAvg = DBUtility.ClsPub.isStrNull(subList[i].HAvg);
                        oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(mainList[0].HBillNo);
                        BillNew.DetailColl.Add(oSub);
                    }
                    else
@@ -158,32 +161,36 @@
                return objJsonResult;
            }
        }
        #endregion
        #region é¦–件检验单根据源单类型获取信息-源单为生产状态临时表(3722)
        /// <summary>
        /// è¿”回生产任务单明细行
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        /// <param name="hmainid">生产任务单ID</param>
        /// <returns>object</returns>
        [Route("Sc_ProcessExchangeBill/GetICMOBillList")]
        [Route("QC_FirstPieceCheckBill/get_ICMOBillStatus_Tmp")]
        [HttpGet]
        public object GetICMOBillList(int hmainid,int OrganizationID)
        public object get_ICMOBillStatus_Tmp(int HInterID,int HEntryID,string HBillType)
        {
            try
            {
                if (hmainid == 0)
                if (HInterID == 0 || HBillType.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "生产任务单ID为0!";
                    objJsonResult.Message = "参数不全,获取源单信息失败!HInterID:"+ HInterID+ ";HEntryID:"+ HEntryID + ";HBillType:"+ HBillType+";";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from h_v_Sc_ICMOBillListDetail where hmainid=" + hmainid, "h_v_Sc_ICMOBillListDetail");
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_GetInfoByICMOStatusBill " + HInterID + "," + HEntryID + "," + HBillType, "h_p_QC_GetInfoByICMOStatusBill");
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此生产任务单无明细行!";
                    objJsonResult.Message = "查询数据异常,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -191,7 +198,7 @@
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
@@ -200,59 +207,12 @@
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// è¿”回生产任务单明细行
        /// </summary>
        /// <param name="hmainid">生产任务单ID</param>
        /// <returns>object</returns>
        [Route("Sc_ProcessExchangeBill/GetICMOBillDetail")]
        [HttpGet]
        public object GetICMOBillDetail(int hmainid, int OrganizationID)
        {
            try
            {
                if (hmainid == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "生产任务单ID为0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from h_v_S_Sc_ICMOBillList where hmainid=" + hmainid, "h_v_S_Sc_ICMOBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此生产任务单无明细行!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        //
    }
}