Commit a6006dfe by 钟博

Merge branch 'v2020morge-graphql' of http://gitlab.suvalue.com/zry/performance…

Merge branch 'v2020morge-graphql' of http://gitlab.suvalue.com/zry/performance into v2020morge-graphql

# Conflicts:
#	Performance.Subsidy/Performance.Subsidy.Api/Controllers/SubsidyController.cs
#	Performance.Subsidy/Performance.Subsidy.Services/SubsidyService.cs
parents e9062ff7 b43aaf28
...@@ -54,27 +54,30 @@ public class SubsidyController : ControllerBase ...@@ -54,27 +54,30 @@ public class SubsidyController : ControllerBase
var jobTitle = await _service.GetJobTitle(allotId, hospitalId); var jobTitle = await _service.GetJobTitle(allotId, hospitalId);
return new ApiResponse(Status.Ok, jobTitle); return new ApiResponse(Status.Ok, jobTitle);
} }
//1
// 职称标准保存 // 职称标准保存
[HttpPost("{allotId}/jobtitle")] [HttpPost("{allotId}/jobtitle")]
public async Task SaveJobTitle(int allotId,List<sub_jobtitle> jobtitles) public ApiResponse SaveJobTitle(int allotId,[FromBody]List<sub_jobtitle> sub_Jobtitle)
{ {
_service.SaveJobTitle(allotId,jobtitles); bool a =_service.SaveJobTitle(allotId, sub_Jobtitle);
throw new NotImplementedException(); return new ApiResponse(Status.Ok, a);
} }
// 个人职称补贴结果查询 // 个人职称补贴结果查询
[HttpGet("{allotId}/jobtitle/subsidy")] [HttpGet("{allotId}/jobtitle/subsidy")]
public Task<ApiResponse> GetJobTitleSubsidy(int allotId) public ApiResponse GetJobTitleSubsidy(int allotId)
{ {
throw new NotImplementedException(); List<sub_subsidy> a=_service.GetJobTitleSubsidy(allotId);
return new ApiResponse(Status.Ok, a);
} }
// 个人职称补贴结果保存 // 个人职称补贴结果保存
[HttpPost("{allotId}/jobtitle/subsidy")] [HttpPost("{allotId}/jobtitle/subsidy")]
public async Task SaveJobTitleSubsidy(int allotId) public ApiResponse SaveJobTitleSubsidy(int allotId, [FromBody] List<sub_subsidy> subsidys)
{ {
throw new NotImplementedException(); bool a = _service.SaveJobTitleSubsidy(allotId, subsidys);
return new ApiResponse(Status.Ok, a);
} }
} }
} }
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Dapper" Version="2.0.90" /> <PackageReference Include="Dapper" Version="2.0.90" />
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
<PackageReference Include="MySql.Data" Version="8.0.24" /> <PackageReference Include="MySql.Data" Version="8.0.24" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.1" /> <PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.1" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" /> <PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
......
using Dapper; using Dapper;
using Performance.Subsidy.Services.Repository; using Performance.Subsidy.Services.Repository;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Linq; using System.Linq;
using AutoMapper;
using System; using System;
using System.Web.Http;
namespace Performance.Subsidy.Services namespace Performance.Subsidy.Services
{ {
...@@ -125,5 +128,29 @@ public bool SaveSubsidy(int allotId, List<sub_subsidy> subsidys) ...@@ -125,5 +128,29 @@ public bool SaveSubsidy(int allotId, List<sub_subsidy> subsidys)
} }
*/ */
#endregion #endregion
public bool SaveJobTitle(int allotId, List<sub_jobtitle> jobtitle)
{
var CreateDefault = _factory.CreateDefault();
var result = jobtitle.Select(t => new { AllotID = allotId, t.BasicPerforFee, t.JobTitle });
var modify= CreateDefault.Execute($" update `sub_jobtitle` set BasicPerforFee =@BasicPerforFee WHERE AllotID=@allotId and JobTitle=@JobTitle; ", result);
var storedProcedure= CreateDefault.Execute("call proc_performance_subsidy(@allotId) ;", result);
return modify>0 && storedProcedure>0;
}
public List<sub_subsidy> GetJobTitleSubsidy(int allotId)
{
IEnumerable<sub_subsidy> _Subsidies = _factory.CreateDefault().Query<sub_subsidy>(@"
select*from sub_subsidy where RealAmount is not null and AllotID=@allotId and RealAmount is not null ", new { allotId });
return _Subsidies?.ToList();
}
public bool SaveJobTitleSubsidy(int allotId, List<sub_subsidy> subsidys)
{
var result = subsidys.Select(t => new { t.RealAmount, AllotID = allotId, t.PersonnelNumber });
return _factory.CreateDefault().Execute(@$"update sub_subsidy set
GiveAmount = Attendance * BasicPerforFee, RealAmount = @RealAmount where AllotID=@allotId and PersonnelNumber=@PersonnelNumber;",result)>0;
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment