2025-03-27 15:05:14 +08:00

209 lines
7.3 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.Web;
using SuperMap.RealEstate.Utility;
using SuperMap.RealEstate.WorkFlow.Instance;
using Running = SuperMap.RealEstate.Contract.Running;
using Storage = SuperMap.RealEstate.Contract.Running;
namespace SuperMap.RealEstate.Contract.Plugins
{
/// <summary />
public class ContractProInst : IWorkFlowProInstDataAction, IWorkFlowActInstDataAction
{
ProInst_310020 _ProInst_310020 = 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.CONTRACTPROINST _CONTRACTPROINST = GetPropertyProinst(WorkFlowProInst);
//DeleteCommonInfo(_CONTRACTPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 310020:
#region 退
_ProInst_310020 = new ProInst_310020(_CONTRACTPROINST);
Flag = _ProInst_310020.EndProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
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.CONTRACTPROINST _CONTRACTPROINST = GetPropertyProinst(WorkFlowProInst);
//PutInStorageCommonInfo(_CONTRACTPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 310020:
#region 退
_ProInst_310020 = new ProInst_310020(_CONTRACTPROINST);
Flag = _ProInst_310020.PutInStorage(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
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.CONTRACTPROINST _CONTRACTPROINST = GetPropertyProinst(WorkFlowProInst);
DeleteCommonInfo(_CONTRACTPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 310020:
#region 退
_ProInst_310020 = new ProInst_310020(_CONTRACTPROINST);
Flag = _ProInst_310020.DeleteProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
default:
throw new Exception("Plugins尚未配置");
}
return Flag;
}
/// <summary>
///
/// </summary>
/// <param name="_CONTRACTPROINST"></param>
public void DeleteCommonInfo(Running.Business.CONTRACTPROINST _CONTRACTPROINST)
{
//删除审批信息
foreach (Running.Business.APPROVED _APPROVED in _CONTRACTPROINST.ApprovedCollection)
{
_APPROVED.Delete();
}
}
/// <summary>
///
/// </summary>
/// <param name="_CONTRACTPROINST"></param>
public void PutInStorageCommonInfo(Running.Business.CONTRACTPROINST _CONTRACTPROINST)
{
Storage.Business.APPROVED StorageApproved = null;
foreach (Running.Business.APPROVED _Approved in _CONTRACTPROINST.ApprovedCollection)
{
StorageApproved = new Storage.Business.APPROVED(_CONTRACTPROINST.Transaction);
StorageApproved.APPROVED_ID = _Approved.APPROVED_ID;
if (StorageApproved.Select())
{
StorageApproved.Delete();
StorageApproved.ResetProperty();
}
StorageApproved.CopyFrom(_Approved);
StorageApproved.Insert();
}
//foreach (Running.Business.Proposer _Proposer in _PropertyProinst.ProposerCollection)
//{
// StorageProposer = new Storage.Business.Proposer(_PropertyProinst.Transaction);
// StorageProposer.CopyFrom(_Proposer);
// StorageProposer.Insert();
//}
}
/// <summary>
/// 获取当前流程信息
/// </summary>
/// <param name="WorkFlowProInst"></param>
/// <returns></returns>
public Running.Business.CONTRACTPROINST GetPropertyProinst(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
Running.Business.CONTRACTPROINST _PropertyProinst = new Running.Business.CONTRACTPROINST(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
}
}