@@ -58,9 +58,9 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
@@ -74,6 +74,7 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = fualityReportMainIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
@@ -19,11 +19,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<QualityReportMainEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
@@ -44,10 +44,10 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
} | |||
/// <summary> | |||
/// 获取QualityReportMain表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
/// 获取QualityReportMain表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public QualityReportMainEntity GetQualityReportMainEntity(string keyValue) | |||
{ | |||
try | |||
@@ -119,6 +119,51 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
} | |||
} | |||
/// <summary> | |||
/// 项目删除,将状态改为作废 | |||
/// </summary> | |||
/// <param name="FillinFromId">项目Id</param> | |||
public void DelProjectByFId(string FillinFromId) | |||
{ | |||
try | |||
{ | |||
qualityReportMainService.DelProjectByFId(FillinFromId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 项目删除,将状态改为作废 | |||
/// </summary> | |||
/// <param name="FillinFromId">项目Id</param> | |||
public void EditProjectByFId(string FillinFromId) | |||
{ | |||
try | |||
{ | |||
qualityReportMainService.EditProjectByFId(FillinFromId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} |
@@ -42,6 +42,19 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, QualityReportMainEntity entity); | |||
/// <summary> | |||
/// 项目删除,将状态改为作废 | |||
/// </summary> | |||
/// <param name="FillinFromId"></param> | |||
void DelProjectByFId(string FillinFromId); | |||
/// <summary> | |||
/// 项目编辑,将状态改为草稿 | |||
/// </summary> | |||
/// <param name="FillinFromId"></param> | |||
void EditProjectByFId(string FillinFromId); | |||
#endregion | |||
} |
@@ -32,7 +32,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
var strSql = new StringBuilder(); | |||
strSql.Append(@"select b.WorderModule,b.ProjectName,b.FillingDept,b.Id as fid,a.Id,a.ReportTime,a.Status,a.Result,a.CreateUserName from QualityReportMain a join FillinFrom b on a.FillinFromId=b.Id | |||
"); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
@@ -136,6 +136,75 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
} | |||
} | |||
/// <summary> | |||
/// 项目删除,将状态改为作废 | |||
/// </summary> | |||
/// <param name="FillinFromId">项目Id</param> | |||
public void DelProjectByFId(string FillinFromId) | |||
{ | |||
try | |||
{ | |||
UpdateStatusByFId(FillinFromId, 99); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 项目编辑,将状态改为草稿 | |||
/// </summary> | |||
/// <param name="FillinFromId">项目Id</param> | |||
public void EditProjectByFId(string FillinFromId) | |||
{ | |||
try | |||
{ | |||
UpdateStatusByFId(FillinFromId, 0); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 修改上报记录为作废状态 | |||
/// </summary> | |||
/// <param name="FillinFromId">项目Id</param> | |||
private void UpdateStatusByFId(string FillinFromId,int Status) | |||
{ | |||
try | |||
{ | |||
string sql = $"update QualityReportMain set [Status]='{Status}' where FillinFromId='{FillinFromId}'"; | |||
this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} |