package cn.huge.module.syncbydyh.service;
|
|
import cn.huge.base.common.exception.ServiceException;
|
import cn.huge.module.cases.domain.po.CaseAgent;
|
import cn.huge.module.cases.domain.po.CaseInfo;
|
import cn.huge.module.cases.domain.po.CasePerson;
|
import cn.huge.module.cases.domain.po.CaseTask;
|
import cn.huge.module.cases.service.*;
|
import cn.huge.module.cust.constant.UserBaseConsts;
|
import cn.huge.module.syncbydyh.client.api.impl.SyncBydyhClientImpl;
|
import cn.huge.module.syncbydyh.domain.dto.GZCaseDTO;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import lombok.extern.slf4j.Slf4j;
|
import org.apache.commons.collections.CollectionUtils;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
|
import java.util.List;
|
|
/**
|
* @title: 白云数据割接为广州数据的业务逻辑处理
|
* @Description 白云数据割接为广州数据的业务逻辑处理
|
* @company hugeinfo
|
* @author liyj
|
* @Time 2024-08-19 20:04:19
|
* @version 1.0.0
|
*/
|
@Slf4j
|
@Service
|
public class ByToGzService{
|
|
@Autowired
|
private SyncBydyhClientImpl syncBydyhClient;
|
@Autowired
|
private CaseInfoService caseInfoService;
|
@Autowired
|
private CaseInfoUnfoldService caseInfoUnfoldService;
|
@Autowired
|
private CasePersonService casePersonService;
|
@Autowired
|
private CaseAgentService caseAgentService;
|
@Autowired
|
private CaseTaskService caseTaskService;
|
|
/**
|
* 白云区矛盾纠纷多元化解平台数据割接-已结束的纠纷案件信息
|
*/
|
public void byToGzEndCase(){
|
try{
|
int operSize = 100;
|
// int endCaseCount = 1000;
|
int endCaseCount = syncBydyhClient.countEndCase();
|
if (endCaseCount > 0) {
|
int allPage = (endCaseCount/operSize);
|
// int allPage = 1;
|
for (int operPage=1; operPage<=allPage; operPage++) {
|
try{
|
List<GZCaseDTO> byToGzDTOList = syncBydyhClient.byToGzEndCase(operPage, operSize);
|
for (GZCaseDTO byToGzDTO: byToGzDTOList){
|
caseInfoService.saveOrUpdate(byToGzDTO.getGzCaseInfoDTO());
|
|
caseInfoUnfoldService.saveOrUpdate(byToGzDTO.getGzCaseInfoUnfoldDTO());
|
|
List<CasePerson> casePersonList = byToGzDTO.getGzCasePersonDTOList();
|
if (CollectionUtils.isNotEmpty(casePersonList)) {
|
for (CasePerson casePerson : casePersonList) {
|
casePersonService.saveOrUpdate(casePerson);
|
}
|
}
|
|
List<CaseAgent> caseAgentList = byToGzDTO.getGzCaseAgentDTOList();
|
if (CollectionUtils.isNotEmpty(caseAgentList)) {
|
for (CaseAgent caseAgent : caseAgentList) {
|
caseAgentService.saveOrUpdate(caseAgent);
|
}
|
}
|
|
List<CaseTask> caseTaskList = byToGzDTO.getGzCaseTaskDTOList();
|
if (CollectionUtils.isNotEmpty(caseTaskList)) {
|
for (CaseTask caseTask : caseTaskList) {
|
caseTaskService.saveOrUpdate(caseTask);
|
}
|
}
|
}
|
}catch (Exception e){
|
log.error("[ByToGzService.byToGzEndCase]调用失败,异常信息:"+e, e);
|
}
|
}
|
}
|
}catch (Exception e){
|
log.error("[ByToGzService.byToGzEndCase]调用失败,异常信息:"+e, e);
|
throw new ServiceException("ByToGzService.byToGzEndCase", e);
|
}
|
}
|
}
|