diff --git a/src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ComplaintCollectionRepeatDTO.java b/src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ComplaintCollectionRepeatDTO.java new file mode 100644 index 0000000..ee8ac75 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ComplaintCollectionRepeatDTO.java @@ -0,0 +1,44 @@ +package com.biutag.supervision.pojo.dto.complaintCollection; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * @ClassName ComplaintCollectionPageDTO + * @Description 涉访涉诉查重DTO + * @Author shihao + * @Date 2025/12/25 15:35 + */ +@Getter +@Setter +@Schema(description = "涉访涉诉查重DTO") +public class ComplaintCollectionRepeatDTO { + + + @Schema(description = "来源类型") + private String sourceTable; + + @Schema(description = "案件编号") + private String originId; + + @Schema(description = "发现时间 / 受理时间") + private LocalDateTime discoveryTime; + + @Schema(description = "反映人姓名") + private String responderName; + + @Schema(description = "投诉人身份证") + private String responderIdCode; + + @Schema(description = "联系电话") + private String responderPhone; + + @Schema(description = "内容/正文") + private String thingDesc; + + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java index 0d9db53..5ad6e9a 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java @@ -79,6 +79,11 @@ public class ComplaintCollectionQueryParam extends BasePage { @Schema(description = "投诉人身份证号集合") private Set responderIdCodes; + + @Schema(description = "联系电话") + private String responderPhone; + + // @Schema(description = "部门ID集合") // private Set secondDepartIds; diff --git a/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java index cc2b53a..9783fb9 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java @@ -40,4 +40,10 @@ public class DataCaseVerifQueryParam extends BasePage { @Schema(description = "创建时间") private List createTime = new ArrayList<>(); + @Schema(description = "投诉人姓名") + private String responderName; + + @Schema(description = "投诉人电话") + private String responderPhone; + } diff --git a/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java index a5165c5..459ae89 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java @@ -44,6 +44,14 @@ public class DataPetitionComplaintQueryParam extends BasePage { @Schema(description = "被投诉三级机构单位集合") private Set thirdDepartIds; + @Schema(description = "投诉人电话") + private String responderPhone; + + @Schema(description = "投诉人姓名") + private String responderName; + + @Schema(description = "投诉人身份证") + private String responderIdCode; // 初重信访 diff --git a/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionMailRepeattRequest.java b/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionMailRepeattRequest.java index 0668644..2d3dab4 100644 --- a/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionMailRepeattRequest.java +++ b/src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionMailRepeattRequest.java @@ -22,16 +22,17 @@ public class ComplaintCollectionMailRepeattRequest implements ParamChecked { @Schema(description = "投诉人身份证号") private String responderIdCode; -// @Schema(description = "投诉人姓名") -// private String responderName; + @Schema(description = "投诉人姓名") + private String responderName; + + @Schema(description = "投诉人电话") + private String responderPhone; + @Override public void check() { - if (StrUtil.isBlank(responderIdCode)){ - throw new IllegalArgumentException("投诉人身份证不能为空"); - } - if (StrUtil.isNotBlank(responderIdCode) && !IdcardUtil.isValidCard(responderIdCode)){ - throw new IllegalArgumentException("请输入正确的身份证格式!"); + if (StrUtil.isAllBlank(responderIdCode, responderName, responderPhone)){ + throw new IllegalArgumentException("请至少填写一个查重信息(身份证、姓名、电话)"); } } } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/complaintCollection/ComplaintCollectionMailRepeattVo.java b/src/main/java/com/biutag/supervision/pojo/vo/complaintCollection/ComplaintCollectionMailRepeattVo.java index 4b78814..a180eb7 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/complaintCollection/ComplaintCollectionMailRepeattVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/complaintCollection/ComplaintCollectionMailRepeattVo.java @@ -1,6 +1,6 @@ package com.biutag.supervision.pojo.vo.complaintCollection; -import com.biutag.supervision.pojo.dto.complaintCollection.ComplaintCollectionPageDTO; +import com.biutag.supervision.pojo.dto.complaintCollection.ComplaintCollectionRepeatDTO; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; @@ -20,7 +20,7 @@ public class ComplaintCollectionMailRepeattVo { @Schema(description = "重复列表") - private List complaintCollectionPageDTOS; + private List complaintCollectionRepeatDTOS; } diff --git a/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java b/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java index f433871..701f91e 100644 --- a/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java +++ b/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java @@ -41,6 +41,7 @@ public class ComplaintCollectionResourceService extends BaseDAO { setBatchQuery(param.getOriginId(), param.getOriginIds(), queryWrapper, ComplaintCollection::getOriginId); queryWrapper.eq(StrUtil.isNotBlank(param.getSourceTable()), ComplaintCollection::getSourceTable, param.getSourceTable()); queryWrapper.eq(StrUtil.isNotBlank(param.getResponderName()), ComplaintCollection::getResponderName, param.getResponderName()); + queryWrapper.eq(StrUtil.isNotBlank(param.getResponderPhone()), ComplaintCollection::getResponderPhone, param.getResponderPhone()); if (queryWrapper.getExpression() == null || queryWrapper.getExpression().getSqlSegment().isEmpty()) { return Collections.emptyList(); } diff --git a/src/main/java/com/biutag/supervision/repository/dataCaseVerif/DataCaseVerifResourceService.java b/src/main/java/com/biutag/supervision/repository/dataCaseVerif/DataCaseVerifResourceService.java index 6e61e90..2b1a3b4 100644 --- a/src/main/java/com/biutag/supervision/repository/dataCaseVerif/DataCaseVerifResourceService.java +++ b/src/main/java/com/biutag/supervision/repository/dataCaseVerif/DataCaseVerifResourceService.java @@ -1,6 +1,7 @@ package com.biutag.supervision.repository.dataCaseVerif; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.biutag.supervision.mapper.DataCaseVerifMapper; import com.biutag.supervision.pojo.entity.DataCaseVerif; @@ -8,6 +9,9 @@ import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; import jakarta.annotation.Resource; import org.springframework.stereotype.Service; +import java.util.Collections; +import java.util.List; + /** * @ClassName DataCaseVerifResourceService * @Description 案件核查资源层 @@ -35,8 +39,19 @@ public class DataCaseVerifResourceService { - - + public List query(DataCaseVerifQueryParam param) { + if (param == null) { + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StrUtil.isNotBlank(param.getOriginId()), DataCaseVerif::getOriginId, param.getOriginId()); + wrapper.eq(StrUtil.isNotBlank(param.getResponderName()), DataCaseVerif::getResponderName, param.getResponderName()); + wrapper.eq(StrUtil.isNotBlank(param.getResponderPhone()), DataCaseVerif::getResponderPhone, param.getResponderPhone()); + if (wrapper.getExpression() == null || wrapper.getExpression().getSqlSegment().isEmpty()) { + return Collections.emptyList(); + } + return dataCaseVerifMapper.selectList(wrapper); + } } diff --git a/src/main/java/com/biutag/supervision/repository/dataPetitionComplaint/DataPetitionComplaintResourceService.java b/src/main/java/com/biutag/supervision/repository/dataPetitionComplaint/DataPetitionComplaintResourceService.java index 4dad110..a9a561d 100644 --- a/src/main/java/com/biutag/supervision/repository/dataPetitionComplaint/DataPetitionComplaintResourceService.java +++ b/src/main/java/com/biutag/supervision/repository/dataPetitionComplaint/DataPetitionComplaintResourceService.java @@ -11,6 +11,7 @@ import jakarta.annotation.Resource; import org.springframework.stereotype.Service; import java.util.Collections; +import java.util.Date; import java.util.List; /** @@ -29,10 +30,19 @@ public class DataPetitionComplaintResourceService { public List query(DataPetitionComplaintQueryParam param) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(StrUtil.isNotBlank(param.getOriginId()), DataPetitionComplaint::getOriginId, param.getOriginId()); - wrapper.between(ObjectUtil.isNotNull(param.getCreateTime()), DataPetitionComplaint::getCreateTime, param.getCreateTime().get(0), param.getCreateTime().get(1)); - wrapper.in(CollectionUtil.isNotEmpty(param.getSecondDepartIds()), DataPetitionComplaint::getSecondDepartId, param.getSecondDepartIds()); + List times = param.getCreateTime(); + if (CollectionUtil.isNotEmpty(times) && times.size() == 2) { + wrapper.between( + DataPetitionComplaint::getCreateTime, + times.get(0), + times.get(1) + ); + } wrapper.in(CollectionUtil.isNotEmpty(param.getSecondDepartIds()), DataPetitionComplaint::getSecondDepartId, param.getSecondDepartIds()); wrapper.in(CollectionUtil.isNotEmpty(param.getThirdDepartIds()), DataPetitionComplaint::getThirdDepartId, param.getThirdDepartIds()); wrapper.eq(StrUtil.isNotBlank(param.getProblemSourcesCode()), DataPetitionComplaint::getProblemSourcesCode, param.getProblemSourcesCode()); + wrapper.eq(StrUtil.isNotBlank(param.getResponderName()), DataPetitionComplaint::getResponderName, param.getResponderName()); + wrapper.eq(StrUtil.isNotBlank(param.getResponderPhone()), DataPetitionComplaint::getResponderPhone, param.getResponderPhone()); + wrapper.eq(StrUtil.isNotBlank(param.getResponderIdCode()), DataPetitionComplaint::getResponderIdCode, param.getResponderIdCode()); if (wrapper.getExpression() == null || wrapper.getExpression().getSqlSegment().isEmpty()) { return Collections.emptyList(); } diff --git a/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java b/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java index 7094c97..e0e3ed2 100644 --- a/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java @@ -15,12 +15,15 @@ import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.domain.Blame; import com.biutag.supervision.pojo.dto.NegativeDto; import com.biutag.supervision.pojo.dto.complaintCollection.ComplaintCollectionPageDTO; +import com.biutag.supervision.pojo.dto.complaintCollection.ComplaintCollectionRepeatDTO; import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.enums.supDict.SupDictEnum; import com.biutag.supervision.pojo.param.ComplaintCollection.ComplaintCollectionExistParam; import com.biutag.supervision.pojo.param.ComplaintCollection.ComplaintCollectionQueryParam; import com.biutag.supervision.pojo.param.ComplaintCollection.ComplaintCollectionUpdateParam; +import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; +import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; import com.biutag.supervision.pojo.param.SupDepartQueryParam; import com.biutag.supervision.pojo.param.SupPoliceQueryParam; import com.biutag.supervision.pojo.param.complaintCollectionBlame.ComplaintCollectionBlameQueryParam; @@ -35,6 +38,8 @@ import com.biutag.supervision.repository.complaintCollection.ComplaintCollection import com.biutag.supervision.repository.complaintCollectionBlame.ComplaintCollectionBlameResourceService; import com.biutag.supervision.repository.complaintCollectionCheckFile.ComplaintCollectionCheckFileResourceService; import com.biutag.supervision.repository.complaintCollectionFile.ComplaintCollectionFileResourceService; +import com.biutag.supervision.repository.dataCaseVerif.DataCaseVerifResourceService; +import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService; import com.biutag.supervision.repository.supPolice.SupPoliceResourceService; import com.biutag.supervision.repository.supdepart.SupDepartResourceService; import com.biutag.supervision.service.*; @@ -50,6 +55,7 @@ import java.time.LocalDateTime; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * @ClassName ComplaintCollectionServiceImpl @@ -75,7 +81,8 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic private final SupPoliceResourceService supPoliceResourceService; private final ComplaintCollectionFileResourceService complaintCollectionFileResourceService; private final ComplaintCollectionCheckFileResourceService complaintCollectionCheckFileResourceService; - private final NegativeFileService negativeFileService; + private final DataPetitionComplaintResourceService dataPetitionComplaintResourceService; + private final DataCaseVerifResourceService dataCaseVerifResourceService; @Override @Transactional(rollbackFor = Exception.class) @@ -115,7 +122,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic throw new RuntimeException("目标信息状态不可删除"); } boolean deleted = complaintCollectionResourceService.deleteById(request.getId()); - if (!deleted){ + if (!deleted) { throw new RuntimeException("删除失败"); } return Result.success(true); @@ -166,7 +173,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic Set ids = complaintCollectionPageDTOS.stream().map(ComplaintCollectionPageDTO::getId).collect(Collectors.toSet()); ComplaintCollectionFileQueryParam complaintCollectionFileQueryParam = new ComplaintCollectionFileQueryParam(); complaintCollectionFileQueryParam.setComplaintIds(ids); - Map> complaintCollectionFileMap= complaintCollectionFileResourceService.queryGroupBy(complaintCollectionFileQueryParam, ComplaintCollectionFile::getComplaintId); + Map> complaintCollectionFileMap = complaintCollectionFileResourceService.queryGroupBy(complaintCollectionFileQueryParam, ComplaintCollectionFile::getComplaintId); if (CollectionUtil.isNotEmpty(complaintCollectionPageDTOS)) { Map dictLabelMap = buildDictLabelMap(SupDictEnum.SUSPECT_PROBLEM.getCode()); Map sfssDictLabelMap = buildDictLabelMap(SupDictEnum.SFSS_SOURCE_TABLE.getCode()); @@ -404,24 +411,25 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic @Override public Result maileRepeatt(ComplaintCollectionMailRepeattRequest request) { - ComplaintCollectionQueryParam complaintCollectionQueryParam = new ComplaintCollectionQueryParam(); - complaintCollectionQueryParam.setResponderIdCode(request.getResponderIdCode()); - List complaintCollections = complaintCollectionResourceService.query(complaintCollectionQueryParam); - List dtos = ComplaintCollectionTransfer.INSTANCE.entityToPageDTOList(complaintCollections); - if (CollectionUtil.isNotEmpty(dtos)) { - Map dictLabelMap = buildDictLabelMap(SupDictEnum.SUSPECT_PROBLEM.getCode()); - Map sfssDictLabelMap = buildDictLabelMap(SupDictEnum.SFSS_SOURCE_TABLE.getCode()); - dtos.forEach(one -> { - // 涉嫌问题拼接 - one.setInvolveProblemStr(CodeTranslateUtil.translateCodesToLabels(one.getInvolveProblem(), dictLabelMap)); - // 来源 - String sourceTable = CodeTranslateUtil.translateCodesToLabels(one.getSourceTable(), sfssDictLabelMap); - String sourceTableSubOne = CodeTranslateUtil.translateCodesToLabels(one.getSourceTableSubOne(), sfssDictLabelMap); - one.setSourceTablePath(sourceTable + "/" + sourceTableSubOne); - }); - } + List sfssList = buildSfss(request); + List xfsjList = buildXfsj(request); + List ajhcList = buildAjhc(request); + List complaintCollectionRepeatDTOS = Stream.of(sfssList, xfsjList, ajhcList) + .flatMap(Collection::stream) + .filter(dto -> + StrUtil.isNotBlank(dto.getResponderIdCode()) + && StrUtil.isNotBlank(dto.getOriginId()) + ) + .collect(Collectors.toMap( + dto -> dto.getResponderIdCode() + "_" + dto.getOriginId(), + Function.identity(), + (oldVal, newVal) -> oldVal + )) + .values() + .stream() + .toList(); ComplaintCollectionMailRepeattVo complaintCollectionMailRepeattVo = new ComplaintCollectionMailRepeattVo(); - complaintCollectionMailRepeattVo.setComplaintCollectionPageDTOS(dtos); + complaintCollectionMailRepeattVo.setComplaintCollectionRepeatDTOS(complaintCollectionRepeatDTOS); return Result.success(complaintCollectionMailRepeattVo); } @@ -553,6 +561,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic /** * 保存附件 + * * @param complaintId * @param thingFiles */ @@ -579,4 +588,60 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic } + private List buildSfss( + ComplaintCollectionMailRepeattRequest request) { + ComplaintCollectionQueryParam param = new ComplaintCollectionQueryParam(); + param.setResponderIdCode(request.getResponderIdCode()); + param.setResponderName(request.getResponderName()); + param.setResponderPhone(request.getResponderPhone()); + Map sourceDict = buildDictLabelMap(SupDictEnum.SFSS_SOURCE_TABLE.getCode()); + return complaintCollectionResourceService.query(param) + .stream() + .map(item -> { + ComplaintCollectionRepeatDTO dto = new ComplaintCollectionRepeatDTO(); + BeanUtil.copyProperties(item, dto); + dto.setSourceTable(CodeTranslateUtil.translateCodesToLabels(item.getSourceTable(), sourceDict)); + return dto; + }) + .toList(); + } + + private List buildXfsj( + ComplaintCollectionMailRepeattRequest request) { + DataPetitionComplaintQueryParam param = new DataPetitionComplaintQueryParam(); + param.setResponderIdCode(request.getResponderIdCode()); + param.setResponderName(request.getResponderName()); + param.setResponderPhone(request.getResponderPhone()); + return dataPetitionComplaintResourceService.query(param) + .stream() + .map(item -> { + ComplaintCollectionRepeatDTO dto = new ComplaintCollectionRepeatDTO(); + BeanUtil.copyProperties(item, dto); + String sourceTable = + ProblemSourcesEnum.GJXFPT.getValue() + .equals(item.getProblemSourcesCode()) + ? ProblemSourcesEnum.GJXFPT.getLabel() + : ProblemSourcesEnum.GABXF.getLabel(); + dto.setSourceTable(sourceTable); + return dto; + }) + .toList(); + } + + private List buildAjhc( + ComplaintCollectionMailRepeattRequest request) { + DataCaseVerifQueryParam param = new DataCaseVerifQueryParam(); + param.setResponderName(request.getResponderName()); + param.setResponderPhone(request.getResponderPhone()); + return dataCaseVerifResourceService.query(param) + .stream() + .map(item -> { + ComplaintCollectionRepeatDTO dto = new ComplaintCollectionRepeatDTO(); + BeanUtil.copyProperties(item, dto); + dto.setSourceTable(ProblemSourcesEnum.A12389.getLabel()); + return dto; + }) + .toList(); + } + }