| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.discuss.entity.PublicDiscussEntity; |
| | | import org.springblade.modules.discuss.entity.UserTopicsEntity; |
| | | import org.springblade.modules.discuss.excel.UserTopicsExcel; |
| | | import org.springblade.modules.discuss.service.IPublicDiscussService; |
| | | import org.springblade.modules.discuss.service.IUserTopicsService; |
| | | import org.springblade.modules.discuss.vo.TopicsVO; |
| | | import org.springblade.modules.discuss.vo.UserTopicsVO; |
| | | import org.springblade.modules.discuss.wrapper.UserTopicsWrapper; |
| | | import org.springblade.modules.house.excel.HouseExcel; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | |
| | | UserTopicsEntity detail = userTopicsService.getOne(Condition.getQueryWrapper(userTopics)); |
| | | return R.data(UserTopicsWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * 用户议题报表 分页 |
| | | */ |
| | |
| | | if (one.getVoteRestrictions().equals(CommonConstant.NUMBER_ONE)) { |
| | | long count = userTopicsService.count(Wrappers.<UserTopicsEntity>lambdaQuery() |
| | | .eq(UserTopicsEntity::getPublicDiscussId, userTopics.getPublicDiscussId()) |
| | | .eq(UserTopicsEntity::getUserId, userTopics.getUserId()) |
| | | .eq(UserTopicsEntity::getHouseCode, userTopics.getHouseCode())); |
| | | if (count > 0) { |
| | | return R.fail("您房屋已经投票,不能重复投票!"); |
| | |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(userTopicsService.removeByIds(Func.toLongList(ids))); |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam Integer ids) { |
| | | UserTopicsEntity userTopicsEntity = new UserTopicsEntity(); |
| | | userTopicsEntity.setDeleteFlag(1); |
| | | userTopicsEntity.setId(ids); |
| | | return R.status(userTopicsService.updateById(userTopicsEntity)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "批量更新", notes = "传入topics") |
| | | public R updateBath(@Valid @RequestBody List<TopicsVO> topics) throws Exception { |
| | | Boolean result = userTopicsService.batchSave(topics); |
| | | return R.status(result); |
| | | String result = userTopicsService.batchSave(topics); |
| | | if (result.equals("200")) { |
| | | R.data("操作成功"); |
| | | } |
| | | return R.fail(result); |
| | | } |
| | | |
| | | /** |
| | | * 导出用户 |
| | | */ |
| | | @GetMapping("/exportUser") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "导出用户", notes = "传入userTopics") |
| | | public void exportUser(UserTopicsVO userTopics, HttpServletResponse response) { |
| | | List<UserTopicsExcel> list = userTopicsService.exportUser(userTopics); |
| | | ExcelUtil.export(response, "投票人员" + DateUtil.time(), "投票人员数据表", list, UserTopicsExcel.class); |
| | | } |
| | | |
| | | |