diff --git a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java index a127664..6267022 100644 --- a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java +++ b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java @@ -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> 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 specialSupervisionDict = dictDataService.listByDictType("involvedIssue"); + EasyExcel.read(file.getInputStream(),DataPetitionComplaintReplenishDto.class,new ReadListener(){ + @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 updateWrapper =new LambdaUpdateWrapper() + .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(); + } //台帐导出 diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 7f7c7fc..29098cf 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -260,7 +260,7 @@ public class Job { private final SupRotaMapper supRotaMapper; //每天一次 00:20:00 //值班人员 - @Scheduled(cron = "0 30 12 * * ?") + @Scheduled(cron = "0 55 17 * * ?") public void operator(){ log.info("operator--------------------"); log.info("值班人员抓取中---------------------"); diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintReplenishDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintReplenishDto.java index e803e35..ceaa0c8 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintReplenishDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintReplenishDto.java @@ -34,4 +34,10 @@ public class DataPetitionComplaintReplenishDto { * */ @ExcelProperty(value = "领导姓名") private String receivingLeaderName; + + /** + * 涉及问题 + * */ + @ExcelProperty(value = "涉及问题") + private String involvedIssue; } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java b/src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java index 9306062..baacb38 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java @@ -105,4 +105,7 @@ public class DataPetitionComplaint { // 信访办理情况 private String petitionProcessingStatus; + @TableField("involved_issue") + private String involvedIssue; + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DataPetitionComplaintVo.java b/src/main/java/com/biutag/supervision/pojo/vo/DataPetitionComplaintVo.java index 3ed6292..7ee1be6 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/DataPetitionComplaintVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/DataPetitionComplaintVo.java @@ -83,5 +83,7 @@ public class DataPetitionComplaintVo { // 信访办理情况 private String petitionProcessingStatus; + //涉及问题 + private String involvedIssue; } diff --git a/src/main/java/com/biutag/supervision/service/SupRotaService.java b/src/main/java/com/biutag/supervision/service/SupRotaService.java index 93c9ef2..5be1be1 100644 --- a/src/main/java/com/biutag/supervision/service/SupRotaService.java +++ b/src/main/java/com/biutag/supervision/service/SupRotaService.java @@ -51,11 +51,4 @@ public class SupRotaService extends ServiceImpl { return jsonObject; } -// public JSONObject getSubofficeTable(SupRotaQueryParam queryParam){ -// JSONObject jsonObject =new JSONObject(); -// List supRotaList = baseMapper.getSupRotaList(queryParam.getDate(),queryParam.getDeptId()); -// jsonObject.fluentPut("supRotaList",supRotaList); -// return jsonObject; -// } - } diff --git a/src/main/resources/static/templates/涉及问题导入模板.xlsx b/src/main/resources/static/templates/涉及问题导入模板.xlsx new file mode 100644 index 0000000..3962d0b Binary files /dev/null and b/src/main/resources/static/templates/涉及问题导入模板.xlsx differ