|
@@ -35,7 +35,6 @@ import javassist.NotFoundException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
-import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -303,12 +302,21 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 可配置的定时任务
|
|
|
|
|
+ */
|
|
|
|
|
+ public List<InquiryRemind> testMessage(Date startTime, Date endTime, Long useruu, Long enuu){
|
|
|
|
|
+ logger.log("公共询价","9点定时统计询价单总数服务开启");
|
|
|
|
|
+ List<InquiryRemind> list = inquiryRemindDao.findTestInfo(startTime,endTime,useruu,enuu);
|
|
|
|
|
+ return list;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 每早9点发送询价通知短信
|
|
* 每早9点发送询价通知短信
|
|
|
*/
|
|
*/
|
|
|
@Scheduled(cron = "0 0 9 * * ?" )
|
|
@Scheduled(cron = "0 0 9 * * ?" )
|
|
|
private void sendMessage() throws Exception {
|
|
private void sendMessage() throws Exception {
|
|
|
-
|
|
|
|
|
|
|
+ logger.log("公共询价","9点定时统计询价单总数服务开启");
|
|
|
List<BigInteger> list1 = inquiryRemindDao.findvenduseruu();
|
|
List<BigInteger> list1 = inquiryRemindDao.findvenduseruu();
|
|
|
//找到询价推荐表中的所有公司
|
|
//找到询价推荐表中的所有公司
|
|
|
List<BigInteger> list2 = inquiryRemindDao.findvenduu();
|
|
List<BigInteger> list2 = inquiryRemindDao.findvenduu();
|
|
@@ -321,6 +329,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ logger.log("公共询价","9点定时统计询价单总数服务结束");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -328,7 +337,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
* 发送消息推送
|
|
* 发送消息推送
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
- private void sendMessage(final Integer count, final List<InquiryRemind> reminds) {
|
|
|
|
|
|
|
+ public void sendMessage(final Integer count, final List<InquiryRemind> reminds) {
|
|
|
ThreadUtils.task(new Runnable() {
|
|
ThreadUtils.task(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
@@ -358,7 +367,9 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
model.setSmTemplate(SMS_TEMP_ID);
|
|
model.setSmTemplate(SMS_TEMP_ID);
|
|
|
models.add(model);
|
|
models.add(model);
|
|
|
String res = HttpUtil.doPost(PS_MESSAGE_URL + "/messages", FlexJsonUtils.toJsonDeep(models));
|
|
String res = HttpUtil.doPost(PS_MESSAGE_URL + "/messages", FlexJsonUtils.toJsonDeep(models));
|
|
|
|
|
+ System.out.println(FlexJsonUtils.toJsonDeep(models));
|
|
|
System.out.println(res);
|
|
System.out.println(res);
|
|
|
|
|
+ logger.log("公共询价","此次"+company+"公司新增"+count+"张公共询价");
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
@@ -372,7 +383,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
*/
|
|
*/
|
|
|
@Scheduled(cron = "0 0 14 * * ?" )
|
|
@Scheduled(cron = "0 0 14 * * ?" )
|
|
|
private void sendMessage2(){
|
|
private void sendMessage2(){
|
|
|
-
|
|
|
|
|
|
|
+ logger.log("公共询价","14点定时统计询价单总数服务开始");
|
|
|
List<BigInteger> list1 = inquiryRemindDao.findvenduseruu();
|
|
List<BigInteger> list1 = inquiryRemindDao.findvenduseruu();
|
|
|
//找到询价推荐表中的所有公司
|
|
//找到询价推荐表中的所有公司
|
|
|
List<BigInteger> list2 = inquiryRemindDao.findvenduu();
|
|
List<BigInteger> list2 = inquiryRemindDao.findvenduu();
|
|
@@ -385,6 +396,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ logger.log("公共询价","14点定时统计询价单总数服务结束");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -392,7 +404,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
*/
|
|
*/
|
|
|
@Scheduled(cron = "0 0 17 * * ?" )
|
|
@Scheduled(cron = "0 0 17 * * ?" )
|
|
|
private void sendMessage3(){
|
|
private void sendMessage3(){
|
|
|
-
|
|
|
|
|
|
|
+ logger.log("公共询价","17点定时统计询价单总数服务结束");
|
|
|
List<BigInteger> list1 = inquiryRemindDao.findvenduseruu();
|
|
List<BigInteger> list1 = inquiryRemindDao.findvenduseruu();
|
|
|
//找到询价推荐表中的所有公司
|
|
//找到询价推荐表中的所有公司
|
|
|
List<BigInteger> list2 = inquiryRemindDao.findvenduu();
|
|
List<BigInteger> list2 = inquiryRemindDao.findvenduu();
|
|
@@ -405,6 +417,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ logger.log("公共询价","17点定时统计询价单总数服务结束");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|