296 lines
12 KiB
C#
296 lines
12 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using SuperMap.RealEstate.Utility;
|
||
using SuperMap.RealEstate.WorkFlow.Instance;
|
||
|
||
namespace SuperMap.RealEstate.Seller.Plugins
|
||
{
|
||
public class SellerProinst : IWorkFlowProInstDataAction, IWorkFlowActInstDataAction
|
||
{
|
||
ProInst_500100 _ProInst_500100 = null;
|
||
ProInst_500200 _ProInst_500200 = null;
|
||
ProInst_500210 _ProInst_500210 = null;
|
||
ProInst_500220 _ProInst_500220 = null;
|
||
ProInst_500300 _ProInst_500300 = 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.SELLERPROINST _SELLERPROINST = GetPropertyProinst(WorkFlowProInst);
|
||
DeleteCommonInfo(_SELLERPROINST);
|
||
switch (WorkFlowProInst.Operation_Type_BaseValue)
|
||
{
|
||
case 500100:
|
||
#region 商品新增审批
|
||
Flag = false;
|
||
_ProInst_500100 = new ProInst_500100(_SELLERPROINST);
|
||
Flag = _ProInst_500100.EndProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500200:
|
||
#region 商品调价审批
|
||
Flag = false;
|
||
_ProInst_500200 = new ProInst_500200(_SELLERPROINST);
|
||
Flag = _ProInst_500200.EndProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500210:
|
||
#region 商品进价审批
|
||
Flag = false;
|
||
_ProInst_500210 = new ProInst_500210(_SELLERPROINST);
|
||
Flag = _ProInst_500210.EndProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500220:
|
||
#region 商品售价审批
|
||
Flag = false;
|
||
_ProInst_500220 = new ProInst_500220(_SELLERPROINST);
|
||
Flag = _ProInst_500220.EndProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500300:
|
||
#region 商品信息审批
|
||
Flag = false;
|
||
_ProInst_500300 = new ProInst_500300(_SELLERPROINST);
|
||
Flag = _ProInst_500300.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.SELLERPROINST _SELLERPROINST = GetPropertyProinst(WorkFlowProInst);
|
||
PutInStorageCommonInfo(_SELLERPROINST);
|
||
switch (WorkFlowProInst.Operation_Type_BaseValue)
|
||
{
|
||
case 500100:
|
||
#region 商品新增审批
|
||
Flag = false;
|
||
_ProInst_500100 = new ProInst_500100(_SELLERPROINST);
|
||
Flag = _ProInst_500100.PutInStorage(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500200:
|
||
#region 商品调价审批
|
||
Flag = false;
|
||
_ProInst_500200 = new ProInst_500200(_SELLERPROINST);
|
||
Flag = _ProInst_500200.PutInStorage(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500210:
|
||
#region 商品进价审批
|
||
Flag = false;
|
||
_ProInst_500210 = new ProInst_500210(_SELLERPROINST);
|
||
Flag = _ProInst_500210.PutInStorage(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500220:
|
||
#region 商品售价审批
|
||
Flag = false;
|
||
_ProInst_500220 = new ProInst_500220(_SELLERPROINST);
|
||
Flag = _ProInst_500220.PutInStorage(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500300:
|
||
#region 商品信息审批
|
||
Flag = false;
|
||
_ProInst_500300 = new ProInst_500300(_SELLERPROINST);
|
||
Flag = _ProInst_500300.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.SELLERPROINST _SELLERPROINST = GetPropertyProinst(WorkFlowProInst);
|
||
DeleteCommonInfo(_SELLERPROINST);
|
||
|
||
switch (WorkFlowProInst.Operation_Type_BaseValue)
|
||
{
|
||
case 500100:
|
||
#region 商品价格审批
|
||
Flag = false;
|
||
_ProInst_500100 = new ProInst_500100(_SELLERPROINST);
|
||
Flag = _ProInst_500100.DeleteProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500200:
|
||
#region 商品调价审批
|
||
Flag = false;
|
||
_ProInst_500200 = new ProInst_500200(_SELLERPROINST);
|
||
Flag = _ProInst_500200.DeleteProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500210:
|
||
#region 商品调价审批
|
||
Flag = false;
|
||
_ProInst_500210 = new ProInst_500210(_SELLERPROINST);
|
||
Flag = _ProInst_500210.DeleteProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500220:
|
||
#region 商品售价审批
|
||
Flag = false;
|
||
_ProInst_500220 = new ProInst_500220(_SELLERPROINST);
|
||
Flag = _ProInst_500220.DeleteProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
case 500300:
|
||
#region 信息修改审批
|
||
Flag = false;
|
||
_ProInst_500300 = new ProInst_500300(_SELLERPROINST);
|
||
Flag = _ProInst_500300.DeleteProcess(WorkFlowProInst, out _ErrorString);
|
||
ErrorString += _ErrorString;
|
||
break;
|
||
#endregion
|
||
default:
|
||
throw new Exception("Plugins尚未配置");
|
||
}
|
||
return Flag;
|
||
}
|
||
/// <summary />
|
||
public void DeleteCommonInfo(Running.Business.SELLERPROINST _SELLERPROINST)
|
||
{
|
||
//删除审批信息
|
||
foreach (Running.Business.APPROVED _APPROVED in _SELLERPROINST.ApprovedCollection)
|
||
_APPROVED.Delete();
|
||
////删除申请人信息
|
||
//foreach (Running.Business.Proposer _Proposer in _PropertyProinst.ProposerCollection)
|
||
// _Proposer.Delete();
|
||
}
|
||
/// <summary />
|
||
public void PutInStorageCommonInfo(Running.Business.SELLERPROINST _SELLERPROINST)
|
||
{
|
||
Storage.Business.APPROVED StorageApproved = null;
|
||
|
||
foreach (Running.Business.APPROVED _Approved in _SELLERPROINST.ApprovedCollection)
|
||
{
|
||
StorageApproved = new Storage.Business.APPROVED(_SELLERPROINST.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.SELLERPROINST GetPropertyProinst(WorkFlow.Instance.Business.ProInst WorkFlowProInst)
|
||
{
|
||
Running.Business.SELLERPROINST _SELLERPROINST = new Running.Business.SELLERPROINST(WorkFlowProInst.Transaction);
|
||
_SELLERPROINST.AddSearchParameter("PROINST_ID", WorkFlowProInst.ProInst_ID);
|
||
if (_SELLERPROINST.Search())
|
||
return _SELLERPROINST;
|
||
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
|
||
}
|
||
}
|