Browse Source

fix:1、集访、领导接访导入优化;2、大屏展示数据优化,修复群众集访情况和追责问责情况不准确的问题;3、完成禁闭管理的后端功能开发、前后端对接

master
pengwei 6 months ago
parent
commit
264bbf1a06
  1. 2
      src/main/java/com/biutag/supervision/config/InterceptorConfig.java
  2. 68
      src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java
  3. 165
      src/main/java/com/biutag/supervision/controller/work/ConfinementController.java
  4. 8
      src/main/java/com/biutag/supervision/mapper/ConfinementFileMapper.java
  5. 14
      src/main/java/com/biutag/supervision/mapper/ConfinementMapper.java
  6. 22
      src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java
  7. 3
      src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java
  8. 5
      src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java
  9. 102
      src/main/java/com/biutag/supervision/pojo/dto/ConfinementDto.java
  10. 14
      src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintReplenishDto.java
  11. 104
      src/main/java/com/biutag/supervision/pojo/entity/Confinement.java
  12. 40
      src/main/java/com/biutag/supervision/pojo/param/ConfinementFile.java
  13. 29
      src/main/java/com/biutag/supervision/pojo/param/ConfinementQueryParam.java
  14. 97
      src/main/java/com/biutag/supervision/pojo/vo/ConfinementVo.java
  15. 53
      src/main/java/com/biutag/supervision/pojo/vo/ExPortConfinement.java
  16. 5
      src/main/java/com/biutag/supervision/pojo/vo/FileVo.java
  17. 14
      src/main/java/com/biutag/supervision/service/ConfinementFileService.java
  18. 99
      src/main/java/com/biutag/supervision/service/ConfinementService.java
  19. 51
      src/main/java/com/biutag/supervision/util/CommonUtil.java
  20. 4
      src/main/resources/logback-spring.xml
  21. 7
      src/main/resources/mapper/ConfinementFileMapper.xml
  22. 25
      src/main/resources/mapper/ConfinementMapper.xml
  23. BIN
      src/main/resources/static/templates/公安部信访集访导入模板.xlsx
  24. BIN
      src/main/resources/static/templates/公安部信访领导接访导入模板.xlsx
  25. BIN
      src/main/resources/static/templates/国家信访集访导入模板.xlsx
  26. BIN
      src/main/resources/static/templates/国家信访领导接访导入模板.xlsx

2
src/main/java/com/biutag/supervision/config/InterceptorConfig.java

