fix a bug that will happen when group leader quit the group.

DEV
PeterAlbus 3 years ago
parent aee626325f
commit 2db318b7bb

@ -164,7 +164,7 @@ public class ParticipateService
QueryWrapper<Record> recordQueryWrapper=new QueryWrapper<>(); QueryWrapper<Record> recordQueryWrapper=new QueryWrapper<>();
recordQueryWrapper.eq("participation_id",participate.getParticipationId()); recordQueryWrapper.eq("participation_id",participate.getParticipationId());
recordDao.delete(recordQueryWrapper); recordDao.delete(recordQueryWrapper);
if(group.getLeaderId().equals(participate.getUserId())&&count==2) if(group.getLeaderId().equals(participate.getUserId())&&count==1)
{ {
participateDao.deleteById(participationId); participateDao.deleteById(participationId);
return groupDao.deleteById(group); return groupDao.deleteById(group);

@ -1,27 +0,0 @@
package com.peteralbus;
import com.peteralbus.dao.UserDao;
import com.peteralbus.entity.User;
import com.peteralbus.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class) // SpringJUnit支持由此引入Spring-Test框架支持
@ContextConfiguration(locations = {"classpath:mybatis-config.xml","classpath:applicationContext.xml"})//用于加载bean
public class MybatisPlusTest
{
@Autowired
UserDao userDao;
@Autowired
UserService userService;
@Test
public void test()
{
User user=userService.queryByUsername("PeterAlbus");
user.setUserPhone("17317792001");
userDao.updateById(user);
}
}
Loading…
Cancel
Save