修改质量接口
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量会议
|
||||
/// </summary>
|
||||
public class CQMSMeetingController : ApiController
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量计划
|
||||
/// </summary>
|
||||
public class CQMSPlanController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据项目id获取总包质量计划列表集合
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Plan_MainPlan>> getMainPlanList(string projectId, int index, int page)
|
||||
{
|
||||
ResponseData<List<Plan_MainPlan>> res = new ResponseData<List<Plan_MainPlan>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.CQMS_MainPlanService.getListDataForApi(projectId, index, page);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目id获取分包质量计划列表集合
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Plan_SubPlan>> getSubPlanList(string projectId, int index, int page)
|
||||
{
|
||||
ResponseData<List<Plan_SubPlan>> res = new ResponseData<List<Plan_SubPlan>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.CQMS_SubPlanService.getListDataForApi(projectId, index, page);
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id获取总包质量计划详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<Plan_MainPlan> GetMainPlanByMainPlanId(string id)
|
||||
{
|
||||
ResponseData<Plan_MainPlan> res = new ResponseData<Plan_MainPlan>();
|
||||
Plan_MainPlan cd = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanIdForApi(id);
|
||||
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<Plan_MainPlan>(cd, true);
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id获取分包质量计划详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<Plan_SubPlan> GetSubPlanBySubPlanId(string id)
|
||||
{
|
||||
ResponseData<Plan_SubPlan> res = new ResponseData<Plan_SubPlan>();
|
||||
Plan_SubPlan cd = BLL.CQMS_SubPlanService.GetSubPlanBySubPlanIdForApi(id);
|
||||
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<Plan_SubPlan>(cd, true);
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id获取总包质量计划审批明细
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Plan_MainPlanApprove>> GetMainPlanApproveById(string id)
|
||||
{
|
||||
ResponseData<List<Plan_MainPlanApprove>> res = new ResponseData<List<Plan_MainPlanApprove>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.CQMS_MainPlanApproveService.getApproveListDataByIdForApi(id);
|
||||
return res;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id获取分包质量计划审批明细
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Plan_SubPlanApprove>> GetSubPlanApproveById(string id)
|
||||
{
|
||||
ResponseData<List<Plan_SubPlanApprove>> res = new ResponseData<List<Plan_SubPlanApprove>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.CQMS_SubPlanApproveService.getApproveListDataByIdForApi(id);
|
||||
return res;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量培训计划
|
||||
/// </summary>
|
||||
public class CQMSTrainController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据项目id获取质量培训列表集合
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Train_TrainPlan>> getTrainPlanList(string projectId, int index, int page)
|
||||
{
|
||||
ResponseData<List<Train_TrainPlan>> res = new ResponseData<List<Train_TrainPlan>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.CQMS_TrainPlanService.getListDataForApi(projectId, index, page);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据id获取质量培训详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<Train_TrainPlan> GetTrainPlanByTrainPlanId(string id)
|
||||
{
|
||||
ResponseData<Train_TrainPlan> res = new ResponseData<Train_TrainPlan>();
|
||||
Train_TrainPlan cd = BLL.CQMS_TrainPlanService.GetTraiPlanByTrainPlanIdForApi(id);
|
||||
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<Train_TrainPlan>(cd, true);
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存质量培训
|
||||
/// </summary>
|
||||
/// <param name="trainPlan"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ResponseData<string> AddTrainPlan([FromBody] Model.Train_TrainPlan trainPlan)
|
||||
{
|
||||
ResponseData<string> res = new ResponseData<string>();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(trainPlan.TrainPlanId))
|
||||
{
|
||||
trainPlan.TrainPlanId = Guid.NewGuid().ToString();
|
||||
BLL.CQMS_TrainPlanService.AddTrainPlanForApi(trainPlan);
|
||||
SaveAttachFile(trainPlan.TrainPlanId, BLL.Const.CQMSTrainPlanMenuId, trainPlan.AttachUrl);
|
||||
res.resultValue = trainPlan.TrainPlanId;
|
||||
res.successful = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
BLL.CQMS_TrainPlanService.UpdateTrainPlanForApi(trainPlan);
|
||||
SaveAttachFile(trainPlan.TrainPlanId, BLL.Const.CQMSTrainPlanMenuId, trainPlan.AttachUrl);
|
||||
res.resultValue = trainPlan.TrainPlanId;
|
||||
res.successful = true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
res.successful = false;
|
||||
res.resultHint = e.StackTrace;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static void SaveAttachFile(string dataId, string menuId, string url)
|
||||
{
|
||||
Model.ToDoItem toDoItem = new Model.ToDoItem
|
||||
{
|
||||
MenuId = menuId,
|
||||
DataId = dataId,
|
||||
UrlStr = url,
|
||||
};
|
||||
APIUpLoadFileService.SaveAttachUrl(toDoItem);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取培训对象列表信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getPlanTrainPersons()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getPlanTrainPersons();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取培训类别列表信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getTrainType()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getCQMSTrainType();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取培训主持人信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getHostMan(string projectId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getCQMSTrainHostMan(projectId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取参与培训教育人员信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getRealTrainPersons(string projectId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getRealTrainPersons(projectId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user