| | |
| | | |
| | | import static java.util.stream.Collectors.toList; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.applets.umf.UmfPayUtil; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.HttpStatus; |
| | | import com.panzhihua.common.model.dtos.community.social.PageProjectDTO; |
| | | import com.panzhihua.common.model.vos.community.rentHouse.WxPayOrderVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | comActActRegistVOS.forEach(activitySignInVO -> { |
| | | if (comActActivityVO.getId().equals(activitySignInVO.getActivityId())) { |
| | | currentList.add(activitySignInVO); |
| | | comActActivityVO.setIsComment(1); |
| | | comActActivityVO.setTimes(comActActivityVO.getTimes()+1); |
| | | if(activitySignInVO.getEndTime()!=null){ |
| | | comActActivityVO.setIsComment(1); |
| | | if(comActActivityVO.getTimes()==null){ |
| | | comActActivityVO.setTimes(1); |
| | | comActActivityVO.setAward(activitySignInVO.getAward()); |
| | | } |
| | | else { |
| | | comActActivityVO.setTimes(comActActivityVO.getTimes()+1); |
| | | comActActivityVO.setAward(comActActivityVO.getAward() + activitySignInVO.getAward()); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | if (currentList.size() > 10) { |
| | | comActActivityVO.setActivitySignInList(currentList.subList(0, 10)); |
| | | } else { |
| | | comActActivityVO.setActivitySignInList(currentList); |
| | | } |
| | | Integer limit = comActActivityVO.getLimit(); |
| | | if(limit != null && limit>0 &¤tList.size()>0){ |
| | | if(limit==currentList.size()&¤tList.get(currentList.size()-1).getEndTime()!=null){ |
| | | comActActivityVO.setIsRegist(1); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | |
| | | public R addFeedback(@RequestBody @Validated(AddGroup.class) SysUserFeedbackDTO sysUserFeedbackDTO) { |
| | | // 微信内容审核 |
| | | String msg = sysUserFeedbackDTO.getContent(); |
| | | if (!checkService.checkMessage(msg)) { |
| | | return R.fail("内容违规"); |
| | | if (StrUtil.isNotBlank(msg)) { |
| | | String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | |
| | | userArchivesVO.setUserId(userId); |
| | | return userService.updateUserArchives(userArchivesVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询用户报名的项目") |
| | | @PostMapping("project") |
| | | public R pageProjectWhichIsSignedByUser(@RequestBody @Valid PageProjectDTO pageProjectDTO) { |
| | | pageProjectDTO.setUserId(this.getUserId()); |
| | | return communityService.pageProjectWhichIsSignedByUser(pageProjectDTO); |
| | | } |
| | | |
| | | @ApiOperation("获取用户") |
| | | @GetMapping("selectAutomessageSysUserById") |
| | | public R selectAutomessageSysUserById(@RequestParam("id")Long id){ |
| | | return communityService.selectAutomessageSysUserById(id); |
| | | } |
| | | |
| | | @ApiOperation("新增投诉建议或问题留言") |
| | | @PostMapping("addFeedBack") |
| | | public R addFeedBack(@RequestBody SysUserFeedbackDTO sysUserFeedbackDTO){ |
| | | sysUserFeedbackDTO.setCommunityId(null); |
| | | return userService.addFeedback(sysUserFeedbackDTO); |
| | | } |
| | | |
| | | @ApiOperation("查看自己的投诉建议或问题留言记录") |
| | | @GetMapping("myFeedBack") |
| | | public R myFeedBack(@ApiParam("类型:1问题留言2投诉建议") @RequestParam(value = "type",required = false)Integer type,@RequestParam("propertyId")Long propertyId){ |
| | | return userService.myFeedBack(this.getLoginUserInfo().getUserId(),type,propertyId); |
| | | } |
| | | |
| | | } |