227 lines
8.5 KiB
C#
227 lines
8.5 KiB
C#
using SuperMap.RealEstate.Utility;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Web;
|
||
using SuperMap.RealEstate.WorkFlow.Instance;
|
||
using Running = SuperMap.RealEstate.HighWay.Running;
|
||
using Storage = SuperMap.RealEstate.HighWay.Running;
|
||
|
||
namespace SuperMap.RealEstate.HighWay.Plugins.Cloud
|
||
{
|
||
/// <summary />
|
||
public class HighWayProInst : IWorkFlowProInstDataAction, IWorkFlowActInstDataAction
|
||
{
|
||
//商品审批
|
||
ProInst_100100 _ProInst_100100 = null;
|
||
ProInst_100200 _ProInst_100200 = 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.HIGHWAYPROINST _HIGHWAYPROINST = GetPropertyProinst(WorkFlowProInst);
|
||
DeleteCommonInfo(_HIGHWAYPROINST);
|
||
switch (WorkFlowProInst.Operation_Type_BaseValue)
|
||
{
|
||
case 100100:
|
||
#region 商品价格审批
|
||
Flag = false;
|
||
_ProInst_100100 = new ProInst_100100(_HIGHWAYPROINST);
|
||
Flag = _ProInst_100100.EndProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 100200:
|
||
#region 商品调价审批
|
||
Flag = false;
|
||
_ProInst_100200 = new ProInst_100200(_HIGHWAYPROINST);
|
||
Flag = _ProInst_100200.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.HIGHWAYPROINST _HIGHWAYPROINST = GetPropertyProinst(WorkFlowProInst);
|
||
PutInStorageCommonInfo(_HIGHWAYPROINST);
|
||
switch (WorkFlowProInst.Operation_Type_BaseValue)
|
||
{
|
||
case 100100:
|
||
#region 商品价格审批
|
||
Flag = false;
|
||
_ProInst_100100 = new ProInst_100100(_HIGHWAYPROINST);
|
||
Flag = _ProInst_100100.PutInStorage(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 100200:
|
||
#region 商品调价审批
|
||
Flag = false;
|
||
_ProInst_100200 = new ProInst_100200(_HIGHWAYPROINST);
|
||
Flag = _ProInst_100200.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.HIGHWAYPROINST _HIGHWAYPROINST = GetPropertyProinst(WorkFlowProInst);
|
||
DeleteCommonInfo(_HIGHWAYPROINST);
|
||
|
||
switch (WorkFlowProInst.Operation_Type_BaseValue)
|
||
{
|
||
case 100100:
|
||
#region 商品价格审批
|
||
Flag = false;
|
||
_ProInst_100100 = new ProInst_100100(_HIGHWAYPROINST);
|
||
Flag = _ProInst_100100.DeleteProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 100200:
|
||
#region 商品调价审批
|
||
Flag = false;
|
||
_ProInst_100200 = new ProInst_100200(_HIGHWAYPROINST);
|
||
Flag = _ProInst_100200.DeleteProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
default:
|
||
throw new Exception("Plugins尚未配置");
|
||
}
|
||
return Flag;
|
||
}
|
||
/// <summary />
|
||
public void DeleteCommonInfo(Running.Business.HIGHWAYPROINST _HIGHWAYPROINST)
|
||
{
|
||
//删除审批信息
|
||
foreach (Running.Business.APPROVED _APPROVED in _HIGHWAYPROINST.ApprovedCollection)
|
||
{
|
||
_APPROVED.Delete();
|
||
}
|
||
////删除申请人信息
|
||
//foreach (Running.Business.Proposer _Proposer in _PropertyProinst.ProposerCollection)
|
||
// _Proposer.Delete();
|
||
}
|
||
/// <summary />
|
||
public void PutInStorageCommonInfo(Running.Business.HIGHWAYPROINST _HIGHWAYPROINST)
|
||
{
|
||
Storage.Business.APPROVED StorageApproved = null;
|
||
|
||
foreach (Running.Business.APPROVED _Approved in _HIGHWAYPROINST.ApprovedCollection)
|
||
{
|
||
StorageApproved = new Storage.Business.APPROVED(_HIGHWAYPROINST.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.HIGHWAYPROINST GetPropertyProinst(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
|
||
{
|
||
Running.Business.HIGHWAYPROINST _PropertyProinst = new Running.Business.HIGHWAYPROINST(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
|
||
}
|
||
}
|