@ -47,7 +47,7 @@ public class InterceptorConfig implements WebMvcConfigurer {
.excludePathPatterns("/common/**")
.excludePathPatterns("/app/**")
// excel导出
.excludePathPatterns("/data/petitionComplaint12337/export/result", "/negative/books/export/**","/data/petitionComplaint/export/**")
.excludePathPatterns("/data/petitionComplaint12337/export/result", "/negative/books/export/**","/data/petitionComplaint/export/**","/confinement/export")
.excludePathPatterns(List.of("/doc.html", "/webjars/**", "/favicon.ico", "/v3/api-docs/**"));
registry.addInterceptor(new ApiInterceptor())
.addPathPatterns("/api/jwdc/**");

68
src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java

@ -48,6 +48,7 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
/**
@ -121,7 +122,7 @@ public class DataPetitionComplaintController {
excelReader.close();
return Result.success(list);
}
//集访、领导名字数据补充
//集访数据补充
@PostMapping("gab/replenish")
public Result replenishExcel(@RequestPart("file") MultipartFile file) throws IOException {
log.info("文件导入中------------------------------");
@ -133,14 +134,67 @@ public class DataPetitionComplaintController {
@Override
public void invoke(DataPetitionComplaintReplenishDto data, AnalysisContext analysisContext) {
// 定义关键词集合
Set<String> initialKeywords = Set.of("初访", "初次来信","到厅初信","初次来访","到厅初访","市局初信","到部初访","国家局初访");
Set<String> initialKeywordsTwo = Set.of("重复访","到部重访", "国信局重访", "重访");
LambdaUpdateWrapper<DataPetitionComplaint> updateWrapper = new LambdaUpdateWrapper<DataPetitionComplaint>()
.eq(DataPetitionComplaint::getOriginId, data.getOriginId());
if (StringUtil.isNotEmpty(data.getInitialPetition())) {
updateWrapper.set(DataPetitionComplaint::getInitialPetition, data.getInitialPetition().contains("初") ? "1" : "2");
}
if (StringUtil.isNotEmpty(data.getMassVisits())) {
updateWrapper.set(DataPetitionComplaint::getMassVisits, data.getMassVisits().contains("是"));
}
//信访内容
if (StringUtil.isNotEmpty(data.getThingDesc())) {
if(initialKeywords.stream().anyMatch(keyword ->
data.getThingDesc().contains(keyword)) ){
updateWrapper.set(DataPetitionComplaint::getInitialPetition, "1" );
}
//重访
if(initialKeywordsTwo.stream().anyMatch(keyword ->
data.getThingDesc().contains(keyword)) ){
updateWrapper.set(DataPetitionComplaint::getInitialPetition, "2" );
}
}
//信访形式
if (StringUtil.isNotEmpty(data.getChannelForFilingComplaints())) {
updateWrapper.set(DataPetitionComplaint::getChannelForFilingComplaints, data.getChannelForFilingComplaints());
}
if(StringUtil.isNotEmpty(data.getInitialPetition())){
updateWrapper.set(DataPetitionComplaint::getInitialPetition,data.getInitialPetition().contains("初")?"1":"2");
}
if(StrUtil.isNotEmpty(data.getOriginId())){
dataPetitionComplaintService.update(updateWrapper);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}).sheet(0).headRowNumber(1).doRead();
return Result.success();
}
@PostMapping("gab/replenishLedao")
public Result replenishLedao(@RequestPart("file") MultipartFile file) throws IOException {
log.info("文件导入中------------------------------");
String fileNameType = FileUtil.extName(file.getOriginalFilename());
if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) {
throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入");
}
EasyExcel.read(file.getInputStream(), DataPetitionComplaintReplenishDto.class, new ReadListener<DataPetitionComplaintReplenishDto>() {
@Override
public void invoke(DataPetitionComplaintReplenishDto data, AnalysisContext analysisContext) {
LambdaUpdateWrapper<DataPetitionComplaint> updateWrapper = new LambdaUpdateWrapper<DataPetitionComplaint>()
.eq(DataPetitionComplaint::getOriginId, data.getOriginId());
if (StrUtil.isNotEmpty(data.getReceivingLeaderName())){
updateWrapper.set(DataPetitionComplaint::getReceivingLeaderName,data.getReceivingLeaderName());
}
@ -153,13 +207,15 @@ public class DataPetitionComplaintController {
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}).sheet(0).headRowNumber(2).doRead();
}).sheet(0).headRowNumber(1).doRead();
return Result.success();
}
//台帐导出
@GetMapping("export/xf/{petitionComplaintType}")
public void exportByGabXf(@PathVariable String petitionComplaintType, DataPetitionComplaintQueryParam queryParam, HttpServletResponse response) throws IOException {
log.info("数据导出==================>");
queryParam.setCurrent(1);
queryParam.setSize(100000);
Page<DataPetitionComplaintVo> page = dataPetitionComplaintService.page(queryParam);

165
src/main/java/com/biutag/supervision/controller/work/ConfinementController.java

@ -0,0 +1,165 @@
package com.biutag.supervision.controller.work;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.mapper.SupDepartMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.ConfinementDto;
import com.biutag.supervision.pojo.entity.Confinement;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.model.PoliceModel;
import com.biutag.supervision.pojo.param.ConfinementFile;
import com.biutag.supervision.pojo.param.ConfinementQueryParam;
import com.biutag.supervision.pojo.param.PoliceQueryParam;
import com.biutag.supervision.pojo.vo.ConfinementVo;
import com.biutag.supervision.pojo.vo.ExPortConfinement;
import com.biutag.supervision.pojo.vo.ExportGabxfVo;
import com.biutag.supervision.pojo.vo.FileVo;
import com.biutag.supervision.service.ConfinementFileService;
import com.biutag.supervision.service.ConfinementService;
import com.biutag.supervision.util.CommonUtil;
import jakarta.servlet.http.HttpServletResponse;
import jdk.jfr.TransitionFrom;
import lombok.RequiredArgsConstructor;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.beans.Transient;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 禁闭管理
* 2025/05/19
* */
@RequiredArgsConstructor
@RequestMapping("confinement")
@RestController
public class ConfinementController {
private final ConfinementService confinementService;
private final ConfinementFileService confinementFileService;
private final SupDepartMapper supDepartMapper;
/**
* 分页查询
* */
@GetMapping
public Result<Page<ConfinementVo>> list(ConfinementQueryParam param) {
return Result.success(confinementService.page(param));
}
/**
* 新增
* */
@Transactional(rollbackFor = Exception.class)
@PostMapping
public Result<Boolean> add(@RequestBody ConfinementDto dto){
Confinement confinement = new Confinement();
BeanUtil.copyProperties(dto,confinement);
if(confinementService.save(confinement)){
List<ConfinementFile> list = dto.getFiles().stream().map(s->{
ConfinementFile confinementFile =new ConfinementFile();
BeanUtil.copyProperties(s,confinementFile);
confinementFile.setConfinementId(confinement.getId());
return confinementFile;
}).toList();
confinementFileService.saveBatch(list);
return Result.success();
}else{
return Result.failed(5000,"添加失败");
}
}
/**
* 修改
* */
@PutMapping
public Result<Boolean> update(@RequestBody ConfinementDto dto){
Confinement confinement = new Confinement();
BeanUtil.copyProperties(dto,confinement);
if(confinementService.updateById(confinement)){
QueryWrapper<ConfinementFile> queryWrapper =new QueryWrapper<>();
queryWrapper.eq("confinement_id",confinement.getId());
confinementFileService.remove(queryWrapper);
List<ConfinementFile> list = dto.getFiles().stream().map(s->{
ConfinementFile confinementFile =new ConfinementFile();
BeanUtil.copyProperties(s,confinementFile);
confinementFile.setConfinementId(confinement.getId());
return confinementFile;
}).toList();
confinementFileService.saveBatch(list);
return Result.success();
}else{
return Result.failed(5000,"添加失败");
}
}
/**
* 根据id删除
* */
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable String id){
if(confinementService.removeById(id)){
return Result.success();
}else {
return Result.failed(5000,"删除失败");
}
}
@GetMapping("export")
public void export(ConfinementQueryParam param, HttpServletResponse response) throws IOException{
param.setCurrent(1);
param.setSize(100000);
Page<ConfinementVo> page =confinementService.GetExportData(param);
List<ConfinementVo> records = page.getRecords();
AtomicInteger i = new AtomicInteger(1);
List<ExPortConfinement> list = records.stream().map(s->{
ExPortConfinement exPortConfinement =new ExPortConfinement();
BeanUtil.copyProperties(s,exPortConfinement);
exPortConfinement.setIndex(i.getAndIncrement());
//获取年龄
if(s.getBirthTime()!=null){
exPortConfinement.setAge(CommonUtil.calculateAge(s.getBirthTime()));
}
if(StrUtil.isNotEmpty(s.getIsVisit())){
exPortConfinement.setIsVisit(s.getIsVisit().equals("0")?"是":"否");
}
return exPortConfinement;
}).toList();
String headerValue = "attachment; filename=\"" + URLEncoder.encode("禁闭台帐.xlsx", "UTF-8") + "\"";
response.setHeader("Content-Disposition", headerValue);
response.setContentType("application/octet-stream");
EasyExcel.write(response.getOutputStream(), ExPortConfinement.class).inMemory(Boolean.TRUE).sheet("禁闭台帐").doWrite(list);
}
/**
* 获取对应附件
* @param id 禁闭信息id
* */
@GetMapping("/files/{id}")
public Result<List<FileVo>> getById(@PathVariable String id){
QueryWrapper<ConfinementFile> queryWrapper =new QueryWrapper<>();
queryWrapper.eq("confinement_id",id);
List<ConfinementFile> confinementFiles = confinementFileService.list(queryWrapper);
List<FileVo> fileVoList= CommonUtil.copyBeanList(confinementFiles, FileVo.class);
return Result.success(fileVoList);
}
@GetMapping("/getNursingOrgs")
public Result<List<SupDepart>> getNursingOrg(){
return Result.success(supDepartMapper.selectNursingOrg());
}
}

