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

294 lines
12 KiB
C#
Raw Permalink 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.Personnel.Running;
using Storage = SuperMap.RealEstate.Personnel.Storage;
namespace SuperMap.RealEstate.Personnel.Plugins
{
/// <summary />
public class PersonnelProInst : IWorkFlowProInstDataAction, IWorkFlowActInstDataAction
{
ProInst_410020 _ProInst_410020 = null;
ProInst_410030 _ProInst_410030 = null;
ProInst_410040 _ProInst_410040 = null;
ProInst_410050 _ProInst_410050 = null;
ProInst_410060 _ProInst_410060 = 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.PERSONNELPROINST _PERSONNELPROINST = GetPropertyProinst(WorkFlowProInst);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 410020:
#region
Flag = false;
_ProInst_410020 = new ProInst_410020(_PERSONNELPROINST);
Flag = _ProInst_410020.EndProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410030:
#region
Flag = false;
_ProInst_410030 = new ProInst_410030(_PERSONNELPROINST);
Flag = _ProInst_410030.EndProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410040:
#region
Flag = false;
_ProInst_410040 = new ProInst_410040(_PERSONNELPROINST);
Flag = _ProInst_410040.EndProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410050:
#region
Flag = false;
_ProInst_410050 = new ProInst_410050(_PERSONNELPROINST);
Flag = _ProInst_410050.EndProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410060:
#region
Flag = false;
_ProInst_410060 = new ProInst_410060(_PERSONNELPROINST);
Flag = _ProInst_410060.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.PERSONNELPROINST _PERSONNELPROINST = GetPropertyProinst(WorkFlowProInst);
//PutInStorageCommonInfo(_FINANCEPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 410020:
#region
Flag = false;
_ProInst_410020 = new ProInst_410020(_PERSONNELPROINST);
Flag = _ProInst_410020.PutInStorage(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410030:
#region
Flag = false;
_ProInst_410030 = new ProInst_410030(_PERSONNELPROINST);
Flag = _ProInst_410030.PutInStorage(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410040:
#region
Flag = false;
_ProInst_410040 = new ProInst_410040(_PERSONNELPROINST);
Flag = _ProInst_410040.PutInStorage(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410050:
#region
Flag = false;
_ProInst_410050 = new ProInst_410050(_PERSONNELPROINST);
Flag = _ProInst_410050.PutInStorage(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410060:
#region
Flag = false;
_ProInst_410060 = new ProInst_410060(_PERSONNELPROINST);
Flag = _ProInst_410060.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.PERSONNELPROINST _PERSONNELPROINST = GetPropertyProinst(WorkFlowProInst);
DeleteCommonInfo(_PERSONNELPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 410020:
#region
Flag = false;
_ProInst_410020 = new ProInst_410020(_PERSONNELPROINST);
Flag = _ProInst_410020.DeleteProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410030:
#region
Flag = false;
_ProInst_410030 = new ProInst_410030(_PERSONNELPROINST);
Flag = _ProInst_410030.DeleteProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410040:
#region
Flag = false;
_ProInst_410040 = new ProInst_410040(_PERSONNELPROINST);
Flag = _ProInst_410040.DeleteProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410050:
#region
Flag = false;
_ProInst_410050 = new ProInst_410050(_PERSONNELPROINST);
Flag = _ProInst_410050.DeleteProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
case 410060:
#region
Flag = false;
_ProInst_410060 = new ProInst_410060(_PERSONNELPROINST);
Flag = _ProInst_410060.DeleteProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
#endregion
break;
default:
throw new Exception("Plugins尚未配置");
}
return Flag;
}
/// <summary />
public void DeleteCommonInfo(Running.Business.PERSONNELPROINST _PERSONNELPROINST)
{
//删除审批信息
foreach (Running.Business.APPROVED _APPROVED in _PERSONNELPROINST.ApprovedCollection)
{
_APPROVED.Delete();
}
//删除申请人信息
//foreach (Running.Business.Proposer _Proposer in _PropertyProinst.ProposerCollection)
// _Proposer.Delete();
}
/// <summary />
public void PutInStorageCommonInfo(Running.Business.PERSONNELPROINST _PERSONNELPROINST)
{
Storage.Business.APPROVED StorageApproved = null;
foreach (Running.Business.APPROVED _Approved in _PERSONNELPROINST.ApprovedCollection)
{
StorageApproved = new Storage.Business.APPROVED(_PERSONNELPROINST.Transaction);
StorageApproved.APPROVED_ID = _Approved.APPROVED_ID;
if (StorageApproved.Select())
{
StorageApproved.Delete();
StorageApproved.ResetProperty();
}
StorageApproved.CopyFrom(_Approved);
StorageApproved.Insert();
}
}
/// <summary>
/// 获取当前流程信息
/// </summary>
/// <param name="WorkFlowProInst"></param>
/// <returns></returns>
public Running.Business.PERSONNELPROINST GetPropertyProinst(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
Running.Business.PERSONNELPROINST _PropertyProinst = new Running.Business.PERSONNELPROINST(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
}
}