| | |
| | | public R pageNeighborByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | neighborCircleAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | if(loginUserInfo.getIsPartymember()==1){ |
| | | neighborCircleAppDTO.setCommunityId(0L); |
| | | } |
| | | else { |
| | | neighborCircleAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | neighborCircleAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | return communityService.pageNeighborByApp(neighborCircleAppDTO); |
| | |
| | | |
| | | @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 = "belongType",defaultValue = "1",required = false) Integer belongType |
| | | ,@RequestParam(value = "name",defaultValue = "",required = false) String name) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | if(isZero == null){ |
| | | isZero = 2; |
| | | } |
| | | return communityService.getNeighborTopicByApp(communityId,isZero,name,belongType); |
| | | } |
| | | |
| | | @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 communityService.addNeighborTopicByApp(circleTopicAppDTO); |
| | | public R getNeighborTopicByApp( |
| | | @RequestParam(value = "name",defaultValue = "",required = false) String name) { |
| | | return communityService.getNeighborTopicByApp(name); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户删除邻里圈") |
New file |
| | |
| | | package com.panzhihua.applets_backstage.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.NeighborCircleConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | 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.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/neighbor/") |
| | | @Api(tags = {"邻里圈服务"}) |
| | | public class NeighborApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "分页查询邻里圈话题列表", response = ComActNeighborCircleTopicAdminVO.class) |
| | | @PostMapping("pageNeighborTopicByAdmin") |
| | | public R pageNeighborTopicByAdmin(@RequestBody ComActNeighborCircleTopicAdminDTO circleTopicAdminDTO) { |
| | | return communityService.pageNeighborTopicByAdmin(circleTopicAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加邻里圈话题") |
| | | @PostMapping("addNeighborTopicByAdmin") |
| | | public R addNeighborTopicByAdmin(@RequestBody AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO) { |
| | | addCircleTopicAdminDTO.setUserId(this.getUserId()); |
| | | return communityService.addNeighborTopicByAdmin(addCircleTopicAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑邻里圈话题") |
| | | @PostMapping("editNeighborTopicByAdmin") |
| | | public R editNeighborTopicByAdmin(@RequestBody AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO) { |
| | | if (addCircleTopicAdminDTO.getId() == null) { |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.editNeighborTopicByAdmin(addCircleTopicAdminDTO); |
| | | } |
| | | /** |
| | | * 删除话题 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除话题") |
| | | @GetMapping("deleteNeighborTopic") |
| | | public R deleteNeighborTopic(@RequestParam("id") Long id){ |
| | | return communityService.deleteNeighborTopic(id); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | vo.setPhone(oneData.get(3)); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(4))){ |
| | | vo.setOrgName(oneData.get(4)); |
| | | } |
| | | voList.add(vo); |
| | | index++; |
| | | } |
| | |
| | | @ApiModelProperty(value = "微信审核结果(1.通过 2.拒绝)",hidden = true) |
| | | private Integer wxExamineResult; |
| | | |
| | | @ApiModelProperty("用户新增邻里圈话题") |
| | | private String topicName; |
| | | |
| | | @ApiModelProperty("使用类型(1.邻里圈 2.问题清单 3.需求清单)") |
| | | private Integer belongType; |
| | | |
| | |
| | | package com.panzhihua.common.model.dtos.neighbor; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty("话题名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "登录用户id", hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "发布状态(1.启用 2.禁用)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("话题id") |
| | | private Long id; |
| | |
| | | @ApiModelProperty("话题logo") |
| | | private String logo; |
| | | |
| | | @ApiModelProperty("排序") |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 使用类型(1.邻里圈 2.问题清单 3.需求清单) |
| | | */ |
| | |
| | | @ApiModelProperty("话题名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "发布状态(1.启用 2.禁用)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("使用类型(1.邻里圈 2.问题清单 3.需求清单)") |
| | | private Integer belongType; |
| | | |
| | |
| | | @ApiModelProperty("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("话题名字") |
| | | private String name; |
| | | |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("随手拍条数") |
| | | private Integer count; |
| | | @ApiModelProperty("排序") |
| | | private Integer sort; |
| | | } |
| | |
| | | @ApiModelProperty("党组织") |
| | | private String orgName; |
| | | |
| | | @ApiModelProperty("时长") |
| | | private Long duration; |
| | | |
| | | @ApiModelProperty("积分") |
| | | private Long partyInterval; |
| | | |
| | | } |
| | |
| | | @ExcelProperty(value = "党员姓名", index = 0) |
| | | private String name; |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @ExcelProperty(value = "身份证号", index = 1) |
| | | private String idCard; |
| | | /** |
| | | * 所属党组织 |
| | | */ |
| | | @ExcelProperty(value = "所属党组织", index = 2) |
| | | private String orgName; |
| | | /** |
| | | * 入党日期 |
| | | */ |
| | | @ExcelProperty(value = "入党日期", index = 3) |
| | | private String joinTime; |
| | | /** |
| | | * 转正日期 |
| | | */ |
| | | @ExcelProperty(value = "转正日期", index = 4) |
| | | private String employmentTime; |
| | | /** |
| | | * 所属社区 |
| | | */ |
| | | @ExcelProperty(value = "所属社区", index = 5) |
| | | private String communityName; |
| | | |
| | | @ExcelProperty(value = "手机号",index = 6) |
| | | @ExcelProperty(value = "联系电话",index = 1) |
| | | private String phone; |
| | | } |
| | |
| | | |
| | | @ExcelProperty(value = "负责人联系电话", index = 3) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "党组织名称",index = 4) |
| | | private String orgName; |
| | | } |
| | |
| | | /** |
| | | * 小程序查询邻里圈话题列表 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | @GetMapping("/neighbor/getNeighborTopicByApp") |
| | | R getNeighborTopicByApp(@RequestParam("communityId") Long communityId,@RequestParam("isZero") Integer isZero,@RequestParam("name") String name,@RequestParam("belongType") Integer belongType); |
| | | R getNeighborTopicByApp(@RequestParam("name") String name); |
| | | |
| | | /** |
| | | * 删除话题 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/neighbor/deleteNeighborTopic") |
| | | R deleteNeighborTopic(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 综治后台-查询社区列表 |
| | |
| | | R updateUserIsPartymember(@RequestParam("idCard") String idCard); |
| | | |
| | | /** |
| | | * 修改党员状态 |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | @PostMapping("updateuserispartymemberByPhone") |
| | | R updateUserIsPartymemberByPhone(@RequestParam("phone") String phone); |
| | | /** |
| | | * 修改用户的为非党员状态 |
| | | * |
| | | * @param idCard |
| | |
| | | @ApiOperation(value = "党员双报到单位-下载模板") |
| | | @GetMapping("/export/elder") |
| | | public R exportElder() { |
| | | return R.ok(sftpConfig.getExcelUrl() + "党员双报到单位导入模板.xlsx"); |
| | | return R.ok(sftpConfig.getExcelUrl() + "报到单位导入模板.xlsx"); |
| | | } |
| | | } |
| | |
| | | return communityService.addNeighborByAdmin(addNeighborCircleAdminVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询邻里圈话题列表", response = ComActNeighborCircleTopicAdminVO.class) |
| | | @PostMapping("pageNeighborTopicByAdmin") |
| | | public R pageNeighborTopicByAdmin(@RequestBody ComActNeighborCircleTopicAdminDTO circleTopicAdminDTO) { |
| | | if (isNull(circleTopicAdminDTO.getCommunityId())) { |
| | | circleTopicAdminDTO.setCommunityId(this.getCommunityId()); |
| | | } |
| | | return communityService.pageNeighborTopicByAdmin(circleTopicAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加邻里圈话题") |
| | | @PostMapping("addNeighborTopicByAdmin") |
| | | public R addNeighborTopicByAdmin(@RequestBody AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO) { |
| | | addCircleTopicAdminDTO.setCommunityId(this.getCommunityId()); |
| | | addCircleTopicAdminDTO.setUserId(this.getUserId()); |
| | | return communityService.addNeighborTopicByAdmin(addCircleTopicAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑邻里圈话题") |
| | | @PostMapping("editNeighborTopicByAdmin") |
| | | public R editNeighborTopicByAdmin(@RequestBody AddNeighborCircleTopicAdminDTO addCircleTopicAdminDTO) { |
| | | if (addCircleTopicAdminDTO.getId() == null) { |
| | | return R.fail("参数错误"); |
| | | } |
| | | addCircleTopicAdminDTO.setCommunityId(this.getCommunityId()); |
| | | return communityService.editNeighborTopicByAdmin(addCircleTopicAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取社区审核状态") |
| | | @GetMapping("getCircleExamineStatus") |
| | | public R getCircleExamineStatus(){ |
| | |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | return communityService.editSysConfValue(communityId,status); |
| | | } |
| | | @ApiOperation(value = "分页查询邻里圈话题列表", response = ComActNeighborCircleTopicAdminVO.class) |
| | | @PostMapping("pageNeighborTopicByAdmin") |
| | | public R pageNeighborTopicByAdmin(@RequestBody ComActNeighborCircleTopicAdminDTO circleTopicAdminDTO) { |
| | | return communityService.pageNeighborTopicByAdmin(circleTopicAdminDTO); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void invoke(PartyBuildingMemberExcelVO partyBuildingMemberExcelVO, AnalysisContext analysisContext) { |
| | | Boolean isRepeat = list.stream().anyMatch(v -> v.getIdCard().equals(partyBuildingMemberExcelVO.getIdCard())); |
| | | if (isRepeat) { |
| | | throw new PartyBuildingMemberException("导入失败,存在多个相同身份证号:" + partyBuildingMemberExcelVO.getIdCard()); |
| | | } |
| | | list.add(partyBuildingMemberExcelVO); |
| | | // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM |
| | | if (list.size() >= BATCH_COUNT) { |
| | |
| | | /** |
| | | * 小程序查询邻里圈话题列表 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | @GetMapping("getNeighborTopicByApp") |
| | | public R getNeighborTopicByApp(@RequestParam("communityId") Long communityId,@RequestParam("isZero") Integer isZero,@RequestParam("name") String name,@RequestParam("belongType") Integer belongType) { |
| | | return comActNeighborCircleTopicService.getNeighborTopicByApp(communityId,isZero,name,belongType); |
| | | public R getNeighborTopicByApp(@RequestParam("name") String name) { |
| | | return comActNeighborCircleTopicService.getNeighborTopicByApp(name); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-用户新增话题 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 新增结果 |
| | | * 删除话题 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("addNeighborTopicByApp") |
| | | public R addNeighborTopicByApp(@RequestBody AddNeighborCircleTopicAppDTO circleTopicAppDTO){ |
| | | return comActNeighborCircleTopicService.addNeighborTopicByApp(circleTopicAppDTO); |
| | | @GetMapping("deleteNeighborTopic") |
| | | public R deleteNeighborTopic(@RequestParam("id") Long id){ |
| | | return comActNeighborCircleTopicService.delete(id); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 小程序查询邻里圈话题列表 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | List<ComActNeighborCircleTopicAppVO> getNeighborTopicByApp(@Param("communityId") Long communityId,@Param("isZero") Integer isZero,@Param("name") String name,@Param("belongType") Integer belongType); |
| | | List<ComActNeighborCircleTopicAppVO> getNeighborTopicByApp(@Param("name") String name); |
| | | |
| | | /** |
| | | * 添加邻里圈话题热度 |
| | |
| | | */ |
| | | private String logo; |
| | | |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 状态(1.启用 2.禁用) |
| | | */ |
| | |
| | | /** |
| | | * 小程序查询邻里圈话题列表 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | R getNeighborTopicByApp(Long communityId,Integer isZero,String name,Integer belongType); |
| | | R getNeighborTopicByApp(String name); |
| | | |
| | | /** |
| | | * 小程序-用户新增话题 |
| | |
| | | */ |
| | | R addNeighborTopicByApp(AddNeighborCircleTopicAppDTO circleTopicAppDTO); |
| | | |
| | | /** |
| | | * 删除话题 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R delete(Long id); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleTopicService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private ComActNeighborCircleTopicMapper comActNeighborCircleTopicMapper; |
| | | @Resource |
| | | private ComActNeighborCircleTopicService comActNeighborCircleTopicService; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private ComPbMemberDAO comPbMemberDAO; |
| | | /** |
| | | * 分页查询邻里圈列表 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public R pageNeighborByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | if(neighborCircleAppDTO.getCommunityId()==0L){ |
| | | R<LoginUserInfoVO> loginUserInfoVOR=userService.getUserInfoByUserId(neighborCircleAppDTO.getUserId().toString()); |
| | | if(R.isOk(loginUserInfoVOR)){ |
| | | LoginUserInfoVO loginUserInfoVO=loginUserInfoVOR.getData(); |
| | | if(loginUserInfoVO!=null){ |
| | | ComPbMemberDO comPbMemberDO=comPbMemberDAO.selectOne(new QueryWrapper<ComPbMemberDO>().lambda().eq(ComPbMemberDO::getIdCard,loginUserInfoVO.getIdCard())); |
| | | if(comPbMemberDO!=null){ |
| | | neighborCircleAppDTO.setCommunityId(comPbMemberDO.getCommunityId()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | Page userPage = new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize()); |
| | | IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageNeighborByApp(userPage, neighborCircleAppDTO); |
| | | if (!doPager.getRecords().isEmpty()) { |
| | |
| | | } |
| | | if (StringUtils.isNotEmpty(addNeighborCircleAppDTO.getPhone())) { |
| | | neighborCircleDO.setReleasePhone(addNeighborCircleAppDTO.getPhone()); |
| | | } |
| | | //判断用户的话题是否是新增的 |
| | | if(StringUtils.isNotEmpty(addNeighborCircleAppDTO.getTopicName())){ |
| | | //新增邻里圈话题 |
| | | ComActNeighborCircleTopicDO circleTopicDO = comActNeighborCircleTopicMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicDO>() |
| | | .lambda().eq(ComActNeighborCircleTopicDO::getCommunityId,neighborCircleDO.getCommunityId()) |
| | | .eq(ComActNeighborCircleTopicDO::getName,addNeighborCircleAppDTO.getTopicName())); |
| | | if(circleTopicDO == null){ |
| | | circleTopicDO = new ComActNeighborCircleTopicDO(); |
| | | circleTopicDO.setCommunityId(neighborCircleDO.getCommunityId()); |
| | | circleTopicDO.setName(addNeighborCircleAppDTO.getTopicName()); |
| | | circleTopicDO.setCreateBy(neighborCircleDO.getReleaseId()); |
| | | circleTopicDO.setCreateAt(new Date()); |
| | | circleTopicDO.setCount(0); |
| | | circleTopicDO.setHotNum(0L); |
| | | circleTopicDO.setStatus(ComActNeighborCircleTopicDO.status.yes); |
| | | comActNeighborCircleTopicMapper.insert(circleTopicDO); |
| | | } |
| | | neighborCircleDO.setTopicId(circleTopicDO.getId()); |
| | | } |
| | | //判断当前邻里圈是否需要审核 |
| | | if(addNeighborCircleAppDTO.getIsExamine().equals(AddComActNeighborCircleAppDTO.isExamine.no)){ |
| | |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-06 15:04:37 |
| | |
| | | extends ServiceImpl<ComActNeighborCircleTopicMapper, ComActNeighborCircleTopicDO> |
| | | implements ComActNeighborCircleTopicService { |
| | | |
| | | @Resource |
| | | private ComActNeighborCircleDAO comActNeighborCircleDAO; |
| | | /** |
| | | * 分页查询邻里圈话题列表 |
| | | * |
| | |
| | | ComActNeighborCircleTopicDO circleTopicDO = |
| | | this.baseMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicDO>().lambda() |
| | | .eq(ComActNeighborCircleTopicDO::getName, addCircleTopicAdminDTO.getName()) |
| | | .eq(ComActNeighborCircleTopicDO::getCommunityId, addCircleTopicAdminDTO.getCommunityId())); |
| | | ); |
| | | if (circleTopicDO != null) { |
| | | return R.fail("该话题已存在"); |
| | | } |
| | |
| | | if (circleTopicDO == null) { |
| | | return R.fail("未找到邻里圈话题记录"); |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(addCircleTopicAdminDTO.getName())) { |
| | | ComActNeighborCircleTopicDO oldCircleTopicDO = |
| | | this.baseMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicDO>().lambda() |
| | | .eq(ComActNeighborCircleTopicDO::getName, addCircleTopicAdminDTO.getName()) |
| | | .eq(ComActNeighborCircleTopicDO::getCommunityId, addCircleTopicAdminDTO.getCommunityId()) |
| | | .ne(ComActNeighborCircleTopicDO::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(); |
| | |
| | | /** |
| | | * 小程序查询邻里圈话题列表 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | @Override |
| | | public R getNeighborTopicByApp(Long communityId,Integer isZero,String name,Integer belongType){ |
| | | return R.ok(this.baseMapper.getNeighborTopicByApp(communityId,isZero,name,belongType)); |
| | | public R getNeighborTopicByApp(String name){ |
| | | return R.ok(this.baseMapper.getNeighborTopicByApp(name)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | return R.ok(circleTopicDO); |
| | | } |
| | | |
| | | @Override |
| | | public R delete(Long id) { |
| | | ComActNeighborCircleTopicDO comActNeighborCircleTopicDO=this.baseMapper.selectById(id); |
| | | if(comActNeighborCircleTopicDO==null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | Integer count=this.comActNeighborCircleDAO.selectCount(new QueryWrapper<ComActNeighborCircleDO>().lambda().eq(ComActNeighborCircleDO::getTopicId,id)); |
| | | if(count>0){ |
| | | return R.fail("请删除相应问题"); |
| | | } |
| | | return R.ok(this.baseMapper.deleteById(id)); |
| | | } |
| | | } |
| | |
| | | canct.`status`, |
| | | canct.create_at, |
| | | canct.logo, |
| | | ( SELECT count( id ) FROM com_act_neighbor_circle WHERE is_del = 2 AND `status` = 2 and topic_id = canct.id) AS `count`, |
| | | su.`name` as createBy |
| | | su.`name` as createBy, |
| | | canct.sort |
| | | FROM |
| | | com_act_neighbor_circle_topic 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 |
| | | order by canct.sort asc |
| | | </select> |
| | | |
| | | <select id="getNeighborTopicByApp" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO"> |
| | | SELECT canct.id, canct.`name`,`logo`, canct.hot_num,( SELECT count( id ) FROM com_act_neighbor_circle WHERE is_del = 2 AND `status` = 2 and topic_id = canct.id) AS `count` |
| | | from com_act_neighbor_circle_topic as canct where canct.`status` = 1 and canct.community_id = ${communityId} and canct.belong_type = #{belongType} |
| | | <if test="isZero != null and isZero == 1"> |
| | | and `count` > 0 |
| | | </if> |
| | | SELECT canct.id, canct.`name`,`logo`, canct.hot_num |
| | | from com_act_neighbor_circle_topic as canct where canct.`status` = 1 |
| | | <if test="name != null and name != """> |
| | | and canct.`name` like concat('%',#{name},'%') |
| | | </if> |
| | | order by `count` desc |
| | | order by canct.sort asc |
| | | </select> |
| | | |
| | | <update id="addHotNum"> |
| | |
| | | * @return 党员列表 |
| | | */ |
| | | IPage<PartyBuildingMemberVO> getPbMemberByApplets(Page page,@Param("dto") PartyBuildingMemberVO partyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 小程序获取报道单位党员列表 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<PartyBuildingMemberVO> getDetailByApp(Long id); |
| | | } |
| | |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.enums.ComPbCheckUnitTypeEnum; |
| | | import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | |
| | | */ |
| | | @Override |
| | | public R queryByList(PageComPbCheckUnitDto comPbCheckUnit) { |
| | | List<ComPbCheckUnitVo> checkUnitList = this.baseMapper.queryAllByList(comPbCheckUnit); |
| | | checkUnitList.forEach(checkUnit -> { |
| | | IPage<ComPbCheckUnitVo> checkUnitList = this.baseMapper.queryAllByLimit(comPbCheckUnit,new Page(comPbCheckUnit.getPageNum(),comPbCheckUnit.getPageSize())); |
| | | checkUnitList.getRecords().forEach(checkUnit -> { |
| | | if(StringUtils.isEmpty(checkUnit.getOrgName())){ |
| | | checkUnit.setOrgName("待编辑党支部"); |
| | | } |
| | |
| | | List<ComPbMemberDO> comPbMemberDOs = comPbMemberDAO.selectList(new QueryWrapper<ComPbMemberDO>().lambda() |
| | | .eq(ComPbMemberDO::getIdCard, idCard).eq(ComPbMemberDO::getAuditResult, 1)); |
| | | if (!ObjectUtils.isEmpty(comPbMemberDOs) && comPbMemberDOs.size() > 0) { |
| | | return R.fail("身份证已经存在"); |
| | | comPbMemberDOs.forEach(comPbMemberDO -> { |
| | | comPbMemberDAO.deleteById(comPbMemberDO.getId()); |
| | | }); |
| | | } |
| | | ComPbMemberDO comPbMemberDO1 = new ComPbMemberDO(); |
| | | BeanUtils.copyProperties(partyBuildingMemberVO, comPbMemberDO1); |
| | |
| | | comPbMemberDO1.setUpdateAt(date); |
| | | int insert = comPbMemberDAO.insert(comPbMemberDO1); |
| | | if (insert > 0) { |
| | | //金沙特殊需求 |
| | | if(comPbMemberDO1.getCommunityId()==2L){ |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO=new ComMngVolunteerMngVO(); |
| | | comMngVolunteerMngVO.setOrgId(53L); |
| | | comMngVolunteerMngVO.setName(comPbMemberDO1.getName()); |
| | | comMngVolunteerMngVO.setPhone(comPbMemberDO1.getPhone()); |
| | | comMngVolunteerMngVO.setIdCard(comPbMemberDO1.getIdCard()); |
| | | comMngVolunteerMngVO.setState(2); |
| | | comMngVolunteerMngVO.setCommunityId(2L); |
| | | R r = communityService.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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 删除已驳回的记录 |
| | | int delete = comPbMemberDAO.delete(new QueryWrapper<ComPbMemberDO>().lambda() |
| | | .eq(ComPbMemberDO::getIdCard, partyBuildingMemberVO.getIdCard()) |
| | |
| | | comPbMemberDO.setCommunityId(partyOrganizationVO.getCommunityId()); |
| | | |
| | | List<ComPbMemberDO> comPbMemberDOList = this.baseMapper.selectList(new QueryWrapper<ComPbMemberDO>() |
| | | .lambda().eq(ComPbMemberDO::getIdCard, partyBuildingMemberExcelVO.getIdCard()) |
| | | .lambda().eq(ComPbMemberDO::getPhone, partyBuildingMemberExcelVO.getPhone()) |
| | | .eq(ComPbMemberDO::getCommunityId, partyOrganizationVO.getCommunityId()) |
| | | .in(ComPbMemberDO::getAuditResult, 0, 1)); |
| | | if (!comPbMemberDOList.isEmpty()) { |
| | |
| | | // 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()); |
| | | comPbMemberDO.setEmploymentTime(employmentTime); |
| | | } else { |
| | | comPbMemberDO.setEmploymentTime(null); |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(partyBuildingMemberExcelVO.getJoinTime())) { |
| | | Date joinTime = DateUtils.toValidDate(partyBuildingMemberExcelVO.getJoinTime()); |
| | | comPbMemberDO.setJoinTime(joinTime); |
| | | } else { |
| | | comPbMemberDO.setJoinTime(null); |
| | | } |
| | | |
| | | comPbMemberDO.setName(partyBuildingMemberExcelVO.getName()); |
| | | comPbMemberDO.setIdCard(partyBuildingMemberExcelVO.getIdCard()); |
| | | comPbMemberDO.setPhone(partyBuildingMemberExcelVO.getPhone()); |
| | | comPbMemberDOS.add(comPbMemberDO); |
| | | } |
| | |
| | | boolean flag=this.save(comPbMemberDO); |
| | | if(flag){ |
| | | //修改党员状态 |
| | | userService.updateUserIsPartymember(comPbMemberDO.getIdCard()); |
| | | //金沙社区特殊需求 添加党员默认添加志愿者 |
| | | 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 = communityService.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); |
| | | } |
| | | } |
| | | } |
| | | userService.updateUserIsPartymemberByPhone(comPbMemberDO.getPhone()); |
| | | } |
| | | |
| | | }); |
| | |
| | | return userService.updateUserIsPartymember(idCard); |
| | | } |
| | | |
| | | @PostMapping("updateuserispartymemberByPhone") |
| | | public R updateUserIsPartymemberByPhone(@RequestParam("phone") String phone) { |
| | | return userService.updateUserIsPartymemberByPhone(phone); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户为非党员状态 |
| | | * |
| | |
| | | R updateUserIsPartymember(String idCard); |
| | | |
| | | /** |
| | | * 修改用户的党员状态 |
| | | * |
| | | * @param phone |
| | | * 身份证号 |
| | | * @return 修改结果 |
| | | */ |
| | | R updateUserIsPartymemberByPhone(String phone); |
| | | |
| | | /** |
| | | * 修改用户为非党员状态 |
| | | * |
| | | * @param idCard |
| | |
| | | /** |
| | | * 修改用户的党员状态 |
| | | * |
| | | * @param phone |
| | | * 身份证号 |
| | | * @return 修改结果 |
| | | */ |
| | | @Override |
| | | public R updateUserIsPartymemberByPhone(String phone) { |
| | | SysUserDO sysUserDO = userDao.selectOne( |
| | | new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone, phone).eq(SysUserDO::getType, 1)); |
| | | if (sysUserDO != null) { |
| | | sysUserDO.setIsPartymember(1); |
| | | int updated = userDao.updateById(sysUserDO); |
| | | if (updated > 0) { |
| | | // 删除用户信息缓存 |
| | | String userKey = UserConstants.LOGIN_USER_INFO + sysUserDO.getUserId(); |
| | | stringRedisTemplate.delete(userKey); |
| | | } |
| | | log.info("新增党员修改用户党员状态成功 手机号【{}】", phone); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户的党员状态 |
| | | * |
| | | * @param idCard |
| | | * 身份证号 |
| | | * @return 修改结果 |