ch
2021-08-06 cf3bf382a85dcace9247e1103b250d1f3bc5104c
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -255,9 +255,9 @@
        /// </summary>
        /// <param name="hmainid">生产任务单ID</param>
        /// <returns>object</returns>
        [Route("Sc_ProcessExchangeBill/GetICMOBillDetail")]
        [Route("Sc_ProcessExchangeBill/GetICMOBillList")]
        [HttpGet]
        public object GetICMOBillDetail(int hmainid,int OrganizationID)
        public object GetICMOBillList(int hmainid,int OrganizationID)
        {
            try
            {
@@ -269,7 +269,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from h_v_Sc_ICMOBillListDetail where hmainid=" + hmainid + " and HSTOCKINORGID="+ OrganizationID, "h_v_Sc_ICMOBillListDetail");
                ds = oCN.RunProcReturn("select * from h_v_Sc_ICMOBillListDetail where hmainid=" + hmainid, "h_v_Sc_ICMOBillListDetail");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -297,6 +297,52 @@
            }
        }
        /// <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;
            }
        }
        //
    }