diff --git a/src/main/java/com/biutag/supervision/constants/enums/InvolveProblemEnum.java b/src/main/java/com/biutag/supervision/constants/enums/InvolveProblemEnum.java index 64205d2..26be3b4 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/InvolveProblemEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/InvolveProblemEnum.java @@ -10,9 +10,12 @@ import lombok.Getter; @AllArgsConstructor public enum InvolveProblemEnum { // 自动回访不满意 - ZDHFBMY("1"); + ZDHFBMY("1", "自动回访不满意"); + @Getter private String value; + private String laebl; + } diff --git a/src/main/java/com/biutag/supervision/constants/enums/PoliceTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/PoliceTypeEnum.java new file mode 100644 index 0000000..0c4ad6c --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/PoliceTypeEnum.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/12/26 + */ +@AllArgsConstructor +@Getter +public enum PoliceTypeEnum { + + JL("警令", "1"), + ZG("政工", "2"), + JB("警保", "3"), + ZJJC("纪检监察", "4"), + JGDW("机关党委", "5"), + JGJW("机关纪委", "6"), + LDZX("六大中心", "7"), + JX("警校", "8"), + XZ("刑侦", "9"), + ZA("治安", "10"); + + + private String label; + private String value; + + public static PoliceTypeEnum getByLabel(String label) { + for (PoliceTypeEnum problemSourcesEnum : values()) { + if (problemSourcesEnum.label.equals(label)) { + return problemSourcesEnum; + } + } + return null; + } +} diff --git a/src/main/java/com/biutag/supervision/controller/PoliceAvatarController.java b/src/main/java/com/biutag/supervision/controller/PoliceAvatarController.java index 68447d0..a9f12d4 100644 --- a/src/main/java/com/biutag/supervision/controller/PoliceAvatarController.java +++ b/src/main/java/com/biutag/supervision/controller/PoliceAvatarController.java @@ -34,7 +34,6 @@ public class PoliceAvatarController { @RequestMapping public Result update() throws FileNotFoundException { List files = FileUtil.loopFiles("/work/POLICE"); - int i = 0; for (File file : files) { try { String img = file.getPath().replace("/work/POLICE", ""); @@ -44,7 +43,7 @@ public class PoliceAvatarController { continue; } String filePath = fileService.upload(new FileInputStream(file), FileUtil.size(file), FileUtil.extName(file.getName())); - policeMapper.update(new LambdaUpdateWrapper().eq(SupPolice::getIdCode, "idCode").set(SupPolice::getAvatarUrl, filePath)); + policeMapper.update(new LambdaUpdateWrapper().eq(SupPolice::getIdCode, idCode).set(SupPolice::getAvatarUrl, filePath)); log.info("{} 更新头像 {}", idCode, file.getName()); } catch (Exception e) { log.error(e.getMessage(), e); diff --git a/src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java b/src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java index f21a798..2d5ebf3 100644 --- a/src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java +++ b/src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java @@ -1,22 +1,31 @@ package com.biutag.supervision.controller.books; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.DepartLevelEnum; import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.constants.enums.SpecialSupervisionEnum; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.param.NegativeQueryParam; +import com.biutag.supervision.pojo.vo.DepartTree; import com.biutag.supervision.pojo.vo.NegativeHdjq; +import com.biutag.supervision.service.NegativeBlameService; import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.SupDepartService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; /** * @author wxc @@ -30,14 +39,59 @@ public class NegativeBookController { private final NegativeService negativeService; + private final NegativeBlameService blameService; + + private final SupDepartService departService; + @GetMapping("hdjq") - public Result> page(NegativeQueryParam queryParam) { + public Result> page(NegativeQueryParam param) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.ZXDC.getValue()) .eq(Negative::getSpecialSupervision, SpecialSupervisionEnum.HDJQ.getValue()) - .orderByAsc(Negative::getReportNumber) - .orderByAsc(Negative::getCrtTime); - Page page = negativeService.page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + .in(!param.getProcessingStatus().isEmpty(), Negative::getProcessingStatus, param.getProcessingStatus()) + .like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()) + .like(StrUtil.isNotBlank(param.getReportNumber()), Negative::getReportNumber, param.getReportNumber()) + .eq(Objects.nonNull(param.getCrtDepartLevel()), Negative::getCrtDepartLevel, param.getCrtDepartLevel()) + .orderByDesc(Negative::getDiscoveryTime) + .orderByAsc(Negative::getReportNumber); + if (param.getDiscoveryTime().size() == 2) { + queryWrapper.between(Negative::getDiscoveryTime, param.getDiscoveryTime().get(0), param.getDiscoveryTime().get(1)); + } + // 涉及单位 + if (StrUtil.isNotBlank(param.getInvolveDepartId())) { + List departIds = departService.getAllNodeIds(param.getInvolveDepartId()); + queryWrapper.in(Negative::getInvolveDepartId, departIds); + } + // 办理单位 + if (StrUtil.isNotBlank(param.getHandleDepartId())) { + List nodes = departService.getAllNode(List.of(param.getHandleDepartId())); + List secondIds = nodes.stream().filter(node -> DepartLevelEnum.SECOND.getValue().equals(node.getLevel())).map(DepartTree::getId).toList(); + if (!secondIds.isEmpty()) { + queryWrapper.in(Negative::getHandleSecondDepartId, secondIds); + } else { + queryWrapper.in(Negative::getHandleThreeDepartId, nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList()); + } + } + if (StrUtil.isNotBlank(param.getBlameKey()) && StrUtil.isNotBlank(param.getBlameValue())) { + LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); + switch (param.getResponderKey()) { + case "name": + qw.like(NegativeBlame::getBlameName, param.getBlameValue()); + break; + case "empNo": + qw.like(NegativeBlame::getBlameEmpNo, param.getBlameValue()); + break; + case "idCode": + qw.like(NegativeBlame::getBlameIdCode, param.getBlameValue()); + break; + } + List blames = blameService.list(qw); + if (blames.isEmpty()) { + return Result.success(new Page().setTotal(0).setRecords(new ArrayList<>())); + } + queryWrapper.in(Negative::getId, blames.stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet())); + } + Page page = negativeService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); List list = page.getRecords().stream().map(item -> { NegativeHdjq negativeHdjq = new NegativeHdjq(); BeanUtil.copyProperties(item, negativeHdjq); diff --git a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java index 803c671..5122dab 100644 --- a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java +++ b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java @@ -1,12 +1,16 @@ package com.biutag.supervision.controller.data; - +import cn.hutool.core.io.FileUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.alibaba.excel.read.metadata.ReadSheet; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.Result; -import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute; -import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute12337; +import com.biutag.supervision.pojo.dto.DataPetition12337Distribute; +import com.biutag.supervision.pojo.dto.DataPetition12337Dto; import com.biutag.supervision.pojo.entity.DataPetition12337; -import com.biutag.supervision.pojo.entity.DataPetitionComplaint; import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; import com.biutag.supervision.pojo.vo.DataPetition12337Vo; import com.biutag.supervision.service.DataPetition12337Service; @@ -15,10 +19,11 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; @Tag(name = "12337信访投诉菜单") @Slf4j @@ -67,17 +72,35 @@ public class DataPetitionComplaint12337Controller { return Result.success(dataPetition12337Service.removeById(id)); } - /** - * 下发 - */ - @PostMapping("distribute") - public Result distribute(@RequestBody DataDataPetitionComplainDistribute12337 dataDistribute) { - return Result.success(dataPetition12337Service.distribution(dataDistribute)); - } - + @PostMapping("import") + public Result> importExcel(@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 list = new ArrayList<>(); + ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataPetition12337Dto.class, new ReadListener() { + @Override + public void invoke(DataPetition12337Dto data, AnalysisContext analysisContext) { + list.add(data); + } + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + } + }).build(); + ReadSheet sheet = EasyExcel.readSheet(0).build(); + excelReader.read(sheet); + excelReader.close(); + return Result.success(list); + } + @PostMapping("distribute") + public Result distribute(@RequestBody DataPetition12337Distribute distributeData) { + return Result.success(dataPetition12337Service.distribution(distributeData)); + } } diff --git a/src/main/java/com/biutag/supervision/controller/sensitiveperception/RiskPersonalController.java b/src/main/java/com/biutag/supervision/controller/sensitiveperception/RiskPersonalController.java index 4d5aa58..3e42890 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitiveperception/RiskPersonalController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitiveperception/RiskPersonalController.java @@ -55,6 +55,7 @@ public class RiskPersonalController { private final RiskTagMapService riskTagMapService; + private final SupDepartService departService; @GetMapping public Result> list(RiskPersonalQueryParam param) { @@ -62,6 +63,10 @@ public class RiskPersonalController { List list = riskTagMapService.list(new LambdaQueryWrapper().in(RiskTagMap::getRiskTag, param.getSmallTags())); param.setSmallTags(list.stream().map(RiskTagMap::getSmallTag).toList()); } + if (StrUtil.isNotBlank(param.getControlDepartId())) { + List departIds = departService.getAllNodeIds(param.getControlDepartId()); + param.setDepartIds(departIds); + } Page page = riskPersonalMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), param); List records = page.getRecords(); if (records.isEmpty()) { @@ -69,8 +74,10 @@ public class RiskPersonalController { } List idCodes = records.stream().map(RiskPersonalVo::getIdCode).toList(); List smallTags = riskPersonalTagService.list(new LambdaQueryWrapper().in(RiskPersonalTag::getIdCode, idCodes)); + List riskPersonInfos = riskPersonInfoService.list(new LambdaQueryWrapper().in(RiskPersonInfo::getIdCode, idCodes)); records.forEach(item -> { item.setSmallTags(smallTags.stream().filter(smallTag -> smallTag.getIdCode().equals(item.getIdCode())).map(RiskPersonalTag::getSmallTag).collect(Collectors.joining(","))); + item.setAvatar(riskPersonInfos.stream().filter(info -> item.getIdCode().equals(info.getIdCode())).findFirst().map(RiskPersonInfo::getImageBase64).orElse(null)); }); return Result.success(page); } diff --git a/src/main/java/com/biutag/supervision/controller/sensitiveperception/ScoreController.java b/src/main/java/com/biutag/supervision/controller/sensitiveperception/ScoreController.java index ce846e2..3216086 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitiveperception/ScoreController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitiveperception/ScoreController.java @@ -124,6 +124,7 @@ public class ScoreController { log.info("{}-{}的 分值 = {}", personal.getName(), personal.getIdCode(), riskScore); riskPersonalService.update(new LambdaUpdateWrapper().eq(RiskPersonal::getIdCode, personal.getIdCode()).set(RiskPersonal::getRiskScore, riskScore)); }); + updateDepartScore(); return Result.success("success"); } diff --git a/src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java index 73d52fe..0d256b9 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java @@ -1,16 +1,42 @@ package com.biutag.supervision.controller.work; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +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.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.BusinessTypeEnum; +import com.biutag.supervision.constants.enums.DepartLevelEnum; +import com.biutag.supervision.constants.enums.PoliceTypeEnum; +import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.NegativeImportDto; 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.param.NegativeTaskQueryParam; import com.biutag.supervision.service.NegativeTaskService; +import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.service.SupDictDataService; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validator; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +@Slf4j @RequiredArgsConstructor @RequestMapping("negativeTask") @RestController @@ -18,9 +44,102 @@ public class NegativeTaskController { private final NegativeTaskService negativeTaskService; + private final Validator validator; + + private final SupDictDataService dictDataService; + + private final SupDepartService departService; + @GetMapping public Result> page(NegativeTaskQueryParam param) { return Result.success(negativeTaskService.page(param)); } + /** + * 批量下发列表 + * @param param + * @return + */ + @GetMapping("importList") + public Result> pageByImport(NegativeTaskQueryParam param) { + return Result.success(negativeTaskService.pageByImport(param)); + } + + @PostMapping("import") + public Result> importExcel(@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 list = new ArrayList<>(); + + List suspectProblem = dictDataService.listByDictType("suspectProblem"); + ExcelReader excelReader = EasyExcel.read(file.getInputStream(), NegativeImportDto.class, new ReadListener() { + + @Override + public void invoke(NegativeImportDto data, AnalysisContext analysisContext) { + Set> validate = validator.validate(data); + if (!validate.isEmpty()) { + String message = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining("\n")); + throw new RuntimeException(message); + } + if (StrUtil.isNotBlank(data.getProblemSources())) { + ProblemSourcesEnum problemSourcesEnum = ProblemSourcesEnum.getByLabel(data.getProblemSources()); + if (problemSourcesEnum == null) { + throw new RuntimeException(String.format("未匹配到该问题来源【%s】,请联系系统管理员", data.getProblemSources())); + } + data.setProblemSourcesCode(problemSourcesEnum.getValue()); + } + if (StrUtil.isNotBlank(data.getBusinessTypeName())) { + BusinessTypeEnum businessTypeEnum = BusinessTypeEnum.getByLabel(data.getBusinessTypeName()); + if (businessTypeEnum == null) { + throw new RuntimeException(String.format("未匹配到该业务类型【%s】,请联系系统管理员", data.getBusinessTypeName())); + } + data.setBusinessTypeCode(businessTypeEnum.getValue()); + } + if (StrUtil.isNotBlank(data.getPoliceTypeName())) { + PoliceTypeEnum policeTypeEnum = PoliceTypeEnum.getByLabel(data.getPoliceTypeName()); + if (policeTypeEnum == null) { + throw new RuntimeException(String.format("未匹配到该警种【%s】,请联系系统管理员", data.getPoliceTypeName())); + } + data.setPoliceType(policeTypeEnum.getValue()); + } + if (StrUtil.isNotBlank(data.getInvolveProblemStr())) { + List involveProblem = Arrays.stream(data.getInvolveProblemStr().split("/")) + .map(label -> suspectProblem.stream().filter(item -> label.equals(item.getDictLabel())).map(SupDictData::getDictValue).findFirst().orElse(null)).filter(StrUtil::isNotBlank).toList(); + data.setInvolveProblem(involveProblem); + } + if (StrUtil.isNotBlank(data.getInvolveDepartName())) { + String[] departNames = data.getInvolveDepartName().split("/"); + List departs = departService.list(new LambdaQueryWrapper().eq(SupDepart::getLevel, DepartLevelEnum.SECOND.getValue()) + .eq(SupDepart::getShortName, departNames[0])); + if (!departs.isEmpty()) { + if (departNames.length > 1) { + List threeDeparts = departService.list(new LambdaQueryWrapper() + .eq(SupDepart::getPid, departs.get(0).getId()) + .eq(SupDepart::getShortName, departNames[0])); + if (!threeDeparts.isEmpty()) { + data.setInvolveDepartId(threeDeparts.get(0).getId()); + data.setInvolveDepartName(threeDeparts.get(0).getShortName()); + } + } else { + data.setInvolveDepartId(departs.get(0).getId()); + data.setInvolveDepartName(departs.get(0).getShortName()); + } + } + + } + list.add(data); + } + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + } + }).build(); + ReadSheet sheet = EasyExcel.readSheet("问题信息模板").build(); + excelReader.read(sheet); + excelReader.close(); + return Result.success(list); + } + } diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Distribute.java b/src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Distribute.java new file mode 100644 index 0000000..f0462bb --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Distribute.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.pojo.dto; + +import com.biutag.supervision.pojo.vo.FileVo; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2024/12/26 + */ +@Setter +@Getter +public class DataPetition12337Distribute { + + private List data = new ArrayList<>(); + + private String taskName; + + // 办理时限 + @NotBlank + private String timeLimit; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 审批流程 + @NotBlank + private String approvalFlow; + + private String businessTypeCode; + + private String businessTypeName; + + private List thingFiles = new ArrayList<>(); +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Dto.java b/src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Dto.java new file mode 100644 index 0000000..b46dbe6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Dto.java @@ -0,0 +1,561 @@ +package com.biutag.supervision.pojo.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * @author wxc + * @date 2024/12/26 + */ +@Setter +@Getter +public class DataPetition12337Dto { + + /** + * 唯一编号 + */ + private String onlyId; + + /** + * 外网线索编号 + */ + @ExcelProperty("外网线索编号") + private String externalId; + + /** + * 内网线索编号 + */ + @ExcelProperty("内网线索编号") + private String innerId; + + /** + * 单机版线索编号 + */ + @ExcelProperty("单机版线索编号") + private String standAlone; + + /** + * 信息受理登记时间 + */ + @ExcelProperty("信息受理登记时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd") + private Date discoverTime; + + /** + * 线索来源 + */ + @ExcelProperty("线索来源") + private String letterSource; + + /** + * 举报人姓名 + */ + @ExcelProperty("举报人姓名") + private String name; + + /** + * 手机号码 + */ + @ExcelProperty("手机号码") + private String phone; + + /** + * 身份证号 + */ + @ExcelProperty("身份证号") + private String idCode; + + /** + * 举报人(省) + */ + @ExcelProperty("举报人(省)") + private String reporterProvincial; + + /** + * 举报人(市) + */ + @ExcelProperty("举报人(市)") + private String reporterCity; + + /** + * 举报人(县) + */ + @ExcelProperty("举报人(县)") + private String reporterCounty; + + /** + * 现住地详址 + */ + @ExcelProperty("现住地详址") + private String address; + + /** + * 是否政法干警 + */ + @ExcelProperty("是否政法干警") + private String isLawPolice; + + /** + * 被举报人姓名 + */ + @ExcelProperty("被举报人姓名") + private String reportedName; + + /** + * 所属系统 + */ + @ExcelProperty("") + private String belongSystem; + + /** + * 人员类别 + */ + @ExcelProperty("人员类别") + private String personType; + + /** + * 被举报人所在地(省) + */ + @ExcelProperty("被举报人所在地(省)") + private String reportedProvincial; + + /** + * 被举报人所在地(市) + */ + @ExcelProperty("被举报人所在地(市)") + private String reportedCity; + + /** + * 被举报人所在地(县) + */ + @ExcelProperty("被举报人所在地(县)") + private String reportedCounty; + + /** + * 单位名称 + */ + @ExcelProperty("单位名称") + private String orgName; + + /** + * 被举报单位名称 + */ + @ExcelProperty("被举报单位名称") + private String reportedOrgName; + + /** + * 所属系统 + */ + @ExcelProperty("所属系统") + private String reportedOrgBelong; + + /** + * 被举报单位所在地(省) + */ + @ExcelProperty("被举报单位所在地(省)") + private String reportedOrgProvincial; + + /** + * 被举报单位所在地(市) + */ + @ExcelProperty("被举报单位所在地(市)") + private String reportedOrgCity; + + /** + * 被举报单位所在地(县) + */ + @ExcelProperty("被举报单位所在地(县)") + private String reportedOrgCounty; + + /** + * 单位所属层级 + */ + @ExcelProperty("单位所属层级") + private String reportedOrgLevel; + + /** + * 涉嫌违纪问题项目 + */ + @ExcelProperty("涉嫌违纪问题项目") + private String againstProProject; + + /** + * 涉嫌贪污贿赂类犯罪 + */ + @ExcelProperty("涉嫌贪污贿赂类犯罪") + private String corruptionGuilt; + + /** + * 涉嫌渎职类犯罪 + */ + @ExcelProperty("涉嫌渎职类犯罪") + private String omissionGuilt; + + /** + * 涉嫌侵犯公民人身权利类犯罪 + */ + @ExcelProperty("涉嫌侵犯公民人身权利类犯罪") + private String invadeEntitlementGuilt; + + /** + * 涉嫌侵犯财产类犯罪 + */ + @ExcelProperty("涉嫌侵犯财产类犯罪") + private String invadeFinanceGuilt; + + /** + * 其他 + */ + @ExcelProperty("其他") + private String otherGuilt; + + /** + * 顽瘴痼疾项目 + */ + @ExcelProperty("顽瘴痼疾项目") + private String hardProProject; + + /** + * 涉嫌违纪违法事项 + */ + @ExcelProperty("涉嫌违纪违法事项") + private String wjwfProject; + + /** + * 转办时间 + */ + @ExcelProperty("转办时间") + private String passTime; + + /** + * 转办单位 + */ + @ExcelProperty("转办单位") + private String passOrg; + + /** + * 核查时间 + */ + @ExcelProperty("核查时间") + private String reviewTime; + + /** + * 核查单位 + */ + @ExcelProperty("核查单位") + private String reviewOrg; + + /** + * 核查人 + */ + @ExcelProperty("核查人") + private String reviewPersonName; + + /** + * 核查人联系方式 + */ + @ExcelProperty("核查人联系方式") + private String reviewPersonPhone; + + /** + * 被核查人类别 + */ + @ExcelProperty("被核查人类别") + private String reviewedPersonType; + + /** + * 被核查人是否属于领导班子成员 + */ + @ExcelProperty("被核查人是否属于领导班子成员") + private String reviewedPersonIsleader; + + /** + * 是否核查完结 + */ + @ExcelProperty("是否核查完结") + private String reviewedIsover; + + /** + * 核查简要情况 + */ + @ExcelProperty("核查简要情况") + private String reviewDes; + + /** + * 办理结果 + */ + @ExcelProperty("办理结果") + private String processResult; + + /** + * 是否进行线索初核 + */ + @ExcelProperty("是否进行线索初核") + private String isFirstView; + + /** + * 核查组组长 + */ + @ExcelProperty("核查组组长") + private String reviewLeader; + + /** + * (核查组组长)联系方式 + */ + @ExcelProperty("(核查组组长)联系方式") + private String reviewLeaderPhone; + + /** + * 初核情况 + */ + @ExcelProperty("初核情况") + private String firstViewDes; + + /** + * 是否立案审查调查 + */ + @ExcelProperty("是否立案审查调查") + private String isRegisterCase; + + /** + * 立案审查调查情况 + */ + @ExcelProperty("立案审查调查情况") + private String registerCaseDes; + + /** + * 是否处分处理 + */ + @ExcelProperty("是否处分处理") + private String isPunish; + + /** + * 处理结论形态 + */ + @ExcelProperty("处理结论形态") + private String processResType; + + /** + * 处理结论结果 + */ + @ExcelProperty("处理结论结果") + private String processResDes; + + /** + * 处分处理情况 + */ + @ExcelProperty("处分处理情况") + private String punishDes; + + /** + * 是否适用自查从宽政策 + */ + @ExcelProperty("是否适用自查从宽政策") + private String isTolerant; + + /** + * 是否办结 + */ + @ExcelProperty("是否办结") + private String isOver; + + /** + * 联系时间 + */ + @ExcelProperty("联系时间") + private String contactTime; + + /** + * 联系单位 + */ + @ExcelProperty("联系单位") + private String contactOrg; + + /** + * 联系人 + */ + @ExcelProperty("联系人") + private String contactPersonName; + + /** + * 联系方式 + */ + @ExcelProperty("联系方式") + private String contactType; + + /** + * 与举报人联系沟通详情 + */ + @ExcelProperty("与举报人联系沟通详情") + private String contactReporterDes; + + /** + * 超期未反馈原因 + */ + @ExcelProperty("超期未反馈原因") + private String overtimeReason; + + /** + * 是否申请异议 + */ + @ExcelProperty("是否申请异议") + private String isDissent; + + /** + * 目标省份 + */ + @ExcelProperty("目标省份") + private String aimProvincial; + + /** + * 申请人 + */ + @ExcelProperty("申请人") + private String applyPersonName; + + /** + * 联系方式 + */ + @ExcelProperty("联系方式") + private String applyPersonPhone; + + /** + * 申请原因 + */ + @ExcelProperty("申请原因") + private String applyReason; + + /** + * 异议处理方式 + */ + @ExcelProperty("异议处理方式") + private String dissentHandle; + + /** + * 处理说明 + */ + @ExcelProperty("处理说明") + private String dissentHandleExplain; + + /** + * 是否存在附件 + */ + @ExcelProperty("是否存在附件") + private String isAnnex; + + /** + * 附件文件名 + */ + @ExcelProperty("附件文件名") + private String annexName; + + /** + * 线索举报时间 + */ + @ExcelProperty("线索举报时间") + private String reportTime; + + /** + * 导入时间 + */ + @ExcelProperty("导入时间") + private String enterTime; + + /** + * 分发时间 + */ + @ExcelProperty("分发时间") + private String distributeTime; + + /** + * 是否违纪违法线索 + */ + @ExcelProperty("是否违纪违法线索") + private String isAgainstClue; + + /** + * 是否涉法涉诉线索 + */ + @ExcelProperty("是否涉法涉诉线索") + private String isAppealClue; + + /** + * 是否范围外线索 + */ + @ExcelProperty("是否范围外线索") + private String isOverroundClue; + + /** + * 是否无效线索 + */ + @ExcelProperty("是否无效线索") + private String isInvalidClue; + + /** + * 是否重点线索 + */ + @ExcelProperty("是否重点线索") + private String isImportantClue; + + /** + * 线索是否重复 + */ + @ExcelProperty("线索是否重复") + private String isRepeatClue; + + /** + * 重复线索组别 + */ + @ExcelProperty("重复线索组别") + private String repeatClueType; + + /** + * 线索是否进行了机筛 + */ + @ExcelProperty("线索是否进行了机筛") + private String isMachine; + + /** + * 机筛线索时间 + */ + @ExcelProperty("机筛线索时间") + private String machineTme; + + /** + * 线索是否经过人工筛查 + */ + @ExcelProperty("线索是否经过人工筛查") + private String isPerson; + + /** + * 人工筛查线索时间 + */ + @ExcelProperty("人工筛查线索时间") + private String personTime; + + /** + * 是否关注线索 + */ + @ExcelProperty("是否关注线索") + private String isCare; + + /** + * 关注时间 + */ + @ExcelProperty("关注时间") + private String careTime; + + /** + * 操作时间 + */ + @ExcelProperty("操作时间") + private String handleTime; + + private String departId; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDto.java b/src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDto.java new file mode 100644 index 0000000..1eb897c --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDto.java @@ -0,0 +1,89 @@ +package com.biutag.supervision.pojo.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class NegativeImportDto { + + // 问题发现时间 + @ExcelProperty("问题发现时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + + @ExcelProperty("问题发生时间") + @NotNull(message = "问题发生时间不能为空") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题来源 + @ExcelProperty("问题来源") + @NotBlank(message = "问题来源不能为空") + private String problemSources; + + private String problemSourcesCode; + + // 业务类别 + @NotBlank(message = "业务类别不能为空") + @ExcelProperty("业务类别") + private String businessTypeName; + + private String businessTypeCode; + + @ExcelProperty("涉及警种") + private String policeTypeName; + + private String policeType; + + // 涉嫌问题 + @ExcelProperty("涉嫌问题") + @NotBlank(message = "涉嫌问题不能为空") + private String involveProblemStr; + + // 涉嫌问题 + private List involveProblem = new ArrayList<>(); + + // 反映人姓名 + @ExcelProperty("投诉人") + private String responderName; + + // 联系电话 + @ExcelProperty("投诉人联系电话") + private String contactPhone; + + // 简要描述 + @ExcelProperty("具体问题内容") + @NotBlank(message = "具体问题内容不能为空") + private String thingDesc; + + @ExcelProperty("涉及单位") + private String involveDepartName; + + private String involveDepartId; + + // 涉及案件/警情编号 + @ExcelProperty("案件/警情编号") + @NotBlank(message = "案件/警情编号不能为空") + private String caseNumber; + + // 专项督察 + @ExcelProperty("专项督察") + private String specialSupervisionName; + + private String specialSupervision; + + // 通报期数 + @ExcelProperty("通报期数") + private String reportNumber; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeTask.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeTask.java index 66cba99..6458ba6 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/NegativeTask.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeTask.java @@ -80,4 +80,6 @@ public class NegativeTask { @TableField("category") private String category; + private String source; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RiskPersonInfo.java b/src/main/java/com/biutag/supervision/pojo/entity/RiskPersonInfo.java index 6d5f7c1..a105007 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/RiskPersonInfo.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/RiskPersonInfo.java @@ -1,13 +1,10 @@ package com.biutag.supervision.pojo.entity; -import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import lombok.Getter; import lombok.Setter; -import java.time.LocalDateTime; - @Setter @Getter public class RiskPersonInfo { diff --git a/src/main/java/com/biutag/supervision/pojo/param/RiskPersonalQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/RiskPersonalQueryParam.java index 614ff05..d5a8964 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/RiskPersonalQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/RiskPersonalQueryParam.java @@ -33,4 +33,8 @@ public class RiskPersonalQueryParam extends BasePage { // 年龄 private List ageTags = new ArrayList<>(); + private String controlDepartId; + + private List departIds = new ArrayList<>(); + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/NegativeHdjq.java b/src/main/java/com/biutag/supervision/pojo/vo/NegativeHdjq.java index af8fee9..2a466b6 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/NegativeHdjq.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/NegativeHdjq.java @@ -37,6 +37,12 @@ public class NegativeHdjq { // 涉及案件/警情编号 private String caseNumber; + // 核查情况 + private String checkStatusDesc; + + // 整改情况 + private String rectifyDesc; + // 通报期数 private String reportNumber; diff --git a/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java b/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java index 8d24795..2e3b4c3 100644 --- a/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java +++ b/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java @@ -1,24 +1,31 @@ package com.biutag.supervision.service; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.biutag.supervision.constants.enums.BusinessTypeEnum; +import com.biutag.supervision.common.UserContextHolder; import com.biutag.supervision.constants.enums.DistributionStateEnum; import com.biutag.supervision.constants.enums.HostLevelEnums; import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.mapper.DataPetition12337Mapper; -import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute; -import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute12337; +import com.biutag.supervision.pojo.dto.DataPetition12337Distribute; +import com.biutag.supervision.pojo.dto.DataPetition12337Dto; import com.biutag.supervision.pojo.dto.NegativeDto; -import com.biutag.supervision.pojo.entity.DataCaseVerif; import com.biutag.supervision.pojo.entity.DataPetition12337; -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.model.UserAuth; import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.List; /** * @author 舒云 @@ -28,7 +35,10 @@ import org.springframework.stereotype.Service; @Service @RequiredArgsConstructor public class DataPetition12337Service extends ServiceImpl { + private final NegativeService negativeService; + private final NegativeTaskService negativeTaskService; + private final SupDepartService departService; public Page page(DataPetitionComplaintQueryParam queryParam) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); @@ -56,48 +66,61 @@ public class DataPetition12337Service extends ServiceImpl { + @Transactional(rollbackFor = Exception.class) + public boolean distribution(DataPetition12337Distribute distributeData) { + List data = distributeData.getData(); + List list = data.stream().map(item -> { + DataPetition12337 dataPetition12337 = new DataPetition12337(); + BeanUtil.copyProperties(item, dataPetition12337); + dataPetition12337.setOnlyId(IdUtil.getSnowflakeNextIdStr()); + dataPetition12337.setDistributionState(DistributionStateEnum.DISTRIBUTED.getValue()); + return dataPetition12337; + }).toList(); + saveBatch(list); + NegativeTask negativeTask = new NegativeTask(); + negativeTask.setTaskName(distributeData.getTaskName()); + negativeTask.setImportRow(list.size()); + negativeTask.setCrtTime(LocalDateTime.now()); + negativeTask.setStatus("12337"); + UserAuth user = UserContextHolder.getCurrentUser(); + negativeTask.setCrtUser(user.getNickName()); + negativeTaskService.save(negativeTask); + data.forEach(item -> { NegativeDto negativeDto = new NegativeDto(); - negativeDto.setOriginId(item.getOnlyId()); - negativeDto.setDiscoveryTime(item.getDiscoverTime()); - negativeDto.setProblemSourcesCode("24"); - negativeDto.setProblemSources("12337信访"); -// negativeDto.setBusinessTypeCode(BusinessTypeEnum.ABWW); -// negativeDto.setBusinessTypeName(); - negativeDto.setResponderName(item.getName()); + negativeDto.setOriginId(item.getExternalId()); // 设置数据源id + if (item.getDiscoverTime() != null) { + negativeDto.setDiscoveryTime(item.getDiscoverTime().toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDateTime()); + } + negativeDto.setProblemSourcesCode(ProblemSourcesEnum.XF12337.getValue()); // 来源分类 + negativeDto.setProblemSources(ProblemSourcesEnum.XF12337.getLabel()); + negativeDto.setBusinessTypeCode(distributeData.getBusinessTypeCode()); + negativeDto.setBusinessTypeName(distributeData.getBusinessTypeName()); + negativeDto.setResponderName(item.getName()); // 投诉人 negativeDto.setContactPhone(item.getPhone()); negativeDto.setThingDesc(item.getWjwfProject()); - String departId; - String departName; - if (StrUtil.isBlank(item.getThirdDepartId())) { - departId = item.getSecondDepartId(); - departName = item.getSecondDepartName(); - } else { - departId = item.getThirdDepartId(); - departName = item.getThirdDepartName(); - } - negativeDto.setInvolveDepartId(departId); - negativeDto.setInvolveDepartName(departName); - negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); + negativeDto.setThingFiles(distributeData.getThingFiles()); + + SupDepart depart = departService.getById(item.getDepartId()); - negativeDto.setApprovalFlow(dataDistribute.getApprovalFlow()); - negativeDto.setDepartId(departId); - negativeDto.setDepartName(departName); - negativeDto.setTimeLimit(dataDistribute.getTimeLimit()); - negativeDto.setMaxSignDuration(dataDistribute.getMaxSignDuration()); - negativeDto.setMaxHandleDuration(dataDistribute.getMaxHandleDuration()); - negativeDto.setMaxExtensionDuration(dataDistribute.getMaxExtensionDuration()); - negativeDto.setCaseNumber(item.getOnlyId()); + negativeDto.setInvolveDepartId(item.getDepartId()); // 涉及单位 + negativeDto.setInvolveDepartName(depart.getShortName()); + negativeDto.setDepartId(item.getDepartId()); + negativeDto.setDepartName(depart.getShortName()); + + negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); + negativeDto.setApprovalFlow(distributeData.getApprovalFlow()); // 审批流程 + negativeDto.setTimeLimit(distributeData.getTimeLimit()); // 办理时限 + negativeDto.setMaxSignDuration(distributeData.getMaxSignDuration()); + negativeDto.setMaxHandleDuration(distributeData.getMaxHandleDuration()); + negativeDto.setMaxExtensionDuration(distributeData.getMaxExtensionDuration()); negativeService.save(negativeDto); - update(new LambdaUpdateWrapper().eq(DataPetition12337::getOnlyId, item.getOnlyId()) - .set(DataPetition12337::getDistributionState, DistributionStateEnum.DISTRIBUTED.getValue())); }); return true; } diff --git a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java index c7cc2b7..d88568c 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java @@ -22,6 +22,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -48,6 +49,18 @@ public class NegativeTaskService extends ServiceImpl pageByImport(NegativeTaskQueryParam param) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .eq(NegativeTask::getCategory, NegativeTaskCategoryEnum.IMPORT.getValue()) + .like(StrUtil.isNotBlank(param.getTaskName()), NegativeTask::getTaskName, param.getTaskName()) + .orderByDesc(NegativeTask::getCrtTime); + if (param.getCrtTime().size() == 2) { + queryWrapper.between(NegativeTask::getCrtTime, param.getCrtTime().get(0), param.getCrtTime().get(1)); + } + return page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + public NegativeTask save(Integer importRow) { NegativeTask task = new NegativeTask(); task.setId(IdUtil.simpleUUID()); diff --git a/src/main/resources/mapper/RiskPersonalMapper.xml b/src/main/resources/mapper/RiskPersonalMapper.xml index 03e0fba..e9a50c3 100644 --- a/src/main/resources/mapper/RiskPersonalMapper.xml +++ b/src/main/resources/mapper/RiskPersonalMapper.xml @@ -57,6 +57,12 @@ #{tag} + + AND p.control_depart_id in + + #{departId} + + order by p.risk_score desc diff --git a/src/main/resources/static/templates/问题标准模板.xlsx b/src/main/resources/static/templates/问题标准模板.xlsx new file mode 100644 index 0000000..dbb09ff Binary files /dev/null and b/src/main/resources/static/templates/问题标准模板.xlsx differ