Browse Source

fix:1、公安部信访:新增【集访导入】,根据信访编号关联更新相关字段状态。

2、公安部信访:根据具体内容中的关键字提取初访重访状态。
master
pengwei 7 months ago
parent
commit
d7de0ea513
  1. 44
      src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java
  2. 26
      src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintReplenishDto.java
  3. 9
      src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java

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

@ -9,6 +9,7 @@ import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.enums.*;
@ -16,6 +17,7 @@ import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintGjImportDto;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintReplenishDto;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import com.biutag.supervision.pojo.entity.NegativeTask;
import com.biutag.supervision.pojo.entity.SupDepart;
@ -25,7 +27,7 @@ import com.biutag.supervision.pojo.vo.DataPetitionComplaintVo;
import com.biutag.supervision.service.DataPetitionComplaintService;
import com.biutag.supervision.service.NegativeTaskService;
import com.biutag.supervision.service.SupDepartService;
import jakarta.validation.Validator;
import dm.jdbc.util.StringUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@ -41,7 +43,6 @@ import java.util.ArrayList;
import java.util.List;
/**
*
* @author wxc
* @date
*/
@ -99,8 +100,10 @@ public class DataPetitionComplaintController {
}
}
}
list.add(data);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
@ -111,6 +114,37 @@ public class DataPetitionComplaintController {
return Result.success(list);
}
@PostMapping("gab/replenish")
public Result replenishExcel(@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 (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("是"));
}
dataPetitionComplaintService.update(updateWrapper);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}).sheet(0).headRowNumber(2).doRead();
return Result.success();
}
@PostMapping("gab")
@Transactional(rollbackFor = Exception.class)
public Result<Boolean> add(@RequestBody List<DataPetitionComplaintImportDto> list) {
@ -127,6 +161,11 @@ public class DataPetitionComplaintController {
} catch (Exception e) {
log.error(e.getMessage(), e);
}
try {
dataPetitionComplaint.setDiscoveryTime(LocalDate.parse(item.getDiscoveryTime(), DateTimeFormatter.ofPattern("yyyy-M-d H:m")).atStartOfDay());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
if (StrUtil.isNotBlank(item.getDepartId())) {
SupDepart depart = departService.getById(item.getDepartId());
@ -184,6 +223,7 @@ public class DataPetitionComplaintController {
}
list.add(data);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}

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

@ -0,0 +1,26 @@
package com.biutag.supervision.pojo.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class DataPetitionComplaintReplenishDto {
/**
* 信访编号
* */
@ExcelProperty(index = 2)
private String originId;
/**
* 初重信访
* */
@ExcelProperty(index = 24)
private String initialPetition;
/**
* 群众集访
* */
@ExcelProperty(index = 26)
private String massVisits;
}

9
src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java

@ -2,8 +2,10 @@ package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@ -25,11 +27,12 @@ public class DataPetitionComplaint {
// 受理层级
@TableField("acceptance_level")
private String acceptanceLevel;
// 登记时间
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm")
private LocalDateTime discoveryTime;
// 投诉人
@TableField("responder_name")
private String responderName;
@ -99,4 +102,4 @@ public class DataPetitionComplaint {
// 信访办理情况
private String petitionProcessingStatus;
}
}

Loading…
Cancel
Save