|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.biutag.supervision.controller.data; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
@ -23,6 +24,7 @@ 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; |
|
|
|
|
import com.biutag.supervision.pojo.entity.SupDictData; |
|
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
|
import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.vo.DataPetitionComplaintVo; |
|
|
|
|
@ -30,6 +32,7 @@ import com.biutag.supervision.pojo.vo.ExportGabxfVo;
|
|
|
|
|
import com.biutag.supervision.service.DataPetitionComplaintService; |
|
|
|
|
import com.biutag.supervision.service.NegativeTaskService; |
|
|
|
|
import com.biutag.supervision.service.SupDepartService; |
|
|
|
|
import com.biutag.supervision.service.SupDictDataService; |
|
|
|
|
import dm.jdbc.util.StringUtil; |
|
|
|
|
import jakarta.servlet.http.HttpServletResponse; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
@ -65,6 +68,9 @@ public class DataPetitionComplaintController {
|
|
|
|
|
|
|
|
|
|
private final NegativeTaskService negativeTaskService; |
|
|
|
|
|
|
|
|
|
private final SupDictDataService dictDataService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping |
|
|
|
|
public Result<Page<DataPetitionComplaintVo>> list(DataPetitionComplaintQueryParam queryParam) { |
|
|
|
|
return Result.success(dataPetitionComplaintService.page(queryParam)); |
|
|
|
|
@ -236,6 +242,40 @@ public class DataPetitionComplaintController {
|
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 补充涉及问题 |
|
|
|
|
* */ |
|
|
|
|
@PostMapping("/replenishInvolvedIssue") |
|
|
|
|
public Result replenishInvolvedIssue(@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 格式文件的导入"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<SupDictData> specialSupervisionDict = dictDataService.listByDictType("involvedIssue"); |
|
|
|
|
EasyExcel.read(file.getInputStream(),DataPetitionComplaintReplenishDto.class,new ReadListener<DataPetitionComplaintReplenishDto>(){ |
|
|
|
|
@Override |
|
|
|
|
public void invoke(DataPetitionComplaintReplenishDto dto, AnalysisContext analysisContext) { |
|
|
|
|
|
|
|
|
|
//专项督察
|
|
|
|
|
if(CollectionUtil.isNotEmpty(specialSupervisionDict)){ |
|
|
|
|
String specialSupervision = specialSupervisionDict.stream().filter(dict->dict.getDictLabel().equals(dto.getInvolvedIssue())).findFirst().map(SupDictData::getDictValue).orElse(""); |
|
|
|
|
LambdaUpdateWrapper<DataPetitionComplaint> updateWrapper =new LambdaUpdateWrapper<DataPetitionComplaint>() |
|
|
|
|
.set(DataPetitionComplaint::getInvolvedIssue,specialSupervision) |
|
|
|
|
.eq(DataPetitionComplaint::getOriginId,dto.getOriginId()); |
|
|
|
|
if(StrUtil.isNotEmpty(dto.getOriginId()) && StrUtil.isNotEmpty(dto.getInvolvedIssue())){ |
|
|
|
|
dataPetitionComplaintService.update(updateWrapper); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
@Override |
|
|
|
|
public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
|
|
|
|
} |
|
|
|
|
}).sheet(0).headRowNumber(1).doRead(); |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//台帐导出
|
|
|
|
|
|