8e8deb4e574e71da2be275ba58a902dad72d3aa0.svn-base 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package xin.glue.nui.G.G02;
  2. import com.posdata.glue.PosException;
  3. import com.posdata.glue.biz.constants.PosBizControlConstants;
  4. import com.posdata.glue.biz.control.PosBizControlIF;
  5. import com.posdata.glue.biz.control.PosBizProvider;
  6. import com.posdata.glue.context.PosContext;
  7. import com.posdata.glue.dao.PosGenericDao;
  8. import com.posdata.glue.dao.vo.PosParameter;
  9. import com.posdata.glue.dao.vo.PosRow;
  10. import com.posdata.glue.dao.vo.PosRowSet;
  11. import com.posdata.glue.msg.PosMESMessageImpl;
  12. import com.posdata.glue.msg.PosMessage;
  13. import com.posdata.glue.scheduling.PosQuartzJobBean;
  14. import com.posdata.glue.transaction.PosTransactionManager;
  15. import com.posdata.glue.util.log.PosLog;
  16. import com.posdata.glue.util.log.PosLogFactory;
  17. import org.quartz.JobExecutionContext;
  18. public class SMSTranAction extends PosQuartzJobBean {
  19. protected PosGenericDao dao = (PosGenericDao)
  20. PosContext.getBeanFactory().getBeanObject("mesdao");
  21. private PosTransactionManager transaction =
  22. (PosTransactionManager) PosContext.getBeanFactory().getBeanObject("tx1");
  23. protected PosLog log = PosLogFactory.getLogger(getClass());
  24. protected void executeJob(JobExecutionContext arg0)
  25. {
  26. log.logInfo("SMSTranAction executeJob start " );
  27. PosParameter param0 = new PosParameter();
  28. param0.setValueParamter(0,"S" );
  29. PosRowSet sndDataVO = dao.find("NIG060100_RECV_01.select",param0 );
  30. while(sndDataVO.hasNext()) {
  31. PosRow sndDataROW = sndDataVO.next();
  32. Number SeqNo = (Number)sndDataROW.getAttribute("SEQ_NO");
  33. String sMsg = (String)sndDataROW.getAttribute("TC_MSG");
  34. String TcLen = (String)sndDataROW.getAttribute("TC_LEN");
  35. String TcId = (String)sndDataROW.getAttribute("TC_ID");
  36. TC_SEND(sMsg,TcId,TcLen);
  37. PosParameter param1 = new PosParameter();
  38. param1.setValueParamter(0,SeqNo );
  39. dao.update("NIG060100_RECV_DATA.update",param1);
  40. }
  41. log.logInfo("SMSTranAction END " );
  42. }
  43. public void TC_SEND(String sMsg ,String TcId,String TcLen)
  44. {
  45. log.logInfo("SMSTranAction TC_SEND " );
  46. PosContext context = new PosContext();
  47. PosMessage message = new PosMESMessageImpl();
  48. String TC_MSG = TcId+sMsg;
  49. log.logInfo("SMSTranAction TC_LEN:"+TcLen );
  50. log.logInfo("SMSTranAction MSG_ID:"+TcId );
  51. message.setTC(TC_MSG);
  52. message.setTCID(TcId);
  53. context.setMessage(message);
  54. String SERVICE_POSTFIX = "-service";
  55. context.put(PosBizControlConstants.SERVICE_NAME, TcId + SERVICE_POSTFIX);
  56. PosBizProvider.getController().doSubController(context, false);
  57. PosBizControlIF controller = PosBizProvider.getController();
  58. log.logInfo("controller context: "+context );
  59. controller.doSubController(context,false);
  60. }
  61. }