package org.jeecg.modules.finance; import cn.com.ctop.common.module.mapper.MailLogMapper; import cn.com.ctop.common.module.utils.CorpWexinUtils; import com.alibaba.fastjson.JSONObject; import org.jeecg.JeecgSystemApplication; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import javax.annotation.Resource; /** * zian Y * 2021/8/3 **/ @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class) public class FinanceTest { @Resource CorpWexinUtils corpWexinUtils; @Resource MailLogMapper mailLogMapper; @Test public void weixin(){ JSONObject wChatIdByUserId = mailLogMapper.getWChatIdByUserId("26bbe90edc5b475ca41ec3f76aa65067"); StringBuilder text = new StringBuilder(); text.append("您有一条销售政策需要审核,该客户为:"); text.append("测试"); text.append(",请及时登录助手平台-销售政策页面进行审核,谢谢!"); corpWexinUtils.sendMessageByWeChatId(wChatIdByUserId,text.toString()); } @Test public void getAccountId(){ String str1 = "123123123-1"; String str2 = "123123123-1"; String str = str1.substring(0, str1.indexOf("-")); String str3 = str2.substring(0, str2.indexOf("-")); System.out.println(str); System.out.println(str3); } public static void main(String[] args) { String str1 = "123123123-1"; String str2 = "123123123-1"; String str = str1.substring(0, str1.indexOf("-")); String str3 = str2.substring(0, str2.indexOf("-")); System.out.println(str); System.out.println(str3); } }