| | |
| | | |
| | | |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.feignclient.activity.model.IntegralCommodity; |
| | | import com.dsh.account.feignclient.other.SysLogClient; |
| | | import com.dsh.account.model.vo.userBenefitDetail.*; |
| | | import com.dsh.account.service.RechargeRecordsService; |
| | |
| | | @ApiOperation(value = "福利主页", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(name = "lat",value = "经度",dataType = "string"), |
| | | @ApiImplicitParam(name = "lon",value = "纬度",dataType = "string") |
| | | }) |
| | | public ResultUtil<IndexOfUserBenefirVo> queryAppUserUser(){ |
| | | public ResultUtil<IndexOfUserBenefirVo> queryAppUserUser(String lon,String lat){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(tauService.queryBenefitDetails(appUserId)); |
| | | IndexOfUserBenefirVo indexOfUserBenefirVo = tauService.queryBenefitDetails(appUserId,lon,lat); |
| | | List<IntegralCommodity> commodities = indexOfUserBenefirVo.getCommodities(); |
| | | if (commodities.size() > 5) { |
| | | commodities = commodities.subList(0, 5); |
| | | } |
| | | indexOfUserBenefirVo.setCommodities(commodities); |
| | | return ResultUtil.success(indexOfUserBenefirVo); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | @ApiOperation(value = "用户个人信息", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(name = "lat",value = "经度",dataType = "string"), |
| | | @ApiImplicitParam(name = "lon",value = "纬度",dataType = "string") |
| | | |
| | | }) |
| | | public ResultUtil<AppUserDetailsVo> queryAppUserDetails(){ |
| | | try { |
| | |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | TAppUser tAppUser = tauService.getBaseMapper().selectById(appUserId); |
| | | if (tAppUser.getCode()==null){ |
| | | detailsVo.setNeedChange(1); |
| | | }else { |
| | | detailsVo.setNeedChange(0); |
| | | } |
| | | |
| | | |
| | | if (null != tAppUser){ |
| | | detailsVo.setUserId(appUserId); |
| | | detailsVo.setUserImage(tAppUser.getHeadImg()); |
| | |
| | | @ApiImplicitParam(value = "记录id", name = "detailsId", required = true, dataType = "string"), |
| | | }) |
| | | public ResultUtil<PointDetailsVo> redemptionDetails(Long detailsId){ |
| | | try { |
| | | // try { |
| | | PointDetailsVo pointDetailsVo = uicService.queryRedemptionDetails(detailsId); |
| | | pointDetailsVo.getPics().remove(0); |
| | | return ResultUtil.success(pointDetailsVo); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |