Commit d5f566ad authored by liudong1993's avatar liudong1993

1

parent f3279cea
...@@ -8037,6 +8037,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8037,6 +8037,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
//查询未填写 //查询未填写
int Number = oKR_ObjectiveRepository.GetNotFilledList(userInfo.Group_Id, periodId, userIds); int Number = oKR_ObjectiveRepository.GetNotFilledList(userInfo.Group_Id, periodId, userIds);
if (TotalNum - Number > 0)
{
RList.Add(new RList.Add(new
{ {
Id = Num, Id = Num,
...@@ -8049,10 +8051,13 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8049,10 +8051,13 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}); });
Num++; Num++;
} }
}
if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.NotAlign).Any() && (SValue == 0 || (SValue > 0 && SDays >= SValue))) if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.NotAlign).Any() && (SValue == 0 || (SValue > 0 && SDays >= SValue)))
{ {
//查询未对齐 //查询未对齐
int Number = oKR_ObjectiveRepository.GetAlignPeopleNum(userInfo.Group_Id, periodId, userIds); int Number = oKR_ObjectiveRepository.GetAlignPeopleNum(userInfo.Group_Id, periodId, userIds);
if (TotalNum - Number > 0)
{
RList.Add(new RList.Add(new
{ {
Id = Num, Id = Num,
...@@ -8065,6 +8070,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8065,6 +8070,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}); });
Num++; Num++;
} }
}
if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.NotUpdated).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue))) if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.NotUpdated).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue)))
{ {
//查询未更新 //查询未更新
...@@ -8083,13 +8089,15 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8083,13 +8089,15 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.NotScore).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue))) if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.NotScore).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue)))
{ {
//查询未打分 //查询未打分
int Number = oKR_ObjectiveRepository.GetNotScoreList(userInfo.Group_Id, periodId, userIds); int Number = oKR_ObjectiveRepository.GetNotScoreList(userInfo.Group_Id, periodId, userIds, 2);
if (TotalNum - Number > 0)
{
RList.Add(new RList.Add(new
{ {
Id = Num, Id = Num,
Days = EDays, Days = EDays,
TotalNum, TotalNum,
PeopleNum = Number, PeopleNum = TotalNum - Number,
Type = Common.Enum.OKR.MatterTypeEnum.NotScore, Type = Common.Enum.OKR.MatterTypeEnum.NotScore,
TypeName = Common.Enum.OKR.MatterTypeEnum.NotScore.ToName(), TypeName = Common.Enum.OKR.MatterTypeEnum.NotScore.ToName(),
SelectType = 4, SelectType = 4,
...@@ -8098,6 +8106,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8098,6 +8106,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
} }
} }
} }
}
else else
{ {
//管理端 主查询对齐率这些 //管理端 主查询对齐率这些
...@@ -8119,8 +8128,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8119,8 +8128,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
int TotalPeopleNum = userIdList.Count(); int TotalPeopleNum = userIdList.Count();
string userIds = string.Join(",", userIdList); string userIds = string.Join(",", userIdList);
List<RB_OKR_Objective_ViewModel> NRList = new List<RB_OKR_Objective_ViewModel>();
List<RB_OKR_Objective_ViewModel> LastRList = new List<RB_OKR_Objective_ViewModel>();
string OKRMatterValue = Common.Config.OKRMatterValue; string OKRMatterValue = Common.Config.OKRMatterValue;
int EValue = 0; int EValue = 0;
if (!string.IsNullOrEmpty(OKRMatterValue)) if (!string.IsNullOrEmpty(OKRMatterValue))
...@@ -8130,27 +8137,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8130,27 +8137,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
} }
if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.Write).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue))) if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.Write).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue)))
{ {
NRList = new List<RB_OKR_Objective_ViewModel>();
LastRList = new List<RB_OKR_Objective_ViewModel>();
//查询填写 //查询填写
NRList = oKR_ObjectiveRepository.GetWritePageList(1, 100000, out long count, userInfo.Group_Id, periodId, userIds, 1); int OKPNum = oKR_ObjectiveRepository.GetNotFilledList(userInfo.Group_Id, periodId, userIds);
int LastPNum = 0;
if (lastPeriodId > 0) if (lastPeriodId > 0)
{ {
LastRList = oKR_ObjectiveRepository.GetWritePageList(1, 100000, out count, userInfo.Group_Id, lastPeriodId, userIds, 1); LastPNum = oKR_ObjectiveRepository.GetNotFilledList(userInfo.Group_Id, lastPeriodId, userIds);
} }
#region 计算概率 #region 计算概率
int PeopleNum = NRList.Count();
int OKPNum = NRList.Where(x => x.Status == 1).Count();
decimal nowRate = 0; decimal nowRate = 0;
if (PeopleNum > 0) if (TotalPeopleNum > 0)
{ {
nowRate = Math.Round(Convert.ToDecimal(OKPNum) / PeopleNum, 3, MidpointRounding.AwayFromZero) * 100; nowRate = Math.Round(Convert.ToDecimal(OKPNum) / TotalPeopleNum, 3, MidpointRounding.AwayFromZero) * 100;
} }
int lPeopleNum = LastRList.Count();
decimal lastRate = 0; decimal lastRate = 0;
if (lPeopleNum > 0) if (TotalPeopleNum > 0)
{ {
lastRate = Math.Round(Convert.ToDecimal(LastRList.Where(x => x.Status == 1).Count()) / lPeopleNum, 3, MidpointRounding.AwayFromZero) * 100; lastRate = Math.Round(Convert.ToDecimal(LastPNum) / TotalPeopleNum, 3, MidpointRounding.AwayFromZero) * 100;
} }
//只查询同比下降的 //只查询同比下降的
decimal UpRate = 0; decimal UpRate = 0;
...@@ -8168,7 +8171,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8168,7 +8171,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
Id = Num, Id = Num,
Days = EDays, Days = EDays,
TotalNum = PeopleNum, TotalNum = TotalPeopleNum,
PeopleNum = OKPNum, PeopleNum = OKPNum,
UpRate, UpRate,
Type = Common.Enum.OKR.MatterTypeEnum.Write, Type = Common.Enum.OKR.MatterTypeEnum.Write,
...@@ -8181,27 +8184,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8181,27 +8184,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
} }
if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.Align).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue))) if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.Align).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue)))
{ {
NRList = new List<RB_OKR_Objective_ViewModel>();
LastRList = new List<RB_OKR_Objective_ViewModel>();
//查询对齐 //查询对齐
NRList = oKR_ObjectiveRepository.GetAlignPageList(1, 100000, out long count, userInfo.Group_Id, periodId, userIds, 1); int OKPNum = oKR_ObjectiveRepository.GetAlignPeopleNum(userInfo.Group_Id, periodId, userIds);
int LastPNum = 0;
if (lastPeriodId > 0) if (lastPeriodId > 0)
{ {
LastRList = oKR_ObjectiveRepository.GetAlignPageList(1, 100000, out count, userInfo.Group_Id, lastPeriodId, userIds, 1); LastPNum = oKR_ObjectiveRepository.GetAlignPeopleNum(userInfo.Group_Id, lastPeriodId, userIds);
} }
#region 计算概率 #region 计算概率
int PeopleNum = NRList.Count();
int OKPNum = NRList.Where(x => x.Status == 1).Count();
decimal nowRate = 0; decimal nowRate = 0;
if (PeopleNum > 0) if (TotalPeopleNum > 0)
{ {
nowRate = Math.Round(Convert.ToDecimal(OKPNum) / PeopleNum, 3, MidpointRounding.AwayFromZero) * 100; nowRate = Math.Round(Convert.ToDecimal(OKPNum) / TotalPeopleNum, 3, MidpointRounding.AwayFromZero) * 100;
} }
int lPeopleNum = LastRList.Count();
decimal lastRate = 0; decimal lastRate = 0;
if (lPeopleNum > 0) if (TotalPeopleNum > 0)
{ {
lastRate = Math.Round(Convert.ToDecimal(LastRList.Where(x => x.Status == 1).Count()) / lPeopleNum, 3, MidpointRounding.AwayFromZero) * 100; lastRate = Math.Round(Convert.ToDecimal(LastPNum) / TotalPeopleNum, 3, MidpointRounding.AwayFromZero) * 100;
} }
//只查询同比下降的 //只查询同比下降的
decimal UpRate = 0; decimal UpRate = 0;
...@@ -8219,7 +8218,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8219,7 +8218,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
Id = Num, Id = Num,
Days = EDays, Days = EDays,
TotalNum = PeopleNum, TotalNum = TotalPeopleNum,
PeopleNum = OKPNum, PeopleNum = OKPNum,
UpRate, UpRate,
Type = Common.Enum.OKR.MatterTypeEnum.Align, Type = Common.Enum.OKR.MatterTypeEnum.Align,
...@@ -8232,27 +8231,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8232,27 +8231,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
} }
if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.Score).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue))) if (!list.Where(x => x.Type == Common.Enum.OKR.MatterTypeEnum.Score).Any() && (EValue == 0 || (EValue > 0 && EDays <= EValue)))
{ {
NRList = new List<RB_OKR_Objective_ViewModel>();
LastRList = new List<RB_OKR_Objective_ViewModel>();
//查询打分 //查询打分
NRList = oKR_ObjectiveRepository.GetScorePageList(1, 100000,out long count, userInfo.Group_Id, periodId, userIds, 1); int OKPNum = oKR_ObjectiveRepository.GetNotScoreList(userInfo.Group_Id, periodId, userIds, 2);
int LastPNum = 0;
if (lastPeriodId > 0) if (lastPeriodId > 0)
{ {
LastRList = oKR_ObjectiveRepository.GetScorePageList(1, 100000, out count, userInfo.Group_Id, lastPeriodId, userIds, 1); LastPNum = oKR_ObjectiveRepository.GetNotScoreList(userInfo.Group_Id, lastPeriodId, userIds, 2);
} }
#region 计算概率 #region 计算概率
int PeopleNum = NRList.Count();
int OKPNum = NRList.Where(x => x.Status == 1).Count();
decimal nowRate = 0; decimal nowRate = 0;
if (PeopleNum > 0) if (TotalPeopleNum > 0)
{ {
nowRate = Math.Round(Convert.ToDecimal(OKPNum) / PeopleNum, 3, MidpointRounding.AwayFromZero) * 100; nowRate = Math.Round(Convert.ToDecimal(OKPNum) / TotalPeopleNum, 3, MidpointRounding.AwayFromZero) * 100;
} }
int lPeopleNum = LastRList.Count();
decimal lastRate = 0; decimal lastRate = 0;
if (lPeopleNum > 0) if (TotalPeopleNum > 0)
{ {
lastRate = Math.Round(Convert.ToDecimal(LastRList.Where(x => x.Status == 1).Count()) / lPeopleNum, 3, MidpointRounding.AwayFromZero) * 100; lastRate = Math.Round(Convert.ToDecimal(LastPNum) / TotalPeopleNum, 3, MidpointRounding.AwayFromZero) * 100;
} }
//只查询同比下降的 //只查询同比下降的
decimal UpRate = 0; decimal UpRate = 0;
...@@ -8270,7 +8265,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8270,7 +8265,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{ {
Id = Num, Id = Num,
Days = EDays, Days = EDays,
TotalNum = PeopleNum, TotalNum = TotalPeopleNum,
PeopleNum = OKPNum, PeopleNum = OKPNum,
UpRate, UpRate,
Type = Common.Enum.OKR.MatterTypeEnum.Score, Type = Common.Enum.OKR.MatterTypeEnum.Score,
......
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
"RedisPwd": "Viitto2018" "RedisPwd": "Viitto2018"
}, },
"VirtualDirectory": "WebFile", "VirtualDirectory": "WebFile",
"OKRMatterValue": "30,100", //未填写 未打分 下降比例
"OKRMatterValue": "30,100,100",
//是否是线上环境 //是否是线上环境
"IsOnline": false, "IsOnline": false,
//退课流程编号 //退课流程编号
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment