Commit 8e25bb45 authored by 黄奎's avatar 黄奎

页面修改

parent 1089ce94
......@@ -17,9 +17,9 @@ namespace Edu.Common.Enum.Course
Train = 1,
/// <summary>
/// 留学
/// 留学就业
/// </summary>
[EnumField("留学")]
[EnumField("留学就业")]
StudyAbroad = 2
}
}
......@@ -18,36 +18,6 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string CreateByPhoto { get; set; }
/// <summary>
/// 公司章
/// </summary>
public string CompanySealImage { get; set; }
/// <summary>
/// 合同公司名称
/// </summary>
public string ContractBranch { get; set; }
/// <summary>
/// 合同电话
/// </summary>
public string ContractTel { get; set; }
/// <summary>
/// 公司名称
/// </summary>
public string BranchName { get; set; }
/// <summary>
/// 法人代表
/// </summary>
public string LegalPerson { get; set; }
/// <summary>
/// 公司列表
/// </summary>
public List<string> BranchNList { get; set; }
/// <summary>
/// 学生名单ids
/// </summary>
......
......@@ -1656,73 +1656,73 @@ namespace Edu.Module.Course
/// <returns></returns>
public bool SetOrderReceiveContract(int orderId, int guestId, UserInfo userInfo)
{
var glist = order_GuestRepository.GetList(new RB_Order_Guest_ViewModel() { Group_Id = userInfo.Group_Id, Id = guestId, OrderId = orderId, GuestState = 1 });
if (glist.Any())
{
//订单信息
var omodel = orderRepository.GetEntity(orderId);
decimal Money = (omodel.PreferPrice - omodel.DiscountMoney) / glist.Count();//平均每人费用 (看是否根据订单单价)
string dxMoney = StringHelper.MoneyToUpper(Money.ToString());
//班级信息
var classmodel = classRepository.GetClassAndCourseListRepository(new RB_Class_ViewModel() { ClassId = omodel.ClassId }).FirstOrDefault();
string newContractNum = "JH-CD0018";
var totalCount = education_ContractRepository.GetContractCount(new RB_Education_Contract_ViewModel() { Group_Id = userInfo.Group_Id });
//查询已有合同的
string guestIds = string.Join(",", glist.Select(x => x.Id));
var clist = education_ContractRepository.GetList(new RB_Education_Contract_ViewModel() { Group_Id = userInfo.Group_Id, OrderId = orderId, GuestIds = guestIds, Status = -1 }).Where(x => x.Status != 4).ToList();
foreach (var item in glist) {
var cmodel = clist.Where(x => x.GuestId == item.Id).FirstOrDefault();
if (cmodel == null) {
totalCount += 1;
string num = totalCount.ToString();
switch (num.Length)
{
case 1:
num = "00000" + num; break;
case 2:
num = "0000" + num; break;
case 3:
num = "000" + num; break;
case 4:
num = "00" + num; break;
case 5:
num = "0" + num; break;
}
string ContractNo = newContractNum + num;
education_ContractRepository.Insert(new Model.Entity.Course.RB_Education_Contract()
{
Id = 0,
GuestId = item.Id,
ContractNo = ContractNo,
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
CType = ContractTypeEnum.Train,
Exam = "",
Group_Id = userInfo.Group_Id,
IsCompanySeal = 0,
CNYCaps = dxMoney,
Money = Money.ToString(),
OrderId = orderId,
CourseName = classmodel.CateName,
CourseContent = classmodel.CourseName,
SchoolName = classmodel.SchoolName,
School_Id = classmodel.School_Id,
Sign = "",
Status = 0,
StudentName = item.GuestName,
UpdateBy = userInfo.Id,
UpdateTime = DateTime.Now,
ContactAddress = item.ContactAddress,
Domicile = item.Domicile,
IDCard = item.IDCard,
ContactMobile = item.Mobile,
EmergencyContact = item.Contact,
EmergencyMobile = item.ContactMobile,
Sex = item.Sex
});
}
}
}
//var glist = order_GuestRepository.GetList(new RB_Order_Guest_ViewModel() { Group_Id = userInfo.Group_Id, Id = guestId, OrderId = orderId, GuestState = 1 });
//if (glist.Any())
//{
// //订单信息
// var omodel = orderRepository.GetEntity(orderId);
// decimal Money = (omodel.PreferPrice - omodel.DiscountMoney) / glist.Count();//平均每人费用 (看是否根据订单单价)
// string dxMoney = StringHelper.MoneyToUpper(Money.ToString());
// //班级信息
// var classmodel = classRepository.GetClassAndCourseListRepository(new RB_Class_ViewModel() { ClassId = omodel.ClassId }).FirstOrDefault();
// string newContractNum = "JH-CD0018";
// var totalCount = education_ContractRepository.GetContractCount(new RB_Education_Contract_ViewModel() { Group_Id = userInfo.Group_Id });
// //查询已有合同的
// string guestIds = string.Join(",", glist.Select(x => x.Id));
// var clist = education_ContractRepository.GetList(new RB_Education_Contract_ViewModel() { Group_Id = userInfo.Group_Id, OrderId = orderId, GuestIds = guestIds, Status = -1 }).Where(x => x.Status != 4).ToList();
// foreach (var item in glist) {
// var cmodel = clist.Where(x => x.GuestId == item.Id).FirstOrDefault();
// if (cmodel == null) {
// totalCount += 1;
// string num = totalCount.ToString();
// switch (num.Length)
// {
// case 1:
// num = "00000" + num; break;
// case 2:
// num = "0000" + num; break;
// case 3:
// num = "000" + num; break;
// case 4:
// num = "00" + num; break;
// case 5:
// num = "0" + num; break;
// }
// string ContractNo = newContractNum + num;
// education_ContractRepository.Insert(new Model.Entity.Course.RB_Education_Contract()
// {
// Id = 0,
// GuestId = item.Id,
// ContractNo = ContractNo,
// CreateBy = userInfo.Id,
// CreateTime = DateTime.Now,
// CType = ContractTypeEnum.Train,
// Exam = "",
// Group_Id = userInfo.Group_Id,
// IsCompanySeal = 0,
// CNYCaps = dxMoney,
// Money = Money.ToString(),
// OrderId = orderId,
// CourseName = classmodel.CateName,
// CourseContent = classmodel.CourseName,
// SchoolName = classmodel.SchoolName,
// School_Id = classmodel.School_Id,
// Sign = "",
// Status = 0,
// StudentName = item.GuestName,
// UpdateBy = userInfo.Id,
// UpdateTime = DateTime.Now,
// ContactAddress = item.ContactAddress,
// Domicile = item.Domicile,
// IDCard = item.IDCard,
// ContactMobile = item.Mobile,
// EmergencyContact = item.Contact,
// EmergencyMobile = item.ContactMobile,
// Sex = item.Sex
// });
// }
// }
//}
return true;
}
#endregion
......
......@@ -39,10 +39,10 @@ namespace Edu.Repository.Course
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (demodel.CType > 0)
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
}
//if (demodel.CType > 0)
//{
// where += $@" and {nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
//}
if (demodel.Status >= 0)
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.Status)} ={demodel.Status}";
......@@ -89,10 +89,10 @@ namespace Edu.Repository.Course
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.GuestId)} in({demodel.GuestIds})";
}
if (demodel.CType > 0)
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
}
//if (demodel.CType > 0)
//{
// where += $@" and {nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
//}
if (demodel.Status >= 0)
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.Status)} ={demodel.Status}";
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Log;
using Edu.Module.Course;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
......@@ -28,7 +26,6 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
private readonly EducationContractModule educationContractModule = AOP.AOPHelper.CreateAOPObject<EducationContractModule>();
#region 合同列表
/// <summary>
......@@ -42,20 +39,17 @@ namespace Edu.WebApi.Controllers.Course
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var dmodel = JsonHelper.DeserializeObject<RB_Education_Contract_ViewModel>(RequestParm.Msg.ToString());
dmodel.Group_Id = userInfo.Group_Id;
var list = educationContractModule.GetEducationContractPageList(pageModel.PageIndex, pageModel.PageSize, out long count, dmodel);
pageModel.Count = Convert.ToInt32(count);
pageModel.PageData = list.Select(x => new
{
x.Id,
x.CType,
CTypeName = x.CType.ToName(),
x.OrderId,
x.ContractNo,
x.StudentName,
x.SchoolName,
x.CourseName,
x.CourseContent,
x.CNYCaps,
x.Money,
x.Exam,
......@@ -66,13 +60,6 @@ namespace Edu.WebApi.Controllers.Course
x.CreateBy,
x.CreateByName,
x.CreateByPhoto,
x.Sex,
x.IDCard,
x.Domicile,
x.ContactAddress,
x.ContactMobile,
x.EmergencyContact,
x.EmergencyMobile,
CreateTime = x.CreateTime.ToString("yyyy-MM-dd HH:mm")
});
return ApiResult.Success("", pageModel);
......@@ -84,23 +71,23 @@ namespace Edu.WebApi.Controllers.Course
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult GetEducationContractInfo() {
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ContractId = parms.GetInt("ContractId", 0);//合同id
public ApiResult GetEducationContractInfo()
{
int ContractId = base.ParmJObj.GetInt("ContractId", 0);//合同id
var model = educationContractModule.GetEducationContractInfo(ContractId);
if (model == null) { return ApiResult.Failed("合同不存在"); }
if (model == null)
{
return ApiResult.Failed("合同不存在");
}
return ApiResult.Success("", new
{
model.Id,
model.CType,
CTypeName = model.CType.ToName(),
model.OrderId,
model.ContractNo,
model.StudentName,
model.SchoolName,
model.CourseName,
model.CourseContent,
model.CNYCaps,
model.Money,
model.Exam,
......@@ -108,21 +95,7 @@ namespace Edu.WebApi.Controllers.Course
model.Status,
model.StatusStr,
model.IsCompanySeal,
model.CompanySealImage,
model.ContractBranch,
model.ContractTel,
model.BranchNList,
model.BranchName,
model.Sex,
model.IDCard,
model.Domicile,
model.ContactAddress,
model.ContactMobile,
model.EmergencyContact,
model.EmergencyMobile,
model.LegalPerson,
SignDate = model.SignDate.HasValue ? model.SignDate.Value.ToString("yyyy-MM-dd") : "",
SealDate = model.SealDate.HasValue ? model.SealDate.Value.ToString("yyyy-MM-dd") : ""
});
}
......@@ -133,26 +106,26 @@ namespace Edu.WebApi.Controllers.Course
[HttpPost]
public ApiResult SetEducationContractInfo()
{
var userInfo = base.UserInfo;
var userInfo = base.UserInfo;
var dmodel = JsonHelper.DeserializeObject<RB_Education_Contract_ViewModel>(RequestParm.Msg.ToString());
if (string.IsNullOrEmpty(dmodel.StudentName)) {
if (string.IsNullOrEmpty(dmodel.StudentName))
{
return ApiResult.ParamIsNull("请输入学生姓名");
}
if (string.IsNullOrEmpty(dmodel.SchoolName)) {
if (string.IsNullOrEmpty(dmodel.SchoolName))
{
return ApiResult.ParamIsNull("请输入学校名称");
}
if (string.IsNullOrEmpty(dmodel.CourseName)) {
if (string.IsNullOrEmpty(dmodel.CourseName))
{
return ApiResult.ParamIsNull("请输入课程名称");
}
if (string.IsNullOrEmpty(dmodel.CourseContent)) {
return ApiResult.ParamIsNull("请输入课程内容");
}
if (string.IsNullOrEmpty(dmodel.CNYCaps)) {
if (string.IsNullOrEmpty(dmodel.CNYCaps))
{
return ApiResult.ParamIsNull("请输入大写金额");
}
if (string.IsNullOrEmpty(dmodel.Money)) {
return ApiResult.ParamIsNull("请输入金额");
}
dmodel.Group_Id = userInfo.Group_Id;
dmodel.School_Id = userInfo.School_Id;
......@@ -167,7 +140,8 @@ namespace Edu.WebApi.Controllers.Course
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed();
}
}
......@@ -183,36 +157,12 @@ namespace Edu.WebApi.Controllers.Course
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ContractId = parms.GetInt("ContractId", 0);//合同id
int State = parms.GetInt("State", 1);// 状态 1提交审核 2通过 3驳回 4取消 5盖章
if (ContractId <= 0) {
return ApiResult.ParamIsNull("请传递合同id");
}
bool flag = educationContractModule.SetEducationContractAudit(ContractId, State, userInfo);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
/// <summary>
/// 合同复制
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetEducationContractCopy() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ContractId = parms.GetInt("ContractId", 0);//合同id
if (ContractId <= 0)
{
return ApiResult.ParamIsNull("请传递合同id");
}
bool flag = educationContractModule.SetEducationContractCopy(ContractId, userInfo);
bool flag = educationContractModule.SetEducationContractAudit(ContractId, State, userInfo);
if (flag)
{
return ApiResult.Success();
......@@ -229,7 +179,8 @@ namespace Edu.WebApi.Controllers.Course
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult SetEducationContractSign() {
public ApiResult SetEducationContractSign()
{
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ContractId = parms.GetInt("ContractId", 0);//合同id
string Sign = parms.GetStringValue("Sign");//签名
......@@ -263,7 +214,7 @@ namespace Edu.WebApi.Controllers.Course
var ID = parms.GetInt("ContractId");
var CType = parms.GetInt("CType");
string curl = Common.Config.UploadSiteUrl + string.Format(@"/Home/EducationContractInfo?ID={0}&CType={1}", ID, CType);
//string curl = "http://localhost:50034"+ string.Format(@"/Home/EducationContractInfo?ID={0}&CType={1}", ID, CType);
var flag = new ToPdfHelper().HtmlWJtoPdf(tempPath, curl);
return ApiResult.Success("", path);
}
......
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