| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | // |
| | | /// <summary> |
| | | /// éè¿çç»æ¥è¯¢èåä¿¡æ¯ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Pay_WorkTimesBill/GetEmployeeByHGroup")] |
| | | [HttpGet] |
| | | public object GetEmployeeByHGroup(int HGroupID) |
| | | { |
| | | if (HGroupID <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "çç»æªéæ©"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | List<object> list = new List<object>(); |
| | | DataSet ds1; |
| | | string sql1 = string.Format(@"select a.HItemID HEmpID,a.HNumber HEmpNumber,a.HName HEmpName,a.HEmpRate HEmpRate,a.HCTPrjID,b.HName HCTPrjName from Gy_Employee a |
| | | left join Gy_ClassTimePrjGroup b on a.HCTPrjID=b.HItemID |
| | | where a.HGroupID=" + HGroupID); |
| | | ds1 = oCN.RunProcReturn(sql1, "Gy_Employee"); |
| | | list.Add(ds1.Tables[0]); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.list = list; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | [Route("Pay_WorkTimesBill/calcAvgMoney")] |
| | | [HttpPost] |
| | | public object GetEmployeeByHGroup([FromBody] JObject msg) { |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | List<object> list = new List<object>(); |
| | | DataSet ds; |
| | | string sql = string.Format($"exec h_p_CalcAvgMoney '{msg["msg"]}'"); |
| | | ds = oCN.RunProcReturn(sql, "h_p_CalcAvgMoney"); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | } |