|
|
|
@ -2,16 +2,25 @@ package com.biutag.supervision.job; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.util.*; |
|
|
|
import cn.hutool.core.util.*; |
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
import com.biutag.supervision.constants.enums.ComfortStatus; |
|
|
|
import com.biutag.supervision.constants.enums.*; |
|
|
|
import com.biutag.supervision.constants.enums.ProcessingStatusEnum; |
|
|
|
|
|
|
|
import com.biutag.supervision.constants.enums.RightsCaseEnum; |
|
|
|
|
|
|
|
import com.biutag.supervision.constants.enums.RpcApplyTypeEnum; |
|
|
|
|
|
|
|
import com.biutag.supervision.mapper.*; |
|
|
|
import com.biutag.supervision.mapper.*; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.dto.complaintCollection.MailBoxCaptureToComplaintCollectionSaveDTO; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.dto.mail.MailAttachmentDTO; |
|
|
|
import com.biutag.supervision.pojo.entity.*; |
|
|
|
import com.biutag.supervision.pojo.entity.*; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.mailbox.Mail; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.enums.complaintCollection.ComplaintCollectionHandleMethodEnum; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.param.ComplaintCollection.ComplaintCollectionQueryParam; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.param.SupDepartQueryParam; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.param.SupExternalDepartQueryParam; |
|
|
|
|
|
|
|
import com.biutag.supervision.repository.complaintCollection.ComplaintCollectionResourceService; |
|
|
|
|
|
|
|
import com.biutag.supervision.repository.supExternalDepart.SupExternalDepartResourceService; |
|
|
|
|
|
|
|
import com.biutag.supervision.repository.supdepart.SupDepartResourceService; |
|
|
|
import com.biutag.supervision.service.*; |
|
|
|
import com.biutag.supervision.service.*; |
|
|
|
|
|
|
|
import com.biutag.supervision.service.complaintCollection.ComplaintCollectionServiceJob; |
|
|
|
import com.biutag.supervision.util.CommonUtil; |
|
|
|
import com.biutag.supervision.util.CommonUtil; |
|
|
|
import com.biutag.supervision.util.TimeUtil; |
|
|
|
import com.biutag.supervision.util.TimeUtil; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
@ -23,11 +32,9 @@ import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.Month; |
|
|
|
|
|
|
|
import java.time.ZoneId; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.logging.Level; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
import static com.biutag.supervision.util.TimeUtil.SECONDS_OF_A_DAY; |
|
|
|
import static com.biutag.supervision.util.TimeUtil.SECONDS_OF_A_DAY; |
|
|
|
@ -47,6 +54,10 @@ public class Job { |
|
|
|
|
|
|
|
|
|
|
|
private final MailService mailService; |
|
|
|
private final MailService mailService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final SupExternalDepartResourceService supExternalDepartResourceService; |
|
|
|
|
|
|
|
private final SupDepartResourceService supDepartResourceService; |
|
|
|
|
|
|
|
private final ComplaintCollectionServiceJob complaintCollectionServiceJob; |
|
|
|
|
|
|
|
private final ComplaintCollectionResourceService complaintCollectionResourceService; |
|
|
|
// 更新办理超时
|
|
|
|
// 更新办理超时
|
|
|
|
@Scheduled(fixedRate = 600000) |
|
|
|
@Scheduled(fixedRate = 600000) |
|
|
|
public void updateHandleTimeout() { |
|
|
|
public void updateHandleTimeout() { |
|
|
|
@ -423,9 +434,9 @@ public class Job { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ZhkshDutyScheduleDcMapper zhkshDutyScheduleDcMapper; |
|
|
|
private final ZhkshDutyScheduleDcMapper zhkshDutyScheduleDcMapper; |
|
|
|
private final SupRotaMapper supRotaMapper; |
|
|
|
private final SupRotaMapper supRotaMapper; |
|
|
|
|
|
|
|
|
|
|
|
//每天一次 00:20:00
|
|
|
|
//每天一次 00:20:00
|
|
|
|
//值班人员
|
|
|
|
//值班人员
|
|
|
|
@Scheduled(cron = "0 20 12 * * ?") |
|
|
|
@Scheduled(cron = "0 20 12 * * ?") |
|
|
|
@ -467,4 +478,225 @@ public class Job { |
|
|
|
supRotaMapper.insert(supRotaList); |
|
|
|
supRotaMapper.insert(supRotaList); |
|
|
|
log.info("值班数据录入完成"); |
|
|
|
log.info("值班数据录入完成"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 局长信箱数据抓取到涉访涉诉
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 1 * * ?") |
|
|
|
|
|
|
|
public void mailBoxCaptureToComplaintCollection() { |
|
|
|
|
|
|
|
LocalDateTime start = LocalDate.now().minusDays(1).atStartOfDay(); |
|
|
|
|
|
|
|
LocalDateTime end = LocalDate.now().atStartOfDay(); |
|
|
|
|
|
|
|
mailBoxCaptureToComplaintCollection(start, end); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 * * * ?") |
|
|
|
|
|
|
|
public void updateMailBoxCaptureToComplaintCollection() { |
|
|
|
|
|
|
|
log.info("【局长信箱回填】开始同步核查信息到ComplaintCollection..."); |
|
|
|
|
|
|
|
ComplaintCollectionQueryParam complaintCollectionQueryParam = new ComplaintCollectionQueryParam(); |
|
|
|
|
|
|
|
complaintCollectionQueryParam.setSourceTable("23"); |
|
|
|
|
|
|
|
complaintCollectionQueryParam.setStatus("0"); |
|
|
|
|
|
|
|
List<ComplaintCollection> collectionList = complaintCollectionResourceService.query(complaintCollectionQueryParam); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(collectionList)) { |
|
|
|
|
|
|
|
log.info("【局长信箱回填】无待同步数据"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
log.info("【局长信箱回填】获取到待处理 ComplaintCollection 条数:{}", CollectionUtil.size(collectionList)); |
|
|
|
|
|
|
|
// 所有局长信箱编号
|
|
|
|
|
|
|
|
Set<String> mailIds = collectionList.stream().map(ComplaintCollection::getOriginId).filter(StrUtil::isNotBlank).collect(Collectors.toSet()); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(mailIds)) { |
|
|
|
|
|
|
|
log.warn("【局长信箱回填】ComplaintCollection 中无有效 originId"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
log.info("【局长信箱回填】提取到 originId 数量:{}", mailIds.size()); |
|
|
|
|
|
|
|
List<Mail> mailList = mailService.list(new LambdaQueryWrapper<Mail>().in(Mail::getId, mailIds)); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(mailList)) { |
|
|
|
|
|
|
|
log.info("【局长信箱回填】Mail 表未查到任何数据"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
log.info("【局长信箱回填】查询到 Mail 记录条数:{}", mailList.size()); |
|
|
|
|
|
|
|
Map<String, Mail> mailMap = mailList.stream().collect(Collectors.toMap(Mail::getId, Function.identity())); |
|
|
|
|
|
|
|
List<ComplaintCollection> toUpdate = new ArrayList<>(); |
|
|
|
|
|
|
|
Map<String, List<MailAttachmentDTO>> verifyAttachMap = new HashMap<>(); |
|
|
|
|
|
|
|
for (ComplaintCollection cc : collectionList) { |
|
|
|
|
|
|
|
Mail mail = mailMap.get(cc.getOriginId()); |
|
|
|
|
|
|
|
if (mail == null) { |
|
|
|
|
|
|
|
log.warn("【局长信箱回填】未找到 Mail,originId={},跳过。", cc.getOriginId()); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ("属实".equals(mail.getVerifyIsTrue())) { |
|
|
|
|
|
|
|
cc.setCheckStatus("1"); |
|
|
|
|
|
|
|
cc.setCheckStatusName("属实"); |
|
|
|
|
|
|
|
} else if ("基本属实".equals(mail.getVerifyIsTrue())) { |
|
|
|
|
|
|
|
cc.setCheckStatus("2"); |
|
|
|
|
|
|
|
cc.setCheckStatusName("基本属实"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
cc.setCheckStatusDesc(mail.getVerifyDetails()); |
|
|
|
|
|
|
|
cc.setProcessingStatus(mail.getMailState()); |
|
|
|
|
|
|
|
toUpdate.add(cc); |
|
|
|
|
|
|
|
// 附件
|
|
|
|
|
|
|
|
List<MailAttachmentDTO> attachList = parseAttachments(mail.getVerifyAttachments()); |
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(attachList)) { |
|
|
|
|
|
|
|
verifyAttachMap.put(cc.getOriginId(), attachList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(toUpdate)) { |
|
|
|
|
|
|
|
log.info("【局长信箱回填】无可更新数据"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
MailBoxCaptureToComplaintCollectionSaveDTO dto = new MailBoxCaptureToComplaintCollectionSaveDTO(); |
|
|
|
|
|
|
|
dto.setComplaintCollectionList(toUpdate); |
|
|
|
|
|
|
|
dto.setVerifyAttachMap(verifyAttachMap); |
|
|
|
|
|
|
|
log.info("【局长信箱回填】准备提交更新,更新条数:{},含附件的 originId 数:{}", toUpdate.size(), verifyAttachMap.size()); |
|
|
|
|
|
|
|
complaintCollectionServiceJob.saveComplaintAndAttachments(dto); |
|
|
|
|
|
|
|
log.info("【局长信箱回填】处理完成。"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void mailBoxCaptureToComplaintCollection(LocalDateTime start, LocalDateTime end) { |
|
|
|
|
|
|
|
log.info("【局长信箱抓取】时间范围 {} ~ {}", start, end); |
|
|
|
|
|
|
|
long startTimeMillis = System.currentTimeMillis(); |
|
|
|
|
|
|
|
log.info("开始抓取局长信箱数据到涉访涉诉--------------------"); |
|
|
|
|
|
|
|
log.info("【局长信箱抓取】查询条件:mailFirstCategory in [举报类, 投诉类], 时间范围 {} ~ {}", start, end); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
LambdaQueryWrapper<Mail> mailLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
mailLambdaQueryWrapper.in(Mail::getMailFirstCategory, "举报类", "投诉类"); |
|
|
|
|
|
|
|
mailLambdaQueryWrapper.between(Mail::getMailTime, start, end); |
|
|
|
|
|
|
|
List<Mail> mailList = mailService.list(mailLambdaQueryWrapper); |
|
|
|
|
|
|
|
log.info("【局长信箱抓取】查询到 Mail 数量:{}", mailList.size()); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(mailList)) { |
|
|
|
|
|
|
|
log.warn("【局长信箱抓取】未查询到任何数据,任务结束"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<ComplaintCollection> complaintCollectionToSave = new ArrayList<>(); |
|
|
|
|
|
|
|
Map<String, List<MailAttachmentDTO>> complaintAttachMap = new HashMap<>(); |
|
|
|
|
|
|
|
Map<String, List<MailAttachmentDTO>> verifyAttachMap = new HashMap<>(); |
|
|
|
|
|
|
|
int successCount = 0; |
|
|
|
|
|
|
|
int failCount = 0; |
|
|
|
|
|
|
|
for (Mail mail : mailList) { |
|
|
|
|
|
|
|
ComplaintCollection complaintCollection = buildComplaintCollection(mail); |
|
|
|
|
|
|
|
// 投诉单位
|
|
|
|
|
|
|
|
Integer threeDeptId = mail.getThreeDeptId(); |
|
|
|
|
|
|
|
if (threeDeptId == null) { |
|
|
|
|
|
|
|
failCount++; |
|
|
|
|
|
|
|
log.warn("【局长信箱抓取】跳过 mail,threeDeptId 为空,mailId={}, source={}", mail.getId(), mail.getSource()); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
SupExternalDepartQueryParam threeDepQueryParam = new SupExternalDepartQueryParam(); |
|
|
|
|
|
|
|
threeDepQueryParam.setSource("局长信箱"); |
|
|
|
|
|
|
|
threeDepQueryParam.setExternalIds(Collections.singleton(String.valueOf(threeDeptId))); |
|
|
|
|
|
|
|
List<SupExternalDepart> supExternalDeparts = supExternalDepartResourceService.query(threeDepQueryParam); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(supExternalDeparts)) { |
|
|
|
|
|
|
|
failCount++; |
|
|
|
|
|
|
|
log.warn("【局长信箱抓取】跳过 mail,未找到 SupExternalDepart,mailId={}, threeDeptId={}", mail.getId(), threeDeptId); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
SupExternalDepart supExternalDepart = supExternalDeparts.get(0); |
|
|
|
|
|
|
|
SupDepartQueryParam secondDepartQueryParam = new SupDepartQueryParam(); |
|
|
|
|
|
|
|
secondDepartQueryParam.setId(supExternalDepart.getInternalId()); |
|
|
|
|
|
|
|
List<SupDepart> threeDeparts = supDepartResourceService.query(secondDepartQueryParam); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(threeDeparts)) { |
|
|
|
|
|
|
|
failCount++; |
|
|
|
|
|
|
|
log.warn("【局长信箱抓取】跳过 mail,未找到对应三级单位,mailId={}, internalId={}", mail.getId(), supExternalDepart.getInternalId()); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
SupDepart threeDepart = threeDeparts.get(0); |
|
|
|
|
|
|
|
SupDepartQueryParam threeDepartQueryParam = new SupDepartQueryParam(); |
|
|
|
|
|
|
|
threeDepartQueryParam.setId(supExternalDepart.getPid()); |
|
|
|
|
|
|
|
List<SupDepart> secondDeparts = supDepartResourceService.query(threeDepartQueryParam); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(secondDeparts)) { |
|
|
|
|
|
|
|
failCount++; |
|
|
|
|
|
|
|
log.warn("【局长信箱抓取】跳过 mail,未找对应到二级单位,mailId={}, pid={}", mail.getId(), supExternalDepart.getPid()); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
SupDepart secondDepart = secondDeparts.get(0); |
|
|
|
|
|
|
|
complaintCollection.setSecondDepartId(secondDepart.getId()); |
|
|
|
|
|
|
|
complaintCollection.setSecondDepartName(secondDepart.getShortName()); |
|
|
|
|
|
|
|
complaintCollection.setThirdDepartId(threeDepart.getId()); |
|
|
|
|
|
|
|
complaintCollection.setThirdDepartName(threeDepart.getShortName()); |
|
|
|
|
|
|
|
complaintCollection.setThingDesc(mail.getContent()); |
|
|
|
|
|
|
|
complaintAttachMap.put(mail.getId(), parseAttachments(mail.getAttachments())); |
|
|
|
|
|
|
|
verifyAttachMap.put(mail.getId(), parseAttachments(mail.getVerifyAttachments())); |
|
|
|
|
|
|
|
complaintCollectionToSave.add(complaintCollection); |
|
|
|
|
|
|
|
successCount++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(complaintCollectionToSave)) { |
|
|
|
|
|
|
|
log.warn("【局长信箱抓取】所有 Mail 均被跳过,无可保存的主数据"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
MailBoxCaptureToComplaintCollectionSaveDTO mailBoxCaptureToComplaintCollectionSaveDTO = new MailBoxCaptureToComplaintCollectionSaveDTO(); |
|
|
|
|
|
|
|
mailBoxCaptureToComplaintCollectionSaveDTO.setComplaintCollectionList(complaintCollectionToSave); |
|
|
|
|
|
|
|
mailBoxCaptureToComplaintCollectionSaveDTO.setComplaintAttachMap(complaintAttachMap); |
|
|
|
|
|
|
|
mailBoxCaptureToComplaintCollectionSaveDTO.setVerifyAttachMap(verifyAttachMap); |
|
|
|
|
|
|
|
complaintCollectionServiceJob.saveComplaintAndAttachments(mailBoxCaptureToComplaintCollectionSaveDTO); |
|
|
|
|
|
|
|
long cost = System.currentTimeMillis() - startTimeMillis; |
|
|
|
|
|
|
|
log.info("【局长信箱抓取】完成,总数:{},成功:{},失败:{},耗时:{}ms", mailList.size(), successCount, failCount, cost); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error("【局长信箱抓取】任务执行过程中发生严重异常,任务中断", e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getSfssSourceTableSubOne(String str) { |
|
|
|
|
|
|
|
if ("厅长信箱".equals(str)) { |
|
|
|
|
|
|
|
return "23_tz"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ("mailbox".equals(str)) { |
|
|
|
|
|
|
|
return "23_jz"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ("110_report_complaints".equals(str)) { |
|
|
|
|
|
|
|
return "23_jb"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ComplaintCollection buildComplaintCollection(Mail mail) { |
|
|
|
|
|
|
|
ComplaintCollection complaintCollection = new ComplaintCollection(); |
|
|
|
|
|
|
|
complaintCollection.setSourceTable("23"); |
|
|
|
|
|
|
|
complaintCollection.setSourceTableSubOne(getSfssSourceTableSubOne(mail.getSource())); |
|
|
|
|
|
|
|
complaintCollection.setOriginId(mail.getId()); |
|
|
|
|
|
|
|
complaintCollection.setDiscoveryTime(mail.getMailTime()); |
|
|
|
|
|
|
|
complaintCollection.setResponderName(mail.getContactName()); |
|
|
|
|
|
|
|
complaintCollection.setResponderPhone(mail.getContactPhone()); |
|
|
|
|
|
|
|
complaintCollection.setResponderIdCode(mail.getContactIdCard()); |
|
|
|
|
|
|
|
complaintCollection.setThingDesc(mail.getContent()); |
|
|
|
|
|
|
|
complaintCollection.setAccountabilityTarget(AccountabilityTargetEnum.PERSONAL.getValue()); |
|
|
|
|
|
|
|
// 核查情况
|
|
|
|
|
|
|
|
if ("属实".equals(mail.getVerifyIsTrue())) { |
|
|
|
|
|
|
|
complaintCollection.setCheckStatus(InspectCaseEnum.TRUE.getValue()); |
|
|
|
|
|
|
|
complaintCollection.setCheckStatusName(InspectCaseEnum.TRUE.getLabel()); |
|
|
|
|
|
|
|
} else if ("基本属实".equals(mail.getVerifyIsTrue())) { |
|
|
|
|
|
|
|
complaintCollection.setCheckStatus(InspectCaseEnum.PARTIALLY_TRUE.getValue()); |
|
|
|
|
|
|
|
complaintCollection.setCheckStatusName(InspectCaseEnum.PARTIALLY_TRUE.getLabel()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
complaintCollection.setCheckStatusDesc(mail.getVerifyDetails()); |
|
|
|
|
|
|
|
// 状态字段
|
|
|
|
|
|
|
|
complaintCollection.setProcessingStatus(mail.getMailState()); |
|
|
|
|
|
|
|
complaintCollection.setProblemSources(ProblemSourcesEnum.JZXX.getLabel()); |
|
|
|
|
|
|
|
complaintCollection.setProblemSourcesCode(ProblemSourcesEnum.JZXX.getValue()); |
|
|
|
|
|
|
|
// complaintCollection.setBusinessTypeCode(BusinessTypeEnum.QT.getValue());
|
|
|
|
|
|
|
|
// complaintCollection.setBusinessTypeName(BusinessTypeEnum.QT.getLabel());
|
|
|
|
|
|
|
|
complaintCollection.setHandleMethod(ComplaintCollectionHandleMethodEnum.XF.getCode()); |
|
|
|
|
|
|
|
complaintCollection.setStatus("0"); |
|
|
|
|
|
|
|
complaintCollection.setCreateTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
complaintCollection.setCreateBy("自动抓取"); |
|
|
|
|
|
|
|
return complaintCollection; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<MailAttachmentDTO> parseAttachments(String json) { |
|
|
|
|
|
|
|
if (StrUtil.isBlank(json)) { |
|
|
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
List<MailAttachmentDTO> mailAttachmentDTOS = JSON.parseArray(json, MailAttachmentDTO.class); |
|
|
|
|
|
|
|
mailAttachmentDTOS.forEach(item -> { |
|
|
|
|
|
|
|
String filepath = "http://65.47.60.145/lan-api/api/file/stream/" + item.getFilepath(); |
|
|
|
|
|
|
|
item.setFilepath(filepath); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return mailAttachmentDTOS; |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.warn("【局长信箱抓取】附件 JSON 解析失败,json={}", json, e); |
|
|
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|