仲国强
2021-10-08 013101be5a8d87da24f4c7c996a6ba98f9e41604
编辑时返回工序工价信息
1个文件已修改
49 ■■■■■ 已修改文件
WebAPI/Controllers/基础资料/工资基础资料/Gy_ProcPriceController.cs 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/»ù´¡×ÊÁÏ/¹¤×Ê»ù´¡×ÊÁÏ/Gy_ProcPriceController.cs
@@ -148,5 +148,54 @@
        }
        #endregion
        #region ç¼–辑时返回工序工价信息
        [Route("Gy_ProcPrice/GetProcPriceValue")]
        [HttpGet]
        public object GetProcPriceValue(int HItemID)
        {
            try
            {
                ds = oCN.RunProcReturn("select " +
                    "a.HItemID,a.HDeptID,b.HName HDeptName" +
                    ",a.HMaterID HMaterIDCol,c.HNumber HMaterNumberCol,c.HName HMaterNameCol,c.HModel HMaterModelCol" +
                    ",a.HProcID HProcIDCol,d.HNumber HProcNumberCol,d.HName HProcNameCol" +
                    ",a.HSourceID HSourceIDCol,e.HNumber HSourceNumberCol,e.HName HSourceNameCol" +
                    ",a.HPrice HPriceCol,a.HBeginDate HBeginDateCol,a.HEndDate HEndDateCol" +
                    ",case when a.HCostFlag<>0 then 'true'else 'false'end HCostFlagCol" +
                    ",case when a.HFlowFlag<>0 then 'true'else 'false'end HFlowFlagCol" +
                    ",case when a.HPayFlag<>0 then 'true'else 'false'end HPayFlagCol,a.HRemark HRemarkCol " +
                    " from Gy_ProcPrice a " +
                    " left join Gy_Department b on a.HDeptID = b.HItemID " +
                    " left join Gy_Material c on a.HMaterID = c.HItemID " +
                    " left join Gy_Process d on a.HProcID = d.HItemID " +
                    " left join Gy_Source e on a.HSourceID = e.HItemID where HItemID = " + HItemID, "Gy_ProcPrice");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "false!";
                    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
    }
}