提交 9392d331 authored 作者: zgy's avatar zgy

更新app 短信群发

上级 175a5de1
......@@ -5,6 +5,8 @@ import com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity;
import com.diaoyun.zion.chinafrica.vo.TbCfUserVo;
import com.diaoyun.zion.master.dao.BaseDao;
import java.util.List;
/**
* 用户表Dao
*
......@@ -62,4 +64,6 @@ public interface TbCfUserInfoDao extends BaseDao<TbCfUserInfoEntity> {
* @return
*/
TbCfUserVo queryUserByUserId(String userId);
List<TbCfUserInfoEntity> selectUserByPhone();
}
......@@ -178,4 +178,5 @@ public interface TbCfUserInfoService {
boolean checkUserByNick(String name);
Result queryUserByUserId(String userId);
List<TbCfUserInfoEntity> selectUserByPhone();
}
......@@ -536,8 +536,8 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
@Override
public Result queryUserByUserId(String userId) {
Result<TbCfUserVo> result = new Result<>();
TbCfUserVo tbCfUserVo=new TbCfUserVo();
TbCfUserVo user=tbCfUserInfoDao.queryUserByUserId(userId);
TbCfUserVo tbCfUserVo = new TbCfUserVo();
TbCfUserVo user = tbCfUserInfoDao.queryUserByUserId(userId);
tbCfUserVo.setUserId(user.getUserId());
tbCfUserVo.setUserNo(user.getUserNo());
tbCfUserVo.setUserName(user.getUserName());
......@@ -550,6 +550,11 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
return result;
}
@Override
public List<TbCfUserInfoEntity>selectUserByPhone() {
return tbCfUserInfoDao.selectUserByPhone();
}
/**
* 获取用户类型
*
......
......@@ -94,7 +94,9 @@
limit #{offset}, #{limit}
</if>
</select>
<select id="selectUserByPhone" resultType="com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity">
select * from tb_cf_user_info where phone is not null
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_user_info
WHERE 1=1
......
......@@ -2,6 +2,8 @@ package com.diaoyun.zion;
import com.alibaba.fastjson.JSON;
import com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity;
import com.diaoyun.zion.chinafrica.service.TbCfUserInfoService;
import com.diaoyun.zion.chinafrica.vo.Products;
import com.diaoyun.zion.chinafrica.vo.ShopifyConstant;
import com.diaoyun.zion.master.base.Result;
......@@ -222,8 +224,15 @@ public class PayTest {
}
@Test
public void sendMessageToAll(){
public void testList() {
boolean flag = false;
List<Integer> list = new ArrayList<>();
list.add(20);
list.add(40);
if (!list.contains("20")) {
flag = true;
}
System.out.println(false);
}
}
......@@ -2,6 +2,7 @@ package com.diaoyun.zion;
import com.diaoyun.zion.chinafrica.constant.KeyConstant;
import com.diaoyun.zion.chinafrica.dao.TbCfIssueCouponDao;
import com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity;
import com.diaoyun.zion.chinafrica.service.SpiderService;
import com.diaoyun.zion.chinafrica.service.TbCfCouponService;
import com.diaoyun.zion.chinafrica.service.TbCfIssueCouponService;
......@@ -9,6 +10,7 @@ import com.diaoyun.zion.chinafrica.service.TbCfUserInfoService;
import com.diaoyun.zion.master.thread.TaskLimitSemaphore;
import com.diaoyun.zion.master.util.AESUtils;
import com.diaoyun.zion.master.util.IdUtil;
import com.diaoyun.zion.master.util.SMSUtil;
import com.stripe.exception.StripeException;
import freemarker.template.Configuration;
import org.apache.http.NameValuePair;
......@@ -53,7 +55,7 @@ public class ZionApplicationTests {
@Test
public void contextLoads() throws InterruptedException, URISyntaxException, IOException, ExecutionException, StripeException, TimeoutException {
Map map=new HashMap();
Map map = new HashMap();
map.entrySet();
/*Template t = config.getTemplate("email-template.ftl");
Map<String,String> model=new HashMap<>();
......@@ -275,7 +277,7 @@ public class ZionApplicationTests {
System.out.println(json);
*/
/*分词********************/
/*分词********************/
/*ExecutorService threadPool = Executors.newFixedThreadPool(20);
TbCfOrderServiceImpl tbCfOrderServiceImpl =new TbCfOrderServiceImpl();
long a=System.currentTimeMillis();
......@@ -306,7 +308,7 @@ public class ZionApplicationTests {
String res=HttpClientUtil.sendPostWithBodyParameter(url,paramMap);
Map map=GsonUtil.GsonToMaps(res);*/
long b=IdUtil.createLongIdByDate();
long b = IdUtil.createLongIdByDate();
System.out.println(b);
......@@ -370,7 +372,7 @@ public class ZionApplicationTests {
*
* @param usableSibUrl
* @return
*/
*/
private String deleteLoginModule(String usableSibUrl) {
usableSibUrl = usableSibUrl.replaceAll("couponActivity", "");
usableSibUrl = usableSibUrl.replaceAll("soldQuantity", "");
......@@ -427,47 +429,49 @@ public class ZionApplicationTests {
}
@Test
public void testP(){
public void testP() {
BigDecimal decimal=new BigDecimal("699");
BigDecimal de=new BigDecimal("100");
decimal.divide(de,2,BigDecimal.ROUND_HALF_UP);
BigDecimal decimal = new BigDecimal("699");
BigDecimal de = new BigDecimal("100");
decimal.divide(de, 2, BigDecimal.ROUND_HALF_UP);
}
@Test
public void testAesut(){
public void testAesut() {
String a = AESUtils.encrypt(KeyConstant.AES_KEY,"sk_test_tGl2q7Omxehpli7R3Z6xU6G900iL1eX32c");
String a = AESUtils.encrypt(KeyConstant.AES_KEY, "sk_test_tGl2q7Omxehpli7R3Z6xU6G900iL1eX32c");
System.out.println(a);
}
@Test
public void test(){
redisTemplate.opsForValue().set("hello","helloworld");
public void test() {
redisTemplate.opsForValue().set("hello", "helloworld");
Object hello = redisTemplate.opsForValue().get("hello");
System.out.println(hello);
redisTemplate.delete("hello");
System.out.println("==============="+redisTemplate.opsForValue().get("hello"));
System.out.println("===============" + redisTemplate.opsForValue().get("hello"));
}
@Autowired
private TbCfIssueCouponService tbCfIssueCouponService;
/* @Test
public void testLogin(){
TbCfIssueCouponEntity issue = new TbCfIssueCouponEntity();
String coupon_id = "";
String issuseCoupon_id = IdUtil.createIdbyUUID();
//把上面获取到的值,赋值到实体类中
issue.setCouponId("1087f4a682354843b145d36c27d2d902");
issue.setIssueId("5308312b76cd4819b7d94f01dea12ab8");
issue.setCreateTime(new Date().toString());
issue.setUserId("5308312b76cd4819b7d94f01dea12ab8");
issue.setNick("avatar");
issue.setEnableFlag(0);
tbCfIssueCouponService.save(issue);
}
*/
/* @Test
public void testLogin(){
TbCfIssueCouponEntity issue = new TbCfIssueCouponEntity();
String coupon_id = "";
String issuseCoupon_id = IdUtil.createIdbyUUID();
//把上面获取到的值,赋值到实体类中
issue.setCouponId("1087f4a682354843b145d36c27d2d902");
issue.setIssueId("5308312b76cd4819b7d94f01dea12ab8");
issue.setCreateTime(new Date().toString());
issue.setUserId("5308312b76cd4819b7d94f01dea12ab8");
issue.setNick("avatar");
issue.setEnableFlag(0);
tbCfIssueCouponService.save(issue);
}
*/
/* @Test
public void testInsert(){
TbCfIssueCouponEntity issue = new TbCfIssueCouponEntity();
......@@ -483,10 +487,10 @@ public class ZionApplicationTests {
tbCfIssueCouponService.save(issue);
}*/
@Test
public void testCouponStatus(){
String userId="c45e8b04b9d44cf4b48e2d5cdb18fbcd";
String couponId="1087f4a682354843b145d36c27d2d90e";
tbCfIssueCouponDao.changeCoupnStatus(userId,couponId);
public void testCouponStatus() {
String userId = "c45e8b04b9d44cf4b48e2d5cdb18fbcd";
String couponId = "1087f4a682354843b145d36c27d2d90e";
tbCfIssueCouponDao.changeCoupnStatus(userId, couponId);
}
@Test
......@@ -495,15 +499,32 @@ public class ZionApplicationTests {
}
@Test
public void testCP(){
Set<String> set =new HashSet<>();
public void testCP() {
Set<String> set = new HashSet<>();
set.add("121");
set.add("121");
set.add("121");
set.add("121");
Iterator it = set.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
Iterator it = set.iterator();
while (it.hasNext()) {
System.out.println(it.next());
}
}
@Test
public void sendMessageToAll() {
String phone = "";
List<TbCfUserInfoEntity> list = tbCfUserInfoService.selectUserByPhone();
for (TbCfUserInfoEntity user : list) {
phone += user.getPhone();
phone += ",";
}
System.out.println(phone);
String text = "We've updated!\n" +
"Thank you for downloading Afrishop. If you get a 'Server Busy' notification as you are trying to shop, be sure to sign out and sign in again. Be sure to check your device store for the lastest app updates.\n" +
"You can also shop using our website www.afrieshop.com\n" +
"Happy Shopping!";
SMSUtil.sendMessageByText(/*phone.trim()*/"+8613751400455,+8618607444177", text);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论