New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ActivitySignUpDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党群服务 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-02 16:19 |
| | | **/ |
| | | @RestController |
| | | @RequestMapping("/partybuilding/") |
| | | @Api(tags = {"党群服务"}) |
| | | public class PartyBuildingApi extends BaseController { |
| | | @Resource |
| | | private PartyBuildingService partyBuildingService; |
| | | |
| | | @ApiOperation(value = "分页党建动态/政策文件",response =PartyCommitteeVO.class ) |
| | | @PostMapping("pagedynamic") |
| | | public R pageYnamic(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO){ |
| | | Long communityId = this.getCommunityId(); |
| | | Integer type = partyBuildingComPbDynVO.getType(); |
| | | if (ObjectUtils.isEmpty(type)) { |
| | | return R.fail("类型不能为空"); |
| | | } |
| | | partyBuildingComPbDynVO.setCommunityId(communityId); |
| | | return partyBuildingService.pageYnamic(partyBuildingComPbDynVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询党员活动",response = PageActivityMembersVO.class) |
| | | @PostMapping("pageactivity") |
| | | public R pageActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | partyBuildingActivityVO.setCommunityId(communityId); |
| | | return partyBuildingService.pageActivity(partyBuildingActivityVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "动态/政策文件详情",response =PartyBuildingComPbDynVO.class ) |
| | | @GetMapping("infodynamic") |
| | | public R infoYnamic(@RequestParam("id") Long id) { |
| | | return partyBuildingService.infoYnamic(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加阅读记录") |
| | | @PostMapping("adddynuser") |
| | | public R addDynUser(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO) { |
| | | Long id = partyBuildingComPbDynVO.getId(); |
| | | if (ObjectUtils.isEmpty(id)||0==id) { |
| | | return R.fail("主键id不能为空"); |
| | | } |
| | | Long userId = this.getUserId(); |
| | | ComPbDynUserVO comPbDynUserVO=new ComPbDynUserVO(); |
| | | comPbDynUserVO.setCreateAt(new Date()); |
| | | comPbDynUserVO.setDynId(id); |
| | | comPbDynUserVO.setUserId(userId); |
| | | return partyBuildingService.addDynUser(comPbDynUserVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页党委查询",response =PartyCommitteeVO.class ) |
| | | @PostMapping("pagepartycommittee") |
| | | public R pagePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO) { |
| | | Long communityId =this.getCommunityId(); |
| | | partyCommitteeVO.setCommunityId(communityId); |
| | | return partyBuildingService.pagePartyCommittee(partyCommitteeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动详情",response = PartyBuildingActivityVO.class) |
| | | @GetMapping("activityinfo") |
| | | public R activityinfo(@RequestParam("id") Long id) { |
| | | Long userId = this.getUserId(); |
| | | return partyBuildingService.activityinfo(id,userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "党员活动人员参入列表",response = PartyBuildingMemberVO.class) |
| | | @GetMapping("listpartybuildingmember") |
| | | public R listPartyBuildingMember(@RequestParam("id") Long id) { |
| | | return partyBuildingService.listPartyBuildingMember(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "报名、取消报名党员活动") |
| | | @PutMapping("activitysignup") |
| | | public R putActivitySignUp(@RequestBody @Validated ActivitySignUpDTO activitySignUpDTO) { |
| | | activitySignUpDTO.setUserId(this.getUserId()); |
| | | return partyBuildingService.putActivitySignUp(activitySignUpDTO); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |