小程序接口修改

This commit is contained in:
2023-07-11 16:32:16 +08:00
parent ca5c3fe9a7
commit 4449a7754f
68 changed files with 4634 additions and 2984 deletions
+135 -21
View File
@@ -1,4 +1,5 @@
using BLL.CNCECHSSEService;
using Model;
using System;
using System.Collections.Generic;
using System.IO;
@@ -501,12 +502,28 @@ namespace BLL
Funs.DB.SubmitChanges();
}
}
public static void DeleteAttachFileByIdForApi(string id)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.AttachFile attachFile = db.AttachFile.FirstOrDefault(e => e.ToKeyId == id);
if (attachFile != null)
{
if (!string.IsNullOrEmpty(attachFile.AttachUrl))
{
UploadFileService.DeleteFile(Funs.RootPath, attachFile.AttachUrl);
}
/// <summary>
///根据主键删除附件
/// </summary>
/// <param name="lawRegulationId"></param>
public static void DeleteAttachFileById(string menuId, string id)
db.AttachFile.DeleteOnSubmit(attachFile);
db.SubmitChanges();
}
}
}
/// <summary>
///根据主键删除附件
/// </summary>
/// <param name="lawRegulationId"></param>
public static void DeleteAttachFileById(string menuId, string id)
{
Model.SGGLDB db = Funs.DB;
Model.AttachFile attachFile = db.AttachFile.FirstOrDefault(e => e.MenuId == menuId && e.ToKeyId == id);
@@ -520,15 +537,32 @@ namespace BLL
db.AttachFile.DeleteOnSubmit(attachFile);
db.SubmitChanges();
}
}
#endregion
}
public static void DeleteAttachFileByIdForApi(string menuId, string id)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.AttachFile attachFile = db.AttachFile.FirstOrDefault(e => e.MenuId == menuId && e.ToKeyId == id);
if (attachFile != null)
{
if (!string.IsNullOrEmpty(attachFile.AttachUrl))
{
BLL.UploadFileService.DeleteFile(Funs.RootPath, attachFile.AttachUrl);
}
#region
/// <summary>
///根据主键删除流程
/// </summary>
/// <param name="lawRegulationId"></param>
public static void DeleteFlowOperateByID(string id)
db.AttachFile.DeleteOnSubmit(attachFile);
db.SubmitChanges();
}
}
}
#endregion
#region
/// <summary>
///根据主键删除流程
/// </summary>
/// <param name="lawRegulationId"></param>
public static void DeleteFlowOperateByID(string id)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
@@ -628,15 +662,95 @@ namespace BLL
}
}
}
#endregion
public static void btnSaveDataForApi(string projectId, string menuId, string dataId, string userId, bool isClosed, string content, string url)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Sys_FlowOperate newFlowOperate = new Model.Sys_FlowOperate
{
MenuId = menuId,
DataId = dataId,
OperaterId = userId,
State = Const.State_2,
IsClosed = isClosed,
Opinion = "系统自动关闭流程",
ProjectId = projectId,
Url = url
};
var user = db.Sys_User.FirstOrDefault(e => e.UserId == newFlowOperate.OperaterId);
if (user != null)
{
var roles = RoleService.GetRoleByRoleId(user.RoleId);
if (roles != null && !string.IsNullOrEmpty(roles.RoleName))
{
newFlowOperate.AuditFlowName = "[" + roles.RoleName + "]";
}
else
{
newFlowOperate.AuditFlowName = "[" + user.UserName + "]";
}
#region http post请求
/// 接收http post请求
/// </summary>
/// <param name="url">地址</param>
/// <param name="parameters">查询参数集合</param>
/// <returns></returns>
public static string CreateGetHttpResponse(string url)
newFlowOperate.AuditFlowName += "系统审核完成";
}
var updateFlowOperate = from x in db.Sys_FlowOperate
where x.DataId == newFlowOperate.DataId && (x.IsClosed == false || !x.IsClosed.HasValue)
select x;
if (updateFlowOperate.Count() > 0)
{
foreach (var item in updateFlowOperate)
{
item.OperaterId = newFlowOperate.OperaterId;
item.OperaterTime = System.DateTime.Now;
item.State = newFlowOperate.State;
item.Opinion = newFlowOperate.Opinion;
item.AuditFlowName = "系统审核完成";
item.IsClosed = newFlowOperate.IsClosed;
db.SubmitChanges();
}
}
else
{
int maxSortIndex = 1;
var flowSet = db.Sys_FlowOperate.Where(x => x.DataId == newFlowOperate.DataId);
var sortIndex = flowSet.Select(x => x.SortIndex).Max();
if (sortIndex.HasValue)
{
maxSortIndex = sortIndex.Value + 1;
}
newFlowOperate.FlowOperateId = SQLHelper.GetNewID(typeof(Model.Sys_FlowOperate));
newFlowOperate.SortIndex = maxSortIndex;
newFlowOperate.OperaterTime = System.DateTime.Now;
newFlowOperate.AuditFlowName = "系统审核完成";
db.Sys_FlowOperate.InsertOnSubmit(newFlowOperate);
db.SubmitChanges();
}
if (newFlowOperate.IsClosed == true)
{
var updateNoClosedFlowOperate = from x in Funs.DB.Sys_FlowOperate
where x.DataId == newFlowOperate.DataId && (x.IsClosed == false || !x.IsClosed.HasValue)
select x;
if (updateNoClosedFlowOperate.Count() > 0)
{
foreach (var itemClosed in updateNoClosedFlowOperate)
{
itemClosed.IsClosed = true;
db.SubmitChanges();
}
}
}
}
}
#endregion
#region http post请求
/// 接收http post请求
/// </summary>
/// <param name="url">地址</param>
/// <param name="parameters">查询参数集合</param>
/// <returns></returns>
public static string CreateGetHttpResponse(string url)
{
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;