|
@@ -3,9 +3,11 @@ package com.bofeng.service;
|
|
|
import com.baomidou.mybatisplus.toolkit.IdWorker;
|
|
|
import com.bofeng.JwtHelper;
|
|
|
import com.bofeng.dao.JmTuangouDao;
|
|
|
+import com.bofeng.dao.UserOpenMapper;
|
|
|
import com.bofeng.dao.YeweihuiSysOwnerMapper;
|
|
|
import com.bofeng.dao.YeweihuiUserRoleMapper;
|
|
|
import com.bofeng.entity.JmTuangou;
|
|
|
+import com.bofeng.entity.UserOpen;
|
|
|
import com.yvan.PageDb;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -34,6 +36,12 @@ public class JmTuangouService {
|
|
|
@Autowired
|
|
|
private YeweihuiSysOwnerMapper yeweihuiSysOwnerMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private EpiTemplateMessageService epiTemplateMessageService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserOpenMapper userOpenMapper;
|
|
|
+
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public Integer tuangouPublish(JmTuangou jmTuangou) {
|
|
|
|
|
@@ -91,6 +99,12 @@ public class JmTuangouService {
|
|
|
jmTuangou.setTgDeliverTime(tgDeliverTime);*/
|
|
|
jmTuangou.setUserId(JwtHelper.getUserId());
|
|
|
success = jmTuangouDao.insert(jmTuangou);
|
|
|
+ if (success == 1) {
|
|
|
+ List<UserOpen> userList = userOpenMapper.getUsersByUptownId(Long.parseLong(uptownId));
|
|
|
+ for (UserOpen user : userList) {
|
|
|
+ epiTemplateMessageService.tuangouSendRemindMessage(user.getUserId(), user.getOpenId(), jmTuangou.getTgEndTime());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return success;
|
|
|
}
|
|
@@ -147,11 +161,35 @@ public class JmTuangouService {
|
|
|
return jmTuangouDao.updateStatusRemarkByJmId(jmId, status, remark);
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public JmTuangou selectByUserId() {
|
|
|
+ buyService.updateStatus();
|
|
|
return jmTuangouDao.selectByUserId();
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public JmTuangou getSelectOne(Long jmId){
|
|
|
+ buyService.updateStatus();
|
|
|
return jmTuangouDao.getSelectOne(jmId);
|
|
|
}
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
+ public Integer zhihuibuTuangouPublish(JmTuangou jmTuangou) {
|
|
|
+
|
|
|
+ jmTuangou.setJmId(IdWorker.getId());
|
|
|
+
|
|
|
+ Long propertyId = yeweihuiUserRoleMapper.queryPropertyIdByUserId(jmTuangou.getUserId());
|
|
|
+ Long uptownId = yeweihuiSysOwnerMapper.queryUptownIdByUserId(propertyId);
|
|
|
+ jmTuangou.setUptownId(uptownId);
|
|
|
+
|
|
|
+ jmTuangou.setTgStatus(1);
|
|
|
+ jmTuangou.setUserId(JwtHelper.getUserId());
|
|
|
+
|
|
|
+ return jmTuangouDao.insert(jmTuangou);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
+ public Integer zhihuibuUpdateStatus(Long jmId, Long status) {
|
|
|
+ return jmTuangouDao.updateStatusByJmId(jmId, status);
|
|
|
+ }
|
|
|
}
|