|
|
|
@ -1,28 +1,39 @@ |
|
|
|
package com.biutag.supervision.service; |
|
|
|
package com.biutag.supervision.service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
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.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.biutag.supervision.constants.enums.DataUpdateMethodEnum; |
|
|
|
import com.biutag.supervision.constants.enums.DataUpdateMethodEnum; |
|
|
|
|
|
|
|
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.DataCaseVerifMapper; |
|
|
|
import com.biutag.supervision.mapper.DataCaseVerifMapper; |
|
|
|
import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto; |
|
|
|
import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto; |
|
|
|
import com.biutag.supervision.pojo.dto.DataPetitionComplaintAddDto; |
|
|
|
import com.biutag.supervision.pojo.dto.DataCaseVerifDistribute; |
|
|
|
import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto; |
|
|
|
import com.biutag.supervision.pojo.dto.NegativeDto; |
|
|
|
import com.biutag.supervision.pojo.entity.DataCaseVerif; |
|
|
|
import com.biutag.supervision.pojo.entity.DataCaseVerif; |
|
|
|
import com.biutag.supervision.pojo.entity.DataPetitionComplaint; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; |
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequiredArgsConstructor |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
public class DataCaseVerifService extends ServiceImpl<DataCaseVerifMapper, DataCaseVerif> { |
|
|
|
public class DataCaseVerifService extends ServiceImpl<DataCaseVerifMapper, DataCaseVerif> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final NegativeService negativeService; |
|
|
|
|
|
|
|
|
|
|
|
public Page<DataCaseVerif> page(DataCaseVerifQueryParam queryParam) { |
|
|
|
public Page<DataCaseVerif> page(DataCaseVerifQueryParam queryParam) { |
|
|
|
LambdaQueryWrapper<DataCaseVerif> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<DataCaseVerif> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.orderByDesc(DataCaseVerif::getCreateTime); |
|
|
|
queryWrapper.like(StrUtil.isNotBlank(queryParam.getOriginId()), DataCaseVerif::getOriginId, queryParam.getOriginId()) |
|
|
|
|
|
|
|
.like(StrUtil.isNotBlank(queryParam.getThingDesc()), DataCaseVerif::getThingDesc, queryParam.getThingDesc()) |
|
|
|
|
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getDistributionState()), DataCaseVerif::getDistributionState, queryParam.getDistributionState()) |
|
|
|
|
|
|
|
.orderByDesc(DataCaseVerif::getCreateTime); |
|
|
|
return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); |
|
|
|
return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -39,9 +50,49 @@ public class DataCaseVerifService extends ServiceImpl<DataCaseVerifMapper, DataC |
|
|
|
DataCaseVerif data = new DataCaseVerif(); |
|
|
|
DataCaseVerif data = new DataCaseVerif(); |
|
|
|
BeanUtils.copyProperties(dto, data); |
|
|
|
BeanUtils.copyProperties(dto, data); |
|
|
|
data.setCreateTime(now); |
|
|
|
data.setCreateTime(now); |
|
|
|
|
|
|
|
if (StrUtil.isBlank(dto.getInvolveThirdDepartId())) { |
|
|
|
|
|
|
|
data.setInvolveDepartId(dto.getInvolveSecondDepartId()); |
|
|
|
|
|
|
|
data.setInvolveDepartName(dto.getInvolveSecondDepartName()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
data.setInvolveDepartId(dto.getInvolveThirdDepartId()); |
|
|
|
|
|
|
|
data.setInvolveDepartName(dto.getInvolveThirdDepartName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
data.setDistributionState(DistributionStateEnum.UNDISTRIBUTED.getValue()); |
|
|
|
saveOrUpdate(data); |
|
|
|
saveOrUpdate(data); |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean distribution(DataCaseVerifDistribute dataDistribute) { |
|
|
|
|
|
|
|
dataDistribute.getData().forEach(item -> { |
|
|
|
|
|
|
|
NegativeDto negativeDto = new NegativeDto(); |
|
|
|
|
|
|
|
negativeDto.setOriginId(item.getOriginId()); |
|
|
|
|
|
|
|
negativeDto.setHappenTime(item.getHappenTime()); |
|
|
|
|
|
|
|
negativeDto.setDiscoveryTime(item.getDiscoveryTime()); |
|
|
|
|
|
|
|
negativeDto.setProblemSourcesCode(ProblemSourcesEnum.A12389.getValue()); |
|
|
|
|
|
|
|
negativeDto.setProblemSources(ProblemSourcesEnum.A12389.getLabel()); |
|
|
|
|
|
|
|
// negativeDto.setBusinessTypeCode(BusinessTypeEnum.ABWW);
|
|
|
|
|
|
|
|
// negativeDto.setBusinessTypeName();
|
|
|
|
|
|
|
|
negativeDto.setResponderName(item.getResponderName()); |
|
|
|
|
|
|
|
negativeDto.setContactPhone(item.getResponderPhone()); |
|
|
|
|
|
|
|
negativeDto.setThingDesc(item.getThingDesc()); |
|
|
|
|
|
|
|
negativeDto.setInvolveDepartId(item.getInvolveDepartId()); |
|
|
|
|
|
|
|
negativeDto.setInvolveDepartName(item.getInvolveDepartName()); |
|
|
|
|
|
|
|
negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
negativeDto.setApprovalFlow(dataDistribute.getApprovalFlow()); |
|
|
|
|
|
|
|
negativeDto.setDepartId(item.getInvolveDepartId()); |
|
|
|
|
|
|
|
negativeDto.setDepartName(item.getInvolveDepartName()); |
|
|
|
|
|
|
|
negativeDto.setTimeLimit(dataDistribute.getTimeLimit()); |
|
|
|
|
|
|
|
negativeDto.setMaxSignDuration(dataDistribute.getMaxSignDuration()); |
|
|
|
|
|
|
|
negativeDto.setMaxHandleDuration(dataDistribute.getMaxHandleDuration()); |
|
|
|
|
|
|
|
negativeDto.setMaxExtensionDuration(dataDistribute.getMaxExtensionDuration()); |
|
|
|
|
|
|
|
negativeDto.setCaseNumber(item.getOriginId()); |
|
|
|
|
|
|
|
negativeService.save(negativeDto); |
|
|
|
|
|
|
|
update(new LambdaUpdateWrapper<DataCaseVerif>().eq(DataCaseVerif::getOriginId, item.getOriginId()) |
|
|
|
|
|
|
|
.set(DataCaseVerif::getDistributionState, DistributionStateEnum.DISTRIBUTED.getValue())); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|