diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekBLL.cs new file mode 100644 index 000000000..385fd2877 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekBLL.cs @@ -0,0 +1,249 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 数字化智慧校园 + /// Copyright (c) 2013-2020 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2024-12-18 14:13 + /// 描 述:DepartmentWeek + /// + public class DepartmentWeekBLL : DepartmentWeekIBLL + { + private DepartmentWeekService departmentWeekService = new DepartmentWeekService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return departmentWeekService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取DepartmentWeek表实体数据 + /// + /// 主键 + /// + public DepartmentWeekEntity GetDepartmentWeekEntity(string keyValue) + { + try + { + return departmentWeekService.GetDepartmentWeekEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取DepartmentWeek表实体数据 + /// + /// 主键 + /// + public IEnumerable GetDetail(string keyValue, string types) + { + try + { + return departmentWeekService.GetDetail(keyValue, types); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public DepartmentWeekEntity GetEntityByProcessId(string processId) + { + try + { + return departmentWeekService.GetEntityByProcessId(processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + departmentWeekService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, DepartmentWeekEntity entity) + { + try + { + departmentWeekService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, DepartmentWeekEntity entity, List Firset, List Second) + { + try + { + departmentWeekService.SaveEntity(keyValue, entity, Firset, Second); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void ChangeStatusById(string keyValue, int status, string processId) + { + try + { + departmentWeekService.ChangeStatusById(keyValue, status, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + public void ChangeStatusByProcessId(int status, string processId) + { + try + { + departmentWeekService.ChangeStatusByProcessId(status, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public void PushEntity() + { + try + { + departmentWeekService.PushEntity(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekEntity.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekEntity.cs new file mode 100644 index 000000000..d129705aa --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekEntity.cs @@ -0,0 +1,98 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 数字化智慧校园 + /// Copyright (c) 2013-2020 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2024-12-18 14:13 + /// 描 述:DepartmentWeek + /// + public class DepartmentWeekEntity + { + #region 实体成员 + /// + /// ID + /// + [Column("ID")] + public string ID { get; set; } + /// + /// Title + /// + [Column("TITLE")] + public string Title { get; set; } + /// + /// Firset + /// + [Column("FIRSET")] + public string Firset { get; set; } + /// + /// Second + /// + [Column("SECOND")] + public string Second { get; set; } + /// + /// Remark + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// CreateTime + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// CreateUser + /// + [Column("CREATEUSER")] + public string CreateUser { get; set; } + /// + /// ProcessId + /// + [Column("PROCESSID")] + public string ProcessId { get; set; } + /// + /// STATUS + /// + [Column("STATUS")] + public int? Status { get; set; } + /// + /// Department + /// + [Column("DEPARTMENT")] + public String Department { get; set; } + /// + /// Week + /// + [Column("WEEK")] + public String Week { get; set; } + + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.ID = Guid.NewGuid().ToString(); + this.Status = 0; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.ID = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekIBLL.cs new file mode 100644 index 000000000..0150606a1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekIBLL.cs @@ -0,0 +1,70 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 数字化智慧校园 + /// Copyright (c) 2013-2020 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2024-12-18 14:13 + /// 描 述:DepartmentWeek + /// + public interface DepartmentWeekIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取DepartmentWeek表实体数据 + /// + /// 主键 + /// + DepartmentWeekEntity GetDepartmentWeekEntity(string keyValue); + IEnumerable GetDetail(string keyValue, string types); + + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + DepartmentWeekEntity GetEntityByProcessId(string processId); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, DepartmentWeekEntity entity); + + + void SaveEntity(string keyValue, DepartmentWeekEntity entity, List First, List Second); + /// + /// 推送 + /// + /// + void PushEntity(); + /// + /// 提交 + /// + void ChangeStatusById(string keyValue, int status, string processId); + void ChangeStatusByProcessId(int status, string processId); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekService.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekService.cs new file mode 100644 index 000000000..f4093dffe --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/DepartmentWeek/DepartmentWeekService.cs @@ -0,0 +1,360 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 数字化智慧校园 + /// Copyright (c) 2013-2020 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2024-12-18 14:13 + /// 描 述:DepartmentWeek + /// + public class DepartmentWeekService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" t.* "); + strSql.Append(" FROM DepartmentWeek t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["CreateUser"].IsEmpty()) + { + dp.Add("CreateUser", queryParam["CreateUser"].ToString(), DbType.String); + strSql.Append(" AND t.CreateUser = @CreateUser "); + } + if (!queryParam["Department"].IsEmpty()) + { + dp.Add("Department", queryParam["Department"].ToString(), DbType.String); + strSql.Append(" AND t.Department = @Department "); + } + if (!queryParam["Week"].IsEmpty()) + { + dp.Add("Week", queryParam["Week"].ToString(), DbType.String); + strSql.Append(" AND t.Week = @Week "); + } + + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取DepartmentWeek表实体数据 + /// + /// 主键 + /// + public DepartmentWeekEntity GetDepartmentWeekEntity(string keyValue) + { + try + { + return this.BaseRepository().FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取StuInfoFreshEmergePeople表数据 + /// + /// + public IEnumerable GetDetail(string keyValue, string Types) + { + try + { + return this.BaseRepository().FindList(t => t.DWeekID == keyValue && t.Types == Types); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public DepartmentWeekEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository().FindEntity(t => t.ProcessId == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + var db = this.BaseRepository().BeginTrans(); + try + { + var id = keyValue.Split(','); + foreach (var item in id) + { + db.Delete(t => t.ID == item); + db.Delete(t => t.DWeekID == item); + db.Commit(); + } + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, DepartmentWeekEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository().Update(entity); + } + else + { + entity.Create(); + this.BaseRepository().Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public void SaveEntity(string keyValue, DepartmentWeekEntity entity, List First, List Second) + { + var db = this.BaseRepository().BeginTrans(); + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + var up = GetDepartmentWeekEntity(keyValue); + entity.Modify(keyValue); + db.Update(entity); + db.Delete(t => t.DWeekID == up.ID); + if (null != First && null != Second) + { + foreach (DepartmentWeekDetailEntity item in First) + { + item.Create(); + item.DWeekID = up.ID; + item.Types = "1"; + item.CreateTime = DateTime.Now; + db.Insert(item); + } + db.Delete(t => t.DWeekID == up.ID); + foreach (DepartmentWeekDetailEntity item in Second) + { + item.Create(); + item.DWeekID = up.ID; + item.Types = "2"; + item.CreateTime = DateTime.Now; + db.Insert(item); + } + } + } + else + { + entity.Create(); + db.Insert(entity); + if (null != First && null != Second) + { + foreach (DepartmentWeekDetailEntity item in First) + { + item.Create(); + item.DWeekID = entity.ID; + item.Types = "1"; + item.CreateTime = DateTime.Now; + db.Insert(item); + } + + foreach (DepartmentWeekDetailEntity item in Second) + { + item.Create(); + item.DWeekID = entity.ID; + item.Types = "2"; + item.CreateTime = DateTime.Now; + db.Insert(item); + } + } + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 推送 + /// + /// + public void PushEntity() + { + var db = this.BaseRepository().BeginTrans(); + try + { + //var id = keyValue.Split(','); + //foreach (var item in id) + //{ + // db.ExecuteBySql("update DepartmentWeek set Status='3' where ID = '" + item + "'"); + //} + db.ExecuteBySql("update DepartmentWeek set Status='3' where Status = '2' "); + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// + /// + /// + /// + public void ChangeStatusByProcessId(int status, string processId) + { + try + { + this.BaseRepository().ExecuteBySql($"update DepartmentWeek set Status='{status}' where processId='{processId}'"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 提交 + /// + /// + /// + /// + public void ChangeStatusById(string keyValue, int status, string processId) + { + try + { + this.BaseRepository().ExecuteBySql($"update DepartmentWeek set Status='{status}',processId='{processId}' where ID='{keyValue}'"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DepartmentWeek/DepartmentWeekEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DepartmentWeek/DepartmentWeekEntity.cs index d129705aa..bcd70887c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DepartmentWeek/DepartmentWeekEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DepartmentWeek/DepartmentWeekEntity.cs @@ -16,7 +16,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #region 实体成员 /// /// ID - /// + /// [Column("ID")] public string ID { get; set; } ///