Commit b43aaf28 by tangzhongyang

职称标准保存 个人职称补贴结果查询 个人职称补贴结果保存 (修改)

parent 0f93c034
......@@ -3,6 +3,8 @@
using Performance.Subsidy.Services.Repository;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using System.Web.Http;
......@@ -33,40 +35,26 @@ public class SubsidyService
public bool SaveJobTitle(int allotId, List<sub_jobtitle> jobtitle)
{
int i = 0;
foreach (var item in jobtitle)
{
_factory.CreateDefault().Execute($" update `sub_jobtitle` set BasicPerforFee ={item.BasicPerforFee} WHERE AllotID={allotId} and JobTitle='{item.JobTitle}'; ");
_factory.CreateDefault().Execute(@$" update sub_subsidy t1 INNER JOIN `sub_jobtitle` t2 on t1.AllotID=t2.AllotID and t1.JobTitle=t2.JobTitle set
t1.BasicPerforFee = t2.BasicPerforFee; ");
i++;
}
return i > 0;
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 t1.ID,t1.AllotID,Department,PersonnelNumber,PersonnelName,t1.JobTitle,t2.BasicPerforFee,Attendance,t2.BasicPerforFee*Attendance GiveAmount,t2.BasicPerforFee*Attendance RealAmount from sub_subsidy t1
join sub_jobtitle t2 on t1.AllotID = t2.AllotID and t1.JobTitle = t2.JobTitle
where t1.AllotID = @allotid", new { 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)
{
int i = 0;
foreach (var item in subsidys)
{
_factory.CreateDefault().Execute(@$"
update sub_subsidy set
GiveAmount = Attendance * BasicPerforFee, RealAmount = {item.RealAmount} where AllotID={allotId} and PersonnelNumber={item.PersonnelNumber};");
i++;
}
return i > 0;
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