diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo
index ccd69612..918d4df6 100644
Binary files a/.vs/SGGL_SeDin/v17/.wsuo and b/.vs/SGGL_SeDin/v17/.wsuo differ
diff --git a/DataBase/版本日志/SGGLDB_V2024-03-11.sql b/DataBase/版本日志/SGGLDB_V2024-03-11.sql
new file mode 100644
index 00000000..d8c8cae4
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2024-03-11.sql
@@ -0,0 +1,185 @@
+INSERT [Sys_Menu] ([MenuId],[MenuName],[SortIndex],[SuperMenu],[MenuType],[IsOffice],[IsEnd],[IsUsed])
+VALUES ( N'1FF4F8D5-C9AA-4C59-B392-1F025AEB8DEE',N'发票管理',90,N'0',N'Menu_PHTGL',0,0,1)
+Go
+ INSERT [Sys_Menu] ([MenuId],[MenuName],[Url],[SortIndex],[SuperMenu],[MenuType],[IsOffice],[IsEnd],[IsUsed])
+ VALUES ( N'B451C8DE-71B9-433E-ACB9-4465FB7E3C5C',N'发票台账',N'PHTGL/InvoiceManage/InvoiceStandingBook.aspx',10,'1FF4F8D5-C9AA-4C59-B392-1F025AEB8DEE',N'Menu_PHTGL',0,1,1)
+ GO
+ INSERT [Sys_ButtonToMenu] ([ButtonToMenuId],[MenuId],[ButtonName],[SortIndex])
+ VALUES ( N'336716CC-3A16-4197-BB05-68ED19A47A5D',N'B451C8DE-71B9-433E-ACB9-4465FB7E3C5C',N'修改',2)
+ INSERT [Sys_ButtonToMenu] ([ButtonToMenuId],[MenuId],[ButtonName],[SortIndex])
+ VALUES ( N'E7AC7D13-71AE-493D-B623-57B4D4CFFA79',N'B451C8DE-71B9-433E-ACB9-4465FB7E3C5C',N'删除',3)
+ INSERT [Sys_ButtonToMenu] ([ButtonToMenuId],[MenuId],[ButtonName],[SortIndex])
+ VALUES ( N'C3B7470A-979D-46FC-863A-7C8AAE63AAF6',N'B451C8DE-71B9-433E-ACB9-4465FB7E3C5C',N'保存',4)
+ INSERT [Sys_ButtonToMenu] ([ButtonToMenuId],[MenuId],[ButtonName],[SortIndex])
+ VALUES ( N'6EF9861A-89B6-4D2A-93A9-DF2F8FD3BA86',N'B451C8DE-71B9-433E-ACB9-4465FB7E3C5C',N'增加',1)
+ GO
+ INSERT [Sys_Menu] ([MenuId],[MenuName],[Url],[SortIndex],[SuperMenu],[MenuType],[IsOffice],[IsEnd],[IsUsed])
+ VALUES ( N'DD38AD86-513B-4BBC-AF64-0F52F56784BE',N'出入库单',N'PHTGL/InvoiceManage/InvoiceOrder.aspx',20,'1FF4F8D5-C9AA-4C59-B392-1F025AEB8DEE',N'Menu_PHTGL',0,1,1)
+ GO
+ INSERT [Sys_ButtonToMenu] ([ButtonToMenuId],[MenuId],[ButtonName],[SortIndex])
+ VALUES ( N'8912C056-7B82-4C37-B992-D9F5FA2F6435',N'DD38AD86-513B-4BBC-AF64-0F52F56784BE',N'修改',2)
+ INSERT [Sys_ButtonToMenu] ([ButtonToMenuId],[MenuId],[ButtonName],[SortIndex])
+ VALUES ( N'529076FA-3109-4E14-8F2B-CBFD308E1B51',N'DD38AD86-513B-4BBC-AF64-0F52F56784BE',N'删除',3)
+ INSERT [Sys_ButtonToMenu] ([ButtonToMenuId],[MenuId],[ButtonName],[SortIndex])
+ VALUES ( N'D7E5E87D-52F1-4B83-BE9E-80B4E4AB9A7C',N'DD38AD86-513B-4BBC-AF64-0F52F56784BE',N'保存',4)
+ CREATE TABLE PHTGL_Invoice
+ (
+ InvoiceId NVARCHAR(50) PRIMARY KEY,
+ ProjectId NVARCHAR(50),
+ ContractId NVARCHAR(50),
+ OrderCode NVARCHAR(50),
+ OrderInDate DATE,
+ OrderOutDate DATE,
+ MaterialRequisitionUnit NVARCHAR(100),
+ State int,
+ InvoiceCode NVARCHAR(50),
+ InvoiceNumber NVARCHAR(50),
+ SellerName NVARCHAR(100),
+ InvoiceDate NVARCHAR(50),
+ AmountExcludingTax DECIMAL(18,2),
+ TotalTax DECIMAL(18,2),
+ Remark NVARCHAR(500),
+ ImagePath NVARCHAR(500),
+ SellerTaxNumber NVARCHAR(50),
+ InvoiceAmount DECIMAL(18,2),
+ ApproveManJson NVARCHAR(2000),
+ CreateDate DATETIME,
+ CreateUser NVARCHAR(50),
+
+ )
+GO
+ INSERT [Sys_ButtonToMenu] ([ButtonToMenuId],[MenuId],[ButtonName],[SortIndex])
+ VALUES ( N'D6736D81-62AC-4695-9A84-19120E4AC9ED',N'DD38AD86-513B-4BBC-AF64-0F52F56784BE',N'增加',1)
+exec sp_addextendedproperty 'MS_Description', N'主键id', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'InvoiceId'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'项目id', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'ProjectId'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'状态', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN', 'State'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'发票代码', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'InvoiceCode'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'发票号码', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'InvoiceNumber'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'销方名称', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'SellerName'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'开票日期', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'InvoiceDate'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'不含税金额', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'AmountExcludingTax'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'合计税额', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'TotalTax'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'备注', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN', 'Remark'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'图片存储路径', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'ImagePath'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'销方税号', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'SellerTaxNumber'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'票面金额', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'InvoiceAmount'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'审批人信息json', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'ApproveManJson'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'创建日期', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'CreateDate'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'创建人id', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'CreateUser'
+go
+exec sp_addextendedproperty 'MS_Description', N'合同主键id', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'ContractId'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'入库日期', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'OrderInDate'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'订单编号', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'OrderCode'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'出库日期', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'OrderOutDate'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'领料单位', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Invoice', 'COLUMN',
+ 'MaterialRequisitionUnit'
+go
+
+
+
+CREATE TABLE PHTGL_InvoiceDetail
+(
+ InvoiceDetailId NVARCHAR(50) PRIMARY KEY,
+ InvoiceId NVARCHAR(50),
+ GoodsOrServicesName NVARCHAR(100),
+ SpecificationModel NVARCHAR(100),
+ Unit NVARCHAR(50),
+ Quantity DECIMAL(18,2),
+ UnitPrice DECIMAL(18,2),
+ Amount DECIMAL(18,2),
+ TaxRate NVARCHAR(50),
+ Tax DECIMAL(18,2),
+)exec sp_addextendedproperty 'MS_Description', N'明细id', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_InvoiceDetail', 'COLUMN',
+ 'InvoiceDetailId'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'合同发票id', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_InvoiceDetail', 'COLUMN',
+ 'InvoiceId'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'货物或应税劳务名称', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_InvoiceDetail',
+ 'COLUMN', 'GoodsOrServicesName'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'规格型号', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_InvoiceDetail', 'COLUMN',
+ 'SpecificationModel'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'单位', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_InvoiceDetail', 'COLUMN', 'Unit'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'数量', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_InvoiceDetail', 'COLUMN',
+ 'Quantity'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'单价', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_InvoiceDetail', 'COLUMN',
+ 'UnitPrice'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'金额', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_InvoiceDetail', 'COLUMN',
+ 'Amount'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'税率', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_InvoiceDetail', 'COLUMN',
+ 'TaxRate'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'税额', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_InvoiceDetail', 'COLUMN', 'Tax'
+go
+
diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs
index d9bb1aca..2f4a5ae7 100644
--- a/SGGL/BLL/API/APIPersonService.cs
+++ b/SGGL/BLL/API/APIPersonService.cs
@@ -61,7 +61,7 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.PersonItem person = new Model.PersonItem();
- var getProjectPerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId || (x.ProjectId == projectId && x.IdentityCard == idcard));
+ var getProjectPerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId || (x.ProjectId == projectId && x.ProjectId.Length > 1 && x.IdentityCard == idcard));
if (getProjectPerson != null)
{
person.SitePersonId = getProjectPerson.SitePersonId;
@@ -135,7 +135,7 @@ namespace BLL
person.AttachUrl4 = getAttachUrl4(getProjectPerson.PersonId);
person.AttachUrl5 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#5", null);
}
- var getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == idcard);
+ var getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == idcard && idcard.Length > 1);
if (getPerson != null)
{
person.PersonId = getPerson.PersonId;
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index c6c3ce76..0f4db6ec 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -70,9 +70,13 @@
..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll
- ..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1000\lib\net20\Microsoft.Office.Interop.Excel.dll
+ ..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1001\lib\net20\Microsoft.Office.Interop.Excel.dll
True
+
+ ..\packages\Microsoft.Office.Interop.Word.15.0.4797.1004\lib\net20\Microsoft.Office.Interop.Word.dll
+ False
+
False
@@ -80,8 +84,8 @@
False
..\Lib\Microsoft.SQLServer.ManagedDTS.dll
-
- ..\packages\MiniExcel.1.29.0\lib\net45\MiniExcel.dll
+
+ ..\packages\MiniExcel.1.31.3\lib\net45\MiniExcel.dll
..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll
@@ -633,6 +637,8 @@
+
+
@@ -845,15 +851,6 @@
-
- {00020905-0000-0000-C000-000000000046}
- 8
- 4
- 0
- primary
- False
- False
-
{0002E157-0000-0000-C000-000000000046}
5
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 2b19d5af..dc2d0a0c 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -3242,6 +3242,17 @@ namespace BLL
/// 进度检测
///
public const string PHTGL_ContractTrackProgressDetectionMenuId = "F545E899-B3B5-4B49-A741-DE19356553D5";
+ ///
+ /// 发票台账
+ ///
+ public const string PHTGL_InvoiceStandingBookMenuId = "B451C8DE-71B9-433E-ACB9-4465FB7E3C5C";
+ ///
+ /// 出入库单
+ ///
+ public const string PHTGL_InvoiceOrderMenuId = "DD38AD86-513B-4BBC-AF64-0F52F56784BE";
+
+
+
#endregion
@@ -3445,6 +3456,10 @@ namespace BLL
///
public const string TemContractTrackTemplateUrl = "File\\Excel\\DataIn\\合同价格信息导入模板.xlsx";
///
+ /// 合同发票信息导入模板
+ ///
+ public const string InvoiceTemplateUrl = "File\\Excel\\DataIn\\发票导入模版.xlsx";
+ ///
/// 施工日志模板文件原始虚拟路径
///
public const string ConstructionLogTemplateUrl = "File\\Excel\\ConstructionLog\\施工日志.xlsx";
diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs
index adfb9664..bc002863 100644
--- a/SGGL/BLL/Common/Funs.cs
+++ b/SGGL/BLL/Common/Funs.cs
@@ -1498,6 +1498,8 @@ namespace BLL
return splitLists;
}
+
+
}
}
diff --git a/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanReviewService.cs
index 1e3b9951..1dedc0da 100644
--- a/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanReviewService.cs
+++ b/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanReviewService.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
+using Model;
namespace BLL
{
diff --git a/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs
index 46ffd521..849de380 100644
--- a/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs
+++ b/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs
@@ -5,6 +5,7 @@ using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
+using Model;
namespace BLL
{
diff --git a/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs
index 1f0fbaab..d54bc8a0 100644
--- a/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs
+++ b/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using Model;
namespace BLL
{
diff --git a/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs
index b01da437..eb6e6882 100644
--- a/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs
+++ b/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs
@@ -7,6 +7,7 @@ using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Web.UI.WebControls;
+using Model;
namespace BLL
{
diff --git a/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs b/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs
index caa74bde..aa41388b 100644
--- a/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs
+++ b/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs
@@ -10,6 +10,7 @@ using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
+using Model;
namespace BLL
{
diff --git a/SGGL/BLL/PHTGL/ContractCompile/PHTGL_ApproveService.cs b/SGGL/BLL/PHTGL/ContractCompile/PHTGL_ApproveService.cs
index c2175632..3562d8f2 100644
--- a/SGGL/BLL/PHTGL/ContractCompile/PHTGL_ApproveService.cs
+++ b/SGGL/BLL/PHTGL/ContractCompile/PHTGL_ApproveService.cs
@@ -1,4 +1,7 @@
-using System.Collections.Generic;
+using Model;
+using System;
+using System.Collections;
+using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
@@ -21,12 +24,18 @@ namespace BLL
return Funs.DB.PHTGL_Approve.FirstOrDefault(e => e.ApproveId == ApproveId);
}
+ ///
+ /// 获取未审批记录
+ ///
+ ///
+ ///
public static List GetPHTGL_ApproveByContractId(string contractId)
{
var q = (from x in Funs.DB.PHTGL_Approve where x.ContractId == contractId && x.State == 0 select x).ToList();
return q;
}
+
///
///获取当前人员的所有审批信息
///
@@ -80,6 +89,22 @@ namespace BLL
return IsExit;
}
///
+ /// 判断当前人员是否正在审批
+ ///
+ ///
+ ///
+ ///
+ public static bool IsApprovingMan(string contractId, string approveMan)
+ {
+ bool IsExit = false;
+ var q = (from x in Funs.DB.PHTGL_Approve where x.ContractId == contractId && x.ApproveMan == approveMan && x.State==0 select x).ToList();
+ if (q.Count>0)
+ {
+ IsExit = true;
+ }
+ return IsExit;
+ }
+ ///
/// 添加审批人员记录
///
///
@@ -207,23 +232,70 @@ namespace BLL
///
///
///
- public static DataTable GetAllApproveData(string ContractId)
+ //public static DataTable GetAllApproveData(string ContractId)
+ //{
+ // string strSql = @" select u.PersonName as ApproveMan,
+ // App.ApproveDate,
+ // (CASE App.IsAgree WHEN '1' THEN '不同意'
+ // WHEN '2' THEN '同意' END) AS IsAgree,
+ // App.ApproveIdea,
+ // App.ApproveId,
+ // App.ApproveType
+ // from PHTGL_Approve as App"
+ // + @" left join Person_Persons AS U ON U.PersonId = App.ApproveMan WHERE 1=1 and App.IsAgree <>0 and app.ContractId= @ContractId order by convert(datetime ,App.ApproveDate) ";
+ // List listStr = new List();
+ // listStr.Add(new SqlParameter("@ContractId", ContractId));
+ // SqlParameter[] parameter = listStr.ToArray();
+ // DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
+ // return tb;
+ //}
+ public static IEnumerable GetAllApproveData(string contractId)
{
- string strSql = @" select u.PersonName as ApproveMan,
- App.ApproveDate,
- (CASE App.IsAgree WHEN '1' THEN '不同意'
- WHEN '2' THEN '同意' END) AS IsAgree,
- App.ApproveIdea,
- App.ApproveId,
- App.ApproveType
- from PHTGL_Approve as App"
- + @" left join Person_Persons AS U ON U.PersonId = App.ApproveMan WHERE 1=1 and App.IsAgree <>0 and app.ContractId= @ContractId order by convert(datetime ,App.ApproveDate) ";
- List listStr = new List();
- listStr.Add(new SqlParameter("@ContractId", ContractId));
- SqlParameter[] parameter = listStr.ToArray();
- DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
- return tb;
+ var result = (from x in Funs.DB.PHTGL_Approve
+ join u in Funs.DB.Person_Persons on x.ApproveMan equals u.PersonId
+ where x.IsAgree != 0 && x.ContractId == contractId
+ orderby x.ApproveDate
+ select new
+ {
+ ApproveMan = u.PersonName,
+ x.ApproveDate,
+ IsAgree = x.IsAgree == 1 ? "不同意" : "同意",
+ x.ApproveIdea,
+ x.ApproveId,
+ x.ApproveType,
+ x.ApproveForm
+ }
+
+ ).ToList();
+
+ return result;
}
+ public static IEnumerable GetAllApproveData(string contractId,string aproveForm)
+ {
+ var result = (from x in Funs.DB.PHTGL_Approve
+ join u in Funs.DB.Person_Persons on x.ApproveMan equals u.PersonId
+ where x.IsAgree != 0 && x.ContractId == contractId
+ orderby x.ApproveDate
+ select new
+ {
+ ApproveMan = u.PersonName,
+ x.ApproveDate,
+ IsAgree = x.IsAgree == 1 ? "不同意" : "同意",
+ x.ApproveIdea,
+ x.ApproveId,
+ x.ApproveType,
+ x.ApproveForm
+ }
+
+ ).ToList();
+ if (!string.IsNullOrEmpty(aproveForm))
+ {
+ result = result.Where(x => x.ApproveForm == aproveForm).ToList();
+ }
+
+ return result;
+ }
+
///
/// 获取最后拒绝的人员
///
@@ -243,57 +315,4 @@ namespace BLL
return tb;
}
}
- public class ApproveManModel
- {
- public int Number
- {
- get;
- set;
- }
- public string userid
- {
- get;
- set;
- }
- public string Rolename
- {
- get;
- set;
- }
-
- }
- public class PrintModel
- {
- public int Number
- {
- get;
- set;
- }
- public string Rolename
- {
- get;
- set;
- }
- public string UserName
- {
- get;
- set;
- }
- public string Image
- {
- get;
- set;
- }
- public string ApproveIdea
- {
- get;
- set;
- }
- public string ApproveDate
- {
- get;
- set;
- }
-
- }
}
diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs
index 6e2ae0f6..afbbe131 100644
--- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs
+++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs
@@ -217,8 +217,6 @@ namespace BLL
db.SubmitChanges();
}
-
-
public static void UpdatePHTGL_ContractTrack(PHTGL_ContractTrack newtable)
{
var table = Funs.DB.PHTGL_ContractTrack.FirstOrDefault(x => x.Id == newtable.Id);
@@ -1341,110 +1339,5 @@ namespace BLL
}
}
-
- }
- public class PHTGL_ContractTrackDtoIn
- {
- ///
- /// 序号
- ///
- [ExcelColumnIndex("A")] public string SerialNumber { get; set; }
- ///
- /// 主项号
- ///
- [ExcelColumnIndex("B")] public string MainItemCode { get; set; }
- ///
- /// 主项名称
- ///
- [ExcelColumnIndex("C")] public string MainItemName { get; set; }
- ///
- /// 专业代码
- ///
- [ExcelColumnIndex("D")] public string MajorCode { get; set; }
- ///
- /// 专业工程名称
- ///
- [ExcelColumnIndex("E")] public string MajorName { get; set; }
- ///
- /// 分部工程
- ///
- [ExcelColumnIndex("F")] public string SubProject { get; set; }
- ///
- /// 分项工程
- ///
- [ExcelColumnIndex("G")] public string SubItemProject { get; set; }
- ///
- /// 项目编码
- ///
- [ExcelColumnIndex("H")] public string ProjectCode { get; set; }
- ///
- /// 项目名称
- ///
- [ExcelColumnIndex("I")] public string ProjectName { get; set; }
- ///
- /// 项目特征描述
- ///
- [ExcelColumnIndex("J")] public string ProjectDescription { get; set; }
- ///
- /// 计量单位
- ///
- [ExcelColumnIndex("K")] public string UnitOfMeasurement { get; set; }
- ///
- /// 工程量
- ///
- [ExcelColumnIndex("L")] public string Quantity { get; set; }
- ///
- /// 全费用固定综合单价
- ///
- [ExcelColumnIndex("M")] public decimal TotalCostFixedComprehensiveUnitPrice { get; set; }
- ///
- /// 其中:主材费
- ///
- [ExcelColumnIndex("N")] public decimal MainMaterialCost { get; set; }
- ///
- /// 合价/元
- ///
- [ExcelColumnIndex("O")] public decimal TotalPrice { get; set; }
- ///
- /// 计算规则
- ///
- [ExcelColumnIndex("P")] public string CalculationRule { get; set; }
- ///
- /// 工作内容
- ///
- [ExcelColumnIndex("Q")] public string WorkContent { get; set; }
- ///
- /// 备注
- ///
- [ExcelColumnIndex("R")] public string Remarks { get; set; }
- ///
- /// 施工分包商
- ///
- [ExcelColumnIndex("S")] public string ConstructionSubcontractor { get; set; }
- ///
- /// 主材供应方
- ///
- [ExcelColumnIndex("T")] public string MaterialSupplier { get; set; }
- ///
- /// 是否总包合同范围内
- ///
- [ExcelColumnIndex("U")]
- public string IsWithinGeneralContractScope { get; set; }
- ///
- /// 概算工程量
- ///
- [ExcelColumnIndex("V")] public string EstimatedQuantity { get; set; }
- ///
- /// 概算金额
- ///
- [ExcelColumnIndex("W")] public decimal EstimatedAmount { get; set; }
- ///
- /// 预算工程量
- ///
- [ExcelColumnIndex("X")] public string SettledQuantity { get; set; }
- ///
- /// 预算金额
- ///
- [ExcelColumnIndex("Y")] public decimal SettledAmount { get; set; }
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/PHTGL/InvoiceManage/PhtglInvoiceService .cs b/SGGL/BLL/PHTGL/InvoiceManage/PhtglInvoiceService .cs
new file mode 100644
index 00000000..7d65e020
--- /dev/null
+++ b/SGGL/BLL/PHTGL/InvoiceManage/PhtglInvoiceService .cs
@@ -0,0 +1,587 @@
+using EmitMapper;
+using FineUIPro;
+using MiniExcelLibs;
+using MiniExcelLibs.Attributes;
+using Model;
+using NPOI.SS.Formula.Functions;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics.Contracts;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using WIA;
+
+
+namespace BLL
+{
+
+ public static class PhtglInvoiceService
+ {
+ ///
+ /// 已导入
+ ///
+ public static int StateDataIn = -1;
+ ///
+ /// 已创建入库订单
+ ///
+ public static int StateCreate = 0;
+ ///
+ /// 入库审核
+ ///
+ public static int StateInPutApprove = 1;
+ ///
+ /// 入库审核拒绝
+ ///
+ public static int StateInPutApproveRefuse = 2;
+ ///
+ /// 入库审核成功
+ ///
+ public static int StateInPutApproveSuccess = 3;
+ ///
+ /// 出库审核中
+ ///
+ public static int StateOutPutApprove = 4;
+ ///
+ /// 出库审核拒绝
+ ///
+ public static int StateOutPutApproveRefuse = 5;
+ ///
+ /// 出库审核成功
+ ///
+ public static int StateOutPutApproveSuccess = 6;
+
+ public static string GetState(object invoiceId)
+ {
+ string result = "";
+ if (invoiceId!=null && !string.IsNullOrEmpty(invoiceId.ToString()) )
+ {
+ var InvoiceId=invoiceId.ToString();
+
+ var model = GetPHTGL_InvoiceById(InvoiceId);
+ var approveModel = PHTGL_ApproveService.GetPHTGL_ApproveByContractId(InvoiceId);
+
+ switch (model.State)
+ {
+ case -1:
+ result = "已导入";
+ break;
+ case 0:
+ result = "已创建入库订单";
+ break;
+ case 1:
+ result = "入库审核中"+",当前节点-"+BLL.Person_PersonsService.getPersonsNamesPersonIds(string.Join(",",approveModel.Select(x => x.ApproveMan)));
+ break;
+ case 2:
+ result = "入库审核拒绝";
+ break;
+ case 3:
+ result = "入库审核成功";
+ break;
+ case 4:
+ result = "出库审核中" + ",当前节点-" + BLL.Person_PersonsService.getPersonsNamesPersonIds(string.Join(",", approveModel.Select(x => x.ApproveMan)));
+ break;
+ case 5:
+ result = "出库审核拒绝";
+ break;
+ case 6:
+ result = "出库审核成功";
+ break;
+ }
+ }
+ return result;
+ }
+
+ #region 获取列表
+ ///
+ /// 记录数
+ ///
+ public static int Count
+ {
+ get;
+ set;
+ }
+ public static IEnumerable GetPHTGL_InvoiceByModle(Model.PHTGL_Invoice table)
+ {
+ var q = from x in Funs.DB.PHTGL_Invoice
+ where
+ (string.IsNullOrEmpty(table.InvoiceId) || x.InvoiceId.Contains(table.InvoiceId)) &&
+ (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
+ (string.IsNullOrEmpty(table.ContractId) || x.ProjectId.Contains(table.ContractId)) &&
+ (string.IsNullOrEmpty(table.InvoiceCode) || x.InvoiceCode.Contains(table.InvoiceCode)) &&
+ (string.IsNullOrEmpty(table.InvoiceNumber) || x.InvoiceNumber.Contains(table.InvoiceNumber)) &&
+ (string.IsNullOrEmpty(table.SellerName) || x.SellerName.Contains(table.SellerName)) &&
+ (string.IsNullOrEmpty(table.InvoiceDate) || x.InvoiceDate.Contains(table.InvoiceDate)) &&
+ (string.IsNullOrEmpty(table.Remark) || x.Remark.Contains(table.Remark)) &&
+ (string.IsNullOrEmpty(table.ImagePath) || x.ImagePath.Contains(table.ImagePath)) &&
+ (string.IsNullOrEmpty(table.SellerTaxNumber) || x.SellerTaxNumber.Contains(table.SellerTaxNumber)) &&
+ (string.IsNullOrEmpty(table.ApproveManJson) || x.ApproveManJson.Contains(table.ApproveManJson)) &&
+ (string.IsNullOrEmpty(table.CreateUser) || x.CreateUser.Contains(table.CreateUser)) &&
+ (table.State==null ||x.State==table.State)
+ select x
+ ;
+
+ return q.ToList();
+ }
+
+ ///
+ /// 获取分页列表
+ ///
+ ///
+ ///
+ ///
+ public static IEnumerable GetListData(Model.PHTGL_Invoice table, Grid grid1)
+ {
+ var q = GetPHTGL_InvoiceByModle(table);
+ Count = q.Count();
+ if (Count == 0)
+ {
+ return null;
+ }
+ q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList();
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ return (from x in q
+ join y in Funs.DB.PHTGL_Contract on x.ContractId equals y.ContractId into g
+ from c in g.DefaultIfEmpty()
+ select new
+ {
+ c?.ContractName,
+ c?.ContractNum,
+ c?.Parties,
+ c?.ContractAmount,
+ x.InvoiceId,
+ x.ProjectId,
+ x.ContractId,
+ x.State,
+ x.InvoiceCode,
+ x.InvoiceNumber,
+ x.SellerName,
+ x.InvoiceDate,
+ x.AmountExcludingTax,
+ x.TotalTax,
+ x.Remark,
+ x.ImagePath,
+ x.SellerTaxNumber,
+ x.InvoiceAmount,
+ x.ApproveManJson,
+ x.CreateDate,
+ x.CreateUser,
+ x.OrderInDate,
+ x.OrderOutDate,
+ x.OrderCode,
+ x.MaterialRequisitionUnit
+ });
+ }
+
+ public static IEnumerable GetOrderInListData(Model.PHTGL_Invoice table, Grid grid1)
+ {
+ var q = GetPHTGL_InvoiceByModle(table);
+ Count = q.Count();
+ if (Count == 0)
+ {
+ return null;
+ }
+ q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList();
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ return (from x in q
+ join y in Funs.DB.PHTGL_Contract on x.ContractId equals y.ContractId into g
+ from c in g.DefaultIfEmpty()
+ where x.State>StateDataIn
+ select new
+ {
+ c?.ContractName,
+ c?.ContractNum,
+ c?.Parties,
+ c?.ContractAmount,
+ x.InvoiceId,
+ x.ProjectId,
+ x.ContractId,
+ x.State,
+ x.InvoiceCode,
+ x.InvoiceNumber,
+ x.SellerName,
+ x.InvoiceDate,
+ x.AmountExcludingTax,
+ x.TotalTax,
+ x.Remark,
+ x.ImagePath,
+ x.SellerTaxNumber,
+ x.InvoiceAmount,
+ x.ApproveManJson,
+ x.CreateDate,
+ x.CreateUser,
+ x.OrderInDate,
+ x.OrderOutDate,
+ x.OrderCode,
+ x.MaterialRequisitionUnit
+ }).ToList();
+ }
+ #endregion
+
+ public static Model.PHTGL_Invoice GetPHTGL_InvoiceById(string InvoiceId)
+ {
+ return Funs.DB.PHTGL_Invoice.FirstOrDefault(x => x.InvoiceId == InvoiceId);
+ }
+
+ ///
+ /// 添加实体
+ ///
+ ///
+ public static void AddPHTGL_Invoice(Model.PHTGL_Invoice newtable)
+ {
+
+ Model.PHTGL_Invoice table = new Model.PHTGL_Invoice
+ {
+ InvoiceId = newtable.InvoiceId,
+ ProjectId = newtable.ProjectId,
+ ContractId = newtable.ContractId,
+ State = newtable.State,
+ InvoiceCode = newtable.InvoiceCode,
+ InvoiceNumber = newtable.InvoiceNumber,
+ SellerName = newtable.SellerName,
+ InvoiceDate = newtable.InvoiceDate,
+ AmountExcludingTax = newtable.AmountExcludingTax,
+ TotalTax = newtable.TotalTax,
+ Remark = newtable.Remark,
+ ImagePath = newtable.ImagePath,
+ SellerTaxNumber = newtable.SellerTaxNumber,
+ InvoiceAmount = newtable.InvoiceAmount,
+ ApproveManJson = newtable.ApproveManJson,
+ CreateDate = newtable.CreateDate,
+ CreateUser = newtable.CreateUser,
+ OrderInDate = newtable.OrderInDate,
+ OrderCode = newtable.OrderCode,
+ OrderOutDate = newtable.OrderOutDate,
+ MaterialRequisitionUnit = newtable.MaterialRequisitionUnit,
+ };
+ Funs.DB.PHTGL_Invoice.InsertOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+
+ ///
+ /// 修改实体
+ ///
+ ///
+ public static void UpdatePHTGL_Invoice(Model.PHTGL_Invoice newtable)
+ {
+
+ Model.PHTGL_Invoice table = Funs.DB.PHTGL_Invoice.FirstOrDefault(x => x.InvoiceId == newtable.InvoiceId);
+ if (table != null)
+ {
+ table.InvoiceId = newtable.InvoiceId;
+ table.ProjectId = newtable.ProjectId;
+ table.ContractId = newtable.ContractId;
+ table.State = newtable.State;
+ table.InvoiceCode = newtable.InvoiceCode;
+ table.InvoiceNumber = newtable.InvoiceNumber;
+ table.SellerName = newtable.SellerName;
+ table.InvoiceDate = newtable.InvoiceDate;
+ table.AmountExcludingTax = newtable.AmountExcludingTax;
+ table.TotalTax = newtable.TotalTax;
+ table.Remark = newtable.Remark;
+ table.ImagePath = newtable.ImagePath;
+ table.SellerTaxNumber = newtable.SellerTaxNumber;
+ table.InvoiceAmount = newtable.InvoiceAmount;
+ table.ApproveManJson = newtable.ApproveManJson;
+ table.CreateDate = newtable.CreateDate;
+ table.CreateUser = newtable.CreateUser;
+ table.OrderInDate = newtable.OrderInDate;
+ table.OrderCode = newtable.OrderCode;
+ table.OrderOutDate = newtable.OrderOutDate;
+ table.MaterialRequisitionUnit = newtable.MaterialRequisitionUnit;
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+ ///
+ /// 删除实体
+ ///
+ ///
+ public static void DeletePHTGL_InvoiceById(string InvoiceId)
+ {
+
+ Model.PHTGL_Invoice table = Funs.DB.PHTGL_Invoice.FirstOrDefault(x => x.InvoiceId == InvoiceId);
+ if (table != null)
+ {
+ Funs.DB.PHTGL_Invoice.DeleteOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+ ///
+ /// 根据主键获取审批人实体
+ ///
+ ///
+ ///
+ public static Model.PHTGL_InvoiceApproveManEntity GetInvoiceApproveManEntity(string InvoiceId)
+ {
+ Model.PHTGL_InvoiceApproveManEntity list = new Model.PHTGL_InvoiceApproveManEntity();
+ Model.PHTGL_Invoice data = Funs.DB.PHTGL_Invoice.FirstOrDefault(e => e.InvoiceId == InvoiceId);
+ if (data != null && !string .IsNullOrEmpty(data.ApproveManJson))
+ {
+ list = Newtonsoft.Json.JsonConvert.DeserializeObject(data.ApproveManJson);
+ }
+ return list;
+ }
+ ///
+ /// 将状态改为已创建
+ ///
+ ///
+ public static void ChangeStateToCreate(string invoiceId)
+ {
+ var model = GetPHTGL_InvoiceById(invoiceId);
+ model.State = StateCreate;
+ UpdatePHTGL_Invoice(model);
+ }
+
+ ///
+ /// 保存入库审批人实体
+ ///
+ ///
+ ///
+ public static void SaveInputApproveManEntity(string invoiceId, Inputapproveman inputapproveman)
+ {
+ var table = GetInvoiceApproveManEntity(invoiceId);
+ table.InputApproveMan = inputapproveman;
+ var json = Newtonsoft.Json.JsonConvert.SerializeObject(table);
+ var data = Funs.DB.PHTGL_Invoice.FirstOrDefault(e => e.InvoiceId == invoiceId);
+ if (data != null)
+ {
+ data.ApproveManJson = json;
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+ ///
+ /// 保存出库审批人实体
+ ///
+ ///
+ ///
+ public static void SaveOutputApproveManEntity(string invoiceId, Outputapproveman outputapproveman)
+ {
+ var table = GetInvoiceApproveManEntity(invoiceId);
+ table.OutputApproveMan = outputapproveman;
+ var json = Newtonsoft.Json.JsonConvert.SerializeObject(table);
+ var data = Funs.DB.PHTGL_Invoice.FirstOrDefault(e => e.InvoiceId == invoiceId);
+ if (data != null)
+ {
+ data.ApproveManJson = json;
+ Funs.DB.SubmitChanges();
+ }
+ }
+
+ ///
+ /// 导入数据
+ ///
+ /// 文件地址
+ /// 项目id
+ /// 创建人id
+ ///
+ public static ResponeData ImportData(string path, string projectid, string creatUserId)
+ {
+ var responeData = new ResponeData();
+ List temeplateDtoIns;
+ try
+ {
+ temeplateDtoIns = MiniExcel.Query(path, startCell: "A2").ToList();
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = "模板错误:" + ex.ToString();
+ return responeData;
+ }
+ //数据校验
+ if (temeplateDtoIns.Count == 0)
+ {
+ responeData.code = 0;
+ responeData.message = "导入数据为空!";
+ return responeData;
+ }
+
+ var invoiceCodeList = temeplateDtoIns.Select(x => x.InvoiceCode).Distinct().ToList(); //获取所有发票代码
+ //根据发票代码分组插入数据
+ foreach (var invoiceCode in invoiceCodeList)
+ {
+ var invoiceCodeDtoIns = temeplateDtoIns.Where(x => x.InvoiceCode == invoiceCode).ToList();
+
+ var mapper =
+ ObjectMapperManager.DefaultInstance.GetMapper, List>();
+ var mapperDetail =
+ ObjectMapperManager.DefaultInstance.GetMapper, List>();
+ //通过映射实体赋值
+ var invoiceModel = mapper.Map(invoiceCodeDtoIns).FirstOrDefault();
+ var invoceDetailList = mapperDetail.Map(invoiceCodeDtoIns.Where(x => !string.IsNullOrEmpty(x.GoodsOrServicesName) && !string.IsNullOrEmpty(x.SpecificationModel)).ToList());
+
+ var queryModel = new PHTGL_Invoice
+ {
+ InvoiceCode = invoiceCode,
+ ProjectId = projectid
+ };
+ var queryresult = GetPHTGL_InvoiceByModle(queryModel).FirstOrDefault();//查询该发票代码是否存在
+ if (queryresult != null)
+ {
+ if (queryresult.State != StateDataIn)
+ {
+ continue;
+ }
+ invoiceModel.State = StateDataIn;
+ invoiceModel.ProjectId = projectid;
+ invoiceModel.InvoiceId = queryresult.InvoiceId;
+ invoiceModel.CreateUser = creatUserId;
+ invoiceModel.CreateDate = DateTime.Now;
+ UpdatePHTGL_Invoice(invoiceModel);
+ }
+ else
+ {
+ invoiceModel.InvoiceId = SQLHelper.GetNewID();
+ invoiceModel.State = StateDataIn;
+ invoiceModel.ProjectId = projectid;
+ invoiceModel.CreateUser = creatUserId;
+ invoiceModel.CreateDate = DateTime.Now;
+ AddPHTGL_Invoice(invoiceModel);
+
+ }
+ PhtglInvoicedetailService.DeletePHTGL_InvoiceDetailByInvoiceId(invoiceModel.InvoiceId);
+ PhtglInvoicedetailService.BatchAddPHTGL_InvoiveDetail(invoceDetailList, invoiceModel.InvoiceId); //插入发票明细
+
+ }
+ return responeData;
+
+ }
+
+ ///
+ /// 获取审批人员
+ ///
+ /// 主键id
+ /// 0 入库 1出库
+ ///
+ public static List GetApproveManModels(string invoiceId ,int type)
+ {
+ List approveManModels = new List();
+ var table = GetInvoiceApproveManEntity(invoiceId);
+
+ if (type==0) //入库
+ {
+ approveManModels.Add(new ApproveManModel { Number = 1, userid = table.InputApproveMan.ProfessionalEngineer, Rolename = "专业工程师" });
+ approveManModels.Add(new ApproveManModel { Number = 2, userid = table.InputApproveMan.ConstructionManager, Rolename = "施工经理" });
+ approveManModels.Add(new ApproveManModel { Number = 3, userid = table.InputApproveMan.ControlManager, Rolename = "控制经理" });
+ approveManModels.Add(new ApproveManModel { Number = 4, userid = table.InputApproveMan.ProjectManager, Rolename = "项目经理" }); }
+ else {
+ approveManModels.Add(new ApproveManModel { Number = 5, userid = table.OutputApproveMan.PurchasingMan, Rolename = "采购员" });
+ approveManModels.Add(new ApproveManModel { Number = 6, userid = table.OutputApproveMan.ControlManager, Rolename = "控制经理" });
+ approveManModels.Add(new ApproveManModel { Number = 7, userid = table.OutputApproveMan.ProjectManager, Rolename = "项目经理" });
+ approveManModels.Add(new ApproveManModel { Number = 8, userid = table.OutputApproveMan.ConUnitMaterialOfficer, Rolename = "施工单位材料经理" });
+ approveManModels.Add(new ApproveManModel { Number = 9, userid = table.OutputApproveMan.ConUnitProjectManager, Rolename = "施工单位项目经理" });
+ }
+
+
+ return approveManModels;
+ }
+
+ ///
+ /// 开启审批流程
+ ///
+ ///
+ public static void StartApprovalProcess(string invoiceId )
+ {
+
+ var model = GetPHTGL_InvoiceById(invoiceId);
+ if (model.State ==StateCreate || model.State == StateInPutApproveRefuse)
+ {
+ CreateFirstApprove(invoiceId, 0);
+ model.State = StateInPutApprove;
+ UpdatePHTGL_Invoice(model);
+ }
+ else if (model.State == StateInPutApproveSuccess || model.State == StateOutPutApproveRefuse)
+ {
+ CreateFirstApprove(invoiceId, 1);
+ model.State = StateOutPutApprove;
+ UpdatePHTGL_Invoice(model);
+ }
+ }
+
+ ///
+ /// 创建第一个审批流程
+ ///
+ /// 主键
+ /// 0 入库 1出库
+ public static void CreateFirstApprove(string invoiceId, int type)
+ {
+ var approveManModels = GetApproveManModels(invoiceId, type).OrderBy(x=>x.Number).FirstOrDefault();
+ Model.PHTGL_Approve _Approve = new Model.PHTGL_Approve();
+ _Approve.ApproveId = SQLHelper.GetNewID(typeof(Model.PHTGL_Approve));
+ _Approve.ContractId = invoiceId;
+ _Approve.ApproveMan = approveManModels.userid;
+ _Approve.ApproveDate = "";
+ _Approve.State = 0;
+ _Approve.IsAgree = 0;
+ _Approve.ApproveIdea = "";
+ _Approve.ApproveType = approveManModels.Rolename;
+ _Approve.ApproveForm =(type==0? "Invoice_Input": "Invoice_Output");
+ BLL.PHTGL_ApproveService.AddPHTGL_Approve(_Approve);
+ }
+
+ ///
+ /// 审批
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// 0 入库 1出库
+ public static void Approve(string invoiceId, int type, string userid, bool isAgree, string idea)
+ {
+ var approveManModels = GetApproveManModels(invoiceId, type); //获取审批人员
+ var thisApprovemodel = PHTGL_ApproveService.GetPHTGL_ApproveByUserId(invoiceId, userid);//获取当前人员正在审批的信息
+ if (thisApprovemodel == null) { return; }
+ var thisApproveTypeNumber = approveManModels.Find(x => x.userid == userid && x.Rolename == thisApprovemodel.ApproveType).Number; //当前审批人员序号
+ int nextApproveTypeNumber = thisApproveTypeNumber + 1; //下一个审批人员序号
+ int maxApproveTypeNumber = approveManModels.Max(x => x.Number); //最大审批人员序号
+
+
+ thisApprovemodel.ApproveDate = Funs.GetNewDateTimeOrNow("").ToString();
+ thisApprovemodel.IsAgree = isAgree ? 2 : 1;
+ thisApprovemodel.ApproveIdea = idea;
+ thisApprovemodel.State = 1;
+ PHTGL_ApproveService.UpdatePHTGL_Approve(thisApprovemodel);
+ if (isAgree)
+ {
+ if (PHTGL_ApproveService.GetPHTGL_ApproveByContractId(invoiceId).Count==0) //当前节点是否全部审批结束
+ {
+ if (thisApproveTypeNumber < maxApproveTypeNumber) //是否最末节点
+ {
+ Model.PHTGL_Approve _Approve = new Model.PHTGL_Approve();
+ _Approve.ContractId = thisApprovemodel.ContractId;
+ _Approve.ApproveMan = approveManModels.Find(e => e.Number == nextApproveTypeNumber).userid;
+ _Approve.ApproveDate = "";
+ _Approve.State = 0;
+ _Approve.IsAgree = 0;
+ _Approve.ApproveIdea = "";
+ _Approve.ApproveType = approveManModels.Find(e => e.Number == nextApproveTypeNumber).Rolename;
+ _Approve.IsPushOa = 0;
+ _Approve.ApproveForm = (type == 0 ? "Invoice_Input" : "Invoice_Output");
+ _Approve.ApproveId = SQLHelper.GetNewID(typeof(Model.PHTGL_Approve));
+ BLL.PHTGL_ApproveService.AddPHTGL_Approve(_Approve);
+ }
+ else
+ {
+ //流程走完结束
+ var model = GetPHTGL_InvoiceById(invoiceId);
+ model.State = (type == 0 ? StateInPutApproveSuccess:StateOutPutApproveSuccess);
+ UpdatePHTGL_Invoice(model);
+ }
+ }
+ }
+ else
+ { //审批拒绝-流程结束
+ var model = GetPHTGL_InvoiceById(invoiceId);
+ model.State = (type == 0 ? StateInPutApproveRefuse : StateOutPutApproveRefuse);
+ UpdatePHTGL_Invoice(model);
+ }
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/SGGL/BLL/PHTGL/InvoiceManage/PhtglInvoicedetailService.cs b/SGGL/BLL/PHTGL/InvoiceManage/PhtglInvoicedetailService.cs
new file mode 100644
index 00000000..7c34c5a1
--- /dev/null
+++ b/SGGL/BLL/PHTGL/InvoiceManage/PhtglInvoicedetailService.cs
@@ -0,0 +1,165 @@
+using FineUIPro;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+
+namespace BLL
+{
+
+ public static class PhtglInvoicedetailService
+ {
+
+
+
+ #region 获取列表
+ ///
+ /// 记录数
+ ///
+ public static int Count
+ {
+ get;
+ set;
+ }
+ public static IEnumerable GetPHTGL_InvoiceDetailByModle(Model.PHTGL_InvoiceDetail table)
+ {
+ var q = from x in Funs.DB.PHTGL_InvoiceDetail
+ where
+ (string.IsNullOrEmpty(table.InvoiceDetailId) || x.InvoiceDetailId.Contains(table.InvoiceDetailId)) &&
+ (string.IsNullOrEmpty(table.InvoiceId) || x.InvoiceId.Contains(table.InvoiceId)) &&
+ (string.IsNullOrEmpty(table.GoodsOrServicesName) || x.GoodsOrServicesName.Contains(table.GoodsOrServicesName)) &&
+ (string.IsNullOrEmpty(table.SpecificationModel) || x.SpecificationModel.Contains(table.SpecificationModel)) &&
+ (string.IsNullOrEmpty(table.Unit) || x.Unit.Contains(table.Unit)) &&
+ (string.IsNullOrEmpty(table.TaxRate) || x.TaxRate.Contains(table.TaxRate))
+ select x
+ ;
+
+ return q.ToList();
+ }
+
+ ///
+ /// 获取分页列表
+ ///
+ ///
+ ///
+ ///
+ public static IEnumerable GetListData(Model.PHTGL_InvoiceDetail table, Grid grid1)
+ {
+ var q = GetPHTGL_InvoiceDetailByModle(table);
+ Count = q.Count();
+ if (Count == 0)
+ {
+ return null;
+ }
+ q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList();
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ return from x in q
+ select new
+ {
+ x.InvoiceDetailId,
+ x.InvoiceId,
+ x.GoodsOrServicesName,
+ x.SpecificationModel,
+ x.Unit,
+ x.Quantity,
+ x.UnitPrice,
+ x.Amount,
+ x.TaxRate,
+ x.Tax,
+
+ };
+ }
+ #endregion
+
+ public static Model.PHTGL_InvoiceDetail GetPHTGL_InvoiceDetailById(string InvoiceDetailId)
+ {
+ return Funs.DB.PHTGL_InvoiceDetail.FirstOrDefault(x => x.InvoiceDetailId == InvoiceDetailId);
+ }
+ public static List GetPHTGL_InvoiceDetailByInvoiceId(string InvoiceId)
+ {
+ var list = Funs.DB.PHTGL_InvoiceDetail.Where(x => x.InvoiceId == InvoiceId).ToList();
+ return list;
+ }
+ public static void AddPHTGL_InvoiceDetail(Model.PHTGL_InvoiceDetail newtable)
+ {
+ if (string.IsNullOrEmpty(newtable.InvoiceDetailId))
+ {
+ newtable.InvoiceDetailId = SQLHelper.GetNewID();
+ }
+ Model.PHTGL_InvoiceDetail table = new Model.PHTGL_InvoiceDetail
+ {
+ InvoiceDetailId = newtable.InvoiceDetailId,
+ InvoiceId = newtable.InvoiceId,
+ GoodsOrServicesName = newtable.GoodsOrServicesName,
+ SpecificationModel = newtable.SpecificationModel,
+ Unit = newtable.Unit,
+ Quantity = newtable.Quantity,
+ UnitPrice = newtable.UnitPrice,
+ Amount = newtable.Amount,
+ TaxRate = newtable.TaxRate,
+ Tax = newtable.Tax,
+ };
+ Funs.DB.PHTGL_InvoiceDetail.InsertOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+ public static void UpdatePHTGL_InvoiceDetail(Model.PHTGL_InvoiceDetail newtable)
+ {
+
+ Model.PHTGL_InvoiceDetail table = Funs.DB.PHTGL_InvoiceDetail.FirstOrDefault(x => x.InvoiceDetailId == newtable.InvoiceDetailId);
+ if (table != null)
+ {
+ table.InvoiceDetailId = newtable.InvoiceDetailId;
+ table.InvoiceId = newtable.InvoiceId;
+ table.GoodsOrServicesName = newtable.GoodsOrServicesName;
+ table.SpecificationModel = newtable.SpecificationModel;
+ table.Unit = newtable.Unit;
+ table.Quantity = newtable.Quantity;
+ table.UnitPrice = newtable.UnitPrice;
+ table.Amount = newtable.Amount;
+ table.TaxRate = newtable.TaxRate;
+ table.Tax = newtable.Tax;
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+ public static void DeletePHTGL_InvoiceDetailById(string InvoiceDetailId)
+ {
+
+ Model.PHTGL_InvoiceDetail table = Funs.DB.PHTGL_InvoiceDetail.FirstOrDefault(x => x.InvoiceDetailId == InvoiceDetailId);
+ if (table != null)
+ {
+ Funs.DB.PHTGL_InvoiceDetail.DeleteOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+
+ public static void DeletePHTGL_InvoiceDetailByInvoiceId(string InvoiceId)
+ {
+ var list = Funs.DB.PHTGL_InvoiceDetail.Where(x => x.InvoiceId == InvoiceId);
+ if (list != null)
+ {
+ Funs.DB.PHTGL_InvoiceDetail.DeleteAllOnSubmit(list);
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+ public static void BatchAddPHTGL_InvoiveDetail(IEnumerable list, string invoiceId )
+ {
+ foreach (var item in list)
+ {
+ item.InvoiceId= invoiceId;
+ AddPHTGL_InvoiceDetail(item);
+ }
+ }
+ public static void BatchAddPHTGL_InvoiveDetail(IEnumerable list)
+ {
+ foreach (var item in list)
+ {
+ AddPHTGL_InvoiceDetail(item);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/ActionPlanReviewDetail.aspx.cs b/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/ActionPlanReviewDetail.aspx.cs
index 399886d1..2c4fcc03 100644
--- a/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/ActionPlanReviewDetail.aspx.cs
+++ b/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/ActionPlanReviewDetail.aspx.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
+using Model;
namespace FineUIPro.Mobile.PHTGL.BiddingManagement
{
diff --git a/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/ApproveUserReviewDetail.aspx.cs b/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/ApproveUserReviewDetail.aspx.cs
index d5dd106d..6325554e 100644
--- a/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/ApproveUserReviewDetail.aspx.cs
+++ b/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/ApproveUserReviewDetail.aspx.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
+using Model;
namespace FineUIPro.Mobile.PHTGL.BiddingManagement
{
diff --git a/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/BidDocumentsReviewDetail.aspx.cs b/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/BidDocumentsReviewDetail.aspx.cs
index 9d0dde03..bc3be275 100644
--- a/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/BidDocumentsReviewDetail.aspx.cs
+++ b/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/BidDocumentsReviewDetail.aspx.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
+using Model;
namespace FineUIPro.Mobile.PHTGL.BiddingManagement
{
diff --git a/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/SetSubReviewDetail.aspx.cs b/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/SetSubReviewDetail.aspx.cs
index eff2ce8a..56bd6434 100644
--- a/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/SetSubReviewDetail.aspx.cs
+++ b/SGGL/FineUIPro.Mobile/PHTGL/BiddingManagement/SetSubReviewDetail.aspx.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
+using Model;
namespace FineUIPro.Mobile.PHTGL.BiddingManagement
{
diff --git a/SGGL/FineUIPro.Mobile/PHTGL/ContractCompile/ContractReviewDetail.aspx.cs b/SGGL/FineUIPro.Mobile/PHTGL/ContractCompile/ContractReviewDetail.aspx.cs
index c0d30036..e7528686 100644
--- a/SGGL/FineUIPro.Mobile/PHTGL/ContractCompile/ContractReviewDetail.aspx.cs
+++ b/SGGL/FineUIPro.Mobile/PHTGL/ContractCompile/ContractReviewDetail.aspx.cs
@@ -5,6 +5,7 @@ using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web.UI.WebControls;
+using Model;
namespace FineUIPro.Mobile.Mobile
{
@@ -193,12 +194,10 @@ namespace FineUIPro.Mobile.Mobile
btnAgree.Enabled = false;
btnDisgree.Enabled = false;
}
-
-
- DataTable tb = BLL.PHTGL_ApproveService.GetAllApproveData(ContractReviewId);
- //Grid1.RecordCount = tb.Rows.Count;
- //var table = this.GetPagedDataTable(Grid1, tb);
- Grid1.DataSource = tb;
+
+ ////Grid1.RecordCount = tb.Rows.Count;
+ ////var table = this.GetPagedDataTable(Grid1, tb);
+ Grid1.DataSource = BLL.PHTGL_ApproveService.GetAllApproveData(ContractReviewId); ;
Grid1.DataBind();
}
diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/发票导入模版.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/发票导入模版.xlsx
new file mode 100644
index 00000000..2916650c
Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/发票导入模版.xlsx differ
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index 9f1f55da..2deb1a52 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -111,11 +111,15 @@
..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1001\lib\net20\Microsoft.Office.Interop.Excel.dll
True
+
+ ..\packages\Microsoft.Office.Interop.Word.15.0.4797.1004\lib\net20\Microsoft.Office.Interop.Word.dll
+ True
+
False
-
- ..\packages\MiniExcel.1.29.0\lib\net45\MiniExcel.dll
+
+ ..\packages\MiniExcel.1.31.3\lib\net45\MiniExcel.dll
..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll
@@ -1300,6 +1304,12 @@
+
+
+
+
+
+
@@ -12690,6 +12700,48 @@
SetSubFile.aspx
+
+ InvoiceDataIn.aspx
+ ASPXCodeBehind
+
+
+ InvoiceDataIn.aspx
+
+
+ InvoiceOrder.aspx
+ ASPXCodeBehind
+
+
+ InvoiceOrder.aspx
+
+
+ InvoiceOrderDetail.aspx
+ ASPXCodeBehind
+
+
+ InvoiceOrderDetail.aspx
+
+
+ InvoiceOrderReviewEdit.aspx
+ ASPXCodeBehind
+
+
+ InvoiceOrderReviewEdit.aspx
+
+
+ InvoiceStandingBook.aspx
+ ASPXCodeBehind
+
+
+ InvoiceStandingBook.aspx
+
+
+ InvoiceStandingBookEdit.aspx
+ ASPXCodeBehind
+
+
+ InvoiceStandingBookEdit.aspx
+
LongListNetApplication.aspx
ASPXCodeBehind
@@ -14397,15 +14449,6 @@
-
- {00020905-0000-0000-C000-000000000046}
- 8
- 4
- 0
- primary
- False
- True
-
{0002E157-0000-0000-C000-000000000046}
5
@@ -14426,7 +14469,7 @@
True
0
/
- http://localhost:14290/
+ http://localhost:7155/
False
False
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx
index a7faddac..76a27117 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx
@@ -5,8 +5,7 @@
- 总部检查
-
+
@@ -23,7 +22,7 @@
-
@@ -36,9 +35,9 @@
SortField="RectifyItemId" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Hidden="true">
-
-
+
+
@@ -53,11 +52,23 @@
+
+
+
+
+
+
+
+
+
+
@@ -70,26 +81,44 @@
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
+
+
![Alternate Text]()
+
-
+ function onGridDataLoad(event) {
+ this.mergeColumns(['RectifyCode'], { depends: true });
+ }
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.cs
index c4a06e2e..0c8883b1 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.cs
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
+using System.Web;
namespace FineUIPro.Web.HSSE.Check
{
@@ -127,5 +128,44 @@ namespace FineUIPro.Web.HSSE.Check
ShowNotify("数据已提交成功!");
}
}
+
+
+ ///
+ /// 获取整改前图片(放于Img中)
+ ///
+ ///
+ ///
+ protected string ConvertImageUrlByImage(object RectifyItemId)
+ {
+ string url = string.Empty;
+ if (RectifyItemId != null)
+ {
+ var RectifyNoticesItem = BLL.AttachFileService.GetAttachFileByToKeyId(RectifyItemId.ToString() + "#1");
+ if (RectifyNoticesItem != null)
+ {
+ url = HttpUtility.HtmlDecode(BLL.UploadAttachmentService.ShowImage("../../", RectifyNoticesItem.AttachUrl));
+ }
+ }
+ return url;
+ }
+
+ ///
+ /// 获取整改后图片
+ ///
+ ///
+ ///
+ protected string ConvertImageUrlByImage2(object RectifyItemId)
+ {
+ string url = string.Empty;
+ if (RectifyItemId != null)
+ {
+ var RectifyNoticesItem = BLL.AttachFileService.GetAttachFileByToKeyId(RectifyItemId.ToString() + "#2");
+ if (RectifyNoticesItem != null)
+ {
+ url = BLL.UploadAttachmentService.ShowImage("../../", RectifyNoticesItem.AttachUrl);
+ }
+ }
+ return url;
+ }
}
}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.designer.cs
index cdf4faec..ea964a99 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.designer.cs
@@ -68,6 +68,24 @@ namespace FineUIPro.Web.HSSE.Check
///
protected global::FineUIPro.RadioButtonList rbStates;
+ ///
+ /// lbImageUrl 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label lbImageUrl;
+
+ ///
+ /// Label2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label Label2;
+
///
/// WindowAtt 控件。
///
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx
index 1df17a02..c9a5082f 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx
@@ -84,7 +84,7 @@
- %>'>
+
- 隐患整改
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 否
+ 是
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -66,111 +166,31 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 否
- 是
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
![Alternate Text]()
+
+