Browse Source

fit:1、案件核查 台账导入手机号没数据,属实情况无法导入

2、案件核查 无涉企涉冻导入
master
pengwei 4 months ago
parent
commit
c324874147
  1. 30
      src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java
  2. 1
      src/main/java/com/biutag/supervision/service/DataCaseVerifService.java

30
src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java

@ -7,12 +7,15 @@ import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
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.constants.enums.DepartLevelEnum;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DataCaseVerifDistribute;
import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintReplenishDto;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam;
@ -103,6 +106,33 @@ public class DataCaseVerifController {
return Result.success(list);
}
@PostMapping("importExcelInvolvedIssue")
public Result importExcelInvolvedIssue(@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 dto, AnalysisContext analysisContext) {
LambdaUpdateWrapper<DataCaseVerif> updateWrapper =new LambdaUpdateWrapper<DataCaseVerif>()
.set(DataCaseVerif::getInvolvedIssue,dto.getInvolvedIssue())
.eq(DataCaseVerif::getOriginId,dto.getOriginId());
if(StrUtil.isNotEmpty(dto.getOriginId()) && StrUtil.isNotEmpty(dto.getInvolvedIssue())){
dataCaseVerifService.update(updateWrapper);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}).sheet(0).headRowNumber(1).doRead();
return Result.success();
}
@PostMapping("{dataUpdateMethod}")
public Result<Boolean> add(@RequestBody List<DataCaseVerifImportDto> body, @PathVariable String dataUpdateMethod) {
if (body.isEmpty()) {

1
src/main/java/com/biutag/supervision/service/DataCaseVerifService.java

@ -64,6 +64,7 @@ public class DataCaseVerifService extends ServiceImpl<DataCaseVerifMapper, DataC
DataCaseVerif data = new DataCaseVerif();
BeanUtils.copyProperties(dto, data);
data.setCreateTime(now);
data.setResponderPhone(dto.getContactPhone());
data.setDistributionState(DistributionStateEnum.UNDISTRIBUTED.getValue());
saveOrUpdate(data);
}

Loading…
Cancel
Save