| | |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.*; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComEldersAuthHistoryRecordMapper; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationDAO; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private EldersAuthService eldersAuthService; |
| | | @Resource |
| | | public ComMngPopulationDAO comMngPopulationDAO; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | @Resource |
| | | public ComEldersAuthUserService comEldersAuthUserService; |
| | | @Resource |
| | |
| | | * @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("活动不存在"); |
| | |
| | | */ |
| | | @PostMapping("putdynamic") |
| | | public R putDynamic(@RequestBody ComActDynVO comActDynVO) { |
| | | ComActDynDO comActDynDO = new ComActDynDO(); |
| | | Long id = comActDynVO.getId(); |
| | | BeanUtils.copyProperties(comActDynVO, comActDynDO); |
| | | ComActDynDO comActDynDO = comActDynService.getById(comActDynVO.getId()); |
| | | if(comActDynDO == null){ |
| | | return R.fail("未查到社区动态记录"); |
| | | } |
| | | // Long id = comActDynVO.getId(); |
| | | Integer isTopping = comActDynVO.getIsTopping(); |
| | | boolean b = isTopping.intValue() == 1; |
| | | boolean b = isTopping.equals(1); |
| | | if(b){ |
| | | ComActDynDO comActDynDO1 = comActDynService.getById(id); |
| | | Integer status = comActDynDO1.getStatus(); |
| | | if (status.intValue()==0) { |
| | | return R.fail("该动态还未发布"); |
| | | Integer status = comActDynDO.getStatus(); |
| | | if (status.equals(0)) { |
| | | return R.fail("待发布的社区动态不可置顶"); |
| | | } |
| | | } |
| | | |
| | | // if(StringUtils.isEmpty(comActDynVO.getCover())){ |
| | | // comActDynVO.setCover(comActDynDO.getCover()); |
| | | // } |
| | | BeanUtils.copyProperties(comActDynVO, comActDynDO); |
| | | |
| | | boolean update = comActDynService.updateById(comActDynDO); |
| | | if (update) { |
| | | // 最多只能设置三条置顶状态,后边设置会取消先前设置的置顶 |
| | |
| | | if (R.isOk(r1)) { |
| | | log.info("新增用户报名党建活动通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } |
| | | |
| | | //用户高龄认证反馈,推送订阅消息给用户 |
| | | Map<String,String> map = comActActSignDAO.getUserOpenId(eldersAuthDO.getSumitUserId()); |
| | | if(map != null){ |
| | | String openid = map.get("openid"); |
| | | try { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | String accessToken = util.getAppAccessToken(); |
| | | WxUtil.sendSubscribeRZSH(openid,accessToken,"高龄认证" |
| | | ,DateUtils.format(eldersAuthDO.getCreateAt(),DateUtils.ymdhms_format),eldersAuthFeedbackAddDTO.getFeedBack()); |
| | | }catch (Exception e){ |
| | | log.error("推送审核状态订阅消息失败,失败原因:" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | return addR; |
| | | } |
| | | |
| | |
| | | public R readUserReward(@RequestParam("userId") Long userId,@RequestParam("communityId") Long communityId) { |
| | | return comActEasyPhotoService.readUserReward(userId,communityId); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务检测即将开始的社区活动,并使用订阅消息通知用户 |
| | | */ |
| | | @PostMapping("timedTaskActivityNotice") |
| | | public R timedTaskActivityNotice(){ |
| | | return comActActivityService.timedTaskActivityNotice(); |
| | | } |
| | | |
| | | |
| | | } |