修改安全实施计划

This commit is contained in:
2023-06-27 17:40:37 +08:00
parent 974a106b57
commit c0c275e3df
8 changed files with 261 additions and 7 deletions
+101
View File
@@ -30,6 +30,10 @@ namespace BLL
case PHTGL_ApproveService.ContractReview:
PHTUrl = string.Format("PHTUrl=PHTGL/ContractCompile/{0}Detail.aspx?ContractReviewId={1}", formname, ID);
break;
case ActionPlanListApproveService.ActionPlanListEdit:
PHTUrl = string.Format("PHTUrl=ZHGL/Plan/ActionPlanListEdit.aspx?ActionPlanListId={0}", ID);
break;
}
url = url + PHTUrl;
return url;
@@ -389,6 +393,68 @@ namespace BLL
}
public static void PushoaActionPlan()
{
// return;
string strjson = "";
string returnjson = "";
OAWebService.OfsTodoDataWebServicePortTypeClient OAWeb = new OAWebService.OfsTodoDataWebServicePortTypeClient();
OAWebJson webJson = new OAWebJson();
webJson.syscode = "shigong";
webJson.workflowname = "审批";
webJson.appurl = "";
webJson.receivedatetime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now);
webJson.createdatetime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now);
var users = ActionPlanListApproveService.GetApproves_NopushOa();
if (users.Count > 0)
{
for (int i = 0; i < users.Count; i++)
{
try
{
var ActionPlanList = BLL.ActionPlanListService.GetActionPlanListById(users[i].ActionPlanListId);
if (ActionPlanList != null)
{
var geCreatUser = BLL.Person_PersonsService.GetPerson_PersonsById(ActionPlanList.CompileMan);
var gereceiver = BLL.Person_PersonsService.GetPerson_PersonsById(users[i].ApproveMan);
var project = BLL.ProjectService.GetProjectByProjectId(ActionPlanList.ProjectId);
string shortProjectName = string.Empty;
if (project != null)
{
shortProjectName = project.ShortName;
}
webJson.flowid = users[i].ActionPlanListApproveId;
webJson.requestname = "安全实施计划审批 " + shortProjectName;
webJson.nodename = "公司部门审批";
webJson.creator = geCreatUser.JobNum;
webJson.receiver = gereceiver.JobNum;
webJson.pcurl = geturl(ActionPlanList.ProjectId, ActionPlanListApproveService.ActionPlanListEdit, ActionPlanList.ActionPlanListId, users[i].ApproveMan);
webJson.appurl = getAppurl(ActionPlanList.ProjectId, ActionPlanListApproveService.ActionPlanListEdit, ActionPlanList.ActionPlanListId, users[i].ApproveMan);
}
strjson = JsonConvert.SerializeObject(webJson);
returnjson = OAWeb.receiveTodoRequestByJson(strjson);
APICommonService.SaveSysHttpLog("OA_Push", strjson, returnjson);
ReviceReturn reviceReturn = JsonConvert.DeserializeObject<ReviceReturn>(returnjson);
if (reviceReturn.operResult == "1")
{
var Approve = ActionPlanListApproveService.GetActionPlanListApproveByActionPlanListApproveId(users[i].ActionPlanListApproveId);
Approve.IsPushOa = 1;
ActionPlanListApproveService.UpdateActionPlanListApprove(Approve);
}
}
catch (Exception ex)
{
strjson += "----" + users[i].ActionPlanListApproveId;
returnjson = ex.ToString();
APICommonService.SaveSysHttpLog("OA_Push", strjson, returnjson);
ErrLogInfo.WriteLog(ex.ToString());
}
}
}
}
/// <summary>
/// 处理待办流程(变为已办)
/// </summary>
@@ -444,6 +510,41 @@ namespace BLL
}
/// <summary>
/// 处理待办流程(变为已办)
/// </summary>
/// <param name="id"></param>
public static void DoneRequestActionPlan(string id)
{
// return;
OAWebService.OfsTodoDataWebServicePortTypeClient OAWeb = new OAWebService.OfsTodoDataWebServicePortTypeClient();
var Approve = ActionPlanListApproveService.GetActionPlanListApproveByActionPlanListApproveId(id);
var gereceiver = BLL.Person_PersonsService.GetPerson_PersonsById(Approve.ApproveMan);
OaDoneJson webJson = new OaDoneJson();
webJson.syscode = "shigong";
webJson.workflowname = "审批";
webJson.flowid = Approve.ActionPlanListApproveId;
webJson.nodename = Approve.ApproveType;
webJson.receiver = gereceiver.JobNum;
webJson.requestname = "安全实施计划审批";
string strjson = JsonConvert.SerializeObject(webJson);
var returnjson = OAWeb.processDoneRequestByJson(strjson);
APICommonService.SaveSysHttpLog("OA_Done", strjson, returnjson);
ReviceReturn reviceReturn = JsonConvert.DeserializeObject<ReviceReturn>(returnjson);
if (reviceReturn.operResult == "1")
{
Approve.IsPushOa = 2;
ActionPlanListApproveService.UpdateActionPlanListApprove(Approve);
}
if (Approve.IsPushOa == 0)
{
Approve.IsPushOa = 2;
ActionPlanListApproveService.UpdateActionPlanListApprove(Approve);
}
}
}
public class OAWebJson
{