| | |
| | | <artifactId>swagger-bootstrap-ui</artifactId> |
| | | <version>1.9.6</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>3.0.5</version> |
| | | </dependency> |
| | | <!-- hutool 工具包 --> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | |
| | | package com.example.jz.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.example.jz.modle.entity.Announcement; |
| | | import com.example.jz.modle.R; |
| | | import com.example.jz.modle.entity.Announcement; |
| | | import com.example.jz.service.AnnouncementService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 公告表(Announcement)表控制层 |
| | |
| | | @Resource |
| | | private AnnouncementService announcementService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param page 分页对象 |
| | | * @param announcement 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @GetMapping |
| | | public R<Page<Announcement>> selectAll(Page<Announcement> page, Announcement announcement) { |
| | | return R.ok(this.announcementService.page(page, new QueryWrapper<>(announcement))); |
| | | @ApiOperation(httpMethod = "GET", value = "群公告查询") |
| | | @GetMapping("/getAnnouncements") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R getAnnouncements(@RequestParam(value = "size") Integer size, |
| | | @RequestParam(value = "current") Integer current, |
| | | @RequestParam(value = "groupId") Integer groupId, |
| | | @RequestParam(value = "content", required = false) String content, |
| | | @RequestParam(value = "status", required = false) Integer status) { |
| | | return R.ok(announcementService.getAnnouncements(size, current, content, status, groupId)); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable Serializable id) { |
| | | return R.ok(this.announcementService.getById(id)); |
| | | @ApiOperation(httpMethod = "POST", value = "群公告添加") |
| | | @PostMapping("/add") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R insert(@RequestParam(value = "groupId") Integer groupId, @RequestBody Announcement announcement) { |
| | | return R.ok(announcementService.add(groupId, announcement)); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param announcement 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody Announcement announcement) { |
| | | return R.ok(this.announcementService.save(announcement)); |
| | | @ApiOperation(httpMethod = "PUT", value = "群公告发布") |
| | | @PutMapping("/updateStatusPublic") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R updateStatusPublic(@RequestParam(value = "id") Integer id) { |
| | | announcementService.updateStatus(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param announcement 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PutMapping |
| | | public R update(@RequestBody Announcement announcement) { |
| | | return R.ok(this.announcementService.updateById(announcement)); |
| | | @ApiOperation(httpMethod = "PUT", value = "群公告下架") |
| | | @PutMapping("/updateStatusUnshelve") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R updateStatusUnshelve(@RequestParam(value = "id") Integer id) { |
| | | announcementService.updateStatusUnshelve(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param idList 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping |
| | | public R delete(@RequestParam("idList") List<Long> idList) { |
| | | return R.ok(this.announcementService.removeByIds(idList)); |
| | | @ApiOperation(httpMethod = "DELETE", value = "群公告删除") |
| | | @DeleteMapping("/delete") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R delete(@RequestParam(value = "id") Integer id) { |
| | | announcementService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.example.jz.modle.dto.AddReportDto; |
| | | import com.example.jz.modle.dto.CauseDto; |
| | | import com.example.jz.modle.dto.ReportParamDto; |
| | | import com.example.jz.modle.entity.Report; |
| | | import com.example.jz.modle.vo.ReportListVo; |
| | | import com.example.jz.service.CauseService; |
| | | import com.example.jz.service.ReportService; |
| | | import com.example.jz.service.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import lombok.SneakyThrows; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 案件表(Cause)表控制层 |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("cause") |
| | | @Api(tags = "案件区") |
| | | @Api(tags = "案件区-案件录入") |
| | | public class CauseController extends ApiController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CauseService causeService; |
| | | private ReportService reportService; |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "POST", value = "案件导入") |
| | | @PostMapping("/upload") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | @SneakyThrows |
| | | public R upload(@RequestParam(value = "multipartFile") MultipartFile multipartFile) { |
| | | causeService.loadFile(multipartFile); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "GET", value = "根据群组id查询案件分页") |
| | | @GetMapping("/getAllReportList") |
| | | @ApiResponse(message = "执行成功", code = 200) |
New file |
| | |
| | | package com.example.jz.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.baomidou.mybatisplus.extension.api.R; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.example.jz.modle.entity.GroupUser; |
| | | import com.example.jz.service.GroupUserService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户和群中间表(GroupUser)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-07-11 16:35:57 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("groupUser") |
| | | public class GroupUserController extends ApiController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private GroupUserService groupUserService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param page 分页对象 |
| | | * @param groupUser 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @GetMapping |
| | | public R selectAll(Page<GroupUser> page, GroupUser groupUser) { |
| | | return success(this.groupUserService.page(page, new QueryWrapper<>(groupUser))); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable Serializable id) { |
| | | return success(this.groupUserService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param groupUser 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody GroupUser groupUser) { |
| | | return success(this.groupUserService.save(groupUser)); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param groupUser 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PutMapping |
| | | public R update(@RequestBody GroupUser groupUser) { |
| | | return success(this.groupUserService.updateById(groupUser)); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param idList 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping |
| | | public R delete(@RequestParam("idList") List<Long> idList) { |
| | | return success(this.groupUserService.removeByIds(idList)); |
| | | } |
| | | } |
| | |
| | | package com.example.jz.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("report") |
| | | @Api(value = "报案接口", tags = "报案接口") |
| | | @Api(value = "案件区-案件人员", tags = "案件区-案件人员") |
| | | public class ReportController extends ApiController { |
| | | /** |
| | | * 服务对象 |
| | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param page 分页对象 |
| | | * @param page 分页对象 |
| | | * @param reportParamDto 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | |
| | | @ApiOperation(httpMethod = "DELETE", value = "报案人人员退群") |
| | | @DeleteMapping("/leaveGroup") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R leaveGroup( @RequestParam(value = "id") Integer id,@RequestParam(value = "groupId") Integer groupId) { |
| | | reportService.leaveGroup(id,groupId); |
| | | public R leaveGroup(@RequestParam(value = "id") Integer id, @RequestParam(value = "groupId") Integer groupId) { |
| | | reportService.leaveGroup(id, groupId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "DELETE", value = "删除报案人") |
| | | @DeleteMapping("/deleteReporter") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R deleteReporter( @RequestParam(value = "id") Integer id) { |
| | | public R deleteReporter(@RequestParam(value = "id") Integer id) { |
| | | reportService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "POST", value = "导出材料") |
| | | @PostMapping("/exportReporter") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public void exportReport(@RequestParam(value = "id") Integer id, HttpServletResponse response) { |
| | | reportService.exportReporter(id, response); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.baomidou.mybatisplus.extension.api.R; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.example.jz.modle.entity.User; |
| | | import com.example.jz.service.UserService; |
| | | import com.example.jz.utils.Md5Utils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | /** |
| | | * 用户表(User)表控制层 |
| | | * |
| | | * @author 安瑾然 |
| | | * @author makejava |
| | | * @since 2022-07-11 16:35:57 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("user") |
| | | @Api(tags = "用户管理") |
| | | public class UserController extends ApiController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Autowired |
| | | public void setUserService(UserService userService) { |
| | | this.userService = userService; |
| | | } |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | |
| | | * @return 所有数据 |
| | | */ |
| | | @GetMapping |
| | | @ApiOperation("分页查询所有数据") |
| | | public R selectAll(Page<User> page, User user) { |
| | | return success(this.userService.page(page, new QueryWrapper<>(user))); |
| | | } |
| | |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | @ApiOperation("通过主键查询单条数据") |
| | | public R selectOne(@PathVariable Serializable id) { |
| | | return success(this.userService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param user 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody User user) { |
| | | return success(this.userService.save(user)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 修改结果 |
| | | */ |
| | | @PutMapping |
| | | @ApiOperation("修改用户数据") |
| | | public R update(@RequestBody User user) { |
| | | return success(userService.updateById(user)); |
| | | return success(this.userService.updateById(user)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping |
| | | @ApiOperation("删除用户数据") |
| | | public R delete(@RequestParam("idList") List<Long> idList) { |
| | | return success(this.userService.removeByIds(idList)); |
| | | } |
| | | |
| | | /** |
| | | * 添加管理员 |
| | | * |
| | | * @param id 用户id |
| | | * @param username 管理员用户名 |
| | | * @param password 管理员密码 |
| | | * @return |
| | | */ |
| | | @PostMapping("/addAdmin/{id}") |
| | | @ApiOperation("添加管理员") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "password", value = "密码", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "username", value = "用户名", required = true, dataType = "String") |
| | | }) |
| | | public R addAdmin(@PathVariable Serializable id, String username, String password) { |
| | | User user = userService.getById(id).setLoginUsername(username).setLoginPassword(Md5Utils.md5(password)).setRole(1); |
| | | return success(userService.updateById(user)); |
| | | } |
| | | |
| | | /** |
| | | * 重置管理员密码 |
| | | * |
| | | * @param id 用户id |
| | | * @return |
| | | */ |
| | | @GetMapping("/resetPassword/{id}") |
| | | @ApiOperation("重置管理员密码") |
| | | public R resetPassword(@PathVariable Serializable id) { |
| | | User user = userService.getById(id); |
| | | // 重置初始密码为身份证后六位 |
| | | user.setLoginPassword(Md5Utils.md5(user.getUserIdcard().substring(user.getUserIdcard().length() - 6))); |
| | | return success(userService.updateById(user)); |
| | | } |
| | | } |
| | |
| | | @Mapper |
| | | public interface ReportDao extends BaseMapper<Report> { |
| | | |
| | | Page<ReportListVo> getPage(Page<ReportListVo> page,@Param("reportParamDto") ReportParamDto reportParamDto); |
| | | Page<ReportListVo> getPage(Page<ReportListVo> page,@Param("reportDto") ReportParamDto reportParamDto); |
| | | |
| | | ReportListVo getReportListVoById(Serializable id); |
| | | |
New file |
| | |
| | | package com.example.jz.enums; |
| | | |
| | | public enum CauseEnums { |
| | | |
| | | //未审核 |
| | | UNCHECKED(0,"未审核"), |
| | | //不予立案 |
| | | NOTTOPUTONRECORD(1,"不予立案"), |
| | | //受理中 |
| | | UNDERCONSIDERATION(2,"受理中"), |
| | | //已结案 |
| | | CASECLOSED(3,"已结案"), |
| | | //已撤案 |
| | | HASBEENDROPPED(4,"已撤案"); |
| | | |
| | | private final int value; |
| | | |
| | | private final String msg; |
| | | |
| | | CauseEnums(int value,String msg){ |
| | | this.value = value; |
| | | this.msg = msg; |
| | | } |
| | | public int value() { |
| | | return this.value; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return this.msg; |
| | | } |
| | | } |
| | |
| | | |
| | | //第一次案发时间 |
| | | @ApiModelProperty(dataType = "Date", value = "第一次案发时间") |
| | | // @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss.SSS") |
| | | private Date firstTime; |
| | | |
| | | //负责人id |
New file |
| | |
| | | package com.example.jz.modle.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(description = "案件录入导入", value = "CauseLoadDto") |
| | | public class CauseLoadDto { |
| | | //案件编号 |
| | | @ApiModelProperty(dataType = "String", value = "案件编号") |
| | | @ExcelProperty(value = "案件编号",index = 0) |
| | | private String number; |
| | | |
| | | //案件名称 |
| | | @ApiModelProperty(dataType = "String", value = "案件名称") |
| | | @ExcelProperty(value = "案件名称",index = 1) |
| | | private String name; |
| | | |
| | | //最早次案发时间 |
| | | @ApiModelProperty(dataType = "Date", value = "最早发案时间") |
| | | @ExcelProperty(value = "最早发案时间",index = 2) |
| | | private Date firstTime; |
| | | |
| | | //案件状态 |
| | | @ApiModelProperty(dataType = "String", value = "案件状态") |
| | | @ExcelProperty(value = "案件状态",index = 3) |
| | | private String status; |
| | | |
| | | //负责人 |
| | | @ApiModelProperty(dataType = "String", value = "负责人") |
| | | @ExcelProperty(value = "负责人",index = 4) |
| | | private String userName; |
| | | |
| | | //案件描述 |
| | | @ApiModelProperty(dataType = "String", value = "案件描述") |
| | | @ExcelProperty(value = "案件描述",index = 5) |
| | | private String description; |
| | | |
| | | } |
| | |
| | | @AllArgsConstructor |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel("报案查询条件") |
| | | @ApiModel("保安查询条件") |
| | | public class ReportParamDto { |
| | | /** |
| | | * 查询条件 可以是姓名也可以是身份证号 |
| | |
| | | package com.example.jz.modle.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 案件表(Cause)表实体类 |
| | |
| | | //创建时间 |
| | | private Date ctime; |
| | | //状态 0未审核 1不予立案 2受理中 3已结案 |
| | | private String status; |
| | | private Integer status; |
| | | //负责人id |
| | | private Integer userId; |
| | | //案件描述 |
| | |
| | | this.ctime = ctime; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | } |
| | | |
| | |
| | | @ApiModel(description = "案件群公告",value = "AnnouncementVo") |
| | | public class AnnouncementVo { |
| | | |
| | | /** |
| | | * 公告内容 |
| | | */ |
| | | private String text; |
| | | /** |
| | | * 群id |
| | | */ |
| | | private Integer groupId; |
| | | /** |
| | | * 公告id |
| | | */ |
| | | private Integer id; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date ctime; |
| | | |
| | | //公告有效开始时间 |
| | | private Date effectiveStime; |
| | | |
| | | //公共有效结束时间 |
| | | private Date effectiveEtime; |
| | | |
| | | //创建人 |
| | | private String createName; |
| | | |
| | | //状态 |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.example.jz.modle.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.ContentStyle; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import com.alibaba.excel.enums.BooleanEnum; |
| | | import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; |
| | | import com.alibaba.excel.enums.poi.VerticalAlignmentEnum; |
| | | import com.alibaba.excel.metadata.data.ImageData; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(description = "导出excel报案材料", value = "ExportExcelReportVo") |
| | | @ContentRowHeight(120) |
| | | @HeadRowHeight(20) |
| | | @ColumnWidth(25) |
| | | public class ExportExcelReportVo { |
| | | |
| | | @ExcelProperty(value = "报案人", index = 0) |
| | | @ContentStyle(wrapped = BooleanEnum.TRUE, horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER) |
| | | private String realName; |
| | | |
| | | @ExcelProperty(value = "手机号", index = 1) |
| | | @ContentStyle(wrapped = BooleanEnum.TRUE, horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER) |
| | | private String userMobile; |
| | | |
| | | @ExcelProperty(value = "身份证号", index = 2) |
| | | @ContentStyle(wrapped = BooleanEnum.TRUE, horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER) |
| | | private String userIdcard; |
| | | //被骗时间 |
| | | @ExcelProperty(value = "被骗时间", index = 3) |
| | | @ContentStyle(wrapped = BooleanEnum.TRUE, horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER) |
| | | private Date cheatTime; |
| | | |
| | | //涉案金额 |
| | | @ExcelProperty(value = "涉案金额", index = 4) |
| | | @ContentStyle(wrapped = BooleanEnum.TRUE, horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER) |
| | | private Double amountInvolved; |
| | | |
| | | //补充信息 |
| | | @ExcelProperty(value = "补充信息", index = 5) |
| | | @ContentStyle(wrapped = BooleanEnum.TRUE, horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER) |
| | | private String information; |
| | | |
| | | @ExcelProperty(value = "案件材料", index = 6) |
| | | @ColumnWidth(120) |
| | | private WriteCellData<List<ImageData>> writeCellData; |
| | | } |
| | |
| | | package com.example.jz.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.example.jz.modle.PageParam; |
| | | import com.example.jz.modle.entity.Announcement; |
| | | import com.example.jz.modle.vo.AnnouncementVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 公告表(Announcement)表服务接口 |
| | |
| | | */ |
| | | public interface AnnouncementService extends IService<Announcement> { |
| | | |
| | | /** |
| | | * @Description 查询公共宣传通告id |
| | | * @Param [size, current, content, status, groupId] |
| | | * @return com.example.jz.modle.PageParam<com.example.jz.modle.entity.Announcement> |
| | | **/ |
| | | PageParam<AnnouncementVo> getAnnouncements(Integer size, Integer current, String content, Integer status,Integer groupId); |
| | | |
| | | /** |
| | | * @Description 发布 |
| | | * @Param [id] |
| | | * @return java.lang.Integer |
| | | **/ |
| | | Integer updateStatus(Integer id); |
| | | |
| | | /** |
| | | * @Description 下架 |
| | | * @Param [id] |
| | | * @return java.lang.Integer |
| | | **/ |
| | | Integer updateStatusUnshelve(Integer id); |
| | | |
| | | Integer add(Integer groupId, Announcement announcement); |
| | | } |
| | | |
| | |
| | | import com.example.jz.modle.PageParam; |
| | | import com.example.jz.modle.dto.AddReportDto; |
| | | import com.example.jz.modle.dto.CauseDto; |
| | | import com.example.jz.modle.entity.Announcement; |
| | | import com.example.jz.modle.entity.Cause; |
| | | import com.example.jz.modle.vo.AnnouncementVo; |
| | | import com.example.jz.modle.vo.CauseReportVo; |
| | | import com.example.jz.modle.vo.CauseVo; |
| | | import com.example.jz.modle.vo.UserVo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @Param [groupId] |
| | | * @return java.util.List<com.example.jz.modle.vo.AnnouncementVo> |
| | | **/ |
| | | List<AnnouncementVo> getGroupAnnouncement(Integer groupId); |
| | | List<Announcement> getGroupAnnouncement(Integer groupId); |
| | | |
| | | /** |
| | | * @Description 删除案件 |
| | |
| | | **/ |
| | | void deleteCause(Integer id); |
| | | |
| | | /** |
| | | * @Description 文件导入 |
| | | * @Param [multipartFile] |
| | | * @return void |
| | | **/ |
| | | void loadFile(MultipartFile multipartFile); |
| | | |
| | | Boolean addReportPeople(AddReportDto addReportDto); |
| | | } |
| | | |
| | |
| | | import com.example.jz.modle.entity.Report; |
| | | import com.example.jz.modle.vo.ReportListVo; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | |
| | | |
| | | void leaveGroup(Integer id, Integer groupId); |
| | | |
| | | void exportReporter(Integer id, HttpServletResponse response); |
| | | |
| | | Page<ReportListVo> getPage(Page<ReportListVo> page, ReportParamDto reportParamDto); |
| | | |
| | | ReportListVo getReportListVoById(Serializable id); |
| | |
| | | package com.example.jz.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.example.jz.dao.AnnouncementDao; |
| | | import com.example.jz.dao.UserDao; |
| | | import com.example.jz.modle.PageParam; |
| | | import com.example.jz.modle.entity.Announcement; |
| | | import com.example.jz.modle.entity.User; |
| | | import com.example.jz.modle.vo.AnnouncementVo; |
| | | import com.example.jz.service.AnnouncementService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 公告表(Announcement)表服务实现类 |
| | |
| | | @Service("announcementService") |
| | | public class AnnouncementServiceImpl extends ServiceImpl<AnnouncementDao, Announcement> implements AnnouncementService { |
| | | |
| | | @Resource |
| | | AnnouncementDao announcementDao; |
| | | @Resource |
| | | UserDao userDao; |
| | | |
| | | @Override |
| | | public PageParam<AnnouncementVo> getAnnouncements(Integer size, Integer current, String content, Integer status, Integer groupId) { |
| | | PageParam<Announcement> announcementPageParam = new PageParam<>(); |
| | | announcementPageParam.setSize(size); |
| | | announcementPageParam.setCurrent(current); |
| | | QueryWrapper<Announcement> announcementQueryWrapper = new QueryWrapper<>(); |
| | | if (StringUtils.isNotBlank(content)) { |
| | | announcementQueryWrapper.like("text", content); |
| | | } |
| | | if (status != null) { |
| | | announcementQueryWrapper.eq("status", status); |
| | | } |
| | | announcementQueryWrapper.eq("group_id", groupId); |
| | | announcementQueryWrapper.orderByDesc("ctime"); |
| | | PageParam<Announcement> announcementPageParamList = announcementDao.selectPage(announcementPageParam, announcementQueryWrapper); |
| | | List<AnnouncementVo> announcementVoList = announcementPageParamList.getRecords().stream().map( |
| | | a -> { |
| | | AnnouncementVo announcementVo = new AnnouncementVo(); |
| | | BeanUtils.copyProperties(a, announcementVo); |
| | | announcementVo.setCreateName(userDao.selectOne(new QueryWrapper<User>().eq("id", a.getCreator())).getRealName()); |
| | | return announcementVo; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | PageParam<AnnouncementVo> announcementVoPageParam = new PageParam<>(); |
| | | BeanUtils.copyProperties(announcementPageParamList, announcementVoPageParam); |
| | | announcementVoPageParam.setRecords(announcementVoList); |
| | | return announcementVoPageParam; |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateStatus(Integer id) { |
| | | return announcementDao.update(new Announcement().setStatus(1), new UpdateWrapper<Announcement>().eq("id", id)); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateStatusUnshelve(Integer id) { |
| | | return announcementDao.update(new Announcement().setStatus(2), new UpdateWrapper<Announcement>().eq("id", id)); |
| | | } |
| | | |
| | | @Override |
| | | public Integer add(Integer groupId, Announcement announcement) { |
| | | announcement.setStatus(0); |
| | | announcement.setCtime(new Date()); |
| | | announcement.setGroupId(groupId); |
| | | return announcementDao.insert(announcement); |
| | | } |
| | | } |
| | |
| | | package com.example.jz.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.example.jz.dao.*; |
| | | import com.example.jz.enums.CauseEnums; |
| | | import com.example.jz.modle.PageParam; |
| | | import com.example.jz.modle.dto.AddReportDto; |
| | | import com.example.jz.modle.dto.CauseDto; |
| | | import com.example.jz.modle.dto.CauseLoadDto; |
| | | import com.example.jz.modle.entity.*; |
| | | import com.example.jz.modle.vo.AnnouncementVo; |
| | | import com.example.jz.modle.vo.CauseReportVo; |
| | | import com.example.jz.modle.vo.CauseVo; |
| | | import com.example.jz.modle.vo.UserVo; |
| | | import com.example.jz.service.CauseService; |
| | | import lombok.SneakyThrows; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * ������(Cause)�����ʵ���� |
| | | * 案件表(Cause)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-07-13 11:52:58 |
| | |
| | | BeanUtils.copyProperties(causeDto, cause); |
| | | cause.setCtime(new Date()); |
| | | causeService.save(cause); |
| | | //����Ⱥ�� |
| | | //创建群组 |
| | | Group group = new Group(); |
| | | group.setCtime(new Date()); |
| | | group.setGroupName(causeDto.getName()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<AnnouncementVo> getGroupAnnouncement(Integer groupId) { |
| | | return announcementDao.selectList(new QueryWrapper<Announcement>().eq("group_id", groupId)).stream() |
| | | .map( |
| | | a -> { |
| | | AnnouncementVo announcementVo = new AnnouncementVo(); |
| | | BeanUtils.copyProperties(a, announcementVo); |
| | | return announcementVo; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | public List<Announcement> getGroupAnnouncement(Integer groupId) { |
| | | return announcementDao.selectList(new QueryWrapper<Announcement>().eq("group_id", groupId)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | @SneakyThrows |
| | | public void loadFile(MultipartFile multipartFile) { |
| | | ArrayList<CauseLoadDto> causeLoadDtos = new ArrayList<>(); |
| | | EasyExcel.read(multipartFile.getInputStream(),CauseLoadDto.class, new AnalysisEventListener<CauseLoadDto>() { |
| | | @Override |
| | | public void invoke(CauseLoadDto data, AnalysisContext context) { |
| | | causeLoadDtos.add(data); |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | |
| | | } |
| | | }) |
| | | .autoCloseStream(true) |
| | | .doReadAll(); |
| | | causeLoadDtos.forEach( |
| | | a -> { |
| | | Cause cause = new Cause(); |
| | | BeanUtils.copyProperties(a, cause); |
| | | if (a.getStatus().equals(CauseEnums.UNCHECKED.getMsg())) { |
| | | cause.setStatus(CauseEnums.UNCHECKED.value()); |
| | | } |
| | | if (a.getStatus().equals(CauseEnums.NOTTOPUTONRECORD.getMsg())) { |
| | | cause.setStatus(CauseEnums.NOTTOPUTONRECORD.value()); |
| | | } |
| | | if (a.getStatus().equals(CauseEnums.UNDERCONSIDERATION.getMsg())) { |
| | | cause.setStatus(CauseEnums.UNDERCONSIDERATION.value()); |
| | | } |
| | | if (a.getStatus().equals(CauseEnums.CASECLOSED.getMsg())) { |
| | | cause.setStatus(CauseEnums.CASECLOSED.value()); |
| | | } |
| | | if (a.getStatus().equals(CauseEnums.HASBEENDROPPED.getMsg())) { |
| | | cause.setStatus(CauseEnums.HASBEENDROPPED.value()); |
| | | } |
| | | cause.setCtime(new Date()); |
| | | cause.setUserId(userDao.selectOne(new QueryWrapper<User>().eq("real_name", a.getUserName())).getId()); |
| | | causeDao.insert(cause); |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Boolean addReportPeople(AddReportDto addReportDto) { |
| | | User user = userDao.selectOne(new LambdaQueryWrapper<User>(User.class).eq(User::getUserIdcard, addReportDto.getIdcard())); |
| | |
| | | package com.example.jz.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.metadata.data.ImageData; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | import com.alibaba.excel.support.ExcelTypeEnum; |
| | | import com.alibaba.excel.util.IoUtils; |
| | | import com.alibaba.excel.util.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.example.jz.modle.entity.GroupUser; |
| | | import com.example.jz.modle.entity.Report; |
| | | import com.example.jz.modle.vo.ReportListVo; |
| | | import com.example.jz.dao.*; |
| | | import com.example.jz.modle.entity.*; |
| | | import com.example.jz.modle.vo.ExportExcelReportVo; |
| | | import com.example.jz.service.MinIOService; |
| | | import com.example.jz.service.ReportService; |
| | | import lombok.SneakyThrows; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.net.URL; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 报案表(Report)表服务实现类 |
| | |
| | | private GroupDao groupDao; |
| | | @Autowired |
| | | private GroupUserDao groupUserDao; |
| | | |
| | | @Resource |
| | | CauseDao causeDao; |
| | | |
| | | @Resource |
| | | UserDao userDao; |
| | | |
| | | @Resource |
| | | MinIOService minIOService; |
| | | |
| | | /** |
| | | * 审核报案 |
| | |
| | | } |
| | | |
| | | @Override |
| | | @SneakyThrows |
| | | public void exportReporter(Integer id, HttpServletResponse response) { |
| | | //查询报案人相关信息通过案件 |
| | | List<Report> reports = reportDao.selectList(new QueryWrapper<Report>().eq("cause_id", id).orderByDesc()); |
| | | ArrayList<ExportExcelReportVo> exportExcelReportVos = new ArrayList<>(); |
| | | reports.forEach( |
| | | a -> { |
| | | ExportExcelReportVo exportExcelReportVo = new ExportExcelReportVo(); |
| | | User user = userDao.selectOne(new QueryWrapper<User>().eq("id", a.getUserId())); |
| | | BeanUtils.copyProperties(a, exportExcelReportVo); |
| | | exportExcelReportVo.setUserIdcard(user.getUserIdcard()); |
| | | exportExcelReportVo.setUserMobile(user.getUserMobile()); |
| | | exportExcelReportVo.setRealName(user.getRealName()); |
| | | WriteCellData<List<ImageData>> objectWriteCellData = new WriteCellData<>(); |
| | | ArrayList<ImageData> imageDataList = new ArrayList<>(); |
| | | if (StringUtils.isNotBlank(a.getReportMaterials())) { |
| | | String[] urls = a.getReportMaterials().split(","); |
| | | for (int i = 0; i < urls.length; i++) { |
| | | int width=600; |
| | | try { |
| | | ImageData imageData = new ImageData(); |
| | | imageData.setImage(IoUtils.toByteArray(new URL(minIOService.getPreviewFileUrl(urls[i])).openConnection().getInputStream())); |
| | | imageData.setLeft(width/ urls.length*i); |
| | | imageData.setRight(width-width/ urls.length*(i+1)); |
| | | imageDataList.add(imageData); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | objectWriteCellData.setImageDataList(imageDataList); |
| | | exportExcelReportVo.setWriteCellData(objectWriteCellData); |
| | | exportExcelReportVos.add(exportExcelReportVo); |
| | | } |
| | | ); |
| | | String name = causeDao.selectOne(new QueryWrapper<Cause>().eq("id", id)).getName(); |
| | | response.setHeader("Content-disposition", "attachment;filename="+ LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))+URLEncoder.encode(name+".xlsx","utf-8")); |
| | | response.setCharacterEncoding("utf-8"); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | EasyExcel.write(response.getOutputStream(), ExportExcelReportVo.class).sheet("材料导出").doWrite(exportExcelReportVos); |
| | | } |
| | | |
| | | @Override |
| | | public Page<ReportListVo> getPage(Page<ReportListVo> page, ReportParamDto reportParamDto) { |
| | | Page<ReportListVo> aaa = reportDao.getPage(page, reportParamDto); |
| | | aaa.getRecords().stream().forEach(x -> x.setIdcard(x.getIdcard().replaceAll("(?<=[\\d]{3})\\d(?=[\\d]{4})", "*"))); |