| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.dtos.community.PageMemberForInviteDTO; |
| | | import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo; |
| | | import com.panzhihua.common.model.vos.grid.EventGridCommunityAdminVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.partybuilding.ComPbCheckUnitFeign; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingWestService; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Resource |
| | | private PartyBuildingService partyBuildingService; |
| | | @Resource |
| | | private PartyBuildingWestService partyBuildingWestService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private CheckService checkService; |
| | |
| | | return R.fail("类型不能为空"); |
| | | } |
| | | partyBuildingComPbDynVO.setStatus(2); |
| | | return partyBuildingService.pageYnamic(partyBuildingComPbDynVO); |
| | | return partyBuildingWestService.pageYnamic(partyBuildingComPbDynVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询党员活动", response = PageActivityMembersVO.class) |
| | |
| | | @ApiOperation(value = "动态/政策文件详情", response = PartyBuildingComPbDynVO.class) |
| | | @GetMapping("infodynamic") |
| | | public R infoYnamic(@RequestParam("id") Long id) { |
| | | R r = partyBuildingService.infoYnamic(id); |
| | | R r = partyBuildingWestService.infoYnamic(id); |
| | | if (R.isOk(r)) { |
| | | if (ObjectUtils.isEmpty(id) || 0 == id) { |
| | | return R.fail("主键id不能为空"); |
| | |
| | | comPbDynUserVO.setCreateAt(new Date()); |
| | | comPbDynUserVO.setDynId(id); |
| | | comPbDynUserVO.setUserId(userId); |
| | | R r1 = partyBuildingService.addDynUser(comPbDynUserVO); |
| | | R r1 = partyBuildingWestService.addDynUser(comPbDynUserVO); |
| | | if (R.isOk(r1)) { |
| | | partyBuildingComPbDynVO.setIsAdd(1); |
| | | } else { |
| | |
| | | public R addActivityinfo(@RequestBody @Validated(AddGroup.class) ComPbActivityDTO comPbActivityDTO) { |
| | | // 微信内容审核 |
| | | String msg = comPbActivityDTO.getRichText(); |
| | | 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(); |
| | |
| | | @ApiOperation(value = "编辑党员") |
| | | @PutMapping("updatepartybuildingmember") |
| | | public R updatePartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | if (partyBuildingMemberVO.getIsPb() != null) { |
| | | Long id = partyBuildingMemberVO.getId(); |
| | | if (partyBuildingMemberVO.getIsPb() == 1) { |
| | | if (null == id || 0 == id) { |
| | | return partyBuildingService.addPartyBuildingMember(partyBuildingMemberVO); |
| | | } |
| | | return partyBuildingService.updatePartyBuildingMember(partyBuildingMemberVO); |
| | | } |
| | | return partyBuildingService.deleteprepartybuildingmember(id); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区下所有党员报到单位", response = ComPbCheckUnitVo.class) |
| | |
| | | @ApiOperation(value = "新增党员") |
| | | @PostMapping("addpartybuildingmember") |
| | | public R addPartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | Long userId = this.getUserId(); |
| | | partyBuildingMemberVO.setUserId(userId); |
| | | partyBuildingMemberVO.setCommunityId(communityId); |
| | | R r = partyBuildingService.addPartyBuildingMember(partyBuildingMemberVO); |
| | | if (R.isOk(r)) { |
| | | R r1 = userService.updateUserPartyStatus(this.getUserId()); |
| | |
| | | @ApiOperation(value = "分页查询党员列表",response = PartyBuildingMemberVO.class) |
| | | @PostMapping("/page/member") |
| | | public R pageMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | partyBuildingMemberVO.setCommunityId(this.getCommunityId()); |
| | | //partyBuildingMemberVO.setCommunityId(this.getCommunityId()); |
| | | return partyBuildingService.getPagePbMember(partyBuildingMemberVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询注册党员列表",response = PartyBuildingMemberVO.class) |
| | | @PostMapping("/page/registerMember") |
| | | public R pageRegisterMember(@RequestBody PageMemberForInviteDTO pageMemberForInviteDTO) { |
| | | pageMemberForInviteDTO.setAppid(this.getAppId()); |
| | | return partyBuildingService.pageRegisterMember(pageMemberForInviteDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询所有社区列表", response = EventGridCommunityAdminVO.class) |
| | |
| | | @ApiOperation(value = "查询当前用户党员信息") |
| | | @GetMapping("/getPartyMember") |
| | | public R getPartyMember(@RequestParam("type")Integer type){ |
| | | return partyBuildingService.getPartyMember(this.getUserId(),type); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (StrUtil.isEmpty(loginUserInfo.getPhone())){ |
| | | return R.fail("请先实名认证"); |
| | | } |
| | | return partyBuildingService.getPartyMember(loginUserInfo.getPhone(),type); |
| | | } |
| | | @ApiOperation(value = "查询报道单位详情") |
| | | @GetMapping("/comPbCheckUnit/detailByPhone") |
| | | public R detailById(@RequestParam("phone") String phone) { |
| | | return partyBuildingService.detailByPhone(phone); |
| | | } |
| | | @ApiOperation(value = "党员详情",response =PartyBuildingMemberVO.class) |
| | | @GetMapping("/memberDetail") |
| | | public R memberDetail(@RequestParam("id")Long id){ |
| | | return partyBuildingService.memberDetail(id); |
| | | } |
| | | } |