8
src/main/java/com/biutag/supervision/mapper/ConfinementFileMapper.java

@ -0,0 +1,8 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.BusinessPolice;
import com.biutag.supervision.pojo.param.ConfinementFile;
public interface ConfinementFileMapper extends BaseMapper<ConfinementFile> {
}

14
src/main/java/com/biutag/supervision/mapper/ConfinementMapper.java

@ -0,0 +1,14 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.entity.Confinement;
import com.biutag.supervision.pojo.vo.ConfinementVo;
import org.apache.ibatis.annotations.Param;
public interface ConfinementMapper extends BaseMapper<Confinement> {
Page<ConfinementVo> queryPage(@Param("page") Page<Confinement> page, @Param(Constants.WRAPPER) QueryWrapper<Confinement> queryWrapper);
}

22
src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java

@ -135,10 +135,9 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
"IFNULL(sum(IF(entanglement_visits = 1, 1, 0)), 0) AS entanglement, " +
"IFNULL(sum(IF(mass_visits = 1, 1, 0)), 0) AS mass " +
"FROM data_petition_complaint dpc " +
"LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " +
"LEFT JOIN sup_depart sd1 on sd.pid=sd1.id " +
"WHERE create_time BETWEEN #{beginTime} AND #{endTime} " +
"AND sd1.statistics_group_id=#{groupId} "+
"LEFT JOIN sup_depart sd on dpc.second_depart_id=sd.id " +
"WHERE dpc.create_time BETWEEN #{beginTime} AND #{endTime} " +
"AND sd.statistics_group_id=#{groupId} "+
"AND dpc.problem_sources_code in "+
"<foreach collection='codes' item='item' open='(' separator=',' close=')'>"+
"#{item}"+
@ -171,19 +170,18 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
@Select("<script>" +
"SELECT " +
"sd1.short_name AS label, " +
"sd.short_name AS label, " +
"count(DISTINCT dpc.origin_id ) AS `value` " +
"FROM data_petition_complaint dpc " +
"LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " +
"LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " +
"WHERE sd1.statistics_group_id=#{groupId} " +
"LEFT JOIN sup_depart sd on dpc.second_depart_id=sd.id " +
"WHERE sd.statistics_group_id=#{groupId} " +
"AND dpc.mass_visits =1 " +
"AND dpc.problem_sources_code in "+
"AND dpc.problem_sources_code in "+
"<foreach collection='codes' item='item' open='(' separator=',' close=')'>"+
"#{item}"+
"</foreach>"+
"AND create_time BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd1.short_name " +
"</foreach> "+
"AND dpc.create_time BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd.short_name " +
"HAVING label is not NULL " +
"ORDER BY `value` DESC"+
"</script>"

3
src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java

@ -55,8 +55,7 @@ public interface NegativeBlameMapper extends BaseMapper<NegativeBlame> {
" and blameIdCode is not null and blameDepartId is not null and length(blameIdCode) > 0 and length(blameDepartId) > 0 and length(blameName) > 0 and ivPersonTypeCode != '1'")
List<NegativeBlame> selectBlameListNotIvPerson();
@Select("select handleResultName as resultName, count(*) as resultCount FROM `negative_blame` "+
"WHERE handleResultName is NOT NULL and handleResultCode is NOT NULL AND crtTime BETWEEN #{beginTime} AND #{endTime} GROUP BY resultName"
@Select("select a.handleResultName as resultName, count(*) as resultCount FROM `negative_blame` as a LEFT JOIN negative as b on a.negativeId = b.id where a.handleResultName is NOT NULL and a.handleResultCode is NOT NULL and a.crtTime BETWEEN #{beginTime} AND #{endTime} GROUP BY resultName"
)
List<BlameStats> selectBlameStatsCount(Date beginTime, Date endTime);
}

5
src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java

@ -13,6 +13,9 @@ public interface SupDepartMapper extends BaseMapper<SupDepart> {
@Select("select d.* from sup_depart d left join sup_depart_jwpy t on d.code = t.depart_code where t.code = #{departCode}")
SupDepart selectByJwpyCode(String departCode);
@Select("SELECT * from sup_depart where statistics_group_id=3 OR pid =13490 order by order_no")
List<SupDepart> selectNursingOrg();
@Select("select max(id) from sup_depart")
Integer getMaxId();
@ -58,4 +61,4 @@ public interface SupDepartMapper extends BaseMapper<SupDepart> {
"WHERE `level`>3 ")
List<LevelAndPid> selectLevelAndPid();
}
}

102
src/main/java/com/biutag/supervision/pojo/dto/ConfinementDto.java

@ -0,0 +1,102 @@
package com.biutag.supervision.pojo.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.biutag.supervision.pojo.vo.FileVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
public class ConfinementDto {
//id
private String id;
//警员id
private String policeId;
//年龄
// private String age;
// //事项ids
// private List<String> ids;
// 姓名
@NotBlank(message = "姓名不能为空")
private String name;
@NotBlank(message = "性别不能为空")
private String gender;
// 组织机构id
@NotBlank(message = "组织机构不能为空")
private String orgId;
// 警号
@NotBlank(message = "警号不能为空")
private String empNo;
// 职位类型
@NotBlank(message = "职位类型不能为空")
private String job;
// 职位类型
@NotBlank(message = "职位类型不能为空")
private String jobType;
// 电话
private String phone;
// 身份证
@NotBlank(message = "身份证号码不能为空")
private String idCode;
//看护单位
@NotBlank(message = "看护单位不能为空")
private String nursingOrgId;
//事由
@NotBlank(message = "事由不能为空")
private String matter;
//禁闭开始时间
@NotBlank(message = "开始日期不能为空")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime startTime;
//禁闭结束时间
@NotBlank(message = "结束日期不能为空")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime endTime;
//禁闭时间
@NotBlank(message = "禁闭时长不能为空")
private String confinementTime;
//入党时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime joinPartyTime;
//参加开始时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime joinWorkTime;
//参加公安工作时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime joinPoliceTime;
//出生年月
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime birthTime;
//文化程度
private String education;
//是否回访
private String isVisit;
//查处单位
private String investigateUnit;
//备注
private String remark;
private List<FileVo> files = new ArrayList<>();
}

