This commit is contained in:
parent
d36cec32ea
commit
2b9435744a
|
|
@ -30,7 +30,7 @@ namespace BLL
|
||||||
/// <param name="projectId"></param>
|
/// <param name="projectId"></param>
|
||||||
/// <param name="states"></param>
|
/// <param name="states"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static List<Model.HazardRegisterItem> getHazardRegisterByProjectIdStates(string projectId, string states, int type ,int pageIndex)
|
public static List<Model.HazardRegisterItem> getHazardRegisterByProjectIdStates(string projectId, string states, int type, int pageIndex)
|
||||||
{
|
{
|
||||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||||
{
|
{
|
||||||
|
|
@ -82,7 +82,8 @@ namespace BLL
|
||||||
Requirements = hazardRegister.Requirements,
|
Requirements = hazardRegister.Requirements,
|
||||||
|
|
||||||
Risk_Level = hazardRegister.Risk_Level,
|
Risk_Level = hazardRegister.Risk_Level,
|
||||||
HiddenType= hazardRegister.HiddenType
|
PunishPerson = hazardRegister.PunishPerson,
|
||||||
|
HiddenType = hazardRegister.HiddenType
|
||||||
|
|
||||||
};
|
};
|
||||||
var RegisterTypesDt = db.HSSE_Hazard_HazardRegisterTypes.FirstOrDefault(x => x.RegisterTypesId == newHazardRegister.RegisterTypesId);
|
var RegisterTypesDt = db.HSSE_Hazard_HazardRegisterTypes.FirstOrDefault(x => x.RegisterTypesId == newHazardRegister.RegisterTypesId);
|
||||||
|
|
@ -132,6 +133,43 @@ namespace BLL
|
||||||
else if (hazardRegister.States == Const.State_2)
|
else if (hazardRegister.States == Const.State_2)
|
||||||
{
|
{
|
||||||
APICommonService.SendSubscribeMessage(hazardRegister.CheckManId, "安全巡检待复查验收", hazardRegister.ResponsibilityManName, string.Format("{0:yyyy-MM-dd HH:mm:ss}", hazardRegister.RectificationTime));
|
APICommonService.SendSubscribeMessage(hazardRegister.CheckManId, "安全巡检待复查验收", hazardRegister.ResponsibilityManName, string.Format("{0:yyyy-MM-dd HH:mm:ss}", hazardRegister.RectificationTime));
|
||||||
|
//推送总包
|
||||||
|
var porject = BLL.ProjectService.GetProjectByProjectId(hazardRegister.ProjectId);
|
||||||
|
if (!string.IsNullOrWhiteSpace(porject.SubjectUnit) && !string.IsNullOrWhiteSpace(porject.SubjectProject))
|
||||||
|
{
|
||||||
|
var register = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(hazardRegister.HazardRegisterId);
|
||||||
|
if (register != null)
|
||||||
|
{
|
||||||
|
if (register.DataSource == "1")
|
||||||
|
{
|
||||||
|
//推送到总包
|
||||||
|
APIHazardRegisterSyncService.pushHazardRegisterLists(register.ProjectId, register.HazardRegisterId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (hazardRegister.States == Const.State_3)
|
||||||
|
{
|
||||||
|
//闭环后通过的并且有处罚人的数据添加到奖罚管理中
|
||||||
|
if (!string.IsNullOrEmpty(hazardRegister.PunishPerson))
|
||||||
|
{
|
||||||
|
Model.Check_RewardAndPunish RewardAndPunish = new Model.Check_RewardAndPunish();
|
||||||
|
RewardAndPunish.RewardAndPunishID = SQLHelper.GetNewID(typeof(Model.Check_RewardAndPunish));
|
||||||
|
RewardAndPunish.ProjectId = hazardRegister.ProjectId;
|
||||||
|
RewardAndPunish.Type = 2;
|
||||||
|
RewardAndPunish.ResponseUnit = hazardRegister.ResponsibleUnit;
|
||||||
|
RewardAndPunish.Date = hazardRegister.CheckTime;
|
||||||
|
RewardAndPunish.Description = hazardRegister.RegisterDef;
|
||||||
|
RewardAndPunish.CreateMan = hazardRegister.CheckManId;
|
||||||
|
RewardAndPunish.RewardAndPunishCode = BLL.RewardAndPunishService.getCode("1", "CF");
|
||||||
|
RewardAndPunish.RewardAndPunishMan = hazardRegister.PunishPerson;
|
||||||
|
RewardAndPunish.TeamGroupId =
|
||||||
|
BLL.PersonService.GetPersonById(hazardRegister.PunishPerson).TeamGroupId;
|
||||||
|
RewardAndPunish.DataSource = "1";
|
||||||
|
RewardAndPunish.SysTemType = "1";
|
||||||
|
RewardAndPunish.HazardRegisterId = hazardRegister.HazardRegisterId;
|
||||||
|
BLL.RewardAndPunishService.AddRewardAndPunish(RewardAndPunish);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -177,7 +215,7 @@ namespace BLL
|
||||||
ResponsibilityManName = db.Sys_User.First(User => x.ResponsibleMan == User.UserId).UserName,
|
ResponsibilityManName = db.Sys_User.First(User => x.ResponsibleMan == User.UserId).UserName,
|
||||||
RectificationTime = x.RectificationTime,
|
RectificationTime = x.RectificationTime,
|
||||||
Risk_Level = x.Risk_Level,
|
Risk_Level = x.Risk_Level,
|
||||||
HiddenType=x.HiddenType
|
HiddenType = x.HiddenType
|
||||||
|
|
||||||
}).OrderBy(x => x.CheckTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
|
}).OrderBy(x => x.CheckTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
|
||||||
return hazardRegisters;
|
return hazardRegisters;
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,12 @@ namespace BLL
|
||||||
{
|
{
|
||||||
CommonService.btnSaveData(meeting.ProjectId, Const.ProjectClassMeetingMenuId, newClassMeeting.ClassMeetingId, newClassMeeting.CompileMan, true, newClassMeeting.ClassMeetingName, "../Meeting/ClassMeetingView.aspx?ClassMeetingId={0}");
|
CommonService.btnSaveData(meeting.ProjectId, Const.ProjectClassMeetingMenuId, newClassMeeting.ClassMeetingId, newClassMeeting.CompileMan, true, newClassMeeting.ClassMeetingName, "../Meeting/ClassMeetingView.aspx?ClassMeetingId={0}");
|
||||||
}
|
}
|
||||||
|
//班前会小程序新增推送到总包
|
||||||
|
var porject = BLL.ProjectService.GetProjectByProjectId(newClassMeeting.ProjectId);
|
||||||
|
if (!string.IsNullOrWhiteSpace(porject.SubjectUnit) && !string.IsNullOrWhiteSpace(porject.SubjectProject))
|
||||||
|
{//项目关联了总包单位项目,保存成功后自动推送至总包单位
|
||||||
|
APIMeetingSyncService.PushClassMeetingLists(newClassMeeting.ProjectId, newClassMeeting.ClassMeetingId);
|
||||||
|
}
|
||||||
menuId = Const.ProjectClassMeetingMenuId;
|
menuId = Const.ProjectClassMeetingMenuId;
|
||||||
}
|
}
|
||||||
else if (meeting.MeetingType == "W")
|
else if (meeting.MeetingType == "W")
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,31 @@ namespace BLL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取最大编号
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="SysTemType"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ namespace FineUIPro.Web.CQMS.Check
|
||||||
Model.Check_RewardAndPunish RewardAndPunish = BLL.RewardAndPunishService.GetRewardAndPunishById(RewardAndPunishID);
|
Model.Check_RewardAndPunish RewardAndPunish = BLL.RewardAndPunishService.GetRewardAndPunishById(RewardAndPunishID);
|
||||||
if (RewardAndPunish != null)
|
if (RewardAndPunish != null)
|
||||||
{
|
{
|
||||||
//this.CurrUser.LoginProjectId = RewardAndPunish.ProjectId;
|
|
||||||
|
|
||||||
this.drpRewardAndPunishType.SelectedValue = RewardAndPunish.RewardAndPunishType;
|
this.drpRewardAndPunishType.SelectedValue = RewardAndPunish.RewardAndPunishType;
|
||||||
|
|
||||||
|
|
@ -169,7 +168,19 @@ namespace FineUIPro.Web.CQMS.Check
|
||||||
RewardAndPunish.Type = int.Parse(this.drpType.SelectedValue);
|
RewardAndPunish.Type = int.Parse(this.drpType.SelectedValue);
|
||||||
RewardAndPunish.ResponseUnit = this.drpResponseUnit.SelectedValue;
|
RewardAndPunish.ResponseUnit = this.drpResponseUnit.SelectedValue;
|
||||||
// RewardAndPunish.NoticeUnit = this.drpNoticeUnit.SelectedValue;
|
// RewardAndPunish.NoticeUnit = this.drpNoticeUnit.SelectedValue;
|
||||||
RewardAndPunish.Money = Decimal.Parse(this.txtMoney.Text);
|
if (!string.IsNullOrWhiteSpace(this.txtMoney.Text))
|
||||||
|
{
|
||||||
|
decimal moneyValue;
|
||||||
|
if (decimal.TryParse(this.txtMoney.Text.Trim(), out moneyValue))
|
||||||
|
{
|
||||||
|
RewardAndPunish.Money = moneyValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Alert.ShowInTop("金额必须为有效数字!", MessageBoxIcon.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
RewardAndPunish.Date = Convert.ToDateTime(this.dpDate.Text.Trim());
|
RewardAndPunish.Date = Convert.ToDateTime(this.dpDate.Text.Trim());
|
||||||
RewardAndPunish.Description = this.txtDescription.Text;
|
RewardAndPunish.Description = this.txtDescription.Text;
|
||||||
RewardAndPunish.CreateMan = this.CurrUser.UserId;
|
RewardAndPunish.CreateMan = this.CurrUser.UserId;
|
||||||
|
|
@ -231,17 +242,36 @@ namespace FineUIPro.Web.CQMS.Check
|
||||||
{
|
{
|
||||||
if (this.drpType.SelectedValue == "1")
|
if (this.drpType.SelectedValue == "1")
|
||||||
{
|
{
|
||||||
this.txtRewardAndPunishCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5",
|
// this.txtRewardAndPunishCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5",
|
||||||
"Check_RewardAndPunish", "RewardAndPunishCode", $"JL");
|
// "Check_RewardAndPunish", "RewardAndPunishCode", $"JL");
|
||||||
|
this.txtRewardAndPunishCode.Text = BLL.RewardAndPunishService.getCode(SysTemType,"JL");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.txtRewardAndPunishCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5",
|
// this.txtRewardAndPunishCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5",
|
||||||
"Check_RewardAndPunish", "RewardAndPunishCode", $"CF");
|
// "Check_RewardAndPunish", "RewardAndPunishCode", $"CF");
|
||||||
|
this.txtRewardAndPunishCode.Text = BLL.RewardAndPunishService.getCode(SysTemType,"CF");
|
||||||
}
|
}
|
||||||
drpRewardAndPunishType_Click(sender, e);
|
drpRewardAndPunishType_Click(sender, e);
|
||||||
}
|
}
|
||||||
|
protected void getCode(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++;
|
||||||
|
this.txtRewardAndPunishCode.Text = $"{type}{codeNum:D5}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.txtRewardAndPunishCode.Text = $"{type}00001";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void drpRewardAndPunishType_Click(object sender, EventArgs e)
|
protected void drpRewardAndPunishType_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -186,8 +186,7 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||||
RewardAndPunish.Date = register.CheckTime;
|
RewardAndPunish.Date = register.CheckTime;
|
||||||
RewardAndPunish.Description = register.RegisterDef;
|
RewardAndPunish.Description = register.RegisterDef;
|
||||||
RewardAndPunish.CreateMan = register.CheckManId;
|
RewardAndPunish.CreateMan = register.CheckManId;
|
||||||
RewardAndPunish.RewardAndPunishCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5",
|
RewardAndPunish.RewardAndPunishCode = BLL.RewardAndPunishService.getCode("1", "CF");//接口获取的编号
|
||||||
"Check_RewardAndPunish", "RewardAndPunishCode", $"CF");
|
|
||||||
RewardAndPunish.RewardAndPunishMan = register.PunishPerson;
|
RewardAndPunish.RewardAndPunishMan = register.PunishPerson;
|
||||||
RewardAndPunish.TeamGroupId = BLL.PersonService.GetPersonById(register.PunishPerson).TeamGroupId;
|
RewardAndPunish.TeamGroupId = BLL.PersonService.GetPersonById(register.PunishPerson).TeamGroupId;
|
||||||
RewardAndPunish.DataSource = "1";
|
RewardAndPunish.DataSource = "1";
|
||||||
|
|
|
||||||
|
|
@ -368,6 +368,14 @@ namespace Model
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 惩罚人
|
||||||
|
/// </summary>
|
||||||
|
public string PunishPerson
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 隐患类型
|
/// 隐患类型
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,13 @@ namespace WebAPI.Controllers
|
||||||
/// 拉取项目安全检查数据
|
/// 拉取项目安全检查数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Model.ResponeData getHazardRegisterLists()
|
public Model.ResponeData getHazardRegisterLists(string projectId = "")
|
||||||
{
|
{
|
||||||
var responeData = new Model.ResponeData();
|
var responeData = new Model.ResponeData();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
responeData.code = 1;
|
responeData.code = 1;
|
||||||
responeData.data = APIHazardRegisterSyncService.getHazardRegisterLists();
|
responeData.data = APIHazardRegisterSyncService.getHazardRegisterLists(projectId);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||||
<UseIISExpress>true</UseIISExpress>
|
<UseIISExpress>true</UseIISExpress>
|
||||||
<Use64BitIISExpress />
|
<Use64BitIISExpress />
|
||||||
<IISExpressSSLPort />
|
<IISExpressSSLPort />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue