2025-03-28 09:49:56 +08:00

211 lines
7.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SuperMap.RealEstate.WorkFlow.Instance;
namespace SuperMap.RealEstate.MemberShip.Plugins
{
public class MemberProinst: IWorkFlowProInstDataAction, IWorkFlowActInstDataAction
{
//在线充值
ProInst_700100 _ProInst_700100 = null;
/// <summary />
public string ErrorString
{
get;
set;
}
/// <summary>
/// 办结
/// </summary>
/// <param name="WorkFlowProInst"></param>
/// <returns></returns>
public bool EndProcess(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
bool Flag = true;
string _ErrorString = "";
Running.Business.MEMBERPROINST _MEMBERPROINST = GetPropertyProinst(WorkFlowProInst);
DeleteCommonInfo(_MEMBERPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 700100:
#region 线
Flag = false;
_ProInst_700100 = new ProInst_700100(_MEMBERPROINST);
Flag = _ProInst_700100.EndProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
break;
#endregion
default:
throw new Exception("Plugins尚未配置");
}
return Flag;
}
/// <summary>
/// 驳回
/// </summary>
/// <param name="WorkFlowProInst"></param>
/// <returns></returns>
public bool FallBackRunning(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
throw new NotImplementedException();
}
/// <summary>
/// 入库
/// </summary>
/// <param name="WorkFlowProInst"></param>
/// <returns></returns>
public bool PutInStorage(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
bool Flag = true;
string _ErrorString = "";
Running.Business.MEMBERPROINST _MEMBERPROINST = GetPropertyProinst(WorkFlowProInst);
PutInStorageCommonInfo(_MEMBERPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 700100:
#region 线
Flag = false;
_ProInst_700100 = new ProInst_700100(_MEMBERPROINST);
Flag = _ProInst_700100.PutInStorage(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
break;
#endregion
default:
throw new Exception("Plugins尚未配置");
}
return Flag;
}
/// <summary>
/// 流程删除
/// </summary>
/// <param name="WorkFlowProInst"></param>
/// <returns></returns>
public bool DeleteProcess(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
bool Flag = false;
string _ErrorString = "";
Running.Business.MEMBERPROINST _MEMBERPROINST = GetPropertyProinst(WorkFlowProInst);
DeleteCommonInfo(_MEMBERPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 700100:
#region 线
Flag = false;
_ProInst_700100 = new ProInst_700100(_MEMBERPROINST);
Flag = _ProInst_700100.DeleteProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
break;
#endregion
default:
throw new Exception("Plugins尚未配置");
}
return Flag;
}
/// <summary />
public void DeleteCommonInfo(Running.Business.MEMBERPROINST _MEMBERPROINST)
{
//删除审批意见信息
foreach (Running.Business.APPROVED _APPROVED in _MEMBERPROINST.ApprovedCollection)
{
_APPROVED.Delete();
}
//删除流程意见信息
foreach (Running.Business.ACTINSTOPINION _ACTINSTOPINION in _MEMBERPROINST.ActinstOpinionCollection)
{
_ACTINSTOPINION.Delete();
}
}
/// <summary />
public void PutInStorageCommonInfo(Running.Business.MEMBERPROINST _MEMBERPROINST)
{
Storage.Business.APPROVED StorageApproved = null;
//审批意见信息
foreach (Running.Business.APPROVED _Approved in _MEMBERPROINST.ApprovedCollection)
{
StorageApproved = new Storage.Business.APPROVED(_MEMBERPROINST.Transaction);
StorageApproved.APPROVED_ID = _Approved.APPROVED_ID;
if (StorageApproved.Select())
{
StorageApproved.Delete();
StorageApproved.ResetProperty();
}
StorageApproved.CopyFrom(_Approved);
StorageApproved.Insert();
}
//流程意见信息
foreach (Running.Business.ACTINSTOPINION _ActinstOpinion in _MEMBERPROINST.ActinstOpinionCollection)
{
Storage.Business.ACTINSTOPINION StorageActinstOpinion = new Storage.Business.ACTINSTOPINION(_MEMBERPROINST.Transaction);
StorageActinstOpinion.ACTINSTOPINION_ID = _ActinstOpinion.ACTINSTOPINION_ID;
if (StorageActinstOpinion.Select())
{
StorageActinstOpinion.Delete();
StorageActinstOpinion.ResetProperty();
}
StorageActinstOpinion.CopyFrom(_ActinstOpinion);
StorageActinstOpinion.Insert();
}
}
/// <summary>
/// 获取当前流程信息
/// </summary>
/// <param name="WorkFlowProInst"></param>
/// <returns></returns>
public Running.Business.MEMBERPROINST GetPropertyProinst(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
Running.Business.MEMBERPROINST _PropertyProinst = new Running.Business.MEMBERPROINST(WorkFlowProInst.Transaction);
_PropertyProinst.AddSearchParameter("proinst_id", WorkFlowProInst.ProInst_ID);
if (_PropertyProinst.Search())
return _PropertyProinst;
else
{
throw new Exception("无法获取ProInst实例对象");
}
}
#region
/// <summary />
public bool OverRuled(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
/// <summary />
public bool OverRuling(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
/// <summary />
public bool Transfered(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
/// <summary />
public bool Transferring(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
/// <summary />
public bool TurnOvered(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
/// <summary />
public bool TurnOvering(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
#endregion
}
}