14
src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintReplenishDto.java

@ -14,15 +14,21 @@ public class DataPetitionComplaintReplenishDto {
@ExcelProperty(value = "信访件编号")
private String originId;
/**
* 初重信访
*
* */
@ExcelProperty(value = "初重信访")
private String initialPetition;
@ExcelProperty(value = "信访内容")
private String thingDesc;
/**
* 群众集访
* 信访形式
* */
@ExcelProperty(value = "信访形式")
private String channelForFilingComplaints;
@ExcelProperty(value = "是否集访")
private String massVisits;
@ExcelProperty(value = "初重信访")
private String initialPetition;
/**
* 领导姓名
* */

104
src/main/java/com/biutag/supervision/pojo/entity/Confinement.java

@ -0,0 +1,104 @@
package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.Getter;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
public class Confinement {
@TableId
private String id;
// 姓名
@TableField("name")
private String name;
// //年龄
// @TableField("age")
// private String age;
// 组织机构id
@NotBlank
@TableField("org_id")
private String orgId;
// 警号
@NotBlank
@TableField("emp_no")
private String empNo;
// 职位类型
@TableField("job")
private String job;
// 职位类型
@TableField("job_type")
private String jobType;
// 电话
@TableField("phone")
private String phone;
//性别
@TableField("gender")
private String gender;
//警员id
@TableField("police_id")
private String policeId;
// 身份证
@NotBlank
@TableField("id_code")
private String idCode;
//看护单位
@TableField("nursing_org_id")
private String nursingOrgId;
//事由
@TableField("matter")
private String matter;
//禁闭开始时间
@TableField("start_time")
private LocalDateTime startTime;
//禁闭结束时间
@TableField("end_time")
private LocalDateTime endTime;
//禁闭时间
@TableField("confinement_time")
private String confinementTime;
//入党时间
@TableField("join_party_time")
private LocalDateTime joinPartyTime;
//参加开始时间
@TableField("join_work_time")
private LocalDateTime joinWorkTime;
//参加公安工作时间
@TableField("join_police_time")
private LocalDateTime joinPoliceTime;
//出生年月
@TableField("birth_time")
private LocalDateTime birthTime;
//文化程度
@TableField("education")
private String education;
//是否回访
@TableField("is_visit")
private String isVisit;
//查处单位
@TableField("investigate_unit")
private String investigateUnit;
@TableField("备注")
private String remark;
}

40
src/main/java/com/biutag/supervision/pojo/param/ConfinementFile.java

@ -0,0 +1,40 @@
package com.biutag.supervision.pojo.param;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
/**
* 禁闭文件
* */
@Setter
@Getter
public class ConfinementFile {
//
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
//
@TableField("confinement_id")
private String confinementId;
// 文件名称
@TableField("file_name")
private String fileName;
// 文件路径
@TableField("file_path")
private String filePath;
//
@TableField("type")
private String type;
//
@TableField("create_time")
private LocalDateTime createTime;
}

29
src/main/java/com/biutag/supervision/pojo/param/ConfinementQueryParam.java

@ -0,0 +1,29 @@
package com.biutag.supervision.pojo.param;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@Getter
@Setter
public class ConfinementQueryParam extends BasePage {
//姓名
private String name;
//部门id
private String orgId;
//事由
private String matter;
//禁闭时间
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private List<LocalDateTime> confinementTime;
// 当前单位及其所有子单位
private Boolean departBranch;
}

97
src/main/java/com/biutag/supervision/pojo/vo/ConfinementVo.java

@ -0,0 +1,97 @@
package com.biutag.supervision.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Data
public class ConfinementVo {
private String id;
// 姓名
private String name;
//警员id
private String policeId;
// 组织机构id
@NotBlank
private String orgId;
// 部门名称
private String departName;
//简单部门名称
private String departShortName;
//父级部门名称
private String parentDepartShortName;
// 警号
private String empNo;
// 职位类型
private String job;
// 职位类型
private String jobType;
// 电话
private String phone;
//出生日期
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime birthTime;
//
// // 手机号
// private String mobile;
// 身份证
@NotBlank
private String idCode;
//看护单位
private String nursingOrgId;
// 看护单位名称
private String nursingName;
//简单部门名称
private String nursingShortName;
//父级部门名称
private String parentDepartNursingName;
//事由
private String matter;
//开始时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime startTime;
//结束时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime endTime;
//禁闭时间
private String confinementTime;
//入党时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime joinPartyTime;
//参加工作开始时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime joinWorkTime;
//参加公安工作时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime joinPoliceTime;
//文化程度
private String education;
//是否回访
private String isVisit;
//查处单位
private String investigateUnit;
private String remark;
private String role;
private String roleId;
private String userId;
}

53
src/main/java/com/biutag/supervision/pojo/vo/ExPortConfinement.java

@ -0,0 +1,53 @@
package com.biutag.supervision.pojo.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
public class ExPortConfinement {
@ExcelProperty({"总编号"})
private int index;
@ExcelProperty({"姓名"})
private String name;
@ExcelProperty({"单位"})
private String parentDepartShortName;
@ExcelProperty({"部门名称"})
private String departShortName;
@ExcelProperty({"年龄"})
private int age;
@ExcelProperty({"职务"})
private String job;
@ExcelProperty({"事由"})
private String matter;
@ExcelProperty({"禁闭时长"})
private String confinementTime;
@ExcelProperty({"开始日期"})
private LocalDateTime startTime;
@ExcelProperty({"结束时间"})
private LocalDateTime endTime;
@ExcelProperty({"看护单位"})
private String nursingShortName;
@ExcelProperty({"是否回访"})
private String isVisit;
@ExcelProperty({"备注"})
private String remark;
@ExcelProperty({"查处单位"})
private String investigateUnit;
}

5
src/main/java/com/biutag/supervision/pojo/vo/FileVo.java

@ -8,11 +8,14 @@ import lombok.experimental.Accessors;
@Setter
@Getter
public class FileVo {
private String id;
private String confinementId;
private String filePath;
private String fileName;
private Integer fileClassId;
// private Integer fileClassId;
}

14
src/main/java/com/biutag/supervision/service/ConfinementFileService.java

@ -0,0 +1,14 @@
package com.biutag.supervision.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.mapper.AlarmFileMapper;
import com.biutag.supervision.mapper.ConfinementFileMapper;
import com.biutag.supervision.pojo.entity.AlarmFile;
import com.biutag.supervision.pojo.param.ConfinementFile;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@RequiredArgsConstructor
@Service
public class ConfinementFileService extends ServiceImpl<ConfinementFileMapper, ConfinementFile> {
}

99
src/main/java/com/biutag/supervision/service/ConfinementService.java

@ -0,0 +1,99 @@
package com.biutag.supervision.service;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.mapper.ConfinementMapper;
import com.biutag.supervision.mapper.SupTaskInspectionMapper;
import com.biutag.supervision.pojo.entity.Confinement;
import com.biutag.supervision.pojo.entity.SupTaskInspection;
import com.biutag.supervision.pojo.model.PoliceModel;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.param.ConfinementQueryParam;
import com.biutag.supervision.pojo.param.PoliceQueryParam;
import com.biutag.supervision.pojo.vo.ConfinementVo;
import com.biutag.supervision.pojo.vo.TaskInspectionVo;
import dm.jdbc.util.StringUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@RequiredArgsConstructor
@Service
public class ConfinementService extends ServiceImpl<ConfinementMapper, Confinement> {
private final SupDepartService departService;
public Page<ConfinementVo> page(ConfinementQueryParam param) {
QueryWrapper<Confinement> queryWrapper = new QueryWrapper<>();
UserAuth user = UserContextHolder.getCurrentUser();
// 权限
if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) {
if (user.getAuthDepartIds().isEmpty() || user.getRoleCodes().isEmpty()) {
return new Page<ConfinementVo>().setTotal(0).setRecords(new ArrayList<>());
}
List<String> orgIds = departService.getAllNodeIds(user.getAuthDepartIds());
queryWrapper.in("c1.org_id", orgIds);
}
//查询条件:姓名、部门、事由、禁闭时间(大于或者等于开始时间,小于或者等于结束时间)
queryWrapper.like(StrUtil.isNotBlank(param.getName()), "c1.name", StrUtil.trim(param.getName()))
.like(StrUtil.isNotBlank(param.getMatter()), "c1.matter", StrUtil.trim(param.getMatter()));
if (CollectionUtils.isNotEmpty(param.getConfinementTime())) {
queryWrapper.le("c1.end_time", param.getConfinementTime().get(1))
.ge("c1.start_time", param.getConfinementTime().get(0));
}
//部门的查询条件
if (StrUtil.isNotEmpty(param.getOrgId())) {
if (param.getDepartBranch()) {
List<String> orgIds = departService.getAllNodeIds(param.getOrgId());
queryWrapper.in("c1.org_id", orgIds);
} else {
queryWrapper.in("c1.org_id", param.getOrgId());
}
}
//todo 排序
return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper);
}
public Page<ConfinementVo> GetExportData(ConfinementQueryParam param){
QueryWrapper<Confinement> queryWrapper = new QueryWrapper<>();
//查询条件:姓名、部门、事由、禁闭时间(大于或者等于开始时间,小于或者等于结束时间)
if(StrUtil.isNotEmpty(param.getName())){
queryWrapper.like(StrUtil.isBlank(param.getName()), "c1.name", StrUtil.trim(param.getName()));
}
if(StrUtil.isNotEmpty(param.getMatter())){
queryWrapper.like(StrUtil.isBlank(param.getMatter()), "c1.matter", StrUtil.trim(param.getMatter()));
}
if (CollectionUtils.isNotEmpty(param.getConfinementTime())) {
queryWrapper.le("c1.end_time", param.getConfinementTime().get(1))
.ge("c1.start_time", param.getConfinementTime().get(0));
}
//部门的查询条件
if (StrUtil.isNotEmpty(param.getOrgId())) {
if (param.getDepartBranch()) {
List<String> orgIds = departService.getAllNodeIds(param.getOrgId());
queryWrapper.in("c1.org_id", orgIds);
} else {
queryWrapper.in("c1.org_id", param.getOrgId());
}
}
//todo 排序
return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper);
}
}

