|
|
|
@ -30,6 +30,8 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.text.DateFormat; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
@ -435,7 +437,14 @@ public class HighUserServiceImpl implements HighUserService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public HighUserLevel findUserLevel(Long userId) { |
|
|
|
|
public HighUserLevel findUserLevel(Long userId) throws Exception { |
|
|
|
|
|
|
|
|
|
HighUser user = highUserMapper.selectByPrimaryKey(userId); |
|
|
|
|
|
|
|
|
|
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
Date targetTime = dateFormat.parse("2023-11-08 00:00:00"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HighUserLevelExample example = new HighUserLevelExample(); |
|
|
|
|
HighUserLevelExample.Criteria criteria = example.createCriteria(); |
|
|
|
|
|
|
|
|
@ -447,6 +456,18 @@ public class HighUserServiceImpl implements HighUserService { |
|
|
|
|
return list.get(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (user != null && user.getRegTime().compareTo(targetTime) < 0) { |
|
|
|
|
HighUserLevel highUserLevel = new HighUserLevel(); |
|
|
|
|
highUserLevel.setCreateTime(new Date()); |
|
|
|
|
highUserLevel.setUpdateTime(new Date()); |
|
|
|
|
highUserLevel.setLevel("1"); |
|
|
|
|
highUserLevel.setStatus(1); |
|
|
|
|
highUserLevel.setUserId(userId); |
|
|
|
|
insertLevelUp(highUserLevel); |
|
|
|
|
return highUserLevel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|