| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- package xin.glue.nui.G.G02;
- import com.posdata.glue.PosException;
- import com.posdata.glue.biz.constants.PosBizControlConstants;
- import com.posdata.glue.biz.control.PosBizControlIF;
- import com.posdata.glue.biz.control.PosBizProvider;
- import com.posdata.glue.context.PosContext;
- import com.posdata.glue.dao.PosGenericDao;
- import com.posdata.glue.dao.vo.PosParameter;
- import com.posdata.glue.dao.vo.PosRow;
- import com.posdata.glue.dao.vo.PosRowSet;
- import com.posdata.glue.msg.PosMESMessageImpl;
- import com.posdata.glue.msg.PosMessage;
- import com.posdata.glue.scheduling.PosQuartzJobBean;
- import com.posdata.glue.transaction.PosTransactionManager;
- import com.posdata.glue.util.log.PosLog;
- import com.posdata.glue.util.log.PosLogFactory;
- import org.quartz.JobExecutionContext;
- public class SMSTranAction extends PosQuartzJobBean {
-
- protected PosGenericDao dao = (PosGenericDao)
- PosContext.getBeanFactory().getBeanObject("mesdao");
- private PosTransactionManager transaction =
- (PosTransactionManager) PosContext.getBeanFactory().getBeanObject("tx1");
- protected PosLog log = PosLogFactory.getLogger(getClass());
-
- protected void executeJob(JobExecutionContext arg0)
- {
-
- log.logInfo("SMSTranAction executeJob start " );
- PosParameter param0 = new PosParameter();
- param0.setValueParamter(0,"S" );
- PosRowSet sndDataVO = dao.find("NIG060100_RECV_01.select",param0 );
-
- while(sndDataVO.hasNext()) {
- PosRow sndDataROW = sndDataVO.next();
-
- Number SeqNo = (Number)sndDataROW.getAttribute("SEQ_NO");
- String sMsg = (String)sndDataROW.getAttribute("TC_MSG");
- String TcLen = (String)sndDataROW.getAttribute("TC_LEN");
- String TcId = (String)sndDataROW.getAttribute("TC_ID");
-
-
- TC_SEND(sMsg,TcId,TcLen);
-
- PosParameter param1 = new PosParameter();
- param1.setValueParamter(0,SeqNo );
- dao.update("NIG060100_RECV_DATA.update",param1);
-
- }
- log.logInfo("SMSTranAction END " );
-
- }
- public void TC_SEND(String sMsg ,String TcId,String TcLen)
- {
- log.logInfo("SMSTranAction TC_SEND " );
-
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
-
-
- String TC_MSG = TcId+sMsg;
-
- log.logInfo("SMSTranAction TC_LEN:"+TcLen );
- log.logInfo("SMSTranAction MSG_ID:"+TcId );
-
- message.setTC(TC_MSG);
- message.setTCID(TcId);
-
-
- context.setMessage(message);
-
- String SERVICE_POSTFIX = "-service";
- context.put(PosBizControlConstants.SERVICE_NAME, TcId + SERVICE_POSTFIX);
- PosBizProvider.getController().doSubController(context, false);
-
- PosBizControlIF controller = PosBizProvider.getController();
-
- log.logInfo("controller context: "+context );
-
- controller.doSubController(context,false);
-
- }
-
-
- }
|