51
src/main/java/com/biutag/supervision/util/CommonUtil.java

@ -0,0 +1,51 @@
package com.biutag.supervision.util;
import org.springframework.beans.BeanUtils;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Period;
import java.util.LinkedList;
import java.util.List;
public class CommonUtil {
/**
* 封装BeanUtils.copyProperties 数组转换
* @param resourceList 源数组
* @param target 目标对象
* @param <T> 目标对象类型
* @return
*/
public static <T> List<T> copyBeanList(List<?> resourceList, Class<T> target){
List<T> targetList = new LinkedList<>();
if (null==resourceList||resourceList.isEmpty()){
return targetList;
}
resourceList.forEach(e->{
T o = null;
try {
o = target.newInstance();
} catch (InstantiationException | IllegalAccessException ex) {
ex.printStackTrace();
}
BeanUtils.copyProperties(e,o);
targetList.add(o);
});
return targetList;
}
/**
* 根据出生日期计算年龄
* @param time 出生日期
* @return
*/
public static int calculateAge(LocalDateTime time){
LocalDate birthDate = LocalDate.from(time);
LocalDate currentDate = LocalDate.now();
// 计算年龄
Period period = Period.between(birthDate, currentDate);
int years = period.getYears();
return years;
}
}

4
src/main/resources/logback-spring.xml

