Merge branch 'master' of https://gitee.com/frane-yang/SGGL_CWCEC
This commit is contained in:
		
						commit
						d9bc211c6a
					
				| 
						 | 
					@ -1,464 +1,468 @@
 | 
				
			||||||
using FineUIPro;
 | 
					using FineUIPro;
 | 
				
			||||||
using Model;
 | 
					using Model;
 | 
				
			||||||
using Newtonsoft.Json;
 | 
					using Newtonsoft.Json;
 | 
				
			||||||
using NPOI.POIFS.Crypt.Dsig;
 | 
					using NPOI.POIFS.Crypt.Dsig;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections;
 | 
					using System.Collections;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace BLL
 | 
					namespace BLL
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public static class CQMSDataService
 | 
					    public static class CQMSDataService
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public static Model.SGGLDB db = Funs.DB;
 | 
					        public static Model.SGGLDB db = Funs.DB;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 集团接口地址
 | 
					        /// 集团接口地址
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public static string CNCECServerUrl
 | 
					        public static string CNCECServerUrl
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get;
 | 
					            get;
 | 
				
			||||||
            set;
 | 
					            set;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region 获取列表
 | 
					        #region 获取列表
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 记录数
 | 
					        /// 记录数
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public static int count
 | 
					        public static int count
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get;
 | 
					            get;
 | 
				
			||||||
            set;
 | 
					            set;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static List<Model.CQMSData_CQMS> GetCQMSData_CQMSByModle(Model.CQMSData_CQMS table)
 | 
					        public static List<Model.CQMSData_CQMS> GetCQMSData_CQMSByModle(Model.CQMSData_CQMS table)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Model.SGGLDB db = Funs.DB;
 | 
					            Model.SGGLDB db = Funs.DB;
 | 
				
			||||||
            var q = from x in db.CQMSData_CQMS
 | 
					            var q = from x in db.CQMSData_CQMS
 | 
				
			||||||
                    where
 | 
					                    where
 | 
				
			||||||
                              (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
 | 
					                              (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
 | 
				
			||||||
                              (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
 | 
					                              (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
 | 
				
			||||||
                              (string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
 | 
					                              (string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
 | 
				
			||||||
                              (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
 | 
					                              (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
 | 
				
			||||||
                    orderby x.ReportDate descending
 | 
					                    orderby x.ReportDate descending
 | 
				
			||||||
                    select x
 | 
					                    select x
 | 
				
			||||||
                  ;
 | 
					                  ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return q.ToList();
 | 
					            return q.ToList();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// 获取分页列表
 | 
					        /// 获取分页列表
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="PageIndex">页码</param>
 | 
					        /// <param name="PageIndex">页码</param>
 | 
				
			||||||
        /// <param name="PageSize">每页数量</param>
 | 
					        /// <param name="PageSize">每页数量</param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static IEnumerable getListData(Model.CQMSData_CQMS table, Grid Grid1)
 | 
					        public static IEnumerable getListData(Model.CQMSData_CQMS table, Grid Grid1)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var q = GetCQMSData_CQMSByModle(table);
 | 
					            var q = GetCQMSData_CQMSByModle(table);
 | 
				
			||||||
            count = q.Count();
 | 
					            count = q.Count();
 | 
				
			||||||
            if (count == 0)
 | 
					            if (count == 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            //  q=  q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
 | 
					            //  q=  q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
 | 
				
			||||||
            // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
 | 
					            // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
 | 
				
			||||||
            return from x in q
 | 
					            return from x in q
 | 
				
			||||||
                   select new
 | 
					                   select new
 | 
				
			||||||
                   {
 | 
					                   {
 | 
				
			||||||
                       x.Id,
 | 
					                       x.Id,
 | 
				
			||||||
                       x.UnitId,
 | 
					                       x.UnitId,
 | 
				
			||||||
                       x.CollCropCode,
 | 
					                       x.CollCropCode,
 | 
				
			||||||
                       x.UnitName,
 | 
					                       x.UnitName,
 | 
				
			||||||
                       x.ReportDate,
 | 
					                       x.ReportDate,
 | 
				
			||||||
                       x.TrainPersonNum,
 | 
					                       x.TrainPersonNum,
 | 
				
			||||||
                       x.TechnicalDisclosePersonNum,
 | 
					                       x.TechnicalDisclosePersonNum,
 | 
				
			||||||
                       x.UseNum,
 | 
					                       x.UseNum,
 | 
				
			||||||
                       x.OKNum,
 | 
					                       x.OKNum,
 | 
				
			||||||
                       x.CompanyPersonNum,
 | 
					                       x.CompanyPersonNum,
 | 
				
			||||||
                       x.BranchPersonNum,
 | 
					                       x.BranchPersonNum,
 | 
				
			||||||
                       x.ProjectPersonNum,
 | 
					                       x.ProjectPersonNum,
 | 
				
			||||||
                       x.ProblemNum,
 | 
					                       x.ProblemNum,
 | 
				
			||||||
                       x.ProblemCompletedNum,
 | 
					                       x.ProblemCompletedNum,
 | 
				
			||||||
                       x.ProblemNotCompletedNum,
 | 
					                       x.ProblemNotCompletedNum,
 | 
				
			||||||
                       x.SNum,
 | 
					                       x.SNum,
 | 
				
			||||||
                       x.ANum,
 | 
					                       x.ANum,
 | 
				
			||||||
                       x.BNum,
 | 
					                       x.BNum,
 | 
				
			||||||
                       x.CNum,
 | 
					                       x.CNum,
 | 
				
			||||||
                       x.KeyProcessNum,
 | 
					                       x.KeyProcessNum,
 | 
				
			||||||
                       x.KeyProcessOKNum,
 | 
					                       x.KeyProcessOKNum,
 | 
				
			||||||
                       x.SpecialProcessNum,
 | 
					                       x.SpecialProcessNum,
 | 
				
			||||||
                       x.SpecialProcessOKNum,
 | 
					                       x.SpecialProcessOKNum,
 | 
				
			||||||
                       x.ConcealedWorksNum,
 | 
					                       x.ConcealedWorksNum,
 | 
				
			||||||
                       x.ConcealedWorksOKNum,
 | 
					                       x.ConcealedWorksOKNum,
 | 
				
			||||||
                       x.UnitProjectOnesNum,
 | 
					                       x.UnitProjectOnesNum,
 | 
				
			||||||
                       x.UnitProjectOnesOKNum,
 | 
					                       x.UnitProjectOnesOKNum,
 | 
				
			||||||
                       x.MaterialInRecheckNum,
 | 
					                       x.MaterialInRecheckNum,
 | 
				
			||||||
                       x.MaterialInRecheckOKNum,
 | 
					                       x.MaterialInRecheckOKNum,
 | 
				
			||||||
                       x.SingleProjectNum,
 | 
					                       x.SingleProjectNum,
 | 
				
			||||||
                       x.UnitProjectNum,
 | 
					                       x.UnitProjectNum,
 | 
				
			||||||
                       x.SubProjectNum,
 | 
					                       x.SubProjectNum,
 | 
				
			||||||
                       x.SubdivisionalWorksNum,
 | 
					                       x.SubdivisionalWorksNum,
 | 
				
			||||||
                       x.InspectionLotNum,
 | 
					                       x.InspectionLotNum,
 | 
				
			||||||
                       x.State,
 | 
					                       x.State,
 | 
				
			||||||
                       x.CreateDate,
 | 
					                       x.CreateDate,
 | 
				
			||||||
                       x.CreateMan,
 | 
					                       x.CreateMan,
 | 
				
			||||||
                   };
 | 
					                   };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #endregion 获取列表
 | 
					        #endregion 获取列表
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static void AddCQMSData_CQMS(Model.CQMSData_CQMS newtable)
 | 
					        public static void AddCQMSData_CQMS(Model.CQMSData_CQMS newtable)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Model.SGGLDB db = Funs.DB;
 | 
					            Model.SGGLDB db = Funs.DB;
 | 
				
			||||||
            Model.CQMSData_CQMS table = new Model.CQMSData_CQMS
 | 
					            Model.CQMSData_CQMS table = new Model.CQMSData_CQMS
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Id = newtable.Id,
 | 
					                Id = newtable.Id,
 | 
				
			||||||
                UnitId = newtable.UnitId,
 | 
					                UnitId = newtable.UnitId,
 | 
				
			||||||
                CollCropCode = newtable.CollCropCode,
 | 
					                CollCropCode = newtable.CollCropCode,
 | 
				
			||||||
                UnitName = newtable.UnitName,
 | 
					                UnitName = newtable.UnitName,
 | 
				
			||||||
                ReportDate = newtable.ReportDate,
 | 
					                ReportDate = newtable.ReportDate,
 | 
				
			||||||
                TrainPersonNum = newtable.TrainPersonNum,
 | 
					                TrainPersonNum = newtable.TrainPersonNum,
 | 
				
			||||||
                TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum,
 | 
					                TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum,
 | 
				
			||||||
                UseNum = newtable.UseNum,
 | 
					                UseNum = newtable.UseNum,
 | 
				
			||||||
                OKNum = newtable.OKNum,
 | 
					                OKNum = newtable.OKNum,
 | 
				
			||||||
                CompanyPersonNum = newtable.CompanyPersonNum,
 | 
					                CompanyPersonNum = newtable.CompanyPersonNum,
 | 
				
			||||||
                BranchPersonNum = newtable.BranchPersonNum,
 | 
					                BranchPersonNum = newtable.BranchPersonNum,
 | 
				
			||||||
                ProjectPersonNum = newtable.ProjectPersonNum,
 | 
					                ProjectPersonNum = newtable.ProjectPersonNum,
 | 
				
			||||||
                ProblemNum = newtable.ProblemNum,
 | 
					                ProblemNum = newtable.ProblemNum,
 | 
				
			||||||
                ProblemCompletedNum = newtable.ProblemCompletedNum,
 | 
					                ProblemCompletedNum = newtable.ProblemCompletedNum,
 | 
				
			||||||
                ProblemNotCompletedNum = newtable.ProblemNotCompletedNum,
 | 
					                ProblemNotCompletedNum = newtable.ProblemNotCompletedNum,
 | 
				
			||||||
                SNum = newtable.SNum,
 | 
					                SNum = newtable.SNum,
 | 
				
			||||||
                ANum = newtable.ANum,
 | 
					                ANum = newtable.ANum,
 | 
				
			||||||
                BNum = newtable.BNum,
 | 
					                BNum = newtable.BNum,
 | 
				
			||||||
                CNum = newtable.CNum,
 | 
					                CNum = newtable.CNum,
 | 
				
			||||||
                KeyProcessNum = newtable.KeyProcessNum,
 | 
					                KeyProcessNum = newtable.KeyProcessNum,
 | 
				
			||||||
                KeyProcessOKNum = newtable.KeyProcessOKNum,
 | 
					                KeyProcessOKNum = newtable.KeyProcessOKNum,
 | 
				
			||||||
                SpecialProcessNum = newtable.SpecialProcessNum,
 | 
					                SpecialProcessNum = newtable.SpecialProcessNum,
 | 
				
			||||||
                SpecialProcessOKNum = newtable.SpecialProcessOKNum,
 | 
					                SpecialProcessOKNum = newtable.SpecialProcessOKNum,
 | 
				
			||||||
                ConcealedWorksNum = newtable.ConcealedWorksNum,
 | 
					                ConcealedWorksNum = newtable.ConcealedWorksNum,
 | 
				
			||||||
                ConcealedWorksOKNum = newtable.ConcealedWorksOKNum,
 | 
					                ConcealedWorksOKNum = newtable.ConcealedWorksOKNum,
 | 
				
			||||||
                UnitProjectOnesNum = newtable.UnitProjectOnesNum,
 | 
					                UnitProjectOnesNum = newtable.UnitProjectOnesNum,
 | 
				
			||||||
                UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum,
 | 
					                UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum,
 | 
				
			||||||
                MaterialInRecheckNum = newtable.MaterialInRecheckNum,
 | 
					                MaterialInRecheckNum = newtable.MaterialInRecheckNum,
 | 
				
			||||||
                MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum,
 | 
					                MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum,
 | 
				
			||||||
                SingleProjectNum = newtable.SingleProjectNum,
 | 
					                SingleProjectNum = newtable.SingleProjectNum,
 | 
				
			||||||
                UnitProjectNum = newtable.UnitProjectNum,
 | 
					                UnitProjectNum = newtable.UnitProjectNum,
 | 
				
			||||||
                SubProjectNum = newtable.SubProjectNum,
 | 
					                SubProjectNum = newtable.SubProjectNum,
 | 
				
			||||||
                SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
 | 
					                SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
 | 
				
			||||||
                InspectionLotNum = newtable.InspectionLotNum,
 | 
					                InspectionLotNum = newtable.InspectionLotNum,
 | 
				
			||||||
                State = newtable.State,
 | 
					                State = newtable.State,
 | 
				
			||||||
                CreateDate = newtable.CreateDate,
 | 
					                CreateDate = newtable.CreateDate,
 | 
				
			||||||
                CreateMan = newtable.CreateMan,
 | 
					                CreateMan = newtable.CreateMan,
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            db.CQMSData_CQMS.InsertOnSubmit(table);
 | 
					            db.CQMSData_CQMS.InsertOnSubmit(table);
 | 
				
			||||||
            db.SubmitChanges();
 | 
					            db.SubmitChanges();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static void DeleteCQMSData_CQMSById(string Id)
 | 
					        public static void DeleteCQMSData_CQMSById(string Id)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Model.SGGLDB db = Funs.DB;
 | 
					            Model.SGGLDB db = Funs.DB;
 | 
				
			||||||
            Model.CQMSData_CQMS table = db.CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
 | 
					            Model.CQMSData_CQMS table = db.CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
 | 
				
			||||||
            if (table != null)
 | 
					            if (table != null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                db.CQMSData_CQMS.DeleteOnSubmit(table);
 | 
					                db.CQMSData_CQMS.DeleteOnSubmit(table);
 | 
				
			||||||
                db.SubmitChanges();
 | 
					                db.SubmitChanges();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static Model.CQMSData_CQMS GetCQMSData_CQMSById(string Id)
 | 
					        public static Model.CQMSData_CQMS GetCQMSData_CQMSById(string Id)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Model.SGGLDB db = Funs.DB;
 | 
					            Model.SGGLDB db = Funs.DB;
 | 
				
			||||||
            return db.CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
 | 
					            return db.CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static Model.CQMSData GetItemById(string Id)
 | 
					        public static Model.CQMSData GetItemById(string Id)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var model = GetCQMSData_CQMSById(Id);
 | 
					            var model = GetCQMSData_CQMSById(Id);
 | 
				
			||||||
            CQMSData data = new CQMSData();
 | 
					            CQMSData data = new CQMSData();
 | 
				
			||||||
            CqmsDataItem item = new CqmsDataItem();
 | 
					            CqmsDataItem item = new CqmsDataItem();
 | 
				
			||||||
            if (model != null)
 | 
					            if (model != null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                item.Id = model.Id;
 | 
					                item.Id = model.Id;
 | 
				
			||||||
                item.ReportDate = model.ReportDate.Value.ToShortDateString();
 | 
					                item.ReportDate = model.ReportDate.Value.ToShortDateString();
 | 
				
			||||||
                item.UnitId = model.UnitId;
 | 
					                item.UnitId = model.UnitId;
 | 
				
			||||||
                item.CollCropCode = model.CollCropCode;
 | 
					                item.CollCropCode = model.CollCropCode;
 | 
				
			||||||
                item.TrainPersonNum = model.TrainPersonNum;
 | 
					                item.TrainPersonNum = model.TrainPersonNum;
 | 
				
			||||||
                item.TechnicalDisclosePersonNum = model.TechnicalDisclosePersonNum;
 | 
					                item.TechnicalDisclosePersonNum = model.TechnicalDisclosePersonNum;
 | 
				
			||||||
                item.UseNum = model.UseNum;
 | 
					                item.UseNum = model.UseNum;
 | 
				
			||||||
                item.OKNum = model.OKNum;
 | 
					                item.OKNum = model.OKNum;
 | 
				
			||||||
                item.CompanyPersonNum = model.CompanyPersonNum;
 | 
					                item.CompanyPersonNum = model.CompanyPersonNum;
 | 
				
			||||||
                item.BranchPersonNum = model.BranchPersonNum;
 | 
					                item.BranchPersonNum = model.BranchPersonNum;
 | 
				
			||||||
                item.ProjectPersonNum = model.ProjectPersonNum;
 | 
					                item.ProjectPersonNum = model.ProjectPersonNum;
 | 
				
			||||||
                item.ProblemNum = model.ProblemNum;
 | 
					                item.ProblemNum = model.ProblemNum;
 | 
				
			||||||
                item.ProblemCompletedNum = model.ProblemCompletedNum;
 | 
					                item.ProblemCompletedNum = model.ProblemCompletedNum;
 | 
				
			||||||
                item.ProblemNotCompletedNum = model.ProblemNotCompletedNum;
 | 
					                item.ProblemNotCompletedNum = model.ProblemNotCompletedNum;
 | 
				
			||||||
                item.ProblemRate = "";
 | 
					                item.ProblemRate = "";
 | 
				
			||||||
                item.SNum = model.SNum;
 | 
					                item.SNum = model.SNum;
 | 
				
			||||||
                item.ANum = model.ANum;
 | 
					                item.ANum = model.ANum;
 | 
				
			||||||
                item.BNum = model.BNum;
 | 
					                item.BNum = model.BNum;
 | 
				
			||||||
                item.CNum = model.CNum;
 | 
					                item.CNum = model.CNum;
 | 
				
			||||||
                item.KeyProcessNum = model.KeyProcessNum;
 | 
					                item.KeyProcessNum = model.KeyProcessNum;
 | 
				
			||||||
                item.KeyProcessOKNum = model.KeyProcessOKNum;
 | 
					                item.KeyProcessOKNum = model.KeyProcessOKNum;
 | 
				
			||||||
                item.KeyProcessRate = "";
 | 
					                item.KeyProcessRate = "";
 | 
				
			||||||
                item.SpecialProcessNum = model.SpecialProcessNum;
 | 
					                item.SpecialProcessNum = model.SpecialProcessNum;
 | 
				
			||||||
                item.SpecialProcessOKNum = model.SpecialProcessOKNum;
 | 
					                item.SpecialProcessOKNum = model.SpecialProcessOKNum;
 | 
				
			||||||
                item.SpecialProcessRate = "";
 | 
					                item.SpecialProcessRate = "";
 | 
				
			||||||
                item.ConcealedWorksNum = model.ConcealedWorksNum;
 | 
					                item.ConcealedWorksNum = model.ConcealedWorksNum;
 | 
				
			||||||
                item.ConcealedWorksOKNum = model.ConcealedWorksOKNum;
 | 
					                item.ConcealedWorksOKNum = model.ConcealedWorksOKNum;
 | 
				
			||||||
                item.ConcealedWorksRate = "";
 | 
					                item.ConcealedWorksRate = "";
 | 
				
			||||||
                item.UnitProjectOnesNum = model.UnitProjectOnesNum;
 | 
					                item.UnitProjectOnesNum = model.UnitProjectOnesNum;
 | 
				
			||||||
                item.UnitProjectOnesOKNum = model.UnitProjectOnesOKNum;
 | 
					                item.UnitProjectOnesOKNum = model.UnitProjectOnesOKNum;
 | 
				
			||||||
                item.UnitProjectOnesRate = "";
 | 
					                item.UnitProjectOnesRate = "";
 | 
				
			||||||
                item.MaterialInRecheckNum = model.MaterialInRecheckNum;
 | 
					                item.MaterialInRecheckNum = model.MaterialInRecheckNum;
 | 
				
			||||||
                item.MaterialInRecheckOKNum = model.MaterialInRecheckOKNum;
 | 
					                item.MaterialInRecheckOKNum = model.MaterialInRecheckOKNum;
 | 
				
			||||||
                item.MaterialInRecheckRate = "";
 | 
					                item.MaterialInRecheckRate = "";
 | 
				
			||||||
                item.SingleProjectNum = model.SingleProjectNum;
 | 
					                item.SingleProjectNum = model.SingleProjectNum;
 | 
				
			||||||
                item.UnitProjectNum = model.UnitProjectNum;
 | 
					                item.UnitProjectNum = model.UnitProjectNum;
 | 
				
			||||||
                item.SubProjectNum = model.SubProjectNum;
 | 
					                item.SubProjectNum = model.SubProjectNum;
 | 
				
			||||||
                item.SubdivisionalWorksNum = model.SubdivisionalWorksNum;
 | 
					                item.SubdivisionalWorksNum = model.SubdivisionalWorksNum;
 | 
				
			||||||
                item.InspectionLotNum = model.InspectionLotNum;
 | 
					                item.InspectionLotNum = model.InspectionLotNum;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            List<CqmsDataItem> cqmsDataItems = new List<CqmsDataItem>();
 | 
					            List<CqmsDataItem> cqmsDataItems = new List<CqmsDataItem>();
 | 
				
			||||||
            cqmsDataItems.Add(item);
 | 
					            cqmsDataItems.Add(item);
 | 
				
			||||||
            data.CQMSDataItems = cqmsDataItems;
 | 
					            data.CQMSDataItems = cqmsDataItems;
 | 
				
			||||||
            return data;
 | 
					            return data;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static Model.CQMSData GetTodayCQMSData_CQMS()
 | 
					        public static Model.CQMSData GetTodayCQMSData_CQMS()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var q = GetTodayData();
 | 
					            var q = GetTodayData();
 | 
				
			||||||
            CQMSData data = new CQMSData();
 | 
					            CQMSData data = new CQMSData();
 | 
				
			||||||
            if (q != null && q.State == Const.CNCEC_State_S)
 | 
					            if (q != null && q.State == Const.CNCEC_State_S)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                data = GetDataByCQMSData_CQMS(q);
 | 
					                data = GetDataByCQMSData_CQMS(q);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                data = StatisticalData();
 | 
					                data = StatisticalData();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            return data;
 | 
					            return data;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static Model.CQMSData_CQMS GetTodayData()
 | 
					        public static Model.CQMSData_CQMS GetTodayData()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var q = (from x in Funs.DB.CQMSData_CQMS
 | 
					            var q = (from x in Funs.DB.CQMSData_CQMS
 | 
				
			||||||
                     where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
 | 
					                     where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
 | 
				
			||||||
                     select x).FirstOrDefault();
 | 
					                     select x).FirstOrDefault();
 | 
				
			||||||
            return q;
 | 
					            return q;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static void   UpdateTodyData_State()
 | 
					        public static void   UpdateTodyData_State()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var q = GetTodayData();
 | 
					            var q = GetTodayData();
 | 
				
			||||||
            if (q!=null )
 | 
					            if (q!=null )
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                q.State = Const.CNCEC_State_1;
 | 
					                q.State = Const.CNCEC_State_1;
 | 
				
			||||||
                UpdateCQMSData_CQMS(q);
 | 
					                UpdateCQMSData_CQMS(q);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static bool IsReportByDate(DateTime dateTime)
 | 
					        public static bool IsReportByDate(DateTime dateTime)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var result = false;
 | 
					            var result = false;
 | 
				
			||||||
            var q = (from x in Funs.DB.CQMSData_CQMS
 | 
					            var q = (from x in Funs.DB.CQMSData_CQMS
 | 
				
			||||||
                     where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date)
 | 
					                     where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date)
 | 
				
			||||||
                     select x).ToList();
 | 
					                     select x).ToList();
 | 
				
			||||||
            if (q != null && q.Count > 0)
 | 
					            if (q != null && q.Count > 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                result = true;
 | 
					                result = true;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 判断当天是否已统计
 | 
					        /// 判断当天是否已统计
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static bool IsReportByToday()
 | 
					        public static bool IsReportByToday()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var result = false;
 | 
					            var result = false;
 | 
				
			||||||
            var q = (from x in Funs.DB.CQMSData_CQMS
 | 
					            var q = (from x in Funs.DB.CQMSData_CQMS
 | 
				
			||||||
                     where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
 | 
					                     where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
 | 
				
			||||||
                     select x).ToList();
 | 
					                     select x).ToList();
 | 
				
			||||||
            if (q != null && q.Count > 0)
 | 
					            if (q != null && q.Count > 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                result = true;
 | 
					                result = true;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static Model.ReturnData PushCNCEC(string Id)
 | 
					        public static Model.ReturnData PushCNCEC(string Id)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            string baseurl = "/api/CQMSData/SaveCQMSData";
 | 
					            string baseurl = "/api/CQMSData/SaveCQMSData";
 | 
				
			||||||
            var item = GetItemById(Id);
 | 
					            var item = GetItemById(Id);
 | 
				
			||||||
            string str = JsonConvert.SerializeObject(item);
 | 
					            string str = JsonConvert.SerializeObject(item);
 | 
				
			||||||
            var responeData = BLL.ServerService.PushCNCEC(str, baseurl);
 | 
					            var responeData = BLL.ServerService.PushCNCEC(str, baseurl);
 | 
				
			||||||
            return responeData;
 | 
					            return responeData;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static CQMSData StatisticalData()
 | 
					        public static CQMSData StatisticalData()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            string thisUnitId = string.Empty;
 | 
					            string thisUnitId = string.Empty;
 | 
				
			||||||
            var thisUnit = Const.UnitId_CWCEC;
 | 
					            var thisUnit = Const.UnitId_CWCEC;
 | 
				
			||||||
            if (thisUnit != null)
 | 
					            if (thisUnit != null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                thisUnitId = thisUnit;
 | 
					                thisUnitId = thisUnit;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
 | 
					            var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
 | 
				
			||||||
            Project_CQMSDataService.StatisticalAllProjectData();
 | 
					            Project_CQMSDataService.StatisticalAllProjectData();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var ProjectData = (from x in Funs.DB.Project_CQMSData_CQMS
 | 
					            var ProjectData = (from x in Funs.DB.Project_CQMSData_CQMS
 | 
				
			||||||
                               where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
 | 
					                               where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
 | 
				
			||||||
                               select x).ToList();
 | 
					                               select x).ToList();
 | 
				
			||||||
            Model.CQMSData_CQMS table = new Model.CQMSData_CQMS
 | 
					            Model.CQMSData_CQMS table = new Model.CQMSData_CQMS
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                UnitId = thisUnitId,
 | 
					                UnitId = thisUnitId,
 | 
				
			||||||
                CollCropCode = base_Unit.CollCropCode,
 | 
					                CollCropCode = base_Unit.CollCropCode,
 | 
				
			||||||
                UnitName = base_Unit.UnitName,
 | 
					                UnitName = base_Unit.UnitName,
 | 
				
			||||||
                ReportDate = DateTime.Now.Date,
 | 
					                ReportDate = DateTime.Now.Date,
 | 
				
			||||||
                TrainPersonNum = ProjectData.Sum(x => x.TrainPersonNum),
 | 
					                TrainPersonNum = ProjectData.Sum(x => x.TrainPersonNum),
 | 
				
			||||||
                TechnicalDisclosePersonNum = ProjectData.Sum(x => x.TechnicalDisclosePersonNum),
 | 
					                TechnicalDisclosePersonNum = ProjectData.Sum(x => x.TechnicalDisclosePersonNum),
 | 
				
			||||||
                UseNum = ProjectData.Sum(x => x.UseNum),
 | 
					                UseNum = ProjectData.Sum(x => x.UseNum),
 | 
				
			||||||
                OKNum = ProjectData.Sum(x => x.OKNum),
 | 
					                OKNum = ProjectData.Sum(x => x.OKNum),
 | 
				
			||||||
                CompanyPersonNum = ProjectData.Sum(x => x.CompanyPersonNum),
 | 
					                CompanyPersonNum = GetCompanyPersonNum(),
 | 
				
			||||||
                BranchPersonNum = ProjectData.Sum(x => x.BranchPersonNum),
 | 
					                BranchPersonNum = GetBranchPersonNum(),
 | 
				
			||||||
                ProjectPersonNum = ProjectData.Sum(x => x.ProjectPersonNum),
 | 
					                ProjectPersonNum = ProjectData.Sum(x => x.ProjectPersonNum),
 | 
				
			||||||
                ProblemNum = ProjectData.Sum(x => x.ProblemNum),
 | 
					                ProblemNum = ProjectData.Sum(x => x.ProblemNum),
 | 
				
			||||||
                ProblemCompletedNum = ProjectData.Sum(x => x.ProblemCompletedNum),
 | 
					                ProblemCompletedNum = ProjectData.Sum(x => x.ProblemCompletedNum),
 | 
				
			||||||
                ProblemNotCompletedNum = ProjectData.Sum(x => x.ProblemNotCompletedNum),
 | 
					                ProblemNotCompletedNum = ProjectData.Sum(x => x.ProblemNotCompletedNum),
 | 
				
			||||||
                SNum = ProjectData.Sum(x => x.SNum),
 | 
					                SNum = ProjectData.Sum(x => x.SNum),
 | 
				
			||||||
                ANum = ProjectData.Sum(x => x.ANum),
 | 
					                ANum = ProjectData.Sum(x => x.ANum),
 | 
				
			||||||
                BNum = ProjectData.Sum(x => x.BNum),
 | 
					                BNum = ProjectData.Sum(x => x.BNum),
 | 
				
			||||||
                CNum = ProjectData.Sum(x => x.CNum),
 | 
					                CNum = ProjectData.Sum(x => x.CNum),
 | 
				
			||||||
                KeyProcessNum = ProjectData.Sum(x => x.KeyProcessNum),
 | 
					                KeyProcessNum = ProjectData.Sum(x => x.KeyProcessNum),
 | 
				
			||||||
                KeyProcessOKNum = ProjectData.Sum(x => x.KeyProcessOKNum),
 | 
					                KeyProcessOKNum = ProjectData.Sum(x => x.KeyProcessOKNum),
 | 
				
			||||||
                SpecialProcessNum = ProjectData.Sum(x => x.SpecialProcessNum),
 | 
					                SpecialProcessNum = ProjectData.Sum(x => x.SpecialProcessNum),
 | 
				
			||||||
                SpecialProcessOKNum = ProjectData.Sum(x => x.SpecialProcessOKNum),
 | 
					                SpecialProcessOKNum = ProjectData.Sum(x => x.SpecialProcessOKNum),
 | 
				
			||||||
                ConcealedWorksNum = ProjectData.Sum(x => x.ConcealedWorksNum),
 | 
					                ConcealedWorksNum = ProjectData.Sum(x => x.ConcealedWorksNum),
 | 
				
			||||||
                ConcealedWorksOKNum = ProjectData.Sum(x => x.ConcealedWorksOKNum),
 | 
					                ConcealedWorksOKNum = ProjectData.Sum(x => x.ConcealedWorksOKNum),
 | 
				
			||||||
                UnitProjectOnesNum = ProjectData.Sum(x => x.UnitProjectOnesNum),
 | 
					                UnitProjectOnesNum = ProjectData.Sum(x => x.UnitProjectOnesNum),
 | 
				
			||||||
                UnitProjectOnesOKNum = ProjectData.Sum(x => x.UnitProjectOnesOKNum),
 | 
					                UnitProjectOnesOKNum = ProjectData.Sum(x => x.UnitProjectOnesOKNum),
 | 
				
			||||||
                MaterialInRecheckNum = ProjectData.Sum(x => x.MaterialInRecheckNum),
 | 
					                MaterialInRecheckNum = ProjectData.Sum(x => x.MaterialInRecheckNum),
 | 
				
			||||||
                MaterialInRecheckOKNum = ProjectData.Sum(x => x.MaterialInRecheckOKNum),
 | 
					                MaterialInRecheckOKNum = ProjectData.Sum(x => x.MaterialInRecheckOKNum),
 | 
				
			||||||
                SingleProjectNum = ProjectData.Sum(x => x.SingleProjectNum),
 | 
					                SingleProjectNum = ProjectData.Sum(x => x.SingleProjectNum),
 | 
				
			||||||
                UnitProjectNum = ProjectData.Sum(x => x.UnitProjectNum),
 | 
					                UnitProjectNum = ProjectData.Sum(x => x.UnitProjectNum),
 | 
				
			||||||
                SubProjectNum = ProjectData.Sum(x => x.SubProjectNum),
 | 
					                SubProjectNum = ProjectData.Sum(x => x.SubProjectNum),
 | 
				
			||||||
                SubdivisionalWorksNum = ProjectData.Sum(x => x.SubdivisionalWorksNum),
 | 
					                SubdivisionalWorksNum = ProjectData.Sum(x => x.SubdivisionalWorksNum),
 | 
				
			||||||
                InspectionLotNum = ProjectData.Sum(x => x.InspectionLotNum),
 | 
					                InspectionLotNum = ProjectData.Sum(x => x.InspectionLotNum),
 | 
				
			||||||
                CreateMan = Const.sysglyId,
 | 
					                CreateMan = Const.sysglyId,
 | 
				
			||||||
                CreateDate = DateTime.Now,
 | 
					                CreateDate = DateTime.Now,
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            if (IsReportByToday())
 | 
					            if (IsReportByToday())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                table.Id = GetTodayData().Id;
 | 
					                table.Id = GetTodayData().Id;
 | 
				
			||||||
                table.State = Const.CNCEC_State_1;
 | 
					                table.State = Const.CNCEC_State_1;
 | 
				
			||||||
                UpdateCQMSData_CQMS(table);
 | 
					                UpdateCQMSData_CQMS(table);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                table.Id = SQLHelper.GetNewID();
 | 
					                table.Id = SQLHelper.GetNewID();
 | 
				
			||||||
                table.State = Const.CNCEC_State_0;
 | 
					                table.State = Const.CNCEC_State_0;
 | 
				
			||||||
                AddCQMSData_CQMS(table);
 | 
					                AddCQMSData_CQMS(table);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            CQMSData data = new CQMSData();
 | 
					            CQMSData data = new CQMSData();
 | 
				
			||||||
            data = GetDataByCQMSData_CQMS(table);
 | 
					            data = GetDataByCQMSData_CQMS(table);
 | 
				
			||||||
            return data;
 | 
					            return data;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static CQMSData GetDataByCQMSData_CQMS(Model.CQMSData_CQMS table)
 | 
					        public static CQMSData GetDataByCQMSData_CQMS(Model.CQMSData_CQMS table)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            CQMSData data = new CQMSData();
 | 
					            CQMSData data = new CQMSData();
 | 
				
			||||||
            CqmsDataItem item = new CqmsDataItem();
 | 
					            CqmsDataItem item = new CqmsDataItem();
 | 
				
			||||||
            item.Id = table.Id;
 | 
					            item.Id = table.Id;
 | 
				
			||||||
            item.ReportDate = table.ReportDate.Value.ToShortDateString();
 | 
					            item.ReportDate = table.ReportDate.Value.ToShortDateString();
 | 
				
			||||||
            item.UnitId = table.UnitId;
 | 
					            item.UnitId = table.UnitId;
 | 
				
			||||||
            item.CollCropCode = table.CollCropCode;
 | 
					            item.CollCropCode = table.CollCropCode;
 | 
				
			||||||
            item.TrainPersonNum = table.TrainPersonNum;
 | 
					            item.TrainPersonNum = table.TrainPersonNum;
 | 
				
			||||||
            item.TechnicalDisclosePersonNum = table.TechnicalDisclosePersonNum;
 | 
					            item.TechnicalDisclosePersonNum = table.TechnicalDisclosePersonNum;
 | 
				
			||||||
            item.UseNum = table.UseNum;
 | 
					            item.UseNum = table.UseNum;
 | 
				
			||||||
            item.OKNum = table.OKNum;
 | 
					            item.OKNum = table.OKNum;
 | 
				
			||||||
            item.CompanyPersonNum = table.CompanyPersonNum;
 | 
					            item.CompanyPersonNum = table.CompanyPersonNum;
 | 
				
			||||||
            item.BranchPersonNum = table.BranchPersonNum;
 | 
					            item.BranchPersonNum = table.BranchPersonNum;
 | 
				
			||||||
            item.ProjectPersonNum = table.ProjectPersonNum;
 | 
					            item.ProjectPersonNum = table.ProjectPersonNum;
 | 
				
			||||||
            item.ProblemNum = table.ProblemNum;
 | 
					            item.ProblemNum = table.ProblemNum;
 | 
				
			||||||
            item.ProblemCompletedNum = table.ProblemCompletedNum;
 | 
					            item.ProblemCompletedNum = table.ProblemCompletedNum;
 | 
				
			||||||
            item.ProblemNotCompletedNum = table.ProblemNotCompletedNum;
 | 
					            item.ProblemNotCompletedNum = table.ProblemNotCompletedNum;
 | 
				
			||||||
            item.ProblemRate = "";
 | 
					            item.ProblemRate = "";
 | 
				
			||||||
            item.SNum = table.SNum;
 | 
					            item.SNum = table.SNum;
 | 
				
			||||||
            item.ANum = table.ANum;
 | 
					            item.ANum = table.ANum;
 | 
				
			||||||
            item.BNum = table.BNum;
 | 
					            item.BNum = table.BNum;
 | 
				
			||||||
            item.CNum = table.CNum;
 | 
					            item.CNum = table.CNum;
 | 
				
			||||||
            item.KeyProcessNum = table.KeyProcessNum;
 | 
					            item.KeyProcessNum = table.KeyProcessNum;
 | 
				
			||||||
            item.KeyProcessOKNum = table.KeyProcessOKNum;
 | 
					            item.KeyProcessOKNum = table.KeyProcessOKNum;
 | 
				
			||||||
            item.KeyProcessRate = "";
 | 
					            item.KeyProcessRate = "";
 | 
				
			||||||
            item.SpecialProcessNum = table.SpecialProcessNum;
 | 
					            item.SpecialProcessNum = table.SpecialProcessNum;
 | 
				
			||||||
            item.SpecialProcessOKNum = table.SpecialProcessOKNum;
 | 
					            item.SpecialProcessOKNum = table.SpecialProcessOKNum;
 | 
				
			||||||
            item.SpecialProcessRate = "";
 | 
					            item.SpecialProcessRate = "";
 | 
				
			||||||
            item.ConcealedWorksNum = table.ConcealedWorksNum;
 | 
					            item.ConcealedWorksNum = table.ConcealedWorksNum;
 | 
				
			||||||
            item.ConcealedWorksOKNum = table.ConcealedWorksOKNum;
 | 
					            item.ConcealedWorksOKNum = table.ConcealedWorksOKNum;
 | 
				
			||||||
            item.ConcealedWorksRate = "";
 | 
					            item.ConcealedWorksRate = "";
 | 
				
			||||||
            item.UnitProjectOnesNum = table.UnitProjectOnesNum;
 | 
					            item.UnitProjectOnesNum = table.UnitProjectOnesNum;
 | 
				
			||||||
            item.UnitProjectOnesOKNum = table.UnitProjectOnesOKNum;
 | 
					            item.UnitProjectOnesOKNum = table.UnitProjectOnesOKNum;
 | 
				
			||||||
            item.UnitProjectOnesRate = "";
 | 
					            item.UnitProjectOnesRate = "";
 | 
				
			||||||
            item.MaterialInRecheckNum = table.MaterialInRecheckNum;
 | 
					            item.MaterialInRecheckNum = table.MaterialInRecheckNum;
 | 
				
			||||||
            item.MaterialInRecheckOKNum = table.MaterialInRecheckOKNum;
 | 
					            item.MaterialInRecheckOKNum = table.MaterialInRecheckOKNum;
 | 
				
			||||||
            item.MaterialInRecheckRate = "";
 | 
					            item.MaterialInRecheckRate = "";
 | 
				
			||||||
            item.SingleProjectNum = table.SingleProjectNum;
 | 
					            item.SingleProjectNum = table.SingleProjectNum;
 | 
				
			||||||
            item.UnitProjectNum = table.UnitProjectNum;
 | 
					            item.UnitProjectNum = table.UnitProjectNum;
 | 
				
			||||||
            item.SubProjectNum = table.SubProjectNum;
 | 
					            item.SubProjectNum = table.SubProjectNum;
 | 
				
			||||||
            item.SubdivisionalWorksNum = table.SubdivisionalWorksNum;
 | 
					            item.SubdivisionalWorksNum = table.SubdivisionalWorksNum;
 | 
				
			||||||
            item.InspectionLotNum = table.InspectionLotNum;
 | 
					            item.InspectionLotNum = table.InspectionLotNum;
 | 
				
			||||||
            List<CqmsDataItem> cqmsDataItems = new List<CqmsDataItem>();
 | 
					            List<CqmsDataItem> cqmsDataItems = new List<CqmsDataItem>();
 | 
				
			||||||
            cqmsDataItems.Add(item);
 | 
					            cqmsDataItems.Add(item);
 | 
				
			||||||
            data.CQMSDataItems = cqmsDataItems;
 | 
					            data.CQMSDataItems = cqmsDataItems;
 | 
				
			||||||
            return data;
 | 
					            return data;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static void UpdateCQMSData_CQMS(Model.CQMSData_CQMS newtable)
 | 
					        public static void UpdateCQMSData_CQMS(Model.CQMSData_CQMS newtable)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Model.SGGLDB db = Funs.DB;
 | 
					            Model.SGGLDB db = Funs.DB;
 | 
				
			||||||
            Model.CQMSData_CQMS table = db.CQMSData_CQMS.FirstOrDefault(x => x.Id == newtable.Id);
 | 
					            Model.CQMSData_CQMS table = db.CQMSData_CQMS.FirstOrDefault(x => x.Id == newtable.Id);
 | 
				
			||||||
            if (table != null)
 | 
					            if (table != null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                table.Id = newtable.Id;
 | 
					                table.Id = newtable.Id;
 | 
				
			||||||
                table.UnitId = newtable.UnitId;
 | 
					                table.UnitId = newtable.UnitId;
 | 
				
			||||||
                table.CollCropCode = newtable.CollCropCode;
 | 
					                table.CollCropCode = newtable.CollCropCode;
 | 
				
			||||||
                table.UnitName = newtable.UnitName;
 | 
					                table.UnitName = newtable.UnitName;
 | 
				
			||||||
                table.ReportDate = newtable.ReportDate;
 | 
					                table.ReportDate = newtable.ReportDate;
 | 
				
			||||||
                table.TrainPersonNum = newtable.TrainPersonNum;
 | 
					                table.TrainPersonNum = newtable.TrainPersonNum;
 | 
				
			||||||
                table.TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum;
 | 
					                table.TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum;
 | 
				
			||||||
                table.UseNum = newtable.UseNum;
 | 
					                table.UseNum = newtable.UseNum;
 | 
				
			||||||
                table.OKNum = newtable.OKNum;
 | 
					                table.OKNum = newtable.OKNum;
 | 
				
			||||||
                table.CompanyPersonNum = newtable.CompanyPersonNum;
 | 
					                table.CompanyPersonNum = newtable.CompanyPersonNum;
 | 
				
			||||||
                table.BranchPersonNum = newtable.BranchPersonNum;
 | 
					                table.BranchPersonNum = newtable.BranchPersonNum;
 | 
				
			||||||
                table.ProjectPersonNum = newtable.ProjectPersonNum;
 | 
					                table.ProjectPersonNum = newtable.ProjectPersonNum;
 | 
				
			||||||
                table.ProblemNum = newtable.ProblemNum;
 | 
					                table.ProblemNum = newtable.ProblemNum;
 | 
				
			||||||
                table.ProblemCompletedNum = newtable.ProblemCompletedNum;
 | 
					                table.ProblemCompletedNum = newtable.ProblemCompletedNum;
 | 
				
			||||||
                table.ProblemNotCompletedNum = newtable.ProblemNotCompletedNum;
 | 
					                table.ProblemNotCompletedNum = newtable.ProblemNotCompletedNum;
 | 
				
			||||||
                table.SNum = newtable.SNum;
 | 
					                table.SNum = newtable.SNum;
 | 
				
			||||||
                table.ANum = newtable.ANum;
 | 
					                table.ANum = newtable.ANum;
 | 
				
			||||||
                table.BNum = newtable.BNum;
 | 
					                table.BNum = newtable.BNum;
 | 
				
			||||||
                table.CNum = newtable.CNum;
 | 
					                table.CNum = newtable.CNum;
 | 
				
			||||||
                table.KeyProcessNum = newtable.KeyProcessNum;
 | 
					                table.KeyProcessNum = newtable.KeyProcessNum;
 | 
				
			||||||
                table.KeyProcessOKNum = newtable.KeyProcessOKNum;
 | 
					                table.KeyProcessOKNum = newtable.KeyProcessOKNum;
 | 
				
			||||||
                table.SpecialProcessNum = newtable.SpecialProcessNum;
 | 
					                table.SpecialProcessNum = newtable.SpecialProcessNum;
 | 
				
			||||||
                table.SpecialProcessOKNum = newtable.SpecialProcessOKNum;
 | 
					                table.SpecialProcessOKNum = newtable.SpecialProcessOKNum;
 | 
				
			||||||
                table.ConcealedWorksNum = newtable.ConcealedWorksNum;
 | 
					                table.ConcealedWorksNum = newtable.ConcealedWorksNum;
 | 
				
			||||||
                table.ConcealedWorksOKNum = newtable.ConcealedWorksOKNum;
 | 
					                table.ConcealedWorksOKNum = newtable.ConcealedWorksOKNum;
 | 
				
			||||||
                table.UnitProjectOnesNum = newtable.UnitProjectOnesNum;
 | 
					                table.UnitProjectOnesNum = newtable.UnitProjectOnesNum;
 | 
				
			||||||
                table.UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum;
 | 
					                table.UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum;
 | 
				
			||||||
                table.MaterialInRecheckNum = newtable.MaterialInRecheckNum;
 | 
					                table.MaterialInRecheckNum = newtable.MaterialInRecheckNum;
 | 
				
			||||||
                table.MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum;
 | 
					                table.MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum;
 | 
				
			||||||
                table.SingleProjectNum = newtable.SingleProjectNum;
 | 
					                table.SingleProjectNum = newtable.SingleProjectNum;
 | 
				
			||||||
                table.UnitProjectNum = newtable.UnitProjectNum;
 | 
					                table.UnitProjectNum = newtable.UnitProjectNum;
 | 
				
			||||||
                table.SubProjectNum = newtable.SubProjectNum;
 | 
					                table.SubProjectNum = newtable.SubProjectNum;
 | 
				
			||||||
                table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
 | 
					                table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
 | 
				
			||||||
                table.InspectionLotNum = newtable.InspectionLotNum;
 | 
					                table.InspectionLotNum = newtable.InspectionLotNum;
 | 
				
			||||||
                table.State = newtable.State;
 | 
					                table.State = newtable.State;
 | 
				
			||||||
                table.CreateMan = newtable.CreateMan;
 | 
					                table.CreateMan = newtable.CreateMan;
 | 
				
			||||||
                table.CreateDate = newtable.CreateDate;
 | 
					                table.CreateDate = newtable.CreateDate;
 | 
				
			||||||
                db.SubmitChanges();
 | 
					                db.SubmitChanges();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
        /// 获取企业总部人数
        /// </summary>
        /// <returns></returns>
        public static int GetCompanyPersonNum()
        {
            string unitId = BLL.Const.UnitId_CWCEC;
            int result = (from x in Funs.DB.Person_CompanyBranchPerson
                          join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
                          where x.IsOnJob == true && y.IsCQMS == true && x.UnitId == unitId
                          select x).Count();
            return result;
        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
        /// 获取分支机构人数
        /// </summary>
        /// <returns></returns>
        public static int GetBranchPersonNum()
        {
            string unitId = BLL.Const.UnitId_CWCEC;
            int result = (from x in Funs.DB.Person_CompanyBranchPerson
                          join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
                          where x.IsOnJob == true && y.IsCQMS == true && x.UnitId != unitId
                          select x).Count();
            return result;
        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -538,9 +538,9 @@ namespace BLL
 | 
				
			||||||
            var ProjectData = (from x in Funs.DB.Project_HSSEData_HSSE
 | 
					            var ProjectData = (from x in Funs.DB.Project_HSSEData_HSSE
 | 
				
			||||||
                               where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
 | 
					                               where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
 | 
				
			||||||
                               select x).ToList();
 | 
					                               select x).ToList();
 | 
				
			||||||
            //int TotalEnergyConsumption= Information_EnvironmentalDataService.GetLatstTimeTotalEnergyConsumption();
 | 
					            decimal TotalEnergyConsumption = GetLatstTimeTotalEnergyConsumption();
 | 
				
			||||||
            //int IncomeComprehensiveEnergyConsumption = Information_EnvironmentalDataService.GetLatstTimeIncomeComprehensiveEnergyConsumption();
 | 
					            decimal IncomeComprehensiveEnergyConsumption = GetLatstTimeIncomeComprehensiveEnergyConsumption();
 | 
				
			||||||
            //int NewWaterConsumption = Information_EnvironmentalDataService.GetLatstTimeNewWaterConsumption();
 | 
					            decimal NewWaterConsumption = GetLatstTimeNewWaterConsumption();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Model.HSSEData_HSSE table = new Model.HSSEData_HSSE
 | 
					            Model.HSSEData_HSSE table = new Model.HSSEData_HSSE
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -801,9 +801,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetSafetyCommitteeMeetingNum()
 | 
					        public static int GetSafetyCommitteeMeetingNum()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Meeting_CompanySafetyMeeting select x).Count();
 | 
				
			||||||
            //int result = (from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompanySafetyMeetingDate.Value.Year == date.Year && x.CompanySafetyMeetingDate.Value.Month == date.Month && x.CompanySafetyMeetingDate.Value.Day == date.Day select x).Count();
 | 
					            return result;
 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取企业专题会议数
 | 
					        /// 获取企业专题会议数
 | 
				
			||||||
| 
						 | 
					@ -811,9 +810,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetEnterpriseTopicsMeetingNum()
 | 
					        public static int GetEnterpriseTopicsMeetingNum()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Meeting_CompanySpecialMeeting select x).Count();
 | 
				
			||||||
            //int result = (from x in Funs.DB.Meeting_CompanySpecialMeeting where x.CompanySpecialMeetingDate.Value.Year == date.Year && x.CompanySpecialMeetingDate.Value.Month == date.Month && x.CompanySpecialMeetingDate.Value.Day == date.Day select x).Count();
 | 
					            return result;
 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -822,9 +820,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetCompanyLeadShiftCheckNum()
 | 
					        public static int GetCompanyLeadShiftCheckNum()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "1" select x).Count();
 | 
				
			||||||
            //int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "1" && x.CheckDate.Value.Year == date.Year && x.CheckDate.Value.Month == date.Month && x.CheckDate.Value.Day == date.Day select x).Count();
 | 
					            return result;
 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取企业综合检查次数
 | 
					        /// 获取企业综合检查次数
 | 
				
			||||||
| 
						 | 
					@ -832,9 +829,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetCompanyComprehensiveCheckNum()
 | 
					        public static int GetCompanyComprehensiveCheckNum()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "2" select x).Count();
 | 
				
			||||||
            //int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "2" && x.CheckDate.Value.Year == date.Year && x.CheckDate.Value.Month == date.Month && x.CheckDate.Value.Day == date.Day select x).Count();
 | 
					            return result;
 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取企业专项检查次数
 | 
					        /// 获取企业专项检查次数
 | 
				
			||||||
| 
						 | 
					@ -842,9 +838,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetCompanySpecialCheckNum()
 | 
					        public static int GetCompanySpecialCheckNum()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "3" select x).Count();
 | 
				
			||||||
            //int result = (from x in Funs.DB.Supervise_SuperviseCheckReport where x.CheckType == "3" && x.CheckDate.Value.Year == date.Year && x.CheckDate.Value.Month == date.Month && x.CheckDate.Value.Day == date.Day select x).Count();
 | 
					            return result;
 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取企业级综合预案数
 | 
					        /// 获取企业级综合预案数
 | 
				
			||||||
| 
						 | 
					@ -852,13 +847,11 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetCompanyComprehensivePlanNum()
 | 
					        public static int GetCompanyComprehensivePlanNum()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Emergency_EmergencyList_Unit
 | 
				
			||||||
            //int result = (from x in Funs.DB.Emergency_EmergencyList_Unit
 | 
					                          join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
				
			||||||
            //              join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
					                          where y.EmergencyTypeName.Contains("综合")
 | 
				
			||||||
            //              where x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
 | 
					                          select x).Count();
 | 
				
			||||||
            //              && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("综合")
 | 
					            return result;
 | 
				
			||||||
            //              select x).Count();
 | 
					 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取企业级专项预案数
 | 
					        /// 获取企业级专项预案数
 | 
				
			||||||
| 
						 | 
					@ -866,13 +859,11 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetCompanySpecialPlanNum()
 | 
					        public static int GetCompanySpecialPlanNum()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Emergency_EmergencyList_Unit
 | 
				
			||||||
            //int result = (from x in Funs.DB.Emergency_EmergencyList_Unit
 | 
					                          join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
				
			||||||
            //              join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
					                          where y.EmergencyTypeName.Contains("专项")
 | 
				
			||||||
            //              where x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
 | 
					                          select x).Count();
 | 
				
			||||||
            //              && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("专项")
 | 
					            return result;
 | 
				
			||||||
            //              select x).Count();
 | 
					 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取企业级现场处置预案
 | 
					        /// 获取企业级现场处置预案
 | 
				
			||||||
| 
						 | 
					@ -880,13 +871,11 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetCompanyOnSiteDisposalPlan()
 | 
					        public static int GetCompanyOnSiteDisposalPlan()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Emergency_EmergencyList_Unit
 | 
				
			||||||
            //int result = (from x in Funs.DB.Emergency_EmergencyList_Unit
 | 
					                          join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
				
			||||||
            //              join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
					                          where y.EmergencyTypeName.Contains("现场处置")
 | 
				
			||||||
            //              where x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
 | 
					                          select x).Count();
 | 
				
			||||||
            //              && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("现场处置")
 | 
					            return result;
 | 
				
			||||||
            //              select x).Count();
 | 
					 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取企业级演练次数
 | 
					        /// 获取企业级演练次数
 | 
				
			||||||
| 
						 | 
					@ -894,12 +883,54 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetCompanyDrillNum()
 | 
					        public static int GetCompanyDrillNum()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Emergency_DrillRecordList_Unit
 | 
				
			||||||
            //int result = (from x in Funs.DB.Emergency_DrillRecordList_Unit
 | 
					                          select x).Count();
 | 
				
			||||||
            //              where x.DrillRecordDate.Value.Year == date.Year && x.DrillRecordDate.Value.Month == date.Month
 | 
					            return result;
 | 
				
			||||||
            //              && x.DrillRecordDate.Value.Day == date.Day
 | 
					        }
 | 
				
			||||||
            //              select x).Count();
 | 
					
 | 
				
			||||||
            return 0;
 | 
					        public static decimal GetLatstTimeTotalEnergyConsumption()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var q1 = (from x in db.Environmental_ChemicalReportItem where x.SortIndex == "01" select x);
 | 
				
			||||||
 | 
					            decimal d1 = 0;
 | 
				
			||||||
 | 
					            foreach (var item in q1)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                d1 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            var q2 = (from x in db.Environmental_ArchitectureReportItem where x.SortIndex == "01" select x);
 | 
				
			||||||
 | 
					            decimal d2 = 0;
 | 
				
			||||||
 | 
					            foreach (var item in q2)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                d2 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return d1 + d2;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public static decimal GetLatstTimeIncomeComprehensiveEnergyConsumption()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var q2 = (from x in db.Environmental_ArchitectureReportItem where x.SortIndex == "15" select x);
 | 
				
			||||||
 | 
					            decimal d2 = 0;
 | 
				
			||||||
 | 
					            foreach (var item in q2)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                d2 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return d2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public static decimal GetLatstTimeNewWaterConsumption()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var q1 = (from x in db.Environmental_ChemicalReportItem where x.SortIndex == "70" select x);
 | 
				
			||||||
 | 
					            decimal d1 = 0;
 | 
				
			||||||
 | 
					            foreach (var item in q1)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                d1 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            var q2 = (from x in db.Environmental_ArchitectureReportItem where x.SortIndex == "38" select x);
 | 
				
			||||||
 | 
					            decimal d2 = 0;
 | 
				
			||||||
 | 
					            foreach (var item in q2)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                d2 += Funs.GetNewDecimalOrZero(item.ThisYearValue);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return d1 + d2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -411,9 +411,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetTrainPersonNum(string projectid)
 | 
					        public static int GetTrainPersonNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            int result = (from x in Funs.DB.Comprehensive_InspectionPerson
 | 
					            int result = (from x in Funs.DB.Comprehensive_InspectionPerson
 | 
				
			||||||
                          where x.ProjectId == projectid && x.IsTrain == true && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month && x.CompileDate.Value.Day == date.Day
 | 
					                          where x.ProjectId == projectid && x.IsTrain == true
 | 
				
			||||||
                          select x).Count();
 | 
					                          select x).Count();
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -423,9 +422,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetTechnicalDisclosePersonNum(string projectid)
 | 
					        public static int GetTechnicalDisclosePersonNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            var result = (from x in Funs.DB.Comprehensive_DesignDetails
 | 
					            var result = (from x in Funs.DB.Comprehensive_DesignDetails
 | 
				
			||||||
                          where x.ProjectId == projectid && x.DetailsDate.Value.Year == date.Year && x.DetailsDate.Value.Month == date.Month && x.DetailsDate.Value.Day == date.Day
 | 
					                          where x.ProjectId == projectid
 | 
				
			||||||
                          select x.JoinPersonNum).ToList().Sum(x => x.Value);
 | 
					                          select x.JoinPersonNum).ToList().Sum(x => x.Value);
 | 
				
			||||||
            var q = Funs.GetNewIntOrZero(result.ToString());
 | 
					            var q = Funs.GetNewIntOrZero(result.ToString());
 | 
				
			||||||
            return q;
 | 
					            return q;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -301,10 +301,32 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetTotalDineNum(string projectid)
 | 
					        public static int GetTotalDineNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //int result = Convert.ToInt32((from x in Funs.DB.PW_JointInfo
 | 
					            int result = 0;
 | 
				
			||||||
            //                              where x.ProjectId == projectid
 | 
					            if (projectid != null)
 | 
				
			||||||
            //                              select x.JOT_Size).ToList().Sum());
 | 
					            {
 | 
				
			||||||
            return 0;
 | 
					                var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
 | 
				
			||||||
 | 
					                            where x.ProjectId == projectid.ToString()
 | 
				
			||||||
 | 
					                            select x;
 | 
				
			||||||
 | 
					                if (getD1.Count() > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    foreach (var item in getD1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        result += Funs.GetNewIntOrZero(item.TotalWeldQuantity.Split('.')[0]);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var getD2 = (from x in Funs.DB.HJGL_FL_Data
 | 
				
			||||||
 | 
					                                 where x.ProjectId == projectid.ToString()
 | 
				
			||||||
 | 
					                                 orderby x.CompileDate descending
 | 
				
			||||||
 | 
					                                 select x).FirstOrDefault();
 | 
				
			||||||
 | 
					                    if (getD2 != null)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        result = Funs.GetNewIntOrZero(getD2.TotalWeldQuantity.Split('.')[0]);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取完成达因数
 | 
					        /// 获取完成达因数
 | 
				
			||||||
| 
						 | 
					@ -312,10 +334,32 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetCompleteDineNum(string projectid)
 | 
					        public static int GetCompleteDineNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //int result = Convert.ToInt32((from x in Funs.DB.PW_JointInfo
 | 
					            int result = 0;
 | 
				
			||||||
            //                              where x.ProjectId == projectid
 | 
					            if (projectid != null)
 | 
				
			||||||
            //                              select x.JOT_DoneDin ).ToList().Sum());
 | 
					            {
 | 
				
			||||||
            return 0;
 | 
					                var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
 | 
				
			||||||
 | 
					                            where x.ProjectId == projectid.ToString()
 | 
				
			||||||
 | 
					                            select x;
 | 
				
			||||||
 | 
					                if (getD1.Count() > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    foreach (var item in getD1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        result += Funs.GetNewIntOrZero(item.TotalCompleted.Split('.')[0]);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var getD2 = (from x in Funs.DB.HJGL_FL_Data
 | 
				
			||||||
 | 
					                                 where x.ProjectId == projectid.ToString()
 | 
				
			||||||
 | 
					                                 orderby x.CompileDate descending
 | 
				
			||||||
 | 
					                                 select x).FirstOrDefault();
 | 
				
			||||||
 | 
					                    if (getD2 != null)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        result = Funs.GetNewIntOrZero(getD2.TotalCompleted.Split('.')[0]);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取总片数
 | 
					        /// 获取总片数
 | 
				
			||||||
| 
						 | 
					@ -323,11 +367,32 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetTotalFilmNum(string projectid)
 | 
					        public static int GetTotalFilmNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
 | 
					            int result = 0;
 | 
				
			||||||
            //              join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
 | 
					            if (projectid != null)
 | 
				
			||||||
            //              where y.ProjectId == projectid
 | 
					            {
 | 
				
			||||||
            //              select x.CHT_TotalFilm  ).ToList().Sum());
 | 
					                var getD1 = from x in Funs.DB.HJGL_FL_NdtList
 | 
				
			||||||
            return 0;
 | 
					                            where x.ProjectId == projectid.ToString()
 | 
				
			||||||
 | 
					                            select x;
 | 
				
			||||||
 | 
					                if (getD1.Count() > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    foreach (var item in getD1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        result += Funs.GetNewIntOrZero(item.OneTimeFilmAmount.Split('.')[0]);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var getD2 = (from x in Funs.DB.HJGL_FL_Data
 | 
				
			||||||
 | 
					                                 where x.ProjectId == projectid.ToString()
 | 
				
			||||||
 | 
					                                 orderby x.CompileDate descending
 | 
				
			||||||
 | 
					                                 select x).FirstOrDefault();
 | 
				
			||||||
 | 
					                    if (getD2 != null)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        result = Funs.GetNewIntOrZero(getD2.OneTimeFilmAmount.Split('.')[0]);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取合格片数
 | 
					        /// 获取合格片数
 | 
				
			||||||
| 
						 | 
					@ -335,11 +400,32 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetOKFilmNum(string projectid)
 | 
					        public static int GetOKFilmNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
 | 
					            int result = 0;
 | 
				
			||||||
            //              join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
 | 
					            if (projectid != null)
 | 
				
			||||||
            //              where y.ProjectId == projectid
 | 
					            {
 | 
				
			||||||
            //              select x.CHT_PassFilm).ToList().Sum());
 | 
					                var getD1 = from x in Funs.DB.HJGL_FL_NdtList
 | 
				
			||||||
            return 0;
 | 
					                            where x.ProjectId == projectid.ToString()
 | 
				
			||||||
 | 
					                            select x;
 | 
				
			||||||
 | 
					                if (getD1.Count() > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    foreach (var item in getD1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        result += Funs.GetNewIntOrZero(item.OneTimeFilmQualifiedAmount.Split('.')[0]);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var getD2 = (from x in Funs.DB.HJGL_FL_Data
 | 
				
			||||||
 | 
					                                 where x.ProjectId == projectid.ToString()
 | 
				
			||||||
 | 
					                                 orderby x.CompileDate descending
 | 
				
			||||||
 | 
					                                 select x).FirstOrDefault();
 | 
				
			||||||
 | 
					                    if (getD2 != null)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        result = Funs.GetNewIntOrZero(getD2.OneTimeFilmQualifiedAmount.Split('.')[0]);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -682,12 +682,11 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetTotalWorkingHour(string projectid)
 | 
					        public static int GetTotalWorkingHour(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            var result = (from x in Funs.DB.SitePerson_DayReportDetail
 | 
					            var result = (from x in Funs.DB.SitePerson_DayReportDetail
 | 
				
			||||||
                          join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
 | 
					                          join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
 | 
				
			||||||
                          where y.ProjectId == projectid && y.CompileDate.Value.Year == date.Year && y.CompileDate.Value.Month == date.Month && y.CompileDate.Value.Day == date.Day
 | 
					                          where y.ProjectId == projectid
 | 
				
			||||||
                        select  x.PersonWorkTime  ).ToList().Sum(x=>x.Value);          
 | 
					                          select x.PersonWorkTime).ToList().Sum(x => x.Value);
 | 
				
			||||||
            var q = Funs.GetNewIntOrZero(result.ToString());             
 | 
					            var q = Funs.GetNewIntOrZero(result.ToString());
 | 
				
			||||||
            return q;
 | 
					            return q;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -696,9 +695,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetLostWorkingHour(string projectid)
 | 
					        public static int GetLostWorkingHour(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					            var result = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid select x.WorkHoursLoss).ToList().Sum(x => x.Value)
 | 
				
			||||||
            var result = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day select x.WorkHoursLoss).ToList().Sum(x => x.Value)
 | 
					            + (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
 | 
				
			||||||
            + (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
 | 
					 | 
				
			||||||
            var q = Funs.GetNewIntOrZero(result.ToString());
 | 
					            var q = Funs.GetNewIntOrZero(result.ToString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return q;
 | 
					            return q;
 | 
				
			||||||
| 
						 | 
					@ -709,13 +707,12 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetSafeWorkingHour(string projectid)
 | 
					        public static int GetSafeWorkingHour(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            var result1 = (from x in Funs.DB.SitePerson_DayReportDetail
 | 
					            var result1 = (from x in Funs.DB.SitePerson_DayReportDetail
 | 
				
			||||||
                           join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
 | 
					                           join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
 | 
				
			||||||
                           where y.ProjectId == projectid && y.CompileDate.Value.Year == date.Year && y.CompileDate.Value.Month == date.Month && y.CompileDate.Value.Day == date.Day
 | 
					                           where y.ProjectId == projectid
 | 
				
			||||||
                           select x.PersonWorkTime).ToList().Sum(x => x.Value);
 | 
					                           select x.PersonWorkTime).ToList().Sum(x => x.Value);
 | 
				
			||||||
            var result2 = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day select x.WorkHoursLoss).ToList().Sum(x => x.Value)
 | 
					            var result2 = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid select x.WorkHoursLoss).ToList().Sum(x => x.Value)
 | 
				
			||||||
              + (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
 | 
					              + (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
 | 
				
			||||||
            var result = result1 - result2;
 | 
					            var result = result1 - result2;
 | 
				
			||||||
            var q = Funs.GetNewIntOrZero(result.ToString());
 | 
					            var q = Funs.GetNewIntOrZero(result.ToString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -727,10 +724,9 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetSafeTrainNum(string projectid)
 | 
					        public static int GetSafeTrainNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            int result = (from x in Funs.DB.EduTrain_TrainRecord
 | 
					            int result = (from x in Funs.DB.EduTrain_TrainRecord
 | 
				
			||||||
                          join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
 | 
					                          join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
 | 
				
			||||||
                          where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "1"
 | 
					                          where x.ProjectId == projectid && y.TrainType == "1"
 | 
				
			||||||
                          select x).Count();
 | 
					                          select x).Count();
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -740,10 +736,9 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetSpecialTrainNum(string projectid)
 | 
					        public static int GetSpecialTrainNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            int result = (from x in Funs.DB.EduTrain_TrainRecord
 | 
					            int result = (from x in Funs.DB.EduTrain_TrainRecord
 | 
				
			||||||
                          join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
 | 
					                          join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
 | 
				
			||||||
                          where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "2"
 | 
					                          where x.ProjectId == projectid && y.TrainType == "2"
 | 
				
			||||||
                          select x).Count();
 | 
					                          select x).Count();
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -753,10 +748,9 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetSpecialOperationTrainNum(string projectid)
 | 
					        public static int GetSpecialOperationTrainNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            int result = (from x in Funs.DB.EduTrain_TrainRecord
 | 
					            int result = (from x in Funs.DB.EduTrain_TrainRecord
 | 
				
			||||||
                          join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
 | 
					                          join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
 | 
				
			||||||
                          where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "3"
 | 
					                          where x.ProjectId == projectid && y.TrainType == "3"
 | 
				
			||||||
                          select x).Count();
 | 
					                          select x).Count();
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -929,9 +923,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetProjectSafetyLeadingGroupMeetingNum(string projectid)
 | 
					        public static int GetProjectSafetyLeadingGroupMeetingNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.ProjectId == projectid select x).Count();
 | 
				
			||||||
            //int result = (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.ProjectId == projectid && x.SafetyLeaderGroupMeetingDate.Value.Year == date.Year && x.SafetyLeaderGroupMeetingDate.Value.Month == date.Month && x.SafetyLeaderGroupMeetingDate.Value.Day == date.Day select x).Count();
 | 
					            return result;
 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取项目安全例会数
 | 
					        /// 获取项目安全例会数
 | 
				
			||||||
| 
						 | 
					@ -939,9 +932,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetProjectSafetyMeetingNum(string projectid)
 | 
					        public static int GetProjectSafetyMeetingNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Meeting_WeekMeeting where x.ProjectId == projectid select x).Count()
 | 
				
			||||||
            int result = (from x in Funs.DB.Meeting_WeekMeeting where x.ProjectId == projectid && x.WeekMeetingDate.Value.Year == date.Year && x.WeekMeetingDate.Value.Month == date.Month && x.WeekMeetingDate.Value.Day == date.Day select x).Count()
 | 
					                + (from x in Funs.DB.Meeting_MonthMeeting where x.ProjectId == projectid select x).Count();
 | 
				
			||||||
                + (from x in Funs.DB.Meeting_MonthMeeting where x.ProjectId == projectid && x.MonthMeetingDate.Value.Year == date.Year && x.MonthMeetingDate.Value.Month == date.Month && x.MonthMeetingDate.Value.Day == date.Day select x).Count();
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -977,9 +969,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetProjectLeadShiftCheckNum(string projectid)
 | 
					        public static int GetProjectLeadShiftCheckNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Check_ProjectLeaderCheck where x.ProjectId == projectid select x).Count();
 | 
				
			||||||
            //int result = (from x in Funs.DB.Check_ProjectLeaderCheck where x.ProjectId == projectid && x.CheckDate.Value.Year == date.Year && x.CheckDate.Value.Month == date.Month && x.CheckDate.Value.Day == date.Day select x).Count();
 | 
					            return result;
 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取项目专项检查次数
 | 
					        /// 获取项目专项检查次数
 | 
				
			||||||
| 
						 | 
					@ -987,8 +978,7 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetProjectSpecialCheckNum(string projectid)
 | 
					        public static int GetProjectSpecialCheckNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Check_CheckSpecial where x.ProjectId == projectid select x).Count();
 | 
				
			||||||
            int result = (from x in Funs.DB.Check_CheckSpecial where x.ProjectId == projectid && x.CheckTime.Value.Year == date.Year && x.CheckTime.Value.Month == date.Month && x.CheckTime.Value.Day == date.Day select x).Count();
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -997,8 +987,7 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetProjectMajorCheckNum(string projectid)
 | 
					        public static int GetProjectMajorCheckNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister where x.ProjectId == projectid select x).Count();
 | 
				
			||||||
            int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister where x.ProjectId == projectid && x.CheckTime.Value.Year == date.Year && x.CheckTime.Value.Month == date.Month && x.CheckTime.Value.Day == date.Day select x).Count();
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -1007,10 +996,9 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetNearMissNum(string projectid)
 | 
					        public static int GetNearMissNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            int result = (from x in Funs.DB.Accident_AccidentPersonRecord
 | 
					            int result = (from x in Funs.DB.Accident_AccidentPersonRecord
 | 
				
			||||||
                          join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
 | 
					                          join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
 | 
				
			||||||
                          where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && x.IsAttempt=="1"
 | 
					                          where x.ProjectId == projectid && x.IsAttempt == "1"
 | 
				
			||||||
                          select x).Count();
 | 
					                          select x).Count();
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -1020,10 +1008,9 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetRecordableEventNum(string projectid)
 | 
					        public static int GetRecordableEventNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            int result = (from x in Funs.DB.Accident_AccidentPersonRecord
 | 
					            int result = (from x in Funs.DB.Accident_AccidentPersonRecord
 | 
				
			||||||
                          join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
 | 
					                          join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
 | 
				
			||||||
                          where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && x.IsAttempt != "1"
 | 
					                          where x.ProjectId == projectid
 | 
				
			||||||
                          select x).Count();
 | 
					                          select x).Count();
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -1033,8 +1020,7 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetGeneralAccidentNum(string projectid)
 | 
					        public static int GetGeneralAccidentNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "1" select x).Count();
 | 
				
			||||||
            int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "1" select x).Count();
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -1043,8 +1029,7 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetMajorAccidentNum(string projectid)
 | 
					        public static int GetMajorAccidentNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "2" select x).Count();
 | 
				
			||||||
            int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "2" select x).Count();
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -1053,8 +1038,7 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetSeriousAccidentNum(string projectid)
 | 
					        public static int GetSeriousAccidentNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "3" select x).Count();
 | 
				
			||||||
            int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "3" select x).Count();
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -1063,8 +1047,7 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetSpecialSeriousAccidentNum(string projectid)
 | 
					        public static int GetSpecialSeriousAccidentNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					            int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDegree == "4" select x).Count();
 | 
				
			||||||
            int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "4" select x).Count();
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -1109,11 +1092,9 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetProjectComprehensivePlanNum(string projectid)
 | 
					        public static int GetProjectComprehensivePlanNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            int result = (from x in Funs.DB.Emergency_EmergencyList
 | 
					            int result = (from x in Funs.DB.Emergency_EmergencyList
 | 
				
			||||||
                          join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
					                          join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
				
			||||||
                          where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
 | 
					                          where x.ProjectId == projectid && y.EmergencyTypeName.Contains("综合")
 | 
				
			||||||
                          && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("综合")
 | 
					 | 
				
			||||||
                          select x).Count();
 | 
					                          select x).Count();
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -1123,11 +1104,9 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetProjectSpecialPlanNum(string projectid)
 | 
					        public static int GetProjectSpecialPlanNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            int result = (from x in Funs.DB.Emergency_EmergencyList
 | 
					            int result = (from x in Funs.DB.Emergency_EmergencyList
 | 
				
			||||||
                          join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
					                          join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
				
			||||||
                          where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
 | 
					                          where x.ProjectId == projectid && y.EmergencyTypeName.Contains("专项")
 | 
				
			||||||
                          && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("专项")
 | 
					 | 
				
			||||||
                          select x).Count();
 | 
					                          select x).Count();
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -1137,11 +1116,9 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetProjectOnSiteDisposalPlan(string projectid)
 | 
					        public static int GetProjectOnSiteDisposalPlan(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            int result = (from x in Funs.DB.Emergency_EmergencyList
 | 
					            int result = (from x in Funs.DB.Emergency_EmergencyList
 | 
				
			||||||
                          join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
					                          join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
 | 
				
			||||||
                          where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
 | 
					                          where x.ProjectId == projectid && y.EmergencyTypeName.Contains("现场处置")
 | 
				
			||||||
                          && x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("现场处置")
 | 
					 | 
				
			||||||
                          select x).Count();
 | 
					                          select x).Count();
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -1151,10 +1128,8 @@ namespace BLL
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static int GetProjectDrillNum(string projectid)
 | 
					        public static int GetProjectDrillNum(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime date = DateTime.Now;
 | 
					 | 
				
			||||||
            int result = (from x in Funs.DB.Emergency_DrillRecordList
 | 
					            int result = (from x in Funs.DB.Emergency_DrillRecordList
 | 
				
			||||||
                          where x.ProjectId == projectid && x.DrillRecordDate.Value.Year == date.Year && x.DrillRecordDate.Value.Month == date.Month
 | 
					                          where x.ProjectId == projectid
 | 
				
			||||||
                          && x.DrillRecordDate.Value.Day == date.Day
 | 
					 | 
				
			||||||
                          select x).Count();
 | 
					                          select x).Count();
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -1174,6 +1149,12 @@ namespace BLL
 | 
				
			||||||
        public static int GetCostUse(string projectid)
 | 
					        public static int GetCostUse(string projectid)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            int result = 0;
 | 
					            int result = 0;
 | 
				
			||||||
 | 
					            var costs = (from x in Funs.DB.CostGoods_CostSmallDetailItem
 | 
				
			||||||
 | 
					                         join y in Funs.DB.CostGoods_CostSmallDetail
 | 
				
			||||||
 | 
					                         on x.CostSmallDetailId equals y.CostSmallDetailId
 | 
				
			||||||
 | 
					                         where y.ProjectId == projectid
 | 
				
			||||||
 | 
					                         select x.CostMoney ?? 0).ToList().Sum();
 | 
				
			||||||
 | 
					            result = Funs.GetNewIntOrZero(costs.ToString().Split('.')[0]);
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -1341,7 +1322,7 @@ namespace BLL
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            int result = (from x in Funs.DB.Solution_LargerHazard
 | 
					            int result = (from x in Funs.DB.Solution_LargerHazard
 | 
				
			||||||
                          where x.ProjectId == projectid && x.IsSuperLargerHazard == false
 | 
					                          where x.ProjectId == projectid && x.IsSuperLargerHazard == false
 | 
				
			||||||
                          select x.TrainPersonNum ).ToList().Sum(x=>x.Value);
 | 
					                          select x.TrainPersonNum).ToList().Sum(x => x.Value);
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue