New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.constants.NeighborCircleConstants; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleDetailAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyAppVO; |
| | | import com.panzhihua.common.service.community.CommunityWestService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:49 |
| | | * @describe 邻里圈模块API |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/neighborWest/") |
| | | @Api(tags = {"邻里圈服务"}) |
| | | public class NeighborWestApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityWestService communityWestService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | |
| | | @ApiOperation(value = "分页查询邻里圈列表", response = ComActNeighborCircleAppVO.class) |
| | | @PostMapping("pageApp") |
| | | public R pageNeighborByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | neighborCircleAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | neighborCircleAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | return communityWestService.pageNeighborByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户发布邻里圈审核") |
| | | @PostMapping("addNeighborByApp") |
| | | public R addNeighborByApp(@RequestBody AddComActNeighborCircleAppDTO addNeighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | Long userId = loginUser.getUserId(); |
| | | Long communityId = loginUser.getCommunityId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登录"); |
| | | } |
| | | addNeighborCircleAppDTO.setUserId(userId); |
| | | if (StringUtils.isNotEmpty(loginUser.getPhone())) { |
| | | addNeighborCircleAppDTO.setPhone(this.getLoginUserInfo().getPhone()); |
| | | } |
| | | if(communityId != null){ |
| | | addNeighborCircleAppDTO.setCommunityId(communityId); |
| | | } |
| | | |
| | | //查询社区自动审核是否开着 |
| | | String key = NeighborCircleConstants.NEIGHBOR_CIRCLE_AUTO_EXAMINE; |
| | | R isOk = communityWestService.getSysConfValue(key + communityId,communityId); |
| | | if(R.isOk(isOk)){ |
| | | if(isOk.getData() != null){ |
| | | String value = isOk.getData().toString(); |
| | | if(value.equals("1")){ |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | String msg = addNeighborCircleAppDTO.getReleaseContent(); |
| | | if (checkService.checkMessage(msg)) { |
| | | addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | }else{ |
| | | addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | } |
| | | }else{ |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } |
| | | }else{ |
| | | communityWestService.addSysConfValue(key + communityId,communityId,"社区邻里圈自动审核参数","1"); |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | } |
| | | }else{ |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } |
| | | |
| | | return communityWestService.addNeighborByApp(addNeighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询邻里圈详情", response = ComActNeighborCircleDetailAppVO.class) |
| | | @PostMapping("detail") |
| | | public R neighborDetailByApp(@RequestBody ComActNeighborCircleDetailAppDTO neighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | neighborCircleAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | // Long userId = this.getLoginUserInfo().getUserId(); |
| | | // if(userId == null){ |
| | | // return R.fail("请先登录"); |
| | | // } |
| | | // neighborCircleAppDTO.setUserId(userId); |
| | | return communityWestService.neighborDetailByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询用户邻里圈审核列表", response = ComActNeighborCircleAppVO.class) |
| | | @PostMapping("user/page") |
| | | public R neighborExamineByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | neighborCircleAppDTO.setUserId(userId); |
| | | return communityWestService.neighborExamineByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈点赞") |
| | | @PostMapping("fabulous") |
| | | public R neighborFabulousByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | fabulousAppDTO.setUserId(userId); |
| | | return communityWestService.neighborFabulousByApp(fabulousAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈转发") |
| | | @PostMapping("forward") |
| | | public R neighborForwardByApp(@RequestBody ComActNeighborForwardAppDTO forwardAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | forwardAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | // Long userId = this.getLoginUserInfo().getUserId(); |
| | | // if(userId == null){ |
| | | // return R.fail("请先登录"); |
| | | // } |
| | | // forwardAppDTO.setUserId(userId); |
| | | return communityWestService.neighborForwardByApp(forwardAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈评论") |
| | | @PostMapping("comment") |
| | | public R neighborCommentByApp(@RequestBody ComActNeighborCommentAppDTO commentAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | commentAppDTO.setUserId(userId); |
| | | return communityWestService.neighborCommentByApp(commentAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈回复") |
| | | @PostMapping("reply") |
| | | public R neighborReplyByApp(@RequestBody ComActNeighborReplyAppDTO replyAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | replyAppDTO.setUserId(userId); |
| | | return communityWestService.neighborReplyByApp(replyAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈取消点赞") |
| | | @PostMapping("cancel/fabulous") |
| | | public R neighborFabulousCancelByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | fabulousAppDTO.setUserId(userId); |
| | | return communityWestService.neighborFabulousCancelByApp(fabulousAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈添加浏览记录") |
| | | @PostMapping("add/browse") |
| | | public R neighborAddBrowseByApp(@RequestBody ComActNeighborAddBrowseAppDTO addBrowseAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | addBrowseAppDTO.setUserId(userId); |
| | | return communityWestService.neighborAddBrowseByApp(addBrowseAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询评论下所有回复", response = ComActNeighborCommentReplyAppVO.class) |
| | | @PostMapping("comment/reply") |
| | | public R neighborCommentReplyByApp(@RequestBody ComActNeighborCommentReplyAppDTO commentReplyAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | commentReplyAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | // Long userId = this.getLoginUserInfo().getUserId(); |
| | | // if(userId == null){ |
| | | // return R.fail("请先登录"); |
| | | // } |
| | | // commentReplyAppDTO.setUserId(userId); |
| | | return communityWestService.neighborCommentReplyByApp(commentReplyAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区邻里圈话题列表", response = ComActNeighborCircleTopicAppVO.class) |
| | | @GetMapping("topic/list") |
| | | public R getNeighborTopicByApp(@RequestParam("communityId") Long communityId |
| | | ,@RequestParam(value = "isZero",defaultValue = "2",required = false) Integer isZero |
| | | ,@RequestParam(value = "name",defaultValue = "",required = false) String name) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | if(isZero == null){ |
| | | isZero = 2; |
| | | } |
| | | return communityWestService.getNeighborTopicByApp(communityId,isZero,name); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户新增邻里圈话题") |
| | | @PostMapping("topic/add") |
| | | public R addNeighborTopicByApp(@RequestBody AddNeighborCircleTopicAppDTO circleTopicAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail(401,"请先登录"); |
| | | } |
| | | circleTopicAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | circleTopicAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityWestService.addNeighborTopicByApp(circleTopicAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户删除邻里圈") |
| | | @PostMapping("delete") |
| | | public R deleteNeighborByApp(@RequestBody DeleteNeighborCircleAppDTO circleTopicAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail(401,"请先登录"); |
| | | } |
| | | circleTopicAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | circleTopicAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityWestService.deleteNeighborByApp(circleTopicAppDTO); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.service.partybuilding.ComPbCheckUnitFeign; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ActivitySignUpDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComListPartyDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComPbActivityDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComPbServiceTeamDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingWestService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党群服务 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-02 16:19 |
| | | **/ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/partybuildingWest/") |
| | | @Api(tags = {"党群服务"}) |
| | | public class PartyBuildingWestApi extends BaseController { |
| | | @Resource |
| | | private PartyBuildingWestService partyBuildingWestService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | @Resource |
| | | private ComPbCheckUnitFeign pbCheckUnitFeign; |
| | | |
| | | public static void main(String[] args) { |
| | | Date date = new Date(); |
| | | String dateFormat = String.format("%tF %tT ", date, date); |
| | | System.out.println(dateFormat); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页党建动态/政策文件", response = PartyBuildingComPbDynVO.class) |
| | | @PostMapping("pagedynamic") |
| | | public R pageYnamic(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | partyBuildingComPbDynVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | Integer type = partyBuildingComPbDynVO.getType(); |
| | | if (ObjectUtils.isEmpty(type)) { |
| | | return R.fail("类型不能为空"); |
| | | } |
| | | partyBuildingComPbDynVO.setStatus(2); |
| | | return partyBuildingWestService.pageYnamic(partyBuildingComPbDynVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询党员活动", response = PageActivityMembersVO.class) |
| | | @PostMapping("pageactivity") |
| | | public R pageActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | partyBuildingActivityVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | // Long communityId = this.getCommunityId(); |
| | | // partyBuildingActivityVO.setCommunityId(communityId); |
| | | Integer status = partyBuildingActivityVO.getStatus(); |
| | | if (null != status && status.intValue() == 4) { |
| | | partyBuildingActivityVO.setIsAppliets(1); |
| | | } |
| | | return partyBuildingWestService.pageActivity(partyBuildingActivityVO); |
| | | } |
| | | |
| | | // @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 = PartyBuildingComPbDynVO.class) |
| | | @GetMapping("infodynamic") |
| | | public R infoYnamic(@RequestParam("id") Long id) { |
| | | R r = partyBuildingWestService.infoYnamic(id); |
| | | if (R.isOk(r)) { |
| | | if (ObjectUtils.isEmpty(id) || 0 == id) { |
| | | return R.fail("主键id不能为空"); |
| | | } |
| | | Long userId = null; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | |
| | | PartyBuildingComPbDynVO partyBuildingComPbDynVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r.getData()), PartyBuildingComPbDynVO.class); |
| | | if (userId != null) { |
| | | ComPbDynUserVO comPbDynUserVO = new ComPbDynUserVO(); |
| | | comPbDynUserVO.setCreateAt(new Date()); |
| | | comPbDynUserVO.setDynId(id); |
| | | comPbDynUserVO.setUserId(userId); |
| | | R r1 = partyBuildingWestService.addDynUser(comPbDynUserVO); |
| | | if (R.isOk(r1)) { |
| | | partyBuildingComPbDynVO.setIsAdd(1); |
| | | } else { |
| | | partyBuildingComPbDynVO.setIsAdd(0); |
| | | } |
| | | } else { |
| | | partyBuildingComPbDynVO.setIsAdd(0); |
| | | } |
| | | return R.ok(partyBuildingComPbDynVO); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "分页党委查询", response = PartyCommitteeVO.class) |
| | | @PostMapping("pagepartycommittee") |
| | | public R pagePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO) { |
| | | // Long communityId =this.getCommunityId(); |
| | | // partyCommitteeVO.setCommunityId(communityId); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | partyCommitteeVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | return partyBuildingWestService.pagePartyCommittee(partyCommitteeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动详情", response = PartyBuildingActivityVO.class) |
| | | @GetMapping("activityinfo") |
| | | public R activityinfo(@RequestParam("id") Long id) { |
| | | Long userId = this.getUserId(); |
| | | return partyBuildingWestService.activityinfo(id, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "党员活动人员参入列表", response = PartyBuildingMemberVO.class) |
| | | @GetMapping("listpartybuildingmember") |
| | | public R listPartyBuildingMember(@RequestParam("id") Long id) { |
| | | return partyBuildingWestService.listPartyBuildingMember(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "报名、取消报名党员活动") |
| | | @PutMapping("activitysignup") |
| | | public R putActivitySignUp(@RequestBody @Validated ActivitySignUpDTO activitySignUpDTO) { |
| | | Long userId = this.getUserId(); |
| | | activitySignUpDTO.setUserId(userId); |
| | | Long id = activitySignUpDTO.getId(); |
| | | R r = partyBuildingWestService.putActivitySignUp(activitySignUpDTO); |
| | | if (R.isOk(r) && activitySignUpDTO.getType().intValue() == 1) { |
| | | R r2 = partyBuildingWestService.activityinfo(id, userId); |
| | | PartyBuildingActivityVO partyBuildingActivityVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r2.getData()), PartyBuildingActivityVO.class); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(1); |
| | | sysUserNoticeVO.setTitle("报名成功"); |
| | | sysUserNoticeVO.setBusinessType(2); |
| | | sysUserNoticeVO.setBusinessTitle(partyBuildingActivityVO.getName()); |
| | | Date activityTimeBegin = partyBuildingActivityVO.getActivityTimeBegin(); |
| | | sysUserNoticeVO |
| | | .setBusinessContent(String.format("活动将于 %tF %tT 开始,请按时参加", activityTimeBegin, activityTimeBegin)); |
| | | sysUserNoticeVO.setBusinessId(id); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r1 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r1)) { |
| | | log.info("新增用户报名党建活动通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "创建党员活动") |
| | | @PostMapping("activityinfo") |
| | | public R addActivityinfo(@RequestBody @Validated(AddGroup.class) ComPbActivityDTO comPbActivityDTO) { |
| | | // 微信内容审核 |
| | | String msg = comPbActivityDTO.getRichText(); |
| | | if (!checkService.checkMessage(msg)) { |
| | | return R.fail("内容违规"); |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | comPbActivityDTO.setCreateBy(userId); |
| | | comPbActivityDTO.setCommunityId(communityId); |
| | | Date date = new Date(); |
| | | comPbActivityDTO.setReleaseTime(date); |
| | | Date activityTimeBegin = comPbActivityDTO.getActivityTimeBegin(); |
| | | Date activityTimeEnd = comPbActivityDTO.getActivityTimeEnd(); |
| | | boolean before = activityTimeEnd.before(activityTimeBegin); |
| | | if (before) { |
| | | return R.fail("活动结束时间不能早于开始时间"); |
| | | } |
| | | // 1 待发布 2 未开始 3 报名中 4 进行中 5 已结束 6 已取消 |
| | | int status = 2; |
| | | Date enrollTimeBegin = comPbActivityDTO.getEnrollTimeBegin(); |
| | | Date enrollTimeEnd = comPbActivityDTO.getEnrollTimeEnd(); |
| | | if (enrollTimeEnd.before(enrollTimeBegin)) { |
| | | return R.fail("报名结束时间不能早于报名开始时间"); |
| | | } |
| | | if (enrollTimeBegin.before(date)) { |
| | | status = 3; |
| | | } |
| | | comPbActivityDTO.setStatus(status); |
| | | return partyBuildingWestService.addActivityApplets(comPbActivityDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询服务团队成员", response = ComPbServiceTeamVO.class) |
| | | @PostMapping("pageserviceteam") |
| | | public R pageServiceTeam(@RequestBody PageComPbServiceTeamDTO pageComPbServiceTeamDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | pageComPbServiceTeamDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | // pageComPbServiceTeamDTO.setCommunityId(this.getCommunityId()); |
| | | return partyBuildingWestService.pageServiceTeam(pageComPbServiceTeamDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区所有启用的党组织列表", response = PartyOrganizationVO.class) |
| | | @PostMapping("listpartyorganization") |
| | | public R listPartyOrganization(@RequestBody ComListPartyDTO comListPartyDTO) { |
| | | // Long communityId = this.getCommunityId(); |
| | | // log.info("社区所有党组织社区id【{}】", communityId); |
| | | // if(communityId != null){ |
| | | // comListPartyDTO.setCommunityId(communityId); |
| | | // } |
| | | return partyBuildingWestService.listPartyOrganizationByApp(comListPartyDTO); |
| | | } |
| | | |
| | | @OperLog(operModul = "党员管理", operType = 2) |
| | | @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 partyBuildingWestService.addPartyBuildingMember(partyBuildingMemberVO); |
| | | } |
| | | return partyBuildingWestService.updatePartyBuildingMember(partyBuildingMemberVO); |
| | | } |
| | | return partyBuildingWestService.deleteprepartybuildingmember(id); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区下所有党员报到单位", response = ComPbCheckUnitVo.class) |
| | | @PostMapping("/comPbCheckUnit/list") |
| | | public R getPbCheckUnitList(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) { |
| | | if(comPbCheckUnit.getCommunityId() == null){ |
| | | comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | } |
| | | return pbCheckUnitFeign.queryByList(comPbCheckUnit); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty("预计服务时长") |
| | | private String targetServiceTime; |
| | | |
| | | private String topicName; |
| | | |
| | | /** |
| | | * 使用类型(1.邻里圈 2.问题清单 3.需求清单) |
| | | */ |
| | |
| | | @ApiModelProperty("排序") |
| | | private Integer sort; |
| | | |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 使用类型(1.邻里圈 2.问题清单 3.需求清单) |
| | | */ |
| | |
| | | @ApiModelProperty("使用类型(1.邻里圈 2.问题清单 3.需求清单)") |
| | | private Integer belongType; |
| | | |
| | | private Long communityId; |
| | | /** |
| | | * 使用类型(1.邻里圈 2.问题清单 3.需求清单) |
| | | */ |
| | |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | private String areaCode; |
| | | } |
| | |
| | | private String phone; |
| | | @ApiModelProperty("是否注册") |
| | | private Integer isReg; |
| | | |
| | | private Long streetId; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("归属区") |
| | | private String belongTo; |
| | | |
| | | private String areaCode; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.service.partybuilding; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleExcelVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import com.panzhihua.common.model.dtos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党建 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 09:50 |
| | | **/ |
| | | @FeignClient(value = "partybuilding") |
| | | public interface PartyBuildingWestService { |
| | | /** |
| | | * 新增党员 |
| | | * |
| | | * @param partyBuildingMemberVO |
| | | * 党员基本信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/addpartybuildingmember") |
| | | R addPartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 社区所有启用的党组织列表 |
| | | * |
| | | * @return 党组织集合 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/listpartyorganization") |
| | | R listPartyOrganization(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 分页查询所有的党组织列表 |
| | | * |
| | | * @return 党组织集合 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/listpartyorganizationAll") |
| | | R listPartyOrganizationAll(@RequestBody PartyOrganizationVO partyOrganizationVO); |
| | | |
| | | /** |
| | | * 查询所有党组织列表 |
| | | * @param partyOrganizationVO 请求参数 |
| | | * @return 党组织列表 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/getPbOrgAllList") |
| | | R getPbOrgAllList(@RequestBody PartyOrganizationVO partyOrganizationVO); |
| | | |
| | | /** |
| | | * 新增党支部 |
| | | * |
| | | * @param partyOrganizationVO |
| | | * 党支部基本信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/addpartyorganization") |
| | | R addPartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO); |
| | | |
| | | /** |
| | | * 编辑党支部 |
| | | * |
| | | * @param partyOrganizationVO |
| | | * 党支部基本信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/updatepartyorganization") |
| | | R updatePartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO); |
| | | |
| | | /** |
| | | * 启用,禁用党支部 |
| | | * |
| | | * @param partyOrganizationVO |
| | | * 党支部基本信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/resetpartyorganization") |
| | | R resetPartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO); |
| | | |
| | | /** |
| | | * 删除党支部 |
| | | * |
| | | * @param partyOrganizationVO |
| | | * 党支部基本信息 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/deletepartyorganization") |
| | | R deletePartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO); |
| | | |
| | | /** |
| | | * 批量新增党员 |
| | | * |
| | | * @param list |
| | | * 党员集合 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/listsavepartybuildingmemberexcelvo") |
| | | R listSavePartyBuildingMemberExcelVO(@RequestBody List<PartyBuildingMemberExcelVO> list); |
| | | |
| | | /** |
| | | * 分页查询党员信息 |
| | | * |
| | | * @param pagePartyOrganizationVO |
| | | * 查询信息 |
| | | * @return 分页数据 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/pagepartyorganization") |
| | | R pagePartyOrganization(@RequestBody PagePartyOrganizationVO pagePartyOrganizationVO); |
| | | |
| | | /** |
| | | * 导出党员信息 |
| | | * |
| | | * @param pagePartyOrganizationVO |
| | | * 查询信息 |
| | | * @return 分页数据 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/exportPartyMember") |
| | | R exportPartyMember(@RequestBody PagePartyOrganizationVO pagePartyOrganizationVO); |
| | | |
| | | /** |
| | | * 党员活动 |
| | | * |
| | | * @param partyBuildingActivityVO |
| | | * 党员活动查询参数 |
| | | * @return 参加的所有活动 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/listpartymemberactivities") |
| | | R listPartyMemberActivities(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO); |
| | | |
| | | /** |
| | | * 活动报名名单分页查询 |
| | | * |
| | | * @param pageActivityMembersVO |
| | | * 查询参数 手机号 名字 |
| | | * @return 分页数据 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/pageactivitymembers") |
| | | R pageActivityMembers(@RequestBody PageActivityMembersVO pageActivityMembersVO); |
| | | |
| | | /** |
| | | * 编辑党员信息 新增字段均可编辑 |
| | | * |
| | | * @param partyBuildingMemberVO |
| | | * 编辑字段 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/updatepartybuildingmember") |
| | | R updatePartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 党员活动详情 |
| | | * |
| | | * @param id |
| | | * 活动id |
| | | * @return 活动详情内容 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/activityinfo") |
| | | R activityinfo(@RequestParam("id") Long id, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 查询指定社区的所有党员 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党员列表 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/listPartyMember") |
| | | R listPartyMember(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 社区下拉选择身份 |
| | | * |
| | | * @return 身份集合 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/listidentity") |
| | | R listIdentity(); |
| | | |
| | | /** |
| | | * 新增党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 新增信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/addpartycommittee") |
| | | R addPartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 编辑党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 编辑信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/updatepartycommittee") |
| | | R updatePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 删除党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 删除id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/deletepartycommittee") |
| | | R deletePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 分页社区党委查询 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/pagepartycommittee") |
| | | R pagePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 新建党建动态 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 动态内容 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/adddynamic") |
| | | R adddYnamic(@RequestBody PartyBuildingComPbDynVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 编辑动态 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/updatedynamic") |
| | | R updateYnamic(@RequestBody PartyBuildingComPbDynVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 动态详情 |
| | | * |
| | | * @param id |
| | | * 动态主键 |
| | | * @return 详情 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/infodynamic") |
| | | R infoYnamic(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 分页查询党员动态/政策文件 |
| | | * |
| | | * @param partyBuildingComPbDynVO |
| | | * 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/pagedynamic") |
| | | R pageYnamic(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO); |
| | | |
| | | /** |
| | | * 删除动态 |
| | | * |
| | | * @param id |
| | | * 动态主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/deletedynamic") |
| | | R deleteYnamic(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 新增党员活动 |
| | | * |
| | | * @param partyBuildingActivityVO |
| | | * 参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/addactivity") |
| | | R addactivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO); |
| | | |
| | | /** |
| | | * 编辑党员活动 |
| | | * |
| | | * @param partyBuildingActivityVO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/updateactivity") |
| | | R updateActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO); |
| | | |
| | | /** |
| | | * 发布党员活动 |
| | | * |
| | | * @param id |
| | | * 主键id |
| | | * @return 发布结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/releaseactivity") |
| | | R releaseActivity(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 删除党员活动 |
| | | * |
| | | * @param id |
| | | * 主键id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/deleteactivity") |
| | | R deleteActivity(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 分页查询党员活动 |
| | | * |
| | | * @param partyBuildingActivityVO |
| | | * 查询条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/pageactivity") |
| | | R pageActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO); |
| | | |
| | | /** |
| | | * 增加阅读记录 |
| | | * |
| | | * @param comPbDynUserVO |
| | | * 记录内容 |
| | | * @return 增加结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/adddynuser") |
| | | R addDynUser(@RequestBody ComPbDynUserVO comPbDynUserVO); |
| | | |
| | | /** |
| | | * 删除党员 |
| | | * |
| | | * @param id |
| | | * 党员主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/deletepartybuildingmember") |
| | | R deleteDynUser(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 取消活动 |
| | | * |
| | | * @param partyBuildingActivityVO |
| | | * 取消原因 |
| | | * @return 操作结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/cancelactivity") |
| | | R cancelActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO); |
| | | |
| | | /** |
| | | * 用户的所有党建活动 |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @param communityId |
| | | * 社区id 同一用户在不同社区都是党员 |
| | | * @param status |
| | | * @return 党建活动列表 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/listactivity") |
| | | R listActivity(@RequestParam("userId") Long userId, @RequestParam("communityId") Long communityId, |
| | | @RequestParam(value = "status", required = false) Integer status); |
| | | |
| | | /** |
| | | * 党员活动人员参入列表 |
| | | * |
| | | * @param id |
| | | * 活动id |
| | | * @return 党员集合 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/listpartybuildingmember") |
| | | R listPartyBuildingMember(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 报名、取消报名党员活动 |
| | | * |
| | | * @param activitySignUpDTO |
| | | * 操作参数 |
| | | * @return 操作结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/putactivitysignup") |
| | | R putActivitySignUp(@RequestBody ActivitySignUpDTO activitySignUpDTO); |
| | | |
| | | /** |
| | | * 获取党建活动所有参入人员的id集合 |
| | | * |
| | | * @param id |
| | | * 党建活动id |
| | | * @return 人员id集合 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/selectallpartybuildingactivitymembers") |
| | | R selectAllPartyBuildingActivityMembers(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 定时任务刷新党建动态发布状态 |
| | | * |
| | | * @return 刷新数据数量 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/timedtaskpartybuildingstatus") |
| | | R timedTaskPartyBuildingStatus(); |
| | | |
| | | /** |
| | | * 定时任务取消党建活动 |
| | | * |
| | | * @return 需要取消的所有党建活动 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/timedtaskpartybuildingactivity") |
| | | R timedTaskPartyBuildingActivity(); |
| | | |
| | | /** |
| | | * 定时任务刷新党建活动的各个状态 除取消外 |
| | | * |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/timedtaskpartybuildingactivityall") |
| | | R timedTaskPartyBuildingActivityAll(); |
| | | |
| | | /** |
| | | * 新增服务团队人员 |
| | | * |
| | | * @param comPbServiceTeamDTO |
| | | * 新增内容 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/addserviceteam") |
| | | R addServiceTeam(@RequestBody ComPbServiceTeamDTO comPbServiceTeamDTO); |
| | | |
| | | /** |
| | | * 编辑团队人员 |
| | | * |
| | | * @param comPbServiceTeamDTO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/putserviceteam") |
| | | R putServiceTeam(@RequestBody ComPbServiceTeamDTO comPbServiceTeamDTO); |
| | | |
| | | /** |
| | | * 删除服务团队人员 |
| | | * |
| | | * @param comPbServiceTeamDTO |
| | | * 删除主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/deleteserviceteam") |
| | | R deleteServiceTeam(@RequestBody ComPbServiceTeamDTO comPbServiceTeamDTO); |
| | | |
| | | /** |
| | | * 分页查询服务团队成员 |
| | | * |
| | | * @param pageComPbServiceTeamDTO |
| | | * 查询参数 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/pageserviceteam") |
| | | R pageServiceTeam(@RequestBody PageComPbServiceTeamDTO pageComPbServiceTeamDTO); |
| | | |
| | | /** |
| | | * 创建党员活动 小程序创建党员活动 |
| | | * |
| | | * @param comPbActivityDTO |
| | | * 创建内容 |
| | | * @return 创建结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/addactivityinfo") |
| | | R addActivityApplets(@RequestBody ComPbActivityDTO comPbActivityDTO); |
| | | |
| | | /** |
| | | * 查询用户党员认证信息 |
| | | * |
| | | * @param id |
| | | * @param communityId |
| | | * 用户ID |
| | | * @return 查询结果 |
| | | */ |
| | | @GetMapping("/partybuildIngWest/usercertification") |
| | | R userCertification(@RequestParam("id") Long id,@RequestParam("communityId")Long communityId); |
| | | |
| | | /** |
| | | * 查询待认证党员信息 |
| | | * |
| | | * @param pagePartyBuildingMemberVO |
| | | * 查询参数 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/pageusercertification") |
| | | R pagePrePartybuildingmember(@RequestBody PagePartyBuildingMemberVO pagePartyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 根据身份证号码查询党员信息 |
| | | * |
| | | * @param idCard |
| | | * 身份证号码 |
| | | * @return 党员信息 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/getPartyBuildingByIdCard") |
| | | R getPartyBuildingByIdCard(@RequestParam("idCard") String idCard); |
| | | |
| | | /** |
| | | * 社区所有启用的党组织列表 |
| | | * |
| | | * @return 党组织集合 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/listpartyorganizationByApp") |
| | | R listPartyOrganizationByApp(@RequestBody ComListPartyDTO comListPartyDTO); |
| | | |
| | | /** |
| | | * 根据id删除党员认证 |
| | | * |
| | | * @param id |
| | | * 党员认证id |
| | | * @return 党员认证id |
| | | */ |
| | | @PostMapping("/partybuildIngWest/deleteprepartybuildingmember") |
| | | R deleteprepartybuildingmember(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 导出党员信息 |
| | | * |
| | | * @param organizationVO |
| | | * 请求参数 |
| | | * @return 党员信息列表 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/exportPbMember") |
| | | R exportPbMember(@RequestBody PagePartyOrganizationVO organizationVO); |
| | | |
| | | /** |
| | | * 选择人员 |
| | | * |
| | | * @param param |
| | | * 查询条件 |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/getTotlePerson") |
| | | R getTotlePerson(@RequestParam(value = "param", required = false) String param, |
| | | @RequestParam(value = "communityId") Long communityId); |
| | | |
| | | /** |
| | | * 根据党员活动id查询活动下报名人员 |
| | | * |
| | | * @param activityId |
| | | * 党员活动id |
| | | * @return 活动下报名人员 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/getTaskPbActivityPeopleList") |
| | | R getTaskPbActivityPeopleList(@RequestParam("activityId") Long activityId); |
| | | |
| | | /** |
| | | * 分页查询党员数据统计 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员数据统计 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/pageDataStatisticsMember") |
| | | R pageDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | |
| | | /** |
| | | * 根据组织id查询组织下统计数据 |
| | | * @param statisticsOrgDto 请求参数 |
| | | * @return 组织下统计数据 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/getOrgDataStatistics") |
| | | R getOrgDataStatistics(@RequestBody ComDataStatisticsOrgDto statisticsOrgDto); |
| | | |
| | | /** |
| | | * 查询党组织表头统计数据 |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党组织表头统计数据 |
| | | */ |
| | | @GetMapping("/partybuildIngWest/getHeaderOrgDataStatistics") |
| | | R getHeaderOrgDataStatistics(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/exportDataStatisticsMember") |
| | | R exportDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | |
| | | /** |
| | | * 党委导入接口 |
| | | * @param memberRoleExcelVoList 数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/partybuildIngWest/importPbMemberRole") |
| | | R importPbMemberRole(@RequestBody List<ComPbMemberRoleExcelVo> memberRoleExcelVoList,@RequestParam("communityId") Long communityId,@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 身份证查询是否党员 |
| | | * @param idCard |
| | | * @return |
| | | */ |
| | | @GetMapping("/partybuildIngWest/checkMember") |
| | | R checkMember(@RequestParam("idCard")String idCard); |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import com.panzhihua.common.exceptions.FileSizeLimitExceededException; |
| | | import com.panzhihua.common.exceptions.InvalidExtensionException; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 文件上传工具类 |
| | | * |
| | | * @author |
| | | */ |
| | | public class FileTypeUploadUtils { |
| | | /** |
| | | * 默认大小 50M |
| | | */ |
| | | public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024; |
| | | |
| | | /** |
| | | * 默认的文件名最大长度 100 |
| | | */ |
| | | public static final int DEFAULT_FILE_NAME_LENGTH = 100; |
| | | |
| | | |
| | | /** |
| | | * 文件大小校验 |
| | | * |
| | | * @param file 上传的文件 |
| | | * @return |
| | | * @throws FileSizeLimitExceededException 如果超出最大大小 |
| | | * @throws InvalidExtensionException |
| | | */ |
| | | public static final void assertAllowed(MultipartFile file, String[] allowedExtension) |
| | | throws FileSizeLimitExceededException, InvalidExtensionException { |
| | | long size = file.getSize(); |
| | | if (size > DEFAULT_MAX_SIZE) { |
| | | throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); |
| | | } |
| | | |
| | | String fileName = file.getOriginalFilename(); |
| | | String extension = getExtension(file); |
| | | if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) { |
| | | if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) { |
| | | throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension, |
| | | fileName); |
| | | } else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) { |
| | | throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension, |
| | | fileName); |
| | | } else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) { |
| | | throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension, |
| | | fileName); |
| | | } else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) { |
| | | throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension, |
| | | fileName); |
| | | } else { |
| | | throw new InvalidExtensionException(allowedExtension, extension, fileName); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 判断MIME类型是否是允许的MIME类型 |
| | | * |
| | | * @param extension |
| | | * @param allowedExtension |
| | | * @return |
| | | */ |
| | | public static final boolean isAllowedExtension(String extension, String[] allowedExtension) { |
| | | for (String str : allowedExtension) { |
| | | if (str.equalsIgnoreCase(extension)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 获取文件名的后缀 |
| | | * |
| | | * @param file 表单文件 |
| | | * @return 后缀名 |
| | | */ |
| | | public static final String getExtension(MultipartFile file) { |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | if (StringUtils.isEmpty(extension)) { |
| | | extension = MimeTypeUtils.getExtension(Objects.requireNonNull(file.getContentType())); |
| | | } |
| | | return extension; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | /** |
| | | * 媒体类型工具类 |
| | | * |
| | | * @author |
| | | */ |
| | | public class MimeTypeUtils |
| | | { |
| | | public static final String IMAGE_PNG = "image/png"; |
| | | |
| | | public static final String IMAGE_JPG = "image/jpg"; |
| | | |
| | | public static final String IMAGE_JPEG = "image/jpeg"; |
| | | |
| | | public static final String IMAGE_BMP = "image/bmp"; |
| | | |
| | | public static final String IMAGE_GIF = "image/gif"; |
| | | |
| | | public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" }; |
| | | |
| | | public static final String[] FLASH_EXTENSION = { "swf", "flv" }; |
| | | |
| | | public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", |
| | | "asf", "rm", "rmvb" }; |
| | | |
| | | public static final String[] VIDEO_EXTENSION = { "mp4", "avi", "rmvb" }; |
| | | |
| | | public static final String[] DEFAULT_ALLOWED_EXTENSION = { |
| | | // 图片 |
| | | "bmp", "gif", "jpg", "jpeg", "png", |
| | | // word excel powerpoint |
| | | "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", |
| | | // 压缩文件 |
| | | "rar", "zip", "gz", "bz2", |
| | | // 视频格式 |
| | | "mp4", "avi", "rmvb", |
| | | // pdf |
| | | "pdf" }; |
| | | |
| | | public static String getExtension(String prefix) |
| | | { |
| | | switch (prefix) |
| | | { |
| | | case IMAGE_PNG: |
| | | return "png"; |
| | | case IMAGE_JPG: |
| | | return "jpg"; |
| | | case IMAGE_JPEG: |
| | | return "jpeg"; |
| | | case IMAGE_BMP: |
| | | return "bmp"; |
| | | case IMAGE_GIF: |
| | | return "gif"; |
| | | default: |
| | | return ""; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.panzhihua.common.listen.ComPbMemberRoleExcelListen; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComDataStatisticsOrgDto; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; |
| | | import com.panzhihua.common.model.vos.PartyMemberListExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComDataStatisticsMemberExcelVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleErrorExcelVo; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.common.service.partybuilding.ComDataStatisticsFeign; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingWestService; |
| | | import com.panzhihua.common.utlis.*; |
| | | import com.panzhihua.community_backstage.config.MinioUtil; |
| | | import com.panzhihua.community_backstage.config.SFTPConfig; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.jcraft.jsch.SftpException; |
| | | import com.panzhihua.common.constants.FtpConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComPbServiceTeamDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComPbServiceTeamDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.UploadFilesVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageVO; |
| | | import com.panzhihua.common.model.vos.community.ResetComActMessageVO; |
| | | import com.panzhihua.common.model.vos.user.RoleVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.CommunityWestService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import com.panzhihua.community_backstage.listen.PartyBuildingMemberExcelListen; |
| | | import com.panzhihua.community_backstage.model.dto.PartyBuildingMemberDTO; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static com.panzhihua.common.utlis.FileTypeUploadUtils.assertAllowed; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 社区党建引领 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 09:45 |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"社区党建引领"}) |
| | | @RestController |
| | | @RequestMapping("/communitypartybuildingWest/") |
| | | public class CommunityPartyBuildingWestApi extends BaseController { |
| | | private static List<String> videoExtensionAllow = Arrays.asList("mp4", "mov"); |
| | | @Resource |
| | | private PartyBuildingWestService partyBuildingWestService; |
| | | @Resource |
| | | private CommunityWestService communityWestService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Value("${excel.url}") |
| | | private String excelUrl = "http://panzhihua.nhys.cdnhxx.com/web/"; |
| | | @Value("${excel.userurl}") |
| | | private String userurl; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | @Resource |
| | | private SFTPConfig sftpConfig; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | @Resource |
| | | private ComDataStatisticsFeign dataStatisticsService; |
| | | |
| | | @ApiOperation(value = "社区所有启用的党组织列表", response = PartyOrganizationVO.class) |
| | | @GetMapping("listpartyorganization") |
| | | public R listPartyOrganization() { |
| | | Long communityId = this.getCommunityId(); |
| | | log.info("社区所有党组织社区id【{}】", communityId); |
| | | return partyBuildingWestService.listPartyOrganization(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询社区所有党组织列表", response = PartyOrganizationVO.class) |
| | | @PostMapping("listpartyorganizationAll") |
| | | public R listPartyOrganizationAll(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | partyOrganizationVO.setCommunityId(communityId); |
| | | log.info("社区所有党组织社区id【{}】", communityId); |
| | | return partyBuildingWestService.listPartyOrganizationAll(partyOrganizationVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区所有党组织列表", response = PartyOrganizationVO.class) |
| | | @PostMapping("getPbOrgAllList") |
| | | public R getPbOrgAllList(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | partyOrganizationVO.setCommunityId(communityId); |
| | | log.info("社区所有党组织社区id【{}】", communityId); |
| | | return partyBuildingWestService.getPbOrgAllList(partyOrganizationVO); |
| | | } |
| | | |
| | | @OperLog(operModul = "党支部管理", operType = 1) |
| | | @ApiOperation(value = "新增党支部") |
| | | @PostMapping("addpartyorganization") |
| | | public R addPartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | partyOrganizationVO.setCommunityId(communityId); |
| | | R r = partyBuildingWestService.addPartyOrganization(partyOrganizationVO); |
| | | return r; |
| | | } |
| | | |
| | | @OperLog(operModul = "党支部管理", operType = 2) |
| | | @ApiOperation(value = "编辑党支部") |
| | | @PostMapping("updatepartyorganization") |
| | | public R updatePartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | Long id = partyOrganizationVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("党支部id不能为空"); |
| | | } |
| | | return partyBuildingWestService.updatePartyOrganization(partyOrganizationVO); |
| | | } |
| | | |
| | | @OperLog(operModul = "党支部管理", operType = 3) |
| | | @ApiOperation(value = "启用、禁用党支部") |
| | | @PutMapping("resetpartyorganization") |
| | | public R resetPartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | Long id = partyOrganizationVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("党支部id不能为空"); |
| | | } |
| | | Integer status = partyOrganizationVO.getStatus(); |
| | | if (null == status || (status != 1 && status != 2)) { |
| | | return R.fail("输入有效的状态,1:启用,2:禁用"); |
| | | } |
| | | return partyBuildingWestService.resetPartyOrganization(partyOrganizationVO); |
| | | } |
| | | |
| | | @OperLog(operModul = "党支部管理", operType = 4) |
| | | @ApiOperation(value = "删除党支部") |
| | | @DeleteMapping("deletepartyorganization") |
| | | public R deletePartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | Long id = partyOrganizationVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("党支部id不能为空"); |
| | | } |
| | | return partyBuildingWestService.deletePartyOrganization(partyOrganizationVO); |
| | | } |
| | | |
| | | @OperLog(operModul = "党员管理", operType = 1) |
| | | @ApiOperation(value = "新增党员") |
| | | @PostMapping("addpartybuildingmember") |
| | | public R addPartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | partyBuildingMemberVO.setCommunityId(communityId); |
| | | R r = partyBuildingWestService.addPartyBuildingMember(partyBuildingMemberVO); |
| | | if (R.isOk(r)) { |
| | | R r1 = userService.updateUserIsPartymember(partyBuildingMemberVO.getIdCard()); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @OperLog(operModul = "党员管理", operType = 2) |
| | | @ApiOperation(value = "编辑党员") |
| | | @PutMapping("updatepartybuildingmember") |
| | | public R updatePartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | Long id = partyBuildingMemberVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("党员id不能为空"); |
| | | } |
| | | return partyBuildingWestService.updatePartyBuildingMember(partyBuildingMemberVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载模板-导入党员") |
| | | @GetMapping(value = "downloadtemplate") |
| | | public R downloadTemplate(HttpServletResponse response) throws IOException, SftpException { |
| | | return R.ok(excelUrl); |
| | | } |
| | | |
| | | @ApiOperation(value = "上传照片") |
| | | @PostMapping(value = "uploadimage", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImage(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | String name = file.getOriginalFilename(); |
| | | List<String> formateList = Arrays.asList("avi", "flv", "mpg", "mpeg", "mpe", "m1v", "m2v", "mpv2", "mp2v", |
| | | "dat", "ts", "tp", "tpr", "pva", "pss", "mp4", "m4v", "m4p", "m4b", "3gp", "3gpp", "3g2", "3gp2", "ogg", |
| | | "mov", "qt", "amr", "rm", "ram", "rmvb", "rpm"); |
| | | String nameStr = name.split("\\.")[1]; |
| | | if (formateList.contains(nameStr)) { |
| | | name = UUID.randomUUID().toString().replaceAll("-", "") + ".mp4"; |
| | | } else { |
| | | name = UUID.randomUUID().toString().replaceAll("-", "") + ".jpg"; |
| | | } |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | InputStream is = file.getInputStream(); |
| | | sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is); |
| | | sftp.logout(); |
| | | return R.ok(url + "/idcard/" + name); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "新上传照片接口") |
| | | @PostMapping(value = "/uploadimages", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | // @ApiOperation(value = "批量新增党员导入excel") |
| | | // @PostMapping(value = "downloadtemplate", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | // public R downloadTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | // String fileName = file.getOriginalFilename(); // 获取文件名 |
| | | // log.info("传入文件名字【{}】", fileName); |
| | | // InputStream inputStream = null; |
| | | // try { |
| | | // inputStream = file.getInputStream(); |
| | | // EasyExcel.read(inputStream, PartyBuildingMemberExcelVO.class, |
| | | // new PartyBuildingMemberExcelListen(partyBuildingWestService)).sheet().doRead(); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // log.error("导入模板失败【{}】", e.getMessage()); |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | |
| | | @ApiOperation(value = "党员管理分页查询", response = PartyBuildingMemberVO.class) |
| | | @PostMapping("pagepartyorganization") |
| | | public R pagePartyOrganization(@RequestBody PagePartyOrganizationVO pagePartyOrganizationVO) { |
| | | pagePartyOrganizationVO.setCommunityId(this.getCommunityId()); |
| | | pagePartyOrganizationVO.setAreaCode(this.getAreaCode()); |
| | | return partyBuildingWestService.pagePartyOrganization(pagePartyOrganizationVO); |
| | | } |
| | | @ApiOperation(value = "党员时长信息导出", response = PartyBuildingMemberVO.class) |
| | | @PostMapping("exportPartyMember") |
| | | public R exportPartyMember(@RequestBody PagePartyOrganizationVO pagePartyOrganizationVO) { |
| | | pagePartyOrganizationVO.setCommunityId(this.getCommunityId()); |
| | | pagePartyOrganizationVO.setAreaCode(this.getAreaCode()); |
| | | String url = userurl; |
| | | String name = "党员时长信息数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | // 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | R r = partyBuildingWestService.exportPartyMember(pagePartyOrganizationVO); |
| | | if (R.isOk(r)) { |
| | | List<PartyMemberListExcelVO> eexcelUserDTOS = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), PartyMemberListExcelVO.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, PartyMemberListExcelVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("党员时长信息数据导出").build(); |
| | | excelWriter.write(eexcelUserDTOS, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @ApiOperation(value = "党员档案--党员活动", response = PartyBuildingActivityVO.class) |
| | | @PostMapping("listpartymemberactivities") |
| | | public R listPartyMemberActivities(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | return partyBuildingWestService.listPartyMemberActivities(partyBuildingActivityVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动报名名单分页查询", response = PageActivityMembersVO.class) |
| | | @PostMapping("pageactivitymembers") |
| | | public R pageActivityMembers(@RequestBody PageActivityMembersVO pageActivityMembersVO) { |
| | | return partyBuildingWestService.pageActivityMembers(pageActivityMembersVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动详情", response = PartyBuildingActivityVO.class) |
| | | @GetMapping("activityinfo") |
| | | public R activityinfo(@RequestParam("id") Long id) { |
| | | Long userId = this.getUserId(); |
| | | return partyBuildingWestService.activityinfo(id, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增党员活动") |
| | | @PostMapping("addactivity") |
| | | public R addActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | partyBuildingActivityVO.setCommunityId(communityId); |
| | | partyBuildingActivityVO.setCreateBy(userId); |
| | | return partyBuildingWestService.addactivity(partyBuildingActivityVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑党员活动") |
| | | @PutMapping("updateactivity") |
| | | public R updateActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | Long id = partyBuildingActivityVO.getId(); |
| | | if (null == id || 0 == id) {// todo 修改报名人数 最低人数 0 的判断 |
| | | return R.fail("主键不能为空"); |
| | | } |
| | | return partyBuildingWestService.updateActivity(partyBuildingActivityVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "发布党员活动") |
| | | @PutMapping("releaseactivity") |
| | | public R releaseActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | Long id = partyBuildingActivityVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("主键不能为空"); |
| | | } |
| | | return partyBuildingWestService.releaseActivity(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除党员活动") |
| | | @DeleteMapping("deleteactivity") |
| | | public R deleteActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | Long id = partyBuildingActivityVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("主键不能为空"); |
| | | } |
| | | return partyBuildingWestService.deleteActivity(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "取消党员活动") |
| | | @PutMapping("cancelactivity") |
| | | public R cancelActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | Long id = partyBuildingActivityVO.getId(); |
| | | String cancelReason = partyBuildingActivityVO.getCancelReason(); |
| | | boolean emptycancelReason = ObjectUtils.isEmpty(cancelReason); |
| | | boolean emptyid = ObjectUtils.isEmpty(id); |
| | | if (emptycancelReason || emptyid) { |
| | | return R.fail("参数不全"); |
| | | } |
| | | R r = partyBuildingWestService.cancelActivity(partyBuildingActivityVO); |
| | | if (R.isOk(r)) { |
| | | R r1 = partyBuildingWestService.selectAllPartyBuildingActivityMembers(id); |
| | | if (R.isOk(r1)) { |
| | | List<Long> userIds = JSONArray.parseArray(JSONArray.toJSONString(r1.getData()), Long.class); |
| | | userIds.forEach(aLong -> { |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(aLong); |
| | | sysUserNoticeVO.setType(1); |
| | | sysUserNoticeVO.setTitle("活动因故取消"); |
| | | sysUserNoticeVO.setBusinessType(2); |
| | | sysUserNoticeVO.setBusinessTitle(partyBuildingActivityVO.getName()); |
| | | sysUserNoticeVO |
| | | .setBusinessContent(String.format("取消原因%s", partyBuildingActivityVO.getCancelReason())); |
| | | sysUserNoticeVO.setBusinessId(id); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(1); |
| | | R r2 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r2)) { |
| | | log.info("新增取消党建活动通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询党员活动", response = PageActivityMembersVO.class) |
| | | @PostMapping("pageactivity") |
| | | public R pageActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | Long CommunityId = this.getCommunityId(); |
| | | partyBuildingActivityVO.setCommunityId(CommunityId); |
| | | return partyBuildingWestService.pageActivity(partyBuildingActivityVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区下拉选择党员", response = PartyBuildingMemberVO.class) |
| | | @GetMapping("listpartymember") |
| | | public R listPartyMember() { |
| | | Long communityId = this.getCommunityId(); |
| | | return partyBuildingWestService.listPartyMember(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区下拉选择身份", response = RoleVO.class) |
| | | @GetMapping("listidentity") |
| | | public R listIdentity() { |
| | | Long communityId = this.getCommunityId(); |
| | | return userService.listIdentity(communityId); |
| | | } |
| | | |
| | | @OperLog(operModul = "党委管理", operType = 1) |
| | | @ApiOperation(value = "新增党委") |
| | | @PostMapping("addpartycommittee") |
| | | public R addPartyCommittee(@RequestBody @Validated(AddGroup.class) PartyCommitteeVO partyCommitteeVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | partyCommitteeVO.setCommunityId(communityId); |
| | | R r = partyBuildingWestService.addPartyCommittee(partyCommitteeVO); |
| | | if (R.isOk(r)) { |
| | | R r1 = userService.updateUserIsPartymember(partyCommitteeVO.getIdCard()); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @OperLog(operModul = "党委管理", operType = 2) |
| | | @ApiOperation(value = "编辑党委") |
| | | @PutMapping("updatepartycommittee") |
| | | public R updatePartyCommittee(@RequestBody @Validated(AddGroup.class) PartyCommitteeVO partyCommitteeVO) { |
| | | Long id = partyCommitteeVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("主键不能为空"); |
| | | } |
| | | Long communityId = this.getCommunityId(); |
| | | partyCommitteeVO.setCommunityId(communityId); |
| | | return partyBuildingWestService.updatePartyCommittee(partyCommitteeVO); |
| | | } |
| | | |
| | | @OperLog(operModul = "党委管理", operType = 3) |
| | | @ApiOperation(value = "删除党委") |
| | | @DeleteMapping("deletepartycommittee") |
| | | public R deletePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO) { |
| | | Long id = partyCommitteeVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("主键不能为空"); |
| | | } |
| | | Long communityId = this.getCommunityId(); |
| | | partyCommitteeVO.setCommunityId(communityId); |
| | | return partyBuildingWestService.deletePartyCommittee(partyCommitteeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页党委查询", response = PartyCommitteeVO.class) |
| | | @PostMapping("pagepartycommittee") |
| | | public R pagePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | partyCommitteeVO.setCommunityId(communityId); |
| | | return partyBuildingWestService.pagePartyCommittee(partyCommitteeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新建动态/政策文件") |
| | | @PostMapping("adddynamic") |
| | | public R adddYnamic(@RequestBody PartyBuildingComPbDynVO partyCommitteeVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | partyCommitteeVO.setCreateBy(loginUserInfo.getUserId()); |
| | | partyCommitteeVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | Date publishAt = partyCommitteeVO.getPublishAt(); |
| | | if (null == publishAt) { |
| | | publishAt = new Date(); |
| | | partyCommitteeVO.setPublishAt(publishAt); |
| | | } |
| | | long time = publishAt.getTime(); |
| | | long l = System.currentTimeMillis(); |
| | | if (l >= time) { |
| | | partyCommitteeVO.setStatus(2); |
| | | } |
| | | return partyBuildingWestService.adddYnamic(partyCommitteeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑动态/政策文件") |
| | | @PutMapping("updatedynamic") |
| | | public R updateYnamic(@RequestBody PartyBuildingComPbDynVO partyCommitteeVO) { |
| | | Long id = partyCommitteeVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("动态主键不能为空"); |
| | | } |
| | | return partyBuildingWestService.updateYnamic(partyCommitteeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "动态/政策文件详情", response = PartyBuildingComPbDynVO.class) |
| | | @GetMapping("infodynamic") |
| | | public R infoYnamic(@RequestParam("id") Long id) { |
| | | return partyBuildingWestService.infoYnamic(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询党员动态/政策文件", response = PartyCommitteeVO.class) |
| | | @PostMapping("pagedynamic") |
| | | public R pageYnamic(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO) { |
| | | Integer type = partyBuildingComPbDynVO.getType(); |
| | | if (null == type || 0 == type) { |
| | | return R.fail("类型不能为空"); |
| | | } |
| | | Long communityId = this.getCommunityId(); |
| | | partyBuildingComPbDynVO.setCommunityId(communityId); |
| | | return partyBuildingWestService.pageYnamic(partyBuildingComPbDynVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除动态/政策文件") |
| | | @DeleteMapping("deletedynamic") |
| | | public R deleteYnamic(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO) { |
| | | Long id = partyBuildingComPbDynVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("动态主键不能为空"); |
| | | } |
| | | return partyBuildingWestService.deleteYnamic(id); |
| | | } |
| | | |
| | | @OperLog(operModul = "党员管理", operType = 3) |
| | | @ApiOperation(value = "删除党员") |
| | | @DeleteMapping("deletepartybuildingmember") |
| | | public R deleteDynUser(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | Long id = partyBuildingMemberVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("党员主键不能为空"); |
| | | } |
| | | return partyBuildingWestService.deleteDynUser(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增服务团队人员") |
| | | @PostMapping("serviceteam") |
| | | public R addServiceTeam(@RequestBody @Validated(AddGroup.class) ComPbServiceTeamDTO comPbServiceTeamDTO) { |
| | | comPbServiceTeamDTO.setCommunityId(this.getCommunityId()); |
| | | return partyBuildingWestService.addServiceTeam(comPbServiceTeamDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑服务团队人员") |
| | | @PutMapping("serviceteam") |
| | | public R putServiceTeam(@RequestBody ComPbServiceTeamDTO comPbServiceTeamDTO) { |
| | | Long id = comPbServiceTeamDTO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("主键不能为空"); |
| | | } |
| | | comPbServiceTeamDTO.setCommunityId(null); |
| | | return partyBuildingWestService.putServiceTeam(comPbServiceTeamDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除服务团队人员") |
| | | @DeleteMapping("serviceteam") |
| | | public R deleteServiceTeam(@RequestBody ComPbServiceTeamDTO comPbServiceTeamDTO) { |
| | | Long id = comPbServiceTeamDTO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("主键不能为空"); |
| | | } |
| | | return partyBuildingWestService.deleteServiceTeam(comPbServiceTeamDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询服务团队成员", response = ComPbServiceTeamVO.class) |
| | | @PostMapping("pageserviceteam") |
| | | public R pageServiceTeam(@RequestBody PageComPbServiceTeamDTO pageComPbServiceTeamDTO) { |
| | | if(nonNull(this.getLoginUserInfo().getStreetId())) { |
| | | pageComPbServiceTeamDTO.setStreetId(this.getLoginUserInfo().getStreetId()); |
| | | } else { |
| | | pageComPbServiceTeamDTO.setCommunityId(this.getCommunityId()); |
| | | } |
| | | return partyBuildingWestService.pageServiceTeam(pageComPbServiceTeamDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "留言-删除") |
| | | @DeleteMapping("deletemessage") |
| | | public R deleteMessage(@RequestBody ComActMessageVO comActMessageVO) { |
| | | return communityWestService.deleteMessage(comActMessageVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量设置留言(公开1,保密2)") |
| | | @DeleteMapping("resetmessagepublic") |
| | | public R resetMessagePublic(@RequestBody ResetComActMessageVO resetComActMessageVO) { |
| | | return communityWestService.resetMessagePublic(resetComActMessageVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页显示社区所有的留言", response = ComActMessageVO.class) |
| | | @PostMapping("pagemycommunitymessage") |
| | | public R pageMyCommunityMessage(@RequestBody ComActMessageVO comActMessageVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("用户未绑定社区"); |
| | | } |
| | | comActMessageVO.setCommunityId(communityId); |
| | | comActMessageVO.setUserId(loginUserInfo.getUserId()); |
| | | return communityWestService.pageMyCommunityMessage(comActMessageVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "待认证党员分页查询", response = PartyBuildingMemberVO.class) |
| | | @PostMapping("pageprepartybuildingmember") |
| | | public R pagePrePartybuildingmember(@RequestBody PagePartyBuildingMemberVO pagePartyBuildingMemberVO) { |
| | | // 待认证党员分页查询 |
| | | Long communityId = this.getCommunityId(); |
| | | if (communityId != null) { |
| | | pagePartyBuildingMemberVO.setCommunityId(communityId); |
| | | } |
| | | return partyBuildingWestService.pagePrePartybuildingmember(pagePartyBuildingMemberVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "待认证党员审核") |
| | | @PostMapping("reviewprepartybuildingmember") |
| | | public R reviewPrePartybuildingmember(@RequestBody PartyBuildingMemberDTO partyBuildingMemberDTO) { |
| | | // 待认证党员审核 |
| | | PartyBuildingMemberVO partyBuildingMemberVO = new PartyBuildingMemberVO(); |
| | | partyBuildingMemberVO.setId(partyBuildingMemberDTO.getId()); |
| | | /** |
| | | * 0 待审核 1 已审核 2 自动认证 3 已驳回 |
| | | */ |
| | | switch (partyBuildingMemberDTO.getType()) { |
| | | case 1: |
| | | partyBuildingMemberVO.setAuditResult(1); |
| | | break; |
| | | case 0: |
| | | partyBuildingMemberVO.setAuditResult(3); |
| | | partyBuildingMemberVO.setRefuseReason(partyBuildingMemberDTO.getRefuseReason()); |
| | | break; |
| | | default: |
| | | return R.fail("参数错误"); |
| | | } |
| | | |
| | | R updated = partyBuildingWestService.updatePartyBuildingMember(partyBuildingMemberVO); |
| | | |
| | | if (R.isOk(updated)) { |
| | | // 审核通过: 修改用户的党员状态 |
| | | PartyBuildingMemberVO vo1 = |
| | | JSONObject.parseObject(JSONObject.toJSONString(updated.getData()), PartyBuildingMemberVO.class); |
| | | //金沙社区特殊需求 添加党员默认添加志愿者 |
| | | if(vo1.getCommunityId()==2){ |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO=new ComMngVolunteerMngVO(); |
| | | comMngVolunteerMngVO.setOrgId(53L); |
| | | comMngVolunteerMngVO.setName(vo1.getName()); |
| | | comMngVolunteerMngVO.setPhone(vo1.getPhone()); |
| | | comMngVolunteerMngVO.setIdCard(vo1.getIdCard()); |
| | | comMngVolunteerMngVO.setState(2); |
| | | comMngVolunteerMngVO.setCommunityId(2L); |
| | | R r = communityWestService.addVolunteer(comMngVolunteerMngVO); |
| | | // 支援者添加成功,修改小程序用户的志愿者状态 ,通过手机号 |
| | | if (R.isOk(r)) { |
| | | String phone = comMngVolunteerMngVO.getPhone(); |
| | | R r1 = userService.putUserIsVolunteer(phone, 1); |
| | | if (R.isOk(r1)) { |
| | | log.info("修改手机号【{}】的支援者状态为是", phone); |
| | | } else { |
| | | log.info("手机号【{}】没有小程序用户", phone); |
| | | } |
| | | } |
| | | } |
| | | Long userId = vo1.getUserId(); |
| | | Long memId = partyBuildingMemberVO.getId(); |
| | | String userIdcard = vo1.getIdCard(); |
| | | if ((1 == partyBuildingMemberVO.getAuditResult()) && R.isOk(updated)) { |
| | | R r = userService.updateUserIsPartymember(userIdcard); |
| | | if (R.isOk(r)) { |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setTitle("党员认证申请审核通过"); |
| | | sysUserNoticeVO.setBusinessType(11); |
| | | sysUserNoticeVO.setBusinessTitle(" "); |
| | | sysUserNoticeVO.setBusinessContent("你提交的党员认证申请已被审核通过"); |
| | | sysUserNoticeVO.setBusinessId(memId); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r1 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r1)) { |
| | | log.info("新增党员认证已被审核通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } |
| | | |
| | | R r1 = userService.getUserOpenId(userId); |
| | | if (R.isOk(r1)) { |
| | | String openid = r1.getData().toString(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),5); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeRZSH(openid, util.getAppAccessToken(), "党员认证", |
| | | DateUtils.format(vo1.getCreateAt(), DateUtils.ymdhms_format), "审核通过",sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | | } |
| | | return r; |
| | | } else if (3 == partyBuildingMemberVO.getAuditResult() && R.isOk(updated)) { |
| | | R r = userService.updateUserNotPartymember(userIdcard); |
| | | if (R.isOk(r)) { |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setTitle("党员认证申请未通过"); |
| | | sysUserNoticeVO.setBusinessType(11); |
| | | sysUserNoticeVO.setBusinessTitle(" "); |
| | | sysUserNoticeVO.setBusinessContent("驳回原因:" + partyBuildingMemberVO.getRefuseReason()); |
| | | sysUserNoticeVO.setBusinessId(memId); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(1); |
| | | R r1 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r1)) { |
| | | log.info("新增党员认证已被审核通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | |
| | | R r2 = userService.getUserOpenId(userId); |
| | | if (R.isOk(r2)) { |
| | | String openid = r2.getData().toString(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),5); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeRZSH(openid, util.getAppAccessToken(), "党员认证", |
| | | DateUtils.format(vo1.getCreateAt(), DateUtils.ymdhms_format), |
| | | "审核驳回,驳回原因:" + partyBuildingMemberVO.getRefuseReason(),sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | } |
| | | return updated; |
| | | } |
| | | |
| | | @ApiOperation(value = "删除认证党员审核") |
| | | @PostMapping("/deleteprepartybuildingmember") |
| | | public R deleteprepartybuildingmember(@RequestParam("id") Long id) { |
| | | return partyBuildingWestService.deleteprepartybuildingmember(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "党员信息导出Excel") |
| | | @PostMapping("/member/export") |
| | | public R exportPbMember(@RequestBody PagePartyOrganizationVO organizationVO) { |
| | | organizationVO.setCommunityId(this.getCommunityId()); |
| | | String url = userurl; |
| | | String name = "党员信息数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | // 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | R r = partyBuildingWestService.exportPartyMember(organizationVO); |
| | | if (R.isOk(r)) { |
| | | List<ComPbMemberExcelVO> eexcelUserDTOS = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComPbMemberExcelVO.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ComPbMemberExcelVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("党员信息数据导出").build(); |
| | | excelWriter.write(eexcelUserDTOS, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量上传照片/视频 (jpg/jpeg/png/mp4/mov)") |
| | | @PostMapping(value = "uploads", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile[] files, HttpServletRequest request) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileExtension = ".jpg"; |
| | | |
| | | List<UploadFilesVO> urlList = new ArrayList<>(); |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | |
| | | for (MultipartFile file : files) { |
| | | String originName = file.getOriginalFilename(); |
| | | AtomicBoolean isVideo = new AtomicBoolean(false); |
| | | videoExtensionAllow.forEach(ext -> { |
| | | String originNameLowerCase = originName.toLowerCase(); |
| | | if (originNameLowerCase.endsWith("." + ext)) { |
| | | isVideo.set(true); |
| | | } |
| | | }); |
| | | if (isVideo.get()) { |
| | | fileExtension = ".mp4"; |
| | | } |
| | | |
| | | if (originName.toLowerCase().endsWith(".mp3")) { |
| | | fileExtension = ".mp3"; |
| | | } |
| | | |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + fileExtension; |
| | | try { |
| | | InputStream is = file.getInputStream(); |
| | | String fileName = |
| | | property + File.separator + UUID.randomUUID().toString().replace("-", "") + fileExtension; |
| | | File file1 = new File(fileName); |
| | | file.transferTo(file1); |
| | | boolean delete = file1.delete(); |
| | | log.info("临时文件删除【{}】", delete); |
| | | sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is); |
| | | UploadFilesVO fileVO = new UploadFilesVO(); |
| | | fileVO.setUrl(url + "idcard/" + name); |
| | | urlList.add(fileVO); |
| | | } catch (Exception e) { |
| | | log.error("上传文件失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | sftp.logout(); |
| | | return R.ok(urlList); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "党员数据统计-分页查询党员数据",response = ComDataStatisticsMemberVo.class) |
| | | @PostMapping("/dataStatistics/member/page") |
| | | public R pageDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto) { |
| | | statisticsMemberDto.setCommunityId(this.getCommunityId()); |
| | | return partyBuildingWestService.pageDataStatisticsMember(statisticsMemberDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "党员数据统计-根据党组织统计数据",response = ComDataStatisticsOrgVo.class) |
| | | @PostMapping("/dataStatistics/org") |
| | | public R getOrgDataStatistics(@RequestBody ComDataStatisticsOrgDto statisticsOrgDto) { |
| | | statisticsOrgDto.setCommunityId(this.getCommunityId()); |
| | | return partyBuildingWestService.getOrgDataStatistics(statisticsOrgDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "党支部表头数据统计",response = ComDataStatisticsHeaderOrgVo.class) |
| | | @GetMapping("/dataStatistics/header/org") |
| | | public R getHeaderOrgDataStatistics() { |
| | | return partyBuildingWestService.getHeaderOrgDataStatistics(this.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "党员数据统计-导出党员数据") |
| | | @PostMapping("/dataStatistics/member/export") |
| | | public R exportDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto) { |
| | | statisticsMemberDto.setCommunityId(this.getCommunityId()); |
| | | String url = sftpConfig.getExcelUrl(); |
| | | String name = "党员数据统计-党员导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = partyBuildingWestService.exportDataStatisticsMember(statisticsMemberDto); |
| | | if (R.isOk(r)) { |
| | | List<ComDataStatisticsMemberExcelVo> resultList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComDataStatisticsMemberExcelVo.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(sftpConfig.getUserName(), sftpConfig.getPassword(), sftpConfig.getHost(), sftpConfig.getPort()); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ComDataStatisticsMemberExcelVo.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("党员导出数据").build(); |
| | | excelWriter.write(resultList, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | // @ApiOperation(value = "批量新增党委导入excel") |
| | | // @PostMapping(value = "/importPbMemberRole", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | // public R importPbMemberRole(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | // log.info("传入文件名字【{}】", file.getOriginalFilename()); |
| | | // InputStream inputStream = null; |
| | | // try { |
| | | // inputStream = file.getInputStream(); |
| | | // EasyExcel.read(inputStream, null, |
| | | // new ComPbMemberRoleExcelListen(partyBuildingWestService,this.getCommunityId(),this.getUserId(),stringRedisTemplate)).sheet().doRead(); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // log.error("导入模板失败【{}】", e.getMessage()); |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | |
| | | @ApiOperation(value = "下载导入失败党委数据") |
| | | @GetMapping("/download/error/pbMemberRole") |
| | | public R downloadErrorPbMemberRole(@RequestParam(value = "key") String key) { |
| | | List<ComPbMemberRoleErrorExcelVo> list = new ArrayList<>(); |
| | | Boolean isExits = stringRedisTemplate.hasKey(key); |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | if (isExits) { |
| | | String json = valueOperations.get(key); |
| | | list = JSONArray.parseArray(json, ComPbMemberRoleErrorExcelVo.class); |
| | | } |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String nowDate = DateUtils.getCurrentDateString(); |
| | | String name = "党委导入错误数据" + nowDate + ".xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(sftpConfig.getUserName(), sftpConfig.getPassword(), sftpConfig.getHost(), sftpConfig.getPort()); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ComPbMemberRoleErrorExcelVo.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("党委导入错误数据").build(); |
| | | excelWriter.write(list, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(sftpConfig.getExcelUrl() + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "社区党委-下载导入模板") |
| | | @GetMapping("/export/pbMemberRole") |
| | | public R exportElder() { |
| | | return R.ok(sftpConfig.getExcelUrl() + "社区党委导入模板.xlsx"); |
| | | } |
| | | |
| | | @ApiOperation("查询是否党员") |
| | | @GetMapping("/checkMember") |
| | | public R checkMember(@RequestParam("idCard")String idCard){ |
| | | return partyBuildingWestService.checkMember(idCard); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.NeighborCircleConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.CommunityWestService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/neighborWest/") |
| | | @Api(tags = {"邻里圈服务"}) |
| | | public class NeighborWestApi extends BaseController { |
| | | @Resource |
| | | private CommunityWestService communityWestService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "邻里圈_分页", response = ComActNeighborCircleAdminVO.class) |
| | | @PostMapping("pageNeighborByAdmin") |
| | | R pageNeighborByAdmin(@RequestBody ComActNeighborCircleAdminDTO comActNeighborCircleAdminDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | comActNeighborCircleAdminDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityWestService.pageNeighborByAdmin(comActNeighborCircleAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 后台修改邻里圈 |
| | | * |
| | | * @param editNeighborCircleAdminVO |
| | | * 请求参数 |
| | | */ |
| | | @ApiOperation(value = "邻里圈_修改") |
| | | @PostMapping("changeStatusByAdmin") |
| | | R changeStatusByAdmin(@RequestBody EditNeighborCircleAdminVO editNeighborCircleAdminVO) { |
| | | R r = communityWestService.changeStatusByAdmin(editNeighborCircleAdminVO); |
| | | if (R.isOk(r)) {// 邻里圈审核 |
| | | if (editNeighborCircleAdminVO.getStatus().equals(EditNeighborCircleAdminVO.status.xs)) { |
| | | // 审核通过添加提示信息 |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(Long.parseLong(r.getData().toString())); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setTitle("邻里圈审核通过"); |
| | | sysUserNoticeVO.setBusinessType(12); |
| | | sysUserNoticeVO.setBusinessTitle(""); |
| | | sysUserNoticeVO.setBusinessContent("您发布的邻里圈已通过审核,可在邻里圈模块查看"); |
| | | sysUserNoticeVO.setBusinessId(editNeighborCircleAdminVO.getId()); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r2 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r2)) { |
| | | log.info("邻里圈审核通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } else if (editNeighborCircleAdminVO.getStatus().equals(EditNeighborCircleAdminVO.status.bh)) { |
| | | // 审核驳回添加提示信息 |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(Long.parseLong(r.getData().toString())); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setTitle("邻里圈审核未通过"); |
| | | sysUserNoticeVO.setBusinessType(12); |
| | | sysUserNoticeVO.setBusinessContent("驳回原因:" + editNeighborCircleAdminVO.getRefuseReason()); |
| | | sysUserNoticeVO.setBusinessTitle(""); |
| | | sysUserNoticeVO.setBusinessId(editNeighborCircleAdminVO.getId()); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(1); |
| | | R r2 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r2)) { |
| | | log.info("邻里圈审核通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈_后台删除 |
| | | * |
| | | * @param id |
| | | * 邻里圈id |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @ApiOperation(value = "邻里圈_删除") |
| | | @PostMapping("deleteByAdmin") |
| | | R deleteByAdmin(@RequestParam("id") Long id) { |
| | | return communityWestService.deleteByAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈_基础详情", response = DetailNeighborCircleAdminVO.class) |
| | | @GetMapping("detailNeighborByAdmin") |
| | | R detailNeighborByAdmin(@RequestParam("id") Long id) { |
| | | return communityWestService.detailNeighborByAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈的所有评论_分页", response = ComActNeighborCommentByAdminVO.class) |
| | | @PostMapping("detailNeighborAllCommentByAdmin") |
| | | R detailNeighborAllCommentByAdmin(@RequestBody DetailNeighborAllCommentByAdminDTO dto) { |
| | | return communityWestService.detailNeighborAllCommentByAdmin(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "评论的状态_修改") |
| | | @PostMapping("changeCommentStatusByAdmin") |
| | | R changeCommentStatusByAdmin(@RequestBody ChangeCommentStatusByAdminVO vo) { |
| | | return communityWestService.changeCommentStatusByAdmin(vo); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈评论_详情", response = ComActNeighborCommentByAdminVO.class) |
| | | @GetMapping("detailNeighborCommentByAdmin") |
| | | R detailNeighborCommentByAdmin(@RequestParam("id") Long id) { |
| | | return communityWestService.detailNeighborCommentByAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈评论回复_分页", response = ComActNeighborCommentReplyByAdminVO.class) |
| | | @PostMapping("detailNeighborCommentAllReply") |
| | | R detailNeighborCommentAllReply(@RequestBody DetailNeighborCommentReplyByAdminDTO dto) { |
| | | return communityWestService.detailNeighborCommentAllReply(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈评论回复_基本详情", response = ComActNeighborCommentReplyByAdminVO.class) |
| | | @GetMapping("detailNeighborCommentReply") |
| | | R detailNeighborCommentReply(@RequestParam("id") Long id) { |
| | | return communityWestService.detailNeighborCommentReply(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "评论回复状态_修改") |
| | | @PostMapping("changeCommentReplyStatusByAdmin") |
| | | R changeCommentReplyStatusByAdmin(@RequestBody ChangeCommentReplyStatusByAdminVO changeStatusReplyVO) { |
| | | return communityWestService.changeCommentReplyStatusByAdmin(changeStatusReplyVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈_添加") |
| | | @PostMapping("addNeighborByAdmin") |
| | | R addNeighborByAdmin(@RequestBody AddNeighborCircleAdminVO addNeighborCircleAdminVO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | addNeighborCircleAdminVO.setUserId(loginUserInfo.getUserId()); |
| | | return communityWestService.addNeighborByAdmin(addNeighborCircleAdminVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询邻里圈话题列表", response = ComActNeighborCircleTopicAdminVO.class) |
| | | @PostMapping("pageNeighborTopicByAdmin") |
| | | public R pageNeighborTopicByAdmin(@RequestBody ComActNeighborCircleTopicAdminDTO circleTopicAdminDTO) { |
| | | if (isNull(circleTopicAdminDTO.getCommunityId())) { |
| | | circleTopicAdminDTO.setCommunityId(this.getCommunityId()); |
| | | } |
| | | return communityWestService.pageNeighborTopicByAdmin(circleTopicAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加邻里圈话题") |
| | | @PostMapping("addNeighborTopicByAdmin") |
| | | public R addNeighborTopicByAdmin(@RequestBody AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO) { |
| | | addCircleTopicAdminDTO.setCommunityId(this.getCommunityId()); |
| | | addCircleTopicAdminDTO.setUserId(this.getUserId()); |
| | | return communityWestService.addNeighborTopicByAdmin(addCircleTopicAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑邻里圈话题") |
| | | @PostMapping("editNeighborTopicByAdmin") |
| | | public R editNeighborTopicByAdmin(@RequestBody AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO) { |
| | | if (addCircleTopicAdminDTO.getId() == null) { |
| | | return R.fail("参数错误"); |
| | | } |
| | | addCircleTopicAdminDTO.setCommunityId(this.getCommunityId()); |
| | | return communityWestService.editNeighborTopicByAdmin(addCircleTopicAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取社区审核状态") |
| | | @GetMapping("getCircleExamineStatus") |
| | | public R getCircleExamineStatus(){ |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail("请先登录"); |
| | | } |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | //查询社区自动审核是否开着 |
| | | String key = NeighborCircleConstants.NEIGHBOR_CIRCLE_AUTO_EXAMINE; |
| | | R isOk = communityWestService.getSysConfValue(key + communityId,communityId); |
| | | if(R.isOk(isOk)){ |
| | | if(isOk.getData() != null){ |
| | | return isOk; |
| | | }else{ |
| | | communityWestService.addSysConfValue(key + communityId,communityId,"社区邻里圈自动审核参数","1"); |
| | | isOk.setData("1"); |
| | | return isOk; |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑社区审核状态") |
| | | @GetMapping("editCircleExamineStatus") |
| | | public R editCircleExamineStatus(@RequestParam("status") Integer status){ |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail("请先登录"); |
| | | } |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | return communityWestService.editSysConfValue(communityId,status); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.AddNeighborCircleAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ChangeCommentReplyStatusByAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ChangeCommentStatusByAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.EditNeighborCircleAdminVO; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleWestService; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleTopicWestService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/neighborWest/") |
| | | public class NeighborWestApi { |
| | | |
| | | @Resource |
| | | private ComActNeighborCircleWestService comActNeighborCircleWestService; |
| | | @Resource |
| | | private ComActNeighborCircleTopicWestService comActNeighborCircleTopicWestService; |
| | | |
| | | /** |
| | | * 分页查询邻里圈列表 |
| | | * |
| | | * @param neighborCircleAppDTO |
| | | * 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @PostMapping("pageNeighborByApp") |
| | | public R pageNeighbor(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | return comActNeighborCircleWestService.pageNeighborByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 用户发布邻里圈审核 |
| | | * |
| | | * @param addNeighborCircleAppDTO |
| | | * 邻里圈请求参数 |
| | | * @return 发布结果 |
| | | */ |
| | | @PostMapping("addNeighborByApp") |
| | | public R addNeighborByApp(@RequestBody AddComActNeighborCircleAppDTO addNeighborCircleAppDTO) { |
| | | return comActNeighborCircleWestService.addNeighborByApp(addNeighborCircleAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询邻里圈详情 |
| | | * |
| | | * @param neighborCircleAppDTO |
| | | * 请求参数 |
| | | * @return 邻里圈详情 |
| | | */ |
| | | @PostMapping("neighborDetailByApp") |
| | | public R neighborDetailByApp(@RequestBody ComActNeighborCircleDetailAppDTO neighborCircleAppDTO) { |
| | | return comActNeighborCircleWestService.neighborDetailByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台查询邻里圈列表 |
| | | * |
| | | * @param comActNeighborCircleAdminDTO |
| | | * 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @PostMapping("pageNeighborByAdmin") |
| | | public R pageNeighborByAdmin(@RequestBody ComActNeighborCircleAdminDTO comActNeighborCircleAdminDTO) { |
| | | return comActNeighborCircleWestService.pageNeighborByAdmin(comActNeighborCircleAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 后台添加邻里圈 |
| | | * |
| | | * @param addNeighborCircleAdminVO |
| | | * 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @PostMapping("addNeighborByAdmin") |
| | | public R addNeighborByAdmin(@RequestBody AddNeighborCircleAdminVO addNeighborCircleAdminVO) { |
| | | return comActNeighborCircleWestService.addNeighborByAdmin(addNeighborCircleAdminVO); |
| | | } |
| | | |
| | | /** |
| | | * 后台修改邻里圈 |
| | | * |
| | | * @param editNeighborCircleAdminVO |
| | | * 请求参数 |
| | | */ |
| | | @PostMapping("changeStatusByAdmin") |
| | | public R changeStatusByAdmin(@RequestBody EditNeighborCircleAdminVO editNeighborCircleAdminVO) { |
| | | return comActNeighborCircleWestService.changeStatusByAdmin(editNeighborCircleAdminVO); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈_后台删除 待审核状态不可删除,显示、隐藏、已驳回的都可以删除) |
| | | * |
| | | * @param id |
| | | * 邻里圈id |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @PostMapping("deleteByAdmin") |
| | | public R deleteByAdmin(@RequestParam("id") Long id) { |
| | | return comActNeighborCircleWestService.deleteByAdmin(id); |
| | | } |
| | | |
| | | /** |
| | | * 用户查询邻里圈列表 |
| | | * |
| | | * @param neighborCircleAppDTO |
| | | * 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @PostMapping("neighborExamineByApp") |
| | | public R neighborExamineByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | return comActNeighborCircleWestService.neighborExamineByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈点赞 |
| | | * |
| | | * @param fabulousAppDTO |
| | | * 请求参数 |
| | | * @return 点赞结果 |
| | | */ |
| | | @PostMapping("neighborFabulousByApp") |
| | | public R neighborFabulousByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | return comActNeighborCircleWestService.neighborFabulousByApp(fabulousAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈转发 |
| | | * |
| | | * @param forwardAppDTO |
| | | * 请求参数 |
| | | * @return 转发结果 |
| | | */ |
| | | @PostMapping("neighborForwardByApp") |
| | | public R neighborForwardByApp(@RequestBody ComActNeighborForwardAppDTO forwardAppDTO) { |
| | | return comActNeighborCircleWestService.neighborForwardByApp(forwardAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈评论 |
| | | * |
| | | * @param commentAppDTO |
| | | * 请求参数 |
| | | * @return 评论结果 |
| | | */ |
| | | @PostMapping("neighborCommentByApp") |
| | | public R neighborCommentByApp(@RequestBody ComActNeighborCommentAppDTO commentAppDTO) { |
| | | return comActNeighborCircleWestService.neighborCommentByApp(commentAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈回复 |
| | | * |
| | | * @param replyAppDTO |
| | | * 请求参数 |
| | | * @return 回复结果 |
| | | */ |
| | | @PostMapping("neighborReplyByApp") |
| | | public R neighborReplyByApp(@RequestBody ComActNeighborReplyAppDTO replyAppDTO) { |
| | | return comActNeighborCircleWestService.neighborReplyByApp(replyAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务更新邻里圈近3天评论数/点赞数/浏览量 |
| | | * |
| | | * @return 执行结果 |
| | | */ |
| | | @PostMapping("timeTaskCircleFlow") |
| | | public R timeTaskCircleFlow() { |
| | | return comActNeighborCircleWestService.timeTaskCircleFlow(); |
| | | } |
| | | |
| | | /** |
| | | * 查看邻里圈基础_详情 |
| | | * |
| | | * @param id |
| | | * 邻里圈id |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @GetMapping("detailNeighborByAdmin") |
| | | public R detailNeighborByAdmin(@RequestParam("id") Long id) { |
| | | return comActNeighborCircleWestService.detailNeighborByAdmin(id); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈的所有评论_分页 |
| | | * |
| | | * @param dto |
| | | * 请求参数 |
| | | * @return 评论列表 |
| | | */ |
| | | @PostMapping("detailNeighborAllCommentByAdmin") |
| | | public R detailNeighborAllCommentByAdmin(@RequestBody DetailNeighborAllCommentByAdminDTO dto) { |
| | | return comActNeighborCircleWestService.detailNeighborAllCommentByAdmin(dto); |
| | | } |
| | | |
| | | /** |
| | | * 评论的状态_修改 |
| | | * |
| | | * @param vo |
| | | * 请求参数 |
| | | */ |
| | | @PostMapping("changeCommentStatusByAdmin") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R changeCommentStatusByAdmin(@RequestBody ChangeCommentStatusByAdminVO vo) { |
| | | return comActNeighborCircleWestService.changeCommentStatusByAdmin(vo); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈评论_详情 |
| | | * |
| | | * @param id |
| | | * 评论id |
| | | */ |
| | | @GetMapping("detailNeighborCommentByAdmin") |
| | | public R detailNeighborCommentByAdmin(@RequestParam("id") Long id) { |
| | | return comActNeighborCircleWestService.detailNeighborCommentByAdmin(id); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈评论回复_分页 |
| | | * |
| | | * @param dto |
| | | * 参数 |
| | | */ |
| | | @PostMapping("detailNeighborCommentAllReply") |
| | | public R detailNeighborCommentAllReply(@RequestBody DetailNeighborCommentReplyByAdminDTO dto) { |
| | | return comActNeighborCircleWestService.detailNeighborCommentAllReply(dto); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈评论回复_基本详情 |
| | | * |
| | | * @param id |
| | | * 参数 |
| | | */ |
| | | @GetMapping("detailNeighborCommentReply") |
| | | public R detailNeighborCommentReply(@RequestParam("id") Long id) { |
| | | return comActNeighborCircleWestService.detailNeighborCommentReply(id); |
| | | } |
| | | |
| | | /** |
| | | * 评论的状态_修改 |
| | | * |
| | | * @param changeStatusReplyVO |
| | | * 参数 |
| | | */ |
| | | @PostMapping("changeCommentReplyStatusByAdmin") |
| | | public R changeCommentReplyStatusByAdmin(@RequestBody ChangeCommentReplyStatusByAdminVO changeStatusReplyVO) { |
| | | return comActNeighborCircleWestService.changeCommentReplyStatusByAdmin(changeStatusReplyVO); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈取消点赞 |
| | | * |
| | | * @param fabulousAppDTO |
| | | * 请求参数 |
| | | * @return 取消点赞结果 |
| | | */ |
| | | @PostMapping("neighborFabulousCancelByApp") |
| | | public R neighborFabulousCancelByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | return comActNeighborCircleWestService.neighborFabulousCancelByApp(fabulousAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 添加邻里圈浏览记录 |
| | | * |
| | | * @param addBrowseAppDTO |
| | | * 请求参数 |
| | | * @return 返回参数 |
| | | */ |
| | | @PostMapping("neighborAddBrowseByApp") |
| | | public R neighborAddBrowseByApp(@RequestBody ComActNeighborAddBrowseAppDTO addBrowseAppDTO) { |
| | | return comActNeighborCircleWestService.neighborAddBrowseByApp(addBrowseAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询评论下所有回复 |
| | | * |
| | | * @param commentReplyAppDTO |
| | | * 请求参数 |
| | | * @return 回复列表 |
| | | */ |
| | | @PostMapping("neighborCommentReplyByApp") |
| | | public R neighborCommentReplyByApp(@RequestBody ComActNeighborCommentReplyAppDTO commentReplyAppDTO) { |
| | | return comActNeighborCircleWestService.neighborCommentReplyByApp(commentReplyAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询邻里圈话题列表 |
| | | * |
| | | * @param circleTopicAdminDTO |
| | | * 请求参数 |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | @PostMapping("pageNeighborTopicByAdmin") |
| | | public R pageNeighborTopicByAdmin(@RequestBody ComActNeighborCircleTopicAdminDTO circleTopicAdminDTO) { |
| | | return comActNeighborCircleTopicWestService.pageNeighborTopicByAdmin(circleTopicAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 添加邻里圈话题 |
| | | * |
| | | * @param addCircleTopicAdminDTO |
| | | * 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("addNeighborTopicByAdmin") |
| | | public R addNeighborTopicByAdmin(@RequestBody AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO) { |
| | | return comActNeighborCircleTopicWestService.addNeighborTopicByAdmin(addCircleTopicAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑邻里圈话题 |
| | | * |
| | | * @param addCircleTopicAdminDTO |
| | | * 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("editNeighborTopicByAdmin") |
| | | public R editNeighborTopicByAdmin(@RequestBody AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO) { |
| | | return comActNeighborCircleTopicWestService.editNeighborTopicByAdmin(addCircleTopicAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 小程序查询邻里圈话题列表 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | @GetMapping("getNeighborTopicByApp") |
| | | public R getNeighborTopicByApp(@RequestParam("communityId") Long communityId,@RequestParam("isZero") Integer isZero,@RequestParam("name") String name) { |
| | | return comActNeighborCircleTopicWestService.getNeighborTopicByApp(communityId,isZero,name); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-用户新增话题 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addNeighborTopicByApp") |
| | | public R addNeighborTopicByApp(@RequestBody AddNeighborCircleTopicAppDTO circleTopicAppDTO){ |
| | | return comActNeighborCircleTopicWestService.addNeighborTopicByApp(circleTopicAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-删除邻里圈 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deleteNeighborByApp") |
| | | public R deleteNeighborByApp(@RequestBody DeleteNeighborCircleAppDTO circleTopicAppDTO){ |
| | | return comActNeighborCircleWestService.deleteNeighborByApp(circleTopicAppDTO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleBrowseWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 13:40:53 |
| | | * @describe 邻里圈浏览记录表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActNeighborCircleBrowseWestDAO extends BaseMapper<ComActNeighborCircleBrowseWestDO> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.neighbor.DetailNeighborCommentReplyByAdminDTO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleCommentReplyAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyByAdminVO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentReplyWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:45 |
| | | * @describe 邻里圈评论回复表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActNeighborCircleCommentReplyWestDAO extends BaseMapper<ComActNeighborCircleCommentReplyWestDO> { |
| | | |
| | | @Select("<script> " + "select reply.id,reply.comment_id, reply.reply_content,reply.fabulous_num " |
| | | + ",reply.create_at,reply.is_release,su1.nick_name as userName " |
| | | + ",su1.image_url as userHeadUrl,su2.nick_name as parentUserName " |
| | | + " from com_act_neighbor_circle_comment_reply as reply" |
| | | + " left join sys_user su1 on su1.user_id = reply.user_id " |
| | | + " left join sys_user su2 on su2.user_id = reply.parent_user_id " |
| | | + " where reply.status = 1 and reply.comment_id = #{commentId} order by create_at desc" + " </script>") |
| | | List<ComActNeighborCircleCommentReplyAppVO> getCircleCommentReplyList(@Param("commentId") Long commentId); |
| | | |
| | | @Select("<script> " |
| | | + "select cr.*,u.name as userName,u.phone as userPhone,u.nick_name as userNickName from com_act_neighbor_circle_comment_reply cr left join sys_user u on cr.user_id=u.user_id " |
| | | + "<where>" + "<if test='dto.id != null and dto.id!= 0l'>" + "cr.comment_id = #{dto.id}" + " </if> " |
| | | + "</where>" + " ORDER BY cr.create_at" + "</script>") |
| | | Page<ComActNeighborCommentReplyByAdminVO> selectListByComment(Page page, |
| | | @Param("dto") DetailNeighborCommentReplyByAdminDTO dto); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleDetailAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.DetailNeighborAllCommentByAdminDTO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleCommentAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentByAdminVO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:33 |
| | | * @describe 邻里圈评论表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActNeighborCircleCommentWestDAO extends BaseMapper<ComActNeighborCircleCommentWestDO> { |
| | | |
| | | @Select("<script> " + "select cancc.id,cancc.circle_id,cancc.user_id,cancc.content,cancc.fabulous_num" |
| | | + ",cancc.create_at,cancc.is_release,su.nick_name as userName,su.image_url as userHeadUrl " |
| | | + " from com_act_neighbor_circle_comment as cancc " + " left join sys_user as su on su.user_id = cancc.user_id" |
| | | + " where cancc.circle_id = #{neighborCircleAppDTO.circleId} and cancc.status = 1" |
| | | + "<if test='neighborCircleAppDTO.order != null and neighborCircleAppDTO.order == 1'>" |
| | | + " order by cancc.create_at desc" + " </if> " |
| | | + "<if test='neighborCircleAppDTO.order != null and neighborCircleAppDTO.order == 2'>" |
| | | + " order by cancc.create_at asc" + " </if> " + " </script>") |
| | | IPage<ComActNeighborCircleCommentAppVO> pageNeighborCommentByApp(Page page, |
| | | @Param("neighborCircleAppDTO") ComActNeighborCircleDetailAppDTO neighborCircleAppDTO); |
| | | |
| | | @Select("<script> " |
| | | + "select nc.*,u.nick_name as userName,u.phone as userPhone from com_act_neighbor_circle_comment nc left join sys_user u on nc.user_id=u.user_id " |
| | | + "<where>" + "<if test='dto.id != null and dto.id!= 0l'>" + "nc.circle_id = #{dto.id}" + " </if> " + "</where>" |
| | | + " ORDER BY create_at" + "</script>") |
| | | IPage<ComActNeighborCommentByAdminVO> selectPageDetailNeighborComment(Page page, |
| | | @Param("dto") DetailNeighborAllCommentByAdminDTO dto); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleFabulousWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:55 |
| | | * @describe 邻里圈点赞表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActNeighborCircleFabulousWestDAO extends BaseMapper<ComActNeighborCircleFabulousWestDO> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleTopicWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-06 15:04:37 |
| | | * @describe 邻里圈话题表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActNeighborCircleTopicWestMapper extends BaseMapper<ComActNeighborCircleTopicWestDO> { |
| | | |
| | | /** |
| | | * 分页查询邻里圈话题列表 |
| | | * |
| | | * @param circleTopicAdminDTO |
| | | * 请求参数 |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | IPage<ComActNeighborCircleTopicAdminVO> pageNeighborTopicByAdmin(Page page, |
| | | @Param("circleTopicAdminDTO") ComActNeighborCircleTopicAdminDTO circleTopicAdminDTO); |
| | | |
| | | /** |
| | | * 小程序查询邻里圈话题列表 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | List<ComActNeighborCircleTopicAppVO> getNeighborTopicByApp(@Param("communityId") Long communityId,@Param("isZero") Integer isZero,@Param("name") String name); |
| | | |
| | | /** |
| | | * 添加邻里圈话题热度 |
| | | * @param circleTopicId 邻里圈话题id |
| | | * @param hotNum 热度值 |
| | | */ |
| | | void addHotNum(@Param("circleTopicId") Long circleTopicId,@Param("hotNum") Long hotNum); |
| | | |
| | | /** |
| | | * 添加邻里圈话题邻里圈数量 |
| | | * @param circleTopicId 邻里圈话题id |
| | | */ |
| | | void addCount(@Param("circleTopicId") Long circleTopicId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.dtos.PageBaseDTO; |
| | | import com.panzhihua.common.model.vos.community.StatisticsCommVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleDetailAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyAppVO; |
| | | import com.panzhihua.common.model.vos.screen.CarouselInfoVO; |
| | | import com.panzhihua.common.model.vos.screen.PieElementVO; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:20:49 |
| | | * @describe 邻里圈表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActNeighborCircleWestDAO extends BaseMapper<ComActNeighborCircleWestDO> { |
| | | |
| | | |
| | | /** |
| | | * 分页查询邻里圈列表 |
| | | * @param neighborCircleAppDTO 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | IPage<ComActNeighborCircleAppVO> pageNeighborByApp(Page page, @Param("neighborCircleAppDTO") ComActNeighborCircleAppDTO neighborCircleAppDTO); |
| | | |
| | | @Select("<script> " + "select canc.id,su.nick_name as name,su.image_url as headUrl,canc.release_content " |
| | | + ",canc.release_images,canc.comment_num,canc.fabulous_num,canc.forward_num,canc.views_num,canct.name as topicName,canc.refuse_reason " |
| | | + ",canc.is_boutique,canc.create_at,canc.reply_at,su.community_id,canc.type from com_act_neighbor_circle as canc " |
| | | + " left join sys_user as su on su.user_id = canc.release_id " |
| | | + " left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id where canc.id = #{circleId} and canc.is_del = 2" |
| | | + " </script>") |
| | | ComActNeighborCircleDetailAppVO neighborDetailByApp(@Param("circleId") Long circleId); |
| | | |
| | | IPage<ComActNeighborCircleAdminVO> pageNeighborByAdmin(Page page,@Param("neighborCircleAdminDTO") ComActNeighborCircleAdminDTO neighborCircleAdminDTO); |
| | | |
| | | @Select("select * from sys_user where user_id=#{userId}") |
| | | AdministratorsUserVO selectUserByUserId(@Param("userId") Long userId); |
| | | |
| | | @Select("<script> " |
| | | + "select canc.id,canc.release_content,canc.release_images,canc.status,canc.create_at,canct.name as topicName" |
| | | + ",canc.comment_num,canc.fabulous_num,canc.forward_num,canc.views_num,canc.refuse_reason,su.nick_name as name,su.image_url as headUrl " |
| | | + " from com_act_neighbor_circle as canc " + " left join sys_user as su on su.user_id = canc.release_id " |
| | | + " left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id " |
| | | + " where canc.release_id = #{userId} and canc.is_del = 2 and canc.status != 3 order by create_at desc" + " </script>") |
| | | IPage<ComActNeighborCircleAppVO> neighborExamineByApp(Page page, @Param("userId") Long userId); |
| | | |
| | | @Select("select reply.id,reply.comment_id,reply.reply_content,reply.fabulous_num,reply.create_at" |
| | | + ",reply.is_release,su.nick_name as userName,su.image_url as userHeadUrl,su1.nick_name as oldUserName" |
| | | + " from com_act_neighbor_circle_comment_reply as reply" |
| | | + " left join sys_user as su on su.user_id = reply.user_id" |
| | | + " left join sys_user as su1 on su1.user_id = reply.parent_user_id" |
| | | + " where reply.comment_id = #{commentId} and reply.status = 1") |
| | | IPage<ComActNeighborCommentReplyAppVO> neighborCommentReplyByApp(Page page, @Param("commentId") Long commentId); |
| | | |
| | | @Select("SELECT id,release_content as content FROM com_act_neighbor_circle WHERE community_id = ${communityId} and status = 2 ORDER BY create_at DESC limit #{pageSize}") |
| | | List<CarouselInfoVO> screenNeighborCircle(@Param("communityId") Long communityId, |
| | | @Param("pageSize") Integer pageSize); |
| | | |
| | | @Select(" SELECT COUNT(id) AS totalNum," |
| | | + " (SELECT COUNT(id) FROM com_act_neighbor_circle WHERE community_id = ${communityId} AND status = 2 AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " |
| | | + " FROM com_act_neighbor_circle WHERE community_id = ${communityId} AND status = 2") |
| | | Map<String, Long> countByCommunityId(@Param("communityId") Long communityId, @Param("nowDate") String nowDate); |
| | | |
| | | @Select("SELECT SUM(comment_num) as commentNum,SUM(fabulous_num) as fabulousNum,SUM(forward_num) as forwardNum FROM com_act_neighbor_circle WHERE community_id = ${communityId} and status = 2 ") |
| | | Map<String, Object> sumScreenNum(@Param("communityId") Long communityId); |
| | | |
| | | @Select("SELECT release_images FROM com_act_neighbor_circle WHERE community_id = ${communityId} and status = 2 order by create_at desc limit #{pageSize}") |
| | | List<String> screenNeighborCircleImgs(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); |
| | | |
| | | @Select("SELECT COUNT(id) as num,'随手拍' as name FROM com_act_easy_photo WHERE community_id = ${communityId} AND STATUS = 4 " |
| | | + "UNION ALL " |
| | | + "SELECT COUNT(id) as num,'微心愿' as name FROM com_act_micro_wish WHERE community_id = ${communityId} AND STATUS = 6 " |
| | | + "UNION ALL " |
| | | + "SELECT COUNT(id) as num,'一起议' as name FROM com_act_discuss WHERE community_id = ${communityId} " |
| | | + "UNION ALL " |
| | | + "SELECT COUNT(id) as num,'邻里圈' as name FROM com_act_neighbor_circle WHERE community_id = ${communityId} AND STATUS = 2 " |
| | | + "UNION ALL " |
| | | + "SELECT COUNT( e.id ) AS num,'网格事件' AS name FROM `event` as e left join event_grid_data as egd on egd.id = e.grid_id WHERE egd.grid_community_id = ${communityId} AND e.event_process_status = 2 " |
| | | + "UNION ALL " |
| | | + "SELECT COUNT(id) as num,'社区活动' as name FROM com_act_activity WHERE community_id = ${communityId} AND STATUS = 5 ") |
| | | List<PieElementVO> countAllCompletedWorkByCommunityId(@Param("communityId") Long communityId); |
| | | |
| | | @Select("SELECT COUNT(id) as num,'随手拍' as name FROM com_act_easy_photo WHERE community_id = ${communityId} AND (STATUS = 1 or STATUS = 2) " |
| | | + "UNION ALL " |
| | | + "SELECT COUNT(id) as num,'微心愿' as name FROM com_act_micro_wish WHERE community_id = ${communityId} AND (STATUS = 1 or STATUS = 2 or STATUS = 3 or STATUS = 4) " |
| | | + "UNION ALL " |
| | | + "SELECT COUNT(id) as num,'一起议' as name FROM com_act_discuss WHERE community_id = ${communityId} " |
| | | + "UNION ALL " |
| | | + "SELECT COUNT(id) as num,'邻里圈' as name FROM com_act_neighbor_circle WHERE community_id = ${communityId} AND STATUS = 1 " |
| | | + "UNION ALL " |
| | | + "SELECT COUNT( e.id ) AS num,'网格事件' AS NAME FROM `event` as e left join event_grid_data as egd on egd.id = e.grid_id WHERE egd.grid_community_id = ${communityId} AND e.event_status = 2 and e.event_deal_status in (1,2,3) " |
| | | + "UNION ALL " |
| | | + "SELECT COUNT(id),'社区活动' as name FROM com_act_activity WHERE community_id = ${communityId} AND (STATUS = 1 or STATUS = 2 or STATUS = 3 or STATUS = 4) ") |
| | | List<PieElementVO> countAllNoneCompletedWorkByCommunityId(@Param("communityId") Long communityId); |
| | | |
| | | @Select(" SELECT AVG(b.t)AS avgTime " |
| | | + " FROM (SELECT TIMESTAMPDIFF(MINUTE,create_at,feedback_at) AS t FROM com_act_easy_photo WHERE community_id = ${communityId} and STATUS = 4 " |
| | | + " UNION ALL SELECT TIMESTAMPDIFF(MINUTE,create_at,finish_at) AS t FROM com_act_micro_wish WHERE community_id = ${communityId} and STATUS = 6 " |
| | | + " )AS b ") |
| | | Map<String, Object> countAvgByCommunityId(@Param("communityId")Long communityId); |
| | | |
| | | void addHotNum(@Param("circleId") Long circleId,@Param("hotNum") Long hotNum); |
| | | |
| | | void addTopicHotNum(@Param("circleId") Long circleId,@Param("hotNum") Long hotNum); |
| | | |
| | | /** |
| | | * 获取大屏邻里圈展示图片 |
| | | * @param communityId |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | List<String> getAllImages(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); |
| | | |
| | | /** |
| | | * 获取大屏邻里圈展示文本内容 |
| | | * @param communityId |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | List<String> getContents(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); |
| | | |
| | | List<StatisticsCommVO> getIndexNeighborBaseData(@Param("communityId") Long communityId); |
| | | |
| | | List<StatisticsCommVO> getNeighborAddPolylineData(@Param("communityId") Long communityId); |
| | | |
| | | StatisticsCommVO getNeighborTotalPolylineDate(@Param("communityId") Long communityId, @Param("date") String date); |
| | | |
| | | IPage<ComActNeighborCircleAdminVO> indexNeighborList(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 13:40:53 |
| | | * @describe 邻里圈浏览记录表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_neighbor_circle_browse_west") |
| | | public class ComActNeighborCircleBrowseWestDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 邻里圈id |
| | | */ |
| | | private Long neighborId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 浏览时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActNeighborCircleBrowseDO{" + "id=" + id + ", neighborId=" + neighborId + ", userId=" + userId |
| | | + ", createAt=" + createAt + "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:45 |
| | | * @describe 邻里圈评论回复表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_neighbor_circle_comment_reply_west") |
| | | public class ComActNeighborCircleCommentReplyWestDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 邻里圈id |
| | | */ |
| | | private Long circleId; |
| | | |
| | | /** |
| | | * 评论id |
| | | */ |
| | | private Long commentId; |
| | | |
| | | /** |
| | | * 上级回复id |
| | | */ |
| | | private Long parentId; |
| | | |
| | | /** |
| | | * 上级回复用户id |
| | | */ |
| | | private Long parentUserId; |
| | | |
| | | /** |
| | | * 回复用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 回复内容 |
| | | */ |
| | | private String replyContent; |
| | | |
| | | /** |
| | | * 点赞数 |
| | | */ |
| | | private Integer fabulousNum; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 是否是作者回复(1.是 2.否) |
| | | */ |
| | | private Integer isRelease; |
| | | |
| | | /** |
| | | * 状态(1.显示 2.隐藏) |
| | | */ |
| | | private Integer status; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActNeighborCircleCommentReplyDO{" + "id=" + id + ", circleId=" + circleId + ", commentId=" |
| | | + commentId + ", parentId=" + parentId + ", parentUserId=" + parentUserId + ", userId=" + userId |
| | | + ", replyContent=" + replyContent + ", fabulousNum=" + fabulousNum + ", createAt=" + createAt |
| | | + ", isRelease=" + isRelease + "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:33 |
| | | * @describe 邻里圈评论表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_neighbor_circle_comment_west") |
| | | public class ComActNeighborCircleCommentWestDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 邻里圈id |
| | | */ |
| | | private Long circleId; |
| | | |
| | | /** |
| | | * 评论用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 评论内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 评论用户手机号 |
| | | */ |
| | | private String userPhone; |
| | | |
| | | /** |
| | | * 点赞数 |
| | | */ |
| | | private Integer fabulousNum; |
| | | |
| | | /** |
| | | * 状态(1.显示 2.隐藏) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 评论时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 是否是作者评论(1.是 2.否) |
| | | */ |
| | | private Integer isRelease; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActNeighborCircleCommentDO{" + "id=" + id + ", circleId=" + circleId + ", userId=" + userId |
| | | + ", content=" + content + ", userPhone=" + userPhone + ", fabulousNum=" + fabulousNum + ", status=" |
| | | + status + ", createAt=" + createAt + ", isRelease=" + isRelease + "}"; |
| | | } |
| | | |
| | | /** |
| | | * 是否是作者评论(1.是 2.否) |
| | | */ |
| | | public interface isRelease { |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:55 |
| | | * @describe 邻里圈点赞表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_neighbor_circle_fabulous_west") |
| | | public class ComActNeighborCircleFabulousWestDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 点赞类型(1.邻里圈 2.评论 3.回复) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 邻里圈id |
| | | */ |
| | | private Long circleId; |
| | | |
| | | /** |
| | | * 点赞上级id |
| | | */ |
| | | private Long parentId; |
| | | |
| | | /** |
| | | * 点赞用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 有效状态(1.有效 2.取消) |
| | | */ |
| | | private Integer isEffective; |
| | | |
| | | /** |
| | | * 点赞时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActNeighborCircleFabulousDO{" + "id=" + id + ", type=" + type + ", parentId=" + parentId |
| | | + ", userId=" + userId + ", isEffective=" + isEffective + ", createAt=" + createAt + ", updateAt=" |
| | | + updateAt + "}"; |
| | | } |
| | | |
| | | /** |
| | | * 有效状态(1.有效 2.取消) |
| | | */ |
| | | public interface isEffective { |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | |
| | | /** |
| | | * 点赞类型(1.邻里圈 2.评论 3.回复) |
| | | */ |
| | | public interface type { |
| | | int llq = 1; |
| | | int pl = 2; |
| | | int hf = 3; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-06 15:04:37 |
| | | * @describe 邻里圈话题表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_neighbor_circle_topic_west") |
| | | public class ComActNeighborCircleTopicWestDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 话题名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 状态(1.启用 2.禁用) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 热度 |
| | | */ |
| | | private Long hotNum; |
| | | |
| | | /** |
| | | * 邻里圈数量 |
| | | */ |
| | | private Integer count; |
| | | |
| | | /** |
| | | * 状态(1.启用 2.禁用) |
| | | */ |
| | | public interface status{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActNeighborCircleTopicDO{" + "id=" + id + ", name=" + name + ", status=" + status + ", createAt=" |
| | | + createAt + ", createBy=" + createBy + "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:20:49 |
| | | * @describe 邻里圈表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_neighbor_circle_west") |
| | | public class ComActNeighborCircleWestDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 发布人id |
| | | */ |
| | | private Long releaseId; |
| | | |
| | | /** |
| | | * 发布人电话 |
| | | */ |
| | | private String releasePhone; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 发布内容 |
| | | */ |
| | | private String releaseContent; |
| | | |
| | | /** |
| | | * 发布图片 |
| | | */ |
| | | private String releaseImages; |
| | | |
| | | /** |
| | | * 发布状态(1.待审核 2.显示 3.隐藏 4.驳回) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 驳回原因 |
| | | */ |
| | | private String refuseReason; |
| | | |
| | | /** |
| | | * 评论数 |
| | | */ |
| | | private Integer commentNum; |
| | | |
| | | /** |
| | | * 点赞数 |
| | | */ |
| | | private Integer fabulousNum; |
| | | |
| | | /** |
| | | * 转发数 |
| | | */ |
| | | private Integer forwardNum; |
| | | |
| | | /** |
| | | * 浏览量 |
| | | */ |
| | | private Integer viewsNum; |
| | | |
| | | /** |
| | | * 是否为精品帖(1.是 2.否) |
| | | */ |
| | | private Integer isBoutique; |
| | | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 最后回复时间 |
| | | */ |
| | | private Date replyAt; |
| | | |
| | | /** |
| | | * 近3天评论数 |
| | | */ |
| | | private Integer lastCommentNum; |
| | | |
| | | /** |
| | | * 近3天评论数 |
| | | */ |
| | | private Integer lastFabulousNum; |
| | | |
| | | /** |
| | | * 近3天评论数 |
| | | */ |
| | | private Integer lastViewsNum; |
| | | |
| | | /** |
| | | * 话题id |
| | | */ |
| | | private Long topicId; |
| | | |
| | | /** |
| | | * 发布类型(1.小程序发布 2.后台发布) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 热度 |
| | | */ |
| | | private Long hotNum; |
| | | |
| | | /** |
| | | * 是否已删除(1.是 2.否) |
| | | */ |
| | | private Integer isDel; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActNeighborCircleDO{" + "id=" + id + ", releaseId=" + releaseId + ", releasePhone=" + releasePhone |
| | | + ", communityId=" + communityId + ", releaseContent=" + releaseContent + ", releaseImages=" + releaseImages |
| | | + ", status=" + status + ", refuseReason=" + refuseReason + ", commentNum=" + commentNum + ", fabulousNum=" |
| | | + fabulousNum + ", forwardNum=" + forwardNum + ", isBoutique=" + isBoutique + ", createAt=" + createAt |
| | | + "}"; |
| | | } |
| | | |
| | | /** |
| | | * 发布状态(1.待审核 2.显示 3.隐藏 4.驳回) |
| | | */ |
| | | public interface status { |
| | | int dsh = 1; |
| | | int xs = 2; |
| | | int yc = 3; |
| | | int bh = 4; |
| | | } |
| | | |
| | | /** |
| | | * 发布类型(1.小程序发布 2.后台发布) |
| | | */ |
| | | public interface type { |
| | | int mini = 1; |
| | | int admin = 2; |
| | | } |
| | | |
| | | /** |
| | | * 是否已删除(1.是 2.否) |
| | | */ |
| | | public interface isDel{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleBrowseWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 13:40:53 |
| | | * @describe 邻里圈浏览记录表服务类 |
| | | */ |
| | | public interface ComActNeighborCircleBrowseWestService extends IService<ComActNeighborCircleBrowseWestDO> { |
| | | |
| | | /** |
| | | * 添加邻里圈浏览记录 |
| | | * |
| | | * @param neighborId |
| | | * 邻里圈id |
| | | * @param userId |
| | | * 用户id |
| | | */ |
| | | void addBrowseRecord(Long neighborId, Long userId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentReplyWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:45 |
| | | * @describe 邻里圈评论回复表服务类 |
| | | */ |
| | | public interface ComActNeighborCircleCommentReplyWestService extends IService<ComActNeighborCircleCommentReplyWestDO> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:33 |
| | | * @describe 邻里圈评论表服务类 |
| | | */ |
| | | public interface ComActNeighborCircleCommentWestService extends IService<ComActNeighborCircleCommentWestDO> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleFabulousWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:55 |
| | | * @describe 邻里圈点赞表服务类 |
| | | */ |
| | | public interface ComActNeighborCircleFabulousWestService extends IService<ComActNeighborCircleFabulousWestDO> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddNeighborCircleTopicAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleTopicWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-06 15:04:37 |
| | | * @describe 邻里圈话题表服务类 |
| | | */ |
| | | public interface ComActNeighborCircleTopicWestService extends IService<ComActNeighborCircleTopicWestDO> { |
| | | |
| | | /** |
| | | * 分页查询邻里圈话题列表 |
| | | * |
| | | * @param circleTopicAdminDTO |
| | | * 请求参数 |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | R pageNeighborTopicByAdmin(ComActNeighborCircleTopicAdminDTO circleTopicAdminDTO); |
| | | |
| | | /** |
| | | * 添加邻里圈话题 |
| | | * |
| | | * @param addCircleTopicAdminDTO |
| | | * 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | R addNeighborTopicByAdmin(AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO); |
| | | |
| | | /** |
| | | * 编辑邻里圈话题 |
| | | * |
| | | * @param addCircleTopicAdminDTO |
| | | * 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | R editNeighborTopicByAdmin(AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO); |
| | | |
| | | /** |
| | | * 小程序查询邻里圈话题列表 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | R getNeighborTopicByApp(Long communityId,Integer isZero,String name); |
| | | |
| | | /** |
| | | * 小程序-用户新增话题 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | R addNeighborTopicByApp(AddNeighborCircleTopicAppDTO circleTopicAppDTO); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.AddNeighborCircleAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ChangeCommentReplyStatusByAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ChangeCommentStatusByAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.EditNeighborCircleAdminVO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleWestDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:20:49 |
| | | * @describe 邻里圈表服务类 |
| | | */ |
| | | public interface ComActNeighborCircleWestService extends IService<ComActNeighborCircleWestDO> { |
| | | |
| | | /** |
| | | * 分页查询邻里圈列表 |
| | | * |
| | | * @param neighborCircleAppDTO |
| | | * 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | R pageNeighborByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO); |
| | | |
| | | /** |
| | | * 用户发布邻里圈审核 |
| | | * |
| | | * @param addNeighborCircleAppDTO |
| | | * 邻里圈请求参数 |
| | | * @return 发布结果 |
| | | */ |
| | | R addNeighborByApp(AddComActNeighborCircleAppDTO addNeighborCircleAppDTO); |
| | | |
| | | /** |
| | | * 查看邻里圈详情 |
| | | * |
| | | * @param neighborCircleAppDTO |
| | | * 请求参数 |
| | | * @return 邻里圈详情 |
| | | */ |
| | | R neighborDetailByApp(ComActNeighborCircleDetailAppDTO neighborCircleAppDTO); |
| | | |
| | | /** |
| | | * 管理后台查询邻里圈列表 |
| | | * |
| | | * @return |
| | | */ |
| | | R pageNeighborByAdmin(ComActNeighborCircleAdminDTO comActNeighborCircleAdminDTO); |
| | | |
| | | /** |
| | | * 邻里圈_添加 |
| | | * |
| | | * @param addNeighborCircleAdminVO |
| | | * @return |
| | | */ |
| | | R addNeighborByAdmin(AddNeighborCircleAdminVO addNeighborCircleAdminVO); |
| | | |
| | | /** |
| | | * 邻里圈_修改 |
| | | * |
| | | * @param editNeighborCircleAdminVO |
| | | * @return |
| | | */ |
| | | R changeStatusByAdmin(EditNeighborCircleAdminVO editNeighborCircleAdminVO); |
| | | |
| | | /** |
| | | * 后台删除未审核的邻里圈(待审核状态不可删除,显示、隐藏、已驳回的都可以删除) |
| | | * |
| | | * @return |
| | | */ |
| | | R deleteByAdmin(Long id); |
| | | |
| | | /** |
| | | * 查看邻里圈基础_详情 |
| | | * |
| | | * @param id |
| | | * 邻里圈id |
| | | * @return |
| | | */ |
| | | R detailNeighborByAdmin(Long id); |
| | | |
| | | /** |
| | | * 邻里圈的所有评论_分页 |
| | | * |
| | | * @param detailNeighborAllCommentByAdminDTO |
| | | * 参数 |
| | | * @return |
| | | */ |
| | | R detailNeighborAllCommentByAdmin(DetailNeighborAllCommentByAdminDTO detailNeighborAllCommentByAdminDTO); |
| | | |
| | | /** |
| | | * 评论的状态_修改 |
| | | * |
| | | * @param changeStatusComment |
| | | * @return |
| | | */ |
| | | R changeCommentStatusByAdmin(ChangeCommentStatusByAdminVO changeStatusComment); |
| | | |
| | | /** |
| | | * 邻里圈评论_详情 |
| | | * |
| | | * @param id |
| | | * 评论id |
| | | * @return |
| | | */ |
| | | R detailNeighborCommentByAdmin(Long id); |
| | | |
| | | /** |
| | | * 邻里圈评论回复_分页 |
| | | * |
| | | * @param dto |
| | | * 参数 |
| | | * @return |
| | | */ |
| | | R detailNeighborCommentAllReply(DetailNeighborCommentReplyByAdminDTO dto); |
| | | |
| | | /** |
| | | * 邻里圈评论回复_基本详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R detailNeighborCommentReply(Long id); |
| | | |
| | | /** |
| | | * 评论的回复状态_修改 |
| | | * |
| | | * @param changeStatusReplyVO |
| | | * @return |
| | | */ |
| | | R changeCommentReplyStatusByAdmin(ChangeCommentReplyStatusByAdminVO changeStatusReplyVO); |
| | | |
| | | /** |
| | | * 用户查询邻里圈列表 |
| | | * |
| | | * @param neighborCircleAppDTO |
| | | * 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | R neighborExamineByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO); |
| | | |
| | | /** |
| | | * 邻里圈点赞 |
| | | * |
| | | * @param fabulousAppDTO |
| | | * 请求参数 |
| | | * @return 点赞结果 |
| | | */ |
| | | R neighborFabulousByApp(ComActNeighborFabulousAppDTO fabulousAppDTO); |
| | | |
| | | /** |
| | | * 邻里圈转发 |
| | | * |
| | | * @param forwardAppDTO |
| | | * 请求参数 |
| | | * @return 转发结果 |
| | | */ |
| | | R neighborForwardByApp(ComActNeighborForwardAppDTO forwardAppDTO); |
| | | |
| | | /** |
| | | * 邻里圈评论 |
| | | * |
| | | * @param commentAppDTO |
| | | * 请求参数 |
| | | * @return 评论结果 |
| | | */ |
| | | R neighborCommentByApp(ComActNeighborCommentAppDTO commentAppDTO); |
| | | |
| | | /** |
| | | * 邻里圈回复 |
| | | * |
| | | * @param replyAppDTO |
| | | * 请求参数 |
| | | * @return 回复结果 |
| | | */ |
| | | R neighborReplyByApp(ComActNeighborReplyAppDTO replyAppDTO); |
| | | |
| | | /** |
| | | * 定时任务更新邻里圈近3天评论数/点赞数/浏览量 |
| | | * |
| | | * @return 执行结果 |
| | | */ |
| | | R timeTaskCircleFlow(); |
| | | |
| | | /** |
| | | * 邻里圈取消点赞 |
| | | * |
| | | * @param fabulousAppDTO |
| | | * 请求参数 |
| | | * @return 取消点赞结果 |
| | | */ |
| | | R neighborFabulousCancelByApp(ComActNeighborFabulousAppDTO fabulousAppDTO); |
| | | |
| | | /** |
| | | * 添加邻里圈浏览记录 |
| | | * |
| | | * @param addBrowseAppDTO |
| | | * 请求参数 |
| | | * @return 返回参数 |
| | | */ |
| | | R neighborAddBrowseByApp(ComActNeighborAddBrowseAppDTO addBrowseAppDTO); |
| | | |
| | | /** |
| | | * 分页查询评论下所有回复 |
| | | * |
| | | * @param commentReplyAppDTO |
| | | * 请求参数 |
| | | * @return 回复列表 |
| | | */ |
| | | R neighborCommentReplyByApp(ComActNeighborCommentReplyAppDTO commentReplyAppDTO); |
| | | |
| | | /** |
| | | * 小程序-删除邻里圈 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | R deleteNeighborByApp(DeleteNeighborCircleAppDTO circleTopicAppDTO); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleBrowseWestDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleBrowseWestDO; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleBrowseWestService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 13:40:53 |
| | | * @describe 邻里圈浏览记录表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActNeighborCircleBrowseWestServiceImpl |
| | | extends ServiceImpl<ComActNeighborCircleBrowseWestDAO, ComActNeighborCircleBrowseWestDO> |
| | | implements ComActNeighborCircleBrowseWestService { |
| | | |
| | | /** |
| | | * 添加邻里圈浏览记录 |
| | | * |
| | | * @param neighborId |
| | | * 邻里圈id |
| | | * @param userId |
| | | * 用户id |
| | | */ |
| | | public void addBrowseRecord(Long neighborId, Long userId) { |
| | | ComActNeighborCircleBrowseWestDO circleBrowseDO = new ComActNeighborCircleBrowseWestDO(); |
| | | circleBrowseDO.setNeighborId(neighborId); |
| | | circleBrowseDO.setUserId(userId); |
| | | this.baseMapper.insert(circleBrowseDO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleCommentReplyWestDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentReplyWestDO; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleCommentReplyWestService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:45 |
| | | * @describe 邻里圈评论回复表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActNeighborCircleCommentReplyWestServiceImpl |
| | | extends ServiceImpl<ComActNeighborCircleCommentReplyWestDAO, ComActNeighborCircleCommentReplyWestDO> |
| | | implements ComActNeighborCircleCommentReplyWestService { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleCommentWestDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentWestDO; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleCommentWestService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:33 |
| | | * @describe 邻里圈评论表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActNeighborCircleCommentWestServiceImpl |
| | | extends ServiceImpl<ComActNeighborCircleCommentWestDAO, ComActNeighborCircleCommentWestDO> |
| | | implements ComActNeighborCircleCommentWestService { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleFabulousWestDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleFabulousWestDO; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleFabulousWestService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:21:55 |
| | | * @describe 邻里圈点赞表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActNeighborCircleFabulousWestServiceImpl |
| | | extends ServiceImpl<ComActNeighborCircleFabulousWestDAO, ComActNeighborCircleFabulousWestDO> |
| | | implements ComActNeighborCircleFabulousWestService { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddNeighborCircleTopicAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleTopicWestMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleTopicWestDO; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleTopicWestService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-06 15:04:37 |
| | | * @describe 邻里圈话题表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActNeighborCircleTopicWestServiceImpl |
| | | extends ServiceImpl<ComActNeighborCircleTopicWestMapper, ComActNeighborCircleTopicWestDO> |
| | | implements ComActNeighborCircleTopicWestService { |
| | | |
| | | /** |
| | | * 分页查询邻里圈话题列表 |
| | | * |
| | | * @param circleTopicAdminDTO |
| | | * 请求参数 |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | @Override |
| | | public R pageNeighborTopicByAdmin(ComActNeighborCircleTopicAdminDTO circleTopicAdminDTO) { |
| | | return R.ok(this.baseMapper.pageNeighborTopicByAdmin( |
| | | new Page(circleTopicAdminDTO.getPageNum(), circleTopicAdminDTO.getPageSize()), circleTopicAdminDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 添加邻里圈话题 |
| | | * |
| | | * @param addCircleTopicAdminDTO |
| | | * 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @Override |
| | | public R addNeighborTopicByAdmin(AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO) { |
| | | ComActNeighborCircleTopicWestDO circleTopicDO = |
| | | this.baseMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicWestDO>().lambda() |
| | | .eq(ComActNeighborCircleTopicWestDO::getName, addCircleTopicAdminDTO.getName()) |
| | | .eq(ComActNeighborCircleTopicWestDO::getCommunityId, addCircleTopicAdminDTO.getCommunityId())); |
| | | if (circleTopicDO != null) { |
| | | return R.fail("该话题已存在"); |
| | | } |
| | | circleTopicDO = new ComActNeighborCircleTopicWestDO(); |
| | | BeanUtils.copyProperties(addCircleTopicAdminDTO, circleTopicDO); |
| | | circleTopicDO.setCreateAt(new Date()); |
| | | circleTopicDO.setCreateBy(addCircleTopicAdminDTO.getUserId()); |
| | | |
| | | if (this.baseMapper.insert(circleTopicDO) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | /** |
| | | * 编辑邻里圈话题 |
| | | * |
| | | * @param addCircleTopicAdminDTO |
| | | * 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @Override |
| | | public R editNeighborTopicByAdmin(AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO) { |
| | | |
| | | ComActNeighborCircleTopicWestDO circleTopicDO = this.baseMapper.selectById(addCircleTopicAdminDTO.getId()); |
| | | if (circleTopicDO == null) { |
| | | return R.fail("未找到邻里圈话题记录"); |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(addCircleTopicAdminDTO.getName())) { |
| | | ComActNeighborCircleTopicWestDO oldCircleTopicDO = |
| | | this.baseMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicWestDO>().lambda() |
| | | .eq(ComActNeighborCircleTopicWestDO::getName, addCircleTopicAdminDTO.getName()) |
| | | .eq(ComActNeighborCircleTopicWestDO::getCommunityId, addCircleTopicAdminDTO.getCommunityId()) |
| | | .ne(ComActNeighborCircleTopicWestDO::getId, circleTopicDO.getId())); |
| | | if (oldCircleTopicDO != null && !oldCircleTopicDO.getId().equals(addCircleTopicAdminDTO.getId())) { |
| | | return R.fail("该话题已存在"); |
| | | } |
| | | } |
| | | |
| | | BeanUtils.copyProperties(addCircleTopicAdminDTO, circleTopicDO); |
| | | if (this.baseMapper.updateById(circleTopicDO) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("修改失败"); |
| | | } |
| | | |
| | | /** |
| | | * 小程序查询邻里圈话题列表 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | @Override |
| | | public R getNeighborTopicByApp(Long communityId,Integer isZero,String name){ |
| | | return R.ok(this.baseMapper.getNeighborTopicByApp(communityId,isZero,name)); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-用户新增话题 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | public R addNeighborTopicByApp(AddNeighborCircleTopicAppDTO circleTopicAppDTO){ |
| | | ComActNeighborCircleTopicWestDO circleTopicDO = this.baseMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicWestDO>() |
| | | .lambda().eq(ComActNeighborCircleTopicWestDO::getCommunityId,circleTopicAppDTO.getCommunityId()) |
| | | .eq(ComActNeighborCircleTopicWestDO::getName,circleTopicAppDTO.getName())); |
| | | if(circleTopicDO == null){ |
| | | circleTopicDO = new ComActNeighborCircleTopicWestDO(); |
| | | circleTopicDO.setCommunityId(circleTopicAppDTO.getCommunityId()); |
| | | circleTopicDO.setName(circleTopicAppDTO.getName()); |
| | | circleTopicDO.setCreateBy(circleTopicAppDTO.getUserId()); |
| | | circleTopicDO.setCreateAt(new Date()); |
| | | circleTopicDO.setCount(0); |
| | | circleTopicDO.setHotNum(0L); |
| | | circleTopicDO.setStatus(ComActNeighborCircleTopicWestDO.status.yes); |
| | | this.baseMapper.insert(circleTopicDO); |
| | | } |
| | | return R.ok(circleTopicDO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleTopicWestService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.constants.NeighborCircleConstants; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleBrowseWestService; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleWestService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-28 09:20:49 |
| | | * @describe 邻里圈表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActNeighborCircleWestServiceImpl extends ServiceImpl<ComActNeighborCircleWestDAO, ComActNeighborCircleWestDO> |
| | | implements ComActNeighborCircleWestService { |
| | | |
| | | @Resource |
| | | ComActNeighborCircleFabulousWestDAO neighborCircleFabulousDAO; |
| | | @Resource |
| | | ComActNeighborCircleBrowseWestDAO neighborCircleBrowseDAO; |
| | | @Resource |
| | | ComActNeighborCircleCommentWestDAO neighborCircleCommentDAO; |
| | | @Resource |
| | | ComActNeighborCircleCommentReplyWestDAO neighborCircleCommentReplyDAO; |
| | | @Resource |
| | | private ComActNeighborCircleBrowseWestService comActNeighborCircleBrowseWestService; |
| | | @Resource |
| | | private ComActNeighborCircleCommentWestDAO comActNeighborCircleCommentWestDAO; |
| | | @Resource |
| | | private ComActNeighborCircleCommentReplyWestDAO comActNeighborCircleCommentReplyWestDAO; |
| | | @Resource |
| | | private ComActNeighborCircleFabulousWestDAO comActNeighborCircleFabulousWestDAO; |
| | | @Resource |
| | | private ComActNeighborCircleBrowseWestDAO comActNeighborCircleBrowseWestDAO; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComActNeighborCircleTopicWestMapper comActNeighborCircleTopicWestMapper; |
| | | @Resource |
| | | private ComActNeighborCircleTopicWestService comActNeighborCircleTopicWestService; |
| | | |
| | | /** |
| | | * 分页查询邻里圈列表 |
| | | * |
| | | * @param neighborCircleAppDTO |
| | | * 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @Override |
| | | public R pageNeighborByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | Page userPage = new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize()); |
| | | IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageNeighborByApp(userPage, neighborCircleAppDTO); |
| | | if (!doPager.getRecords().isEmpty()) { |
| | | for (ComActNeighborCircleAppVO circleAppVO : doPager.getRecords()) { |
| | | if (neighborCircleAppDTO.getUserId() != null) { |
| | | // 查询点赞信息 |
| | | ComActNeighborCircleFabulousWestDO circleFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>() |
| | | .lambda().eq(ComActNeighborCircleFabulousWestDO::getParentId, circleAppVO.getId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getUserId, neighborCircleAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborCircleFabulousWestDO.type.llq) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (circleFabulousDO != null) { |
| | | circleAppVO.setHaveSign(1); |
| | | } else { |
| | | circleAppVO.setHaveSign(2); |
| | | } |
| | | } |
| | | |
| | | if (circleAppVO.getType() != null && circleAppVO.getType().equals(ComActNeighborCircleWestDO.type.admin)) { |
| | | ComActDO actDO = comActDAO.selectById(circleAppVO.getCommunityId()); |
| | | if (actDO != null) { |
| | | circleAppVO.setName(actDO.getName()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.ok(doPager); |
| | | } |
| | | |
| | | /** |
| | | * 用户发布邻里圈审核 |
| | | * |
| | | * @param addNeighborCircleAppDTO |
| | | * 邻里圈请求参数 |
| | | * @return 发布结果 |
| | | */ |
| | | @Override |
| | | public R addNeighborByApp(AddComActNeighborCircleAppDTO addNeighborCircleAppDTO) { |
| | | // 新增邻里圈审核 |
| | | ComActNeighborCircleWestDO neighborCircleDO = new ComActNeighborCircleWestDO(); |
| | | BeanUtils.copyProperties(addNeighborCircleAppDTO, neighborCircleDO); |
| | | if (addNeighborCircleAppDTO.getUserId() != null) { |
| | | neighborCircleDO.setReleaseId(addNeighborCircleAppDTO.getUserId()); |
| | | } |
| | | if (addNeighborCircleAppDTO.getCommunityId() != null) { |
| | | neighborCircleDO.setCommunityId(addNeighborCircleAppDTO.getCommunityId()); |
| | | } |
| | | if (StringUtils.isNotEmpty(addNeighborCircleAppDTO.getPhone())) { |
| | | neighborCircleDO.setReleasePhone(addNeighborCircleAppDTO.getPhone()); |
| | | } |
| | | //判断用户的话题是否是新增的 |
| | | if(StringUtils.isNotEmpty(addNeighborCircleAppDTO.getTopicName())){ |
| | | //新增邻里圈话题 |
| | | ComActNeighborCircleTopicWestDO circleTopicDO = comActNeighborCircleTopicWestMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicWestDO>() |
| | | .lambda().eq(ComActNeighborCircleTopicWestDO::getCommunityId,neighborCircleDO.getCommunityId()) |
| | | .eq(ComActNeighborCircleTopicWestDO::getName,addNeighborCircleAppDTO.getTopicName())); |
| | | if(circleTopicDO == null){ |
| | | circleTopicDO = new ComActNeighborCircleTopicWestDO(); |
| | | circleTopicDO.setCommunityId(neighborCircleDO.getCommunityId()); |
| | | circleTopicDO.setName(addNeighborCircleAppDTO.getTopicName()); |
| | | circleTopicDO.setCreateBy(neighborCircleDO.getReleaseId()); |
| | | circleTopicDO.setCreateAt(new Date()); |
| | | circleTopicDO.setCount(0); |
| | | circleTopicDO.setHotNum(0L); |
| | | circleTopicDO.setStatus(ComActNeighborCircleTopicWestDO.status.yes); |
| | | comActNeighborCircleTopicWestMapper.insert(circleTopicDO); |
| | | } |
| | | neighborCircleDO.setTopicId(circleTopicDO.getId()); |
| | | } |
| | | //判断当前邻里圈是否需要审核 |
| | | if(addNeighborCircleAppDTO.getIsExamine().equals(AddComActNeighborCircleAppDTO.isExamine.no)){ |
| | | //当邻里圈不需要审核才进入自动审核 |
| | | //判断邻里圈自动审核结果 |
| | | if(addNeighborCircleAppDTO.getWxExamineResult().equals(AddComActNeighborCircleAppDTO.isExamine.yes)){ |
| | | neighborCircleDO.setStatus(ComActNeighborCircleWestDO.status.xs); |
| | | if(neighborCircleDO.getTopicId() != null){ |
| | | //给邻里圈话题添加邻里圈数量 |
| | | comActNeighborCircleTopicWestMapper.addCount(neighborCircleDO.getTopicId()); |
| | | } |
| | | }else{ |
| | | neighborCircleDO.setStatus(ComActNeighborCircleWestDO.status.bh); |
| | | neighborCircleDO.setRefuseReason("内容违规"); |
| | | } |
| | | } |
| | | |
| | | if(this.baseMapper.insert(neighborCircleDO) > 0){ |
| | | return R.ok(); |
| | | } else { |
| | | return R.fail("发布失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查看邻里圈详情 |
| | | * |
| | | * @param neighborCircleAppDTO |
| | | * 请求参数 |
| | | * @return 邻里圈详情 |
| | | */ |
| | | @Override |
| | | public R neighborDetailByApp(ComActNeighborCircleDetailAppDTO neighborCircleAppDTO) { |
| | | |
| | | // 查询邻里圈详情 |
| | | ComActNeighborCircleDetailAppVO circleDetailAppVO = |
| | | this.baseMapper.neighborDetailByApp(neighborCircleAppDTO.getCircleId()); |
| | | if (circleDetailAppVO == null) { |
| | | return R.fail("未找到邻里圈信息"); |
| | | } |
| | | |
| | | if (circleDetailAppVO.getType() != null |
| | | && circleDetailAppVO.getType().equals(ComActNeighborCircleWestDO.type.admin)) { |
| | | ComActDO actDO = comActDAO.selectById(circleDetailAppVO.getCommunityId()); |
| | | if (actDO != null) { |
| | | circleDetailAppVO.setName(actDO.getName()); |
| | | } |
| | | } |
| | | |
| | | if (neighborCircleAppDTO.getUserId() != null) { |
| | | // 查询邻里圈点赞信息 |
| | | ComActNeighborCircleFabulousWestDO circleFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>().lambda() |
| | | .eq(ComActNeighborCircleFabulousWestDO::getParentId, circleDetailAppVO.getId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getUserId, neighborCircleAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborCircleFabulousWestDO.type.llq) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (circleFabulousDO != null) { |
| | | circleDetailAppVO.setHaveSign(1); |
| | | } else { |
| | | circleDetailAppVO.setHaveSign(2); |
| | | } |
| | | } |
| | | |
| | | // 查询邻里圈下评论列表 |
| | | IPage<ComActNeighborCircleCommentAppVO> circleCommentAppPage = |
| | | comActNeighborCircleCommentWestDAO.pageNeighborCommentByApp( |
| | | new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize()), neighborCircleAppDTO); |
| | | if (!circleCommentAppPage.getRecords().isEmpty()) { |
| | | for (ComActNeighborCircleCommentAppVO circleCommentVo : circleCommentAppPage.getRecords()) { |
| | | |
| | | if (neighborCircleAppDTO.getUserId() != null) { |
| | | // 查询点赞信息 |
| | | ComActNeighborCircleFabulousWestDO circleCommentFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>() |
| | | .lambda().eq(ComActNeighborCircleFabulousWestDO::getParentId, circleCommentVo.getId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getUserId, neighborCircleAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborCircleFabulousWestDO.type.pl) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (circleCommentFabulousDO != null) { |
| | | circleCommentVo.setHaveSign(1); |
| | | } else { |
| | | circleCommentVo.setHaveSign(2); |
| | | } |
| | | } |
| | | |
| | | // 查询评论下评论回复 |
| | | List<ComActNeighborCircleCommentReplyAppVO> commentReplyAppVOS = |
| | | comActNeighborCircleCommentReplyWestDAO.getCircleCommentReplyList(circleCommentVo.getId()); |
| | | if (!commentReplyAppVOS.isEmpty()) { |
| | | List<ComActNeighborCircleCommentReplyAppVO> newCommentReplyAppVOS = new ArrayList<>(); |
| | | if (neighborCircleAppDTO.getUserId() != null) { |
| | | int i = 0; |
| | | for (ComActNeighborCircleCommentReplyAppVO commentReplyVO : commentReplyAppVOS) { |
| | | if (i >= 2) { |
| | | break; |
| | | } |
| | | // 查询点赞信息 |
| | | ComActNeighborCircleFabulousWestDO circleReplyFabulousDO = comActNeighborCircleFabulousWestDAO |
| | | .selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>().lambda() |
| | | .eq(ComActNeighborCircleFabulousWestDO::getParentId, commentReplyVO.getId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getUserId, neighborCircleAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborCircleFabulousWestDO.type.hf) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (circleReplyFabulousDO != null) { |
| | | commentReplyVO.setHaveSign(1); |
| | | } else { |
| | | commentReplyVO.setHaveSign(2); |
| | | } |
| | | newCommentReplyAppVOS.add(commentReplyVO); |
| | | i++; |
| | | } |
| | | } |
| | | circleCommentVo.setCircleCommentReplyAppList(newCommentReplyAppVOS); |
| | | circleCommentVo.setCommentReplyNum(commentReplyAppVOS.size()); |
| | | } |
| | | } |
| | | } |
| | | circleDetailAppVO.setCircleCommentAppList(circleCommentAppPage.getRecords()); |
| | | return R.ok(circleDetailAppVO); |
| | | } |
| | | |
| | | @Override |
| | | public R pageNeighborByAdmin(ComActNeighborCircleAdminDTO neighborCircleAdminDTO) { |
| | | Page page = new Page(neighborCircleAdminDTO.getPageNum(), neighborCircleAdminDTO.getPageSize()); |
| | | IPage<ComActNeighborCircleAdminVO> doPager = this.baseMapper.pageNeighborByAdmin(page, neighborCircleAdminDTO); |
| | | doPager.getRecords().forEach(data -> { |
| | | if(data.getUserType()!=null){ |
| | | if (data.getUserType() != 1) { |
| | | data.setReleaseName(data.getCommunityName()); |
| | | } |
| | | } |
| | | }); |
| | | return R.ok(doPager); |
| | | } |
| | | |
| | | @Override |
| | | public R addNeighborByAdmin(AddNeighborCircleAdminVO addVO) { |
| | | ComActNeighborCircleWestDO comActNeighborCircleWestDO = new ComActNeighborCircleWestDO(); |
| | | AdministratorsUserVO adminUser = this.baseMapper.selectUserByUserId(addVO.getUserId()); |
| | | if (adminUser == null) { |
| | | return R.fail("请登录重试"); |
| | | } |
| | | comActNeighborCircleWestDO.setReleaseId(addVO.getUserId()); |
| | | comActNeighborCircleWestDO.setReleasePhone(adminUser.getPhone()); |
| | | comActNeighborCircleWestDO.setCommunityId(adminUser.getCommunityId()); |
| | | comActNeighborCircleWestDO.setReleaseContent(addVO.getReleaseContent()); |
| | | comActNeighborCircleWestDO.setReleaseImages(addVO.getReleaseImages()); |
| | | comActNeighborCircleWestDO.setType(2); |
| | | comActNeighborCircleWestDO.setStatus(2); |
| | | comActNeighborCircleWestDO.setCommentNum(0); |
| | | comActNeighborCircleWestDO.setFabulousNum(0); |
| | | comActNeighborCircleWestDO.setForwardNum(0); |
| | | comActNeighborCircleWestDO.setViewsNum(0); |
| | | comActNeighborCircleWestDO.setIsBoutique(2); |
| | | comActNeighborCircleWestDO.setCreateAt(new Date()); |
| | | comActNeighborCircleWestDO.setLastCommentNum(0); |
| | | comActNeighborCircleWestDO.setLastFabulousNum(0); |
| | | comActNeighborCircleWestDO.setLastViewsNum(0); |
| | | this.baseMapper.insert(comActNeighborCircleWestDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R changeStatusByAdmin(EditNeighborCircleAdminVO editVO) { |
| | | ComActNeighborCircleWestDO neighborCircleDO = this.baseMapper.selectById(editVO.getId()); |
| | | if (neighborCircleDO == null) { |
| | | return R.fail("id有误!"); |
| | | } |
| | | neighborCircleDO.setStatus(editVO.getStatus()); |
| | | if (editVO.getRefuseReason() != null) { |
| | | neighborCircleDO.setRefuseReason(editVO.getRefuseReason()); |
| | | } |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | |
| | | if(editVO.getStatus().equals(EditNeighborCircleAdminVO.status.xs) && neighborCircleDO.getTopicId() != null){ |
| | | //给邻里圈话题添加邻里圈数量 |
| | | comActNeighborCircleTopicWestMapper.addCount(neighborCircleDO.getTopicId()); |
| | | } |
| | | return R.ok(neighborCircleDO.getReleaseId()); |
| | | } |
| | | |
| | | /** |
| | | * 用户查询邻里圈列表 |
| | | * |
| | | * @param neighborCircleAppDTO |
| | | * 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @Override |
| | | public R neighborExamineByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | IPage<ComActNeighborCircleAppVO> neighborCircleIPage = this.baseMapper.neighborExamineByApp( |
| | | new Page<>(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize()), |
| | | neighborCircleAppDTO.getUserId()); |
| | | if (!neighborCircleIPage.getRecords().isEmpty()) { |
| | | for (ComActNeighborCircleAppVO circleAppVO : neighborCircleIPage.getRecords()) { |
| | | // 查询点赞信息 |
| | | ComActNeighborCircleFabulousWestDO circleFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>() |
| | | .lambda().eq(ComActNeighborCircleFabulousWestDO::getParentId, circleAppVO.getId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getUserId, neighborCircleAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborCircleFabulousWestDO.type.llq) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (circleFabulousDO != null) { |
| | | circleAppVO.setHaveSign(1); |
| | | } else { |
| | | circleAppVO.setHaveSign(2); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(neighborCircleIPage); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈点赞 |
| | | * |
| | | * @param fabulousAppDTO |
| | | * 请求参数 |
| | | * @return 点赞结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R neighborFabulousByApp(ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | |
| | | ComActNeighborCircleFabulousWestDO circleFabulousDO = new ComActNeighborCircleFabulousWestDO(); |
| | | circleFabulousDO.setUserId(fabulousAppDTO.getUserId()); |
| | | circleFabulousDO.setType(fabulousAppDTO.getType()); |
| | | circleFabulousDO.setParentId(fabulousAppDTO.getServiceId()); |
| | | // 判断点赞类型 |
| | | if (fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.llq)) { |
| | | |
| | | ComActNeighborCircleFabulousWestDO oldCircleFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>().lambda() |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborFabulousAppDTO.type.llq) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getParentId, fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, ComActNeighborCircleFabulousWestDO.isEffective.yes) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getUserId, fabulousAppDTO.getUserId())); |
| | | if (oldCircleFabulousDO != null) { |
| | | return R.fail("您已点赞"); |
| | | } |
| | | |
| | | // 增加邻里圈点赞数量 |
| | | ComActNeighborCircleWestDO neighborCircleDO = this.baseMapper.selectById(fabulousAppDTO.getServiceId()); |
| | | if (neighborCircleDO != null) { |
| | | neighborCircleDO.setFabulousNum(neighborCircleDO.getFabulousNum() + 1); |
| | | neighborCircleDO.setViewsNum(neighborCircleDO.getViewsNum() + 1); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM + NeighborCircleConstants.VIEW_HOT_NUM; |
| | | neighborCircleDO.setHotNum(neighborCircleDO.getHotNum() + hotNum); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | comActNeighborCircleTopicWestMapper.addHotNum(neighborCircleDO.getTopicId(),hotNum); |
| | | circleFabulousDO.setCircleId(neighborCircleDO.getId()); |
| | | } |
| | | // 添加邻里圈浏览记录 |
| | | comActNeighborCircleBrowseWestService.addBrowseRecord(fabulousAppDTO.getServiceId(), |
| | | fabulousAppDTO.getUserId()); |
| | | } else if (fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.pl)) { |
| | | ComActNeighborCircleFabulousWestDO oldCircleFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>().lambda() |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborFabulousAppDTO.type.pl) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getParentId, fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (oldCircleFabulousDO != null) { |
| | | return R.fail("您已点赞"); |
| | | } |
| | | // 增加邻里圈评论点赞数量 |
| | | ComActNeighborCircleCommentWestDO circleCommentDO = |
| | | comActNeighborCircleCommentWestDAO.selectById(fabulousAppDTO.getServiceId()); |
| | | if (circleCommentDO != null) { |
| | | circleCommentDO.setFabulousNum(circleCommentDO.getFabulousNum() + 1); |
| | | comActNeighborCircleCommentWestDAO.updateById(circleCommentDO); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM + NeighborCircleConstants.VIEW_HOT_NUM; |
| | | this.baseMapper.addTopicHotNum(circleCommentDO.getCircleId(),hotNum); |
| | | this.baseMapper.addHotNum(circleCommentDO.getCircleId(),hotNum); |
| | | circleFabulousDO.setCircleId(circleCommentDO.getCircleId()); |
| | | } |
| | | } else if (fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.hf)) { |
| | | ComActNeighborCircleFabulousWestDO oldCircleFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>().lambda() |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborFabulousAppDTO.type.hf) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getParentId, fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (oldCircleFabulousDO != null) { |
| | | return R.fail("您已点赞"); |
| | | } |
| | | // 增加邻里圈评论回复点赞数量 |
| | | ComActNeighborCircleCommentReplyWestDO circleCommentReplyDO = |
| | | comActNeighborCircleCommentReplyWestDAO.selectById(fabulousAppDTO.getServiceId()); |
| | | if (circleCommentReplyDO != null) { |
| | | circleCommentReplyDO.setFabulousNum(circleCommentReplyDO.getFabulousNum() + 1); |
| | | comActNeighborCircleCommentReplyWestDAO.updateById(circleCommentReplyDO); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM + NeighborCircleConstants.VIEW_HOT_NUM; |
| | | this.baseMapper.addTopicHotNum(circleCommentReplyDO.getCircleId(),hotNum); |
| | | this.baseMapper.addHotNum(circleCommentReplyDO.getCircleId(),hotNum); |
| | | circleFabulousDO.setCircleId(circleCommentReplyDO.getCircleId()); |
| | | } |
| | | } |
| | | if (comActNeighborCircleFabulousWestDAO.insert(circleFabulousDO) > 0) { |
| | | return R.ok(); |
| | | } else { |
| | | return R.fail("点赞失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈转发 |
| | | * |
| | | * @param forwardAppDTO |
| | | * 请求参数 |
| | | * @return 转发结果 |
| | | */ |
| | | @Override |
| | | public R neighborForwardByApp(ComActNeighborForwardAppDTO forwardAppDTO) { |
| | | |
| | | if (forwardAppDTO.getUserId() != null) { |
| | | // 添加邻里圈浏览记录 |
| | | comActNeighborCircleBrowseWestService.addBrowseRecord(forwardAppDTO.getCircleId(), forwardAppDTO.getUserId()); |
| | | } |
| | | |
| | | ComActNeighborCircleWestDO circleDO = this.baseMapper.selectById(forwardAppDTO.getCircleId()); |
| | | if (circleDO == null) { |
| | | return R.fail("没有找到邻里圈"); |
| | | } |
| | | circleDO.setForwardNum(circleDO.getForwardNum() + 1); |
| | | if (this.baseMapper.updateById(circleDO) > 0){ |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.VIEW_HOT_NUM; |
| | | this.baseMapper.addHotNum(forwardAppDTO.getCircleId(),hotNum); |
| | | this.baseMapper.addTopicHotNum(forwardAppDTO.getCircleId(),hotNum); |
| | | return R.ok(); |
| | | } else { |
| | | return R.fail("转发失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈评论 |
| | | * |
| | | * @param commentAppDTO |
| | | * 请求参数 |
| | | * @return 评论结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R neighborCommentByApp(ComActNeighborCommentAppDTO commentAppDTO) { |
| | | |
| | | ComActNeighborCircleCommentWestDO circleCommentDO = new ComActNeighborCircleCommentWestDO(); |
| | | // 查询邻里圈更新邻里圈评论数量 |
| | | ComActNeighborCircleWestDO neighborCircleDO = this.baseMapper.selectById(commentAppDTO.getCircleId()); |
| | | if (neighborCircleDO == null) { |
| | | return R.fail("没有找到邻里圈"); |
| | | } |
| | | neighborCircleDO.setCommentNum(neighborCircleDO.getCommentNum() + 1); |
| | | neighborCircleDO.setReplyAt(new Date()); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.COMMENT_HOT_NUM; |
| | | this.baseMapper.addHotNum(commentAppDTO.getCircleId(),hotNum); |
| | | this.baseMapper.addTopicHotNum(commentAppDTO.getCircleId(),hotNum); |
| | | |
| | | circleCommentDO.setCircleId(commentAppDTO.getCircleId()); |
| | | circleCommentDO.setUserId(commentAppDTO.getUserId()); |
| | | circleCommentDO.setUserPhone(commentAppDTO.getPhone()); |
| | | circleCommentDO.setContent(commentAppDTO.getContent()); |
| | | if (neighborCircleDO.getReleaseId().equals(commentAppDTO.getUserId())) { |
| | | circleCommentDO.setIsRelease(ComActNeighborCircleCommentWestDO.isRelease.yes); |
| | | } |
| | | |
| | | if (comActNeighborCircleCommentWestDAO.insert(circleCommentDO) > 0) { |
| | | return R.ok(); |
| | | } else { |
| | | return R.fail("评论失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈回复 |
| | | * |
| | | * @param replyAppDTO |
| | | * 请求参数 |
| | | * @return 回复结果 |
| | | */ |
| | | @Override |
| | | public R neighborReplyByApp(ComActNeighborReplyAppDTO replyAppDTO) { |
| | | |
| | | ComActNeighborCircleCommentReplyWestDO circleCommentReplyDO = new ComActNeighborCircleCommentReplyWestDO(); |
| | | // 查询邻里圈更新邻里圈评论数量 |
| | | ComActNeighborCircleWestDO neighborCircleDO = this.baseMapper.selectById(replyAppDTO.getCircleId()); |
| | | if (neighborCircleDO == null) { |
| | | return R.fail("没有找到邻里圈"); |
| | | } |
| | | neighborCircleDO.setCommentNum(neighborCircleDO.getCommentNum() + 1); |
| | | neighborCircleDO.setReplyAt(new Date()); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.COMMENT_HOT_NUM; |
| | | this.baseMapper.addHotNum(replyAppDTO.getCircleId(),hotNum); |
| | | this.baseMapper.addTopicHotNum(replyAppDTO.getCircleId(),hotNum); |
| | | |
| | | circleCommentReplyDO.setCircleId(replyAppDTO.getCircleId()); |
| | | circleCommentReplyDO.setUserId(replyAppDTO.getUserId()); |
| | | circleCommentReplyDO.setReplyContent(replyAppDTO.getContent()); |
| | | if (neighborCircleDO.getReleaseId().equals(replyAppDTO.getUserId())) { |
| | | circleCommentReplyDO.setIsRelease(1); |
| | | } |
| | | |
| | | // 判断回复类型 |
| | | if (replyAppDTO.getType().equals(ComActNeighborReplyAppDTO.type.pl)) { |
| | | // 查询评论信息 |
| | | ComActNeighborCircleCommentWestDO circleCommentDO = |
| | | comActNeighborCircleCommentWestDAO.selectById(replyAppDTO.getServiceId()); |
| | | if (circleCommentDO != null) { |
| | | circleCommentReplyDO.setCommentId(replyAppDTO.getServiceId()); |
| | | circleCommentReplyDO.setParentId(0L); |
| | | circleCommentReplyDO.setParentUserId(circleCommentDO.getUserId()); |
| | | } |
| | | } else if (replyAppDTO.getType().equals(ComActNeighborReplyAppDTO.type.hf)) { |
| | | // 查询上级回复信息 |
| | | ComActNeighborCircleCommentReplyWestDO parentCommentReplyDO = |
| | | comActNeighborCircleCommentReplyWestDAO.selectById(replyAppDTO.getServiceId()); |
| | | if (parentCommentReplyDO != null) { |
| | | circleCommentReplyDO.setCommentId(parentCommentReplyDO.getCommentId()); |
| | | circleCommentReplyDO.setParentId(parentCommentReplyDO.getId()); |
| | | circleCommentReplyDO.setParentUserId(parentCommentReplyDO.getUserId()); |
| | | } |
| | | } |
| | | |
| | | if (comActNeighborCircleCommentReplyWestDAO.insert(circleCommentReplyDO) > 0) { |
| | | return R.ok(); |
| | | } else { |
| | | return R.fail("回复失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public R timeTaskCircleFlow() { |
| | | Date oldDate = DateUtils.addDay(new Date(), -3); |
| | | // 查询所有状态正常的邻里圈 |
| | | List<ComActNeighborCircleWestDO> circleDOList = |
| | | this.baseMapper.selectList(new QueryWrapper<ComActNeighborCircleWestDO>().lambda() |
| | | .eq(ComActNeighborCircleWestDO::getStatus, ComActNeighborCircleWestDO.status.xs)); |
| | | if (!circleDOList.isEmpty()) { |
| | | // 遍历查询到的邻里圈,更新邻里圈内近3天的评论数,点赞数,浏览量 |
| | | for (ComActNeighborCircleWestDO neighborCircleDO : circleDOList) { |
| | | // 查询邻里圈近3天的评论数 |
| | | int commentCount = |
| | | comActNeighborCircleCommentWestDAO.selectCount(new QueryWrapper<ComActNeighborCircleCommentWestDO>() |
| | | .lambda().eq(ComActNeighborCircleCommentWestDO::getCircleId, neighborCircleDO.getId())); |
| | | // 查询邻里圈近3天的评论回复数 |
| | | int commentReplyCount = comActNeighborCircleCommentReplyWestDAO |
| | | .selectCount(new QueryWrapper<ComActNeighborCircleCommentReplyWestDO>().lambda() |
| | | .eq(ComActNeighborCircleCommentReplyWestDO::getCircleId, neighborCircleDO.getId())); |
| | | // 查询邻里圈近3天的点赞数 |
| | | int fabulousCount = |
| | | comActNeighborCircleFabulousWestDAO.selectCount(new QueryWrapper<ComActNeighborCircleFabulousWestDO>() |
| | | .lambda().eq(ComActNeighborCircleFabulousWestDO::getCircleId, neighborCircleDO.getId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | // 查询邻里圈近3天的浏览量 |
| | | int browseCount = |
| | | comActNeighborCircleBrowseWestDAO.selectCount(new QueryWrapper<ComActNeighborCircleBrowseWestDO>().lambda() |
| | | .eq(ComActNeighborCircleBrowseWestDO::getNeighborId, neighborCircleDO.getId())); |
| | | // 更新邻里圈信息 |
| | | neighborCircleDO.setLastCommentNum(commentCount + commentReplyCount); |
| | | neighborCircleDO.setLastFabulousNum(fabulousCount); |
| | | neighborCircleDO.setLastViewsNum(browseCount); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | } |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteByAdmin(Long id) { |
| | | ComActNeighborCircleWestDO comActNeighborCircleWestDO = this.baseMapper.selectById(id); |
| | | if (comActNeighborCircleWestDO == null) { |
| | | return R.fail(); |
| | | } |
| | | if (comActNeighborCircleWestDO.getStatus() == 1) { |
| | | return R.fail("待审核的邻里圈不能删除"); |
| | | } |
| | | // 邻里圈删除 |
| | | this.baseMapper.deleteById(id); |
| | | // 邻里圈评论删除 |
| | | neighborCircleCommentDAO.delete( |
| | | new LambdaQueryWrapper<ComActNeighborCircleCommentWestDO>().eq(ComActNeighborCircleCommentWestDO::getCircleId, id)); |
| | | // 邻里圈回复删除 |
| | | neighborCircleCommentReplyDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleCommentReplyWestDO>() |
| | | .eq(ComActNeighborCircleCommentReplyWestDO::getCircleId, id)); |
| | | // 邻里圈浏览器记录 |
| | | neighborCircleBrowseDAO.delete( |
| | | new LambdaQueryWrapper<ComActNeighborCircleBrowseWestDO>().eq(ComActNeighborCircleBrowseWestDO::getNeighborId, id)); |
| | | // 邻里圈点赞删除 |
| | | neighborCircleFabulousDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleFabulousWestDO>() |
| | | .eq(ComActNeighborCircleFabulousWestDO::getCircleId, id)); |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborByAdmin(Long id) { |
| | | ComActNeighborCircleWestDO comActNeighborCircleWestDO = this.baseMapper.selectById(id); |
| | | if (comActNeighborCircleWestDO == null) { |
| | | return R.fail("id有误"); |
| | | } |
| | | AdministratorsUserVO user = this.baseMapper.selectUserByUserId(comActNeighborCircleWestDO.getReleaseId()); |
| | | DetailNeighborCircleAdminVO vo = new DetailNeighborCircleAdminVO(); |
| | | BeanUtils.copyProperties(comActNeighborCircleWestDO, vo); |
| | | vo.setReleaseName(user.getName()); |
| | | vo.setImageUrl(user.getImageUrl()); |
| | | |
| | | // 查询话题名称 |
| | | if (comActNeighborCircleWestDO.getTopicId() != null) { |
| | | ComActNeighborCircleTopicWestDO circleTopicDO = |
| | | comActNeighborCircleTopicWestMapper.selectById(comActNeighborCircleWestDO.getTopicId()); |
| | | vo.setTopicName(circleTopicDO.getName()); |
| | | } |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborAllCommentByAdmin(DetailNeighborAllCommentByAdminDTO dto) { |
| | | ComActNeighborCircleWestDO comActNeighborCircleWestDO = this.baseMapper.selectById(dto.getId()); |
| | | if (comActNeighborCircleWestDO == null) { |
| | | return R.fail("id有误"); |
| | | } |
| | | Page<ComActNeighborCircleCommentWestDO> page = new Page<>(dto.getPageNum(), dto.getPageSize()); |
| | | // 1、先查询所有该邻里圈_的评论 |
| | | IPage<ComActNeighborCommentByAdminVO> commentDOIPage = |
| | | neighborCircleCommentDAO.selectPageDetailNeighborComment(page, dto); |
| | | return R.ok(commentDOIPage); |
| | | } |
| | | |
| | | @Override |
| | | public R changeCommentStatusByAdmin(ChangeCommentStatusByAdminVO dto) { |
| | | ComActNeighborCircleCommentWestDO commentDO = neighborCircleCommentDAO.selectById(dto.getId()); |
| | | if (commentDO == null) { |
| | | return R.fail("id有误!"); |
| | | } |
| | | commentDO.setStatus(dto.getStatus()); |
| | | neighborCircleCommentDAO.updateById(commentDO); |
| | | |
| | | // 查询邻里圈更新邻里圈评论数量 |
| | | ComActNeighborCircleWestDO neighborCircleDO = this.baseMapper.selectById(commentDO.getCircleId()); |
| | | if (neighborCircleDO != null) { |
| | | if (dto.getStatus().equals(2)) { |
| | | neighborCircleDO.setCommentNum(neighborCircleDO.getCommentNum() - 1); |
| | | } else { |
| | | neighborCircleDO.setCommentNum(neighborCircleDO.getCommentNum() + 1); |
| | | } |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborCommentByAdmin(Long id) { |
| | | ComActNeighborCircleCommentWestDO commentDO = neighborCircleCommentDAO.selectById(id); |
| | | if (commentDO == null) { |
| | | return R.fail("id有误!"); |
| | | } |
| | | AdministratorsUserVO user = this.baseMapper.selectUserByUserId(commentDO.getUserId()); |
| | | ComActNeighborCommentByAdminVO vo = new ComActNeighborCommentByAdminVO(); |
| | | BeanUtils.copyProperties(commentDO, vo); |
| | | String name = user.getName() == null ? user.getNickName() : user.getName(); |
| | | vo.setUserName(name); |
| | | vo.setUserPhone(user.getPhone()); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborCommentAllReply(DetailNeighborCommentReplyByAdminDTO dto) { |
| | | Page<ComActNeighborCircleCommentReplyWestDO> page = new Page<>(dto.getPageNum(), dto.getPageSize()); |
| | | Page<ComActNeighborCommentReplyByAdminVO> replyPage = |
| | | neighborCircleCommentReplyDAO.selectListByComment(page, dto); |
| | | replyPage.getRecords().forEach(reply -> { |
| | | |
| | | }); |
| | | return R.ok(replyPage); |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborCommentReply(Long id) { |
| | | ComActNeighborCircleCommentReplyWestDO replyDO = neighborCircleCommentReplyDAO.selectById(id); |
| | | if (replyDO == null) { |
| | | return R.fail("id有误!"); |
| | | } |
| | | AdministratorsUserVO user = this.baseMapper.selectUserByUserId(replyDO.getUserId()); |
| | | ComActNeighborCommentReplyByAdminVO vo = new ComActNeighborCommentReplyByAdminVO(); |
| | | BeanUtils.copyProperties(replyDO, vo); |
| | | vo.setUserName(user.getName()); |
| | | vo.setUserPhone(user.getPhone()); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | @Override |
| | | public R changeCommentReplyStatusByAdmin(ChangeCommentReplyStatusByAdminVO changeStatusReplyVO) { |
| | | ComActNeighborCircleCommentReplyWestDO replyDO = |
| | | neighborCircleCommentReplyDAO.selectById(changeStatusReplyVO.getId()); |
| | | if (replyDO == null) { |
| | | return R.fail("id有误!"); |
| | | } |
| | | replyDO.setStatus(changeStatusReplyVO.getStatus()); |
| | | neighborCircleCommentReplyDAO.updateById(replyDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈取消点赞 |
| | | * |
| | | * @param fabulousAppDTO |
| | | * 请求参数 |
| | | * @return 取消点赞结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R neighborFabulousCancelByApp(ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | ComActNeighborCircleFabulousWestDO circleFabulousDO = null; |
| | | // 查询邻里圈点赞信息 |
| | | if (fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.llq)) { |
| | | // 查询点赞信息 |
| | | circleFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>().lambda() |
| | | .eq(ComActNeighborCircleFabulousWestDO::getParentId, fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getUserId, fabulousAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborCircleFabulousWestDO.type.llq) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (circleFabulousDO == null) { |
| | | return R.fail("未查询到点赞信息"); |
| | | } |
| | | |
| | | // 减少邻里圈点赞数量 |
| | | ComActNeighborCircleWestDO neighborCircleDO = this.baseMapper.selectById(fabulousAppDTO.getServiceId()); |
| | | if (neighborCircleDO != null) { |
| | | neighborCircleDO.setFabulousNum(neighborCircleDO.getFabulousNum() - 1); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM; |
| | | this.baseMapper.addHotNum(neighborCircleDO.getId(),-hotNum); |
| | | this.baseMapper.addTopicHotNum(neighborCircleDO.getId(),-hotNum); |
| | | } |
| | | } else if (fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.pl)) { |
| | | circleFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>().lambda() |
| | | .eq(ComActNeighborCircleFabulousWestDO::getParentId, fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getUserId, fabulousAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborCircleFabulousWestDO.type.pl) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (circleFabulousDO == null) { |
| | | return R.fail("未查询到点赞信息"); |
| | | } |
| | | |
| | | // 减少邻里圈评论点赞数量 |
| | | ComActNeighborCircleCommentWestDO circleCommentDO = |
| | | comActNeighborCircleCommentWestDAO.selectById(fabulousAppDTO.getServiceId()); |
| | | if (circleCommentDO != null) { |
| | | circleCommentDO.setFabulousNum(circleCommentDO.getFabulousNum() - 1); |
| | | comActNeighborCircleCommentWestDAO.updateById(circleCommentDO); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM; |
| | | this.baseMapper.addHotNum(circleCommentDO.getCircleId(),-hotNum); |
| | | this.baseMapper.addTopicHotNum(circleCommentDO.getCircleId(),-hotNum); |
| | | } |
| | | } else if (fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.hf)) { |
| | | circleFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>().lambda() |
| | | .eq(ComActNeighborCircleFabulousWestDO::getParentId, fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getUserId, fabulousAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborCircleFabulousWestDO.type.hf) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (circleFabulousDO == null) { |
| | | return R.fail("未查询到点赞信息"); |
| | | } |
| | | // 减少邻里圈评论回复点赞数量 |
| | | ComActNeighborCircleCommentReplyWestDO circleCommentReplyDO = |
| | | comActNeighborCircleCommentReplyWestDAO.selectById(fabulousAppDTO.getServiceId()); |
| | | if (circleCommentReplyDO != null) { |
| | | circleCommentReplyDO.setFabulousNum(circleCommentReplyDO.getFabulousNum() - 1); |
| | | comActNeighborCircleCommentReplyWestDAO.updateById(circleCommentReplyDO); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM; |
| | | this.baseMapper.addHotNum(circleCommentReplyDO.getCircleId(),-hotNum); |
| | | this.baseMapper.addTopicHotNum(circleCommentReplyDO.getCircleId(),-hotNum); |
| | | } |
| | | } |
| | | if (circleFabulousDO != null) { |
| | | circleFabulousDO.setIsEffective(ComActNeighborCircleFabulousWestDO.isEffective.no); |
| | | comActNeighborCircleFabulousWestDAO.updateById(circleFabulousDO); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 添加邻里圈浏览记录 |
| | | * |
| | | * @param addBrowseAppDTO |
| | | * 请求参数 |
| | | * @return 返回参数 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R neighborAddBrowseByApp(ComActNeighborAddBrowseAppDTO addBrowseAppDTO) { |
| | | // 添加邻里圈浏览记录 |
| | | comActNeighborCircleBrowseWestService.addBrowseRecord(addBrowseAppDTO.getCircleId(), addBrowseAppDTO.getUserId()); |
| | | // 更新邻里圈记录 |
| | | ComActNeighborCircleWestDO neighborCircleDO = this.baseMapper.selectById(addBrowseAppDTO.getCircleId()); |
| | | if (neighborCircleDO != null) { |
| | | neighborCircleDO.setViewsNum(neighborCircleDO.getViewsNum() + 1); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM; |
| | | this.baseMapper.addHotNum(neighborCircleDO.getId(),hotNum); |
| | | this.baseMapper.addTopicHotNum(neighborCircleDO.getId(),hotNum); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询评论下所有回复 |
| | | * |
| | | * @param commentReplyAppDTO |
| | | * 请求参数 |
| | | * @return 回复列表 |
| | | */ |
| | | @Override |
| | | public R neighborCommentReplyByApp(ComActNeighborCommentReplyAppDTO commentReplyAppDTO) { |
| | | IPage<ComActNeighborCommentReplyAppVO> neighborCircleIPage = this.baseMapper.neighborCommentReplyByApp( |
| | | new Page<>(commentReplyAppDTO.getPageNum(), commentReplyAppDTO.getPageSize()), |
| | | commentReplyAppDTO.getCommentId()); |
| | | if (!neighborCircleIPage.getRecords().isEmpty()) { |
| | | for (ComActNeighborCommentReplyAppVO commentReplyAppVO : neighborCircleIPage.getRecords()) { |
| | | if (commentReplyAppDTO.getUserId() != null) { |
| | | // 查询点赞信息 |
| | | ComActNeighborCircleFabulousWestDO circleFabulousDO = |
| | | comActNeighborCircleFabulousWestDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousWestDO>() |
| | | .lambda().eq(ComActNeighborCircleFabulousWestDO::getParentId, commentReplyAppVO.getId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getUserId, commentReplyAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getType, ComActNeighborCircleFabulousWestDO.type.hf) |
| | | .eq(ComActNeighborCircleFabulousWestDO::getIsEffective, |
| | | ComActNeighborCircleFabulousWestDO.isEffective.yes)); |
| | | if (circleFabulousDO != null) { |
| | | commentReplyAppVO.setHaveSign(1); |
| | | } else { |
| | | commentReplyAppVO.setHaveSign(2); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return R.ok(neighborCircleIPage); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-删除邻里圈 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | public R deleteNeighborByApp(DeleteNeighborCircleAppDTO circleTopicAppDTO){ |
| | | ComActNeighborCircleWestDO neighborCircleDO = new ComActNeighborCircleWestDO(); |
| | | neighborCircleDO.setId(circleTopicAppDTO.getId()); |
| | | neighborCircleDO.setIsDel(ComActNeighborCircleWestDO.isDel.yes); |
| | | if(this.baseMapper.updateById(neighborCircleDO) > 0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActNeighborCircleTopicWestMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActNeighborCircleTopicWestDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="name" property="name" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="count" property="count" /> |
| | | <result column="hot_num" property="hotNum" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, community_id, name, status, create_at, create_by, count, hot_num |
| | | </sql> |
| | | |
| | | <select id="pageNeighborTopicByAdmin" parameterType="com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleTopicAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAdminVO"> |
| | | SELECT |
| | | canct.id, |
| | | canct.`name`, |
| | | canct.`status`, |
| | | canct.create_at, |
| | | ( SELECT count( id ) FROM com_act_neighbor_circle_west WHERE is_del = 2 AND `status` = 2 and topic_id = canct.id) AS `count`, |
| | | su.`name` as createBy |
| | | FROM |
| | | com_act_neighbor_circle_topic_west AS canct |
| | | LEFT JOIN sys_user AS su ON su.user_id = canct.create_by |
| | | <where> |
| | | <if test="circleTopicAdminDTO.communityId != null"> |
| | | and canct.community_id = ${circleTopicAdminDTO.communityId} |
| | | </if> |
| | | <if test="circleTopicAdminDTO.status != null"> |
| | | and canct.status = #{circleTopicAdminDTO.status} |
| | | </if> |
| | | <if test="circleTopicAdminDTO.name != null and circleTopicAdminDTO.name != """> |
| | | and canct.name like concat(#{circleTopicAdminDTO.name},'%') |
| | | </if> |
| | | </where> |
| | | order by canct.create_at desc |
| | | </select> |
| | | |
| | | <select id="getNeighborTopicByApp" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO"> |
| | | SELECT canct.id, canct.`name`, canct.hot_num,( SELECT count( id ) FROM com_act_neighbor_circle_west WHERE is_del = 2 AND `status` = 2 and topic_id = canct.id) AS `count` |
| | | from com_act_neighbor_circle_topic_west as canct where canct.`status` = 1 and canct.community_id = ${communityId} |
| | | <if test="isZero != null and isZero == 1"> |
| | | and `count` > 0 |
| | | </if> |
| | | <if test="name != null and name != """> |
| | | and canct.`name` like concat('%',#{name},'%') |
| | | </if> |
| | | order by `count` desc |
| | | </select> |
| | | |
| | | <update id="addHotNum"> |
| | | update com_act_neighbor_circle_topic_west set hot_num = hot_num + #{hotNum} where id = #{circleTopicId} |
| | | </update> |
| | | |
| | | <update id="addCount"> |
| | | update com_act_neighbor_circle_topic_west set `count` = `count` + 1 where id = #{circleTopicId} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActNeighborCircleWestDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActNeighborCircleWestDO"> |
| | | <id column="id" property="id"/> |
| | | <result column="release_id" property="releaseId"/> |
| | | <result column="release_phone" property="releasePhone"/> |
| | | <result column="community_id" property="communityId"/> |
| | | <result column="release_content" property="releaseContent"/> |
| | | <result column="release_images" property="releaseImages"/> |
| | | <result column="status" property="status"/> |
| | | <result column="refuse_reason" property="refuseReason"/> |
| | | <result column="comment_num" property="commentNum"/> |
| | | <result column="fabulous_num" property="fabulousNum"/> |
| | | <result column="forward_num" property="forwardNum"/> |
| | | <result column="views_num" property="viewsNum"/> |
| | | <result column="is_boutique" property="isBoutique"/> |
| | | <result column="create_at" property="createAt"/> |
| | | <result column="reply_at" property="replyAt"/> |
| | | <result column="last_comment_num" property="lastCommentNum"/> |
| | | <result column="last_fabulous_num" property="lastFabulousNum"/> |
| | | <result column="last_views_num" property="lastViewsNum"/> |
| | | <result column="type" property="type"/> |
| | | <result column="topic_id" property="topicId"/> |
| | | <result column="hot_num" property="hotNum"/> |
| | | <result column="is_del" property="isDel"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, release_id, release_phone, community_id, release_content, release_images, status, refuse_reason, comment_num, fabulous_num, forward_num, views_num, is_boutique, create_at, reply_at, last_comment_num, last_fabulous_num, last_views_num, type, topic_id, hot_num, is_del |
| | | </sql> |
| | | |
| | | <select id="pageNeighborByApp" parameterType="com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO" |
| | | resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO"> |
| | | SELECT |
| | | canc.id, |
| | | canc.release_content, |
| | | canc.release_images, |
| | | canc.comment_num, |
| | | canc.fabulous_num, |
| | | canc.forward_num, |
| | | canc.views_num, |
| | | canc.is_boutique, |
| | | canc.create_at, |
| | | canc.refuse_reason, |
| | | canc.reply_at, |
| | | canc.last_comment_num, |
| | | canc.last_fabulous_num, |
| | | canc.last_views_num, |
| | | canc.type, |
| | | canc.topic_id, |
| | | canc.hot_num, |
| | | su.nick_name as name, |
| | | su.community_id, |
| | | canct.name as topicName, |
| | | su.image_url as headUrl |
| | | FROM |
| | | com_act_neighbor_circle_west AS canc |
| | | left join sys_user as su on su.user_id = canc.release_id |
| | | left join com_act_neighbor_circle_topic_west as canct on canct.id = canc.topic_id |
| | | where canc.status = 2 and is_del = 2 and canc.community_id = ${neighborCircleAppDTO.communityId} |
| | | <if test='neighborCircleAppDTO.topicId != null '> |
| | | and canc.topic_id = #{neighborCircleAppDTO.topicId} |
| | | </if> |
| | | <if test='neighborCircleAppDTO.keyWord != null and neighborCircleAppDTO.keyWord != ""'> |
| | | and (canct.`name` like concat (#{neighborCircleAppDTO.keyWord},'%') or |
| | | su.nick_name like concat (#{neighborCircleAppDTO.keyWord},'%') or |
| | | canc.release_content like concat (#{neighborCircleAppDTO.keyWord},'%')) |
| | | </if> |
| | | order by canc.create_at desc |
| | | </select> |
| | | |
| | | <update id="addHotNum"> |
| | | update com_act_neighbor_circle_west set hot_num = hot_num + #{hotNum} where id = #{circleId} |
| | | </update> |
| | | |
| | | <update id="addTopicHotNum"> |
| | | update com_act_neighbor_circle_topic_west set hot_num = hot_num + 1 where id = (select topic_id from com_act_neighbor_circle_west where id = #{circleId}) |
| | | </update> |
| | | |
| | | <select id="pageNeighborByAdmin" parameterType="com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO"> |
| | | SELECT |
| | | nc.*, |
| | | u.`nick_name` AS releaseName,u.image_url,canct.`name` as topicName ,u.`type` as userType |
| | | ,u.name as communityName |
| | | FROM |
| | | com_act_neighbor_circle_west nc |
| | | LEFT JOIN sys_user u ON nc.release_id = u.user_id |
| | | LEFT JOIN com_act_neighbor_circle_topic_west as canct ON canct.id = nc.topic_id |
| | | <where> |
| | | nc.community_id = ${neighborCircleAdminDTO.communityId} and is_del = 2 |
| | | <if test='neighborCircleAdminDTO.releaseContent != null and neighborCircleAdminDTO.releaseContent != ""'> |
| | | and nc.release_content like concat('%',#{neighborCircleAdminDTO.releaseContent},'%') |
| | | </if> |
| | | <if test='neighborCircleAdminDTO.topicName != null and neighborCircleAdminDTO.topicName != ""'> |
| | | and canct.`name` = #{neighborCircleAdminDTO.topicName} |
| | | </if> |
| | | <if test='neighborCircleAdminDTO.keyWord != null and neighborCircleAdminDTO.keyWord != ""'> |
| | | and (canct.`name` like concat(#{neighborCircleAdminDTO.keyWord},'%') or |
| | | u.`nick_name` like concat(#{neighborCircleAdminDTO.keyWord},'%') or |
| | | nc.`release_content` like concat(#{neighborCircleAdminDTO.keyWord},'%') ) |
| | | </if> |
| | | <if test='neighborCircleAdminDTO.startAt != null and neighborCircleAdminDTO.endAt !=null '> |
| | | and nc.create_at between #{neighborCircleAdminDTO.startAt} and #{neighborCircleAdminDTO.endAt} |
| | | </if> |
| | | <if test='neighborCircleAdminDTO.status != null '> |
| | | and nc.status = #{neighborCircleAdminDTO.status} |
| | | </if> |
| | | </where> |
| | | order by |
| | | case when nc.`status`=1 then 0 else 1 end, |
| | | nc.`status` asc,nc.create_at desc |
| | | </select> |
| | | <select id="getAllImages" resultType="java.lang.String"> |
| | | SELECT release_images FROM com_act_neighbor_circle |
| | | WHERE community_id = ${communityId} AND `status` = 2 AND release_images IS NOT NULL AND release_images != '' |
| | | ORDER BY create_at DESC limit #{pageSize} |
| | | </select> |
| | | <select id="getContents" resultType="java.lang.String"> |
| | | SELECT release_content FROM com_act_neighbor_circle |
| | | WHERE community_id = ${communityId} AND `status` = 2 AND release_content IS NOT NULL AND release_content != '' |
| | | ORDER BY create_at DESC limit #{pageSize} |
| | | </select> |
| | | <select id="getIndexNeighborBaseData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT filed, num, ROUND(num/total,2) AS percent FROM |
| | | (SELECT IF(t2.`name` IS NULL,'无话题',t2.`name`) AS filed, COUNT(1) AS num FROM com_act_neighbor_circle_west t1 |
| | | LEFT JOIN com_act_neighbor_circle_topic_west t2 ON t1.topic_id = t2.id |
| | | WHERE t1.community_id = ${communityId} AND t1.`status` IN (2,3) AND t1.is_del = 2 AND (t2.`status` = 1 OR t2.id IS NULL) GROUP BY filed) temp1, |
| | | (SELECT COUNT(t1.id) AS total FROM com_act_neighbor_circle_west t1 |
| | | LEFT JOIN com_act_neighbor_circle_topic_west t2 ON t1.topic_id = t2.id |
| | | WHERE t1.community_id = ${communityId} AND t1.`status` IN (2,3) AND t1.is_del = 2 AND (t2.`status` = 1 OR t2.id IS NULL)) temp2 |
| | | </select> |
| | | <select id="getNeighborAddPolylineData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( t1.create_at, '%Y-%m' ) AS filed, COUNT(t1.id) AS num |
| | | FROM com_act_neighbor_circle_west t1 |
| | | LEFT JOIN com_act_neighbor_circle_topic_west t2 ON t1.topic_id = t2.id |
| | | WHERE t1.community_id = ${communityId} AND t1.`status` IN (2,3) AND t1.is_del = 2 AND (t2.`status` = 1 OR t2.id IS NULL) |
| | | AND DATE_FORMAT( t1.create_at, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | | ( |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num |
| | | ) temT |
| | | ) temp GROUP BY filed ORDER BY filed ASC |
| | | </select> |
| | | <select id="getNeighborTotalPolylineDate" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT COUNT(t1.id) AS num FROM com_act_neighbor_circle_west t1 |
| | | LEFT JOIN com_act_neighbor_circle_topic_west t2 ON t1.topic_id = t2.id |
| | | WHERE t1.community_id = ${communityId} AND t1.`status` IN (2,3) AND t1.is_del = 2 AND (t2.`status` = 1 OR t2.id IS NULL) AND DATE_FORMAT( t1.create_at, '%Y-%m' ) <= #{date} |
| | | </select> |
| | | <select id="indexNeighborList" |
| | | resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO"> |
| | | SELECT t1.id, t1.release_content, t1.release_images, t1.comment_num, t1.fabulous_num, t2.`name` AS topicName |
| | | FROM com_act_neighbor_circle_west t1 |
| | | LEFT JOIN com_act_neighbor_circle_topic_west t2 ON t1.topic_id = t2.id |
| | | WHERE 1=1 |
| | | <if test="pageBaseDTO.communityIds != null and pageBaseDTO.communityIds.size > 0"> |
| | | AND t1.community_id IN |
| | | <foreach collection="pageBaseDTO.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="pageBaseDTO.communityIds == null"> |
| | | AND t1.community_id = ${pageBaseDTO.communityId} |
| | | </if> |
| | | AND t1.`status` IN (2,3) AND t1.is_del = 2 AND (t2.`status` = 1 OR t2.id IS NULL) |
| | | <if test="pageBaseDTO.paramId != null"> |
| | | AND t1.topic_id = #{pageBaseDTO.paramId} |
| | | </if> |
| | | ORDER BY t1.id DESC |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.panzhihua.service_dangjian.api; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleExcelVo; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.panzhihua.common.exceptions.PartyBuildingMemberException; |
| | | import com.panzhihua.common.model.dtos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingWestService; |
| | | import com.panzhihua.service_dangjian.dao.ComPbOrgDAO; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbMemberWestDO; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbOrgDO; |
| | | import com.panzhihua.service_dangjian.service.ComBpActivityService; |
| | | import com.panzhihua.service_dangjian.service.ComPbMemberWestService; |
| | | import com.panzhihua.service_dangjian.service.ComPbServiceTeamService; |
| | | import com.panzhihua.service_dangjian.service.PartyOrganizationService; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党建 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 10:41 |
| | | **/ |
| | | @RequestMapping("/partybuildIngWest/") |
| | | @RestController |
| | | public class PartyBuildIngWestApi { |
| | | @Resource |
| | | private ComPbMemberWestService comPbMemberWestService; |
| | | @Resource |
| | | private PartyOrganizationService partyOrganizationService; |
| | | @Resource |
| | | private ComBpActivityService comBpActivityService; |
| | | @Resource |
| | | private ComPbServiceTeamService comPbServiceTeamService; |
| | | @Resource |
| | | private ComPbOrgDAO comPbOrgDAO; |
| | | @Resource |
| | | private PartyBuildingWestService partyBuildingWestService; |
| | | |
| | | /** |
| | | * 社区所有启用的党组织列表 |
| | | * |
| | | * @return 党组织集合 |
| | | */ |
| | | @PostMapping("listpartyorganization") |
| | | public R listPartyOrganization(@RequestParam("communityId") Long communityId) { |
| | | List<PartyOrganizationVO> partyOrganizationVOS = partyOrganizationService.listPartyOrganization(communityId); |
| | | return R.ok(partyOrganizationVOS); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询社区所有党组织列表 |
| | | * |
| | | * @return 党组织集合 |
| | | */ |
| | | @PostMapping("listpartyorganizationAll") |
| | | public R listPartyOrganizationAll(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | return partyOrganizationService.listPartyOrganizationAll(partyOrganizationVO); |
| | | } |
| | | |
| | | /** |
| | | * 查询所有党组织列表 |
| | | * @param partyOrganizationVO 请求参数 |
| | | * @return 党组织列表 |
| | | */ |
| | | @PostMapping("getPbOrgAllList") |
| | | public R getPbOrgAllList(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | return partyOrganizationService.getPbOrgAllList(partyOrganizationVO); |
| | | } |
| | | |
| | | /** |
| | | * 新增党支部 |
| | | * |
| | | * @param partyOrganizationVO |
| | | * 党支部基本信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addpartyorganization") |
| | | public R addPartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | return partyOrganizationService.addPartyOrganization(partyOrganizationVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 编辑党支部 |
| | | * |
| | | * @param partyOrganizationVO |
| | | * 党支部基本信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("updatepartyorganization") |
| | | public R updatePartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | return partyOrganizationService.updatePartyOrganization(partyOrganizationVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 启用,禁用党支部 |
| | | * |
| | | * @param partyOrganizationVO |
| | | * 党支部基本信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("resetpartyorganization") |
| | | public R resetPartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | return partyOrganizationService.resetPartyOrganization(partyOrganizationVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除党支部 |
| | | * |
| | | * @param partyOrganizationVO |
| | | * 党支部基本信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("deletepartyorganization") |
| | | public R deletePartyOrganization(@RequestBody PartyOrganizationVO partyOrganizationVO) { |
| | | return partyOrganizationService.deletePartyOrganization(partyOrganizationVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 新增党员 |
| | | * |
| | | * @param partyBuildingMemberVO |
| | | * 党员基本信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addpartybuildingmember") |
| | | public R addPartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | return comPbMemberWestService.addPartyBuildingMember(partyBuildingMemberVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 批量新增党员 |
| | | * |
| | | * @param list |
| | | * 党员集合 |
| | | */ |
| | | @PostMapping("listsavepartybuildingmemberexcelvo") |
| | | public R listSavePartyBuildingMemberExcelVO(@RequestBody List<PartyBuildingMemberExcelVO> list) { |
| | | R r = null; |
| | | try { |
| | | r = comPbMemberWestService.listSavePartyBuildingMemberExcelVO(list); |
| | | } catch (PartyBuildingMemberException e) { |
| | | return R.fail(e.getMsg()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | if (e.getMessage().contains("unique_id_card_community_id")) { |
| | | return R.fail("身份证重复"); |
| | | } else { |
| | | return R.fail("导入失败"); |
| | | } |
| | | } |
| | | return r; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 分页查询党员信息 |
| | | * |
| | | * @param pagePartyOrganizationVO |
| | | * 查询信息 |
| | | * @return 分页数据 |
| | | */ |
| | | @PostMapping("pagepartyorganization") |
| | | public R pagePartyOrganization(@RequestBody PagePartyOrganizationVO pagePartyOrganizationVO) { |
| | | return comPbMemberWestService.pagePartyOrganization(pagePartyOrganizationVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 查询党员信息导出 |
| | | * |
| | | * @param pagePartyOrganizationVO |
| | | * 查询信息 |
| | | * @return 分页数据 |
| | | */ |
| | | @PostMapping("exportPartyMember") |
| | | public R exportPartyMember(@RequestBody PagePartyOrganizationVO pagePartyOrganizationVO) { |
| | | return comPbMemberWestService.exportPartyMember(pagePartyOrganizationVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 党员活动查询 |
| | | * |
| | | * @param partyBuildingActivityVO |
| | | * 查询参数 |
| | | * @return 参加的所有活动 |
| | | */ |
| | | @PostMapping("listpartymemberactivities") |
| | | public R listPartyMemberActivities(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | Long id = partyBuildingActivityVO.getId(); |
| | | if (ObjectUtils.isEmpty(id)) { |
| | | return R.fail("党员id不能为空"); |
| | | } |
| | | return comBpActivityService.listPartyMemberActivities(partyBuildingActivityVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 活动报名名单分页查询 |
| | | * |
| | | * @param pageActivityMembersVO |
| | | * 查询参数 手机号 名字 |
| | | * @return 分页数据 |
| | | */ |
| | | @PostMapping("pageactivitymembers") |
| | | public R pageActivityMembers(@RequestBody PageActivityMembersVO pageActivityMembersVO) { |
| | | return comBpActivityService.pageActivityMembers(pageActivityMembersVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 编辑党员信息 新增字段均可编辑 |
| | | * |
| | | * @param partyBuildingMemberVO |
| | | * 编辑字段 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("updatepartybuildingmember") |
| | | public R updatePartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | return comPbMemberWestService.updatePartyBuildingMembers(partyBuildingMemberVO); |
| | | } |
| | | |
| | | /** |
| | | * 党员活动详情 |
| | | * |
| | | * @param id |
| | | * 活动id |
| | | * @return 活动详情内容 |
| | | */ |
| | | @PostMapping("activityinfo") |
| | | public R activityinfo(@RequestParam("id") Long id, @RequestParam("userId") Long userId) { |
| | | return comBpActivityService.activityinfo(id, userId); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 查询指定社区的所有党员 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党员列表 |
| | | */ |
| | | @PostMapping("listPartyMember") |
| | | public R listPartyMember(@RequestParam("communityId") Long communityId) { |
| | | return comPbMemberWestService.listPartyMember(communityId); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 新增党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 新增信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addpartycommittee") |
| | | public R addPartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO) { |
| | | return comPbMemberWestService.addPartyCommittee(partyCommitteeVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 编辑党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 编辑信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("updatepartycommittee") |
| | | public R updatePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO) { |
| | | return comPbMemberWestService.updatePartyCommittee(partyCommitteeVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 删除id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deletepartycommittee") |
| | | public R deletePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO) { |
| | | return comPbMemberWestService.deletePartyCommittee(partyCommitteeVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 分页社区党委查询 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | | @PostMapping("pagepartycommittee") |
| | | public R pagePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO) { |
| | | return comPbMemberWestService.pagePartyCommittee(partyCommitteeVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 新建党建动态 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 动态内容 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("adddynamic") |
| | | public R adddYnamic(@RequestBody PartyBuildingComPbDynVO partyCommitteeVO) { |
| | | return comPbMemberWestService.adddYnamic(partyCommitteeVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 编辑动态 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("updatedynamic") |
| | | public R updateYnamic(@RequestBody PartyBuildingComPbDynVO partyCommitteeVO) { |
| | | return comPbMemberWestService.updateYnamic(partyCommitteeVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 动态详情 |
| | | * |
| | | * @param id |
| | | * 动态主键 |
| | | * @return 详情 |
| | | */ |
| | | @PostMapping("infodynamic") |
| | | public R infoYnamic(@RequestParam("id") Long id) { |
| | | return comPbMemberWestService.infoYnamic(id); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 分页查询党员动态/政策文件 |
| | | * |
| | | * @param partyBuildingComPbDynVO |
| | | * 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | @PostMapping("pagedynamic") |
| | | public R pageYnamic(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO) { |
| | | return comPbMemberWestService.pageYnamic(partyBuildingComPbDynVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除动态 |
| | | * |
| | | * @param id |
| | | * 动态主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deletedynamic") |
| | | public R deleteYnamic(@RequestParam("id") Integer id) { |
| | | return comPbMemberWestService.deleteYnamic(id); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 新增党员活动 |
| | | * |
| | | * @param partyBuildingActivityVO |
| | | * 参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addactivity") |
| | | public R addactivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | return comBpActivityService.addactivity(partyBuildingActivityVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 编辑党员活动 |
| | | * |
| | | * @param partyBuildingActivityVO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("updateactivity") |
| | | public R updateActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | return comBpActivityService.updateActivity(partyBuildingActivityVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 发布党员活动 |
| | | * |
| | | * @param id |
| | | * 主键id |
| | | * @return 发布结果 |
| | | */ |
| | | @PostMapping("releaseactivity") |
| | | public R releaseActivity(@RequestParam("id") Long id) { |
| | | return comBpActivityService.releaseActivity(id); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除党员活动 |
| | | * |
| | | * @param id |
| | | * 主键id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deleteactivity") |
| | | public R deleteActivity(@RequestParam("id") Long id) { |
| | | return comBpActivityService.deleteActivity(id); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 分页查询党员活动 |
| | | * |
| | | * @param partyBuildingActivityVO |
| | | * 查询条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("pageactivity") |
| | | public R pageActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | return comBpActivityService.pageActivity(partyBuildingActivityVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 增加阅读记录 |
| | | * |
| | | * @param comPbDynUserVO |
| | | * 记录内容 |
| | | * @return 增加结果 |
| | | */ |
| | | @PostMapping("adddynuser") |
| | | public R addDynUser(@RequestBody ComPbDynUserVO comPbDynUserVO) { |
| | | return comPbMemberWestService.addDynUser(comPbDynUserVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除党员 |
| | | * |
| | | * @param id |
| | | * 党员主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deletepartybuildingmember") |
| | | public R deleteDynUser(@RequestParam("id") Integer id) { |
| | | return comPbMemberWestService.deleteDynUser(id); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 取消活动 |
| | | * |
| | | * @param partyBuildingActivityVO |
| | | * 取消原因 |
| | | * @return 操作结果 |
| | | */ |
| | | @PostMapping("cancelactivity") |
| | | public R cancelActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | return comBpActivityService.cancelActivity(partyBuildingActivityVO); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 用户的所有党建活动 |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党建活动列表 |
| | | */ |
| | | @PostMapping("listactivity") |
| | | public R listActivity(@RequestParam("userId") Long userId, |
| | | @RequestParam("communityId") Long communityId, |
| | | @RequestParam(value = "status", required = false) Integer status) { |
| | | return comBpActivityService.listActivity(userId, communityId, status); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 党员活动人员参入列表 |
| | | * |
| | | * @param id |
| | | * 活动id |
| | | * @return 党员集合 |
| | | */ |
| | | @PostMapping("listpartybuildingmember") |
| | | public R listPartyBuildingMember(@RequestParam("id") Long id) { |
| | | return comBpActivityService.listPartyBuildingMember(id); |
| | | } |
| | | |
| | | /** |
| | | * 报名、取消报名党员活动 |
| | | * |
| | | * @param activitySignUpDTO |
| | | * 操作参数 |
| | | * @return 操作结果 |
| | | */ |
| | | @PostMapping("putactivitysignup") |
| | | public R putActivitySignUp(@RequestBody ActivitySignUpDTO activitySignUpDTO) { |
| | | return comBpActivityService.putActivitySignUp(activitySignUpDTO); |
| | | } |
| | | |
| | | /** |
| | | * 获取党建活动所有参入人员的id集合 |
| | | * |
| | | * @param id |
| | | * 党建活动id |
| | | * @return 人员id集合 |
| | | */ |
| | | @PostMapping("selectallpartybuildingactivitymembers") |
| | | public R selectAllPartyBuildingActivityMembers(@RequestParam("id") Long id) { |
| | | return comBpActivityService.selectAllPartyBuildingActivityMembers(id); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务刷新党建动态发布状态 |
| | | * |
| | | * @return 刷新数据数量 |
| | | */ |
| | | @PostMapping("timedtaskpartybuildingstatus") |
| | | R timedTaskPartyBuildingStatus() { |
| | | return comPbMemberWestService.timedTaskPartyBuildingStatus(); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务取消党建活动 |
| | | * |
| | | * @return 党建活动集合 |
| | | */ |
| | | @PostMapping("timedtaskpartybuildingactivity") |
| | | public R timedTaskPartyBuildingActivity() { |
| | | return comBpActivityService.timedTaskPartyBuildingActivity(); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务刷新党建活动的各个状态 除取消外 |
| | | * |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("timedtaskpartybuildingactivityall") |
| | | public R timedTaskPartyBuildingActivityAll() { |
| | | return comBpActivityService.timedTaskPartyBuildingActivityAll(); |
| | | } |
| | | |
| | | /** |
| | | * 新增服务团队人员 |
| | | * |
| | | * @param comPbServiceTeamDTO |
| | | * 新增内容 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addserviceteam") |
| | | public R addServiceTeam(@RequestBody ComPbServiceTeamDTO comPbServiceTeamDTO) { |
| | | return comPbServiceTeamService.addServiceTeam(comPbServiceTeamDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑团队人员 |
| | | * |
| | | * @param comPbServiceTeamDTO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("putserviceteam") |
| | | public R putServiceTeam(@RequestBody ComPbServiceTeamDTO comPbServiceTeamDTO) { |
| | | return comPbServiceTeamService.putServiceTeam(comPbServiceTeamDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询服务团队成员 |
| | | * |
| | | * @param pageComPbServiceTeamDTO |
| | | * 查询参数 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("pageserviceteam") |
| | | public R pageServiceTeam(@RequestBody PageComPbServiceTeamDTO pageComPbServiceTeamDTO) { |
| | | return comPbServiceTeamService.PageComPbServiceTeamDTO(pageComPbServiceTeamDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除服务团队人员 |
| | | * |
| | | * @param comPbServiceTeamDTO |
| | | * 删除主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deleteserviceteam") |
| | | public R deleteServiceTeam(@RequestBody ComPbServiceTeamDTO comPbServiceTeamDTO) { |
| | | return comPbServiceTeamService.deleteServiceTeam(comPbServiceTeamDTO); |
| | | } |
| | | |
| | | /** |
| | | * 创建党员活动 小程序创建党员活动 |
| | | * |
| | | * @param comPbActivityDTO |
| | | * 创建内容 |
| | | * @return 创建结果 |
| | | */ |
| | | @PostMapping("addactivityinfo") |
| | | R addActivityApplets(@RequestBody ComPbActivityDTO comPbActivityDTO) { |
| | | return comBpActivityService.addActivityApplets(comPbActivityDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户认证信息 |
| | | * |
| | | * @param id |
| | | * 用户id |
| | | * @return 查询结果 |
| | | */ |
| | | @GetMapping("usercertification") |
| | | R userCertification(@RequestParam("id") Long id,@RequestParam("communityId")Long communityId) { |
| | | List<ComPbMemberWestDO> comPbMemberWestDOList = |
| | | comPbMemberWestService.list(new QueryWrapper<ComPbMemberWestDO>().lambda().eq(ComPbMemberWestDO::getUserId, id).eq(ComPbMemberWestDO::getCommunityId,communityId)); |
| | | List<PartyBuildingMemberVO> partyBuildingMemberVOList = new ArrayList<>(); |
| | | comPbMemberWestDOList.forEach(comPbMemberDO -> { |
| | | PartyBuildingMemberVO partyBuildingMemberVO = new PartyBuildingMemberVO(); |
| | | BeanUtils.copyProperties(comPbMemberDO, partyBuildingMemberVO); |
| | | ComPbOrgDO comPbOrgDO = comPbOrgDAO.selectById(partyBuildingMemberVO.getOrgId()); |
| | | partyBuildingMemberVO.setOrgName(comPbOrgDO.getName()); |
| | | partyBuildingMemberVOList.add(partyBuildingMemberVO); |
| | | }); |
| | | return R.ok(partyBuildingMemberVOList); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户认证信息 |
| | | * |
| | | * @param pagePartyBuildingMemberVO |
| | | * 查询参数 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("pageusercertification") |
| | | R pageUserCertification(@RequestBody PagePartyBuildingMemberVO pagePartyBuildingMemberVO) { |
| | | return comPbMemberWestService.pagePrePartyBuilingMember(pagePartyBuildingMemberVO); |
| | | } |
| | | |
| | | /** |
| | | * 社区所有启用的党组织列表 |
| | | * |
| | | * @return 党组织集合 |
| | | */ |
| | | @PostMapping("listpartyorganizationByApp") |
| | | public R listPartyOrganizationByApp(@RequestBody ComListPartyDTO comListPartyDTO) { |
| | | List<PartyOrganizationVO> partyOrganizationVOS = |
| | | partyOrganizationService.listPartyOrganizationByApp(comListPartyDTO); |
| | | return R.ok(partyOrganizationVOS); |
| | | } |
| | | |
| | | /** |
| | | * 根据党员认证id删除 |
| | | * |
| | | * @param id |
| | | * 党员认证id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deleteprepartybuildingmember") |
| | | public R deleteprepartybuildingmember(@RequestParam("id") Long id) { |
| | | return R.ok(comPbMemberWestService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 导出党员信息 |
| | | * |
| | | * @param organizationVO |
| | | * 请求参数 |
| | | * @return 党员信息列表 |
| | | */ |
| | | @PostMapping("exportPbMember") |
| | | public R exportPbMember(@RequestBody PagePartyOrganizationVO organizationVO) { |
| | | return comPbMemberWestService.exportPbMember(organizationVO); |
| | | } |
| | | |
| | | /** |
| | | * 选择人员 |
| | | * |
| | | * @param param |
| | | * 查询条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("getTotlePerson") |
| | | public R getTotlePerson(@RequestParam(value = "param", required = false) String param, |
| | | @RequestParam(value = "communityId") Long communityId) { |
| | | return comPbServiceTeamService.getTotlePerson(param, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 根据党员活动id查询活动下报名人员 |
| | | * |
| | | * @param activityId |
| | | * 党员活动id |
| | | * @return 活动下报名人员 |
| | | */ |
| | | @PostMapping("getTaskPbActivityPeopleList") |
| | | public R getTaskPbActivityPeopleList(@RequestParam("activityId") Long activityId) { |
| | | return comBpActivityService.getTaskPbActivityPeopleList(activityId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询党员数据统计 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员数据统计 |
| | | */ |
| | | @PostMapping("/pageDataStatisticsMember") |
| | | public R pageDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto) { |
| | | return comPbMemberWestService.pageDataStatisticsMember(statisticsMemberDto); |
| | | } |
| | | |
| | | /** |
| | | * 根据组织id查询组织下统计数据 |
| | | * @param statisticsOrgDto 请求参数 |
| | | * @return 组织下统计数据 |
| | | */ |
| | | @PostMapping("/getOrgDataStatistics") |
| | | public R getOrgDataStatistics(@RequestBody ComDataStatisticsOrgDto statisticsOrgDto) { |
| | | return comPbMemberWestService.getOrgDataStatistics(statisticsOrgDto); |
| | | } |
| | | |
| | | /** |
| | | * 查询党组织表头统计数据 |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党组织表头统计数据 |
| | | */ |
| | | @GetMapping("/getHeaderOrgDataStatistics") |
| | | public R getHeaderOrgDataStatistics(@RequestParam("communityId") Long communityId) { |
| | | return comPbMemberWestService.getHeaderOrgDataStatistics(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | @PostMapping("/exportDataStatisticsMember") |
| | | public R exportDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto) { |
| | | return comPbMemberWestService.exportDataStatisticsMember(statisticsMemberDto); |
| | | } |
| | | |
| | | /** |
| | | * 党委导入接口 |
| | | * @param memberRoleExcelVoList 数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/importPbMemberRole") |
| | | public R importPbMemberRole(@RequestBody List<ComPbMemberRoleExcelVo> memberRoleExcelVoList,@RequestParam("communityId") Long communityId,@RequestParam("userId") Long userId){ |
| | | return comPbMemberWestService.importPbMemberRole(memberRoleExcelVoList,communityId,userId); |
| | | } |
| | | @GetMapping("/checkMember") |
| | | public R checkMember(@RequestParam("idCard")String idCard){ |
| | | return comPbMemberWestService.checkMember(idCard); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.dao; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComDataStatisticsMemberExcelVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbMemberWestDO; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党员 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 10:52 |
| | | **/ |
| | | @Mapper |
| | | public interface ComPbMemberWestDAO extends BaseMapper<ComPbMemberWestDO> { |
| | | |
| | | @Select("<script> " + "SELECT\n" + "o.`name` orgName,\n" + "m.org_id,\n" + "m.id_card,\n" + "m.`id`,\n" |
| | | + "u.phone,\n" + "m.`name`,\n" + "m.photo_path,\n" + "TIMESTAMPDIFF(\n" + "YEAR,\n" + "m.employment_time,\n" |
| | | + "DATE_FORMAT( NOW(), '%Y-%m-%d' )) partyAge,\n" + "m.join_time,\n" + "m.employment_time,\n" + "CASE\n" |
| | | + "WHEN u.id_card IS NULL THEN\n" + "'未注册' ELSE '已注册' \n" + "END STATUS \n" + "FROM\n" + "com_pb_member m\n" |
| | | + "LEFT JOIN sys_user u ON m.id_card = u.id_card\n" + "LEFT JOIN com_pb_org o ON m.org_id = o.id" |
| | | + " where m.community_id = ${pagePartyOrganizationVO.communityId} and m.audit_result='1' " |
| | | + "<if test='pagePartyOrganizationVO.orgName != null and pagePartyOrganizationVO.orgName != ""'>" |
| | | + "and o.name like concat(#{pagePartyOrganizationVO.orgName},'%') " + " </if> " |
| | | + "<if test='pagePartyOrganizationVO.orgId != null'>" + " and o.id = #{pagePartyOrganizationVO.orgId} " |
| | | + " </if> " |
| | | + "<if test='pagePartyOrganizationVO.account != null and pagePartyOrganizationVO.account != ""'>" |
| | | + "and u.phone like concat (#{pagePartyOrganizationVO.account},'%')" + " </if> " |
| | | + "<if test='pagePartyOrganizationVO.name != null and pagePartyOrganizationVO.name != ""'>" |
| | | + "and m.name like concat (#{pagePartyOrganizationVO.name},'%')" + " </if> " + "order by m.create_at desc " |
| | | + "</script>") |
| | | IPage<PartyBuildingMemberVO> pagePartyOrganization(Page page, |
| | | @Param("pagePartyOrganizationVO") PagePartyOrganizationVO pagePartyOrganizationVO); |
| | | |
| | | @Select("select m.id,m.org_id,m.name,m.id_card,m.join_time,m.employment_time,m.audit_result,m.create_at,m.update_at,m.community_id,m.user_id,m.refuse_reason,u.image_url as photoPath from sys_user u join com_pb_member m on u.id_card=m.id_card where u.user_id=#{userId}") |
| | | ComPbMemberWestDO selectByUserId(Long userId); |
| | | |
| | | @Select("select name from sys_user where user_id=#{createBy}") |
| | | String selectNameByUserId(Long createBy); |
| | | |
| | | @Update("update sys_user u set u.is_partymember=0 where u.id_card=#{idCard}") |
| | | void updateUserIsPartymember(String idCard); |
| | | |
| | | @Select("<script> " + "SELECT\n" + "o.`name` orgName,\n" + "m.org_id,\n" + "m.id_card,\n" + "m.`id`,\n" |
| | | + "u.phone,\n" + "m.`name`,\n" + "m.photo_path,\n" + "TIMESTAMPDIFF(\n" + "YEAR,\n" + "m.employment_time,\n" |
| | | + "DATE_FORMAT( NOW(), '%Y-%m-%d' )) partyAge,\n" + "m.join_time,\n" + "m.audit_result, \n" |
| | | + "m.employment_time,\n" + "CASE\n" + "WHEN u.id_card IS NULL THEN\n" + "'未注册' ELSE '已注册' \n" + "END STATUS \n" |
| | | + "FROM\n" + "com_pb_member m\n" + "LEFT JOIN sys_user u ON m.id_card = u.id_card\n" |
| | | + "LEFT JOIN com_pb_org o ON m.org_id = o.id" + " where m.user_id is not null " |
| | | + "<if test='pagePartyBuildingMemberVO.phone != null and pagePartyBuildingMemberVO.phone != ""'>" |
| | | + "and u.phone = #{pagePartyBuildingMemberVO.phone} " + " </if> " |
| | | + "<if test='pagePartyBuildingMemberVO.name != null and pagePartyBuildingMemberVO.name != ""'>" |
| | | + "and u.name like concat (#{pagePartyBuildingMemberVO.name},'%')" + " </if> " |
| | | + "<if test='pagePartyBuildingMemberVO.auditStatus != null and pagePartyBuildingMemberVO.auditStatus != ""'>" |
| | | + "and m.audit_result = #{pagePartyBuildingMemberVO.auditStatus}" + " </if> " + "order by m.join_time desc " |
| | | + "</script>") |
| | | IPage<PartyBuildingMemberVO> pagePartyBuildingMemberVO(Page page, |
| | | @Param("pagePartyBuildingMemberVO") PagePartyBuildingMemberVO pagePartyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 分页查询待认证党员列表 |
| | | * @param page 分页参数 |
| | | * @param pagePartyBuildingMemberVO 请求参数 |
| | | * @return 待认证党员列表 |
| | | */ |
| | | IPage<PartyBuildingMemberVO> pagePartyBuildingMembersVO(Page page, |
| | | @Param("pagePartyBuildingMemberVO") PagePartyBuildingMemberVO pagePartyBuildingMemberVO); |
| | | |
| | | @Select("<script> " |
| | | + "select cpm.name as comName,cpm.id_card,cpm.join_time,cpm.employment_time,ca.`name` as communityName,cpo.name as orgName from com_pb_member as cpm " |
| | | + " left join com_act as ca on ca.community_id = cpm.community_id " |
| | | + " left join com_pb_org as cpo on cpo.id = cpm.org_id " + " LEFT JOIN sys_user u ON cpm.id_card = u.id_card " |
| | | + " where cpm.community_id = ${organizationVO.communityId} and cpm.audit_result = 1 " |
| | | + "<if test='organizationVO.orgName != null'>" + " and cpo.name LIKE CONCAT('%',#{organizationVO.orgName},'%') " |
| | | + " </if> " + "<if test='organizationVO.account != null and organizationVO.account != ""'>" |
| | | + " and u.phone like concat (#{organizationVO.account},'%')" + " </if> " |
| | | + "<if test='organizationVO.name != null and organizationVO.name != ""'>" |
| | | + " and cpm.name like concat (#{organizationVO.name},'%')" + " </if> " + "</script>") |
| | | List<ComPbMemberExcelVO> exportPbMember(@Param("organizationVO") PagePartyOrganizationVO organizationVO); |
| | | |
| | | /** |
| | | * 分页查询党员列表 |
| | | * @param page 分页参数 |
| | | * @param buildingMemberVO 请求参数 |
| | | * @return 党员列表 |
| | | */ |
| | | IPage<PartyBuildingMemberVO> queryAllByLimit(Page page,@Param("dto") PagePartyOrganizationVO buildingMemberVO); |
| | | |
| | | /** |
| | | * 导出党员列表 |
| | | * @param buildingMemberVO 请求参数 |
| | | * @return 党员列表 |
| | | */ |
| | | List<ComPbMemberExcelVO> exportPartyMemberList(@Param("dto") PagePartyOrganizationVO buildingMemberVO); |
| | | |
| | | /** |
| | | * 根据id查询党员信息 |
| | | * @param id 主键id |
| | | * @param areaCode |
| | | * @return 党员信息 |
| | | */ |
| | | PartyBuildingMemberVO queryById(@Param("id") Long id, @Param("areaCode") String areaCode); |
| | | |
| | | /** |
| | | * 分页查询党员数据统计 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员数据统计 |
| | | */ |
| | | IPage<ComDataStatisticsMemberVo> pageDataStatisticsMember(Page page, @Param("dto") PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | |
| | | /** |
| | | * 查询人口活动统计数据 |
| | | * @param userId 用户id |
| | | * @param communityId 社区id |
| | | * @return 人口活动统计数据 |
| | | */ |
| | | ComDataStatisticsMemberVo getMemberStatistics(@Param("userId") Long userId,@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 查询社区党组织下的统计数据 |
| | | * @param communityId 社区id |
| | | * @param orgIds 党组织id集合 |
| | | * @return 社区党组织下统计数据 |
| | | */ |
| | | ComDataStatisticsOrgVo getOrgDataStatistics(@Param("communityId") Long communityId, @Param("orgIds") List<Long> orgIds); |
| | | |
| | | /** |
| | | * 查询社区党组织左下统计数据 |
| | | * @param communityId 社区id |
| | | * @param orgIds 党组织id集合 |
| | | * @param startTime 查询开始时间 |
| | | * @param endTime 查询结束时间 |
| | | * @param areaCode |
| | | * @return 社区党组织左下统计数据 |
| | | */ |
| | | ComDataStatisticsOrgVo getOrgDataStatisticsLeftDown(@Param("communityId") Long communityId, @Param("orgIds") List<Long> orgIds |
| | | , @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("areaCode") String areaCode); |
| | | |
| | | /** |
| | | * 分页查询社区党组织下党员 |
| | | * @param page 分页参数 |
| | | * @param communityId 社区id |
| | | * @param orgIds 党组织id集合 |
| | | * @param areaCode |
| | | * @return 党员列表 |
| | | */ |
| | | IPage<PartyBuildingMemberVO> getOrgDataStatisticsMember(@Param("page") Page page, @Param("communityId") Long communityId, @Param("orgIds") List<Long> orgIds, @Param("areaCode") String areaCode); |
| | | |
| | | /** |
| | | * 查询社区党组织下某个时间段统计数据 |
| | | * @param communityId 社区id |
| | | * @param orgIds 党组织id集合 |
| | | * @param startDate 查询开始时间 |
| | | * @param endDate 查询结束时间 |
| | | * @return 社区党组织下某个时间段统计数据 |
| | | */ |
| | | Map<String,Object> getOrgDataStatisticsRightDown(@Param("communityId") Long communityId,@Param("orgIds") List<Long> orgIds,@Param("startDate") String startDate,@Param("endDate") String endDate); |
| | | |
| | | /** |
| | | * 查询党组织表头统计数据 |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党组织表头统计数据 |
| | | */ |
| | | ComDataStatisticsHeaderOrgVo getHeaderOrgDataStatistics(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | List<ComDataStatisticsMemberExcelVo> exportDataStatisticsMember(@Param("dto") PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.model.dos; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党员 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 10:48 |
| | | **/ |
| | | @Data |
| | | @TableName("com_pb_member_west") |
| | | public class ComPbMemberWestDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 党员在表中的id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 所属党组织id |
| | | */ |
| | | private Long orgId; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 头像图片路径 |
| | | */ |
| | | private String photoPath; |
| | | |
| | | /** |
| | | * 入党时间 |
| | | */ |
| | | private Date joinTime; |
| | | |
| | | /** |
| | | * 转正时间 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Date employmentTime; |
| | | |
| | | /** |
| | | * 党员审查结果 |
| | | */ |
| | | private Integer auditResult; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 驳回原因 |
| | | */ |
| | | private String refuseReason; |
| | | |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 党员类型(1.预备党员 2.正式党员) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 职位 |
| | | */ |
| | | private String position; |
| | | |
| | | /** |
| | | * 报道单位id |
| | | */ |
| | | private Long checkUnitId; |
| | | |
| | | /** |
| | | * 职能 |
| | | */ |
| | | @TableField("`function`") |
| | | private String function; |
| | | |
| | | /** |
| | | * 特长类别(1.体育类 2.舞蹈类 3.音乐类 4.美术类 5.其他) |
| | | */ |
| | | private Integer specialtyCategory; |
| | | |
| | | /** |
| | | * 特长描述 |
| | | */ |
| | | private String specialtyName; |
| | | |
| | | /** |
| | | * 职位2 |
| | | */ |
| | | private String positionTwo; |
| | | |
| | | /** |
| | | * 党员审查结果 0待审核 1 审核通过 3审核失败 |
| | | */ |
| | | public interface AuditResult { |
| | | int DSH = 0; |
| | | int SHTG = 1; |
| | | int SHBH = 3; |
| | | } |
| | | |
| | | /** |
| | | * 党员类型(1.预备党员 2.正式党员) |
| | | */ |
| | | public interface Type { |
| | | int YBDY = 1; |
| | | int ZSDY = 2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComDataStatisticsOrgDto; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleExcelVo; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbMemberWestDO; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党员 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 10:53 |
| | | **/ |
| | | public interface ComPbMemberWestService extends IService<ComPbMemberWestDO> { |
| | | /** |
| | | * 新增党员 |
| | | * |
| | | * @param partyBuildingMemberVO |
| | | * 党员基本信息 |
| | | * @return 新增结果 |
| | | */ |
| | | R addPartyBuildingMember(PartyBuildingMemberVO partyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 批量新增党员 |
| | | * |
| | | * @param list |
| | | * 党员集合 |
| | | * @return 新增结果 |
| | | */ |
| | | R listSavePartyBuildingMemberExcelVO(List<PartyBuildingMemberExcelVO> list); |
| | | |
| | | /** |
| | | * 分页党员 |
| | | * |
| | | * @param pagePartyOrganizationVO |
| | | * 查询信息 |
| | | * @return 分页数据 |
| | | */ |
| | | R pagePartyOrganization(PagePartyOrganizationVO pagePartyOrganizationVO); |
| | | |
| | | /** |
| | | * 编辑党员信息 新增字段均可编辑 |
| | | * |
| | | * @param partyBuildingMemberVO |
| | | * 编辑字段 |
| | | * @return 编辑结果 |
| | | */ |
| | | R updatePartyBuildingMember(PartyBuildingMemberVO partyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 查询指定社区的所有党员 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党员列表 |
| | | */ |
| | | R listPartyMember(Long communityId); |
| | | |
| | | /** |
| | | * 新增党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 新增信息 |
| | | * @return 新增结果 |
| | | */ |
| | | R addPartyCommittee(PartyCommitteeVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 编辑党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 编辑信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | R updatePartyCommittee(PartyCommitteeVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 删除党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 删除id |
| | | * @return 删除结果 |
| | | */ |
| | | R deletePartyCommittee(PartyCommitteeVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 分页社区党委查询 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | | R pagePartyCommittee(PartyCommitteeVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 新建党建动态 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 动态内容 |
| | | * @return 新增结果 |
| | | */ |
| | | R adddYnamic(PartyBuildingComPbDynVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 编辑动态 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | R updateYnamic(PartyBuildingComPbDynVO partyCommitteeVO); |
| | | |
| | | /** |
| | | * 动态详情 |
| | | * |
| | | * @param id |
| | | * 动态主键 |
| | | * @return 详情 |
| | | */ |
| | | R infoYnamic(Long id); |
| | | |
| | | /** |
| | | * 分页查询党员动态 |
| | | * |
| | | * @param partyBuildingComPbDynVO |
| | | * 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | R pageYnamic(PartyBuildingComPbDynVO partyBuildingComPbDynVO); |
| | | |
| | | /** |
| | | * 删除动态 |
| | | * |
| | | * @param id |
| | | * 动态主键 |
| | | * @return 删除结果 |
| | | */ |
| | | R deleteYnamic(Integer id); |
| | | |
| | | /** |
| | | * 增加阅读记录 |
| | | * |
| | | * @param comPbDynUserVO |
| | | * 阅读记录 |
| | | * @return 增加结果 |
| | | */ |
| | | R addDynUser(ComPbDynUserVO comPbDynUserVO); |
| | | |
| | | /** |
| | | * 删除党员 |
| | | * |
| | | * @param id |
| | | * 党员主键 |
| | | * @return 删除结果 |
| | | */ |
| | | R deleteDynUser(Integer id); |
| | | |
| | | /** |
| | | * 定时任务刷新党建动态发布状态 |
| | | * |
| | | * @return 刷新数据数量 |
| | | */ |
| | | R timedTaskPartyBuildingStatus(); |
| | | |
| | | /** |
| | | * 分页查询认证党员 |
| | | * |
| | | * @param pagePartyBuildingMemberVO |
| | | * 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | R pagePrePartyBuilingMember(PagePartyBuildingMemberVO pagePartyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 审核党员认证信息 |
| | | * |
| | | * @param partyBuildingMemberVO |
| | | * 编辑字段 |
| | | * @return 编辑结果 |
| | | */ |
| | | R updatePartyBuildingMembers(PartyBuildingMemberVO partyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 导出党员信息 |
| | | * |
| | | * @param organizationVO |
| | | * 请求参数 |
| | | * @return 党员信息列表 |
| | | */ |
| | | R exportPbMember(PagePartyOrganizationVO organizationVO); |
| | | |
| | | /** |
| | | * 分页查询党员数据统计 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员数据统计 |
| | | */ |
| | | R pageDataStatisticsMember(PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | |
| | | /** |
| | | * 根据组织id查询组织下统计数据 |
| | | * @param statisticsOrgDto 请求参数 |
| | | * @return 组织下统计数据 |
| | | */ |
| | | R getOrgDataStatistics(ComDataStatisticsOrgDto statisticsOrgDto); |
| | | |
| | | /** |
| | | * 查询党组织表头统计数据 |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党组织表头统计数据 |
| | | */ |
| | | R getHeaderOrgDataStatistics(Long communityId); |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | R exportDataStatisticsMember(PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | |
| | | /** |
| | | * 党委导入接口 |
| | | * @param list 数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | R importPbMemberRole(List<ComPbMemberRoleExcelVo> list, Long communityId, Long userId); |
| | | |
| | | /** |
| | | * 导出党员积分 |
| | | * @param pagePartyOrganizationVO |
| | | * @return |
| | | */ |
| | | R exportPartyMember(PagePartyOrganizationVO pagePartyOrganizationVO); |
| | | |
| | | /** |
| | | * 身份证查询党员 |
| | | * @param idCard |
| | | * @return |
| | | */ |
| | | R checkMember(String idCard); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.service.impl; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.enums.ComPbMemberRoleTypeEnum; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComDataStatisticsOrgDto; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComDataStatisticsMemberExcelVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleErrorExcelVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleExcelVo; |
| | | import com.panzhihua.common.service.community.CommunityWestService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.exceptions.PartyBuildingMemberException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.RichTextUtil; |
| | | import com.panzhihua.common.utlis.SensitiveUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_dangjian.dao.*; |
| | | import com.panzhihua.service_dangjian.model.dos.*; |
| | | import com.panzhihua.service_dangjian.service.ComPbMemberWestService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党员 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 10:53 |
| | | **/ |
| | | @Slf4j |
| | | @Service |
| | | public class ComPbMemberWestServiceImpl extends ServiceImpl<ComPbMemberWestDAO, ComPbMemberWestDO> implements ComPbMemberWestService { |
| | | private final String REDIS_ORG_ALL = "ogrlist"; |
| | | @Resource |
| | | private ComPbMemberWestDAO comPbMemberWestDAO; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Resource |
| | | private ComPbOrgDAO comPbOrgDAO; |
| | | @Resource |
| | | private ComPbMemberRoleDAO comPbMemberRoleDAO; |
| | | @Resource |
| | | private ComPbDynDAO comPbDynDAO; |
| | | @Resource |
| | | private ComPbDynUserDAO comPbDynUserDAO; |
| | | @Resource |
| | | private CommunityWestService communityWestService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 新增党员 |
| | | * |
| | | * @param partyBuildingMemberVO |
| | | * 党员基本信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | public R addPartyBuildingMember(PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | String idCard = partyBuildingMemberVO.getIdCard(); |
| | | List<ComPbMemberWestDO> comPbMemberWestDOS = comPbMemberWestDAO.selectList(new QueryWrapper<ComPbMemberWestDO>().lambda() |
| | | .eq(ComPbMemberWestDO::getIdCard, idCard).eq(ComPbMemberWestDO::getAuditResult, 1)); |
| | | if (!ObjectUtils.isEmpty(comPbMemberWestDOS) && comPbMemberWestDOS.size() > 0) { |
| | | return R.fail("身份证已经存在"); |
| | | } |
| | | ComPbMemberWestDO comPbMemberWestDO1 = new ComPbMemberWestDO(); |
| | | BeanUtils.copyProperties(partyBuildingMemberVO, comPbMemberWestDO1); |
| | | Date date = new Date(); |
| | | comPbMemberWestDO1.setCreateAt(date); |
| | | comPbMemberWestDO1.setUpdateAt(date); |
| | | int insert = comPbMemberWestDAO.insert(comPbMemberWestDO1); |
| | | if (insert > 0) { |
| | | // 删除已驳回的记录 |
| | | int delete = comPbMemberWestDAO.delete(new QueryWrapper<ComPbMemberWestDO>().lambda() |
| | | .eq(ComPbMemberWestDO::getIdCard, partyBuildingMemberVO.getIdCard()) |
| | | .eq(ComPbMemberWestDO::getUserId, partyBuildingMemberVO.getUserId()) |
| | | .eq(ComPbMemberWestDO::getCommunityId, partyBuildingMemberVO.getCommunityId()) |
| | | .eq(ComPbMemberWestDO::getAuditResult, 3)); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 批量新增党员 |
| | | * |
| | | * @param list |
| | | * 党员集合 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R listSavePartyBuildingMemberExcelVO(List<PartyBuildingMemberExcelVO> list) { |
| | | // Boolean aBoolean = stringRedisTemplate.hasKey(REDIS_ORG_ALL); |
| | | // ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | List<PartyOrganizationVO> partyOrganizationVOS = new ArrayList<>(); |
| | | // if (aBoolean) { |
| | | // String orgs = valueOperations.get(REDIS_ORG_ALL); |
| | | // if (!ObjectUtils.isEmpty(orgs)) { |
| | | // partyOrganizationVOS= JSONArray.parseArray(orgs,PartyOrganizationVO.class); |
| | | // } |
| | | // } else { |
| | | // List<ComPbOrgDO> comPbOrgDOS = comPbOrgDAO.selectList(new LambdaQueryWrapper<>()); |
| | | // if (!ObjectUtils.isEmpty(comPbOrgDOS)) { |
| | | // List<PartyOrganizationVO> partyOrganizationVOList=new ArrayList<>(); |
| | | // comPbOrgDOS.forEach(comPbOrgDO -> { |
| | | // PartyOrganizationVO partyOrganizationVO=new PartyOrganizationVO(); |
| | | // partyOrganizationVO.setId(comPbOrgDO.getId()); |
| | | // partyOrganizationVO.setName(comPbOrgDO.getName()); |
| | | // partyOrganizationVO.setCommunityId(comPbOrgDO.getCommunityId()); |
| | | // partyOrganizationVOList.add(partyOrganizationVO); |
| | | // }); |
| | | // partyOrganizationVOS= partyOrganizationVOList; |
| | | // } |
| | | // valueOperations.set(REDIS_ORG_ALL,JSONArray.toJSONString(partyOrganizationVOS),24, TimeUnit.HOURS); |
| | | // } |
| | | List<ComPbOrgDO> comPbOrgDOS = comPbOrgDAO.selectList(new LambdaQueryWrapper<>()); |
| | | if (!ObjectUtils.isEmpty(comPbOrgDOS)) { |
| | | List<PartyOrganizationVO> partyOrganizationVOList = new ArrayList<>(); |
| | | comPbOrgDOS.forEach(comPbOrgDO -> { |
| | | PartyOrganizationVO partyOrganizationVO = new PartyOrganizationVO(); |
| | | partyOrganizationVO.setId(comPbOrgDO.getId()); |
| | | partyOrganizationVO.setName(comPbOrgDO.getName()); |
| | | partyOrganizationVO.setCommunityId(comPbOrgDO.getCommunityId()); |
| | | partyOrganizationVOList.add(partyOrganizationVO); |
| | | }); |
| | | partyOrganizationVOS = partyOrganizationVOList; |
| | | } |
| | | List<ComPbMemberWestDO> comPbMemberWestDOS = new ArrayList<>(); |
| | | if (!ObjectUtils.isEmpty(list)) { |
| | | List<PartyOrganizationVO> partyOrganizationVOArrayList = partyOrganizationVOS; |
| | | for (PartyBuildingMemberExcelVO partyBuildingMemberExcelVO : list) { |
| | | ComPbMemberWestDO comPbMemberWestDO = new ComPbMemberWestDO(); |
| | | Date date = new Date(); |
| | | comPbMemberWestDO.setUpdateAt(date); |
| | | comPbMemberWestDO.setCreateAt(date); |
| | | String orgName = partyBuildingMemberExcelVO.getOrgName(); |
| | | List<PartyOrganizationVO> collect = partyOrganizationVOArrayList.stream() |
| | | .filter(partyOrganizationVO -> orgName.equals(partyOrganizationVO.getName())) |
| | | .collect(Collectors.toList()); |
| | | if (ObjectUtils.isEmpty(collect)) { |
| | | throw new PartyBuildingMemberException( |
| | | "导入失败,组织不存在" + partyBuildingMemberExcelVO.getOrgName() + ",请先在“党支部管理”中添加该党支部"); |
| | | } else { |
| | | PartyOrganizationVO partyOrganizationVO = collect.get(0); |
| | | comPbMemberWestDO.setOrgId(partyOrganizationVO.getId()); |
| | | comPbMemberWestDO.setCommunityId(partyOrganizationVO.getCommunityId()); |
| | | |
| | | List<ComPbMemberWestDO> comPbMemberWestDOList = this.baseMapper.selectList(new QueryWrapper<ComPbMemberWestDO>() |
| | | .lambda().eq(ComPbMemberWestDO::getIdCard, partyBuildingMemberExcelVO.getIdCard()) |
| | | .eq(ComPbMemberWestDO::getCommunityId, partyOrganizationVO.getCommunityId()) |
| | | .in(ComPbMemberWestDO::getAuditResult, 0, 1)); |
| | | if (!comPbMemberWestDOList.isEmpty()) { |
| | | comPbMemberWestDOList.forEach(comPbMember -> { |
| | | BeanUtils.copyProperties(partyBuildingMemberExcelVO, comPbMember); |
| | | this.baseMapper.updateById(comPbMember); |
| | | }); |
| | | continue; |
| | | // throw new PartyBuildingMemberException("导入失败,您导入的数据中有已存在的党员信息,已存在的数据:"+ |
| | | // partyBuildingMemberExcelVO.getEmploymentTime() + ",已存在的人名:" + |
| | | // partyBuildingMemberExcelVO.getName()); |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(partyBuildingMemberExcelVO.getEmploymentTime()) |
| | | && !DateUtils.isValidDate(partyBuildingMemberExcelVO.getEmploymentTime())) { |
| | | throw new PartyBuildingMemberException( |
| | | "导入失败,您导入的数据中有转正日期格式错误,错误数据:" + partyBuildingMemberExcelVO.getEmploymentTime() + ",错误人名:" |
| | | + partyBuildingMemberExcelVO.getName()); |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(partyBuildingMemberExcelVO.getJoinTime()) |
| | | && !DateUtils.isValidDate(partyBuildingMemberExcelVO.getJoinTime())) { |
| | | throw new PartyBuildingMemberException("导入失败,您导入的数据中有入党日期格式错误,错误数据:" |
| | | + partyBuildingMemberExcelVO.getJoinTime() + ",错误人名:" + partyBuildingMemberExcelVO.getName()); |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(partyBuildingMemberExcelVO.getEmploymentTime())) { |
| | | Date employmentTime = DateUtils.toValidDate(partyBuildingMemberExcelVO.getEmploymentTime()); |
| | | comPbMemberWestDO.setEmploymentTime(employmentTime); |
| | | } else { |
| | | comPbMemberWestDO.setEmploymentTime(null); |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(partyBuildingMemberExcelVO.getJoinTime())) { |
| | | Date joinTime = DateUtils.toValidDate(partyBuildingMemberExcelVO.getJoinTime()); |
| | | comPbMemberWestDO.setJoinTime(joinTime); |
| | | } else { |
| | | comPbMemberWestDO.setJoinTime(null); |
| | | } |
| | | |
| | | comPbMemberWestDO.setName(partyBuildingMemberExcelVO.getName()); |
| | | comPbMemberWestDO.setIdCard(partyBuildingMemberExcelVO.getIdCard()); |
| | | comPbMemberWestDOS.add(comPbMemberWestDO); |
| | | } |
| | | } |
| | | comPbMemberWestDOS.forEach(comPbMemberDO -> { |
| | | //金沙社区特殊需求 添加党员默认添加志愿者 |
| | | if(comPbMemberDO.getCommunityId()==2L){ |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO=new ComMngVolunteerMngVO(); |
| | | comMngVolunteerMngVO.setOrgId(53L); |
| | | comMngVolunteerMngVO.setName(comPbMemberDO.getName()); |
| | | comMngVolunteerMngVO.setPhone(comPbMemberDO.getPhone()); |
| | | comMngVolunteerMngVO.setIdCard(comPbMemberDO.getIdCard()); |
| | | comMngVolunteerMngVO.setState(2); |
| | | comMngVolunteerMngVO.setCommunityId(2L); |
| | | R r = communityWestService.addVolunteer(comMngVolunteerMngVO); |
| | | // 支援者添加成功,修改小程序用户的志愿者状态 ,通过手机号 |
| | | String phone = comMngVolunteerMngVO.getPhone(); |
| | | if (R.isOk(r) && StringUtils.isNotBlank(phone)) { |
| | | R r1 = userService.putUserIsVolunteer(phone, 1); |
| | | if (R.isOk(r1)) { |
| | | log.info("修改手机号【{}】的支援者状态为是", phone); |
| | | } else { |
| | | log.info("手机号【{}】没有小程序用户", phone); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | this.saveBatch(comPbMemberWestDOS); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 分页党员 |
| | | * |
| | | * @param pagePartyOrganizationVO |
| | | * 查询信息 |
| | | * @return 分页数据 |
| | | */ |
| | | @Override |
| | | public R pagePartyOrganization(PagePartyOrganizationVO pagePartyOrganizationVO) { |
| | | Page page = new Page<>(); |
| | | Long pageNum = pagePartyOrganizationVO.getPageNum(); |
| | | Long pageSize = pagePartyOrganizationVO.getPageSize(); |
| | | if (null == pageNum || 0 == pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (null == pageSize || 0 == pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<PartyBuildingMemberVO> iPage = comPbMemberWestDAO.queryAllByLimit(page, pagePartyOrganizationVO); |
| | | iPage.getRecords().forEach(record -> { |
| | | record.setIdCard(SensitiveUtil.desensitizedIdNumber(record.getIdCard())); |
| | | }); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | /** |
| | | * 编辑党员信息 新增字段均可编辑 |
| | | * |
| | | * @param partyBuildingMemberVO |
| | | * 编辑字段 |
| | | * @return 编辑结果 |
| | | */ |
| | | @Override |
| | | public R updatePartyBuildingMember(PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | ComPbMemberWestDO comPbMemberWestDO = new ComPbMemberWestDO(); |
| | | Long orgId = partyBuildingMemberVO.getOrgId(); |
| | | if (null != orgId && 0 == orgId) { |
| | | partyBuildingMemberVO.setOrgId(null); |
| | | } |
| | | BeanUtils.copyProperties(partyBuildingMemberVO, comPbMemberWestDO); |
| | | Integer type = partyBuildingMemberVO.getType(); |
| | | if (nonNull(type) && type.equals(1)) { |
| | | comPbMemberWestDO.setEmploymentTime(null); |
| | | } |
| | | comPbMemberWestDO.setAuditResult(partyBuildingMemberVO.getAuditResult()); |
| | | int i = comPbMemberWestDAO.updateById(comPbMemberWestDO); |
| | | if (i > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 查询指定社区的所有党员 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党员列表 |
| | | */ |
| | | @Override |
| | | public R listPartyMember(Long communityId) { |
| | | List<ComPbMemberWestDO> comPbMemberWestDOS = comPbMemberWestDAO.selectList(new QueryWrapper<ComPbMemberWestDO>().lambda() |
| | | .eq(ComPbMemberWestDO::getCommunityId, communityId).eq(ComPbMemberWestDO::getAuditResult, 1)); |
| | | // 查询社区所有已经注册的党员 |
| | | // 排除掉已经成为党委的党员 |
| | | // List<ComPbMemberDO> comPbMemberDOS = comPbMemberDAO.selectListRegister(communityId); |
| | | // if (ObjectUtils.isEmpty(comPbMemberDOS)) { |
| | | // return R.ok(new ArrayList<>()); |
| | | // } |
| | | List<PartyBuildingMemberVO> partyBuildingMemberVOS = new ArrayList<>(); |
| | | comPbMemberWestDOS.forEach(comPbMemberDO -> { |
| | | PartyBuildingMemberVO partyBuildingMemberVO = new PartyBuildingMemberVO(); |
| | | BeanUtils.copyProperties(comPbMemberDO, partyBuildingMemberVO); |
| | | partyBuildingMemberVOS.add(partyBuildingMemberVO); |
| | | }); |
| | | return R.ok(partyBuildingMemberVOS); |
| | | } |
| | | |
| | | /** |
| | | * 新增党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 新增信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addPartyCommittee(PartyCommitteeVO partyCommitteeVO) { |
| | | ComPbMemberRoleDO comPbMemberRoleDO = new ComPbMemberRoleDO(); |
| | | BeanUtils.copyProperties(partyCommitteeVO, comPbMemberRoleDO); |
| | | comPbMemberRoleDO.setCreateAt(new Date()); |
| | | comPbMemberRoleDO.setUpdateAt(new Date()); |
| | | comPbMemberRoleDO.setIsReg(2); |
| | | comPbMemberRoleDO.setSex(Integer.parseInt(partyCommitteeVO.getIdCard().substring(16,17))%2==0?2:1); |
| | | Integer userCount = comPbMemberRoleDAO.getSysUserByIdCardCount(partyCommitteeVO.getIdCard(), partyCommitteeVO.getAreaCode()); |
| | | if (userCount > 0) { |
| | | comPbMemberRoleDO.setIsReg(1); |
| | | } |
| | | Date nowDate = new Date(); |
| | | //判断党员信息是否存在党委信息 |
| | | ComPbMemberWestDO pbMemberDO = comPbMemberWestDAO.selectOne(new QueryWrapper<ComPbMemberWestDO>().lambda() |
| | | .eq(ComPbMemberWestDO::getIdCard,partyCommitteeVO.getIdCard()) |
| | | .eq(ComPbMemberWestDO::getAuditResult, ComPbMemberWestDO.AuditResult.SHTG) |
| | | .eq(ComPbMemberWestDO::getCommunityId,partyCommitteeVO.getCommunityId())); |
| | | if(pbMemberDO == null){ |
| | | //不存在则创建党委党员信息 |
| | | pbMemberDO = new ComPbMemberWestDO(); |
| | | BeanUtils.copyProperties(partyCommitteeVO, pbMemberDO); |
| | | pbMemberDO.setAuditResult(ComPbMemberWestDO.AuditResult.SHTG); |
| | | pbMemberDO.setCreateAt(nowDate); |
| | | pbMemberDO.setUpdateAt(nowDate); |
| | | pbMemberDO.setType(ComPbMemberWestDO.Type.ZSDY); |
| | | comPbMemberWestDAO.insert(pbMemberDO); |
| | | }else{ |
| | | //存在则更新党委党员信息 |
| | | BeanUtils.copyProperties(partyCommitteeVO, pbMemberDO); |
| | | pbMemberDO.setUpdateAt(nowDate); |
| | | pbMemberDO.setType(ComPbMemberWestDO.Type.ZSDY); |
| | | comPbMemberWestDAO.updateById(pbMemberDO); |
| | | } |
| | | int insert = comPbMemberRoleDAO.insert(comPbMemberRoleDO); |
| | | if (insert > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 编辑信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R updatePartyCommittee(PartyCommitteeVO partyCommitteeVO) { |
| | | ComPbMemberRoleDO comPbMemberRoleDO = new ComPbMemberRoleDO(); |
| | | Date nowDate = new Date(); |
| | | BeanUtils.copyProperties(partyCommitteeVO, comPbMemberRoleDO); |
| | | comPbMemberRoleDO.setUpdateAt(nowDate); |
| | | comPbMemberRoleDO.setIsReg(2); |
| | | Integer userCount = comPbMemberRoleDAO.getSysUserByIdCardCount(partyCommitteeVO.getIdCard(), partyCommitteeVO.getAreaCode()); |
| | | if (userCount > 0) { |
| | | comPbMemberRoleDO.setIsReg(1); |
| | | } |
| | | //查询党员信息并更新 |
| | | ComPbMemberWestDO pbMemberDO = comPbMemberWestDAO.selectOne(new QueryWrapper<ComPbMemberWestDO>().lambda() |
| | | .eq(ComPbMemberWestDO::getIdCard,partyCommitteeVO.getIdCard()) |
| | | .eq(ComPbMemberWestDO::getAuditResult, ComPbMemberWestDO.AuditResult.SHTG) |
| | | .eq(ComPbMemberWestDO::getCommunityId,partyCommitteeVO.getCommunityId())); |
| | | if(pbMemberDO != null){ |
| | | Long id = pbMemberDO.getId(); |
| | | BeanUtils.copyProperties(partyCommitteeVO, pbMemberDO); |
| | | pbMemberDO.setId(id); |
| | | pbMemberDO.setUpdateAt(nowDate); |
| | | pbMemberDO.setType(ComPbMemberWestDO.Type.ZSDY); |
| | | comPbMemberWestDAO.updateById(pbMemberDO); |
| | | } |
| | | int update = comPbMemberRoleDAO.updateById(comPbMemberRoleDO); |
| | | if (update > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 删除党委 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 删除id |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | public R deletePartyCommittee(PartyCommitteeVO partyCommitteeVO) { |
| | | ComPbMemberRoleDO comPbMemberRoleDO = comPbMemberRoleDAO.selectById(partyCommitteeVO.getId()); |
| | | if (comPbMemberRoleDO == null) { |
| | | return R.fail("记录不存在"); |
| | | } |
| | | int delete = comPbMemberRoleDAO.deleteById(partyCommitteeVO.getId()); |
| | | if (delete > 0) { |
| | | Long userId = comPbMemberRoleDAO.getUserIdByIdCard(comPbMemberRoleDO.getIdCard(), partyCommitteeVO.getAreaCode()); |
| | | // 删除用户信息缓存 |
| | | if (userId != null) { |
| | | String userKey = UserConstants.LOGIN_USER_INFO + userId; |
| | | stringRedisTemplate.delete(userKey); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 分页社区党委查询 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | | @Override |
| | | public R pagePartyCommittee(PartyCommitteeVO partyCommitteeVO) { |
| | | Page page = new Page<>(); |
| | | Long pageNum = partyCommitteeVO.getPageNum(); |
| | | Long pageSize = partyCommitteeVO.getPageSize(); |
| | | if (null == pageNum || 0 == pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (null == pageSize || 0 == pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<PartyCommitteeVO> iPage = comPbMemberRoleDAO.pagePartyOrganization(page, partyCommitteeVO); |
| | | iPage.getRecords().forEach(record -> { |
| | | record.setPhone(SensitiveUtil.desensitizedPhoneNumber(record.getPhone())); |
| | | }); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | /** |
| | | * 新建党建动态 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 动态内容 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | public R adddYnamic(PartyBuildingComPbDynVO partyCommitteeVO) { |
| | | ComPbDynDO comPbDynDO = new ComPbDynDO(); |
| | | BeanUtils.copyProperties(partyCommitteeVO, comPbDynDO); |
| | | comPbDynDO.setCreateAt(new Date()); |
| | | int insert = comPbDynDAO.insert(comPbDynDO); |
| | | if (insert > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑动态 |
| | | * |
| | | * @param partyCommitteeVO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @Override |
| | | public R updateYnamic(PartyBuildingComPbDynVO partyCommitteeVO) { |
| | | ComPbDynDO comPbDynDO = new ComPbDynDO(); |
| | | BeanUtils.copyProperties(partyCommitteeVO, comPbDynDO); |
| | | int insert = comPbDynDAO.updateById(comPbDynDO); |
| | | if (insert > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 动态详情 |
| | | * |
| | | * @param id |
| | | * 动态主键 |
| | | * @return 详情 |
| | | */ |
| | | @Override |
| | | public R infoYnamic(Long id) { |
| | | PartyBuildingComPbDynVO comPbDynVO = comPbDynDAO.selectVoById(id); |
| | | if (ObjectUtils.isEmpty(comPbDynVO)) { |
| | | return R.fail("动态不存在"); |
| | | } |
| | | // ComPbMemberDO comPbMemberDO = comPbMemberDAO.selectById(createBy); |
| | | // String name = comPbMemberDAO.selectNameByUserId(createBy); |
| | | |
| | | if (ObjectUtils.isEmpty(comPbDynVO.getCreateByName())) { |
| | | // return R.fail("发布人不存在"); |
| | | String name = comPbMemberWestDAO.selectNameByUserId(comPbDynVO.getCreateBy()); |
| | | name = "后台发布"; |
| | | comPbDynVO.setCreateByName(name); |
| | | } |
| | | // Integer integer = comPbDynUserDAO.selectCount(new |
| | | // QueryWrapper<ComPbDynUserDO>().lambda().eq(ComPbDynUserDO::getDynId, id)); |
| | | comPbDynVO.setReadingVolume(null == comPbDynVO.getReadingVolume() ? 0 : comPbDynVO.getReadingVolume()); |
| | | return R.ok(comPbDynVO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询党员动态 |
| | | * |
| | | * @param partyBuildingComPbDynVO |
| | | * 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | @Override |
| | | public R pageYnamic(PartyBuildingComPbDynVO partyBuildingComPbDynVO) { |
| | | Page page = new Page<>(); |
| | | Long pageNum = partyBuildingComPbDynVO.getPageNum(); |
| | | Long pageSize = partyBuildingComPbDynVO.getPageSize(); |
| | | if (null == pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (null == pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<PartyBuildingComPbDynVO> iPage = comPbDynDAO.pageYnamic(page, partyBuildingComPbDynVO); |
| | | List<PartyBuildingComPbDynVO> records = iPage.getRecords(); |
| | | if (!(ObjectUtils.isEmpty(records))) { |
| | | records.forEach(partyBuildingComPbDynVO1 -> { |
| | | String content = partyBuildingComPbDynVO1.getContent(); |
| | | if (!ObjectUtils.isEmpty(content)) { |
| | | String text = RichTextUtil.getText(content); |
| | | partyBuildingComPbDynVO1.setContentText(text); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | /** |
| | | * 删除动态 |
| | | * |
| | | * @param id |
| | | * 动态主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | public R deleteYnamic(Integer id) { |
| | | int delete = comPbDynDAO.deleteById(id); |
| | | if (delete > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 增加阅读记录 |
| | | * |
| | | * @param comPbDynUserVO |
| | | * 阅读记录 |
| | | * @return 增加结果 |
| | | */ |
| | | @Override |
| | | public R addDynUser(ComPbDynUserVO comPbDynUserVO) { |
| | | ComPbDynUserDO comPbDynUserDO = new ComPbDynUserDO(); |
| | | BeanUtils.copyProperties(comPbDynUserVO, comPbDynUserDO); |
| | | int insert = comPbDynUserDAO.insert(comPbDynUserDO); |
| | | if (insert > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 删除党员 |
| | | * |
| | | * @param id |
| | | * 党员主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R deleteDynUser(Integer id) { |
| | | ComPbMemberWestDO comPbMemberWestDO = comPbMemberWestDAO.selectById(id); |
| | | if (ObjectUtils.isEmpty(comPbMemberWestDO)) { |
| | | return R.fail("党员不存在"); |
| | | } |
| | | int delete = comPbMemberWestDAO.deleteById(id); |
| | | if (delete > 0) { |
| | | comPbMemberRoleDAO.delete(new LambdaQueryWrapper<ComPbMemberRoleDO>() |
| | | .eq(ComPbMemberRoleDO::getIdCard, comPbMemberWestDO.getIdCard()) |
| | | .eq(ComPbMemberRoleDO::getCommunityId, comPbMemberWestDO.getCommunityId())); |
| | | // 维护用户表党员状态 |
| | | comPbMemberWestDAO.updateUserIsPartymember(comPbMemberWestDO.getIdCard()); |
| | | // 删除缓存 |
| | | String userKey = UserConstants.LOGIN_USER_INFO + comPbMemberWestDO.getUserId(); |
| | | stringRedisTemplate.delete(userKey); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务刷新党建动态发布状态 |
| | | * |
| | | * @return 刷新数据数量 |
| | | */ |
| | | @Override |
| | | public R timedTaskPartyBuildingStatus() { |
| | | int num = comPbDynDAO.timedTaskPartyBuildingStatus(); |
| | | log.info("定时任务更新党建动态发布状态数量【{}】", num); |
| | | return R.ok(num); |
| | | } |
| | | |
| | | @Override |
| | | public R pagePrePartyBuilingMember(PagePartyBuildingMemberVO pagePartyBuildingMemberVO) { |
| | | |
| | | Page page = new Page<>(); |
| | | Long pageNum = pagePartyBuildingMemberVO.getPageNum(); |
| | | Long pageSize = pagePartyBuildingMemberVO.getPageSize(); |
| | | if (null == pageNum || 0 == pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (null == pageSize || 0 == pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<PartyBuildingMemberVO> iPage = comPbMemberWestDAO.pagePartyBuildingMembersVO(page, pagePartyBuildingMemberVO); |
| | | |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | @Override |
| | | public R updatePartyBuildingMembers(PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | ComPbMemberWestDO comPbMemberWestDO = comPbMemberWestDAO.selectById(partyBuildingMemberVO.getId()); |
| | | if (comPbMemberWestDO == null) { |
| | | return R.fail("未找到党员认证信息"); |
| | | } |
| | | // BeanUtils.copyProperties(partyBuildingMemberVO, comPbMemberDO); |
| | | comPbMemberWestDO.setAuditResult(partyBuildingMemberVO.getAuditResult()); |
| | | if (partyBuildingMemberVO.getAuditResult() != null && partyBuildingMemberVO.getAuditResult().equals(3)) { |
| | | comPbMemberWestDO.setRefuseReason(partyBuildingMemberVO.getRefuseReason()); |
| | | } |
| | | if (partyBuildingMemberVO.getAuditResult() != null && partyBuildingMemberVO.getAuditResult().equals(1)) { |
| | | comPbMemberWestDO.setUpdateAt(new Date()); |
| | | } |
| | | |
| | | // 编辑 |
| | | if (partyBuildingMemberVO.getJoinTime() != null) { |
| | | comPbMemberWestDO.setJoinTime(partyBuildingMemberVO.getJoinTime()); |
| | | } |
| | | if (partyBuildingMemberVO.getEmploymentTime() != null) { |
| | | comPbMemberWestDO.setEmploymentTime(partyBuildingMemberVO.getEmploymentTime()); |
| | | } |
| | | if (partyBuildingMemberVO.getIdCard() != null && !partyBuildingMemberVO.getIdCard().contains("*")) { |
| | | comPbMemberWestDO.setIdCard(partyBuildingMemberVO.getIdCard()); |
| | | } |
| | | if (partyBuildingMemberVO.getName() != null) { |
| | | comPbMemberWestDO.setName(partyBuildingMemberVO.getName()); |
| | | } |
| | | if (partyBuildingMemberVO.getOrgId() != null) { |
| | | comPbMemberWestDO.setOrgId(partyBuildingMemberVO.getOrgId()); |
| | | } |
| | | if (partyBuildingMemberVO.getPhotoPath() != null) { |
| | | comPbMemberWestDO.setPhotoPath(partyBuildingMemberVO.getPhotoPath()); |
| | | } |
| | | if (nonNull(partyBuildingMemberVO.getType())) { |
| | | comPbMemberWestDO.setType(partyBuildingMemberVO.getType()); |
| | | } |
| | | if (StringUtils.isNotEmpty(partyBuildingMemberVO.getPosition())) { |
| | | comPbMemberWestDO.setPosition(partyBuildingMemberVO.getPosition()); |
| | | } |
| | | if (nonNull(partyBuildingMemberVO.getCheckUnitId())) { |
| | | comPbMemberWestDO.setCheckUnitId(partyBuildingMemberVO.getCheckUnitId()); |
| | | } |
| | | if (StringUtils.isNotEmpty(partyBuildingMemberVO.getFunction())) { |
| | | comPbMemberWestDO.setFunction(partyBuildingMemberVO.getFunction()); |
| | | } |
| | | if (nonNull(partyBuildingMemberVO.getSpecialtyCategory())) { |
| | | comPbMemberWestDO.setSpecialtyCategory(partyBuildingMemberVO.getSpecialtyCategory()); |
| | | comPbMemberWestDO.setSpecialtyName(partyBuildingMemberVO.getSpecialtyName()); |
| | | } |
| | | |
| | | Integer type = partyBuildingMemberVO.getType(); |
| | | if (nonNull(type) && type.equals(1)) { |
| | | comPbMemberWestDO.setEmploymentTime(null); |
| | | } |
| | | |
| | | |
| | | if (comPbMemberWestDAO.updateById(comPbMemberWestDO) > 0) { |
| | | PartyBuildingMemberVO rtVO = new PartyBuildingMemberVO(); |
| | | BeanUtils.copyProperties(comPbMemberWestDO, rtVO); |
| | | return R.ok(rtVO); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public R exportPbMember(PagePartyOrganizationVO organizationVO) { |
| | | return R.ok(comPbMemberWestDAO.exportPbMember(organizationVO)); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询党员数据统计 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员数据统计 |
| | | */ |
| | | @Override |
| | | public R pageDataStatisticsMember(PageComDataStatisticsMemberDto statisticsMemberDto) { |
| | | IPage<ComDataStatisticsMemberVo> memberPage = comPbMemberWestDAO.pageDataStatisticsMember(new Page(statisticsMemberDto.getPageNum() |
| | | ,statisticsMemberDto.getPageSize()),statisticsMemberDto); |
| | | memberPage.getRecords().forEach(member -> { |
| | | if(member.getIsRole() > 0){ |
| | | member.setIsRole(1); |
| | | }else{ |
| | | member.setIsRole(2); |
| | | } |
| | | try { |
| | | member.setAge(IdcardUtil.getAgeByIdCard(member.getIdCard())); |
| | | } catch (Exception e) { |
| | | log.error("年龄转义失败"); |
| | | } |
| | | //查询党员统计数据 |
| | | ComDataStatisticsMemberVo statisticsMemberVo = comPbMemberWestDAO.getMemberStatistics(member.getUserId(),member.getCommunityId()); |
| | | if(statisticsMemberVo != null){ |
| | | member.setPartyActivityCount(statisticsMemberVo.getPartyActivityCount()); |
| | | member.setPartyActivityDuration(statisticsMemberVo.getPartyActivityDuration()); |
| | | member.setVolunteerActivityCount(statisticsMemberVo.getVolunteerActivityCount()); |
| | | member.setVolunteerActivityDuration(statisticsMemberVo.getVolunteerActivityDuration()); |
| | | member.setVolunteerActivityIntegral(statisticsMemberVo.getVolunteerActivityIntegral()); |
| | | member.setWishCount(statisticsMemberVo.getWishCount()); |
| | | member.setEasyCount(statisticsMemberVo.getEasyCount()); |
| | | member.setActivityCount(member.getPartyActivityCount() + member.getVolunteerActivityCount()); |
| | | member.setActivityDuration(member.getPartyActivityDuration() + member.getVolunteerActivityDuration()); |
| | | } |
| | | }); |
| | | return R.ok(memberPage); |
| | | } |
| | | |
| | | /** |
| | | * 根据组织id查询组织下统计数据 |
| | | * @param statisticsOrgDto 请求参数 |
| | | * @return 组织下统计数据 |
| | | */ |
| | | @Override |
| | | public R getOrgDataStatistics(ComDataStatisticsOrgDto statisticsOrgDto) { |
| | | List<Long> orgIds = new ArrayList<>(); |
| | | Long communityId = statisticsOrgDto.getCommunityId(); |
| | | ComDataStatisticsOrgVo statisticsOrgVo = new ComDataStatisticsOrgVo(); |
| | | if(statisticsOrgDto.getOrgId() != null){ |
| | | ComPbOrgDO pbOrgDO = comPbOrgDAO.selectById(statisticsOrgDto.getOrgId()); |
| | | if(pbOrgDO == null){ |
| | | return R.fail("未查询到党组织"); |
| | | } |
| | | //拼接党组织id |
| | | if(pbOrgDO.getOneId() != null){ |
| | | orgIds.add(pbOrgDO.getOneId()); |
| | | } |
| | | if(pbOrgDO.getTwoId() != null){ |
| | | orgIds.add(pbOrgDO.getTwoId()); |
| | | } |
| | | if(pbOrgDO.getThirdId() != null){ |
| | | orgIds.add(pbOrgDO.getThirdId()); |
| | | } |
| | | if(pbOrgDO.getFourId() != null){ |
| | | orgIds.add(pbOrgDO.getFourId()); |
| | | } |
| | | if(pbOrgDO.getFiveId() != null){ |
| | | orgIds.add(pbOrgDO.getFiveId()); |
| | | } |
| | | } |
| | | //拼接查询开始结束时间 |
| | | String startTime = statisticsOrgDto.getYear() + "-01-01 00:00:00"; |
| | | String endTime = statisticsOrgDto.getYear() + "-12-31 23:59:59"; |
| | | |
| | | ComDataStatisticsOrgVo statisticsVo = new ComDataStatisticsOrgVo(); |
| | | //查询统计左上数据 |
| | | statisticsVo = comPbMemberWestDAO.getOrgDataStatistics(communityId,orgIds); |
| | | if(statisticsVo != null){ |
| | | BeanUtils.copyProperties(statisticsVo,statisticsOrgVo); |
| | | } |
| | | |
| | | //查询左下数据 |
| | | statisticsVo = comPbMemberWestDAO.getOrgDataStatisticsLeftDown(communityId,orgIds,startTime,endTime, statisticsOrgDto.getAreaCode()); |
| | | if(statisticsVo != null){ |
| | | statisticsOrgVo.setParticipateVolunteerActivityDuration(statisticsVo.getParticipateVolunteerActivityDuration()); |
| | | statisticsOrgVo.setParticipateVolunteerActivityNum(statisticsVo.getParticipateVolunteerActivityNum()); |
| | | statisticsOrgVo.setParticipatePartyActivityNum(statisticsVo.getParticipatePartyActivityNum()); |
| | | } |
| | | |
| | | //查询党员数据 |
| | | IPage<PartyBuildingMemberVO> partyMemberPage = comPbMemberWestDAO.getOrgDataStatisticsMember(new Page(statisticsOrgDto.getPageNum() |
| | | ,statisticsOrgDto.getPageSize()),communityId,orgIds, statisticsOrgDto.getAreaCode()); |
| | | if(partyMemberPage.getRecords() != null && !partyMemberPage.getRecords().isEmpty()){ |
| | | statisticsOrgVo.setPartyMemberList(partyMemberPage.getRecords()); |
| | | } |
| | | |
| | | List<String> startDateList = DateUtils.getYearFirstMonths(statisticsOrgDto.getYear()); |
| | | List<String> endDateList = DateUtils.getYearLastMonths(statisticsOrgDto.getYear()); |
| | | List<String> completeWishList = new ArrayList<>(); |
| | | List<String> cumulativeWishList = new ArrayList<>(); |
| | | List<String> completeEasyList = new ArrayList<>(); |
| | | List<String> cumulativeEasyList = new ArrayList<>(); |
| | | for (int i = 0; i < startDateList.size(); i++) { |
| | | Map<String,Object> statisticsMap = comPbMemberWestDAO.getOrgDataStatisticsRightDown(communityId,orgIds, startDateList.get(i) + " 00:00:00", endDateList.get(i) + " 23:59:59"); |
| | | if(statisticsMap != null){ |
| | | completeWishList.add(statisticsMap.get("completeWishNum").toString()); |
| | | cumulativeWishList.add(statisticsMap.get("cumulativeWishNum").toString()); |
| | | completeEasyList.add(statisticsMap.get("completeEasyNum").toString()); |
| | | cumulativeEasyList.add(statisticsMap.get("cumulativeEasyNum").toString()); |
| | | if(i == startDateList.size() - 1){ |
| | | statisticsOrgVo.setWishNum(statisticsMap.get("cumulativeWishNum").toString()); |
| | | statisticsOrgVo.setEasyNum(statisticsMap.get("cumulativeEasyNum").toString()); |
| | | } |
| | | } |
| | | } |
| | | statisticsOrgVo.setCompleteEasyList(completeEasyList); |
| | | statisticsOrgVo.setCompleteWishList(completeWishList); |
| | | statisticsOrgVo.setCumulativeWishList(cumulativeWishList); |
| | | statisticsOrgVo.setCumulativeEasyList(cumulativeEasyList); |
| | | Integer partyMemberNum = statisticsOrgVo.getPartyMemberNum(); |
| | | if (nonNull(partyMemberNum) && partyMemberNum.intValue() > 0) { |
| | | Integer formalPartyMemberNum = statisticsOrgVo.getFormalPartyMemberNum(); |
| | | if (nonNull(formalPartyMemberNum) && formalPartyMemberNum.intValue() > 0) { |
| | | statisticsOrgVo.setFormalPartyMemberNumPercent(new BigDecimal(formalPartyMemberNum) |
| | | .divide(new BigDecimal(partyMemberNum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | Integer preparePartyMemberNum = statisticsOrgVo.getPreparePartyMemberNum(); |
| | | if (nonNull(preparePartyMemberNum) && preparePartyMemberNum.intValue() > 0) { |
| | | statisticsOrgVo.setPreparePartyMemberNumPercent(new BigDecimal(preparePartyMemberNum) |
| | | .divide(new BigDecimal(partyMemberNum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | Integer tyNum = statisticsOrgVo.getTyNum(); |
| | | if (nonNull(tyNum) && tyNum.intValue() > 0) { |
| | | statisticsOrgVo.setTyNumPercent(new BigDecimal(tyNum) |
| | | .divide(new BigDecimal(partyMemberNum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | Integer msNum = statisticsOrgVo.getMsNum(); |
| | | if (nonNull(msNum) && msNum.intValue() > 0) { |
| | | statisticsOrgVo.setMsNumPercent(new BigDecimal(msNum) |
| | | .divide(new BigDecimal(partyMemberNum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | Integer yyNum = statisticsOrgVo.getYyNum(); |
| | | if (nonNull(yyNum) && yyNum.intValue() > 0) { |
| | | statisticsOrgVo.setYyNumPercent(new BigDecimal(yyNum) |
| | | .divide(new BigDecimal(partyMemberNum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | Integer wdNum = statisticsOrgVo.getWdNum(); |
| | | if (nonNull(wdNum) && wdNum.intValue() > 0) { |
| | | statisticsOrgVo.setWdNumPercent(new BigDecimal(wdNum) |
| | | .divide(new BigDecimal(partyMemberNum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | Integer qtNum = statisticsOrgVo.getQtNum(); |
| | | if (nonNull(qtNum) && qtNum.intValue() > 0) { |
| | | statisticsOrgVo.setQtNumPercent(new BigDecimal(qtNum) |
| | | .divide(new BigDecimal(partyMemberNum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | Integer wuNum = statisticsOrgVo.getWuNum(); |
| | | if (nonNull(wuNum) && wuNum.intValue() > 0) { |
| | | statisticsOrgVo.setWuNumPercent(new BigDecimal(wuNum) |
| | | .divide(new BigDecimal(partyMemberNum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | } |
| | | Integer participateActivityNum = statisticsOrgVo.getParticipateActivityNum(); |
| | | if (nonNull(participateActivityNum) && participateActivityNum.intValue() > 0) { |
| | | Integer participateVolunteerActivityNum = statisticsOrgVo.getParticipateVolunteerActivityNum(); |
| | | if (nonNull(participateVolunteerActivityNum) && participateVolunteerActivityNum.intValue() > 0) { |
| | | statisticsOrgVo.setParticipateVolunteerActivityNumPercent(new BigDecimal(participateVolunteerActivityNum) |
| | | .divide(new BigDecimal(participateActivityNum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | Integer participatePartyActivityNum = statisticsOrgVo.getParticipatePartyActivityNum(); |
| | | if (nonNull(participatePartyActivityNum) && participatePartyActivityNum.intValue() > 0) { |
| | | statisticsOrgVo.setParticipatePartyActivityNumPercent(new BigDecimal(participatePartyActivityNum) |
| | | .divide(new BigDecimal(participateActivityNum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | } |
| | | Integer participateActivityDuration = statisticsOrgVo.getParticipateActivityDuration(); |
| | | if (nonNull(participateActivityDuration) && participateActivityDuration.intValue() > 0) { |
| | | Integer participateVolunteerActivityDuration = statisticsOrgVo.getParticipateVolunteerActivityDuration(); |
| | | if (nonNull(participateVolunteerActivityDuration) && participateVolunteerActivityDuration.intValue() > 0) { |
| | | statisticsOrgVo.setParticipateVolunteerActivityDurationPercent(new BigDecimal(participateVolunteerActivityDuration) |
| | | .divide(new BigDecimal(participateActivityDuration), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | Integer participatePartyActivityDuration = statisticsOrgVo.getParticipatePartyActivityDuration(); |
| | | if (nonNull(participatePartyActivityDuration) && participatePartyActivityDuration.intValue() > 0) { |
| | | statisticsOrgVo.setParticipatePartyActivityDurationPercent(new BigDecimal(participatePartyActivityDuration) |
| | | .divide(new BigDecimal(participateActivityDuration), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); |
| | | } |
| | | } |
| | | return R.ok(statisticsOrgVo); |
| | | } |
| | | |
| | | /** |
| | | * 查询党组织表头统计数据 |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党组织表头统计数据 |
| | | */ |
| | | @Override |
| | | public R getHeaderOrgDataStatistics(Long communityId) { |
| | | ComDataStatisticsHeaderOrgVo headerOrgVo = comPbMemberWestDAO.getHeaderOrgDataStatistics(communityId); |
| | | if(headerOrgVo != null){ |
| | | if(headerOrgVo.getVillageNum() == null || headerOrgVo.getVillageNum().equals(0)){ |
| | | headerOrgVo.setVillageRate(BigDecimal.ZERO); |
| | | }else{ |
| | | headerOrgVo.setVillageRate(BigDecimal.valueOf(headerOrgVo.getAreaNum()).divide(BigDecimal.valueOf(headerOrgVo.getVillageNum()) |
| | | ,4,BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100))); |
| | | } |
| | | } |
| | | return R.ok(headerOrgVo); |
| | | } |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | @Override |
| | | public R exportDataStatisticsMember(PageComDataStatisticsMemberDto statisticsMemberDto) { |
| | | List<ComDataStatisticsMemberExcelVo> memberList = comPbMemberWestDAO.exportDataStatisticsMember(statisticsMemberDto); |
| | | memberList.forEach(member -> { |
| | | //查询党员统计数据 |
| | | ComDataStatisticsMemberVo statisticsMemberVo = comPbMemberWestDAO.getMemberStatistics(member.getUserId(),member.getCommunityId()); |
| | | if(statisticsMemberVo != null){ |
| | | member.setPartyActivityCount(statisticsMemberVo.getPartyActivityCount()); |
| | | member.setPartyActivityDuration(statisticsMemberVo.getPartyActivityDuration()); |
| | | member.setVolunteerActivityCount(statisticsMemberVo.getVolunteerActivityCount()); |
| | | member.setVolunteerActivityDuration(statisticsMemberVo.getVolunteerActivityDuration()); |
| | | member.setVolunteerActivityIntegral(statisticsMemberVo.getVolunteerActivityIntegral()); |
| | | member.setWishCount(statisticsMemberVo.getWishCount()); |
| | | member.setEasyCount(statisticsMemberVo.getEasyCount()); |
| | | member.setActivityCount(member.getPartyActivityCount() + member.getVolunteerActivityCount()); |
| | | member.setActivityDuration(member.getPartyActivityDuration() + member.getVolunteerActivityDuration()); |
| | | } |
| | | }); |
| | | return R.ok(memberList); |
| | | } |
| | | |
| | | /** |
| | | * 党委导入接口 |
| | | * @param list 数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R importPbMemberRole(List<ComPbMemberRoleExcelVo> list, Long communityId, Long userId) { |
| | | ComActVO actVO = comPbMemberRoleDAO.selectActById(communityId); |
| | | ArrayList<ComPbMemberRoleErrorExcelVo> mistakes = Lists.newArrayList(); |
| | | ArrayList<ComPbMemberRoleDO> saveList = Lists.newArrayList(); |
| | | Date nowDate = new Date(); |
| | | if(list != null && list.size() > 0){ |
| | | list.forEach(memberRole -> { |
| | | ComPbMemberRoleDO memberRoleDO = comPbMemberRoleDAO.selectOne(new QueryWrapper<ComPbMemberRoleDO>().lambda() |
| | | .eq(ComPbMemberRoleDO::getCommunityId,communityId).eq(ComPbMemberRoleDO::getIdCard,memberRole.getIdCard())); |
| | | if(memberRoleDO != null){ |
| | | ComPbMemberRoleErrorExcelVo roleErrorExcelVo = new ComPbMemberRoleErrorExcelVo(); |
| | | BeanUtils.copyProperties(memberRole,roleErrorExcelVo); |
| | | roleErrorExcelVo.setError("该党委已存在,不可重复导入"); |
| | | mistakes.add(roleErrorExcelVo); |
| | | }else{ |
| | | memberRoleDO = new ComPbMemberRoleDO(); |
| | | BeanUtils.copyProperties(memberRole,memberRoleDO); |
| | | Integer type = ComPbMemberRoleTypeEnum.getCodeByName(memberRole.getTypeName()); |
| | | if(type.equals(0)){ |
| | | ComPbMemberRoleErrorExcelVo roleErrorExcelVo = new ComPbMemberRoleErrorExcelVo(); |
| | | BeanUtils.copyProperties(memberRole,roleErrorExcelVo); |
| | | roleErrorExcelVo.setError("党委标签不存在,请核对后再重新导入"); |
| | | mistakes.add(roleErrorExcelVo); |
| | | return; |
| | | }else{ |
| | | memberRoleDO.setType(type); |
| | | } |
| | | try { |
| | | Date joinTime = DateUtils.stringToDate(memberRole.getJoinTime(),DateUtils.yyyyMMdd_format); |
| | | memberRoleDO.setJoinTime(joinTime); |
| | | } catch (Exception e) { |
| | | ComPbMemberRoleErrorExcelVo roleErrorExcelVo = new ComPbMemberRoleErrorExcelVo(); |
| | | BeanUtils.copyProperties(memberRole,roleErrorExcelVo); |
| | | roleErrorExcelVo.setError("入党时间格式错误,请按照正确格式填写,如:2022-01-01"); |
| | | mistakes.add(roleErrorExcelVo); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | Date employmentTime = DateUtils.stringToDate(memberRole.getEmploymentTime(),DateUtils.yyyyMMdd_format); |
| | | memberRoleDO.setEmploymentTime(employmentTime); |
| | | } catch (Exception e) { |
| | | ComPbMemberRoleErrorExcelVo roleErrorExcelVo = new ComPbMemberRoleErrorExcelVo(); |
| | | BeanUtils.copyProperties(memberRole,roleErrorExcelVo); |
| | | roleErrorExcelVo.setError("转正时间格式错误,请按照正确格式填写,如:2022-01-01"); |
| | | mistakes.add(roleErrorExcelVo); |
| | | return; |
| | | } |
| | | Integer userCount = comPbMemberRoleDAO.getSysUserByIdCardCount(memberRole.getIdCard(), actVO.getAreaCode()); |
| | | memberRoleDO.setIsReg(userCount > 0 ? 1 : 2); |
| | | memberRoleDO.setCommunityId(communityId); |
| | | saveList.add(memberRoleDO); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if(saveList.size() > 0){ |
| | | saveList.forEach(save -> { |
| | | comPbMemberRoleDAO.insert(save); |
| | | }); |
| | | } |
| | | if(mistakes.size() > 0){ |
| | | return R.fail(mistakes); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R exportPartyMember(PagePartyOrganizationVO pagePartyOrganizationVO) { |
| | | return R.ok(comPbMemberWestDAO.exportPartyMemberList(pagePartyOrganizationVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R checkMember(String idCard) { |
| | | List<ComPbMemberWestDO> list= comPbMemberWestDAO.selectList(new QueryWrapper<ComPbMemberWestDO>().lambda().eq(ComPbMemberWestDO::getIdCard,idCard)); |
| | | return R.ok(CollectionUtils.isEmpty(list)); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_dangjian.dao.ComPbMemberDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_dangjian.model.dos.ComPbMemberDO" id="ComPbMemberMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="orgId" column="org_id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="idCard" column="id_card" jdbcType="VARCHAR"/> |
| | | <result property="photoPath" column="photo_path" jdbcType="VARCHAR"/> |
| | | <result property="joinTime" column="join_time" jdbcType="TIMESTAMP"/> |
| | | <result property="employmentTime" column="employment_time" jdbcType="TIMESTAMP"/> |
| | | <result property="auditResult" column="audit_result" jdbcType="INTEGER"/> |
| | | <result property="createAt" column="create_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updateAt" column="update_at" jdbcType="TIMESTAMP"/> |
| | | <result property="communityId" column="community_id" jdbcType="INTEGER"/> |
| | | <result property="userId" column="user_id" jdbcType="INTEGER"/> |
| | | <result property="refuseReason" column="refuse_reason" jdbcType="VARCHAR"/> |
| | | <result property="phone" column="phone" jdbcType="VARCHAR"/> |
| | | <result property="type" column="type" jdbcType="INTEGER"/> |
| | | <result property="position" column="position" jdbcType="VARCHAR"/> |
| | | <result property="checkUnitId" column="check_unit_id" jdbcType="INTEGER"/> |
| | | <result property="function" column="function" jdbcType="VARCHAR"/> |
| | | <result property="specialtyCategory" column="specialty_category" jdbcType="INTEGER"/> |
| | | <result property="specialtyName" column="specialty_name" jdbcType="VARCHAR"/> |
| | | <result property="positionTwo" column="position_two" jdbcType="VARCHAR"/> |
| | | <result property="otherRemark" column="other_remark" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <!--查询单个--> |
| | | <select id="queryById" resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | select |
| | | m.id, m.org_id, m.name, m.id_card, m.photo_path, m.join_time, m.employment_time, m.audit_result, m.create_at, m.update_at, |
| | | m.community_id, m.user_id, m.refuse_reason, m.phone, m.type, m.position, m.check_unit_id, m.function, m.specialty_category, |
| | | m.specialty_name, m.position_two, o.`name` orgName,cpcu.name as checkUnitName, |
| | | TIMESTAMPDIFF( |
| | | YEAR, |
| | | m.employment_time, |
| | | DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge, |
| | | CASE |
| | | |
| | | WHEN u.id_card IS NULL THEN |
| | | '未注册' ELSE '已注册' |
| | | END status |
| | | from com_pb_member as m |
| | | LEFT JOIN sys_user u ON m.id_card = u.id_card |
| | | LEFT JOIN com_pb_org o ON m.org_id = o.id |
| | | LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id |
| | | where m.id = #{id} |
| | | </select> |
| | | |
| | | <!--查询指定行数据--> |
| | | <select id="queryAllByLimit" resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | select |
| | | m.id, m.org_id, m.name, m.id_card, m.photo_path, m.join_time, m.employment_time, m.audit_result, m.create_at, m.update_at, |
| | | m.community_id, m.user_id, m.refuse_reason, m.phone, m.type, m.position, m.check_unit_id, m.function, m.specialty_category, |
| | | m.specialty_name, m.position_two, m.org_name,cpcu.name as checkUnitName,t2.partyTime,t2.partyInterval,cmv.name as villageName,ca.name as communityName,cpcu.belong_to, |
| | | TIMESTAMPDIFF( |
| | | YEAR, |
| | | m.employment_time, |
| | | DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge |
| | | from com_pb_member as m |
| | | LEFT JOIN com_pb_org o ON m.org_id = o.id |
| | | LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id |
| | | LEFT JOIN com_mng_village cmv on m.village_id = cmv.village_id |
| | | LEFT JOIN com_act ca on m.community_id = ca.community_id |
| | | LEFT JOIN (select t1.user_id,sum(t.duration) as partyTime,sum(t.reward_integral) as partyInterval from com_act_activity t LEFT JOIN com_act_act_regist t1 on t.id = t1.activity_id where t.type = 3 |
| | | <if test="dto.startTime !=null"> |
| | | and t.begin_at between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | GROUP BY t1.user_id ) t2 on m.user_id = t2.user_id |
| | | <where> |
| | | and m.audit_result = 1 |
| | | <if test='dto.orgName != null and dto.orgName != ""'> |
| | | and o.name like concat(#{dto.orgName},'%') |
| | | </if> |
| | | <if test='dto.orgId != null'> |
| | | and o.id = #{dto.orgId} |
| | | </if> |
| | | <if test='dto.account != null and dto.account != ""'> |
| | | and m.phone like concat (#{dto.account},'%') |
| | | </if> |
| | | <if test='dto.name != null and dto.name != ""'> |
| | | and m.name like concat (#{dto.name},'%') |
| | | </if> |
| | | <if test="dto.orgId != null"> |
| | | and m.org_id = #{dto.orgId} |
| | | </if> |
| | | <if test="dto.communityId != null and dto.communityId !=0"> |
| | | and m.community_id = ${dto.communityId} |
| | | </if> |
| | | <if test="dto.keyWord != null and dto.keyWord != ''"> |
| | | and (m.name like concat ('%',#{dto.keyWord},'%') or |
| | | m.phone like concat ('%',#{dto.keyWord},'%') or |
| | | cpcu.name like concat ('%',#{dto.keyWord},'%') or ca.name like concat ('%',#{dto.keyWord},'%') |
| | | ) |
| | | </if> |
| | | <if test="dto.type != null"> |
| | | and m.type = #{dto.type} |
| | | </if> |
| | | <if test="dto.checkUnitId != null"> |
| | | and m.check_unit_id = #{dto.checkUnitId} |
| | | </if> |
| | | <if test="dto.specialtyName != null and dto.specialtyName !=''"> |
| | | and m.specialty_name like concat('%',#{dto.specialtyName},'%') |
| | | </if> |
| | | <if test="dto.belongTo !=null and dto.belongTo !=''"> |
| | | and cpcu.belong_to = #{dto.belongTo} |
| | | </if> |
| | | </where> |
| | | order by m.create_at desc |
| | | </select> |
| | | |
| | | <select id="exportPartyMemberList" resultType="com.panzhihua.common.model.vos.PartyMemberListExcelVO"> |
| | | select |
| | | m.id, m.org_id, m.name, m.id_card, m.photo_path, m.join_time, m.employment_time, m.audit_result, m.create_at, m.update_at, |
| | | m.community_id, m.user_id, m.refuse_reason, m.phone, m.type, m.position, m.check_unit_id, m.function, m.specialty_category, |
| | | m.specialty_name, m.position_two, m.org_name,cpcu.name as checkUnitName,t2.partyTime,t2.partyInterval,cmv.name as villageName,ca.name as communityName,cpcu.belong_to,cpcu.help_community_name, |
| | | TIMESTAMPDIFF( |
| | | YEAR, |
| | | m.employment_time, |
| | | DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge |
| | | from com_pb_member as m |
| | | LEFT JOIN com_pb_org o ON m.org_id = o.id |
| | | LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id |
| | | LEFT JOIN com_mng_village cmv on m.village_id = cmv.village_id |
| | | LEFT JOIN com_act ca on m.community_id = ca.community_id |
| | | LEFT JOIN (select t1.user_id,sum(t.duration) as partyTime,sum(t.reward_integral) as partyInterval from com_act_activity t LEFT JOIN com_act_act_regist t1 on t.id = t1.activity_id where t.type = 3 |
| | | <if test="dto.startTime !=null"> |
| | | and t.begin_at between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | GROUP BY t1.user_id ) t2 on m.user_id = t2.user_id |
| | | <where> |
| | | and m.audit_result = 1 |
| | | <if test='dto.orgName != null and dto.orgName != ""'> |
| | | and o.name like concat(#{dto.orgName},'%') |
| | | </if> |
| | | <if test='dto.orgId != null'> |
| | | and o.id = #{dto.orgId} |
| | | </if> |
| | | <if test='dto.account != null and dto.account != ""'> |
| | | and m.phone like concat (#{dto.account},'%') |
| | | </if> |
| | | <if test='dto.name != null and dto.name != ""'> |
| | | and m.name like concat (#{dto.name},'%') |
| | | </if> |
| | | <if test="dto.orgId != null"> |
| | | and m.org_id = #{dto.orgId} |
| | | </if> |
| | | <if test="dto.communityId != null and dto.communityId !=0"> |
| | | and m.community_id = ${dto.communityId} |
| | | </if> |
| | | <if test="dto.keyWord != null and dto.keyWord != ''"> |
| | | and (m.name like concat ('%',#{dto.keyWord},'%') or |
| | | m.phone like concat ('%',#{dto.keyWord},'%') or |
| | | cpcu.name like concat ('%',#{dto.keyWord},'%') or ca.name like concat ('%',#{dto.keyWord},'%') |
| | | ) |
| | | </if> |
| | | <if test="dto.type != null"> |
| | | and m.type = #{dto.type} |
| | | </if> |
| | | <if test="dto.checkUnitId != null"> |
| | | and m.check_unit_id = #{dto.checkUnitId} |
| | | </if> |
| | | <if test="dto.specialtyName != null and dto.specialtyName !=''"> |
| | | and m.specialty_name like concat('%',#{dto.specialtyName},'%') |
| | | </if> |
| | | <if test="dto.belongTo !=null and dto.belongTo !=''"> |
| | | and cpcu.belong_to = #{dto.belongTo} |
| | | </if> |
| | | </where> |
| | | order by m.create_at desc |
| | | </select> |
| | | |
| | | <select id="pagePartyBuildingMembersVO" resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | select |
| | | m.id, m.org_id, m.name, m.id_card, m.photo_path, m.join_time, m.employment_time, m.audit_result, m.create_at, m.update_at, |
| | | m.community_id, m.user_id, m.refuse_reason, m.phone, m.type, m.position, m.check_unit_id, m.function, m.specialty_category, |
| | | m.specialty_name, m.position_two, o.`name` orgName,cpcu.name as checkUnitName, |
| | | TIMESTAMPDIFF( |
| | | YEAR, |
| | | m.employment_time, |
| | | DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge, |
| | | CASE |
| | | |
| | | WHEN u.id_card IS NULL THEN |
| | | '未注册' ELSE '已注册' |
| | | END status |
| | | from com_pb_member as m |
| | | LEFT JOIN sys_user u ON m.id_card = u.id_card AND u.`type` = 1 |
| | | LEFT JOIN com_pb_org o ON m.org_id = o.id |
| | | LEFT JOIN com_pb_check_unit as cpcu on cpcu.id = m.check_unit_id |
| | | WHERE |
| | | m.audit_result IN ( 0, 3 ) |
| | | <if test='pagePartyBuildingMemberVO.phone != null and pagePartyBuildingMemberVO.phone != ""'> |
| | | and u.phone LIKE CONCAT('%',#{pagePartyBuildingMemberVO.phone},'%') |
| | | </if> |
| | | <if test='pagePartyBuildingMemberVO.name != null and pagePartyBuildingMemberVO.name != ""'> |
| | | and u.name like concat ('%',#{pagePartyBuildingMemberVO.name},'%') |
| | | </if> |
| | | <if test='pagePartyBuildingMemberVO.auditStatus != null'> |
| | | and m.audit_result = #{pagePartyBuildingMemberVO.auditStatus} |
| | | </if> |
| | | <if test='pagePartyBuildingMemberVO.communityId != null'> |
| | | and m.community_id = ${pagePartyBuildingMemberVO.communityId} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="pageDataStatisticsMember" resultType="com.panzhihua.common.model.vos.partybuilding.ComDataStatisticsMemberVo"> |
| | | SELECT |
| | | cpm.id, |
| | | cpm.`name`, |
| | | cpm.photo_path, |
| | | cpm.type, |
| | | cpm.`function`, |
| | | cpm.specialty_category, |
| | | cpm.specialty_name, |
| | | cpm.position, |
| | | cpm.position_two, |
| | | cpm.id_card, |
| | | cpm.phone, |
| | | cpm.check_unit_id, |
| | | t1.user_id, |
| | | cpcu.`name` AS checkUnitName, |
| | | cpm.org_id, |
| | | cpm.community_id, |
| | | cpo.`name` AS orgName, |
| | | YEAR ( |
| | | from_days( |
| | | datediff( now( ), cpm.join_time ))) AS partyAge, |
| | | (select count(id) from com_pb_member_role where id_card = cpm.id_card) as isRole |
| | | FROM |
| | | com_pb_member AS cpm |
| | | LEFT JOIN com_pb_check_unit AS cpcu ON cpcu.id = cpm.check_unit_id |
| | | LEFT JOIN com_pb_org AS cpo ON cpo.id = cpm.org_id |
| | | LEFT JOIN sys_user t1 on cpm.id_card = t1.id_card and t1.type=1 |
| | | <where> |
| | | and cpm.audit_result = 1 |
| | | <if test="dto.communityId != null"> |
| | | and cpm.community_id = #{dto.communityId} |
| | | </if> |
| | | |
| | | <if test="dto.keyWord != null and dto.keyWord !=''"> |
| | | and ( |
| | | cpm.`name` like concat (#{dto.keyWord},'%') or |
| | | cpm.`id_card` = #{dto.keyWord} or |
| | | cpm.`phone` like concat (#{dto.keyWord},'%') or |
| | | cpcu.`name` like concat (#{dto.keyWord},'%') or |
| | | cpo.`name` like concat (#{dto.keyWord},'%') |
| | | ) |
| | | </if> |
| | | <if test="dto.month !=null and dto.month !=''"> |
| | | and (cpm.create_at >= DATE_FORMAT( CONCAT(#{dto.month},'-00-00'), '%Y-00-00 00:00:00') and DATE_FORMAT( CONCAT(#{dto.month},'-12-31'), '%Y-12-31 23:59:59') >= cpm.create_at) |
| | | </if> |
| | | </where> |
| | | order by cpm.create_at desc |
| | | </select> |
| | | |
| | | <select id="getMemberStatistics" resultType="com.panzhihua.common.model.vos.partybuilding.ComDataStatisticsMemberVo"> |
| | | SELECT |
| | | count( cpam.id ) AS partyActivityCount, |
| | | IFNULL(( SELECT integral_available_party FROM com_act_integral_user WHERE user_id = #{userId} AND community_id = #{communityId} ), 0 ) AS partyActivityIntegral, |
| | | IFNULL(( SELECT integral_available_volunteer FROM com_act_integral_user WHERE user_id = #{userId} AND community_id = #{communityId} ), 0 ) AS volunteerActivityIntegral, |
| | | ( SELECT count( caas.id ) FROM com_act_act_regist AS caas |
| | | LEFT JOIN com_act_activity AS caa ON caa.id = caas.activity_id |
| | | WHERE caas.user_id = #{userId} and caas.type = 1 and caa.type = 1 and caa.community_id = #{communityId} |
| | | ) AS volunteerActivityCount, |
| | | IFNULL(( |
| | | SELECT |
| | | sum( caa.duration ) |
| | | FROM |
| | | com_act_act_regist AS caas |
| | | LEFT JOIN com_act_activity AS caa ON caa.id = caas.activity_id |
| | | WHERE |
| | | caas.user_id = #{userId} and caas.type = 1 and caa.type = 1 and caa.community_id = #{communityId} |
| | | ), |
| | | 0 |
| | | ) AS volunteerActivityDuration, |
| | | IFNULL(( |
| | | SELECT |
| | | sum( caa.duration ) |
| | | FROM |
| | | com_act_act_regist AS caas |
| | | LEFT JOIN com_act_activity AS caa ON caa.id = caas.activity_id |
| | | WHERE |
| | | caas.user_id = #{userId} and caas.type = 3 and caas.end_time is not null and caa.type = 3 and caa.community_id = #{communityId} |
| | | ), |
| | | 0 |
| | | ) AS partyActivityDuration, |
| | | ( SELECT count( id ) FROM com_act_micro_wish WHERE sponsor_id = #{userId} AND `status` = 6 AND community_id = #{communityId} ) AS wishCount, |
| | | ( SELECT count( id ) FROM com_act_easy_photo WHERE sponsor_id = #{userId} AND `status` = 4 AND community_id = #{communityId} ) AS easyCount |
| | | FROM |
| | | com_act_act_regist AS cpam |
| | | LEFT JOIN com_act_activity AS caa ON caa.id = cpam.activity_id |
| | | WHERE |
| | | cpam.user_id = #{userId} and caa.type = 3 and cpam.end_time is not null |
| | | </select> |
| | | |
| | | <select id="getOrgDataStatistics" resultType="com.panzhihua.common.model.vos.partybuilding.ComDataStatisticsOrgVo"> |
| | | SELECT |
| | | count( id ) AS tyNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND specialty_category = 2 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS wdNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND specialty_category = 3 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS yyNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND specialty_category = 4 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS msNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND specialty_category = 5 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS qtNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND specialty_category IS NULL |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS wuNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND type = 1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS preparePartyMemberNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND type = 2 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS formalPartyMemberNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS partyMemberNum |
| | | FROM |
| | | com_pb_member |
| | | WHERE |
| | | audit_result = 1 |
| | | AND community_id = #{communityId} |
| | | AND specialty_category = 1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getOrgDataStatisticsLeftDown" resultType="com.panzhihua.common.model.vos.partybuilding.ComDataStatisticsOrgVo"> |
| | | SELECT |
| | | count( caas1.id ) AS participateVolunteerActivityNum, |
| | | ( |
| | | SELECT |
| | | IFNULL( sum( caa.duration ), 0 ) |
| | | FROM |
| | | com_act_act_sign AS caas |
| | | LEFT JOIN com_act_activity AS caa ON caa.id = caas.activity_id |
| | | WHERE |
| | | caas.`status` = 1 |
| | | AND caa.type = 1 |
| | | AND caas.user_id IN ( SELECT t1.user_id FROM com_pb_member t left join sys_user t1 on t.id_card=t1.id_card WHERE audit_result = 1 AND t.community_id = #{communityId} AND t1.type=1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND caas.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | ) AS participateVolunteerActivityDuration, |
| | | ( |
| | | SELECT |
| | | IFNULL( sum( caa3.duration ), 0 ) |
| | | FROM |
| | | com_act_act_sign AS caas3 |
| | | LEFT JOIN com_act_activity AS caa3 ON caa3.id = caas3.activity_id |
| | | WHERE |
| | | caas3.`status` = 1 |
| | | AND caa3.type = 3 |
| | | AND caas3.user_id IN ( SELECT t1.user_id FROM com_pb_member t left join sys_user t1 on t.id_card=t1.id_card WHERE audit_result = 1 AND t.community_id = #{communityId} AND t1.type=1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND caas3.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | ) AS participatePartyActivityDuration, |
| | | ( |
| | | SELECT |
| | | IFNULL( sum( caa4.duration ), 0 ) |
| | | FROM |
| | | com_act_act_sign AS caas4 |
| | | LEFT JOIN com_act_activity AS caa4 ON caa4.id = caas4.activity_id |
| | | WHERE |
| | | caas4.`status` = 1 and (caa4.type = 1 or caa4.type = 3) |
| | | AND caas4.user_id IN ( SELECT t1.user_id FROM com_pb_member t left join sys_user t1 on t.id_card=t1.id_card WHERE audit_result = 1 AND t.community_id = #{communityId} AND t1.type=1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND caas4.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | ) AS participateActivityDuration, |
| | | ( |
| | | SELECT |
| | | count( caas2.id ) |
| | | FROM |
| | | com_act_act_sign as caas2 |
| | | left join com_act_activity as caa2 on caa2.id = caas2.activity_id |
| | | WHERE |
| | | caas2.`status` = 1 and caa2.type = 3 |
| | | AND caas2.user_id IN ( SELECT t1.user_id FROM com_pb_member t left join sys_user t1 on t.id_card=t1.id_card WHERE audit_result = 1 AND t.community_id = #{communityId} AND t1.type=1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND caas2.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | ) AS participatePartyActivityNum, |
| | | ( |
| | | SELECT |
| | | count( caas5.id ) |
| | | FROM |
| | | com_act_act_sign as caas5 |
| | | left join com_act_activity as caa5 on caa5.id = caas5.activity_id |
| | | WHERE |
| | | caas5.`status` = 1 and (caa5.type = 1 or caa5.type = 3) |
| | | AND caas5.user_id IN ( SELECT t1.user_id FROM com_pb_member t left join sys_user t1 on t.id_card=t1.id_card WHERE audit_result = 1 AND t.community_id = #{communityId} AND t1.type=1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND caas5.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | ) AS participateActivityNum |
| | | FROM |
| | | com_act_act_sign as caas1 |
| | | left join com_act_activity as caa1 on caa1.id = caas1.activity_id |
| | | WHERE |
| | | caas1.`status` = 1 and caa1.type = 1 |
| | | AND caas1.user_id IN ( SELECT t1.user_id FROM com_pb_member t left join sys_user t1 on t.id_card=t1.id_card WHERE audit_result = 1 AND t.community_id = #{communityId} AND t1.type=1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND caas1.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | </select> |
| | | |
| | | <select id="getOrgDataStatisticsMember" resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | select |
| | | m.id, m.org_id, m.name, m.id_card, m.photo_path, m.join_time, m.employment_time, m.audit_result, m.create_at, m.update_at, |
| | | m.community_id, m.user_id, m.refuse_reason, m.phone, m.type, m.position, m.check_unit_id, m.function, m.specialty_category, |
| | | m.specialty_name, m.position_two, o.`name` orgName,cpcu.name as checkUnitName, |
| | | TIMESTAMPDIFF( |
| | | YEAR, |
| | | m.employment_time, |
| | | DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge, |
| | | CASE |
| | | |
| | | WHEN u.id_card IS NULL THEN |
| | | '未注册' ELSE '已注册' |
| | | END status |
| | | from com_pb_member as m |
| | | LEFT JOIN sys_user u ON m.id_card = u.id_card |
| | | LEFT JOIN com_pb_org o ON m.org_id = o.id |
| | | LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id |
| | | <where> |
| | | and m.audit_result = 1 |
| | | and m.community_id = #{communityId} |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND m.org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getOrgDataStatisticsRightDown" resultType="map"> |
| | | SELECT |
| | | count( camw.id ) AS completeWishNum,( |
| | | SELECT |
| | | count( camw.id ) |
| | | FROM |
| | | com_act_micro_wish AS camw |
| | | WHERE |
| | | camw.community_id = #{communityId} |
| | | AND camw.`status` = 6 |
| | | AND camw.evaluate_at <![CDATA[ <= ]]> #{endDate} |
| | | AND sponsor_id IN ( |
| | | SELECT |
| | | user_id |
| | | FROM |
| | | com_pb_member |
| | | WHERE |
| | | community_id = #{communityId} |
| | | AND audit_result = 1 |
| | | AND user_id IS NOT NULL |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | )) AS cumulativeWishNum, |
| | | (SELECT |
| | | count( caep.id ) |
| | | FROM |
| | | com_act_easy_photo AS caep |
| | | WHERE |
| | | caep.community_id = #{communityId} |
| | | AND caep.`status` >= 4 |
| | | AND caep.feedback_at <![CDATA[ <= ]]> #{endDate} |
| | | AND caep.feedback_at <![CDATA[ >= ]]> #{startDate} |
| | | AND caep.sponsor_id IN ( |
| | | SELECT |
| | | user_id |
| | | FROM |
| | | com_pb_member |
| | | WHERE |
| | | community_id = #{communityId} |
| | | AND audit_result = 1 |
| | | AND user_id IS NOT NULL |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) ) as completeEasyNum, |
| | | (SELECT |
| | | count( caep.id ) |
| | | FROM |
| | | com_act_easy_photo AS caep |
| | | WHERE |
| | | caep.community_id = #{communityId} |
| | | AND caep.`status` >= 4 |
| | | AND caep.feedback_at <![CDATA[ <= ]]> #{endDate} |
| | | AND caep.sponsor_id IN ( |
| | | SELECT |
| | | user_id |
| | | FROM |
| | | com_pb_member |
| | | WHERE |
| | | community_id = #{communityId} |
| | | AND audit_result = 1 |
| | | AND user_id IS NOT NULL |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) ) as cumulativeEasyNum |
| | | FROM |
| | | com_act_micro_wish AS camw |
| | | WHERE |
| | | camw.community_id = #{communityId} |
| | | AND camw.`status` = 6 |
| | | AND camw.evaluate_at <![CDATA[ <= ]]> #{endDate} |
| | | AND camw.evaluate_at <![CDATA[ >= ]]> #{startDate} |
| | | AND sponsor_id IN ( |
| | | SELECT |
| | | user_id |
| | | FROM |
| | | com_pb_member |
| | | WHERE |
| | | community_id = #{communityId} |
| | | AND audit_result = 1 |
| | | AND user_id IS NOT NULL |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | </select> |
| | | |
| | | <select id="getHeaderOrgDataStatistics" resultType="com.panzhihua.common.model.vos.partybuilding.ComDataStatisticsHeaderOrgVo"> |
| | | SELECT |
| | | count( id ) AS orgNum, |
| | | ( SELECT count( distinct area_id ) FROM com_pb_org WHERE community_id = #{communityId} AND area_id IS NOT NULL ) AS areaNum, |
| | | (select count(village_id) from com_mng_village where community_id = #{communityId}) as villageNum |
| | | FROM |
| | | com_pb_org |
| | | WHERE |
| | | community_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="exportDataStatisticsMember" resultType="com.panzhihua.common.model.vos.partybuilding.excel.ComDataStatisticsMemberExcelVo"> |
| | | SELECT |
| | | cpm.id, |
| | | cpm.`name`, |
| | | cpm.photo_path, |
| | | cpm.type, |
| | | cpm.`function`, |
| | | cpm.specialty_category, |
| | | cpm.specialty_name, |
| | | cpm.position, |
| | | cpm.position_two, |
| | | cpm.id_card, |
| | | cpm.phone, |
| | | cpm.check_unit_id, |
| | | cpm.user_id, |
| | | cpcu.`name` AS checkUnitName, |
| | | cpm.org_id, |
| | | cpm.community_id, |
| | | cpo.`name` AS orgName, |
| | | YEAR ( |
| | | from_days( |
| | | datediff( now( ), cpm.join_time ))) AS partyAge, |
| | | (select count(id) from com_pb_member_role where id_card = cpm.id_card) as isRole |
| | | FROM |
| | | com_pb_member AS cpm |
| | | LEFT JOIN com_pb_check_unit AS cpcu ON cpcu.id = cpm.check_unit_id |
| | | LEFT JOIN com_pb_org AS cpo ON cpo.id = cpm.org_id |
| | | <where> |
| | | and cpm.audit_result = 1 |
| | | <if test="dto.communityId != null"> |
| | | and cpm.community_id = #{dto.communityId} |
| | | </if> |
| | | |
| | | <if test="dto.keyWord != null and dto.keyWord !=''"> |
| | | and ( |
| | | cpm.`name` like concat (#{dto.keyWord},'%') or |
| | | cpm.`id_card` = #{dto.keyWord} or |
| | | cpm.`phone` like concat (#{dto.keyWord},'%') or |
| | | cpcu.`name` like concat (#{dto.keyWord},'%') or |
| | | cpo.`name` like concat (#{dto.keyWord},'%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | order by cpm.create_at desc |
| | | </select> |
| | | |
| | | <select id="getPbMemberByApplets" resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | select |
| | | m.id, m.org_id, m.name, m.id_card, m.photo_path, m.join_time, m.employment_time, m.audit_result, m.create_at, m.update_at, |
| | | m.community_id, m.user_id, m.refuse_reason, m.phone, m.type, m.position, m.check_unit_id, m.function, m.specialty_category, |
| | | m.specialty_name, m.position_two, IFNULL(m.org_Name,cpo.`name`) as orgName,cpcu.name as checkUnitName,t2.partyTime,t2.partyInterval, |
| | | TIMESTAMPDIFF( |
| | | YEAR, |
| | | m.employment_time, |
| | | DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge |
| | | from com_pb_member as m |
| | | LEFT JOIN sys_user u ON m.id_card = u.id_card and u.type = 1 |
| | | LEFT JOIN com_pb_org as cpo on cpo.id = m.org_id |
| | | LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id |
| | | LEFT JOIN (select t1.user_id,sum(t.duration) as partyTime,sum(t.reward_integral) as partyInterval from com_act_activity t LEFT JOIN com_act_act_regist t1 on t.id = t1.activity_id where t.type = 3 |
| | | GROUP BY t1.user_id ) t2 on u.user_id = t2.user_id |
| | | where m.audit_result = 1 |
| | | <if test="dto.checkUnitId != null"> |
| | | and m.check_unit_id = #{dto.checkUnitId} |
| | | </if> |
| | | <if test="dto.specialtyCategory != null"> |
| | | and m.specialty_category = #{dto.specialtyCategory} |
| | | </if> |
| | | <if test="dto.specialtyName != null and dto.specialtyName != ''"> |
| | | and m.specialty_name = #{dto.specialtyName} |
| | | </if> |
| | | <if test="dto.name != null"> |
| | | and m.name like concat('%',#{dto.name},'%') |
| | | </if> |
| | | <if test="dto.communityId != null"> |
| | | and m.community_id =#{dto.communityId} |
| | | </if> |
| | | order by m.create_at desc |
| | | </select> |
| | | |
| | | <select id="selectDetail" resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | select t.*, |
| | | t1.contacts as contactsName, |
| | | t1.phone as contacts, |
| | | t1.name as checkUnitName, |
| | | t2.name as villageName, |
| | | t1.contacts as helpCommunityContactsName, |
| | | t1.phone as helpCommunityContacts, |
| | | t4.name as communityName, |
| | | t1.address, |
| | | t1.village_name as unitVillageName, |
| | | t1.belong_to |
| | | from com_pb_member t |
| | | left join com_pb_check_unit t1 on t.check_unit_id = t1.id |
| | | left join com_mng_village t2 on t.village_id = t2.village_id |
| | | left join com_act t4 on t.community_id = t4.community_id |
| | | where t.phone = #{phone} |
| | | and t.type = #{type} limit 1 |
| | | </select> |
| | | <select id="getDetailByApp" resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | select t.*, |
| | | t1.contacts as contactsName, |
| | | t1.phone as contacts, |
| | | t1.name as checkUnitName, |
| | | t2.name as villageName, |
| | | t1.contacts as helpCommunityContactsName, |
| | | t1.phone as helpCommunityContacts, |
| | | t4.name as communityName, |
| | | t1.address, |
| | | t1.village_name as unitVillageName, |
| | | t1.belong_to |
| | | from com_pb_member t |
| | | left join com_pb_check_unit t1 on t.check_unit_id = t1.id |
| | | left join com_mng_village t2 on t.village_id = t2.village_id |
| | | left join com_act t4 on t.community_id = t4.community_id where t.id = #{id} |
| | | </select> |
| | | </mapper> |
| | | |