This commit is contained in:
2023-06-27 22:03:52 +08:00
7 changed files with 221 additions and 7 deletions
@@ -0,0 +1,2 @@
alter table [dbo].[ActionPlan_ActionPlanListApprove] add [IsPushOa] int null
GO
@@ -6,6 +6,7 @@ namespace BLL
{ {
public class ActionPlanListApproveService public class ActionPlanListApproveService
{ {
public const string ActionPlanListEdit = "ActionPlanListEdit";
public static Model.ActionPlan_ActionPlanListApprove GetActionPlanListApproveByActionPlanListApproveId(string ActionPlanListApproveId) public static Model.ActionPlan_ActionPlanListApprove GetActionPlanListApproveByActionPlanListApproveId(string ActionPlanListApproveId)
{ {
Model.SGGLDB db = Funs.DB; Model.SGGLDB db = Funs.DB;
@@ -37,6 +38,16 @@ namespace BLL
} }
} }
/// <summary>
/// 获取未推送oa 的审批记录
/// </summary>
/// <returns></returns>
public static List<Model.ActionPlan_ActionPlanListApprove> GetApproves_NopushOa()
{
var q = (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.IsPushOa == 0 && x.ApproveMan != "" select x).ToList();
return q;
}
/// <summary> /// <summary>
/// 部门评审小组审批信息 /// 部门评审小组审批信息
/// </summary> /// </summary>
@@ -47,6 +58,16 @@ namespace BLL
return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_Reviewing && x.Edition == edtion select x).ToList(); return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_Reviewing && x.Edition == edtion select x).ToList();
} }
/// <summary>
/// 公司部门评审小组审批信息
/// </summary>
/// <param name="MainPlanId"></param>
/// <returns></returns>
public static List<Model.ActionPlan_ActionPlanListApprove> GetDepartReviewings(string ActionPlanListId, int edtion)
{
return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_DepartReview && x.Edition == edtion select x).ToList();
}
/// <summary> /// <summary>
/// 部门评审小组审批信息 /// 部门评审小组审批信息
/// </summary> /// </summary>
@@ -57,6 +78,16 @@ namespace BLL
return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_Reviewing && x.Edition == edtion && x.ApproveDate != null select x).ToList(); return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_Reviewing && x.Edition == edtion && x.ApproveDate != null select x).ToList();
} }
/// <summary>
/// 公司部门评审小组审批信息
/// </summary>
/// <param name="MainPlanId"></param>
/// <returns></returns>
public static List<Model.ActionPlan_ActionPlanListApprove> GetDepartReviewingEnds(string ActionPlanListId, int edtion)
{
return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_DepartReview && x.Edition == edtion && x.ApproveDate != null select x).ToList();
}
/// <summary> /// <summary>
/// 部门评审小组审批人员Id集合 /// 部门评审小组审批人员Id集合
/// </summary> /// </summary>
@@ -192,11 +223,11 @@ namespace BLL
/// <param name="satartRowIndex"></param> /// <param name="satartRowIndex"></param>
/// <param name="maximumRows"></param> /// <param name="maximumRows"></param>
/// <returns></returns> /// <returns></returns>
public static IList<Model.ActionPlan_ActionPlanListApprove> getDepartListData(string ActionPlanListId) public static IList<Model.ActionPlan_ActionPlanListApprove> getDepartListData(string ActionPlanListId, int? edition)
{ {
Model.SGGLDB db = Funs.DB; Model.SGGLDB db = Funs.DB;
var res = from x in db.ActionPlan_ActionPlanListApprove var res = from x in db.ActionPlan_ActionPlanListApprove
where x.ActionPlanListId == ActionPlanListId && x.DepartId != null where x.ActionPlanListId == ActionPlanListId && x.DepartId != null && x.Edition == edition
orderby x.ApproveDate orderby x.ApproveDate
select x; select x;
@@ -278,7 +309,7 @@ namespace BLL
{ {
Model.SGGLDB db = Funs.DB; Model.SGGLDB db = Funs.DB;
var q = (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListApproveId == ActionPlanListApproveId select x).FirstOrDefault(); var q = (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListApproveId == ActionPlanListApproveId select x).FirstOrDefault();
if (q!=null) if (q != null)
{ {
db.ActionPlan_ActionPlanListApprove.DeleteOnSubmit(q); db.ActionPlan_ActionPlanListApprove.DeleteOnSubmit(q);
db.SubmitChanges(); db.SubmitChanges();
@@ -332,6 +363,7 @@ namespace BLL
newApprove.DepartId = approve.DepartId; newApprove.DepartId = approve.DepartId;
newApprove.SignType = approve.SignType; newApprove.SignType = approve.SignType;
newApprove.Edition = approve.Edition; newApprove.Edition = approve.Edition;
newApprove.IsPushOa = approve.IsPushOa;
db.ActionPlan_ActionPlanListApprove.InsertOnSubmit(newApprove); db.ActionPlan_ActionPlanListApprove.InsertOnSubmit(newApprove);
db.SubmitChanges(); db.SubmitChanges();
} }
@@ -357,6 +389,7 @@ namespace BLL
newApprove.ApproveType = approve.ApproveType; newApprove.ApproveType = approve.ApproveType;
newApprove.SignType = approve.SignType; newApprove.SignType = approve.SignType;
newApprove.Edition = approve.Edition; newApprove.Edition = approve.Edition;
newApprove.IsPushOa = approve.IsPushOa;
db.ActionPlan_ActionPlanListApprove.InsertOnSubmit(newApprove); db.ActionPlan_ActionPlanListApprove.InsertOnSubmit(newApprove);
db.SubmitChanges(); db.SubmitChanges();
} }
+101
View File
@@ -30,6 +30,10 @@ namespace BLL
case PHTGL_ApproveService.ContractReview: case PHTGL_ApproveService.ContractReview:
PHTUrl = string.Format("PHTUrl=PHTGL/ContractCompile/{0}Detail.aspx?ContractReviewId={1}", formname, ID); PHTUrl = string.Format("PHTUrl=PHTGL/ContractCompile/{0}Detail.aspx?ContractReviewId={1}", formname, ID);
break; break;
case ActionPlanListApproveService.ActionPlanListEdit:
PHTUrl = string.Format("PHTUrl=ZHGL/Plan/ActionPlanListEdit.aspx?ActionPlanListId={0}", ID);
break;
} }
url = url + PHTUrl; url = url + PHTUrl;
return url; 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>
/// 处理待办流程(变为已办) /// 处理待办流程(变为已办)
/// </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 public class OAWebJson
{ {
@@ -183,7 +183,7 @@ namespace FineUIPro.Web.ZHGL.Plan
return; return;
} }
} }
else if (actionPlanList.States == Const.ActionPlanList_Review || actionPlanList.States == Const.ActionPlanList_Reviewing || actionPlanList.States == Const.ActionPlanList_ReCompile || actionPlanList.States == Const.ActionPlanList_Review2) else if (actionPlanList.States == Const.ActionPlanList_Review || actionPlanList.States == Const.ActionPlanList_Reviewing || actionPlanList.States == Const.ActionPlanList_ReCompile || actionPlanList.States == Const.ActionPlanList_Review2 || actionPlanList.States == Const.ActionPlanList_DepartReview)
{ {
Model.ActionPlan_ActionPlanListApprove approve = ActionPlanListApproveService.GetActionPlanListApproveByApproveMan(id, CurrUser.PersonId); Model.ActionPlan_ActionPlanListApprove approve = ActionPlanListApproveService.GetActionPlanListApproveByApproveMan(id, CurrUser.PersonId);
if (approve != null || CurrUser.PersonId == Const.sysglyId) if (approve != null || CurrUser.PersonId == Const.sysglyId)
@@ -222,6 +222,10 @@ namespace FineUIPro.Web.ZHGL.Plan
rblIsCompanyReview.SelectedValue = "False"; rblIsCompanyReview.SelectedValue = "False";
} }
ContactImg = -1; ContactImg = -1;
this.btnNew.Hidden = true;
this.btnMenuEdit.Hidden = true;
this.btnMenuDelete.Hidden = true;
this.gvDepart.EnableRowDoubleClickEvent = false;
} }
//提交版本人多次修改 //提交版本人多次修改
if (actionPlanList.CompileMan.Equals(CurrUser.PersonId)) if (actionPlanList.CompileMan.Equals(CurrUser.PersonId))
@@ -443,7 +447,17 @@ namespace FineUIPro.Web.ZHGL.Plan
{ {
if (rblIsCompanyReview.SelectedValue == "True") //公司部门评审 if (rblIsCompanyReview.SelectedValue == "True") //公司部门评审
{ {
OAWebSevice.PushoaActionPlan(); //推送OA待办
Model.ActionPlan_ActionPlanListApprove approve = ActionPlanListApproveService.GetConstructSoluAppByApproveMan(ActionPlanListId, CurrUser.PersonId, Convert.ToInt32(actionPlanList1.Edition));
if (type == BLL.Const.BtnSubmit)
{
approve.ApproveDate = DateTime.Now;
}
approve.Edition = Convert.ToInt32(edtion);
approve.IsAgree = Convert.ToBoolean(rblIsAgree.SelectedValue);
approve.ApproveIdea = txtOptions.Text.Trim();
ActionPlanListApproveService.UpdateActionPlanListApprove(approve);
actionPlanList.States = Const.ActionPlanList_DepartReview;
} }
else //备案 else //备案
{ {
@@ -459,6 +473,41 @@ namespace FineUIPro.Web.ZHGL.Plan
actionPlanList.States = Const.ActionPlanList_Complete; actionPlanList.States = Const.ActionPlanList_Complete;
} }
} }
else if (actionPlanList1.States == Const.ActionPlanList_DepartReview)
{
actionPlanList.States = Const.ActionPlanList_DepartReview;
Model.ActionPlan_ActionPlanListApprove approve = ActionPlanListApproveService.GetConstructSoluAppByApproveMan(ActionPlanListId, CurrUser.PersonId, Convert.ToInt32(actionPlanList1.Edition));
if (approve != null)
{
approve.ApproveDate = DateTime.Now;
approve.ApproveIdea = this.txtOptions.Text.Trim();
approve.IsAgree = Convert.ToBoolean(this.rblIsAgree.SelectedValue);
BLL.ActionPlanListApproveService.UpdateActionPlanListApprove(approve);
OAWebSevice.DoneRequestActionPlan(approve.ActionPlanListApproveId); //处理待办流程
}
List<Model.ActionPlan_ActionPlanListApprove> approve3s = BLL.ActionPlanListApproveService.GetDepartReviewings(ActionPlanListId, edtion); //审批集合
List<Model.ActionPlan_ActionPlanListApprove> approve3Ends = BLL.ActionPlanListApproveService.GetDepartReviewingEnds(ActionPlanListId, edtion); //审批完成集合
int okNum = approve3Ends.Count(x => x.IsAgree == true); //审批同意数量
if (approve3s.Count == approve3Ends.Count)
{
if (approve3s.Count == okNum) //全部同意,审批完成
{
actionPlanList.States = Const.ActionPlanList_Complete;
}
else //有人不同意,(编制人)修改
{
Model.ActionPlan_ActionPlanListApprove reApprove = new Model.ActionPlan_ActionPlanListApprove();
reApprove.ActionPlanListId = actionPlanList.ActionPlanListId;
reApprove.ApproveMan = actionPlanList1.CompileMan;
reApprove.ApproveType = Const.ActionPlanList_ReCompile;
edtion++;
reApprove.Edition = edtion;
ActionPlanListApproveService.AddActionPlanListApprove(reApprove);
actionPlanList.States = Const.ActionPlanList_ReCompile;
actionPlanList.Edition = edtion;
}
}
}
} }
else else
{ {
@@ -645,7 +694,8 @@ namespace FineUIPro.Web.ZHGL.Plan
private void BindDepart() private void BindDepart()
{ {
var list = ActionPlanListApproveService.getDepartListData(ActionPlanListId); Model.ActionPlan_ActionPlanList actionPlanList = BLL.ActionPlanListService.GetActionPlanListById(this.ActionPlanListId);
var list = ActionPlanListApproveService.getDepartListData(ActionPlanListId, actionPlanList.Edition);
gvDepart.DataSource = list; gvDepart.DataSource = list;
gvDepart.DataBind(); gvDepart.DataBind();
} }
@@ -716,7 +766,7 @@ namespace FineUIPro.Web.ZHGL.Plan
string rowID = gvDepart.DataKeys[rowIndex][0].ToString(); string rowID = gvDepart.DataKeys[rowIndex][0].ToString();
BLL.ActionPlanListApproveService.DeleteActionPlanListApprovesByActionPlanListApproveId(rowID); BLL.ActionPlanListApproveService.DeleteActionPlanListApprovesByActionPlanListApproveId(rowID);
} }
//BindGrid(); BindDepart();
ShowNotify("删除数据成功!(表格数据已重新绑定)", MessageBoxIcon.Success); ShowNotify("删除数据成功!(表格数据已重新绑定)", MessageBoxIcon.Success);
} }
} }
@@ -91,6 +91,7 @@ namespace FineUIPro.Web.ZHGL.Plan
Alert.ShowInTop("请选择办理人!", MessageBoxIcon.Warning); Alert.ShowInTop("请选择办理人!", MessageBoxIcon.Warning);
return; return;
} }
Model.ActionPlan_ActionPlanList actionPlanList = BLL.ActionPlanListService.GetActionPlanListById(this.ActionPlanListId);
Model.ActionPlan_ActionPlanListApprove approve = new Model.ActionPlan_ActionPlanListApprove Model.ActionPlan_ActionPlanListApprove approve = new Model.ActionPlan_ActionPlanListApprove
{ {
ActionPlanListId = this.ActionPlanListId ActionPlanListId = this.ActionPlanListId
@@ -103,6 +104,9 @@ namespace FineUIPro.Web.ZHGL.Plan
{ {
approve.ApproveMan = this.drpApproveMan.SelectedValue; approve.ApproveMan = this.drpApproveMan.SelectedValue;
} }
approve.ApproveType = BLL.Const.ActionPlanList_DepartReview;
approve.Edition = actionPlanList.Edition;
approve.IsPushOa = 0;
if (!string.IsNullOrEmpty(this.ActionPlanListApproveId)) if (!string.IsNullOrEmpty(this.ActionPlanListApproveId))
{ {
approve.ActionPlanListApproveId = this.ActionPlanListApproveId; approve.ActionPlanListApproveId = this.ActionPlanListApproveId;
+24
View File
@@ -11278,6 +11278,8 @@ namespace Model
private string _DepartId; private string _DepartId;
private System.Nullable<int> _IsPushOa;
private EntityRef<ActionPlan_ActionPlanList> _ActionPlan_ActionPlanList; private EntityRef<ActionPlan_ActionPlanList> _ActionPlan_ActionPlanList;
private EntityRef<Person_Persons> _Person_Persons; private EntityRef<Person_Persons> _Person_Persons;
@@ -11308,6 +11310,8 @@ namespace Model
partial void OnEditionChanged(); partial void OnEditionChanged();
partial void OnDepartIdChanging(string value); partial void OnDepartIdChanging(string value);
partial void OnDepartIdChanged(); partial void OnDepartIdChanged();
partial void OnIsPushOaChanging(System.Nullable<int> value);
partial void OnIsPushOaChanged();
#endregion #endregion
public ActionPlan_ActionPlanListApprove() public ActionPlan_ActionPlanListApprove()
@@ -11545,6 +11549,26 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsPushOa", DbType="Int")]
public System.Nullable<int> IsPushOa
{
get
{
return this._IsPushOa;
}
set
{
if ((this._IsPushOa != value))
{
this.OnIsPushOaChanging(value);
this.SendPropertyChanging();
this._IsPushOa = value;
this.SendPropertyChanged("IsPushOa");
this.OnIsPushOaChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ActionPlan_ActionPlanListApprove_ActionPlan_ActionPlanList", Storage="_ActionPlan_ActionPlanList", ThisKey="ActionPlanListId", OtherKey="ActionPlanListId", IsForeignKey=true)] [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ActionPlan_ActionPlanListApprove_ActionPlan_ActionPlanList", Storage="_ActionPlan_ActionPlanList", ThisKey="ActionPlanListId", OtherKey="ActionPlanListId", IsForeignKey=true)]
public ActionPlan_ActionPlanList ActionPlan_ActionPlanList public ActionPlan_ActionPlanList ActionPlan_ActionPlanList
{ {