|
|
|
|
@ -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()) { |
|
|
|
|
|