Commit 88c3fb14 authored by 黄奎's avatar 黄奎

新增验证

parent 89c23fc3
......@@ -96,6 +96,14 @@ namespace Edu.WebApi.Controllers.Customer
Account = base.ParmJObj.GetStringValue("Account"),
Remark = base.ParmJObj.GetStringValue("Remark"),
};
if (string.IsNullOrEmpty(model.CustomerName))
{
return ApiResult.ParamIsNull(message: "请填写客户名称!");
}
if (string.IsNullOrEmpty(model.ContactNumber))
{
return ApiResult.ParamIsNull(message: "请填写客户联系电话!");
}
model.Status = Common.Enum.DateStateEnum.Normal;
model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
......@@ -208,6 +216,26 @@ namespace Edu.WebApi.Controllers.Customer
ExchangeEndTime = base.ParmJObj.GetDateTime("ExchangeEndTime"),
TaskFinishType = base.ParmJObj.GetInt("TaskFinishType"),
};
if (string.IsNullOrEmpty(model.TaskName))
{
return ApiResult.ParamIsNull(message: "请填写任务名称!");
}
if (string.IsNullOrEmpty(base.ParmJObj.GetStringValue("TaskStartTime")))
{
return ApiResult.ParamIsNull(message: "请选择任务开始时间!");
}
if (string.IsNullOrEmpty(base.ParmJObj.GetStringValue("TaskEndTime")))
{
return ApiResult.ParamIsNull(message: "请选择任务结束时间!");
}
if (model.TaskStartTime > model.TaskEndTime)
{
return ApiResult.ParamIsNull(message: "开始时间不能大于结束时间!");
}
if (model.TaskFinishType <= 0)
{
return ApiResult.ParamIsNull(message: "请选择任务完成类型!");
}
string taskImageList = base.ParmJObj.GetStringValue("TaskImageList");
List<string> imgList = new List<string>();
if (!string.IsNullOrEmpty(taskImageList))
......@@ -251,7 +279,6 @@ namespace Edu.WebApi.Controllers.Customer
DetailsName=jobj.GetStringValue("DetailsName"),
TaskType = (TaskTypeEnum)jobj.GetInt("TaskType"),
TargetId = string.Join(",", targetIds),
TaskFinishValue = jobj.GetDecimal("TaskFinishValue"),
TaskKudo=jobj.GetStringValue("TaskKudo"),
TaskKudoImg= JsonHelper.Serialize(imgKudoList),
......@@ -262,20 +289,8 @@ namespace Edu.WebApi.Controllers.Customer
}
if (model.DetailsList == null || (model.DetailsList != null && model.DetailsList.Count() == 0))
{
return ApiResult.ParamIsNull(message: "请添加任务类型!");
return ApiResult.ParamIsNull(message: "请添加任务完成条件!");
}
//if (model.DetailsList != null)
//{
// var groupList = model.DetailsList.GroupBy(qitem => new { qitem.TaskType })
// .Select(qitem => new { qitem.Key.TaskType, TaskTypeCount = qitem.Count() });
// foreach (var item in groupList)
// {
// if (item.TaskTypeCount > 1)
// {
// return ApiResult.ParamIsNull(message: $"已经存在【{item.TaskType.ToName()}】类型,请重新选择!");
// }
// }
//}
foreach (var item in model.DetailsList)
{
switch (item.TaskType)
......@@ -351,10 +366,6 @@ namespace Edu.WebApi.Controllers.Customer
Description=base.ParmJObj.GetStringValue("Description"),
};
var list = balanceDetailModule.GetCustomerBalanceDetailPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
}
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
......@@ -381,10 +392,6 @@ namespace Edu.WebApi.Controllers.Customer
ExchangeStatus=base.ParmJObj.GetInt("ExchangeStatus"),
};
var list = taskModule.GetCustomerFinishtaskPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
}
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
......
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