IDP质量设计图纸管理
This commit is contained in:
@@ -178,6 +178,7 @@
|
||||
<Compile Include="Common\AttachFileService.cs" />
|
||||
<Compile Include="Common\CodeRecordsService.cs" />
|
||||
<Compile Include="Common\CommonService.cs" />
|
||||
<Compile Include="Common\HttpHelper.cs" />
|
||||
<Compile Include="Common\CreateQRCodeService.cs" />
|
||||
<Compile Include="Common\IDCardValid.cs" />
|
||||
<Compile Include="Common\NPOIExcel.cs" />
|
||||
@@ -292,6 +293,7 @@
|
||||
<Compile Include="CQMS\Unqualified\WorkContactApproveService.cs" />
|
||||
<Compile Include="CQMS\Unqualified\WorkContactService.cs" />
|
||||
<Compile Include="CQMS\WBS\BreakdownProjectService.cs" />
|
||||
<Compile Include="CQMS\DesignDrawing\DesignDrawingService.cs" />
|
||||
<Compile Include="CQMS\WBS\BreakdownService.cs" />
|
||||
<Compile Include="CQMS\WBS\ControlItemAndCycleService.cs" />
|
||||
<Compile Include="CQMS\WBS\ControlItemInitService.cs" />
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Web.UI.WebControls;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class DesignDrawingService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 获取IDP文件
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<IDP_DesignDrawing> GetIDPDesignDrawingFile()
|
||||
{
|
||||
return (from x in Funs.DB.IDP_DesignDrawing select x).ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取IDP文件id
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<string> GetIDPDesignDrawingFileId()
|
||||
{
|
||||
return (from x in Funs.DB.IDP_DesignDrawing select x.IdpfileId).ToList();
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 添加分项
|
||||
///// </summary>
|
||||
///// <param name="Installation"></param>
|
||||
//public static void AddBreakdown(Model.WBS_Breakdown breakdown)
|
||||
//{
|
||||
// Model.SGGLDB db = Funs.DB;
|
||||
// Model.WBS_Breakdown newBreakdown = new Model.WBS_Breakdown();
|
||||
|
||||
// newBreakdown.BreakdownId = breakdown.BreakdownId;
|
||||
// newBreakdown.BreakdownCode = breakdown.BreakdownCode;
|
||||
// newBreakdown.BreakdownName = breakdown.BreakdownName;
|
||||
// newBreakdown.DivisionId = breakdown.DivisionId;
|
||||
// newBreakdown.Basis = breakdown.Basis;
|
||||
// newBreakdown.CheckPoints = breakdown.CheckPoints;
|
||||
// newBreakdown.RecordAndCode = breakdown.RecordAndCode;
|
||||
// newBreakdown.Class = breakdown.Class;
|
||||
// newBreakdown.SortIndex = breakdown.SortIndex;
|
||||
// newBreakdown.Remark = breakdown.Remark;
|
||||
// newBreakdown.ModelURL = breakdown.ModelURL;
|
||||
// newBreakdown.IsAcceptance = breakdown.IsAcceptance;
|
||||
// newBreakdown.FenBao = breakdown.FenBao;
|
||||
// newBreakdown.WuHuan = breakdown.WuHuan;
|
||||
// newBreakdown.JianLi = breakdown.JianLi;
|
||||
// newBreakdown.YeZhu = breakdown.YeZhu;
|
||||
// newBreakdown.CheckAcceptType = breakdown.CheckAcceptType;
|
||||
|
||||
// db.WBS_Breakdown.InsertOnSubmit(newBreakdown);
|
||||
// db.SubmitChanges();
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 修改分项
|
||||
///// </summary>
|
||||
///// <param name="breakdown"></param>
|
||||
//public static void UpdateBreakdown(Model.WBS_Breakdown breakdown)
|
||||
//{
|
||||
// Model.SGGLDB db = Funs.DB;
|
||||
// Model.WBS_Breakdown newBreakdown = db.WBS_Breakdown.First(e => e.BreakdownId == breakdown.BreakdownId);
|
||||
// newBreakdown.BreakdownCode = breakdown.BreakdownCode;
|
||||
// newBreakdown.BreakdownName = breakdown.BreakdownName;
|
||||
// newBreakdown.DivisionId = breakdown.DivisionId;
|
||||
// newBreakdown.Basis = breakdown.Basis;
|
||||
// newBreakdown.CheckPoints = breakdown.CheckPoints;
|
||||
// newBreakdown.RecordAndCode = breakdown.RecordAndCode;
|
||||
// newBreakdown.Class = breakdown.Class;
|
||||
// newBreakdown.SortIndex = breakdown.SortIndex;
|
||||
// newBreakdown.Remark = breakdown.Remark;
|
||||
// newBreakdown.ModelURL = breakdown.ModelURL;
|
||||
// newBreakdown.FenBao = breakdown.FenBao;
|
||||
// newBreakdown.WuHuan = breakdown.WuHuan;
|
||||
// newBreakdown.JianLi = breakdown.JianLi;
|
||||
// newBreakdown.YeZhu = breakdown.YeZhu;
|
||||
// newBreakdown.CheckAcceptType = breakdown.CheckAcceptType;
|
||||
// db.SubmitChanges();
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3925,6 +3925,14 @@ namespace BLL
|
||||
public const string CheckListMenuId = "B3E99BD9-FDC7-4F15-8C3C-A7821AC9E306";
|
||||
#endregion
|
||||
|
||||
|
||||
#region 质量设计图纸管理
|
||||
/// <summary>
|
||||
/// 档案文件库
|
||||
/// </summary>
|
||||
public const string ArchivesLibMenuId = "13E3544E-AC56-48F9-9BC0-EB14EF4620FF";
|
||||
#endregion
|
||||
|
||||
#region 质量共检
|
||||
/// <summary>
|
||||
/// 质量共检
|
||||
|
||||
+60
-7
@@ -39,13 +39,13 @@ namespace BLL
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static Dictionary<string ,string >WebEditList= new Dictionary<string ,string >();
|
||||
public static Dictionary<string, string> WebEditList = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// 数据库连接字符串
|
||||
/// </summary>
|
||||
private static string connString;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 数据库连结字符串。
|
||||
/// </summary>
|
||||
@@ -294,7 +294,7 @@ namespace BLL
|
||||
DDL.Items.Insert(0, new FineUIPro.ListItem("- 请选择 -", BLL.Const._Null));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 为目标下拉框加上选择内容
|
||||
/// </summary>
|
||||
@@ -623,11 +623,64 @@ namespace BLL
|
||||
Random rm = new Random(System.Environment.TickCount);
|
||||
if (dateTime.HasValue)
|
||||
{
|
||||
str= dateTime.Value.ToString("yyyyMMddhhmmss") + rm.Next(1000, 9999).ToString();
|
||||
str = dateTime.Value.ToString("yyyyMMddhhmmss") + rm.Next(1000, 9999).ToString();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
#region 时间戳
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前时间的时间戳
|
||||
/// </summary>
|
||||
/// <param name="size">时间戳长度(默认10位)</param>
|
||||
/// <returns></returns>
|
||||
public static long GetNowTimeStamp(int size = 10)
|
||||
{
|
||||
long result = 0;
|
||||
// 获取当前时间
|
||||
DateTimeOffset now = DateTimeOffset.Now;
|
||||
// 获取Unix纪元时间(1970-01-01)到现在的时间间隔
|
||||
TimeSpan timeSpan = now - new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
|
||||
if (size == 13)
|
||||
{
|
||||
// 转换为长整型的毫秒数
|
||||
result = (long)timeSpan.TotalMilliseconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (long)timeSpan.TotalSeconds;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定时间的时间戳
|
||||
/// </summary>
|
||||
/// <param name="dateOffset"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <returns></returns>
|
||||
public static long GetDateTimeStamp(DateTimeOffset dateOffset, int size = 10)
|
||||
{
|
||||
long result = 0;
|
||||
DateTimeOffset epochStart = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
|
||||
// 获取Unix纪元时间(1970-01-01)到现在的时间间隔
|
||||
TimeSpan timeSpan = dateOffset - epochStart;
|
||||
if (size == 13)
|
||||
{
|
||||
// 转换为长整型的毫秒数
|
||||
result = (long)timeSpan.TotalMilliseconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (long)timeSpan.TotalSeconds;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 时间转换
|
||||
/// <summary>
|
||||
/// 输入文本转换时间类型
|
||||
@@ -639,7 +692,7 @@ namespace BLL
|
||||
{
|
||||
if (!String.IsNullOrEmpty(time))
|
||||
{
|
||||
DateTime dateTime = DateTime.Parse(time);
|
||||
DateTime dateTime = DateTime.Parse(time);
|
||||
if (dateTime.Year > 1753 && dateTime.Year < 9999)
|
||||
{
|
||||
return dateTime;
|
||||
@@ -950,7 +1003,7 @@ namespace BLL
|
||||
}
|
||||
|
||||
#region 获取大写金额事件
|
||||
public static string NumericCapitalization(decimal num)
|
||||
public static string NumericCapitalization(decimal num)
|
||||
{
|
||||
string str1 = "零壹贰叁肆伍陆柒捌玖"; //0-9所对应的汉字
|
||||
string str2 = "万仟佰拾亿仟佰拾万仟佰拾元角分"; //数字位所对应的汉字
|
||||
@@ -1081,7 +1134,7 @@ namespace BLL
|
||||
return str.ToArray();
|
||||
}
|
||||
|
||||
public static string GetStringByArray(string[] array)
|
||||
public static string GetStringByArray(string[] array)
|
||||
{
|
||||
string str = string.Empty;
|
||||
foreach (var item in array)
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using RestSharp;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class HttpHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// GET请求
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public static string Get(string url, Dictionary<string, string> token)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
|
||||
|
||||
var client = new RestClient(url);
|
||||
client.Timeout = -1;
|
||||
var request = new RestRequest(Method.GET);
|
||||
if (token != null)
|
||||
{
|
||||
foreach (var item in token)
|
||||
{
|
||||
request.AddHeader(item.Key, item.Value);
|
||||
}
|
||||
}
|
||||
request.AddHeader("ClientId", SysConstSetService.ClientId);
|
||||
request.AddHeader("OperationCode", url.Substring(url.LastIndexOf("/", StringComparison.Ordinal) + 1));
|
||||
IRestResponse response = client.Execute(request);
|
||||
return response.Content;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// POST请求
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="token"></param>
|
||||
/// <param name="jsonBody"></param>
|
||||
/// <returns></returns>
|
||||
public static string Post(string url, Dictionary<string, string> token, string jsonBody)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
|
||||
var client = new RestClient(url);
|
||||
client.Timeout = -1;
|
||||
var request = new RestRequest(Method.POST);
|
||||
if (token != null)
|
||||
{
|
||||
foreach (var item in token)
|
||||
{
|
||||
request.AddHeader(item.Key, item.Value);
|
||||
}
|
||||
}
|
||||
request.AddHeader("ClientId", SysConstSetService.ClientId);
|
||||
request.AddHeader("OperationCode", url.Substring(url.LastIndexOf("/", StringComparison.Ordinal) + 1));
|
||||
if (!string.IsNullOrEmpty(jsonBody))
|
||||
{
|
||||
request.AddJsonBody(jsonBody);
|
||||
}
|
||||
|
||||
IRestResponse response = client.Execute(request);
|
||||
return response.Content;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+313
-39
@@ -1,4 +1,5 @@
|
||||
using Apache.NMS.ActiveMQ.Commands;
|
||||
using Aspose.Words.Lists;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
@@ -8,20 +9,39 @@ using SgManager.AI;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Policy;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// IDP平台接口服务
|
||||
/// </summary>
|
||||
public static class IDPDataService
|
||||
{
|
||||
/// <summary>
|
||||
/// 测试环境api地址
|
||||
/// </summary>
|
||||
private static readonly string IDPApiUrl = "http://10.5.6.151:8100/";
|
||||
///// <summary>
|
||||
///// 正式环境api地址
|
||||
///// </summary>
|
||||
//private static readonly string IDPApiUrl = "https://idp.cwcec.com/";
|
||||
private static readonly string IDPApiUrl = SysConstSetService.WuHuanIDPPath;
|
||||
////private static readonly string publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQChnc2YD0YzJPx6QTh+/n7XzjR1ugFzrsmPolJhpCfWMKrSGbT7iX/Kgcm1AI+T95K4Jzv3KS42QTecZ1ziJ4Rr9Luzw+9ZCSjMZgrmAUbY5IeBaA6GzaSk8UWHZ4n5PL+GUGq+2f+COL7+KCS2AxEpaqDZVrJrIfg/UektdgNyzwIDAQAB";
|
||||
//private static readonly string IDPApiUrl = SysConstSetService.WuHuanIDPPath;
|
||||
|
||||
#region 接口授权认证
|
||||
|
||||
/// <summary>
|
||||
/// 加密公钥
|
||||
/// </summary>
|
||||
private static readonly string publicKey = "<RSAKeyValue><Modulus>g1sk7Xtc1TJouHdY4+FAe5atGCu2n17NhoKVDV57pki1IL+9+S7BY4gxAjmMkUU2/cbCCdbPoUJLBrCBCjX7yI3UJW6FZwQWkn3kVoeulLEwdPCIq/GUjMXaWf3Iaaad5wBUFbfXAzv15VN6z48Nt1IY/O8YEzhIpuZdtEgDdos=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
|
||||
//private static readonly string publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQChnc2YD0YzJPx6QTh+/n7XzjR1ugFzrsmPolJhpCfWMKrSGbT7iX/Kgcm1AI+T95K4Jzv3KS42QTecZ1ziJ4Rr9Luzw+9ZCSjMZgrmAUbY5IeBaA6GzaSk8UWHZ4n5PL+GUGq+2f+COL7+KCS2AxEpaqDZVrJrIfg/UektdgNyzwIDAQAB";
|
||||
|
||||
/// <summary>
|
||||
/// 第三方加密认证接口
|
||||
@@ -30,48 +50,60 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static SessionItem GetAuthenticationSession()
|
||||
{
|
||||
//// 创建RSA加密服务提供者
|
||||
////using (RSA rsa = RSA.Create())
|
||||
//using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
|
||||
//{
|
||||
//// 获取公钥false表示只导出公钥
|
||||
//string publicKey = rsa.ToXmlString(false);
|
||||
//// 获取私钥true表示导出公钥和私钥
|
||||
//string privateKey = rsa.ToXmlString(true);
|
||||
|
||||
SessionItem session = new SessionItem();
|
||||
|
||||
////用户名加密
|
||||
//string encryptedUsername = EncryptData("dataviewer", publicKey);
|
||||
////密码加密
|
||||
//string encryptedPassword = EncryptData("a3365$!", publicKey);
|
||||
|
||||
//用户名加密后的密文
|
||||
string encryptedUsername = "k0N0tx/hfRPY0v2lq1G8eH6hCO+UiMqlSZi1PD6bhGf4YpP/koJq5hfMsDSzdn3dZjzExrwyrjFWp/1jZLde0+gRbQ0D7tzm0R5D6AmriodD2cJvrEiwtDy7SeGNloSaNmpTEMuycpuueiOeGhMkKnTwWfRkEw73lxEpTmaahq4=";
|
||||
//密码加密后的密文
|
||||
string encryptedPassword = "HLLroiNJJzyTWJt9td1xgChbVzyQkoxWCGGXqdwI2cvlUF/A30FAPaInszSwEhNRQlJZZ01EODElemkgv36DMF+XGwfDi0BfIq9jKG+/+wq0TVOHNhiu2NPzpn5Ji2X3yXIXpH1zv6XEtkvx/qiLToZYfRQCufsl5vH1cZxk2fQ=";
|
||||
|
||||
string url = $"{IDPApiUrl}UAMS/authEncrypt";
|
||||
string contenttype = "application/json;charset=utf-8";
|
||||
var body = new
|
||||
try
|
||||
{
|
||||
encryptedUsername = encryptedUsername,
|
||||
encryptedPassword = encryptedPassword
|
||||
};
|
||||
//// 创建RSA加密服务提供者
|
||||
////using (RSA rsa = RSA.Create())
|
||||
//using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
|
||||
//{
|
||||
//// 获取公钥false表示只导出公钥
|
||||
//string publicKey = rsa.ToXmlString(false);
|
||||
//// 获取私钥true表示导出公钥和私钥
|
||||
//string privateKey = rsa.ToXmlString(true);
|
||||
|
||||
string pushContent = JsonConvert.SerializeObject(body);
|
||||
//var returndata = BLL.APIGetHttpService.OutsideHttp(url, "POST", null, null, pushContent);
|
||||
string strJosn = APIGetHttpService.Http(url, "POST", contenttype, null, pushContent);
|
||||
JObject obj = JObject.Parse(strJosn);
|
||||
if (!string.IsNullOrEmpty(strJosn))
|
||||
|
||||
////用户名加密
|
||||
//string encryptedUsername = EncryptData("dataviewer", publicKey);
|
||||
////密码加密
|
||||
//string encryptedPassword = EncryptData("a3365$!", publicKey);
|
||||
|
||||
//用户名加密后的密文
|
||||
string encryptedUsername = "k0N0tx/hfRPY0v2lq1G8eH6hCO+UiMqlSZi1PD6bhGf4YpP/koJq5hfMsDSzdn3dZjzExrwyrjFWp/1jZLde0+gRbQ0D7tzm0R5D6AmriodD2cJvrEiwtDy7SeGNloSaNmpTEMuycpuueiOeGhMkKnTwWfRkEw73lxEpTmaahq4=";
|
||||
//密码加密后的密文
|
||||
string encryptedPassword = "HLLroiNJJzyTWJt9td1xgChbVzyQkoxWCGGXqdwI2cvlUF/A30FAPaInszSwEhNRQlJZZ01EODElemkgv36DMF+XGwfDi0BfIq9jKG+/+wq0TVOHNhiu2NPzpn5Ji2X3yXIXpH1zv6XEtkvx/qiLToZYfRQCufsl5vH1cZxk2fQ=";
|
||||
|
||||
string url = $"{IDPApiUrl}UAMS/authEncrypt";
|
||||
//string url = $"http://10.5.6.151:8100/UAMS/authEncrypt";
|
||||
string contenttype = "application/json;charset=utf-8";
|
||||
var body = new
|
||||
{
|
||||
encryptedUsername = encryptedUsername,
|
||||
encryptedPassword = encryptedPassword
|
||||
};
|
||||
|
||||
string pushContent = JsonConvert.SerializeObject(body);
|
||||
string strJosn = APIGetHttpService.Http(url, "POST", contenttype, null, pushContent);
|
||||
//string strJosn = HttpHelper.Post(url, null, pushContent);
|
||||
JObject obj = JObject.Parse(strJosn);
|
||||
if (!string.IsNullOrEmpty(strJosn))
|
||||
{
|
||||
string value = obj["value"].ToString();
|
||||
string name = obj["name"].ToString();
|
||||
session.value = value;
|
||||
session.name = name;
|
||||
}
|
||||
//}
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
string value = obj["value"].ToString();
|
||||
string name = obj["name"].ToString();
|
||||
session.value = value;
|
||||
session.name = name;
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
return session;
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -100,6 +132,245 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 质量管理设计图纸
|
||||
|
||||
#region IDP
|
||||
|
||||
/// <summary>
|
||||
/// 质量管理设计图纸
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <param name="startDate">获取指定日期之后到现在的异动数据</param>
|
||||
public static void GetIDPProjectDesignDrawingData(string projectId = "", string startDate = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
//五环主数据项目Code
|
||||
string projectCode = string.Empty;
|
||||
if (!string.IsNullOrWhiteSpace(projectId))
|
||||
{//根据施工平台项目Id获取主数据项目Code
|
||||
var getPro = ProjectService.GetProjectByProjectId(projectId);
|
||||
projectCode = getPro.ProjectCode;
|
||||
}
|
||||
|
||||
string timeStampStr = string.Empty;
|
||||
if (!string.IsNullOrWhiteSpace(startDate))
|
||||
{
|
||||
string format = "yyyy-MM-dd";
|
||||
DateTimeOffset dateTimeOffset = DateTimeOffset.ParseExact(startDate, format, CultureInfo.InvariantCulture);
|
||||
long timeStamp = Funs.GetDateTimeStamp(dateTimeOffset, 13);
|
||||
timeStampStr = timeStamp.ToString();
|
||||
}
|
||||
|
||||
var session = GetAuthenticationSession();
|
||||
//ErrLogInfo.WriteLog($"【Session】name:{session.name};value:{session.value}");
|
||||
Hashtable newToken = new Hashtable { { "Cookie", $"{session.name}={session.value}" } };
|
||||
|
||||
List<IDP_DesignDrawing> listAdd = new List<IDP_DesignDrawing>();
|
||||
List<IDP_DesignDrawing> listModify = new List<IDP_DesignDrawing>();
|
||||
|
||||
int pageSize = 1000;//一次性最多返回1000条数据
|
||||
int maxPageNum = 100;
|
||||
List<string> idpFileIds = DesignDrawingService.GetIDPDesignDrawingFileId();
|
||||
List<IDP_DesignDrawing> idpFiles = DesignDrawingService.GetIDPDesignDrawingFile();
|
||||
for (int pageNum = 1; pageNum < 100000; pageNum++)
|
||||
{
|
||||
if (pageNum > maxPageNum) { break; }
|
||||
string url = $"{IDPApiUrl}EDC/third/workitems?pageNum={pageNum}&pageSize={pageSize}";
|
||||
if (!string.IsNullOrWhiteSpace(timeStampStr)) { url = $"{url}&lastTimestamp={timeStampStr}"; }
|
||||
if (!string.IsNullOrWhiteSpace(projectCode)) { url = $"{url}&projectCode={projectCode}"; }
|
||||
|
||||
var returndata = BLL.APIGetHttpService.OutsideHttp(url, "GET", null, newToken, null);
|
||||
if (!string.IsNullOrEmpty(returndata))
|
||||
{
|
||||
IDPDesignDrawingResponseData responseData = IDPDesignDrawingResponseData.FromJson(returndata);
|
||||
maxPageNum = responseData.page.pages;
|
||||
foreach (var item in responseData.page.results)
|
||||
{
|
||||
IDP_DesignDrawing newItem = new IDP_DesignDrawing();
|
||||
if (!string.IsNullOrWhiteSpace(projectId))
|
||||
{
|
||||
newItem.ProjectId = projectId;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(item.projectCode))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var getProject = ProjectService.GetProjectByProjectCode(item.projectCode);
|
||||
if (getProject == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
newItem.ProjectId = getProject.ProjectId;
|
||||
}
|
||||
newItem.IdpfileId = item.fileId;
|
||||
newItem.StockId = item.stockId;
|
||||
newItem.ThirdId = item.thirdId;
|
||||
newItem.ProjectCode = item.projectCode;
|
||||
newItem.DisplayProjectName = item.displayProjectName;
|
||||
newItem.ProjectDeviceProcedureSubjectCode = item.projectDeviceProcedureSubjectCode;
|
||||
newItem.WbsFullPath = item.wbsFullPath;
|
||||
newItem.FormatFileName = item.formatFileName;
|
||||
newItem.FileVersion = item.fileVersion;
|
||||
newItem.MajorNo = item.majorNo;
|
||||
newItem.Status = item.status;
|
||||
newItem.DesignUserName = item.designUserName;
|
||||
newItem.JiaoheUserName = item.jiaoheUserName;
|
||||
newItem.ShenheUserName = item.shenheUserName;
|
||||
newItem.ShendingUserName = item.shendingUserName;
|
||||
newItem.MajorResponsibleUserName = item.majorResponsibleUserName;
|
||||
newItem.ClassificationLevelInProject = item.classificationLevelInProject;
|
||||
newItem.UpdateTime = item.updateTime;
|
||||
newItem.Remark = item.remark;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(item.fileId) && idpFileIds.Contains(item.fileId))
|
||||
{//编辑
|
||||
newItem.Id = idpFiles.Where(x => x.IdpfileId == item.fileId).FirstOrDefault().Id;
|
||||
listModify.Add(newItem);
|
||||
}
|
||||
else
|
||||
{//新增
|
||||
newItem.Id = SQLHelper.GetNewID(typeof(IDP_DesignDrawing));
|
||||
listAdd.Add(newItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (listAdd.Any())
|
||||
{
|
||||
AddIDP_DesignDrawing(listAdd);
|
||||
}
|
||||
if (listModify.Any())
|
||||
{
|
||||
ModifyIDP_DesignDrawing(listModify);
|
||||
}
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量插入数据
|
||||
/// </summary>
|
||||
/// <param name="list"></param>
|
||||
public static void AddIDP_DesignDrawing(List<Model.IDP_DesignDrawing> list)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
db.IDP_DesignDrawing.InsertAllOnSubmit(list);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新数据
|
||||
/// </summary>
|
||||
/// <param name="list"></param>
|
||||
public static void ModifyIDP_DesignDrawing(List<Model.IDP_DesignDrawing> list)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
foreach (var obj in list)
|
||||
{
|
||||
IDP_DesignDrawing newItem = db.IDP_DesignDrawing.FirstOrDefault(x => x.Id == obj.Id);
|
||||
if (newItem != null)
|
||||
{
|
||||
newItem.StockId = obj.StockId;
|
||||
newItem.ThirdId = obj.ThirdId;
|
||||
newItem.ProjectId = obj.ProjectId;
|
||||
newItem.ProjectCode = obj.ProjectCode;
|
||||
newItem.DisplayProjectName = obj.DisplayProjectName;
|
||||
newItem.ProjectDeviceProcedureSubjectCode = obj.ProjectDeviceProcedureSubjectCode;
|
||||
newItem.WbsFullPath = obj.WbsFullPath;
|
||||
newItem.FormatFileName = obj.FormatFileName;
|
||||
newItem.FileVersion = obj.FileVersion;
|
||||
newItem.MajorNo = obj.MajorNo;
|
||||
newItem.Status = obj.Status;
|
||||
newItem.DesignUserName = obj.DesignUserName;
|
||||
newItem.JiaoheUserName = obj.JiaoheUserName;
|
||||
newItem.ShenheUserName = obj.ShenheUserName;
|
||||
newItem.ShendingUserName = obj.ShendingUserName;
|
||||
newItem.MajorResponsibleUserName = obj.MajorResponsibleUserName;
|
||||
newItem.ClassificationLevelInProject = obj.ClassificationLevelInProject;
|
||||
newItem.UpdateTime = obj.UpdateTime;
|
||||
newItem.Remark = obj.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 数字档案馆
|
||||
|
||||
/// <summary>
|
||||
/// 接收保存数据
|
||||
/// </summary>
|
||||
/// <param name="newItem"></param>
|
||||
public static string SaveDesignDrawingData(OADesignDrawingData newItems)
|
||||
{
|
||||
try
|
||||
{
|
||||
string message = string.Empty;
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
foreach (var item in newItems.DataItems)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(item.RdpId))
|
||||
{
|
||||
IDP_DesignDrawing newItem = db.IDP_DesignDrawing.FirstOrDefault(x => x.StockId == item.RdpId);
|
||||
if (newItem != null)
|
||||
{
|
||||
newItem.RdpId = item.RdpId;
|
||||
newItem.Fileid = item.fileid;
|
||||
newItem.Upfileid = item.upfileid;
|
||||
newItem.Maintitle = item.maintitle;
|
||||
newItem.Doc_no = item.doc_no;
|
||||
newItem.Bc = item.bc;
|
||||
newItem.Archnumber = item.archnumber;
|
||||
newItem.Sendtime = item.sendtime;
|
||||
newItem.Printtime = item.printtime;
|
||||
newItem.Ifmail = item.ifmail;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
return ex.Message;
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region 试车工作包
|
||||
|
||||
/// <summary>
|
||||
/// 获取工作包结构化数据
|
||||
@@ -114,6 +385,9 @@ namespace BLL
|
||||
//string url = $"{IDPApiUrl}/OSS/projects/{projectId}/wbs/{wbsCode}/workitems/{workitemCode}/objects/latest";
|
||||
string url = $"{IDPApiUrl}/OSS/projects/9100168/wbs/000000/workitems/CP2100/objects/latest";
|
||||
|
||||
|
||||
//测试环境接口地址
|
||||
var testApiUrl = "http://10.5.6.151:8100/OSS/projects/9100168/wbs/000000/workitems/CP2100/objects/latest";
|
||||
try
|
||||
{
|
||||
var session = GetAuthenticationSession();
|
||||
@@ -131,7 +405,6 @@ namespace BLL
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -153,6 +426,7 @@ namespace BLL
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace BLL
|
||||
string data = string.Empty;
|
||||
string rows = string.Empty;
|
||||
|
||||
List<Model.PMP_Project> list = new List<PMP_Project>();
|
||||
List<PMP_Project> list = new List<PMP_Project>();
|
||||
|
||||
int pageSize = 1000;//一次性最多返回1000条数据
|
||||
List<PMPSearchCondData> searchCond = new List<PMPSearchCondData>();
|
||||
|
||||
Reference in New Issue
Block a user