调整初始化政策代码逻辑
parent
46ef595570
commit
e889cebc17
|
|
@ -26,10 +26,11 @@ namespace New_College.Api.Controllers
|
|||
/// 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下
|
||||
/// </summary>
|
||||
private readonly ID_SeVolunteerInitializationServices _d_SeVolunteerInitializationServices;
|
||||
|
||||
public SeVolunteerInitializationController(ID_SeVolunteerInitializationServices D_SeVolunteerInitializationServices)
|
||||
private readonly ISysRegionServices _sysRegionServices;
|
||||
public SeVolunteerInitializationController(ID_SeVolunteerInitializationServices D_SeVolunteerInitializationServices, ISysRegionServices sysRegionServices)
|
||||
{
|
||||
_d_SeVolunteerInitializationServices = D_SeVolunteerInitializationServices;
|
||||
_sysRegionServices = sysRegionServices;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -40,6 +41,7 @@ namespace New_College.Api.Controllers
|
|||
[HttpGet]
|
||||
public async Task<MessageModel<List<SeVolunterInitializationDto>>> Get()
|
||||
{
|
||||
var sysregion = await _sysRegionServices.Query(e => e.Level == 1);
|
||||
var data = new MessageModel<List<SeVolunterInitializationDto>>();
|
||||
var sevolunterlist = (await _d_SeVolunteerInitializationServices.Query(E => E.IsDelete == false)).Select(c => new SeVolunterInitializationDto()
|
||||
{
|
||||
|
|
@ -48,9 +50,11 @@ namespace New_College.Api.Controllers
|
|||
ProvinceName = c.ProvinceName,
|
||||
Policy = c.PolicyType,
|
||||
Years = c.Years,
|
||||
Code = c.Id
|
||||
|
||||
Code = sysregion.Where(e => e.RegionName == c.ProvinceName).FirstOrDefault().RegionCode
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
int nowyear = DateTime.Now.Year;
|
||||
int month = DateTime.Now.Month;
|
||||
sevolunterlist.ForEach(a =>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace New_College.Model
|
|||
public class SeVolunterInitializationDto
|
||||
{
|
||||
|
||||
public int Code { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string ProvinceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue