Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev

new-dev
袁野 1 year ago
parent 7fcdfd2e69
commit d7bfa1372f
  1. 2
      hai-service/src/main/java/com/hai/service/HighUserService.java
  2. 23
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java

@ -166,7 +166,7 @@ public interface HighUserService {
void editLevelUp(HighUserLevel highUserLevel);
HighUserLevel findUserLevel(Long userId);
HighUserLevel findUserLevel(Long userId) throws Exception;

@ -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;
}
}

Loading…
Cancel
Save