FinanceTest.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package org.jeecg.modules.finance;
  2. import cn.com.ctop.common.module.mapper.MailLogMapper;
  3. import cn.com.ctop.common.module.utils.CorpWexinUtils;
  4. import com.alibaba.fastjson.JSONObject;
  5. import org.jeecg.JeecgSystemApplication;
  6. import org.junit.Test;
  7. import org.junit.runner.RunWith;
  8. import org.springframework.boot.test.context.SpringBootTest;
  9. import org.springframework.test.context.junit4.SpringRunner;
  10. import javax.annotation.Resource;
  11. /**
  12. * zian Y
  13. * 2021/8/3
  14. **/
  15. @RunWith(SpringRunner.class)
  16. @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
  17. public class FinanceTest {
  18. @Resource
  19. CorpWexinUtils corpWexinUtils;
  20. @Resource
  21. MailLogMapper mailLogMapper;
  22. @Test
  23. public void weixin(){
  24. JSONObject wChatIdByUserId = mailLogMapper.getWChatIdByUserId("26bbe90edc5b475ca41ec3f76aa65067");
  25. StringBuilder text = new StringBuilder();
  26. text.append("您有一条销售政策需要审核,该客户为:");
  27. text.append("测试");
  28. text.append(",请及时登录助手平台-销售政策页面进行审核,谢谢!");
  29. corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId,text.toString());
  30. }
  31. @Test
  32. public void getAccountId(){
  33. String str1 = "123123123-1";
  34. String str2 = "123123123-1";
  35. String str = str1.substring(0, str1.indexOf("-"));
  36. String str3 = str2.substring(0, str2.indexOf("-"));
  37. System.out.println(str);
  38. System.out.println(str3);
  39. }
  40. public static void main(String[] args) {
  41. String str1 = "123123123-1";
  42. String str2 = "123123123-1";
  43. String str = str1.substring(0, str1.indexOf("-"));
  44. String str3 = str2.substring(0, str2.indexOf("-"));
  45. System.out.println(str);
  46. System.out.println(str3);
  47. }
  48. }