|
|
|
@@ -11,8 +11,10 @@ import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.WxAppinfo; |
|
|
|
import com.iformall.domain.po.WxCUser; |
|
|
|
import com.iformall.domain.po.WxCUserCar; |
|
|
|
import com.iformall.domain.po.WxLevelConfig; |
|
|
|
import com.iformall.service.WxCUserCarService; |
|
|
|
import com.iformall.service.WxCUserService; |
|
|
|
import com.iformall.service.WxLevelConfigService; |
|
|
|
import com.iformall.service.WxScoreRulesService; |
|
|
|
import com.iformall.utils.IPUtil; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
@@ -51,6 +53,9 @@ public class WxUserGrantController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private WxScoreRulesService wxScoreRulesService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxLevelConfigService wxLevelConfigService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 用户登录 |
|
|
|
* @param map |
|
|
|
@@ -327,6 +332,16 @@ public class WxUserGrantController extends BaseController { |
|
|
|
@GetMapping("/userinfo") |
|
|
|
public ResultData getUserInfo() { |
|
|
|
WxCUser user = getUser(); |
|
|
|
if (user.getScore() == null || user.getScore() == 0) { |
|
|
|
user.setLevelName("无"); |
|
|
|
} else { |
|
|
|
List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(user.getTenantId()); |
|
|
|
for(WxLevelConfig levelConfig: levelList) { |
|
|
|
if (user.getScore() > levelConfig.getPoints()) { |
|
|
|
user.setLevelName(levelConfig.getLevel()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS,"查询成功",user); |
|
|
|
} |
|
|
|
|
|
|
|
|