|
@@ -86,7 +86,6 @@ public class JmTuangouService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public Integer whepiTuangouPublish(String uptownIds, JmTuangou jmTuangou) throws InvocationTargetException, IllegalAccessException {
|
|
|
- long startTime = System.currentTimeMillis();
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
int moth = cal.get(Calendar.MONTH) + 1;
|
|
|
int date = cal.get(Calendar.DAY_OF_MONTH);
|
|
@@ -131,16 +130,20 @@ public class JmTuangouService {
|
|
|
tgList.add(jmTuangou1);
|
|
|
}
|
|
|
Integer success = jmTuangouDao.insertJmTuangouList(tgList);
|
|
|
- if (success == 1) {
|
|
|
- for (String uptownId : uptownIdArray) {
|
|
|
- List<UserOpen> userList = userOpenMapper.getUsersByUptownId(Long.parseLong(uptownId));
|
|
|
- for (UserOpen user : userList) {
|
|
|
- epiTemplateMessageService.tuangouSendRemindMessage(user.getUserId(), user.getOpenId(), jmTuangou.getTgEndTime());
|
|
|
+ if (success > 0) {
|
|
|
+ Thread thread=new Thread(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ for (String uptownId : uptownIdArray) {
|
|
|
+ List<UserOpen> userList = userOpenMapper.getUsersByUptownId(Long.parseLong(uptownId));
|
|
|
+ for (UserOpen user : userList) {
|
|
|
+ epiTemplateMessageService.tuangouSendRemindMessage(user.getUserId(), user.getOpenId(), jmTuangou.getTgEndTime());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
+ thread.start();
|
|
|
}
|
|
|
- long endTime = System.currentTimeMillis();
|
|
|
- System.out.print((endTime-startTime)/1000);
|
|
|
return success;
|
|
|
}
|
|
|
|