Commit b0a58c6b authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents f13b4d2e bbd35789
......@@ -38,8 +38,10 @@ namespace Edu.Common.Data
/// <returns></returns>
private static WordsItem DataRowToModel(int ChapterId, DataRow dr)
{
WordsItem model = new WordsItem();
model.ChapterId = ChapterId;
WordsItem model = new WordsItem
{
ChapterId = ChapterId
};
if (dr != null)
{
if (dr.Table.Columns.Contains("品詞名") && !string.IsNullOrEmpty(dr["品詞名"].ToString()))
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
namespace Edu.Common.Plugin
{
/// <summary>
/// 文件帮助类
/// </summary>
public class FileHelper
{
/// <summary>
/// 获取指定文件夹下面的所有文件
/// </summary>
/// <param name="path"></param>
/// <param name="serverPath"></param>
/// <returns></returns>
public static List<FileItem> GetFileAllPath(string path, string savePath)
{
List<FileItem> fileList = new List<FileItem>();
int leval = 0;
GetDirectoryAndFile(path, leval, fileList);
foreach (var item in fileList)
{
string str = @"录音";
Regex reg = new Regex(str);
string newFileName = Regex.Replace(item.FileName, @"\d", "");
var fileNameArray = Regex.Split(newFileName, str);
if (fileNameArray != null && fileNameArray.Length > 0)
{
newFileName = (fileNameArray.Length > 1 ? fileNameArray[1] : fileNameArray[0]).TrimStart().TrimEnd();
}
string newPathFileName = savePath + @"\" + newFileName.TrimStart('.')+"3";
File.Copy(item.FileUrl, newPathFileName, true);
item.FileUrl = newPathFileName;
}
return fileList;
}
/// <summary>
/// 获取所有文件
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static List<FileItem> GetFileList(string path)
{
List<FileItem> fileList = new List<FileItem>();
DirectoryInfo theFolder = new DirectoryInfo(@path);
//遍历文件
foreach (FileInfo NextFile in theFolder.GetFiles())
{
string extName = Path.GetExtension(NextFile.Name).ToLower();
if (extName == ".mp3")
{
fileList.Add(new FileItem()
{
FileName = NextFile.Name,
FileUrl = NextFile.FullName
});
}
}
return fileList;
}
/// <summary>
/// 列出path路径对应的文件夹中的子文件夹和文件
/// 然后再递归列出子文件夹内的文件和文件夹
/// </summary>
/// <param name="path">需要列出内容的文件夹的路径</param>
/// <param name="leval">当前递归层级,用于控制输出前导空格的数量</param>
private static void GetDirectoryAndFile(string path, int leval, List<FileItem> list)
{
DirectoryInfo theFolder = new DirectoryInfo(@path);
leval++;
//遍历文件
foreach (FileInfo NextFile in theFolder.GetFiles())
{
for (int i = 0; i < leval; i++)
{
string extName = Path.GetExtension(NextFile.Name).ToLower();
if (extName == ".mp3")
{
list.Add(new FileItem()
{
FileName = NextFile.Name,
FileUrl = NextFile.FullName
});
}
}
}
//遍历文件夹
foreach (DirectoryInfo NextFolder in theFolder.GetDirectories())
{
for (int i = 0; i < leval; i++)
{
GetDirectoryAndFile(NextFolder.FullName, leval, list);
}
}
}
}
/// <summary>
/// 文件项目
/// </summary>
public class FileItem
{
/// <summary>
/// 文件名
/// </summary>
public string FileName { get; set; }
/// <summary>
/// 文件全路径
/// </summary>
public string FileUrl { get; set; }
}
}
......@@ -593,8 +593,7 @@ namespace Edu.Common.Plugin
/// <returns></returns>
public static DataSet ExcelToDataSet(string excelPath)
{
int sheetCount;
return ExcelToDataSet(excelPath, true, out sheetCount);
return ExcelToDataSet(excelPath, true, out int sheetCount);
}
/// <summary>
......@@ -606,41 +605,37 @@ namespace Edu.Common.Plugin
/// <returns></returns>
static DataSet ExcelToDataSet(string excelPath, bool firstRowAsHeader, out int sheetCount)
{
using (DataSet ds = new DataSet())
using DataSet ds = new DataSet();
using FileStream fileStream = new FileStream(excelPath, FileMode.Open, FileAccess.Read);
string extFile = Path.GetExtension(excelPath).ToLower();
IWorkbook workbook;
if (extFile.Equals(".xls"))
{
using (FileStream fileStream = new FileStream(excelPath, FileMode.Open, FileAccess.Read))
workbook = new HSSFWorkbook(fileStream);
HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(workbook);
sheetCount = workbook.NumberOfSheets;
for (int i = 0; i < sheetCount; ++i)
{
string extFile = Path.GetExtension(excelPath).ToLower();
IWorkbook workbook;
if (extFile.Equals(".xls"))
{
workbook = new HSSFWorkbook(fileStream);
HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(workbook);
sheetCount = workbook.NumberOfSheets;
for (int i = 0; i < sheetCount; ++i)
{
HSSFSheet sheet = workbook.GetSheetAt(i) as HSSFSheet;
DataTable dt = ImportDataTable(sheet, 0, firstRowAsHeader);
dt.TableName = workbook.GetSheetName(i);
ds.Tables.Add(dt);
}
return ds;
}
else
{
workbook = new XSSFWorkbook(fileStream);
XSSFFormulaEvaluator evaluator = new XSSFFormulaEvaluator(workbook);
sheetCount = workbook.NumberOfSheets;
for (int i = 0; i < sheetCount; ++i)
{
XSSFSheet sheet = workbook.GetSheetAt(i) as XSSFSheet;
DataTable dt = ImportDataTable(sheet, 0, firstRowAsHeader);
dt.TableName = workbook.GetSheetName(i);
ds.Tables.Add(dt);
}
return ds;
}
HSSFSheet sheet = workbook.GetSheetAt(i) as HSSFSheet;
DataTable dt = ImportDataTable(sheet, 0, firstRowAsHeader);
dt.TableName = workbook.GetSheetName(i);
ds.Tables.Add(dt);
}
return ds;
}
else
{
workbook = new XSSFWorkbook(fileStream);
XSSFFormulaEvaluator evaluator = new XSSFFormulaEvaluator(workbook);
sheetCount = workbook.NumberOfSheets;
for (int i = 0; i < sheetCount; ++i)
{
XSSFSheet sheet = workbook.GetSheetAt(i) as XSSFSheet;
DataTable dt = ImportDataTable(sheet, 0, firstRowAsHeader);
dt.TableName = workbook.GetSheetName(i);
ds.Tables.Add(dt);
}
return ds;
}
}
......
......@@ -386,6 +386,16 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public int CategoryId { get; set; }
/// <summary>
/// 同行名称
/// </summary>
public string CategoryName { get; set; }
/// <summary>
/// 同行类型
/// </summary>
public CatetoryTypeEnum CatetoryType { get; set; }
/// <summary>
/// 课程顾问跟进状态名称
/// </summary>
......
......@@ -1198,6 +1198,34 @@ namespace Edu.Module.Course
}
}
/// <summary>
/// 重新更新课程单词URL
/// </summary>
public void RunWordsUrlModule()
{
var list= course_WordsRepository.GetCourseWordsListRepository(new RB_Course_Words_Extend() {});
string newPath = @"G:\WebFile\EduSystem\CourseWords";
var fileList = Common.Plugin.FileHelper.GetFileList(newPath);
if (list != null && list.Count > 0 && fileList != null && fileList.Count > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>();
foreach (var item in list.Where(qitem=>string.IsNullOrEmpty(qitem.FileUrl)))
{
if (string.IsNullOrEmpty(item.FileUrl))
{
var tempWords = fileList.Where(qitem => (qitem.FileName.Replace("。","") == item.WordContent.ToUpper() + ".mp3") || (qitem.FileName.Replace("。", "") == item.WordContent.ToLower() + ".mp3") || (qitem.FileName.Replace("。", "") == item.WordWrite + ".mp3") || (qitem.FileName.Replace("。", "") == item.ChineseMean + ".mp3"))?.FirstOrDefault();
if (tempWords != null)
{
fileds.Clear();
string newFileUrl = @"/EduSystem/CourseWords/" + tempWords.FileName;
fileds.Add(nameof(RB_Course_Words_Extend.FileUrl), newFileUrl);
bool flag = course_WordsRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Words_Extend.Id), item.Id));
}
}
}
}
}
/// <summary>
/// 获取课程章节列表
/// </summary>
......
......@@ -55,49 +55,22 @@ namespace Edu.Module.Course
/// 学生
/// </summary>
private readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
/// <summary>
/// 订单
/// </summary>
private readonly RB_OrderRepository orderRepository = new RB_OrderRepository();
/// <summary>
/// 订单学生
/// </summary>
private readonly RB_Order_GuestRepository order_GuestRepository = new RB_Order_GuestRepository();
/// <summary>
/// 签到
/// </summary>
private readonly RB_Class_CheckRepository class_CheckRepository = new RB_Class_CheckRepository();
/// <summary>
/// 班级
/// </summary>
private readonly RB_ClassRepository classRepository = new RB_ClassRepository();
/// <summary>
/// 课程
/// </summary>
private readonly RB_CourseRepository courseRepository = new RB_CourseRepository();
/// <summary>
/// 班级类型
/// </summary>
private readonly RB_Class_TypeRepository class_TypeRepository = new RB_Class_TypeRepository();
/// <summary>
/// 账户
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 部门
/// </summary>
private readonly RB_DepartmentRepository departmentRepository = new RB_DepartmentRepository();
/// <summary>
/// 校区
/// </summary>
private readonly RB_SchoolRepository schoolRepository = new RB_SchoolRepository();
/// <summary>
/// 财务单据
/// </summary>
private readonly RB_FinanceRepository financeRepository = new RB_FinanceRepository();
private readonly RB_Customer_RemitRepository customer_RemitRepository = new RB_Customer_RemitRepository();
#region 首页返佣
/// <summary>
/// 获取首页返佣同级
/// </summary>
......
......@@ -912,7 +912,7 @@ namespace Edu.Module.Customer
string mask = "";
var guwen = push.Content.Split(',', StringSplitOptions.RemoveEmptyEntries);
var guwenName = push.Mask.Split(',', StringSplitOptions.RemoveEmptyEntries);
if (guwen.Length > 1)
if (guwen.Length > 0)
{
if (rule.Content.Equals("1"))
{
......
......@@ -19,6 +19,7 @@ using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Newtonsoft.Json.Linq;
using System.Dynamic;
using Edu.Common.Enum.Customer;
namespace Edu.Module.Customer
{
......@@ -1245,44 +1246,39 @@ namespace Edu.Module.Customer
{
customerList = customerRepository.GetCustomerListRepository(new RB_Customer_Extend() { CustomerIds = cusIds });
}
var sourceTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput)
?.GroupBy(qitem => new { qitem.CustomerType })
?.Select(qitem => new { qitem.Key.CustomerType });
var categoryTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput)
?.GroupBy(qitem => new { qitem.CatetoryType})
?.Select(qitem => new { qitem.Key.CatetoryType });
foreach (var sItem in sourceTypeList)
foreach (var sItem in categoryTypeList)
{
var sourceIdList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CustomerType == sItem.CustomerType)
?.GroupBy(qitem => new { qitem.StuSourceId })
?.Select(qitem => new { qitem.Key.StuSourceId });
foreach (var subItem in sourceIdList)
var categoryList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CatetoryType == sItem.CatetoryType)
?.GroupBy(qitem => new { qitem.CategoryId })
?.Select(qitem => new { qitem.Key.CategoryId });
foreach (var subItem in categoryList)
{
var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.StuSourceId == subItem.StuSourceId)?.ToList();
var tempCustomer = customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId);
string channelName = tempCustomer?.CustomerName ?? "";
if (!string.IsNullOrEmpty(tempCustomer?.CategoryName))
{
channelName += string.Format("({0})", tempCustomer?.CategoryName);
}
//企业同行
if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.Company)
var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CategoryId == subItem.CategoryId)?.ToList();
var tempCustomer = customerList?.FirstOrDefault(qitem => qitem.CategoryId == subItem.CategoryId);
string channelName = tempCustomer?.CategoryName ?? "其他";
if (sItem.CatetoryType == CatetoryTypeEnum.Company)
{
customerDataList.Add(new MarketChannelStaticModel()
{
ChannelName = channelName,
ChannelId = subItem.StuSourceId,
ChannelId = subItem.CategoryId,
ClueCount = tempCusList?.Count() ?? 0,
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount) ?? 0,
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount) ?? 0,
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome) ?? 0
});
}
//校代同行
else if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.School)
if (sItem.CatetoryType == CatetoryTypeEnum.School)
{
schoolDataList.Add(new MarketChannelStaticModel()
{
ChannelName = channelName,
ChannelId = subItem.StuSourceId,
ChannelId = subItem.CategoryId,
ClueCount = tempCusList?.Count() ?? 0,
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount) ?? 0,
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount) ?? 0,
......@@ -1291,7 +1287,6 @@ namespace Edu.Module.Customer
}
}
}
}
else if (item.Id == (int)StuCreateTypeEnum.InternalIntroduction)
{
......@@ -1386,34 +1381,33 @@ namespace Edu.Module.Customer
});
}
}
var cusIds = string.Join(",", dataList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput).Select(qitem => qitem.StuSourceId));
List<RB_Customer_Extend> customerList = new List<RB_Customer_Extend>();
if (!string.IsNullOrEmpty(cusIds))
{
customerList = customerRepository.GetCustomerListRepository(new RB_Customer_Extend() { CustomerIds = cusIds });
}
var sourceTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput)
?.GroupBy(qitem => new { qitem.CustomerType })
?.Select(qitem => new { qitem.Key.CustomerType });
var catetoryTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput)
?.GroupBy(qitem => new { qitem.CatetoryType })
?.Select(qitem => new { qitem.Key.CatetoryType });
foreach (var sItem in sourceTypeList)
foreach (var sItem in catetoryTypeList)
{
var sourceIdList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CustomerType == sItem.CustomerType)
?.GroupBy(qitem => new { qitem.StuSourceId })
?.Select(qitem => new { qitem.Key.StuSourceId });
var sourceIdList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CatetoryType == sItem.CatetoryType)
?.GroupBy(qitem => new { qitem.CategoryId })
?.Select(qitem => new { qitem.Key.CategoryId });
foreach (var subItem in sourceIdList)
{
var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.StuSourceId == subItem.StuSourceId)?.ToList();
var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CategoryId == subItem.CategoryId)?.ToList();
var tempCustomer = customerList?.FirstOrDefault(qitem => qitem.CategoryId == subItem.CategoryId);
//企业同行
if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.Company)
if (sItem.CatetoryType == CatetoryTypeEnum.Company)
{
list.Add(new MarketChannelStaticModel()
{
ChannelName = "(企业)" + (customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId)?.CustomerName ?? ""),
ChannelId= subItem.StuSourceId,
CustomerType= sItem.CustomerType,
ChannelName = "(企业)" + (tempCustomer?.CustomerName ?? ""),
ChannelId= subItem.CategoryId,
CustomerType= sItem.CatetoryType,
ChannelType = 2,
ClueCount = tempCusList?.Count()??0,
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount)??0,
......@@ -1422,13 +1416,13 @@ namespace Edu.Module.Customer
});
}
//校代同行
if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.School)
if (sItem.CatetoryType == CatetoryTypeEnum.School)
{
list.Add(new MarketChannelStaticModel()
{
ChannelName = "(校代)" + (customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId)?.CustomerName ?? ""),
ChannelId=subItem.StuSourceId,
CustomerType=sItem.CustomerType,
ChannelName = "(校代)" + (tempCustomer?.CustomerName ?? ""),
ChannelId=subItem.CategoryId,
CustomerType=sItem.CatetoryType,
ChannelType = 2,
ClueCount = tempCusList?.Count()??0,
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount)??0,
......@@ -1439,7 +1433,6 @@ namespace Edu.Module.Customer
}
}
var empIds = string.Join(",", dataList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction).Select(qitem => qitem.StuSourceId));
List<Employee_ViewModel> empList = new List<Employee_ViewModel>();
if (!string.IsNullOrEmpty(empIds))
......
......@@ -2147,7 +2147,6 @@ namespace Edu.Module.Finance
decimal Money = 0, Fee = 0;
if (NewfinanceList != null && NewfinanceList.Count() > 0)
{
//var costList = costtypeRepository.GetList();
switch (Type)
{
//佣金收入
......
......@@ -471,6 +471,13 @@ namespace Edu.Module.User
{
StuId = extModel.StuId
});
//学员订单
var stuOrderList = student_OrderGuestRepository.GetStrOrderGuestListStaticRepository(new RB_Student_OrderGuest_ViewModel()
{
QStudentIds = extModel.StuId.ToString()
});
extModel.OrderCount = stuOrderList?.Count() ?? 0;
extModel.AssistList = assistList;
extModel.StuStageName = stageRepository.GetEntity(extModel.StuStage)?.StageName ?? "";
extModel.StuTypeName = student_TypeRepository.GetEntity(extModel.StuType)?.Name ?? "";
......
......@@ -382,6 +382,7 @@ WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.Status), 0);
builder.AppendFormat(" AND A.{0} in(1,2) ", nameof(RB_Class_ViewModel.ClassStatus));
builder.AppendFormat(" AND B.Saleplat<>'' ");
if (query != null)
{
if (query.Group_Id > 0)
......
......@@ -243,7 +243,7 @@ WHERE 1=1
SELECT t.*,g.GroupName,s.SName,IFNULL(a.Account,'') AS StudentAccount ,c.CustomerName,IFNULL(B.Name,'') AS AdvisorStatusName
FROM rb_student AS t LEFT JOIN rb_group AS g ON t.Group_Id=g.GId
LEFT JOIN rb_school AS s ON t.School_Id=s.SId
LEFT JOIN rb_customer c on c.CustomerId = t.CustomerId
LEFT JOIN rb_customer c on (c.CustomerId = t.StuSourceId AND t.CreateType=2)
LEFT JOIN rb_account as a ON (t.StuId=a.AccountId AND a.AccountType=4 )
LEFT JOIN rb_student_advisorconfig AS b ON t.AdvisorStatus=B.Id
WHERE 1=1
......@@ -819,7 +819,7 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState <>2
string sql = $@"
SELECT A.StuStage,COUNT(0) AS OrderCount
FROM rb_student AS A INNER JOIN rb_customer AS B ON (A.CreateType=2 AND A.StuSourceId=B.CustomerId)
WHERE A.Group_Id ={group_Id} AND A.CreateType=2 {builder.ToString()}
WHERE A.Group_Id ={group_Id} AND A.CreateType=2 {builder}
GROUP BY A.StuStage ";
return Get<RB_Student_ViewModel>(sql).ToList();
}
......@@ -1080,13 +1080,15 @@ WHERE 1=1
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.StuId,A.CreateBy,A.StuChannel,A.CreateType,IFNULL(B.VisitCount,0) AS VisitCount,IFNULL(C.CourseOrderCount,0) AS OrderCount,IFNULL(c.Income,0) AS OrderInCome
,A.CustomerId,A.StuSourceId,IFNULL(D.CustomerType,0) AS CustomerType,IFNULL(D.CategoryId,0) AS CategoryId
,A.CustomerId,A.StuSourceId,IFNULL(D.CustomerType,0) AS CustomerType,IFNULL(D.CategoryId,0) AS CategoryId,IFNULL(E.CategoryName,'') AS CategoryName,IFNULL(E.CatetoryType,0) AS CatetoryType
FROM RB_Student AS A
LEFT JOIN(SELECT StuId,Count(1) AS VisitCount FROM rb_student_visit WHERE Status=0 GROUP BY StuId) AS B ON A.StuId=B.StuId
LEFT JOIN(SELECT og.Student_Id,COUNT(1) AS CourseOrderCount,SUM(o.Income) AS Income FROM rb_student_orderguest AS og INNER JOIN rb_order AS o ON og.OrderId=o.OrderId WHERE O.OrderState NOT IN(3,4) GROUP BY og.Student_Id ) AS C ON A.StuId=C.Student_Id
LEFT JOIN rb_customer AS D ON A.StuSourceId=D.CustomerId AND A.CreateType=2
LEFT JOIN rb_customer_category AS E ON D.CategoryId=E.CategoryId
WHERE A.Status=0
");
builder.AppendFormat(" AND A.StuStage<>{0} AND A.AdvisorStatus<>{1} ", 7, 7);
if (query != null)
{
if (query.Group_Id > 0)
......

using Edu.Repository.Course;
using System;
namespace Edu.Test
......@@ -11,6 +12,13 @@ namespace Edu.Test
//filePath = @"C:/Users/qiaoyajun/Desktop/EduWordTemplate.doc";
//filePath = @"C:/Users/qiaoyajun/Desktop/EduWordTemplate.doc";
//var data = Common.Data.QuestionHelper.GetWordQuestionData(filePath);
string newPath = @"G:\NewWords";
string filePath = @"G:\Words";
var list = Common.Plugin.FileHelper.GetFileAllPath(filePath, newPath);
string str = Common.Plugin.JsonHelper.Serialize(list);
Console.WriteLine(str);
Console.ReadKey();
}
}
}
......@@ -5,6 +5,7 @@ using Edu.Cache.User;
using Edu.Common;
using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Customer;
......@@ -34,7 +35,7 @@ namespace Edu.WebApi.Controllers.Course
/// 财务配置
/// </summary>
private readonly EducationContractModule educationContractModule = new EducationContractModule();
#region 获取首页返佣
/// <summary>
......@@ -114,7 +115,17 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult GetCommissionUserList()
{
var userInfo = base.UserInfo;
var dmodel = JsonHelper.DeserializeObject<RB_Order_ReturnComission_ViewModel>(RequestParm.Msg.ToString());
var dmodel = new RB_Order_ReturnComission_ViewModel()
{
BatchId = base.ParmJObj.GetInt("BatchId"),
OrderSourceId = base.ParmJObj.GetInt("OrderSourceId"),
OrderSourceType = (StuCreateTypeEnum)base.ParmJObj.GetInt("OrderSourceType"),
Q_SelectNormal = base.ParmJObj.GetInt("Q_SelectNormal"),
Status = base.ParmJObj.GetInt("Status"),
UserDept = base.ParmJObj.GetInt("UserDept"),
SchoolId = base.ParmJObj.GetInt("SchoolId"),
};
dmodel.GroupId = userInfo.Group_Id;
if (dmodel.BatchId <= 0)
{
......@@ -311,7 +322,15 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult SetBatchFinance()
{
var userInfo = base.UserInfo;
var dmodel = JsonHelper.DeserializeObject<RB_Order_ReturnComission_ViewModel>(RequestParm.Msg.ToString());
var dmodel = new RB_Order_ReturnComission_ViewModel()
{
BatchId = base.ParmJObj.GetInt("BatchId"),
OrderSourceId = base.ParmJObj.GetInt("OrderSourceId"),
OrderSourceType = (StuCreateTypeEnum)base.ParmJObj.GetInt("OrderSourceType"),
Q_SelectNormal = base.ParmJObj.GetInt("Q_SelectNormal"),
SchoolId = base.ParmJObj.GetInt("SchoolId"),
Status = base.ParmJObj.GetInt("Status"),
};
dmodel.GroupId = userInfo.Group_Id;
if (dmodel.BatchId <= 0)
{
......@@ -360,7 +379,6 @@ namespace Edu.WebApi.Controllers.Course
};
deptList.Add(deptObj);
}
}
var financeModel = new
{
......@@ -378,7 +396,7 @@ namespace Edu.WebApi.Controllers.Course
PayMoney = 0,
OtherType = 53,
ReFinanceId2 = deptItem.Key,
ReFinanceId = tempList.FirstOrDefault().BatchId,
ReFinanceId = dmodel.BatchId,
Status = 1,
Fee = 0,
IsPublic = 1,//配置信息
......@@ -405,9 +423,7 @@ namespace Edu.WebApi.Controllers.Course
RB_CreateByName = userInfo.AccountName,
RB_GroupName = userInfo.GroupName,
};
financeList.Add(financeModel);
}
}
}
......@@ -416,7 +432,9 @@ namespace Edu.WebApi.Controllers.Course
{
msg = sign,
};
System.Threading.Tasks.Task.Run(() => SetFinance(resultInfo, dmodel.BatchId));
System.Threading.Tasks.Task.Run(() =>
SetFinance(resultInfo, dmodel.BatchId)
);
return ApiResult.Success("财务单据生成中,请稍后刷新查看");
}
......@@ -432,17 +450,13 @@ namespace Edu.WebApi.Controllers.Course
string resultCode = parmsJob.GetStringValue("resultCode");
string message = parmsJob.GetStringValue("message");
string frid = parmsJob.GetStringValue("data");
if (resultCode == "1" && !string.IsNullOrWhiteSpace(frid))//新增记录
{
bool result = customerCommissionModule.UdateReturnMoneyModule(frid.Trim('"'), BatchId);
}
}
#endregion
#region 员工申请提现
public ApiResult SetWithdrawal()
......
......@@ -160,7 +160,6 @@ namespace Edu.WebApi.Controllers.LearningGarden
{
int pageIndex = 1;
int pageSize = 20;
int pageCount = 0;
//获取token
string tokenKey = Cache.CacheKey.DATA_WeChatAccountToken + Common.Config.WeChatAccountAppId;
string token = Cache.WeChat.WeChatReidsCache2.GetToken(tokenKey);
......
......@@ -63,7 +63,7 @@ namespace Edu.WebApi.Controllers.User
[AllowAnonymous]
public ApiResult Test()
{
courseModule.RunCourseChapterModule();
courseModule.RunWordsUrlModule();
return ApiResult.Success();
}
......
......@@ -1448,6 +1448,7 @@ namespace Edu.WebApi.Controllers.User
extModel.ResistPoint,
extModel.ConsultingResults,
ConsultDate = extModel.ConsultDate.HasValue ? extModel.ConsultDate.Value.ToString("yyyy-MM-dd") : "",
extModel.OrderCount,
};
return ApiResult.Success(data: obj);
}
......
......@@ -38,6 +38,7 @@
"IncomeFinanceApi": "http://192.168.10.65:8083/api/Mall/InsertFinanceBatchForMallIn",
"sTenpayNotifyUrl": "http://eduapi.oytour.com/api/WeChatPay/WxPayCallback", //下单回调地址
"sTenpayNotifyRefundUrl": "http://eduapi.oytour.com/api/WeChatPay/Refunds", //退款回调地址
"SellFinanceApi": "http://127.0.0.1/api/Mall/InsertFinanceBatchForEduOut",
"FinanceDateBase": "reborn_finance",
"EduDateBase": "reborn_edu",
"JHTenantId": "15",
......
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