修改质量接口
This commit is contained in:
@@ -183,6 +183,8 @@ namespace WebAPI.Controllers
|
||||
return res;
|
||||
}
|
||||
|
||||
///获取单位接口 Unit/getProjectUnitLists(projectId)
|
||||
|
||||
/// <summary>
|
||||
/// 获取主持人信息
|
||||
/// </summary>
|
||||
@@ -240,6 +242,25 @@ namespace WebAPI.Controllers
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据是否同意获取办理步骤
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getChangeHandle(bool isAgree)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = isAgree == true ? Const.CQMSMeeting_Complete : Const.CQMSMeeting_ReCompile;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据办理步骤获取办理人
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量样板
|
||||
/// </summary>
|
||||
public class CQMSModelsController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据项目id获取质量样板列表集合
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Model_QualityModel>> getModelsList(string projectId, int index, int page)
|
||||
{
|
||||
ResponseData<List<Model_QualityModel>> res = new ResponseData<List<Model_QualityModel>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.QualityModelService.getListDataForApi(projectId, index, page);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据id获取质量样板详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<Model_QualityModel> GetModelsById(string id)
|
||||
{
|
||||
ResponseData<Model_QualityModel> res = new ResponseData<Model_QualityModel>();
|
||||
Model_QualityModel cd = BLL.QualityModelService.GetQualityModelById(id);
|
||||
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<Model_QualityModel>(cd, true);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存质量样板
|
||||
/// </summary>
|
||||
/// <param name="trainPlan"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ResponseData<string> AddModels([FromBody] Model.Model_QualityModel models)
|
||||
{
|
||||
ResponseData<string> res = new ResponseData<string>();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(models.QualityModelId))
|
||||
{
|
||||
models.QualityModelId = Guid.NewGuid().ToString();
|
||||
BLL.QualityModelService.AddQualityModelForApi(models);
|
||||
SaveAttachFile(models.QualityModelId, BLL.Const.QualityModelMenuId, models.AttachUrl);
|
||||
res.resultValue = models.QualityModelId;
|
||||
res.successful = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
BLL.QualityModelService.UpdateQualityModelForApi(models);
|
||||
SaveAttachFile(models.QualityModelId, BLL.Const.QualityModelMenuId, models.AttachUrl);
|
||||
res.resultValue = models.QualityModelId;
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace WebAPI.Controllers
|
||||
public class CQMSRewardAndPunishController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据项目id获取质量会议列表集合
|
||||
/// 根据项目id获取质量奖罚列表集合
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="index"></param>
|
||||
@@ -17,12 +17,268 @@ namespace WebAPI.Controllers
|
||||
/// <param name="type">0-全部,1-奖励,2-处罚</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<RewardAndPunish_RewardAndPunish>> getMeetingList(string projectId, int index, int page, string type)
|
||||
public ResponseData<List<RewardAndPunish_RewardAndPunish>> getRewardAndPunishList(string projectId, int index, int page, string type)
|
||||
{
|
||||
ResponseData<List<RewardAndPunish_RewardAndPunish>> res = new ResponseData<List<RewardAndPunish_RewardAndPunish>>();
|
||||
res.successful = true;
|
||||
//res.resultValue = BLL.RewardAndPunishService.getListDataForApi(projectId, index, page, type);
|
||||
res.resultValue = BLL.RewardAndPunishService.getListDataForApi(projectId, index, page, type);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据id获取质量奖罚详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<RewardAndPunish_RewardAndPunish> GetRewardAndPunishByRewardAndPunishId(string id)
|
||||
{
|
||||
ResponseData<RewardAndPunish_RewardAndPunish> res = new ResponseData<RewardAndPunish_RewardAndPunish>();
|
||||
RewardAndPunish_RewardAndPunish cd = BLL.RewardAndPunishService.GetRewardAndPunishByRewardAndPunishIdForApi(id);
|
||||
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<RewardAndPunish_RewardAndPunish>(cd, true);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据id获取审核记录集合
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public ResponseData<List<RewardAndPunish_RewardAndPunishApprove>> GetApproveById(string id)
|
||||
{
|
||||
ResponseData<List<RewardAndPunish_RewardAndPunishApprove>> res = new ResponseData<List<RewardAndPunish_RewardAndPunishApprove>>();
|
||||
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.RewardAndPunishApproveService.GetListDataByIdForApi(id);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据id获取当前办理人审批信息
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public ResponseData<RewardAndPunish_RewardAndPunishApprove> GetCurrApproveById(string id)
|
||||
{
|
||||
ResponseData<RewardAndPunish_RewardAndPunishApprove> res = new ResponseData<RewardAndPunish_RewardAndPunishApprove>();
|
||||
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<RewardAndPunish_RewardAndPunishApprove>(BLL.RewardAndPunishApproveService.getCurrApproveForApi(id), true);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存奖罚主表信息
|
||||
/// </summary>
|
||||
/// <param name="rewardAndPunish"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ResponseData<string> AddRewardAndPunish([FromBody] Model.RewardAndPunish_RewardAndPunish rewardAndPunish)
|
||||
{
|
||||
ResponseData<string> res = new ResponseData<string>();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(rewardAndPunish.RewardAndPunishId))
|
||||
{
|
||||
rewardAndPunish.RewardAndPunishId = Guid.NewGuid().ToString();
|
||||
BLL.RewardAndPunishService.AddRewardAndPunishForApi(rewardAndPunish);
|
||||
SaveAttachFile(rewardAndPunish.RewardAndPunishId, BLL.Const.RewardAndPunishMenuId, rewardAndPunish.AttachUrl);
|
||||
res.resultValue = rewardAndPunish.RewardAndPunishId;
|
||||
}
|
||||
else
|
||||
{
|
||||
BLL.RewardAndPunishService.UpdateRewardAndPunishForApi(rewardAndPunish);
|
||||
SaveAttachFile(rewardAndPunish.RewardAndPunishId, BLL.Const.RewardAndPunishMenuId, rewardAndPunish.AttachUrl);
|
||||
res.resultValue = rewardAndPunish.RewardAndPunishId;
|
||||
}
|
||||
|
||||
res.successful = true;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
res.resultHint = e.StackTrace;
|
||||
res.successful = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
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>
|
||||
/// <param name="approve"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ResponseData<string> AddApprove([FromBody] Model.RewardAndPunish_RewardAndPunishApprove approve)
|
||||
{
|
||||
ResponseData<string> res = new ResponseData<string>();
|
||||
try
|
||||
{
|
||||
Model.RewardAndPunish_RewardAndPunish RewardAndPunish = new Model.RewardAndPunish_RewardAndPunish();
|
||||
RewardAndPunish.RewardAndPunishId = approve.RewardAndPunishId;
|
||||
RewardAndPunish.State = approve.ApproveType;
|
||||
BLL.RewardAndPunishService.UpdateRewardAndPunishForApi(RewardAndPunish);
|
||||
res.resultValue = BLL.RewardAndPunishApproveService.AddRewardAndPunishApproveForApi(approve);
|
||||
res.successful = true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
res.resultHint = e.StackTrace;
|
||||
res.successful = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新办理信息
|
||||
/// </summary>
|
||||
/// <param name="approve"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ResponseData<string> UpdateApprove([FromBody] Model.RewardAndPunish_RewardAndPunishApprove approve)
|
||||
{
|
||||
ResponseData<string> res = new ResponseData<string>();
|
||||
try
|
||||
{
|
||||
approve.ApproveDate = DateTime.Now;
|
||||
BLL.RewardAndPunishApproveService.UpdateRewardAndPunishApproveForApi(approve);
|
||||
res.successful = true;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
res.resultHint = e.StackTrace;
|
||||
res.successful = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
///获取奖罚对象接口 Unit/getUnitByProjectIdUnitType(projectId,"2")
|
||||
|
||||
/// <summary>
|
||||
/// 根据奖励或处罚获取奖罚事由
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getCause(string type)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getRewardAndPunishCause(type);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据奖罚事由Id获取奖罚决定
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getRewardAndPunishDecision(string typeId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
string rewardAndPunishDecision = string.Empty;
|
||||
Model.Base_RewardType rt = BLL.RewardTypeService.GetRewardTypeById(typeId);
|
||||
Model.Base_PunishType pt = BLL.PunishTypeService.GetPunishTypeById(typeId);
|
||||
if (rt != null)
|
||||
{
|
||||
rewardAndPunishDecision = rt.RewardDecision;
|
||||
}
|
||||
else if (pt != null)
|
||||
{
|
||||
rewardAndPunishDecision = pt.PunishDecision;
|
||||
}
|
||||
responeData.data = rewardAndPunishDecision;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据状态获取办理步骤 0-重新编制,1-编制,2-质量经理审核,3-项目经理批准,C-审批完成
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getHandleListByState(string state)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = RewardAndPunishService.GetDHandleTypeByStateForApi(state);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据是否同意和当前主表状态获取办理步骤
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getChangeHandle(bool isAgree,string state)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
if (state == Const.RewardAndPunish_Audit2)
|
||||
{
|
||||
responeData.data = isAgree == true ? Const.RewardAndPunish_Complete : Const.RewardAndPunish_ReCompile;
|
||||
}
|
||||
else if (state == Const.RewardAndPunish_Audit1)
|
||||
{
|
||||
responeData.data = isAgree == true ? Const.RewardAndPunish_Audit2 : Const.RewardAndPunish_ReCompile;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据办理步骤获取办理人
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getHandleManListByState(string state, string id, string projectId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = RewardAndPunishService.GetHandleManListForApi(state, id, projectId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +168,7 @@
|
||||
<Compile Include="Controllers\BaseInfoController.cs" />
|
||||
<Compile Include="Controllers\CommonController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSMeetingController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSModelsController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSPersonManageController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSPlanController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSRewardAndPunishController.cs" />
|
||||
|
||||
Reference in New Issue
Block a user