@ -2,8 +2,8 @@
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<contextName>logs</contextName>
<!-- 日志位置 -->
<!-- <property name="log.path" value="/Users/weipeng/dome/chuankei/supervision/supervision-boot/work/log"/>-->
<property name="log.path" value="/work/log"/>
<property name="log.path" value="/Users/weipeng/dome/chuankei/supervision/supervision-boot/work/log"/>
<!-- <property name="log.path" value="/work/log"/>-->
<!-- 日志保留时长 -->
<property name="log.maxHistory" value="7"/>
<!-- 控制台格式化及颜色 -->

7
src/main/resources/mapper/ConfinementFileMapper.xml

@ -0,0 +1,7 @@
<?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.biutag.supervision.mapper.ConfinementFileMapper">
</mapper>

25
src/main/resources/mapper/ConfinementMapper.xml

@ -0,0 +1,25 @@
<?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.biutag.supervision.mapper.ConfinementMapper">
<select id="queryPage" resultType="com.biutag.supervision.pojo.vo.ConfinementVo">
SELECT c1.*,
sd1.name as departName,
sd1.short_name departShortName,
sd2.short_name parentDepartShortName,
sd3.name as nursingName,
sd3.short_name nursingShortName,
u.role, u.role_id as roleId, u.user_id as userId
from confinement as c1
LEFT JOIN sup_depart as sd1 on c1.org_id = sd1.id
LEFT JOIN sup_depart as sd2 on sd1.pid = sd2.id AND sd2.LEVEL != 1
LEFT JOIN sup_depart as sd3 on c1.nursing_org_id = sd3.id
LEFT JOIN
(
SELECT u.user_id, u.user_name, GROUP_CONCAT( r.role_name SEPARATOR ',' ) role, GROUP_CONCAT( r.role_id SEPARATOR ',' ) role_id FROM `open-platform`.base_user u LEFT JOIN `open-platform`.base_role_user ru ON ru.user_id = u.user_id LEFT JOIN `open-platform`.base_role r ON r.role_id = ru.role_id GROUP BY u.user_name
) u ON u.user_name = c1.id_code
${ew.getCustomSqlSegment}
</select>
</mapper>

BIN
src/main/resources/static/templates/公安部信访集访导入模板.xlsx

Binary file not shown.

BIN
src/main/resources/static/templates/公安部信访领导接访导入模板.xlsx

Binary file not shown.

BIN
src/main/resources/static/templates/国家信访集访导入模板.xlsx

Binary file not shown.

BIN
src/main/resources/static/templates/国家信访领导接访导入模板.xlsx

Binary file not shown.
Loading…
Cancel
Save