Merge remote-tracking branch 'origin/test' into txb
| | |
| | | @GetMapping("detailactivity") |
| | | @ApiImplicitParam(name ="id",value = "社区活动主键",required = true) |
| | | public R detailActivity(@RequestParam("id") Long id){ |
| | | Long userId = this.getUserId(); |
| | | Long userId = null; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo != null){ |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.detailActivity(id,userId); |
| | | } |
| | | |
| | |
| | | * @return 详情 |
| | | */ |
| | | @PostMapping("detailactivity") |
| | | R detailActivity(@RequestParam("id") Long id, @RequestParam("userId") Long userId); |
| | | R detailActivity(@RequestParam("id") Long id, @RequestParam(value = "userId",required = false) Long userId); |
| | | |
| | | /** |
| | | * 分页活动报名名单 |
| | |
| | | private List<PartyBuildingMemberExcelVO> list = new ArrayList<>(); |
| | | @Override |
| | | public void invoke(PartyBuildingMemberExcelVO partyBuildingMemberExcelVO, AnalysisContext analysisContext) { |
| | | Boolean isRepeat = list.stream().anyMatch(v -> v.getIdCard().equals(partyBuildingMemberExcelVO.getIdCard())); |
| | | if(isRepeat){ |
| | | throw new PartyBuildingMemberException("导入失败,存在多个相同身份证号:" + partyBuildingMemberExcelVO.getIdCard()); |
| | | } |
| | | list.add(partyBuildingMemberExcelVO); |
| | | // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM |
| | | if(list.size() >= BATCH_COUNT){ |
| | |
| | | * @return 详情 |
| | | */ |
| | | @PostMapping("detailactivity") |
| | | public R detailActivity(@RequestParam("id") Long id, @RequestParam("userId") Long userId) { |
| | | public R detailActivity(@RequestParam("id") Long id, @RequestParam(value = "userId",required = false) Long userId) { |
| | | ComActActivityVO comActActivityVO = comActActivityService.inforActivity(id, userId); |
| | | if (ObjectUtils.isEmpty(comActActivityVO)) { |
| | | return R.fail("活动不存在"); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | public ComActActivityVO inforActivity(Long id, Long userId) { |
| | | ComActActivityVO comActActivityVO=comActActivityDAO.inforActivity(id); |
| | | if (!ObjectUtils.isEmpty(comActActivityVO)) { |
| | | ComActActSignDO comActActSignDO = comActActSignDAO.selectOne(new QueryWrapper<ComActActSignDO>().lambda().eq(ComActActSignDO::getActivityId, id).eq(ComActActSignDO::getUserId, userId)); |
| | | |
| | | LambdaQueryWrapper<ComActActSignDO> actSignQuery = new LambdaQueryWrapper<>(); |
| | | actSignQuery.eq(ComActActSignDO::getActivityId, id); |
| | | if(userId != null){ |
| | | actSignQuery.eq(ComActActSignDO::getUserId, userId); |
| | | } |
| | | |
| | | ComActActSignDO comActActSignDO = comActActSignDAO.selectOne(actSignQuery); |
| | | if (!ObjectUtils.isEmpty(comActActSignDO)) { |
| | | comActActivityVO.setIsSign(1); |
| | | comActActivityVO.setIsVolunteer(comActActSignDO.getIsVolunteer()); |
| | |
| | | // boolean detailworkguide = !requestURI.contains("workguide/detailworkguide"); |
| | | // boolean pagedynamic = !requestURI.contains("partybuilding/pagedynamic"); |
| | | // boolean infodynamic = !requestURI.contains("partybuilding/infodynamic"); |
| | | |
| | | SafeboxRequestWrapper safeboxRequestWrapper = new SafeboxRequestWrapper(request); |
| | | if (login||doc||css||js||ui||swagger||ico||docs||error||refreshToken||useragreement||wxPay |
| | | ||wxCgi||isShop||listadvertisement||noToken||bigscreen) { |
| | |
| | | safeboxRequestWrapper.addHeader(TokenConstant.TOKEN_USERINFO,hexStr ); |
| | | } |
| | | } else { |
| | | //小程序无需登录也可访问地址列表 |
| | | List<String> noLoginUrl = new ArrayList<>(); |
| | | noLoginUrl.add("/api/applets/community/detaildynamic"); |
| | | noLoginUrl.add("/api/applets/community/detailactivity"); |
| | | if(noLoginUrl.contains(requestURI)){ |
| | | List<SimpleGrantedAuthority> authorities = new ArrayList<>(); |
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS)); |
| | | UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(null, null, authorities); |
| | | SecurityContextHolder.getContext().setAuthentication(authentication); |
| | | }else { |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token校验失败")); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | filterChain.doFilter(safeboxRequestWrapper,response); |
| | | } |
| | | |