积分优化
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Model;
|
||||
using NPOI.SS.UserModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -20,7 +19,6 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.ScoreUser.FirstOrDefault(e => e.Id == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据证件号码获取人员今年上一条得分记录
|
||||
/// </summary>
|
||||
@@ -55,17 +53,27 @@ namespace BLL
|
||||
/// <param name="model">人员得分实体</param>
|
||||
public static void AddScoreUser(Model.ScoreUser model)
|
||||
{
|
||||
Model.ScoreUser newModel = new Model.ScoreUser();
|
||||
newModel.Id = model.Id;
|
||||
newModel.Year = model.Year;
|
||||
newModel.IdentityCard = model.IdentityCard;
|
||||
newModel.UserName = model.UserName;
|
||||
newModel.Score = model.Score;
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
newModel.DataSourceId = model.DataSourceId;
|
||||
newModel.CheckDate = model.CheckDate;
|
||||
Funs.DB.ScoreUser.InsertOnSubmit(newModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
var su = Funs.DB.ScoreUser.FirstOrDefault(e => e.IdentityCard == model.IdentityCard && e.Year == model.Year);
|
||||
if (su != null)
|
||||
{//已存在,修改人员今年得分值
|
||||
su.Score = model.Score;
|
||||
su.CompileDate = model.CompileDate;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.ScoreUser newModel = new Model.ScoreUser();
|
||||
newModel.Id = model.Id;
|
||||
newModel.Year = model.Year;
|
||||
newModel.IdentityCard = model.IdentityCard;
|
||||
newModel.UserName = model.UserName;
|
||||
newModel.Score = model.Score;
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
newModel.DataSourceId = model.DataSourceId;
|
||||
newModel.CheckDate = model.CheckDate;
|
||||
Funs.DB.ScoreUser.InsertOnSubmit(newModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -153,7 +153,9 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_Unit> GetUnitDropDownList()
|
||||
{
|
||||
var list = (from x in Funs.DB.Base_Unit select x).OrderBy(x => x.UnitCode).ToList();
|
||||
var list = (from x in Funs.DB.Base_Unit
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -163,7 +165,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_Unit> GetThisUnitDropDownList()
|
||||
{
|
||||
var list = (from x in Funs.DB.Base_Unit where x.UnitId == Const.UnitId_XJYJ select x).ToList();
|
||||
var list = (from x in Funs.DB.Base_Unit
|
||||
where x.UnitId == Const.UnitId_XJYJ
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -181,7 +186,10 @@ namespace BLL
|
||||
var unitIdList = GetChildrenUnitId(unitId);
|
||||
if (unitIdList.Count() > 0)
|
||||
{
|
||||
unitList = (from x in Funs.DB.Base_Unit where unitIdList.Contains(x.UnitId) || x.UnitId == unitId select x).ToList();
|
||||
unitList = (from x in Funs.DB.Base_Unit
|
||||
where unitIdList.Contains(x.UnitId) || x.UnitId == unitId
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
}
|
||||
return unitList;
|
||||
}
|
||||
@@ -212,12 +220,14 @@ namespace BLL
|
||||
{
|
||||
var list = (from x in Funs.DB.Base_Unit
|
||||
where x.IsBranch == true
|
||||
select x).OrderBy(x => x.UnitCode).ToList();
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
if (isThisUnit)
|
||||
{
|
||||
list = (from x in Funs.DB.Base_Unit
|
||||
where x.IsBranch == true || x.UnitId == Const.UnitId_XJYJ
|
||||
select x).OrderBy(x => x.UnitCode).ToList();
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -237,15 +247,16 @@ namespace BLL
|
||||
units = (from x in db.Base_Unit
|
||||
join y in db.Project_ProjectUnit on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
units = (from x in db.Base_Unit
|
||||
orderby x.UnitCode
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
}
|
||||
units = units.OrderBy(x => x.UnitCode).ToList();
|
||||
//units = units.OrderBy(x => x.UnitCode).ToList();
|
||||
return units;
|
||||
}
|
||||
}
|
||||
@@ -263,7 +274,7 @@ namespace BLL
|
||||
join y in db.Project_ProjectUnit
|
||||
on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId
|
||||
orderby x.UnitCode
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
@@ -282,7 +293,7 @@ namespace BLL
|
||||
join y in db.Project_ProjectUnit
|
||||
on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId && (y.UnitType == unitType || string.IsNullOrEmpty(unitType))
|
||||
orderby x.UnitCode
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
@@ -301,7 +312,7 @@ namespace BLL
|
||||
join y in db.Project_ProjectUnit
|
||||
on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId && (y.UnitType == BLL.Const.ProjectUnitType_2 || y.UnitType == BLL.Const.ProjectUnitType_1)
|
||||
orderby x.UnitCode
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
@@ -320,7 +331,7 @@ namespace BLL
|
||||
join y in db.Project_ProjectUnit
|
||||
on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId && (x.UnitId != unitId || unitId == null)
|
||||
orderby x.UnitCode
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
@@ -333,7 +344,7 @@ namespace BLL
|
||||
join y in db.Project_ProjectUnit
|
||||
on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId && (unitId == null || x.UnitId != unitId) && (key == null || x.UnitCode.Contains(key) || x.UnitName.Contains(key))
|
||||
orderby x.UnitCode
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
@@ -421,7 +432,10 @@ namespace BLL
|
||||
public static List<Model.Base_Unit> GetMainAndSubUnitList()
|
||||
{
|
||||
//return (from x in Funs.DB.Base_Unit where x.IsThisUnit == true || x.IsBranch == true orderby x.IsThisUnit descending select x).ToList();
|
||||
return (from x in Funs.DB.Base_Unit where x.IsThisUnit == true || x.IsBranch == true select x).ToList();
|
||||
return (from x in Funs.DB.Base_Unit
|
||||
where x.IsThisUnit == true || x.IsBranch == true
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
#region 单位表下拉框
|
||||
@@ -557,11 +571,11 @@ namespace BLL
|
||||
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
|
||||
{
|
||||
var q = (from x in db.Base_Unit
|
||||
join y in db.Project_ProjectUnit
|
||||
on x.UnitId equals y.UnitId
|
||||
join y in db.Project_ProjectUnit on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId
|
||||
&& (y.UnitType == BLL.Const.ProjectUnitType_1 || y.UnitType == BLL.Const.ProjectUnitType_2) && (y.OutTime == null || y.OutTime >= Convert.ToDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-01"))
|
||||
select x).OrderBy(x => x.UnitCode).ToList();
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
}
|
||||
@@ -620,16 +634,17 @@ namespace BLL
|
||||
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
|
||||
{
|
||||
var q = (from x in db.Base_Unit
|
||||
orderby x.UnitCode
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = (from x in q
|
||||
join y in db.Project_ProjectUnit on x.UnitId equals y.UnitId
|
||||
where (y.ProjectId == projectId && y.UnitType != Const.ProjectUnitType_2)
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
}
|
||||
q = q.OrderByDescending(x => x.UnitCode).ToList();
|
||||
//q = q.OrderByDescending(x => x.UnitCode).ToList();
|
||||
return q;
|
||||
}
|
||||
}
|
||||
@@ -741,7 +756,8 @@ namespace BLL
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == projectId
|
||||
//where (x.UnitType == Const.ProjectUnitType_1 || x.UnitType == Const.ProjectUnitType_2)
|
||||
orderby y.UnitCode
|
||||
//orderby y.UnitCode
|
||||
orderby y.IsThisUnit descending, y.UnitCode ascending
|
||||
select y).ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
for (int i = 0; i < list.Count(); i++)
|
||||
@@ -805,7 +821,8 @@ namespace BLL
|
||||
var q = (from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == projectId
|
||||
orderby y.UnitCode
|
||||
//orderby y.UnitCode
|
||||
orderby y.IsThisUnit descending, y.UnitCode ascending
|
||||
select y).ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
for (int i = 0; i < list.Count(); i++)
|
||||
@@ -827,8 +844,9 @@ namespace BLL
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
join z in Funs.DB.ProjectData_WorkArea on y.UnitId equals z.UnitId
|
||||
where x.ProjectId == projectId && (y.UnitId == unitId || z.SupervisorUnitId == unitId) && x.UnitType == BLL.Const.ProjectUnitType_2
|
||||
orderby y.UnitCode
|
||||
select y).Distinct().ToList();
|
||||
//orderby y.UnitCode
|
||||
orderby y.IsThisUnit descending, y.UnitCode ascending
|
||||
select y).Distinct().ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
@@ -844,7 +862,8 @@ namespace BLL
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
join z in Funs.DB.ProjectData_WorkArea on y.UnitId equals z.UnitId
|
||||
where x.ProjectId == projectId && (y.UnitId == unitId || z.SupervisorUnitId == unitId) && x.UnitType == BLL.Const.ProjectUnitType_2
|
||||
orderby y.UnitCode
|
||||
//orderby y.UnitCode
|
||||
orderby y.IsThisUnit descending, y.UnitCode ascending
|
||||
select y).Distinct().ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
for (int i = 0; i < q.Count(); i++)
|
||||
@@ -852,7 +871,7 @@ namespace BLL
|
||||
list[i] = new ListItem(q[i].UnitName ?? "", q[i].UnitId.ToString());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取登陆用户分包单位名称项
|
||||
@@ -861,7 +880,7 @@ namespace BLL
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitSubUnitNameDownList(FineUIPro.DropDownList dropName, string projectId,string unitId, bool isShowPlease)
|
||||
public static void InitSubUnitNameDownList(FineUIPro.DropDownList dropName, string projectId, string unitId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
@@ -883,8 +902,9 @@ namespace BLL
|
||||
{
|
||||
var q = (from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == projectId && y.UnitId == unitId && x.UnitType == BLL.Const.ProjectUnitType_2
|
||||
orderby y.UnitCode
|
||||
where x.ProjectId == projectId && y.UnitId == unitId && x.UnitType == BLL.Const.ProjectUnitType_2
|
||||
//orderby y.UnitCode
|
||||
orderby y.IsThisUnit descending, y.UnitCode ascending
|
||||
select y).Distinct().ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
for (int i = 0; i < q.Count(); i++)
|
||||
@@ -952,7 +972,10 @@ namespace BLL
|
||||
{
|
||||
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
|
||||
{
|
||||
var q = (from x in db.Base_Unit where x.UnitId != BLL.Const.UnitId_XJYJ orderby x.UnitCode select x).ToList();
|
||||
var q = (from x in db.Base_Unit
|
||||
where x.UnitId != BLL.Const.UnitId_XJYJ
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
}
|
||||
@@ -961,7 +984,9 @@ namespace BLL
|
||||
{
|
||||
dropName.DataValueField = "UnitId";
|
||||
dropName.DataTextField = "UnitName";
|
||||
dropName.DataSource = (from x in Funs.DB.Base_Unit orderby x.UnitCode select x).ToList();
|
||||
dropName.DataSource = (from x in Funs.DB.Base_Unit
|
||||
orderby x.IsThisUnit descending, x.UnitCode ascending
|
||||
select x).ToList();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
|
||||
@@ -492,7 +492,6 @@ namespace BLL
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -150,35 +150,12 @@ namespace BLL
|
||||
{
|
||||
var q = GetTodayData();
|
||||
var data = new HJGLData();
|
||||
if (CommonService.GetIsThisUnit().CollCropCode== "91410200170644116B")
|
||||
{
|
||||
return GetELECLTodayHJGLData_HJGL();
|
||||
}
|
||||
if (q != null && q.State == Const.CNCEC_State_S)
|
||||
data = StatisticalData();
|
||||
else
|
||||
data = StatisticalData();
|
||||
return data;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取十一化建焊接数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static HJGLData GetELECLTodayHJGLData_HJGL()
|
||||
{
|
||||
var data = new HJGLData();
|
||||
string baseurl = "http://36.99.162.230:9493/sgglapi/api/CNCECServer/PostGetHJGLData";
|
||||
string token = Const.sysglyId;
|
||||
string response = Funs.RequestPost(baseurl, token, "");
|
||||
var json = JsonConvert.DeserializeObject(response) as JObject;
|
||||
if (json != null && json["code"]?.ToString()=="1")
|
||||
{
|
||||
var str = json["data"]?.ToString();
|
||||
if (str != null) data = JsonConvert.DeserializeObject<HJGLData>(str);
|
||||
}
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
public static HJGLData_HJGL GetTodayData()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user