提交代码

This commit is contained in:
2024-01-17 16:12:42 +08:00
parent 66a56a44af
commit 74e2a00958
49 changed files with 4594 additions and 715 deletions
+32 -11
View File
@@ -14,6 +14,8 @@
using System.Web;
using RestSharp;
using System.Net;
using System.Collections;
using Newtonsoft.Json.Linq;
public static class CNCECHSSEWebService
{
@@ -1262,10 +1264,10 @@
{
try
{
CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient();
var upCheckReport = from x in Funs.DB.View_CheckRectifyListFromSUB
// CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient();
var upCheckReport = from x in db.View_CheckRectifyListFromSUB
where x.RealEndDate.HasValue && x.CheckRectifyId == checkRectifyId
select new CNCECHSSEService.Check_CheckRectify
select new Model.CheckRectifyItem
{
CheckRectifyId = x.CheckRectifyId,
CheckRectifyCode = x.CheckRectifyCode,
@@ -1290,18 +1292,37 @@
FileContext = FileStructService.GetMoreFileStructByAttachUrl(x.AttachUrl2),
};
var getR = hsseC.DataInsertCheck_CheckRectifyTable(upCheckReport.ToList());
foreach (var item in getR)
string baseurl = SysConstSetService.CNCECPath + "/api/HSSEData/UpCheckRectifyTable";
string contenttype = "application/json;charset=unicode";
Hashtable newToken = new Hashtable
{
{ "token", ServerService.GetToken().Token }
};
var pushContent = JsonConvert.SerializeObject(upCheckReport.ToList());
var strJosn = APIGetHttpService.Http(baseurl, "Post", contenttype, newToken, pushContent);
if (!string.IsNullOrEmpty(strJosn))
{
var newCheckRectify = db.Check_CheckRectify.FirstOrDefault(e => e.CheckRectifyId == item);
if (newCheckRectify != null)
JObject obj = JObject.Parse(strJosn);
code = obj["code"].ToString();
if (code == "1")
{
newCheckRectify.HandleState = BLL.Const.State_3; //已完成
db.SubmitChanges();
var getIds = Funs.GetStrListByStr(obj["data"].ToString(), ',');
if (getIds.Count() > 0)
{
foreach (var item in getIds)
{
var newCheckRectify = db.Check_CheckRectify.FirstOrDefault(e => e.CheckRectifyId == item);
if (newCheckRectify != null)
{
newCheckRectify.HandleState = BLL.Const.State_3; //已完成
db.SubmitChanges();
}
}
}
LogService.AddSys_Log(CurrUser, "【集团检查整改】上传到服务器" + getIds.Count.ToString() + "条数据;", null, BLL.Const.UpCheckReportMenuId, BLL.Const.BtnUploadResources);
}
}
code = "1";
LogService.AddSys_Log(CurrUser, "【集团检查整改】上传到服务器" + getR.Count.ToString() + "条数据;", null, BLL.Const.UpCheckReportMenuId, BLL.Const.BtnUploadResources);
}
catch (Exception ex)
{