From 73511d2e033bd4a88cff61db51169de58d59ce5a Mon Sep 17 00:00:00 2001
From: xiaju <1784803958@qq.com>
Date: Fri, 27 Feb 2026 11:05:35 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B2=97=E4=BD=8D=E5=90=88=E5=B9=B6=E6=B8=85?=
=?UTF-8?q?=E7=90=86=E3=80=81=E7=8F=AD=E5=89=8D=E4=BC=9A=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E5=90=8C=E6=AD=A5=E3=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SUBQHSE_V2026-02-06-xiaj(SP_DataIdMove).sql | 59 ++++
.../版本日志/SUBQHSE_V2026-02-13-xiaj.sql | 22 ++
SGGL/BLL/BLL.csproj | 3 +
SGGL/BLL/Common/DataCleanupMergeHelper.cs | 71 +++++
SGGL/BLL/DataShare/APIDataShareSyncService.cs | 49 +++
.../DataShare/HSSE/APIMeetingSyncService.cs | 273 +++++++++++++++++
SGGL/BLL/OpenService/FileInsertService.cs | 107 +++++--
SGGL/BLL/SQLHelper.cs | 34 +++
SGGL/BLL/SysManage/UnitService.cs | 49 ++-
SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx | 19 ++
SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx.cs | 23 ++
.../BaseInfo/WorkPost.aspx.designer.cs | 115 ++++---
.../BaseInfo/WorkPostCleanupMerge.aspx | 161 ++++++++++
.../BaseInfo/WorkPostCleanupMerge.aspx.cs | 280 ++++++++++++++++++
.../WorkPostCleanupMerge.aspx.designer.cs | 224 ++++++++++++++
SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 8 +
.../HSSE/Meeting/ClassMeeting.aspx | 203 ++++++-------
.../HSSE/Meeting/ClassMeeting.aspx.cs | 65 +++-
.../Meeting/ClassMeeting.aspx.designer.cs | 61 ++--
.../HSSE/Meeting/ClassMeetingEdit.aspx.cs | 3 +-
.../HSSE/Meeting/ClassMeetingView.aspx.cs | 3 +-
.../SysManage/UnitCleanupMerge.aspx.cs | 67 +++--
SGGL/Model/DataShare/ClassMeetingData.cs | 93 ++++++
SGGL/Model/Model.cs | 72 +++++
SGGL/Model/Model.csproj | 1 +
.../DataShare/HSSE/MeetingSyncController.cs | 64 ++++
SGGL/WebAPI/ErrLog.txt | 6 +
SGGL/WebAPI/WebAPI.csproj | 1 +
28 files changed, 1911 insertions(+), 225 deletions(-)
create mode 100644 DataBase/版本日志/SUBQHSE_V2026-02-06-xiaj(SP_DataIdMove).sql
create mode 100644 DataBase/版本日志/SUBQHSE_V2026-02-13-xiaj.sql
create mode 100644 SGGL/BLL/Common/DataCleanupMergeHelper.cs
create mode 100644 SGGL/BLL/DataShare/APIDataShareSyncService.cs
create mode 100644 SGGL/BLL/DataShare/HSSE/APIMeetingSyncService.cs
create mode 100644 SGGL/FineUIPro.Web/BaseInfo/WorkPostCleanupMerge.aspx
create mode 100644 SGGL/FineUIPro.Web/BaseInfo/WorkPostCleanupMerge.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/BaseInfo/WorkPostCleanupMerge.aspx.designer.cs
create mode 100644 SGGL/Model/DataShare/ClassMeetingData.cs
create mode 100644 SGGL/WebAPI/Controllers/DataShare/HSSE/MeetingSyncController.cs
diff --git a/DataBase/版本日志/SUBQHSE_V2026-02-06-xiaj(SP_DataIdMove).sql b/DataBase/版本日志/SUBQHSE_V2026-02-06-xiaj(SP_DataIdMove).sql
new file mode 100644
index 00000000..8a37a078
--- /dev/null
+++ b/DataBase/版本日志/SUBQHSE_V2026-02-06-xiaj(SP_DataIdMove).sql
@@ -0,0 +1,59 @@
+
+
+/****** Object: StoredProcedure [dbo].[SP_DataIdMove] Script Date: 2026-2-6 17:34:01 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+
+
+ALTER PROC [dbo].[SP_DataIdMove]
+ @exTable NVARCHAR(50) = NULL ,
+ @colums NVARCHAR(50) = NULL ,
+ @trueId NVARCHAR(50) = NULL
+ --,@returnVal int output
+AS
+
+BEGIN
+--DECLARE @returnVal int =0
+--SET @returnVal = 0
+DECLARE @OldId nvarchar(50),@NewId nvarchar(50)
+DECLARE @tablename nvarchar(1000),@columnname nvarchar(1000)
+DECLARE @sql nvarchar(2000)
+DECLARE cursor_Id CURSOR FOR -- 定义游标
+ SELECT OldId ,NewIds FROM DataIdMove WHERE ColumType = @colums and NewIds = @trueId
+ OPEN cursor_Id
+ FETCH NEXT FROM cursor_Id INTO @OldId, @NewId -- 抓取下一行游标数据
+ WHILE @@FETCH_STATUS = 0 --(-1 语句失败, -2 被提取行不存在)
+ BEGIN
+ --SET @returnVal=@returnVal+1
+ --print @OldId
+ DECLARE cursor_name CURSOR FOR -- 定义游标
+ SELECT DISTINCT TABLE_NAME,COLUMN_NAME
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE COLUMN_NAME like '%'+@colums+'%' and TABLE_NAME in (SELECT distinct TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE') and TABLE_NAME <> @exTable
+ OPEN cursor_name -- 打开游标
+ FETCH NEXT FROM cursor_name INTO @tablename ,@columnname -- 抓取下一行游标数据
+ WHILE @@FETCH_STATUS = 0 --(-1 语句失败, -2 被提取行不存在)
+ BEGIN
+ SET @sql = 'update ' + @tablename + ' set ' + @columnname + ' =REPLACE('+@columnname+', '''+@OldId+''', '''+@NewId+''') where '+ @columnname + ' like '+'''%'+@OldId+'%'';' ;
+ --print @sql
+ EXEC sp_executesql @sql
+ FETCH NEXT FROM cursor_name INTO @tablename,@columnname;
+ END
+ CLOSE cursor_name -- 关闭游标
+ DEALLOCATE cursor_name -- 释放游标
+ FETCH NEXT FROM cursor_Id INTO @OldId, @NewId
+ END
+CLOSE cursor_Id -- 关闭游标
+DEALLOCATE cursor_Id -- 释放游标
+--SELECT @returnVal
+END
+
+
+
+GO
+
+
diff --git a/DataBase/版本日志/SUBQHSE_V2026-02-13-xiaj.sql b/DataBase/版本日志/SUBQHSE_V2026-02-13-xiaj.sql
new file mode 100644
index 00000000..096a8f71
--- /dev/null
+++ b/DataBase/版本日志/SUBQHSE_V2026-02-13-xiaj.sql
@@ -0,0 +1,22 @@
+
+
+--ǰᲹֶ
+IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Meeting_ClassMeeting' AND COLUMN_NAME = 'Remark')
+BEGIN
+ ALTER TABLE Meeting_ClassMeeting ADD Remark nvarchar(500);
+END
+GO
+
+
+--ĿֶΣܰλܰλĿ
+IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Base_Project' AND COLUMN_NAME = 'SubjectUnit')
+BEGIN
+ -- ܰλ
+ ALTER TABLE Base_Project ADD SubjectUnit nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL;
+ -- ܰλĿid
+ ALTER TABLE Base_Project ADD SubjectProject nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL;
+END
+GO
+
+
+
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index 29314d5b..9e6e5499 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -179,6 +179,7 @@
+
@@ -313,6 +314,8 @@
+
+
diff --git a/SGGL/BLL/Common/DataCleanupMergeHelper.cs b/SGGL/BLL/Common/DataCleanupMergeHelper.cs
new file mode 100644
index 00000000..e6b9185a
--- /dev/null
+++ b/SGGL/BLL/Common/DataCleanupMergeHelper.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace BLL
+{
+ ///
+ /// 数据合并清理
+ ///
+ public class DataCleanupMergeHelper
+ {
+ ///
+ /// 数据合并清理
+ ///
+ /// 排除操作数据表
+ /// 替换字段(模糊匹配)
+ /// 需要替换的数据值
+ /// 新的字段数据值
+ ///
+ public static bool DataCleanupMerge(string exTable, string columType, List mergeDataIds, string dataId, ref string msg)
+ {
+ bool result = false;
+ try
+ {
+ Model.SGGLDB db = Funs.DB;
+ var clist = db.DataIdMove.Where(x => x.ColumType == columType && x.NewIds == dataId).ToList();
+ db.DataIdMove.DeleteAllOnSubmit(clist);
+ db.SubmitChanges();
+ List list = new List();
+ foreach (var mergeId in mergeDataIds)
+ {
+ list.Add(new Model.DataIdMove { OldId = mergeId.Trim(), NewIds = dataId.Trim(), ColumType = columType });
+ }
+
+ db.DataIdMove.InsertAllOnSubmit(list);
+ db.SubmitChanges();
+
+
+ //SP_DataIdMove[排除操作数据表,替换字段(模糊匹配),字段数据值]
+ string strSql = $"exec SP_DataIdMove '{exTable}','{columType}','{dataId}'";
+ result = BLL.SQLHelper.ExecuteSql(strSql);
+
+ //SqlParameter[] parameters = {
+ // new SqlParameter("@exTable", exTable),
+ // new SqlParameter("@colums", columType),
+ // new SqlParameter("@trueId", dataId),
+ // new SqlParameter("@returnVal", SqlDbType.Int)
+ //};
+ //BLL.SQLHelper.ExecuteNonQueryStoredProcedure("SP_DataIdMove", parameters);
+ //int succ = BLL.SQLHelper.ExecuteProcedure("SP_DataIdMove", parameters);
+ //Thread.Sleep(30000); // 等待30秒,30000毫秒等于30秒
+ if (result)
+ {
+ db.DataIdMove.DeleteAllOnSubmit(list);
+ db.SubmitChanges();
+ msg = "数据合并成功!";
+ }
+ else
+ {
+ msg = "数据合并失败,请稍后再试!";
+ }
+ }
+ catch (Exception ex)
+ {
+ msg = ex.Message;
+ result = false;
+ }
+ return result;
+ }
+ }
+}
diff --git a/SGGL/BLL/DataShare/APIDataShareSyncService.cs b/SGGL/BLL/DataShare/APIDataShareSyncService.cs
new file mode 100644
index 00000000..c35c572e
--- /dev/null
+++ b/SGGL/BLL/DataShare/APIDataShareSyncService.cs
@@ -0,0 +1,49 @@
+using System.Linq;
+
+namespace BLL
+{
+ ///
+ /// 数据共享互通辅助服务
+ ///
+ public class APIDataShareSyncService
+ {
+ #region 班组
+
+ ///
+ /// 获取班组Id
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string GetTeamGroupId(string TeamGroupName, string projectId, string unitId)
+ {
+ string TeamGroupId = null;
+ if (!string.IsNullOrEmpty(TeamGroupName))
+ {
+ var tg = Funs.DB.ProjectData_TeamGroup.Where(x => x.TeamGroupName == TeamGroupName && x.ProjectId == projectId && x.UnitId == unitId).ToList();
+ if (tg.Count == 0)
+ {
+ Model.ProjectData_TeamGroup newTeamGroup = new Model.ProjectData_TeamGroup
+ {
+ TeamGroupId = SQLHelper.GetNewID(typeof(Model.ProjectData_TeamGroup)),
+ ProjectId = projectId,
+ UnitId = unitId,
+ TeamGroupName = TeamGroupName,
+ Remark = "导入"
+ };
+ TeamGroupService.AddTeamGroup(newTeamGroup);
+ TeamGroupId = newTeamGroup.TeamGroupId;
+ }
+ else
+ {
+ TeamGroupId = tg.FirstOrDefault().TeamGroupId;
+ }
+ }
+ return TeamGroupId;
+ }
+
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/DataShare/HSSE/APIMeetingSyncService.cs b/SGGL/BLL/DataShare/HSSE/APIMeetingSyncService.cs
new file mode 100644
index 00000000..fdbffa7b
--- /dev/null
+++ b/SGGL/BLL/DataShare/HSSE/APIMeetingSyncService.cs
@@ -0,0 +1,273 @@
+using Model;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections;
+using System.Linq;
+
+namespace BLL
+{
+ ///
+ /// 安全会议数据共享互通
+ ///
+ public class APIMeetingSyncService
+ {
+ #region 分包单位推送数据到总包单位
+
+ ///
+ /// 推送分包班前会数据
+ ///
+ /// 项目Id
+ /// 班前会数据Id(为空的时候推送全部)
+ ///
+ public static ReturnData PushClassMeetingLists(string projectId, string dataId = "")
+ {
+ Model.ReturnData responeData = new Model.ReturnData();
+ responeData.code = 0;
+ responeData.message = string.Empty;
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ try
+ {
+ var list = from x in db.Meeting_ClassMeeting where x.ProjectId == projectId select x;
+ if (!string.IsNullOrWhiteSpace(dataId))
+ {
+ list = list.Where(x => x.ClassMeetingId == dataId);
+ }
+ var dataList = (from x in list
+ join ptg in db.ProjectData_TeamGroup on x.TeamGroupId equals ptg.TeamGroupId into ptGroup
+ from ptg in ptGroup.DefaultIfEmpty()
+ join su in db.Sys_User on x.CompileMan equals su.UserId into sUser
+ from su in sUser.DefaultIfEmpty()
+ join att in db.AttachFile on x.ClassMeetingId equals att.ToKeyId into attTemp
+ from att in attTemp.DefaultIfEmpty()
+ join att1 in db.AttachFile on (x.ClassMeetingId + "#1") equals att1.ToKeyId into att1Temp
+ from att1 in att1Temp.DefaultIfEmpty()
+ join att2 in db.AttachFile on (x.ClassMeetingId + "#2") equals att2.ToKeyId into att2Temp
+ from att2 in att2Temp.DefaultIfEmpty()
+ orderby x.CompileDate descending
+ select new ClassMeetingItem
+ {
+ ProjectId = x.ProjectId,
+ UnitId = x.UnitId,
+ ClassMeetingId = x.ClassMeetingId,
+ ClassMeetingCode = x.ClassMeetingCode,
+ ClassMeetingName = x.ClassMeetingName,
+ ClassMeetingDate = x.ClassMeetingDate,
+ ClassMeetingContents = x.ClassMeetingContents,
+ CompileMan = x.CompileMan,
+ CompileManName = su.UserName,
+ TeamGroupId = x.TeamGroupId,
+ TeamGroupName = ptg.TeamGroupName,
+ CompileDate = x.CompileDate,
+ States = x.States,
+ MeetingPlace = x.MeetingPlace,
+ MeetingHours = x.MeetingHours,
+ MeetingHostMan = x.MeetingHostMan,
+ AttentPerson = x.AttentPerson,
+ AttentPersonNum = x.AttentPersonNum,
+ //MeetingHostManOther = x.MeetingHostManOther,
+ Remark = x.Remark,
+ //AttachUrl = AttachFileService.getFileUrl(x.ClassMeetingId),//内容
+ //AttachUrl1 = AttachFileService.getFileUrl(x.ClassMeetingId + "#1"),//签到表
+ //AttachUrl2 = AttachFileService.getFileUrl(x.ClassMeetingId + "#2"),//会议过程
+ AttachFileId = att.AttachFileId,
+ ToKeyId = att.ToKeyId,
+ AttachSource = att.AttachSource,
+ AttachUrl = att.AttachUrl,
+ AttachFileId1 = att1.AttachFileId,
+ ToKeyId1 = att1.ToKeyId,
+ AttachSource1 = att1.AttachSource,
+ AttachUrl1 = att1.AttachUrl,
+ AttachFileId2 = att2.AttachFileId,
+ ToKeyId2 = att2.ToKeyId,
+ AttachSource2 = att2.AttachSource,
+ AttachUrl2 = att2.AttachUrl,
+ }).ToList();
+
+ if (dataList.Count() > 0)
+ {
+ var thisUnit = CommonService.GetIsThisUnit();
+ var porject = BLL.ProjectService.GetProjectByProjectId(projectId);
+ var pushData = new ClassMeetingData
+ {
+ CollCropCode = thisUnit.CollCropCode,//分包单位社会统一信用码
+ UnitId = thisUnit.UnitId,//分包单位Id
+ UnitName = thisUnit.UnitName,//分包单位名称
+ ShortUnitName = thisUnit.ShortUnitName,//分包单位简称
+ UnitDomain = Funs.SGGLUrl,//分包单位域名地址【文件存储地址】
+ SubjectUnit = porject.SubjectUnit,//主包单位Id
+ SubjectProject = porject.SubjectProject,//主包项目Id
+ Items = dataList//会议数据
+ };
+ var pushContent = JsonConvert.SerializeObject(pushData);
+
+ //获取总包单位接口apiurl地址
+ var Url = BLL.UnitService.getUnitApiUrlByUnitId(porject.SubjectUnit);
+ var ApiUrl = string.Empty;
+ var WebUrl = string.Empty;
+ if (Url != null)
+ {
+ var urls = Url.Split(',');
+ ApiUrl = urls[0];
+ if (urls.Length > 1)
+ {
+ WebUrl = urls[1];
+ }
+ }
+ var baseurl = $"{ApiUrl}/api/MeetingSync/ReceiveSaveProjectClassMeetingData";
+ string contenttype = "application/json;charset=unicode";
+ Hashtable newToken = new Hashtable
+ {
+ { "token", ServerService.GetToken().Token }
+ };
+ //var returndata = APIGetHttpService.Http(baseurl, "Post", contenttype, newToken, pushContent);
+ var returndata = "";
+ if (!string.IsNullOrEmpty(returndata))
+ {
+ JObject obj = JObject.Parse(returndata);
+ string mess = obj["message"].ToString();
+ string code = obj["code"].ToString();
+ }
+ }
+ else
+ {
+ responeData.message = "当前项目没有班前会数据";
+ }
+ }
+ catch (Exception ex)
+ {
+ responeData.message = "同步到总包单位失败!";
+ ErrLogInfo.WriteLog("【班前会】同步到总包单位失败!", ex);
+ }
+ }
+ return responeData;
+ }
+
+ #endregion
+
+ #region 总包单位接收分包单位推送数据
+
+ ///
+ /// 总包单位接收保存分包单位推送的班前会数据
+ ///
+ ///
+ ///
+ public static string ReceiveSaveProjectClassMeetingData(ClassMeetingData data)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ string result = string.Empty;
+ if (data.Items.Count() > 0)
+ {
+ //1、判断分包单位是否存在
+ var unit = UnitService.getUnitByCollCropCodeUnitName(data.CollCropCode, data.UnitName);
+ if (unit == null)
+ {
+ result = "总包单位不存在本单位,请登录总包系统检查维护本单位信息!";
+ }
+ else
+ {
+ //2、判断主包项目是否存在
+ var porject = BLL.ProjectService.GetProjectByProjectId(data.SubjectProject);
+ if (porject == null)
+ {
+ result = "总包单位不存在本项目,请检查总包项目关联是否正确!";
+ }
+ else
+ {
+ int succ = 0;
+ //3、保存数据
+ foreach (var item in data.Items)
+ {
+ try
+ {
+ var model = ClassMeetingService.GetClassMeetingById(item.ClassMeetingId);
+ if (model != null)
+ {//编辑
+ model.ProjectId = data.SubjectProject;
+ model.UnitId = unit.UnitId;
+ model.ClassMeetingCode = item.ClassMeetingCode;
+ model.ClassMeetingName = item.ClassMeetingName;
+ model.ClassMeetingDate = item.ClassMeetingDate;
+ model.AttentPersonNum = item.AttentPersonNum;
+ //model.TeamGroupId = item.TeamGroupId;
+ model.TeamGroupId = APIDataShareSyncService.GetTeamGroupId(item.TeamGroupName, data.SubjectProject, unit.UnitId);
+ model.AttentPersonNum = item.AttentPersonNum;
+ //model.ClassMeetingContents = HttpUtility.HtmlEncode(item.ClassMeetingContents);
+ model.ClassMeetingContents = item.ClassMeetingContents;
+ //model.States = item.States;
+ model.States = BLL.Const.State_2; ;//分包推送过来的班前会数据默认已完成
+ model.MeetingPlace = item.MeetingPlace;
+ model.MeetingHours = item.MeetingHours;
+ model.MeetingHostMan = item.MeetingHostMan;
+ model.AttentPerson = item.AttentPerson;
+ model.AttentPersonNum = item.AttentPersonNum;
+ //model.MeetingHostManOther = item.MeetingHostManOther;
+ //model.Remark = item.Remark;
+ model.Remark = $"{(!string.IsNullOrWhiteSpace(data.ShortUnitName) ? data.ShortUnitName : data.UnitName)}#{item.CompileManName}";
+ model.CompileDate = item.CompileDate;
+ //newModel.CompileMan = item.CompileMan;
+
+ db.SubmitChanges();
+ }
+ else
+ {//新增
+ Model.Meeting_ClassMeeting newModel = new Model.Meeting_ClassMeeting();
+ newModel.ClassMeetingId = item.ClassMeetingId;
+ newModel.ProjectId = data.SubjectProject;
+ newModel.UnitId = unit.UnitId;
+ newModel.ClassMeetingCode = item.ClassMeetingCode;
+ newModel.ClassMeetingName = item.ClassMeetingName;
+ newModel.ClassMeetingDate = item.ClassMeetingDate;
+ newModel.AttentPersonNum = item.AttentPersonNum;
+ //newModel.TeamGroupId = item.TeamGroupId;
+ newModel.TeamGroupId = APIDataShareSyncService.GetTeamGroupId(item.TeamGroupName, data.SubjectProject, unit.UnitId);
+ newModel.AttentPersonNum = item.AttentPersonNum;
+ //newModel.ClassMeetingContents = HttpUtility.HtmlEncode(item.ClassMeetingContents);
+ newModel.ClassMeetingContents = item.ClassMeetingContents;
+ //newModel.States = item.States;
+ newModel.States = BLL.Const.State_2; ;//分包推送过来的班前会数据默认已完成
+ newModel.MeetingPlace = item.MeetingPlace;
+ newModel.MeetingHours = item.MeetingHours;
+ newModel.MeetingHostMan = item.MeetingHostMan;
+ newModel.AttentPerson = item.AttentPerson;
+ newModel.AttentPersonNum = item.AttentPersonNum;
+ //newModel.MeetingHostManOther = item.MeetingHostManOther;
+ //newModel.Remark = item.Remark;
+ newModel.Remark = $"{(!string.IsNullOrWhiteSpace(data.ShortUnitName) ? data.ShortUnitName : data.UnitName)}#{item.CompileManName}";
+ newModel.CompileDate = item.CompileDate;
+ //newModel.CompileMan = item.CompileMan;
+
+ db.Meeting_ClassMeeting.InsertOnSubmit(newModel);
+ db.SubmitChanges();
+ }
+ succ++;
+ //附件处理:内容附件
+ BLL.FileInsertService.SaveAttachFileRecords(data.UnitDomain, item.AttachFileId, item.ToKeyId, item.AttachSource, item.AttachUrl);
+ //附件处理:签到表
+ BLL.FileInsertService.SaveAttachFileRecords(data.UnitDomain, item.AttachFileId1, item.ToKeyId1, item.AttachSource1, item.AttachUrl1);
+ //附件处理:会议过程
+ BLL.FileInsertService.SaveAttachFileRecords(data.UnitDomain, item.AttachFileId2, item.ToKeyId2, item.AttachSource2, item.AttachUrl2);
+ }
+ catch (Exception ex)
+ {
+ BLL.ErrLogInfo.WriteLog($"【{porject.ProjectName}】班前会数据推送总包失败", ex.Message);
+ continue;
+ }
+ }
+ result = $"推送成功:总数{data.Items.Count()}条,成功{succ}条";
+ }
+ }
+ }
+ else
+ {
+ result = "推送数据对象为空!";
+ }
+ return result;
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/OpenService/FileInsertService.cs b/SGGL/BLL/OpenService/FileInsertService.cs
index 2594188f..e94c8463 100644
--- a/SGGL/BLL/OpenService/FileInsertService.cs
+++ b/SGGL/BLL/OpenService/FileInsertService.cs
@@ -1,17 +1,40 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Collections;
+using System.Collections.Generic;
+using System.Configuration;
using System.IO;
-using System.Web;
-using System.Text.RegularExpressions;
+using System.Linq;
using System.Net;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Web;
namespace BLL
{
public static class FileInsertService
{
+
+ ///
+ /// 保存其他单位附件同步处理
+ ///
+ /// 单位域名地址
+ /// 附件id
+ /// 附件keyid
+ /// 附件json信息
+ /// 附件地址
+ public static void SaveAttachFileRecords(string domain, string attachFileId, string tokeyId, string attachSource, string attachUrl)
+ {
+ if (!string.IsNullOrEmpty(attachFileId) && !string.IsNullOrEmpty(attachSource) && !string.IsNullOrEmpty(attachUrl))
+ {
+ List FileContext = new List();
+ if (!string.IsNullOrWhiteSpace(domain) && !string.IsNullOrWhiteSpace(attachUrl))
+ {
+ FileContext = FilePathTransStream(domain, attachUrl);
+ }
+ InsertAttachFilesRecord(attachFileId, tokeyId, attachSource, attachUrl, FileContext);
+ }
+ }
+
///
/// 获取服务器图片转byte
///
@@ -22,35 +45,43 @@ namespace BLL
{
List bytes = new List();
var strs = attachUrl.Trim().Split(',');
-
try
{
foreach (var fileUrl in strs)
{
- string filepath = $"{fileHost}{fileUrl}";
- // 创建WebClient实例
- using (WebClient webClient = new WebClient())
+ string path = ConfigurationManager.AppSettings["localRoot"] + fileUrl;
+ if (!File.Exists(path))
{
- // 下载图片并保存到内存流
- using (MemoryStream ms = new MemoryStream(webClient.DownloadData(filepath)))
+ //BLL.ErrLogInfo.WriteLog($"不存在则新增,附件地址:{path}");
+ string filepath = $"{fileHost}{fileUrl}";
+ //BLL.ErrLogInfo.WriteLog($"不存在则新增,责任单位附件地址:{filepath}");
+ // 创建WebClient实例
+ using (WebClient webClient = new WebClient())
{
- // 将MemoryStream转换为byte数组
- byte[] imageBytes = ms.ToArray();
- bytes.Add(imageBytes);
- //// 使用byte数组(例如,保存到文件或进行其他处理)
- //File.WriteAllBytes("localImage.jpg", imageBytes);
+ // 下载图片并保存到内存流
+ using (MemoryStream ms = new MemoryStream(webClient.DownloadData(filepath)))
+ {
+ // 将MemoryStream转换为byte数组
+ byte[] imageBytes = ms.ToArray();
+ bytes.Add(imageBytes);
+ //// 使用byte数组(例如,保存到文件或进行其他处理)
+ //File.WriteAllBytes("localImage.jpg", imageBytes);
+ }
}
}
+ //else
+ //{
+ // BLL.ErrLogInfo.WriteLog($"已存在附件地址:{path}");
+ //}
}
}
catch (Exception ex)
{
- Console.WriteLine("Error: " + ex.Message);
+ BLL.ErrLogInfo.WriteLog($"服务器图片转换异常:{fileHost};图片地址:{attachUrl}", ex.Message);
}
return bytes;
}
-
///
/// 获取附件数据流类
///
@@ -187,6 +218,46 @@ namespace BLL
}
}
+ ///
+ /// 数据和附件插入到多附件表
+ ///
+ public static void InsertAttachFilesRecord(string attachFileId, string dataId, string attachSource, string attachUrl, List fileContext)
+ {
+ if (!string.IsNullOrEmpty(attachFileId))
+ {
+ //多附件
+ var attachFile = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == dataId);
+ if (attachFile == null)
+ {
+ ////插入附件文件
+ BLL.FileInsertService.FileMoreInsert(fileContext, attachUrl);
+
+ Model.AttachFile newAttachFile = new Model.AttachFile
+ {
+ AttachFileId = attachFileId,
+ ToKeyId = dataId,
+ AttachSource = attachSource,
+ AttachUrl = attachUrl
+ };
+ Funs.DB.AttachFile.InsertOnSubmit(newAttachFile);
+ Funs.DB.SubmitChanges();
+ }
+ else
+ {
+ if (attachFile.AttachUrl != attachUrl)
+ {
+ /////删除附件文件
+ //BLL.UploadAttachmentService.DeleteFile(ConfigurationManager.AppSettings["localRoot"], attachFile.AttachUrl);
+ ////插入附件文件
+ BLL.FileInsertService.FileMoreInsert(fileContext, attachUrl);
+ attachFile.AttachSource = attachSource;
+ attachFile.AttachUrl = attachUrl;
+ Funs.DB.SubmitChanges();
+ }
+ }
+ }
+ }
+
///
/// 数据和附件插入到多附件表【不存实际文件,只存地址】
diff --git a/SGGL/BLL/SQLHelper.cs b/SGGL/BLL/SQLHelper.cs
index d9bcf7ab..fc53011a 100644
--- a/SGGL/BLL/SQLHelper.cs
+++ b/SGGL/BLL/SQLHelper.cs
@@ -505,6 +505,40 @@ namespace BLL
}
}
+ ///
+ /// ִSQL
+ ///
+ /// sql
+ public static bool ExecuteSql(string sql)
+ {
+ bool result = false;
+ using (SqlConnection Connection = new SqlConnection(connectionString))
+ {
+ try
+ {
+ result = true;
+ Connection.Open();
+ SqlCommand command = new SqlCommand(sql, Connection)
+ {
+ CommandTimeout = 0,
+ CommandType = CommandType.Text
+ };
+ command.ExecuteNonQuery();
+ }
+ catch (Exception ex)
+ {
+ result = false;
+ ErrLogInfo.WriteLog($"ִSQL䱨{sql}Ϣ{ex.Message}");
+ }
+ finally
+ {
+ Connection.Close();
+ }
+ return result;
+ }
+ }
+
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// Creates a DataSet by running the stored procedure and placing the results
diff --git a/SGGL/BLL/SysManage/UnitService.cs b/SGGL/BLL/SysManage/UnitService.cs
index 150202a1..e229a6a7 100644
--- a/SGGL/BLL/SysManage/UnitService.cs
+++ b/SGGL/BLL/SysManage/UnitService.cs
@@ -1,4 +1,6 @@
-using System;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -857,5 +859,50 @@ namespace BLL
Funs.FineUIPleaseSelect(dropName);
}
}
+
+
+ #region 根据单位id获取单位信息列表
+
+ ///
+ /// 获取集团单位列表
+ ///
+ ///
+ public static string getUnitApiUrlByUnitId(string userId)
+ {
+ string url = "";
+ try
+ {
+ string baseurl = $"{SysConstSetService.CNCECPath}/api/Unit/getUnitApiUrlByUnitId?unitId=" + userId;
+ string contenttype = "application/json;charset=unicode";
+ Hashtable newToken = new Hashtable
+ {
+ { "token", ServerService.GetToken().Token }
+ };
+ var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, newToken, null);
+ if (!string.IsNullOrEmpty(strJosn))
+ {
+ JObject obj = JObject.Parse(strJosn);
+ if (Funs.GetNewIntOrZero(obj["code"].ToString()) == 1)
+ {
+ if (obj["data"] != null)
+ {
+ JObject dataObj = obj["data"] as JObject;
+ if (dataObj != null && dataObj["BaseInfoCode"] != null)
+ {
+ url = dataObj["BaseInfoCode"].ToString();
+ }
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ ErrLogInfo.WriteLog("获取失败!", ex);
+ }
+
+ return url;
+ }
+
+ #endregion
}
}
diff --git a/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx b/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx
index 6f165560..9aee8a9b 100644
--- a/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx
+++ b/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx
@@ -18,6 +18,21 @@
SortField="PostType,WorkPostCode" SortDirection="ASC"
OnPageIndexChange="Grid1_PageIndexChange" AllowFilters="true" OnFilterChange="Grid1_FilterChange"
EnableTextSelection="True">
+
+
+
+
+
+
+
+
+ <%--
+ --%>
+
+
+
+
+
@@ -134,6 +149,10 @@
+
+