feat:完善一键填报接口
parent
26297da54c
commit
7ea29b060c
|
|
@ -6,12 +6,14 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using New_College.Model.ViewModels;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace New_College.Api.Controllers
|
namespace New_College.Api.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/[controller]/[action]")]
|
[Route("api/[controller]/[action]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize(Permissions.Name)]
|
[Authorize]
|
||||||
public class D_PlanMajorDescController : ControllerBase
|
public class D_PlanMajorDescController : ControllerBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -24,52 +26,36 @@ namespace New_College.Api.Controllers
|
||||||
_d_PlanMajorDescServices = D_PlanMajorDescServices;
|
_d_PlanMajorDescServices = D_PlanMajorDescServices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一键填报
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<MessageModel<PageModel<D_PlanMajorDesc>>> Get(int page = 1, string key = "", int intPageSize = 50)
|
public async Task<MessageModel<PageModel<OneSubmitGoResponse>>> OneSubmitGo([FromQuery] OneSubmitGoRequest request)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(key) || string.IsNullOrWhiteSpace(key))
|
|
||||||
|
var response = await _d_PlanMajorDescServices.GetPlanMajorList(request);
|
||||||
|
if (!response.data.Any() || response.dataCount <= 0)
|
||||||
{
|
{
|
||||||
key = "";
|
return new MessageModel<PageModel<OneSubmitGoResponse>>()
|
||||||
|
{
|
||||||
|
msg = "获取失败",
|
||||||
|
success = false,
|
||||||
|
response = response
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression<Func<D_PlanMajorDesc, bool>> whereExpression = a => a.Id > 0;
|
return new MessageModel<PageModel<OneSubmitGoResponse>>()
|
||||||
|
|
||||||
return new MessageModel<PageModel<D_PlanMajorDesc>>()
|
|
||||||
{
|
{
|
||||||
msg = "获取成功",
|
msg = "获取成功",
|
||||||
success = true,
|
success = true,
|
||||||
response = await _d_PlanMajorDescServices.QueryPage(whereExpression, page, intPageSize)
|
response = response
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{id}")]
|
|
||||||
public async Task<MessageModel<D_PlanMajorDesc>> Get(int id = 0)
|
|
||||||
{
|
|
||||||
return new MessageModel<D_PlanMajorDesc>()
|
|
||||||
{
|
|
||||||
msg = "获取成功",
|
|
||||||
success = true,
|
|
||||||
response = await _d_PlanMajorDescServices.QueryById(id)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<MessageModel<string>> Post([FromBody] D_PlanMajorDesc request)
|
|
||||||
{
|
|
||||||
var data = new MessageModel<string>();
|
|
||||||
|
|
||||||
var id = await _d_PlanMajorDescServices.Add(request);
|
|
||||||
data.success = id > 0;
|
|
||||||
|
|
||||||
if (data.success)
|
|
||||||
{
|
|
||||||
data.response = id.ObjToString();
|
|
||||||
data.msg = "添加成功";
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
using New_College.IServices;
|
||||||
|
using New_College.Model;
|
||||||
|
using New_College.Model.Models;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using New_College.Model.ViewModels;
|
||||||
|
using SqlSugar;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace New_College.Api.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]/[action]")]
|
||||||
|
[ApiController]
|
||||||
|
[Authorize(Permissions.Name)]
|
||||||
|
public class HighSchoolRankController : ControllerBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下
|
||||||
|
/// </summary>
|
||||||
|
private readonly ID_HighSchoolRankServices _d_HighSchoolRankServices;
|
||||||
|
|
||||||
|
public HighSchoolRankController(ID_HighSchoolRankServices D_HighSchoolRankServices)
|
||||||
|
{
|
||||||
|
_d_HighSchoolRankServices = D_HighSchoolRankServices;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取高中学校名单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="highSchoolRank">通过省份名称当作过滤条件模糊查询学校名称</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<MessageModel<List<HighSchoolRankResponse>>> Get(HighSchoolRankRequest highSchoolRank)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(highSchoolRank.City))
|
||||||
|
{
|
||||||
|
return new MessageModel<List<HighSchoolRankResponse>>()
|
||||||
|
{
|
||||||
|
msg = "请传入省份或城市字段:City",
|
||||||
|
success = false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (string.IsNullOrWhiteSpace(highSchoolRank.Province))
|
||||||
|
{
|
||||||
|
return new MessageModel<List<HighSchoolRankResponse>>()
|
||||||
|
{
|
||||||
|
msg = "请传入省份或城市字段:Province",
|
||||||
|
success = false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
Expression<Func<D_HighSchoolRank, bool>> exp = Expressionable.Create<D_HighSchoolRank>()
|
||||||
|
.And(c => c.IsDelete == false)
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(highSchoolRank.Province), c => c.Province == highSchoolRank.Province)
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(highSchoolRank.City), c => c.City == highSchoolRank.City)
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(highSchoolRank.Area), c => c.City == highSchoolRank.Area)
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(highSchoolRank.Name), c => SqlFunc.Contains(highSchoolRank.Name, c.SchoolName))
|
||||||
|
.ToExpression();
|
||||||
|
var query = (await _d_HighSchoolRankServices.Query(exp)).Select(c => new HighSchoolRankResponse()
|
||||||
|
{
|
||||||
|
SchoolName = c.SchoolName,
|
||||||
|
Id = c.Id,
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
return new MessageModel<List<HighSchoolRankResponse>>()
|
||||||
|
{
|
||||||
|
msg = "获取成功",
|
||||||
|
success = true,
|
||||||
|
response = query
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -632,7 +632,7 @@
|
||||||
</member>
|
</member>
|
||||||
<member name="P:New_College.Model.Models.D_PlanMajorDesc.Nature">
|
<member name="P:New_College.Model.Models.D_PlanMajorDesc.Nature">
|
||||||
<summary>
|
<summary>
|
||||||
办学性质
|
办学性质:公办 民办
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:New_College.Model.Models.D_PlanMajorDesc.Ownership">
|
<member name="P:New_College.Model.Models.D_PlanMajorDesc.Ownership">
|
||||||
|
|
@ -3590,6 +3590,151 @@
|
||||||
类型 1本科 2专科
|
类型 1本科 2专科
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:New_College.Model.ViewModels.OneSubmitGoRequest">
|
||||||
|
<summary>
|
||||||
|
一键填报传入参数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.BatchName">
|
||||||
|
<summary>
|
||||||
|
批次名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.SubjectClaim">
|
||||||
|
<summary>
|
||||||
|
选科组合
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.Location">
|
||||||
|
<summary>
|
||||||
|
用户所在省份
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.Score">
|
||||||
|
<summary>
|
||||||
|
分数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.Year">
|
||||||
|
<summary>
|
||||||
|
高考年份
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.Province">
|
||||||
|
<summary>
|
||||||
|
检索省份
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.Nature">
|
||||||
|
<summary>
|
||||||
|
办学性质 0、公办,1、民办,2中外合作,3 港澳台
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.SchoolType">
|
||||||
|
<summary>
|
||||||
|
大学类型 综合,理工类,医学类...
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.SearchType">
|
||||||
|
<summary>
|
||||||
|
1专业到学校 2学校到专业
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest._985">
|
||||||
|
<summary>
|
||||||
|
是否985 0、否,1、是
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest._211">
|
||||||
|
<summary>
|
||||||
|
是否211 0、否,1、是
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.Syl">
|
||||||
|
<summary>
|
||||||
|
是否双一流 0、否,1、是
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoRequest.Ownership">
|
||||||
|
<summary>
|
||||||
|
学校归属:教育部,上海市-湖北省
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:New_College.Model.ViewModels.OneSubmitGoResponse">
|
||||||
|
<summary>
|
||||||
|
一键填报返回值
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.Type">
|
||||||
|
<summary>
|
||||||
|
冲稳保 类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.Rank">
|
||||||
|
<summary>
|
||||||
|
排名
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.UniversityCode">
|
||||||
|
<summary>
|
||||||
|
全国统一招生代码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse._SYL">
|
||||||
|
<summary>
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.planCount">
|
||||||
|
<summary>
|
||||||
|
计划数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.fee">
|
||||||
|
<summary>
|
||||||
|
学费
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.MajorCode">
|
||||||
|
<summary>
|
||||||
|
专业代码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.MajorGroup">
|
||||||
|
<summary>
|
||||||
|
专业组
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.Major">
|
||||||
|
<summary>
|
||||||
|
专业名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.MajorRemark">
|
||||||
|
<summary>
|
||||||
|
专业备注
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.SubjectClam">
|
||||||
|
<summary>
|
||||||
|
选科组合
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.PlanItems">
|
||||||
|
<summary>
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.OneSubmitGoResponse.PlanId">
|
||||||
|
<summary>
|
||||||
|
招生计划Id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.PlanItem.RankLine">
|
||||||
|
<summary>
|
||||||
|
位次
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:New_College.Model.ViewModels.OrderInfoQuery.PayType">
|
<member name="P:New_College.Model.ViewModels.OrderInfoQuery.PayType">
|
||||||
<summary>
|
<summary>
|
||||||
1支付宝支付 2微信支付
|
1支付宝支付 2微信支付
|
||||||
|
|
|
||||||
|
|
@ -835,6 +835,18 @@
|
||||||
<param name="headers"></param>
|
<param name="headers"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:New_College.Api.Controllers.HighSchoolRankController._d_HighSchoolRankServices">
|
||||||
|
<summary>
|
||||||
|
服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:New_College.Api.Controllers.HighSchoolRankController.Get(New_College.Model.ViewModels.HighSchoolRankRequest)">
|
||||||
|
<summary>
|
||||||
|
获取高中学校名单
|
||||||
|
</summary>
|
||||||
|
<param name="highSchoolRank">通过省份名称当作过滤条件模糊查询学校名称</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="F:New_College.Api.Controllers.SeVolunteerInitializationController._d_SeVolunteerInitializationServices">
|
<member name="F:New_College.Api.Controllers.SeVolunteerInitializationController._d_SeVolunteerInitializationServices">
|
||||||
<summary>
|
<summary>
|
||||||
服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下
|
服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
using New_College.IServices.BASE;
|
||||||
|
using New_College.Model.Models;
|
||||||
|
|
||||||
|
namespace New_College.IServices
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ID_HighSchoolRankServices
|
||||||
|
/// </summary>
|
||||||
|
public interface ID_HighSchoolRankServices :IBaseServices<D_HighSchoolRank>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
using New_College.IServices.BASE;
|
using New_College.IServices.BASE;
|
||||||
|
using New_College.Model;
|
||||||
using New_College.Model.Models;
|
using New_College.Model.Models;
|
||||||
|
using New_College.Model.ViewModels;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace New_College.IServices
|
namespace New_College.IServices
|
||||||
{
|
{
|
||||||
|
|
@ -8,5 +11,12 @@ namespace New_College.IServices
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ID_PlanMajorDescServices :IBaseServices<D_PlanMajorDesc>
|
public interface ID_PlanMajorDescServices :IBaseServices<D_PlanMajorDesc>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一键填报
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<PageModel<OneSubmitGoResponse>> GetPlanMajorList(OneSubmitGoRequest request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace New_College.Model.Models
|
||||||
|
{
|
||||||
|
public class D_HighSchoolRank : EntityModel
|
||||||
|
{
|
||||||
|
public string SchoolName { get; set; }
|
||||||
|
public string City { get; set; }
|
||||||
|
public string Area { get; set; }
|
||||||
|
public string Province { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -131,7 +131,7 @@ namespace New_College.Model.Models
|
||||||
public string Location { get; set; }
|
public string Location { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 办学性质
|
/// 办学性质:公办 民办
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Nature { get; set; }
|
public string Nature { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace New_College.Model.ViewModels
|
||||||
|
{
|
||||||
|
public class HighSchoolRankRequest
|
||||||
|
{
|
||||||
|
|
||||||
|
public string Province { get; set; }
|
||||||
|
public string City { get; set; }
|
||||||
|
|
||||||
|
public string Area { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class HighSchoolRankResponse
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string SchoolName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,191 @@
|
||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace New_College.Model.ViewModels
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一键填报传入参数
|
||||||
|
/// </summary>
|
||||||
|
public class OneSubmitGoRequest : BasePageRequest
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///批次名称
|
||||||
|
/// </summary>
|
||||||
|
public string BatchName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 选科组合
|
||||||
|
/// </summary>
|
||||||
|
public string SubjectClaim { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 用户所在省份
|
||||||
|
/// </summary>
|
||||||
|
public string Location { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分数
|
||||||
|
/// </summary>
|
||||||
|
public int Score { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 高考年份
|
||||||
|
/// </summary>
|
||||||
|
public int Year { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检索省份
|
||||||
|
/// </summary>
|
||||||
|
public string Province { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 学科层次 1、本科,2、专科
|
||||||
|
///// </summary>
|
||||||
|
public int? SubjectLevel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 办学性质 0、公办,1、民办,2中外合作,3 港澳台
|
||||||
|
/// </summary>
|
||||||
|
public string Nature { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///大学类型 综合,理工类,医学类...
|
||||||
|
/// </summary>
|
||||||
|
public string SchoolType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 1专业到学校 2学校到专业
|
||||||
|
/// </summary>
|
||||||
|
public int? SearchType { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否985 0、否,1、是
|
||||||
|
/// </summary>
|
||||||
|
public int? _985 { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否211 0、否,1、是
|
||||||
|
/// </summary>
|
||||||
|
public int? _211 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否双一流 0、否,1、是
|
||||||
|
/// </summary>
|
||||||
|
public int? Syl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///学校归属:教育部,上海市-湖北省
|
||||||
|
/// </summary>
|
||||||
|
public string Ownership { get; set; }
|
||||||
|
|
||||||
|
public string Major { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一键填报返回值
|
||||||
|
/// </summary>
|
||||||
|
public class OneSubmitGoResponse
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 冲稳保 类型
|
||||||
|
/// </summary>
|
||||||
|
public string Type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 排名
|
||||||
|
/// </summary>
|
||||||
|
public string Rank { get; set; }
|
||||||
|
|
||||||
|
public int UniversityId { get; set; }
|
||||||
|
|
||||||
|
public string UniversityName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 全国统一招生代码
|
||||||
|
/// </summary>
|
||||||
|
public string UniversityCode { get; set; }
|
||||||
|
|
||||||
|
public string AreaName { get; set; }
|
||||||
|
|
||||||
|
public string _985 { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string _211 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string _SYL { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 计划数
|
||||||
|
/// </summary>
|
||||||
|
public int planCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学费
|
||||||
|
/// </summary>
|
||||||
|
public string fee { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业代码
|
||||||
|
/// </summary>
|
||||||
|
public string MajorCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 专业组
|
||||||
|
/// </summary>
|
||||||
|
public string MajorGroup { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 专业名称
|
||||||
|
/// </summary>
|
||||||
|
public string Major { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业备注
|
||||||
|
/// </summary>
|
||||||
|
public string MajorRemark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 选科组合
|
||||||
|
/// </summary>
|
||||||
|
public string SubjectClam { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<PlanItem> PlanItems { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 招生计划Id
|
||||||
|
/// </summary>
|
||||||
|
public int PlanId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PlanItem
|
||||||
|
{
|
||||||
|
public string Year { get; set; }
|
||||||
|
public int PlanCount { get; set; }
|
||||||
|
public int Count { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 位次
|
||||||
|
/// </summary>
|
||||||
|
public int RankLine { get; set; }
|
||||||
|
///// <summary>
|
||||||
|
///// 最低分
|
||||||
|
///// </summary>
|
||||||
|
public int Scoreline { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using New_College.IRepository;
|
||||||
|
using New_College.IRepository.UnitOfWork;
|
||||||
|
using New_College.Model.Models;
|
||||||
|
using New_College.Repository.Base;
|
||||||
|
|
||||||
|
namespace New_College.Repository
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// D_HighSchoolRankRepository
|
||||||
|
/// </summary>
|
||||||
|
public class D_HighSchoolRankRepository : BaseRepository<D_HighSchoolRank>, ID_HighSchoolRankRepository
|
||||||
|
{
|
||||||
|
public D_HighSchoolRankRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
using New_College.IRepository.Base;
|
||||||
|
using New_College.Model.Models;
|
||||||
|
|
||||||
|
namespace New_College.IRepository
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ID_HighSchoolRankRepository
|
||||||
|
/// </summary>
|
||||||
|
public interface ID_HighSchoolRankRepository : IBaseRepository<D_HighSchoolRank>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
|
||||||
|
using New_College.IServices;
|
||||||
|
using New_College.Model.Models;
|
||||||
|
using New_College.Services.BASE;
|
||||||
|
using New_College.IRepository.Base;
|
||||||
|
|
||||||
|
namespace New_College.Services
|
||||||
|
{
|
||||||
|
public class D_HighSchoolRankServices : BaseServices<D_HighSchoolRank>, ID_HighSchoolRankServices
|
||||||
|
{
|
||||||
|
private readonly IBaseRepository<D_HighSchoolRank> _dal;
|
||||||
|
public D_HighSchoolRankServices(IBaseRepository<D_HighSchoolRank> dal)
|
||||||
|
{
|
||||||
|
this._dal = dal;
|
||||||
|
base.BaseDal = dal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,9 +3,20 @@ using New_College.IServices;
|
||||||
using New_College.Model.Models;
|
using New_College.Model.Models;
|
||||||
using New_College.Services.BASE;
|
using New_College.Services.BASE;
|
||||||
using New_College.IRepository.Base;
|
using New_College.IRepository.Base;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using New_College.Model.ViewModels;
|
||||||
|
using New_College.Model;
|
||||||
|
using SqlSugar;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace New_College.Services
|
namespace New_College.Services
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 填报数据整合
|
||||||
|
/// </summary>
|
||||||
public class D_PlanMajorDescServices : BaseServices<D_PlanMajorDesc>, ID_PlanMajorDescServices
|
public class D_PlanMajorDescServices : BaseServices<D_PlanMajorDesc>, ID_PlanMajorDescServices
|
||||||
{
|
{
|
||||||
private readonly IBaseRepository<D_PlanMajorDesc> _dal;
|
private readonly IBaseRepository<D_PlanMajorDesc> _dal;
|
||||||
|
|
@ -14,5 +25,122 @@ namespace New_College.Services
|
||||||
this._dal = dal;
|
this._dal = dal;
|
||||||
base.BaseDal = dal;
|
base.BaseDal = dal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一键填报招生计划展示
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<PageModel<OneSubmitGoResponse>> GetPlanMajorList(OneSubmitGoRequest request)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(request.Location))
|
||||||
|
{
|
||||||
|
return new PageModel<OneSubmitGoResponse>()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (request.Year <= 0)
|
||||||
|
{
|
||||||
|
return new PageModel<OneSubmitGoResponse>()
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var pagemodel = new PageModel<OneSubmitGoResponse>();
|
||||||
|
Expression<Func<D_PlanMajorDesc, bool>> expression = Expressionable.Create<D_PlanMajorDesc>()
|
||||||
|
.And(c => c.IsDelete == false)
|
||||||
|
.And(c => c.Location == request.Location)
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(request.Major, c.Major))
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(request.SubjectClaim, c.SelectSubject))
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName.Equals(request.BatchName))
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.AreaName))
|
||||||
|
.And(c => c.Years == request.Year)
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType)
|
||||||
|
.AndIF(request.Score > 0, c => SqlFunc.Between(c.LowScore, request.Score - 15, request.Score + 15))
|
||||||
|
.AndIF(request.Syl.HasValue && request.Syl == 1, c => c._SYL == "是")
|
||||||
|
.AndIF(request._211.HasValue && request._211 == 1, c => c._211 == "是")
|
||||||
|
.AndIF(request._985.HasValue && request._985 == 1, c => c._985 == "是")
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership)
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.Nature), c => c.Nature == request.Nature)
|
||||||
|
//.AndIF(request. > 0, c => SqlFunc.Between(c.LowScore, request.Score, request.Score)) 位次区间
|
||||||
|
.ToExpression();
|
||||||
|
var query = await _dal.QueryPage(expression, request.PageIndex, request.PageSize, " order by LowScoreRank desc");
|
||||||
|
|
||||||
|
var majorarry = query.data.Select(c => c.Major).ToArray();
|
||||||
|
var universityarry = query.data.Select(c => c.UniversityName).ToArray();
|
||||||
|
Expression<Func<D_PlanMajorDesc, bool>> expression2 = Expressionable.Create<D_PlanMajorDesc>()
|
||||||
|
.And(c => c.IsDelete == false)
|
||||||
|
.And(c => c.Location == request.Location)
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(request.Major, c.Major))
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(request.SubjectClaim, c.SelectSubject))
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName.Equals(request.BatchName))
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.AreaName))
|
||||||
|
//.And(c => c.Years == request.Year)
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType)
|
||||||
|
.AndIF(request.Score > 0, c => SqlFunc.Between(c.LowScore, request.Score - 15, request.Score + 15))
|
||||||
|
.AndIF(request.Syl.HasValue && request.Syl == 1, c => c._SYL == "是")
|
||||||
|
.AndIF(request._211.HasValue && request._211 == 1, c => c._211 == "是")
|
||||||
|
.AndIF(request._985.HasValue && request._985 == 1, c => c._985 == "是")
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership)
|
||||||
|
.AndIF(!string.IsNullOrWhiteSpace(request.Nature), c => c.Nature == request.Nature)
|
||||||
|
.AndIF(query.data.Any(), c => SqlFunc.ContainsArray(majorarry, c.Major))
|
||||||
|
.AndIF(query.data.Any(), c => SqlFunc.ContainsArray(universityarry, c.UniversityName))
|
||||||
|
//.AndIF(request. > 0, c => SqlFunc.Between(c.LowScore, request.Score, request.Score)) 位次区间
|
||||||
|
.ToExpression();
|
||||||
|
var list = (await _dal.Query(expression2)).Select(c => new D_PlanMajorDesc()
|
||||||
|
{
|
||||||
|
Major = c.Major,
|
||||||
|
MajorCode = c.MajorCode,
|
||||||
|
UniversityName = c.UniversityName,
|
||||||
|
Years = c.Years,
|
||||||
|
LowScore = c.LowScore,
|
||||||
|
LowScoreRank = c.LowScoreRank,
|
||||||
|
PlanCount = c.PlanCount,
|
||||||
|
AcademicYear = c.Years.ToString()
|
||||||
|
|
||||||
|
}).ToList();
|
||||||
|
var responselist = query.data.Select(c => new OneSubmitGoResponse()
|
||||||
|
{
|
||||||
|
AreaName = c.AreaName,
|
||||||
|
fee = c.Free,
|
||||||
|
Major = c.Major,
|
||||||
|
MajorGroup = c.MajorGroup,
|
||||||
|
MajorRemark = c.Remark,
|
||||||
|
planCount = c.PlanCount,
|
||||||
|
Rank = c.Rank,
|
||||||
|
_985 = c._985,
|
||||||
|
_211 = c._211,
|
||||||
|
_SYL = c._SYL,
|
||||||
|
UniversityId = c.UId,
|
||||||
|
UniversityName = c.UniversityName,
|
||||||
|
SubjectClam = c.SelectSubject,
|
||||||
|
Type = "冲",//还缺冲稳保
|
||||||
|
PlanId = c.Id,
|
||||||
|
UniversityCode = c.EnrollmentCode,
|
||||||
|
MajorCode = c.MajorCode,
|
||||||
|
PlanItems = list.Where(e => e.UniversityName.Equals(c.UniversityName) && e.Major.Equals(c.Major) && e.MajorCode.Equals(c.MajorCode)).Select(s => new PlanItem()
|
||||||
|
{
|
||||||
|
PlanCount = s.PlanCount,
|
||||||
|
RankLine = s.LowScoreRank,
|
||||||
|
Scoreline = s.LowScore,
|
||||||
|
Year = s.AcademicYear
|
||||||
|
|
||||||
|
}).OrderByDescending(k => k.Year).ToList()
|
||||||
|
}).ToList();
|
||||||
|
return new PageModel<OneSubmitGoResponse>()
|
||||||
|
{
|
||||||
|
data = responselist,
|
||||||
|
dataCount = query.dataCount,
|
||||||
|
page = query.page,
|
||||||
|
pageCount = query.pageCount,
|
||||||
|
PageSize = query.PageSize
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue