Никак не получается добавить задание на перерачет услуги RSCM.
Делаю так:
Код:
import java.sql.*;
import java.util.*;
import bitel.billing.server.contract.bean.*;
import bitel.billing.server.contract.object.bean.*;
import ru.bitel.bgbilling.plugins.crm.server.dao.*;
import ru.bitel.bgbilling.plugins.crm.common.model.*;
import bitel.billing.server.rscm.bean.*;
import bitel.billing.server.admin.bean.*;
import bitel.billing.server.util.*;
import bitel.billing.common.TimeUtils;
import bitel.billing.server.task.bean.RunTaskDataManager;
import bitel.billing.server.rscm.*;
//Группа ожидания подключения
GROUP_EC = 18;
//Параметр, в котором прописана дата начала предоставления услуг
PARAM_START_DATE = 49;
EventDate = new Date();
cid = event.getContractID();
contract = new ContractManager(con).getContractByID(cid);
contract_utils = new ContractUtils( con );
contract_groups = contract.getGroups();
contract_param_utils = new ContractParamUtils( con );
contract_is_group_ec = (contract_groups & (1L<<GROUP_EC)) > 0;
register_task_manager = new RegisterTaskManager( con );
task = event.getTask();
task_id = task.getID();
task_type_id = task.getTypeID();
task_ExecuteDate = task.getExecuteDate();
task_TargetDate = task.getTargetDate();
task_AddressObjectId = task.getAddressObjectId();
task_ExecuteDate_Calendar = new GregorianCalendar();
task_ExecuteDate_Calendar.setTime( task_TargetDate );
//Интернет - новое подключение (монтаж)
if (task_type_id == 3 && contract_is_group_ec)
{
task_new_type_id = 13;
task_new_group_id = 4;
//Ищем задачу на настройку
filter = new RegisterTaskManager.TaskFilter();
filter.cid = cid;
filter.types = Integer.toString(task_new_type_id);
task_count = register_task_manager.getTaskCount(filter);
if (task_count == 0){
RegisterTask task_new = new RegisterTask();
task_new.setContractID( cid );
task_new.setTypeID( task_new_type_id );
task_new.setGroupID( task_new_group_id );
task_new.setOpenUserID( 0 ) ;
task_new.setOpenTime( EventDate );
task_new.setComment( "Задача создана автоматически" );
task_new.setAddressParamID( 2 );
task_new.setAddressObjectId( task_AddressObjectId );
task_new.setTargetDate(task_TargetDate);
register_task_manager.updateTask( "new", task_new );
};
};
//Интернет - новое подключение (настройка)
if (task_type_id == 13 && contract_is_group_ec)
{
rscm_sid = 17;
// установка даты начала предоставления услуг
if( contract_param_utils.getDateParam( cid, PARAM_START_DATE ) == null )
{
contract_param_utils.setDateParam( cid, PARAM_START_DATE, task_ExecuteDate );
};
rscm_table_name = "rscm_service_account_9_"+TimeUtils.format(task_ExecuteDate, "yyyyMM");
query_new_table = "CREATE TABLE IF NOT EXISTS `"+rscm_table_name+"` ( "+
"`id` int(11) NOT NULL auto_increment, "+
"`cid` int(11) NOT NULL, "+
"`sid` int(11) NOT NULL, "+
"`date` date default NULL, "+
"`amount` bigint(20) default NULL, "+
"`comment` text NOT NULL, "+
"PRIMARY KEY (`id`), "+
"KEY `cid` (`cid`) "+
") ENGINE=MyISAM DEFAULT CHARSET=cp1251;";
psUpdate_new_table = con.prepareStatement( query_new_table );
psUpdate_new_table.executeUpdate();
query_check = "SELECT id FROM "+rscm_table_name+" WHERE cid='"+cid+"' AND sid='"+rscm_sid+"'";
ps_check = con.prepareStatement(query_check);
rs_check = ps_check.executeQuery();
if ( !rs_check.next() )
{
query_new = "INSERT INTO "+rscm_table_name+" (cid,sid,date,amount,comment) VALUES ('"+cid+"','"+rscm_sid+
"','"+TimeUtils.format(task_ExecuteDate, "yyyy-MM-dd")+"','1','')";
psUpdate_new = con.prepareStatement( query_new );
psUpdate_new.executeUpdate();
};
cids = cid.toString();
new RunTaskDataManager( con ).addTask( new RSCMRecalculator( 9, task_ExecuteDate_Calendar, "lda@dsn.ru", cids ) );
};
Получаю ошибку:
Eval error: Sourced file: inline evaluation of: ``import java.sql.*; import java.util.*; import bitel.billing.server.contract.
. . . '' : reflection error: bsh.ReflectError: Method addTask( bitel.billing.server.rscm.RSCMRecalculator ) not found in class'bitel.billing.server.task.bean
.RunTaskDataManager'
Sourced file: inline evaluation of: ``import java.sql.*; import java.util.*; import bitel.billing.server.contract. . . . '' : reflection error: bsh.Reflec
tError: Method addTask( bitel.billing.server.rscm.RSCMRecalculator ) not found in class'bitel.billing.server.task.bean.RunTaskDataManager' : at Line: 98 : in
file: inline evaluation of: ``import java.sql.*; import java.util.*; import bitel.billing.server.contract. . . . '' : .addTask ( new RSCMRecalculator ( 9
, task_ExecuteDate_Calendar , "lda@dsn.ru" , cids ) )
at bsh.BSHPrimarySuffix.doSuffix(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHBlock.evalBlock(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BSHIfStatement.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bitel.billing.server.script.bean.ScriptMachine.runScript(ScriptMachine.java:158)
at bitel.billing.server.script.bean.event.EventProcessor.processEvent(EventProcessor.java:248)
at bitel.billing.server.script.bean.event.EventProcessor.run(EventProcessor.java:163)
Подскажите что делаю не так?