| | |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.social.PageProjectSignListDTO; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActSocialOrgVO; |
| | | import com.panzhihua.common.model.vos.community.social.SocialProjectVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * 三社联动项目表(ComActSocialProject)表控制层 |
| | |
| | | @ApiOperation(value = "分页查询接口",response =SocialProjectVO.class ) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | LoginUserInfoVO loginUserInfoSureNoLogin = this.getLoginUserInfoSureNoLogin(); |
| | | if (nonNull(loginUserInfoSureNoLogin)) { |
| | | commonPage.setCommunityId(loginUserInfoSureNoLogin.getCommunityId()); |
| | | } else if (isNull(commonPage.getCommunityId())) { |
| | | return R.fail("缺少社区id"); |
| | | } |
| | | commonPage.setParamId2(0); |
| | | commonPage.setIsPublicity(1); |
| | | return communityService.selectAllComActSocialProject(commonPage); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "平台详情接口",response =SocialProjectVO.class ) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.getAppletComActSocialProject(id); |
| | | LoginUserInfoVO userInfo = this.getLoginUserInfoSureNoLogin(); |
| | | Long userId = null; |
| | | if (nonNull(userInfo)) { |
| | | userId = userInfo.getUserId(); |
| | | } |
| | | return communityService.getAppletComActSocialProject(id, userId); |
| | | } |
| | | /** |
| | | * 根据项目id分页获取关联项目 |
| | |
| | | return communityService.deleteComActSocialProject(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "项目公开报名") |
| | | @ApiImplicitParam(name = "projectId", value = "项目id", required = true) |
| | | @GetMapping("/sign") |
| | | public R signProject(@RequestParam("projectId") Long projectId) { |
| | | return communityService.signProject(projectId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询项目报名列表", response = ComActSocialOrgVO.class) |
| | | @PostMapping("signList") |
| | | public R pageProjectSignList(@RequestBody @Valid PageProjectSignListDTO pageProjectSignListDTO) { |
| | | return communityService.pageProjectSignList(pageProjectSignListDTO); |
| | | } |
| | | } |