| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.model.vos.community.MyActivityEvaluateVO; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | 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 com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.ComMngCarAppletDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageVolunteerDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignInRecordVO; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngCarVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngAppletsVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PageGroup; |
| | | |
| | | import io.swagger.annotations.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | |
| | | return communityService.activityEvaluate(comActActEvaluateVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的评价", response = MyActivityEvaluateVO.class) |
| | | @GetMapping("activity/my-evaluate") |
| | | public R listMyActivityEvaluate(@RequestParam("activityId") Long activityId) { |
| | | return communityService.listMyActivityEvaluate(getUserId(), activityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "报名/取消报名社区活动") |
| | | @PutMapping("signactivity") |
| | | public R signActivity(@RequestBody @Validated(AddGroup.class) SignactivityVO signactivityVO) { |
| | | Long userId = this.getUserId(); |
| | | Long activityId = signactivityVO.getActivityId(); |
| | | Integer isVolunteer = signactivityVO.getIsVolunteer(); |
| | | signactivityVO.setUserId(userId); |
| | | R r = communityService.signActivity(signactivityVO); |
| | | if (R.isOk(r) && signactivityVO.getType().intValue() == 1) { |
| | | R r2 = communityService.detailActivity(activityId, userId,null,null); |
| | | ComActActivityVO comActActivityVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r2.getData()), ComActActivityVO.class); |
| | | Integer isVolunteer = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), Integer.class); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(1); |
| | |
| | | } |
| | | if (type.intValue() == 1) { |
| | | return communityService.listSignInRecord(id); |
| | | } else { |
| | | return partyBuildingService.listSignInRecord(id); |
| | | } |
| | | return R.fail("type不存在"); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动签到记录", response = ComActActRegistVO.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "社区活动主键", required = true), |
| | | @ApiImplicitParam(name = "type", value = "活动类型,1.居民/志愿者活动 2.党员活动", required = true), |
| | | @ApiImplicitParam(name = "userId", value = "用户id", required = true) |
| | | @ApiImplicitParam(name = "id", value = "活动主键", required = true), |
| | | @ApiImplicitParam(name = "type", value = "活动类型,1.居民/志愿者活动 2.党员活动", required = true) |
| | | }) |
| | | @GetMapping("activity/regist/list") |
| | | public R listRegistRecord(@RequestParam("id") Long id, |
| | | @RequestParam("type") Integer type, |
| | | @RequestParam("userId") Long userId) { |
| | | @RequestParam("type") Integer type) { |
| | | if (type.intValue() == 1) { |
| | | return communityService.listRegistRecord(id, userId); |
| | | } else { |
| | | return partyBuildingService.listRegistRecord(id, userId); |
| | | return communityService.listRegistRecord(id, this.getUserId()); |
| | | } |
| | | return R.fail("type不存在"); |
| | | } |
| | | |
| | | // @ApiOperation(value = "新增社区动态浏览记录") |