TestInit.java 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package com.dashitech.callcenter.init;
  2. import com.dashitech.hsms.dao.IHsmsCallLogDAO;
  3. import com.dashitech.hsms.entity.HsmsCallLogEntity;
  4. import org.apache.commons.logging.Log;
  5. import org.apache.commons.logging.LogFactory;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.boot.ApplicationArguments;
  8. import org.springframework.boot.ApplicationRunner;
  9. import org.springframework.context.annotation.Bean;
  10. import org.springframework.context.annotation.Lazy;
  11. import org.springframework.core.annotation.Order;
  12. import org.springframework.stereotype.Service;
  13. import java.util.Date;
  14. @Service
  15. @Order(10)
  16. public class TestInit implements ApplicationRunner {
  17. private static Log log = LogFactory.getLog(TestInit.class);
  18. @Autowired
  19. private IHsmsCallLogDAO hsmsCallLogDAO;
  20. @Override
  21. public void run(ApplicationArguments args) throws Exception {
  22. // testHsmsCallLogEntity();
  23. }
  24. private void testHsmsCallLogEntity() {
  25. log.info("start");
  26. HsmsCallLogEntity hsmsCallLog = new HsmsCallLogEntity();
  27. hsmsCallLog.setVersion(0);
  28. hsmsCallLog.setCallDept(null);
  29. hsmsCallLog.setCallAccept("AAAAAAAAA");
  30. hsmsCallLog.setPhyIDA("1111");
  31. hsmsCallLog.setdTMFA("2222");
  32. hsmsCallLog.setdTMFB("33333");
  33. hsmsCallLog.setResponseTime(new Date());
  34. hsmsCallLog.setLongTime("123");
  35. hsmsCallLog.setPath("d:/a.txt");
  36. hsmsCallLog.setCallType(1);
  37. hsmsCallLog.setCallState(1);
  38. hsmsCallLog.setHosId(1);
  39. hsmsCallLogDAO.save(hsmsCallLog);
  40. log.info("保存HSMS通话记录完成!");
  41. }
  42. }