Commit 0ec60626 authored by codezwjava's avatar codezwjava

修改用户升级后同步账户表和团队业绩表等级bug

parent 9582f8aa
...@@ -11,6 +11,8 @@ import org.springframework.stereotype.Service; ...@@ -11,6 +11,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -889,17 +891,20 @@ public class UserLevelServiceImpl extends ServiceImpl<UsersMapper, User> impleme ...@@ -889,17 +891,20 @@ public class UserLevelServiceImpl extends ServiceImpl<UsersMapper, User> impleme
@Override @Override
public void accountAndTeamPerformanceUserLevelUpdate(String userId){ public void accountAndTeamPerformanceUserLevelUpdate(String userId){
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
String format = dateFormat.format(new Date());
User userByUserId = usersMapper.getUserByUserId(userId); User userByUserId = usersMapper.getUserByUserId(userId);
if (null != userByUserId){ if (null != userByUserId){
int userLevel = userByUserId.getUserLevel(); int userLevel = userByUserId.getUserLevel();
AccountInfo accountInfoByUserId = accountMapper.getByUserId(userId); AccountInfo accountInfoByUserId = accountMapper.getByUserId(userId);
accountInfoByUserId.setUserLevel(userLevel); accountInfoByUserId.setUserLevel(userLevel);
TeamPerformance teamPerformanceByUserId = teamPerformanceMapper.getByUserId(userId); TeamPerformance teamPerformanceByUserId = teamPerformanceMapper.getByUserIdAndTime(userId,format);
teamPerformanceByUserId.setUserLevel(userLevel); teamPerformanceByUserId.setUserLevel(userLevel);
accountMapper.updateById(accountInfoByUserId); accountMapper.edit(accountInfoByUserId);
teamPerformanceMapper.updateById(teamPerformanceByUserId); teamPerformanceMapper.edit(teamPerformanceByUserId);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment