This commit is contained in:
geh
2026-03-23 15:22:29 +08:00
parent 94584d242b
commit c38590add8
173 changed files with 19679 additions and 4413 deletions
@@ -34,6 +34,15 @@ namespace BLL
newRewardAndPunish.Money = RewardAndPunish.Money;
newRewardAndPunish.Type = RewardAndPunish.Type;
newRewardAndPunish.ResponseUnit = RewardAndPunish.ResponseUnit;
newRewardAndPunish.NoticeUnit = RewardAndPunish.NoticeUnit;
newRewardAndPunish.RewardAndPunishType = RewardAndPunish.RewardAndPunishType;
newRewardAndPunish.RewardAndPunishCode = RewardAndPunish.RewardAndPunishCode;
newRewardAndPunish.RewardAndPunishMan = RewardAndPunish.RewardAndPunishMan;
newRewardAndPunish.TeamGroupId = RewardAndPunish.TeamGroupId;
newRewardAndPunish.Remark = RewardAndPunish.Remark;
newRewardAndPunish.DataSource = RewardAndPunish.DataSource;
newRewardAndPunish.HazardRegisterId = RewardAndPunish.HazardRegisterId;
newRewardAndPunish.SysTemType = RewardAndPunish.SysTemType;
db.Check_RewardAndPunish.InsertOnSubmit(newRewardAndPunish);
db.SubmitChanges();
}
@@ -56,6 +65,15 @@ namespace BLL
newRewardAndPunish.Money = RewardAndPunish.Money;
newRewardAndPunish.Type = RewardAndPunish.Type;
newRewardAndPunish.ResponseUnit = RewardAndPunish.ResponseUnit;
newRewardAndPunish.NoticeUnit = RewardAndPunish.NoticeUnit;
newRewardAndPunish.RewardAndPunishType = RewardAndPunish.RewardAndPunishType;
newRewardAndPunish.RewardAndPunishCode = RewardAndPunish.RewardAndPunishCode;
newRewardAndPunish.RewardAndPunishMan = RewardAndPunish.RewardAndPunishMan;
newRewardAndPunish.TeamGroupId = RewardAndPunish.TeamGroupId;
newRewardAndPunish.Remark = RewardAndPunish.Remark;
newRewardAndPunish.DataSource = RewardAndPunish.DataSource;
newRewardAndPunish.HazardRegisterId = RewardAndPunish.HazardRegisterId;
newRewardAndPunish.SysTemType = RewardAndPunish.SysTemType;
db.SubmitChanges();
}
@@ -87,6 +105,39 @@ namespace BLL
dropName.DataBind();
Funs.FineUIPleaseSelect(dropName);
}
/// <summary>
/// 根据巡检主键删除
/// </summary>
/// <param name="checkerId"></param>
public static void DeleteRewardAndPunishByHazardRegisterId(string HazardRegisterId)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Check_RewardAndPunish RewardAndPunish = db.Check_RewardAndPunish.FirstOrDefault(e => e.HazardRegisterId == HazardRegisterId);
if (RewardAndPunish != null)
{
db.Check_RewardAndPunish.DeleteOnSubmit(RewardAndPunish);
db.SubmitChanges();
}
}
public static string getCode(string SysTemType, string type)
{
var maxCode = Funs.DB.Check_RewardAndPunish
.Where(x => x.SysTemType == SysTemType && x.RewardAndPunishCode.Contains(type))
.Max(x => x.RewardAndPunishCode);
if (maxCode != null)
{
//取最后5 位
var code = maxCode.Substring(maxCode.Length - 5);
var codeNum = int.Parse(code);
codeNum++;
return $"{type}{codeNum:D5}";
}
else
{
return $"{type}00001";
}
}
}
}
@@ -0,0 +1,153 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 质量会议
/// </summary>
public class MeetingService
{
public static Model.SUBQHSEDB db = Funs.DB;
/// <summary>
/// 根据主键获取质量会议
/// </summary>
/// <param name="weekMeetingId"></param>
/// <returns></returns>
public static Model.CQMS_Meeting GetMeetingById(string meetingId)
{
return db.CQMS_Meeting.FirstOrDefault(e => e.MeetingId == meetingId);
}
/// <summary>
/// 根据时间段获取质量会议集合
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static int GetCountByTime(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.CQMS_Meeting where x.MeetingDate >= startTime && x.MeetingDate < endTime && x.ProjectId == projectId && x.States == BLL.Const.State_2 select x).Count();
}
/// <summary>
/// 根据时间段获取质量会议参会人数
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static int? GetSumAttentPersonNumByMeetingDate(DateTime startTime, DateTime endTime, string projectId)
{
int? sumAttentPersonNum = (from x in Funs.DB.CQMS_Meeting where x.MeetingDate >= startTime && x.MeetingDate < endTime && x.ProjectId == projectId && x.States == BLL.Const.State_2 select x.AttentPersonNum).Sum();
if (sumAttentPersonNum == null)
{
return 0;
}
return sumAttentPersonNum;
}
/// <summary>
/// 根据日期和类型获取会议记录集合
/// </summary>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <param name="projectId">项目号</param>
/// <returns>会议记录集合</returns>
public static List<Model.CQMS_Meeting> GetMeetingListsByDate(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.CQMS_Meeting where x.MeetingDate >= startTime && x.MeetingDate <= endTime && x.ProjectId == projectId orderby x.MeetingDate select x).ToList();
}
/// <summary>
/// 添加质量会议
/// </summary>
/// <param name="meeting"></param>
public static void AddMeeting(Model.CQMS_Meeting meeting)
{
Model.SUBQHSEDB db = Funs.DB;
Model.CQMS_Meeting newMeeting = new Model.CQMS_Meeting
{
MeetingId = meeting.MeetingId,
ProjectId = meeting.ProjectId,
UnitId = meeting.UnitId,
MeetingCode = meeting.MeetingCode,
MeetingName = meeting.MeetingName,
MeetingDate = meeting.MeetingDate,
CompileMan = meeting.CompileMan,
MeetingContents = meeting.MeetingContents,
CompileDate = meeting.CompileDate,
States = meeting.States,
AttentPersonNum = meeting.AttentPersonNum,
MeetingHours = meeting.MeetingHours,
MeetingHostMan = meeting.MeetingHostMan,
AttentPerson = meeting.AttentPerson,
MeetingPlace = meeting.MeetingPlace,
MeetingHostManId = meeting.MeetingHostManId,
AttentPersonIds = meeting.AttentPersonIds,
MeetingHostManOther = meeting.MeetingHostManOther
};
db.CQMS_Meeting.InsertOnSubmit(newMeeting);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.CQMS_MeetingMenuId, meeting.ProjectId, null, meeting.MeetingId, meeting.CompileDate);
}
/// <summary>
/// 修改质量会议
/// </summary>
/// <param name="meeting"></param>
public static void UpdateMeeting(Model.CQMS_Meeting meeting)
{
Model.SUBQHSEDB db = Funs.DB;
Model.CQMS_Meeting newMeeting = db.CQMS_Meeting.FirstOrDefault(e => e.MeetingId == meeting.MeetingId);
if (newMeeting != null)
{
//newWeekMeeting.ProjectId = weekMeeting.ProjectId;
newMeeting.UnitId = meeting.UnitId;
newMeeting.MeetingCode = meeting.MeetingCode;
newMeeting.MeetingName = meeting.MeetingName;
newMeeting.MeetingDate = meeting.MeetingDate;
newMeeting.CompileMan = meeting.CompileMan;
newMeeting.MeetingContents = meeting.MeetingContents;
newMeeting.CompileDate = meeting.CompileDate;
newMeeting.States = meeting.States;
newMeeting.AttentPersonNum = meeting.AttentPersonNum;
newMeeting.MeetingHours = meeting.MeetingHours;
newMeeting.MeetingHostMan = meeting.MeetingHostMan;
newMeeting.AttentPerson = meeting.AttentPerson;
newMeeting.MeetingPlace = meeting.MeetingPlace;
newMeeting.MeetingHostManId = meeting.MeetingHostManId;
newMeeting.AttentPersonIds = meeting.AttentPersonIds;
newMeeting.MeetingHostManOther = meeting.MeetingHostManOther;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除质量会议
/// </summary>
/// <param name="meetingId"></param>
public static void DeleteMeetingById(string meetingId)
{
Model.SUBQHSEDB db = Funs.DB;
Model.CQMS_Meeting meeting = db.CQMS_Meeting.FirstOrDefault(e => e.MeetingId == meetingId);
if (meeting != null)
{
///删除编码表记录
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(meeting.MeetingId);
////删除附件表
BLL.CommonService.DeleteAttachFileById(meeting.MeetingId);
////删除流程表
BLL.CommonService.DeleteFlowOperateByID(meeting.MeetingId);
db.CQMS_Meeting.DeleteOnSubmit(meeting);
db.SubmitChanges();
}
}
}
}