| | |
| | | @ApiOperation(value = "新增或修改", notes = "传入userTopics") |
| | | public R submit(@Valid @RequestBody UserTopicsEntity userTopics) { |
| | | userTopics.setUserId(AuthUtil.getUserId()); |
| | | // 判断是否一户一票 还是一人一票 |
| | | IPublicDiscussService bean = SpringUtil.getBean(IPublicDiscussService.class); |
| | | PublicDiscussEntity one = bean.getOne(Wrappers.<PublicDiscussEntity>lambdaQuery().eq(PublicDiscussEntity::getId, userTopics.getPublicDiscussId())); |
| | | // 一户一票 |
| | | if (one.getVoteRestrictions().equals(CommonConstant.NUMBER_ONE)) { |
| | | long count = userTopicsService.count(Wrappers.<UserTopicsEntity>lambdaQuery() |
| | | .eq(UserTopicsEntity::getPublicDiscussId, userTopics.getPublicDiscussId()) |
| | | .eq(UserTopicsEntity::getHouseCode, userTopics.getHouseCode())); |
| | | if (count > 0) { |
| | | return R.fail("您房屋已经投票,不能重复投票!"); |
| | | } |
| | | // 一人一票 |
| | | } else { |
| | | long count = userTopicsService.count(Wrappers.<UserTopicsEntity>lambdaQuery() |
| | | .eq(UserTopicsEntity::getPublicDiscussId, userTopics.getPublicDiscussId()) |
| | | .eq(UserTopicsEntity::getUserId, userTopics.getUserId())); |
| | | if (count > 0) { |
| | | return R.fail("您已投票,不能重复投票!"); |
| | | } |
| | | } |
| | | return R.status(userTopicsService.save(userTopics)); |
| | | } |
| | | |
| | |
| | | .eq(UserTopicsEntity::getUserId, AuthUtil.getUserId()) |
| | | .eq(UserTopicsEntity::getArticleId, topics.get(0).getArticleId())); |
| | | if (count > 0) { |
| | | return "您的已投票,不能重复投票!"; |
| | | return "您已投票,不能重复投票!"; |
| | | } |
| | | } |
| | | Boolean userTopics = getaBoolean(topics); |
| | |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/getUserInfo") |
| | | public R getUserInfo(){ |
| | | public R getUserInfo() { |
| | | //根据保安员编码查询保安员信息 |
| | | return R.data(userService.getUserInfo(AuthUtil.getUserId())); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过小区id查询物业人员/网格人员 |
| | | * 通过小区id查询用户 |
| | | */ |
| | | @GetMapping("/getUserInfoByDistrictIds") |
| | | @ApiOperation(value = "查询物业人员By小区id", notes = "houseCode") |
| | | public R getUserInfoByDistrictIds(@RequestParam("districtIds") String districtIds) { |
| | | return R.data(userService.getUserInfoByDistrictIds(districtIds)); |
| | | @ApiOperation(value = "通过小区id查询用户") |
| | | public R<IPage<UserVO>> getUserInfoByDistrictIds(@RequestParam("districtIds") String districtIds |
| | | , @RequestParam(value = "building", required = false) String building |
| | | , @RequestParam(value = "unit", required = false) String unit |
| | | , @RequestParam(value = "name", required = false) String name |
| | | , Query query) { |
| | | IPage<User> pages = userService.getUserInfoByDistrictIds(districtIds, building, unit, name, Condition.getPage(query)); |
| | | return R.data(UserWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @GetMapping("/getUserInfoByPropertyCompanyId") |
| | | @ApiOperation(value = "通过机构查询物业公司人员", notes = "propertyCompanyId") |
| | | public R getUserInfoByPropertyId(@RequestParam("propertyCompanyId") String propertyCompanyId,@RequestParam("roleId") String roleId) { |
| | | return R.data(userService.getUserInfoByPropertyId(propertyCompanyId,roleId)); |
| | | public R getUserInfoByPropertyId(@RequestParam("propertyCompanyId") String propertyCompanyId, @RequestParam("roleId") String roleId) { |
| | | return R.data(userService.getUserInfoByPropertyId(propertyCompanyId, roleId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/getPoliceUser") |
| | | @ApiOperation(value = "通过经纬度查询最近的民警人员") |
| | | public R getPoliceUser(@RequestParam("longitude") String longitude, @RequestParam(value = "latitude") String latitude,@RequestParam(value = "houseCode",required = false) String houseCode) { |
| | | return R.data(userService.getPoliceUser(longitude, latitude,houseCode)); |
| | | public R getPoliceUser(@RequestParam("longitude") String longitude, @RequestParam(value = "latitude") String latitude, @RequestParam(value = "houseCode", required = false) String houseCode) { |
| | | return R.data(userService.getPoliceUser(longitude, latitude, houseCode)); |
| | | } |
| | | |
| | | } |
| | |
| | | List<User> getUserInfoByPropertyId(String deptId, String roleId); |
| | | |
| | | /** |
| | | * |
| | | * 多个小区id查询用户 |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<User> getUserInfoByDistrictIds(@Param("list") List<String> list); |
| | | List<User> getUserInfoByDistrictIds(@Param("list") List<String> list, String building, String unit, String name, IPage<User> page); |
| | | |
| | | /** |
| | | * 通过机构查询用户 |
| | | * |
| | | * @param deptIdList |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过经纬度查询最近的民警人员 |
| | | * |
| | | * @param longitude |
| | | * @param latitude |
| | | * @return |
| | | */ |
| | | List<User> getPoliceUser(String longitude, String latitude); |
| | | List<User> getPoliceUser(String longitude, String latitude); |
| | | } |
| | |
| | | #{item} |
| | | </foreach> |
| | | and bu.is_deleted = 0 |
| | | and jh.relationship !=18 |
| | | <if test="param2 != null and param2 !=''"> |
| | | and jhe.building like concat('%',#{param2},'%') |
| | | </if> |
| | | <if test="param3 != null and param3 !=''"> |
| | | and jhe.unit like concat('%',#{param3},'%') |
| | | </if> |
| | | <if test="param4 != null and param4 !=''"> |
| | | and jh.name like concat('%',#{param4},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | */ |
| | | void importPoliceUser(List<PoliceUserExcel> data); |
| | | |
| | | List<User> getUserInfoByDistrictIds(String districtIds); |
| | | /** |
| | | * 通过小区id查询用户 |
| | | * @param districtIds |
| | | * @param building |
| | | * @param unit |
| | | * @param name |
| | | * @return |
| | | */ |
| | | IPage<User> getUserInfoByDistrictIds(String districtIds,String building,String unit,String name,IPage<User> page); |
| | | |
| | | /** |
| | | * 查询500M内的民警 |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通过小区id查询物业人员 |
| | | * |
| | | * @param districtId |
| | | * @param building |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<UserEntity> getUserInfoByDistrictId(String districtId, String building) { |
| | | return baseMapper.getUserInfoByDistrictId(districtId, building); |
| | | } |
| | | |
| | | /** |
| | | * 通过小区id查询用户 |
| | | * |
| | | * @param districtIds |
| | | * @param building |
| | | * @param unit |
| | | * @param name |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<User> getUserInfoByDistrictIds(String districtIds) { |
| | | public IPage<User> getUserInfoByDistrictIds(String districtIds, String building, String unit, String name, IPage<User> page) { |
| | | List<String> list = JSON.parseArray(districtIds).toJavaList(String.class); |
| | | return baseMapper.getUserInfoByDistrictIds(list); |
| | | return page.setRecords(baseMapper.getUserInfoByDistrictIds(list, building, unit, name, page)); |
| | | } |
| | | |
| | | /** |