Browse Source

feat:投诉举报变为附表,主表位negative

feature/tsjb-1.0
parent
commit
907cbd6f91
  1. 4
      src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java
  2. 3
      src/main/java/com/biutag/supervision/mapper/ComplaintCollectionMapper.java
  3. 9
      src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ComplaintCollectionPageDTO.java
  4. 81
      src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ExportComplaintCollectionBlameVo.java
  5. 93
      src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ExportComplaintCollectionExcelVo.java
  6. 2
      src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java
  7. 4
      src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionUpdateParam.java
  8. 3
      src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java
  9. 66
      src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java
  10. 410
      src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java
  11. 8
      src/main/resources/application-prod.yml
  12. 219
      src/main/resources/mapper/ComplaintCollectionMapper.xml

4
src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java

@ -11,6 +11,7 @@ import com.biutag.supervision.constants.enums.*;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.VerifyData;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.enums.negative.NegativeSourceTypeEnum;
import com.biutag.supervision.pojo.param.ComplaintCollection.ComplaintCollectionQueryParam;
import com.biutag.supervision.pojo.param.ComplaintCollection.ComplaintCollectionUpdateParam;
import com.biutag.supervision.repository.complaintCollection.ComplaintCollectionResourceService;
@ -307,6 +308,9 @@ public class ApplyCompletionAction implements Action {
complaintCollectionQueryParam.setOriginId(negative.getOriginId());
List<ComplaintCollection> complaintCollections = complaintCollectionResourceService.query(complaintCollectionQueryParam);
if (CollectionUtil.isEmpty(complaintCollections)) {
if (NegativeSourceTypeEnum.COMPLAINT_REPORT.getCode().equals(negative.getSourceType())) {
throw new IllegalArgumentException("请联系后台管理员,问题来自投诉举报,但没有对应关联!");
}
return;
}
if (CollectionUtil.size(complaintCollections) > 1) {

3
src/main/java/com/biutag/supervision/mapper/ComplaintCollectionMapper.java

@ -14,9 +14,6 @@ public interface ComplaintCollectionMapper extends HBaseMapper<ComplaintCollecti
int insertBatch(List<ComplaintCollection> list);
IPage<ComplaintCollection> selectPageWithConditions(Page<ComplaintCollection> page, @Param("param") ComplaintCollectionQueryParam param);
IPage<ComplaintCollectionPageDTO> selectPageWithNegative(Page<ComplaintCollection> page, @Param("param") ComplaintCollectionQueryParam param);
}

9
src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ComplaintCollectionPageDTO.java

@ -162,7 +162,7 @@ public class ComplaintCollectionPageDTO {
@Schema(description = "办结时间")
private LocalDateTime completedTime;
@Schema(description = "责任单位")
@Schema(description = "涉及单位")
private String involveDepartName;
@Schema(description = "接访领导姓名")
@ -206,8 +206,8 @@ public class ComplaintCollectionPageDTO {
private String crxState;
/* ---- MAILBOX/三表统一补充 ---- */
@Schema(description = "核查情况")
private String checkStatus;
@Schema(description = "核查结论代码")
private String checkStatusCode;
@Schema(description = "核查情况名称")
private String checkStatusName;
@ -266,9 +266,6 @@ public class ComplaintCollectionPageDTO {
@Schema(description = "群众认可")
private String publicRecognition;
@Schema(description = "状态,显示用,暂无实际意义")
private String status;
@Schema(description = "附件列表")
private List<FileVo> thingFiles = new ArrayList<>();

81
src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ExportComplaintCollectionBlameVo.java

@ -0,0 +1,81 @@
package com.biutag.supervision.pojo.dto.complaintCollection;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
public class ExportComplaintCollectionBlameVo {
@ExcelProperty("关联负面清单ID")
private String negativeId;
@ExcelProperty("信件编号")
private String originId;
@ExcelProperty(value = "发现/受理时间", format = "yyyy-MM-dd HH:mm")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime discoveryTime;
@ExcelProperty("来源")
private String sourceTablePath;
@ExcelProperty("业务类别")
private String businessTypeName;
@ExcelProperty("涉嫌问题")
private String involveProblemStr;
@ExcelProperty("简要描述")
private String thingDesc;
@ExcelProperty("涉及单位(二级)")
private String secondDepartName;
@ExcelProperty("涉及单位(三级)")
private String thirdDepartName;
@ExcelProperty("核查结论")
private String checkStatusName;
@ExcelProperty("追责对象")
private String accountabilityTarget;
@ExcelProperty("涉及人员姓名")
private String blameName;
@ExcelProperty("警号")
private String blameEmpNo;
@ExcelProperty("身份证")
private String blameIdCode;
@ExcelProperty("人员属性")
private String ivPersonType;
@ExcelProperty("责任追责")
private String handleResultName;
@ExcelProperty("责任领导姓名")
private String leadName;
@ExcelProperty("责任领导警号")
private String leadEmpNo;
@ExcelProperty("责任领导身份证")
private String leadIdCode;
@ExcelProperty("责任领导责任追责")
private String leadHandleResultName;
@ExcelProperty("问题类型")
private String problemType;
@ExcelProperty("督察措施")
private String superviseMeasuresName;
}

93
src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ExportComplaintCollectionExcelVo.java

@ -0,0 +1,93 @@
package com.biutag.supervision.pojo.dto.complaintCollection;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
public class ExportComplaintCollectionExcelVo {
@ExcelProperty("关联负面清单ID")
private String negativeId;
@ExcelProperty("信件编号")
private String originId;
@ExcelProperty("来源")
private String sourceTablePath;
@ExcelProperty(value = "发现/受理时间", format = "yyyy-MM-dd HH:mm")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime discoveryTime;
@ExcelProperty("业务类别")
private String businessTypeName;
@ExcelProperty("涉嫌问题")
private String involveProblemStr;
@ExcelProperty("简要描述")
private String thingDesc;
@ExcelProperty("投诉反映人")
private String responderName;
@ExcelProperty("联系电话")
private String responderPhone;
@ExcelProperty("涉及警种")
private String policeTypeName;
@ExcelProperty("办理单位(二级)")
private String secondDepartName;
@ExcelProperty("办理单位(三级)")
private String thirdDepartName;
@ExcelProperty("涉及单位")
private String involveDepartName;
@ExcelProperty("核查结论")
private String checkStatusName;
// @ExcelProperty("追责对象")
// private String accountabilityTarget;
// @ExcelProperty("涉及人数")
// private Integer blameNumber;
@ExcelProperty("涉及人员")
private String blameStr;
// @ExcelProperty("责任追责")
// private String handleResultName;
// @ExcelProperty("是否追责")
// private String isHoldAccountable;
// @ExcelProperty("问题类型")
// private String problemTypeList;
@ExcelProperty("办理状态")
private String processingStatus;
@ExcelProperty("办结情况")
private String completionStatus;
@ExcelProperty("群众认可")
private String publicRecognition;
@ExcelProperty("办理方式")
private String handleMethod;
@ExcelProperty("是否重复件")
private String repeatt;
@ExcelProperty("标签")
private String tag;
}

2
src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java

@ -103,7 +103,7 @@ public class ComplaintCollectionQueryParam extends BasePage {
private String status;
@Schema(description = "信件状态(局)")
private String processingStatus;
private Set<String> processingStatus;
@Schema(description = "核查情况")
private String checkStatus;

4
src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionUpdateParam.java

@ -72,8 +72,8 @@ public class ComplaintCollectionUpdateParam {
@Schema(description = "是否领导审批")
private String leadApproval;
@Schema(description = "标签")
private String tag;
// @Schema(description = "标签")
// private String tag;
/**
* @see ComplaintCollectionHandleMethodEnum

3
src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java

@ -71,9 +71,10 @@ public class ComplaintCollectionPageRequest extends BasePage implements ParamChe
private Set<String> tags;
@Schema(description = "信件状态(局)")
private String processingStatus;
private Set<String> processingStatus;
@Schema(description = "状态")
@Deprecated
private String status;
@Schema(description = "核查情况")

66
src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java

@ -53,72 +53,6 @@ public class ComplaintCollectionResourceService extends BaseDAO {
return complaintCollectionMapper.selectList(queryWrapper);
}
public IPage<ComplaintCollection> pageQuery(ComplaintCollectionQueryParam param) {
// 构建分页对象
Page<ComplaintCollection> page = new Page<>(param.getCurrent(), param.getSize());
LambdaQueryWrapper<ComplaintCollection> qw = new LambdaQueryWrapper<>();
setBatchQuery(param.getSourceTable(), param.getSourceTableList(), qw, ComplaintCollection::getSourceTable);
setBatchQuery(param.getSourceTableSubOne(), param.getSourceTableSubOneList(), qw, ComplaintCollection::getSourceTableSubOne);
setBatchLikeQuery(param.getOriginId(), param.getOriginIds(), qw, ComplaintCollection::getOriginId);
setBatchLikeQuery(param.getCheckStatus(), param.getCheckStatusList(),qw, ComplaintCollection::getCheckStatus);
setBatchQuery(param.getSecondDepartId(), param.getSecondDepartIds(), qw, ComplaintCollection::getSecondDepartId);
setBatchQuery(param.getThirdDepartId(), param.getThirdDepartIds(), qw, ComplaintCollection::getThirdDepartId);
if (CollectionUtil.size(param.getDiscoveryTimeList()) == 2
&& param.getDiscoveryTimeList().get(0) != null
&& param.getDiscoveryTimeList().get(1) != null) {
qw.between(ComplaintCollection::getDiscoveryTime, param.getDiscoveryTimeList().get(0), param.getDiscoveryTimeList().get(1));
}
if (CollectionUtil.size(param.getCreateTimeList()) == 2){
qw.between(ComplaintCollection::getCreateTime, param.getCreateTimeList().get(0), param.getCreateTimeList().get(1));
}
// 来件人信息
if (StrUtil.isNotBlank(param.getPersonInfo())) {
String kw = param.getPersonInfo();
qw.and(w -> w.like(ComplaintCollection::getResponderName, kw).or().like(ComplaintCollection::getResponderPhone, kw).or().like(ComplaintCollection::getResponderIdCode, kw));
}
qw.eq(StrUtil.isNotBlank(param.getHandleMethod()), ComplaintCollection::getHandleMethod, param.getHandleMethod());
qw.like(StrUtil.isNotBlank(param.getThingDesc()), ComplaintCollection::getThingDesc, param.getThingDesc());
qw.eq(StrUtil.isNotBlank(param.getRepeatt()), ComplaintCollection::getRepeatt, param.getRepeatt());
qw.eq(StrUtil.isNotBlank(param.getLeadApproval()), ComplaintCollection::getLeadApproval, param.getLeadApproval());
qw.eq(StrUtil.isNotBlank(param.getProcessingStatus()), ComplaintCollection::getProcessingStatus, param.getProcessingStatus());
qw.eq(StrUtil.isNotBlank(param.getStatus()), ComplaintCollection::getStatus, param.getStatus());
qw.in(CollectionUtil.isNotEmpty(param.getInitialReviewFileList()), ComplaintCollection::getGwf3, param.getInitialReviewFileList());
// 来件内容
// 标签(表里如果是逗号字符串 tag="URGENT,NORMAL")
// 语义:命中任意一个标签即可(OR)
if (CollectionUtil.isNotEmpty(param.getTags())) {
qw.and(w -> {
boolean first = true;
for (String t : param.getTags()) {
if (StrUtil.isBlank(t)) continue;
if (first) {
w.apply("FIND_IN_SET({0}, tag)", t);
first = false;
} else {
w.or().apply("FIND_IN_SET({0}, tag)", t);
}
}
});
}
List<String> ids = param.getInvolveProblemIdList();
if (CollectionUtil.isNotEmpty(ids)) {
qw.and(w -> {
ids.forEach(id ->
w.or().apply("FIND_IN_SET({0}, involve_problem)", id)
);
});
}
// 排序
qw.orderByDesc(ComplaintCollection::getDiscoveryTime).orderByDesc(ComplaintCollection::getId);
return complaintCollectionMapper.selectPage(page, qw);
}
public List<ComplaintCollection> pageList(ComplaintCollectionQueryParam param) {
return pageQuery(param).getRecords();
}
public Boolean createComplaintCollection(List<ComplaintCollection> complaintCollectionList) {
innerBatchInsert(complaintCollectionMapper, complaintCollectionList, "添加失败!");
return Boolean.TRUE;

410
src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java

@ -17,18 +17,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.BlameType;
import com.biutag.supervision.constants.enums.InspectCaseEnum;
import com.biutag.supervision.constants.enums.ProblemSourcesEnum;
import com.biutag.supervision.constants.enums.ProcessingStatusEnum;
import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.mapper.ComplaintCollectionMapper;
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.ComplaintCollectionExcelDTO;
import com.biutag.supervision.pojo.dto.complaintCollection.ComplaintCollectionPageDTO;
import com.biutag.supervision.pojo.dto.complaintCollection.ComplaintCollectionPersonExcelDTO;
import com.biutag.supervision.pojo.dto.complaintCollection.ComplaintCollectionRepeatDTO;
import com.biutag.supervision.pojo.dto.complaintCollection.*;
import com.biutag.supervision.pojo.dto.flow.VerifyData;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.enums.complaintCollection.*;
@ -49,7 +46,6 @@ import com.biutag.supervision.pojo.request.complaintCollection.*;
import com.biutag.supervision.pojo.transfer.ComplaintCollectionTransfer;
import com.biutag.supervision.pojo.vo.FileVo;
import com.biutag.supervision.pojo.vo.complaintCollection.ComplaintCollectionDetailVo;
import com.biutag.supervision.pojo.vo.complaintCollection.ComplaintCollectionHandlerDataVo;
import com.biutag.supervision.pojo.vo.complaintCollection.ComplaintCollectionMailRepeattVo;
import com.biutag.supervision.pojo.vo.complaintCollection.ComplaintCollectionWatchDetailVO;
import com.biutag.supervision.repository.complaintCollection.ComplaintCollectionResourceService;
@ -134,10 +130,22 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
if (CollectionUtil.isEmpty(supDepartList) || supDepartList.get(0).getLevel()!=2){
throw new IllegalStateException("请选择正确的二级机构");
}
ComplaintCollection complaintCollection = ComplaintCollectionTransfer.INSTANCE.addRequestToEntity(request);
// 手动创建 ComplaintCollection,只设置特有字段
ComplaintCollection complaintCollection = new ComplaintCollection();
complaintCollection.setSourceTable(request.getSourceTable());
complaintCollection.setSourceTableSubOne(request.getSourceTableSubOne());
complaintCollection.setResponderIdCode(request.getResponderIdCode());
complaintCollection.setRepeatt(request.getRepeatt());
complaintCollection.setLeadApproval(request.getLeadApproval());
complaintCollection.setTag(request.getTag());
complaintCollection.setHandleMethod(request.getHandleMethod());
complaintCollection.setSecondDepartId(request.getSecondDepartId());
complaintCollection.setSecondDepartName(request.getSecondDepartName());
// 生成编号
if (StrUtil.isBlank(complaintCollection.getOriginId())) {
if (StrUtil.isBlank(request.getOriginId())) {
complaintCollection.setOriginId(SfssUtil.generateIdWithPrefix(request.getSourceTable()));
}else {
complaintCollection.setOriginId(request.getOriginId());
}
complaintCollection.setCreateTime(LocalDateTime.now());
complaintCollection.setCreateBy(UserContextHolder.getCurrentUser().getUserName());
@ -150,7 +158,6 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
// 创建主信息
Boolean res = complaintCollectionResourceService.createComplaintCollection(Arrays.asList(complaintCollection));
Assert.notNull(complaintCollection.getId(), "主表插入后未获取到ID");
saveThingFilesOrThrow(complaintCollection.getId(), request.getThingFiles());
return Result.success(res);
}
@ -165,8 +172,13 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
if (CollectionUtil.isEmpty(query)) {
throw new IllegalStateException("未找到可删除信息" + request.getId());
}
if (!"0".equals(query.get(0).getStatus())) {
throw new IllegalStateException("目标信息状态不可删除" + request.getId());
// 通过 negative 的 processingStatus 判断是否可删除
String negativeId = query.get(0).getNegativeId();
if (StrUtil.isNotBlank(negativeId)) {
Negative negative = negativeService.getById(negativeId);
if (negative != null && "completed".equals(negative.getProcessingStatus())) {
throw new IllegalStateException("目标办理状态不可删除" + request.getId());
}
}
// 鉴权
checkDeletePermission(query.get(0));
@ -204,27 +216,27 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
if (CollectionUtil.isEmpty(supDepartList) || supDepartList.get(0).getLevel()!=2){
throw new IllegalStateException("请选择正确的二级机构");
}
ComplaintCollectionUpdateParam updateParam = ComplaintCollectionTransfer.INSTANCE.updateRequestToParam(request);
// 处理 involve_problem + tag
String involveProblem = CodeTranslateUtil.joinDistinct(request.getInvolveProblemIdList());
if (StrUtil.isNotBlank(involveProblem)) {
updateParam.setInvolveProblem(involveProblem);
}
String tag = CodeTranslateUtil.joinDistinct(request.getTags());
if (StrUtil.isNotBlank(tag)) {
updateParam.setTag(tag);
}
// 4) 必填:id + 更新信息
// 手动创建 ComplaintCollectionUpdateParam,只设置特有字段
ComplaintCollectionUpdateParam updateParam = new ComplaintCollectionUpdateParam();
updateParam.setId(request.getId());
updateParam.setUpdateTime(LocalDateTime.now());
updateParam.setUpdateBy(UserContextHolder.getCurrentUser().getUserName());
// 特有字段
updateParam.setSourceTable(request.getSourceTable());
updateParam.setSourceTableSubOne(request.getSourceTableSubOne());
updateParam.setResponderIdCode(request.getResponderIdCode());
updateParam.setRepeatt(request.getRepeatt());
updateParam.setLeadApproval(request.getLeadApproval());
// tag 处理
updateParam.setTags(request.getTags());
updateParam.setHandleMethod(request.getHandleMethod());
updateParam.setSecondDepartId(request.getSecondDepartId());
updateParam.setSecondDepartName(request.getSecondDepartName());
// 5) 更新(只更新非空字段)
boolean ok = complaintCollectionResourceService.updateSelectiveById(updateParam);
if (!ok) {
throw new RuntimeException("修改失败");
}
// complaintCollectionFileResourceService.delByComplaintCollectionId(id);
// saveThingFilesOrThrow(id, request.getThingFiles());
NegativeDto negativeDto = new NegativeDto();
negativeDto.setId(request.getNegativeId());
negativeDto.setBusinessTypeCode(request.getBusinessTypeCode());
@ -241,6 +253,9 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
negativeDto.setProblemSourcesCode(request.getSourceTable());
negativeDto.setProblemSources(sourceDict.get(request.getSourceTable()));
}
// 通用字段
negativeDto.setResponderName(request.getResponderName());
negativeDto.setContactPhone(request.getResponderPhone());
negativeService.updateNegative(negativeDto);
return Result.success(true);
@ -432,44 +447,197 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
return Result.success(complaintCollectionMailRepeattVo);
}
@Override
/**
* 导出涉访涉诉台账新版本3个Sheet台账 + 个人涉及 + 单位涉及
*/
public void exportData(ComplaintCollectionPageRequest request, HttpServletResponse response) {
request.setSize(10000);
request.setCurrent(1);
// 涉访涉诉台账
List<ComplaintCollectionPageDTO> complaintCollectionPageDTOS = getComplaintCollectionPageNew(request).getRecords();
List<ComplaintCollectionExcelDTO> dataList = this.buildComplaintCollectionExcelDTO(complaintCollectionPageDTOS);
if (dataList.size() > 10000) {
// 1. 查分页数据
List<ComplaintCollectionPageDTO> pageDTOList = getComplaintCollectionPageNew(request).getRecords();
// 2. 过滤有 negativeId 的数据
Map<String, ComplaintCollectionPageDTO> pageDtoMap = pageDTOList.stream()
.filter(dto -> StrUtil.isNotBlank(dto.getNegativeId()))
.collect(Collectors.toMap(
ComplaintCollectionPageDTO::getNegativeId,
Function.identity(),
(a, b) -> a));
List<String> negativeIds = new ArrayList<>(pageDtoMap.keySet());
// 3. 查 negative_blame
List<NegativeBlame> negativeBlames = negativeBlameService.listByNegativeIds(new HashSet<>(negativeIds));
// 4. 查问题关系表
List<NegativeProblemRelation> negativeProblemRelations =
negativeProblemRelationService.list(new LambdaQueryWrapper<NegativeProblemRelation>()
.in(NegativeProblemRelation::getNegativeId, negativeIds));
// 5. negativeBlame 按 negativeId 分组
Map<String, List<NegativeBlame>> negativeBlameMap = negativeBlames.stream()
.filter(b -> StrUtil.isNotBlank(b.getNegativeId()))
.collect(Collectors.groupingBy(NegativeBlame::getNegativeId, Collectors.toList()));
// 6. 构建 Sheet1 数据
List<ExportComplaintCollectionExcelVo> sheet1List = new ArrayList<>();
for (ComplaintCollectionPageDTO dto : pageDTOList) {
ExportComplaintCollectionExcelVo vo = new ExportComplaintCollectionExcelVo();
vo.setNegativeId(dto.getNegativeId());
vo.setOriginId(dto.getOriginId());
vo.setSourceTablePath(dto.getSourceTablePath());
vo.setDiscoveryTime(dto.getDiscoveryTime());
vo.setBusinessTypeName(dto.getBusinessTypeName());
vo.setInvolveProblemStr(dto.getInvolveProblemStr());
vo.setThingDesc(dto.getThingDesc());
vo.setResponderName(dto.getResponderName());
vo.setResponderPhone(dto.getResponderPhone());
vo.setPoliceTypeName(dto.getPoliceTypeName());
vo.setSecondDepartName(dto.getSecondDepartName());
vo.setThirdDepartName(dto.getThirdDepartName());
vo.setInvolveDepartName(dto.getInvolveDepartName());
vo.setProcessingStatus(ProcessingStatusEnum.getLabel(dto.getProcessingStatus()));
// 枚举值转换
vo.setCompletionStatus(ComplaintCollectionClosingStatusEnum.getDescByCode(dto.getCompletionStatus()));
vo.setPublicRecognition(ComplaintCollectionPublicApprovalEnum.getDescByCode(dto.getPublicRecognition()));
vo.setHandleMethod(ComplaintCollectionHandleMethodEnum.getDescByCode(dto.getHandleMethod()));
vo.setRepeatt("1".equals(dto.getRepeatt()) ? "是" : "否");
vo.setTag(dto.getTag());
vo.setCheckStatusName(dto.getCheckStatusName());
// vo.setAccountabilityTarget(dto.getAccountabilityTarget());
List<NegativeBlame> blames = negativeBlameMap.getOrDefault(dto.getNegativeId(), Collections.emptyList());
// vo.setBlameNumber(blames.size());
// 涉及人员汇总
String blameStr = blames.stream()
.filter(b -> StrUtil.isNotBlank(b.getBlameName()))
.map(b -> String.format("(%s)%s-%s",
"personal".equals(b.getType()) ? "个人" : "单位",
b.getBlameName(),
StrUtil.isNotBlank(b.getBlameEmpNo()) ? b.getBlameEmpNo() : ""))
.collect(Collectors.joining("、"));
vo.setBlameStr(blameStr);
// 责任追责汇总
// vo.setHandleResultName(blames.stream()
// .map(NegativeBlame::getHandleResultName)
// .filter(StrUtil::isNotBlank)
// .collect(Collectors.joining("、")));
//
// // 是否追责
// if (InspectCaseEnum.isItTure(dto.getCheckStatusCode())) {
// if (blames.stream().allMatch(b -> StrUtil.isBlank(b.getHandleResultName()) || b.getHandleResultName().contains("不予追责"))) {
// vo.setIsHoldAccountable("否");
// } else {
// vo.setIsHoldAccountable("是");
// }
// }
// 问题类型
// String problemTypeList = blames.stream()
// .filter(b -> StrUtil.isNotBlank(b.getBlameId()))
// .flatMap(b -> negativeProblemRelations.stream()
// .filter(p -> b.getBlameId().equals(p.getBlameId()) && StrUtil.isNotBlank(p.getOneLevelContent()))
// .map(p -> {
// if ("其他".equals(p.getThreeLevelContent())) {
// return String.format("%s / %s / %s(%s)",
// p.getOneLevelContent(), p.getTwoLevelContent(),
// p.getThreeLevelContent(), p.getThreeLevelContentOther());
// }
// return String.format("%s / %s / %s",
// p.getOneLevelContent(), p.getTwoLevelContent(), p.getThreeLevelContent());
// }))
// .collect(Collectors.joining("、"));
// vo.setProblemTypeList(problemTypeList);
sheet1List.add(vo);
}
if (sheet1List.size() > 10000) {
throw new RuntimeException("导出数据量过大,请缩小筛选范围");
}
// 涉访涉诉涉及人数据
ComplaintCollectionBlameQueryParam complaintCollectionBlameQueryParam = new ComplaintCollectionBlameQueryParam();
Set<String> complaintCollectionIds = complaintCollectionPageDTOS.stream().map(ComplaintCollectionPageDTO::getId).collect(Collectors.toSet());
complaintCollectionBlameQueryParam.setComplaintIds(complaintCollectionIds);
List<ComplaintCollectionBlame> blameList = complaintCollectionBlameResourceService.query(complaintCollectionBlameQueryParam);
List<NegativeBlame> negativeBlames = negativeBlameService.listByNegativeIds(complaintCollectionIds);
List<ComplaintCollectionPersonExcelDTO> personList = this.buildComplaintCollectionPersonExcelDTO(blameList, negativeBlames, complaintCollectionPageDTOS);
// 7. 构建 Sheet2/Sheet3 数据(个人涉及 + 单位涉及)
List<ExportComplaintCollectionBlameVo> personalList = new ArrayList<>();
List<ExportComplaintCollectionBlameVo> departList = new ArrayList<>();
for (Map.Entry<String, List<NegativeBlame>> entry : negativeBlameMap.entrySet()) {
String negativeId = entry.getKey();
ComplaintCollectionPageDTO dto = pageDtoMap.get(negativeId);
if (dto == null) continue;
for (NegativeBlame blame : entry.getValue()) {
ExportComplaintCollectionBlameVo vo = new ExportComplaintCollectionBlameVo();
vo.setNegativeId(negativeId);
vo.setOriginId(dto.getOriginId());
vo.setDiscoveryTime(dto.getDiscoveryTime());
vo.setSourceTablePath(dto.getSourceTablePath());
vo.setBusinessTypeName(dto.getBusinessTypeName());
vo.setInvolveProblemStr(dto.getInvolveProblemStr());
vo.setThingDesc(dto.getThingDesc());
vo.setSecondDepartName(dto.getSecondDepartName());
vo.setThirdDepartName(dto.getThirdDepartName());
vo.setCheckStatusName(dto.getCheckStatusName());
String accountabilityTarget = "personal".equals(blame.getType()) ? "涉及个人" : "涉及单位";
vo.setAccountabilityTarget(accountabilityTarget);
vo.setBlameName(blame.getBlameName());
vo.setBlameEmpNo(blame.getBlameEmpNo());
vo.setBlameIdCode(blame.getBlameIdCode());
vo.setIvPersonType(blame.getIvPersonType());
vo.setHandleResultName(blame.getHandleResultName());
vo.setLeadName(blame.getLeadName());
vo.setLeadEmpNo(blame.getLeadEmpNo());
vo.setLeadIdCode(blame.getLeadIdCode());
vo.setLeadHandleResultName(blame.getLeadHandleResultName());
vo.setSuperviseMeasuresName(blame.getSuperviseMeasuresName());
// 问题类型
String problemType = negativeProblemRelations.stream()
.filter(p -> blame.getBlameId() != null
&& blame.getBlameId().equals(p.getBlameId())
&& StrUtil.isNotBlank(p.getOneLevelContent()))
.map(p -> {
if ("其他".equals(p.getThreeLevelContent())) {
return String.format("%s / %s / %s(%s)",
p.getOneLevelContent(), p.getTwoLevelContent(),
p.getThreeLevelContent(), p.getThreeLevelContentOther());
}
return String.format("%s / %s / %s",
p.getOneLevelContent(), p.getTwoLevelContent(), p.getThreeLevelContent());
}).collect(Collectors.joining("、"));
vo.setProblemType(problemType);
if ("涉及个人".equals(accountabilityTarget)) {
personalList.add(vo);
} else {
departList.add(vo);
}
}
}
// 8. 写出 Excel(3个Sheet)
try {
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
String fileName = URLEncoder.encode("涉访涉诉导出", "UTF-8").replaceAll("\\+", "%20");
response.setHeader(
"Content-disposition",
"attachment;filename*=utf-8''" + fileName + ".xlsx"
);
String fileName = URLEncoder.encode("涉访涉诉导出(新)", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
try (ServletOutputStream outputStream = response.getOutputStream()) {
ExcelWriter excelWriter = EasyExcel.write(outputStream).build();
// Sheet1: 台账
WriteSheet sheet1 = EasyExcel.writerSheet(0, "涉访涉诉台账")
.head(ComplaintCollectionExcelDTO.class)
.build();
excelWriter.write(dataList, sheet1);
// Sheet2: 涉及人
WriteSheet sheet2 = EasyExcel.writerSheet(1, "涉访涉诉涉及人数据")
.head(ComplaintCollectionPersonExcelDTO.class)
.build();
excelWriter.write(personList, sheet2);
.head(ExportComplaintCollectionExcelVo.class).build();
excelWriter.write(sheet1List, sheet1);
WriteSheet sheet2 = EasyExcel.writerSheet(1, "个人涉及台账")
.head(ExportComplaintCollectionBlameVo.class).build();
excelWriter.write(personalList, sheet2);
WriteSheet sheet3 = EasyExcel.writerSheet(2, "单位涉及台账")
.head(ExportComplaintCollectionBlameVo.class).build();
excelWriter.write(departList, sheet3);
excelWriter.finish();
}
} catch (UnsupportedEncodingException e) {
@ -485,83 +653,6 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
}
private List<ComplaintCollectionPersonExcelDTO> buildComplaintCollectionPersonExcelDTO(List<ComplaintCollectionBlame> blameList, List<NegativeBlame> negativeBlames, List<ComplaintCollectionPageDTO> dataList) {
List<ComplaintCollectionPersonExcelDTO> res = new ArrayList<>();
Map<String, List<ComplaintCollectionBlame>> complaintCollectionBlameMap = blameList.stream()
.filter(blame -> blame.getComplaintId() != null)
.collect(Collectors.groupingBy(ComplaintCollectionBlame::getComplaintId, Collectors.toList()));
Map<String, List<NegativeBlame>> negativeBlameMap = negativeBlames.stream()
.filter(blame -> blame.getNegativeId() != null)
.collect(Collectors.groupingBy(NegativeBlame::getNegativeId, Collectors.toList()));
List<NegativeProblemRelation> negativeProblemRelations = negativeProblemRelationService.list(new LambdaQueryWrapper<NegativeProblemRelation>().in(NegativeProblemRelation::getNegativeId, dataList.stream().map(ComplaintCollectionPageDTO::getId).toList()));
for (ComplaintCollectionPageDTO dto : dataList) {
String checkStatus = dto.getCheckStatus();
boolean itTure = InspectCaseEnum.isItTure(checkStatus);
if (itTure) {
List<NegativeBlame> nBlame = negativeBlameMap.getOrDefault(dto.getId(), new ArrayList<>());
nBlame.forEach(item -> {
String problemTypeList = negativeProblemRelations.stream().filter(problem -> item.getBlameId().equals(problem.getBlameId()) && StrUtil.isNotBlank(problem.getOneLevelContent())).map(problem -> {
if ("其他".equals(problem.getThreeLevelContent())) {
return String.format("%s / %s / %s(%s)", problem.getOneLevelContent(), problem.getTwoLevelContent(), problem.getThreeLevelContent(), problem.getThreeLevelContentOther());
}
return String.format("%s / %s / %s", problem.getOneLevelContent(), problem.getTwoLevelContent(), problem.getThreeLevelContent());
}).collect(Collectors.joining("、"));
ComplaintCollectionPersonExcelDTO complaintCollectionPersonExcelDTO = new ComplaintCollectionPersonExcelDTO();
complaintCollectionPersonExcelDTO.setOriginId(dto.getOriginId());
complaintCollectionPersonExcelDTO.setDiscoveryTime(dto.getDiscoveryTime());
complaintCollectionPersonExcelDTO.setSourceTablePath(dto.getSourceTablePath());
complaintCollectionPersonExcelDTO.setBusinessTypeName(dto.getBusinessTypeName());
complaintCollectionPersonExcelDTO.setInvolveProblemStr(dto.getInvolveProblemStr());
complaintCollectionPersonExcelDTO.setThingDesc(dto.getThingDesc());
complaintCollectionPersonExcelDTO.setSecondDepartName(dto.getSecondDepartName());
complaintCollectionPersonExcelDTO.setCheckStatusName(dto.getCheckStatusName());
complaintCollectionPersonExcelDTO.setAccountabilityTarget(BlameType.personal.name().equals(item.getType()) ? "涉及个人" : "涉及单位");
complaintCollectionPersonExcelDTO.setBlameName(item.getBlameName());
complaintCollectionPersonExcelDTO.setBlameEmpNo(item.getBlameEmpNo());
complaintCollectionPersonExcelDTO.setBlameIdCode(item.getBlameIdCode());
complaintCollectionPersonExcelDTO.setIvPersonType(item.getIvPersonType());
complaintCollectionPersonExcelDTO.setLeadName(item.getLeadName());
complaintCollectionPersonExcelDTO.setLeadEmpNo(item.getLeadEmpNo());
complaintCollectionPersonExcelDTO.setLeadIdCode(item.getLeadIdCode());
complaintCollectionPersonExcelDTO.setHandleResultName(item.getHandleResultName());
complaintCollectionPersonExcelDTO.setProblemType(problemTypeList);
res.add(complaintCollectionPersonExcelDTO);
});
} else {
List<ComplaintCollectionBlame> complaintCollectionBlames = complaintCollectionBlameMap.getOrDefault(dto.getId(), new ArrayList<>());
complaintCollectionBlames.forEach(item -> {
// String problemTypeList = negativeProblemRelations.stream().filter(problem -> item.getBlameId().equals(problem.getBlameId()) && StrUtil.isNotBlank(problem.getOneLevelContent())).map(problem -> {
// if ("其他".equals(problem.getThreeLevelContent())) {
// return String.format("%s / %s / %s(%s)", problem.getOneLevelContent(), problem.getTwoLevelContent(), problem.getThreeLevelContent(), problem.getThreeLevelContentOther());
// }
// return String.format("%s / %s / %s", problem.getOneLevelContent(), problem.getTwoLevelContent(), problem.getThreeLevelContent());
// }).collect(Collectors.joining("、"));
ComplaintCollectionPersonExcelDTO complaintCollectionPersonExcelDTO = new ComplaintCollectionPersonExcelDTO();
complaintCollectionPersonExcelDTO.setOriginId(dto.getOriginId());
complaintCollectionPersonExcelDTO.setDiscoveryTime(dto.getDiscoveryTime());
complaintCollectionPersonExcelDTO.setSourceTablePath(dto.getSourceTablePath());
complaintCollectionPersonExcelDTO.setBusinessTypeName(dto.getBusinessTypeName());
complaintCollectionPersonExcelDTO.setInvolveProblemStr(dto.getInvolveProblemStr());
complaintCollectionPersonExcelDTO.setThingDesc(dto.getThingDesc());
complaintCollectionPersonExcelDTO.setSecondDepartName(dto.getSecondDepartName());
complaintCollectionPersonExcelDTO.setCheckStatusName(dto.getCheckStatusName());
complaintCollectionPersonExcelDTO.setAccountabilityTarget(BlameType.personal.name().equals(item.getType()) ? "涉及个人" : "涉及单位");
complaintCollectionPersonExcelDTO.setBlameName(item.getBlameName());
complaintCollectionPersonExcelDTO.setBlameEmpNo(item.getBlameEmpNo());
complaintCollectionPersonExcelDTO.setBlameIdCode(item.getBlameIdCode());
complaintCollectionPersonExcelDTO.setIvPersonType(item.getIvPersonTypeName());
complaintCollectionPersonExcelDTO.setLeadName(item.getLeadName());
complaintCollectionPersonExcelDTO.setLeadEmpNo(item.getLeadEmpNo());
complaintCollectionPersonExcelDTO.setLeadIdCode(item.getLeadIdCode());
complaintCollectionPersonExcelDTO.setHandleResultName(item.getHandleResultName());
// complaintCollectionPersonExcelDTO.setProblemType(problemTypeList);
res.add(complaintCollectionPersonExcelDTO);
});
}
}
return res;
}
@Override
public Result<Boolean> saveInvolveJson(ComplaintCollectionInitialReviewSaveRequest request) {
complaintCollectionMapper.update(new LambdaUpdateWrapper<ComplaintCollection>()
@ -636,9 +727,26 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
// 2. 转换为 VO
ComplaintCollectionDetailVo vo = new ComplaintCollectionDetailVo();
BeanUtil.copyProperties(complaintCollection, vo);
// 转换 involveProblem 为列表
vo.setInvolveProblemIdList(StrUtil.isBlank(complaintCollection.getInvolveProblem())
? new ArrayList<>() : Arrays.asList(complaintCollection.getInvolveProblem().split("[,,]")));
// 3. 从 negative 表补充通用字段
String negativeId = complaintCollection.getNegativeId();
if (StrUtil.isNotBlank(negativeId)) {
Negative negative = negativeService.getById(negativeId);
if (negative != null) {
vo.setOriginId(negative.getOriginId());
vo.setDiscoveryTime(negative.getDiscoveryTime());
vo.setResponderName(negative.getResponderName());
vo.setResponderPhone(negative.getContactPhone());
vo.setThingDesc(negative.getThingDesc());
vo.setInvolveProblem(negative.getInvolveProblem());
vo.setBusinessTypeCode(negative.getBusinessTypeCode());
vo.setBusinessTypeName(negative.getBusinessTypeName());
}
}
// 4. 转换 involveProblem 为列表
vo.setInvolveProblemIdList(StrUtil.isBlank(vo.getInvolveProblem())
? new ArrayList<>() : Arrays.asList(vo.getInvolveProblem().split("[,,]")));
// 转换 tag 为列表
vo.setTags(StrUtil.isBlank(complaintCollection.getTag())
? new ArrayList<>() : Arrays.asList(complaintCollection.getTag().split("[,,]")));
@ -673,7 +781,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
NegativeDto dto = new NegativeDto();
// originId 会自动生成
dto.setOriginId(complaintCollection.getOriginId());
dto.setDiscoveryTime(complaintCollection.getDiscoveryTime());
dto.setDiscoveryTime(request.getDiscoveryTime());
// 问题来源
if (ComplaintCollectionSourceTableEnum.LEADER_ASSIGN.getCode().equals(request.getSourceTable())) {
@ -691,7 +799,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
dto.setInvolveDepartName(request.getSecondDepartName());
// 内容描述
dto.setThingDesc(complaintCollection.getThingDesc());
dto.setThingDesc(request.getThingDesc());
// 主办层级
dto.setHostLevel(request.getHostLevel());
@ -719,6 +827,13 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
// 涉嫌问题
dto.setInvolveProblem(request.getInvolveProblemIdList());
// 反映人信息
dto.setResponderName(request.getResponderName());
dto.setContactPhone(request.getResponderPhone());
// 案件编号
// dto.setCaseNumber(request.getCaseNumber());
return dto;
}
@ -735,35 +850,6 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
/**
* 保存附件
*
* @param complaintId
* @param thingFiles
*/
private void saveThingFilesOrThrow(String complaintId, List<FileVo> thingFiles) {
if (CollectionUtil.isEmpty(thingFiles)) {
return;
}
String userName = UserContextHolder.getCurrentUser().getUserName();
LocalDateTime now = LocalDateTime.now();
List<ComplaintCollectionFile> files = thingFiles.stream().map(one -> {
ComplaintCollectionFile file = new ComplaintCollectionFile();
file.setComplaintId(complaintId);
file.setFileName(one.getFileName());
file.setFilePath(one.getFilePath());
file.setCreateBy(userName);
file.setCreateTime(now);
return file;
}).toList();
boolean ok = complaintCollectionFileResourceService.createComplaintCollectionFile(files);
if (!ok) {
throw new ValidationException("附件保存失败");
}
}
private List<ComplaintCollectionRepeatDTO> buildSfss(
ComplaintCollectionMailRepeattRequest request) {
ComplaintCollectionQueryParam param = new ComplaintCollectionQueryParam();

8
src/main/resources/application-prod.yml

@ -94,6 +94,14 @@ fdfs:
tracker-list:
- 65.47.6.110:22122
preview-url: http://65.47.6.110:81
so-timeout: 120000 # socket超时增加到120秒(默认30秒)
connect-timeout: 10000 # 连接超时10秒(默认5秒)
pool:
max-total: 100 # 从池中借出的对象的最大数目
max-wait-millis: 5000 # 获取连接时的最大等待毫秒数
max-total-per-key: 50 # 每个key最大连接数
max-idle-per-key: 10 # 每个key对应的连接池最大空闲连接数
min-idle-per-key: 5 # 每个key对应的连接池最小空闲连接数
negative:
v1-user-url: http://65.47.6.108:8765/admin/current/user

219
src/main/resources/mapper/ComplaintCollectionMapper.xml

@ -146,151 +146,54 @@
</foreach>
</insert>
<select id="selectPageWithConditions" resultType="com.biutag.supervision.pojo.entity.ComplaintCollection">
SELECT
complaint_collection.*
FROM complaint_collection
<where>
<if test="param.sourceTable != null and param.sourceTable != ''">
AND source_table = #{param.sourceTable}
</if>
<if test="param.sourceTableList != null and param.sourceTableList.size > 0">
AND source_table IN
<foreach collection="param.sourceTableList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.sourceTableSubOne != null and param.sourceTableSubOne != ''">
AND source_table_sub_one = #{param.sourceTableSubOne}
</if>
<if test="param.sourceTableSubOneList != null and param.sourceTableSubOneList.size > 0">
AND source_table_sub_one IN
<foreach collection="param.sourceTableSubOneList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.originId != null and param.originId != ''">
AND origin_id LIKE CONCAT('%', #{param.originId}, '%')
</if>
<if test="param.originIds != null and param.originIds.size > 0">
AND origin_id IN
<foreach collection="param.originIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.checkStatus != null and param.checkStatus != ''">
AND check_status = #{param.checkStatus}
</if>
<if test="param.checkStatusList != null and param.checkStatusList.size > 0">
AND check_status IN
<foreach collection="param.checkStatusList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.secondDepartId != null and param.secondDepartId != ''">
AND second_depart_id = #{param.secondDepartId}
</if>
<if test="param.secondDepartIds != null and param.secondDepartIds.size > 0">
AND second_depart_id IN
<foreach collection="param.secondDepartIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.discoveryTimeList != null and param.discoveryTimeList.size == 2">
AND discovery_time BETWEEN #{param.discoveryTimeList[0]} AND #{param.discoveryTimeList[1]}
</if>
<if test="param.personInfo != null and param.personInfo != ''">
AND (
responder_name LIKE CONCAT('%', #{param.personInfo}, '%')
OR responder_phone LIKE CONCAT('%', #{param.personInfo}, '%')
OR responder_id_code LIKE CONCAT('%', #{param.personInfo}, '%')
)
</if>
<if test="param.handleMethod != null and param.handleMethod != ''">
AND handle_method = #{param.handleMethod}
</if>
<if test="param.thingDesc != null and param.thingDesc != ''">
AND thing_desc LIKE CONCAT('%', #{param.thingDesc}, '%')
</if>
<if test="param.repeatt != null and param.repeatt != ''">
AND repeatt = #{param.repeatt}
</if>
<if test="param.leadApproval != null and param.leadApproval != ''">
AND lead_approval = #{param.leadApproval}
</if>
<if test="param.processingStatus != null and param.processingStatus != ''">
AND processing_status = #{param.processingStatus}
</if>
<if test="param.status != null and param.status != ''">
AND status = #{param.status}
</if>
<if test="param.initialReviewFileList != null and param.initialReviewFileList.size > 0">
AND gwf3 IN
<foreach collection="param.initialReviewFileList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.tags != null and param.tags.size > 0">
AND (
<foreach collection="param.tags" item="tagItem" separator=" OR ">
FIND_IN_SET(#{tagItem}, tag)
</foreach>
)
</if>
<if test="param.involveProblemIdList != null and param.involveProblemIdList.size > 0">
AND (
<foreach collection="param.involveProblemIdList" item="probItem" separator=" OR ">
FIND_IN_SET(#{probItem}, involve_problem)
</foreach>
)
</if>
</where>
ORDER BY discovery_time DESC, id DESC
</select>
<select id="selectPageWithNegative" resultType="com.biutag.supervision.pojo.dto.complaintCollection.ComplaintCollectionPageDTO">
SELECT
cc.id,
cc.id AS id,
cc.source_table AS sourceTable,
cc.source_table_sub_one AS sourceTableSubOne,
-- source_table_path 不从数据库查,由后端计算
cc.origin_id AS originId,
cc.discovery_time AS discoveryTime,
cc.responder_name AS responderName,
cc.responder_phone AS responderPhone,
cc.business_type_name AS businessTypeName,
cc.thing_desc AS thingDesc,
cc.involved_issue AS involvedIssue,
cc.negative_id AS negativeId,
cc.responder_id_code AS responderIdCode,
cc.repeatt AS repeatt,
cc.lead_approval AS leadApproval,
cc.tag AS tag,
cc.handle_method AS handleMethod,
cc.second_depart_id AS secondDepartId,
cc.second_depart_name AS secondDepartName,
cc.third_depart_id AS thirdDepartId,
cc.third_depart_name AS thirdDepartName,
cc.involve_problem AS involveProblem,
cc.gwf1 AS gwf1,
cc.gwf2 AS gwf2,
cc.gwf3 AS gwf3,
cc.gwf4 AS gwf4,
cc.gwf5 AS gwf5,
cc.create_by AS createBy,
cc.create_time AS createTime,
cc.update_by AS updateBy,
cc.update_time AS updateTime,
cc.completion_status AS completionStatus,
cc.public_recognition AS publicRecognition,
cc.init_work_des AS initWorkDes,
cc.init_problem_plan AS initProblemPlan,
cc.init_verdict AS initVerdict,
cc.involved_issue AS involvedIssue,
cc.distribution_state AS distributionState,
cc.second_depart_id AS secondDepartId,
cc.third_depart_id AS thirdDepartId,
cc.problem_sources_code AS problemSourcesCode,
cc.problem_sources AS problemSources,
cc.police_type_name AS policeTypeName,
cc.channel_for_filing_complaints AS channelForFilingComplaints,
cc.acceptance_level AS acceptanceLevel,
cc.initial_petition AS initialPetition,
cc.entanglement_visits AS entanglementVisits,
cc.mass_visits AS massVisits,
cc.police_type AS policeType,
cc.responder_id_code AS responderIdCode,
cc.police_type_name AS policeTypeName,
cc.people_number AS peopleNumber,
cc.appeal AS appeal,
cc.business_class AS businessClass,
cc.register_depart_name AS registerDepartName,
cc.transfer_depart AS transferDepart,
cc.handle_method AS handleMethod,
cc.handle_depart_name AS handleDepartName,
cc.completed_time AS completedTime,
cc.involve_depart_name AS involveDepartName,
cc.receiving_leader_name AS receivingLeaderName,
cc.is_mian_responsib AS isMianResponsib,
cc.receiving_depart_name AS receivingDepartName,
cc.negative_id AS negativeId,
cc.petition_type AS petitionType,
cc.petition_processing_status AS petitionProcessingStatus,
cc.happen_time AS happenTime,
@ -300,35 +203,29 @@
cc.source_involve_depart_name AS sourceInvolveDepartName,
cc.outer_id AS outerId,
cc.crx_state AS crxState,
cc.business_type_code AS businessTypeCode,
cc.check_status AS checkStatus,
cc.check_status_name AS checkStatusName,
cc.check_status_desc AS checkStatusDesc,
cc.processing_status AS processingStatus,
cc.accountability_target AS accountabilityTarget,
cc.crt_time AS crtTime,
cc.repeatt AS repeatt,
cc.lead_approval AS leadApproval,
cc.tag AS tag,
cc.case_number AS caseNumber,
cc.gwf1 AS gwf1,
cc.gwf2 AS gwf2,
cc.gwf3 AS gwf3,
cc.gwf4 AS gwf4,
cc.gwf5 AS gwf5,
cc.create_by AS createBy,
cc.create_time AS createTime,
cc.update_by AS updateBy,
cc.update_time AS updateTime,
cc.completion_status AS completionStatus,
cc.public_recognition AS publicRecognition,
cc.status AS status,
cc.init_work_des AS initWorkDes,
cc.init_problem_plan AS initProblemPlan,
cc.init_verdict AS initVerdict
FROM complaint_collection cc
LEFT JOIN negative n ON cc.negative_id = n.id
-- 从 negative 表取通用字段
n.originId AS originId,
n.discoveryTime AS discoveryTime,
n.responderName AS responderName,
n.contactPhone AS responderPhone,
n.businessTypeCode AS businessTypeCode,
n.businessTypeName AS businessTypeName,
n.thingDesc AS thingDesc,
n.involveProblem AS involveProblem,
n.problemSourcesCode AS problemSourcesCode,
n.problemSources AS problemSources,
n.case_number AS caseNumber,
n.processing_status AS processingStatus,
n.check_status_code AS checkStatusCode,
n.checkStatusName AS checkStatusName,
n.check_status_desc AS checkStatusDesc,
n.involveDepartName AS involveDepartName
FROM negative n
LEFT JOIN complaint_collection cc ON n.id = cc.negative_id
<where>
n.sourceType = '2'
<if test="param.sourceTable != null and param.sourceTable != ''">
AND cc.source_table = #{param.sourceTable}
</if>
@ -348,10 +245,10 @@
</foreach>
</if>
<if test="param.originId != null and param.originId != ''">
AND cc.origin_id LIKE CONCAT('%', #{param.originId}, '%')
AND n.originId LIKE CONCAT('%', #{param.originId}, '%')
</if>
<if test="param.originIds != null and param.originIds.size > 0">
AND cc.origin_id IN
AND n.originId IN
<foreach collection="param.originIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@ -375,12 +272,12 @@
</foreach>
</if>
<if test="param.discoveryTimeList != null and param.discoveryTimeList.size == 2">
AND cc.discovery_time BETWEEN #{param.discoveryTimeList[0]} AND #{param.discoveryTimeList[1]}
AND n.discoveryTime BETWEEN #{param.discoveryTimeList[0]} AND #{param.discoveryTimeList[1]}
</if>
<if test="param.personInfo != null and param.personInfo != ''">
AND (
cc.responder_name LIKE CONCAT('%', #{param.personInfo}, '%')
OR cc.responder_phone LIKE CONCAT('%', #{param.personInfo}, '%')
n.responderName LIKE CONCAT('%', #{param.personInfo}, '%')
OR n.contactPhone LIKE CONCAT('%', #{param.personInfo}, '%')
OR cc.responder_id_code LIKE CONCAT('%', #{param.personInfo}, '%')
)
</if>
@ -388,7 +285,7 @@
AND cc.handle_method = #{param.handleMethod}
</if>
<if test="param.thingDesc != null and param.thingDesc != ''">
AND cc.thing_desc LIKE CONCAT('%', #{param.thingDesc}, '%')
AND n.thingDesc LIKE CONCAT('%', #{param.thingDesc}, '%')
</if>
<if test="param.repeatt != null and param.repeatt != ''">
AND cc.repeatt = #{param.repeatt}
@ -396,11 +293,11 @@
<if test="param.leadApproval != null and param.leadApproval != ''">
AND cc.lead_approval = #{param.leadApproval}
</if>
<if test="param.processingStatus != null and param.processingStatus != ''">
AND cc.processing_status = #{param.processingStatus}
</if>
<if test="param.status != null and param.status != ''">
AND cc.status = #{param.status}
<if test="param.processingStatus != null and param.processingStatus.size > 0">
AND n.processing_status IN
<foreach collection="param.processingStatus" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.initialReviewFileList != null and param.initialReviewFileList.size > 0">
AND cc.gwf3 IN
@ -418,7 +315,7 @@
<if test="param.involveProblemIdList != null and param.involveProblemIdList.size > 0">
AND (
<foreach collection="param.involveProblemIdList" item="probItem" separator=" OR ">
FIND_IN_SET(#{probItem}, cc.involve_problem)
FIND_IN_SET(#{probItem}, n.involveProblem)
</foreach>
)
</if>
@ -426,7 +323,7 @@
AND cc.create_time BETWEEN #{param.createTimeList[0]} AND #{param.createTimeList[1]}
</if>
</where>
ORDER BY cc.create_time DESC, cc.id DESC
ORDER BY n.crtTime DESC, cc.id DESC
</select>
</mapper>

Loading…
Cancel
Save