|
@ -1,24 +1,60 @@ |
|
|
package com.epmet.service.impl; |
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.afterturn.easypoi.excel.ExcelExportUtil; |
|
|
|
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
|
|
import com.epmet.commons.tools.utils.ExcelPoiUtils; |
|
|
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
|
|
import com.epmet.constants.ImportTaskConstants; |
|
|
import com.epmet.dao.IcVaccinePrarmeterDao; |
|
|
import com.epmet.dao.IcVaccinePrarmeterDao; |
|
|
import com.epmet.dto.IcVaccinePrarmeterDTO; |
|
|
import com.epmet.dto.IcVaccinePrarmeterDTO; |
|
|
|
|
|
import com.epmet.dto.form.GridInfoVaccinePrarmeterFormDTO; |
|
|
|
|
|
import com.epmet.dto.form.ImportTaskCommonFormDTO; |
|
|
|
|
|
import com.epmet.dto.form.OrgInfoPointFormDTO; |
|
|
|
|
|
import com.epmet.dto.result.CommunityInfoResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.GridInfoByNameResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.UploadImgResultDTO; |
|
|
|
|
|
import com.epmet.entity.IcPointNucleicMonitoringEntity; |
|
|
import com.epmet.entity.IcVaccinePrarmeterEntity; |
|
|
import com.epmet.entity.IcVaccinePrarmeterEntity; |
|
|
|
|
|
import com.epmet.excel.IcPointNucleicMonitoringImportExcel; |
|
|
|
|
|
import com.epmet.excel.IcVaccinePrarmeterImportExcel; |
|
|
|
|
|
import com.epmet.excel.error.PointNucleicMonitoringErrorModel; |
|
|
|
|
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|
|
|
|
|
import com.epmet.feign.GovOrgFeignClient; |
|
|
|
|
|
import com.epmet.feign.OssFeignClient; |
|
|
import com.epmet.redis.IcVaccinePrarmeterRedis; |
|
|
import com.epmet.redis.IcVaccinePrarmeterRedis; |
|
|
import com.epmet.service.IcVaccinePrarmeterService; |
|
|
import com.epmet.service.IcVaccinePrarmeterService; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
|
import org.apache.commons.fileupload.FileItem; |
|
|
|
|
|
import org.apache.commons.fileupload.FileItemFactory; |
|
|
|
|
|
import org.apache.commons.fileupload.disk.DiskFileItemFactory; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.apache.http.entity.ContentType; |
|
|
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
import org.springframework.web.multipart.commons.CommonsMultipartFile; |
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
import java.io.IOException; |
|
|
import java.util.List; |
|
|
import java.io.InputStream; |
|
|
import java.util.Map; |
|
|
import java.io.OutputStream; |
|
|
|
|
|
import java.util.*; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 新冠病毒疫苗接种人员信息台账 |
|
|
* 新冠病毒疫苗接种人员信息台账 |
|
@ -27,11 +63,21 @@ import java.util.Map; |
|
|
* @since v1.0.0 2022-08-22 |
|
|
* @since v1.0.0 2022-08-22 |
|
|
*/ |
|
|
*/ |
|
|
@Service |
|
|
@Service |
|
|
|
|
|
@Slf4j |
|
|
public class IcVaccinePrarmeterServiceImpl extends BaseServiceImpl<IcVaccinePrarmeterDao, IcVaccinePrarmeterEntity> implements IcVaccinePrarmeterService { |
|
|
public class IcVaccinePrarmeterServiceImpl extends BaseServiceImpl<IcVaccinePrarmeterDao, IcVaccinePrarmeterEntity> implements IcVaccinePrarmeterService { |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private IcVaccinePrarmeterRedis icVaccinePrarmeterRedis; |
|
|
private IcVaccinePrarmeterRedis icVaccinePrarmeterRedis; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private OssFeignClient ossFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private GovOrgFeignClient govOrgFeignClient; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<IcVaccinePrarmeterDTO> page(Map<String, Object> params) { |
|
|
public PageData<IcVaccinePrarmeterDTO> page(Map<String, Object> params) { |
|
|
IPage<IcVaccinePrarmeterEntity> page = baseDao.selectPage( |
|
|
IPage<IcVaccinePrarmeterEntity> page = baseDao.selectPage( |
|
@ -84,4 +130,273 @@ public class IcVaccinePrarmeterServiceImpl extends BaseServiceImpl<IcVaccinePrar |
|
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Desc: 【新冠病毒疫苗接种人员信息台账】导入 |
|
|
|
|
|
* @param tokenDto |
|
|
|
|
|
* @param inputStream |
|
|
|
|
|
* @param taskId |
|
|
|
|
|
* @author wgf |
|
|
|
|
|
* @date 2022/8/22 15:35 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
@Async |
|
|
|
|
|
public void importFile(TokenDto tokenDto, InputStream inputStream, String taskId) { |
|
|
|
|
|
List<PointNucleicMonitoringErrorModel> errorInfo = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
List<IcVaccinePrarmeterImportExcel> list = ExcelPoiUtils.importExcel(inputStream, 0,1, IcVaccinePrarmeterImportExcel.class); |
|
|
|
|
|
if (CollectionUtils.isEmpty(list)){ |
|
|
|
|
|
closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,""); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
|
|
|
if (null == staffInfo){ |
|
|
|
|
|
throw new EpmetException("未查询到工作人员信息"+tokenDto.getUserId()); |
|
|
|
|
|
} |
|
|
|
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); |
|
|
|
|
|
if (null == agencyInfo){ |
|
|
|
|
|
throw new EpmetException("未查询到组织信息"+staffInfo.getAgencyId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 校验空单元格以及网格名称是否正确
|
|
|
|
|
|
checkInfo(list,errorInfo,tokenDto); |
|
|
|
|
|
|
|
|
|
|
|
if (list.size() > errorInfo.size()){ |
|
|
|
|
|
Map<String, Long> groupByName = list.stream().collect(Collectors.groupingBy(IcVaccinePrarmeterImportExcel::getName, Collectors.counting())); |
|
|
|
|
|
groupByName.forEach((name,count) -> { |
|
|
|
|
|
if (Integer.valueOf(count.toString()).compareTo(1) != 0){ |
|
|
|
|
|
for (IcVaccinePrarmeterImportExcel i : list) { |
|
|
|
|
|
if (name.equals(i.getName()) && !i.getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(i,"数据重复",i.getNum())); |
|
|
|
|
|
i.setAddStatus(true); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
Map<Boolean, List<IcVaccinePrarmeterImportExcel>> groupByStatus = list.stream().collect(Collectors.groupingBy(IcVaccinePrarmeterImportExcel::getAddStatus)); |
|
|
|
|
|
List<IcVaccinePrarmeterImportExcel> needInsert = groupByStatus.get(false); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(needInsert)){ |
|
|
|
|
|
List<IcVaccinePrarmeterEntity> entities = ConvertUtils.sourceToTarget(needInsert, IcVaccinePrarmeterEntity.class); |
|
|
|
|
|
entities.forEach(e -> { |
|
|
|
|
|
// 设置客户ID
|
|
|
|
|
|
e.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
|
|
}); |
|
|
|
|
|
insertBatch(entities); |
|
|
|
|
|
} |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(errorInfo)){ |
|
|
|
|
|
String url = importOssUpload(errorInfo, PointNucleicMonitoringErrorModel.class); |
|
|
|
|
|
closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,url); |
|
|
|
|
|
}else { |
|
|
|
|
|
closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS,""); |
|
|
|
|
|
} |
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
log.error(e.getMessage()); |
|
|
|
|
|
closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,""); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 校验空单元格以及网格名称是否正确 |
|
|
|
|
|
* @param list |
|
|
|
|
|
* @param errorInfo |
|
|
|
|
|
* @param tokenDto |
|
|
|
|
|
*/ |
|
|
|
|
|
public void checkInfo(List<IcVaccinePrarmeterImportExcel> list,List<PointNucleicMonitoringErrorModel> errorInfo,TokenDto tokenDto){ |
|
|
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
|
|
list.get(i).setNum(i+1); |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getGridName()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "所属网格不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getVillageName()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "所属小区不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getBuildName()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "所属楼宇不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getUnitName()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "单元不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getHomeName()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "门牌号不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getName()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "姓名不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "身份证号不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getMobile()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "咨询电话不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getIsVaccination()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "是否接种不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if("0".equals(list.get(i).getIsVaccination())){ |
|
|
|
|
|
// 未接种 判断是否填写原因
|
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getReason()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "选择未接种时,原因不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if("其他原因".equals(list.get(i).getReason())){ |
|
|
|
|
|
// 未接种原因选择其他,判断是否填写备注
|
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getNote()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "选择其他原因时,备注不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
// 已接种 判断是否填写接种时间地点
|
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getFirstVacTime()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "第一次接种时间不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getFirstVacSite()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "第一次接种地点不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getSecondVacTime()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "第二次接种时间不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getSecondVacSite()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "第二次接种地点不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getThirdVacTime()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "第三次接种时间不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isBlank(list.get(i).getThirdVacSite()) && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "第三次接种地点不能为空",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 校验所属组织通过名称能否匹配到ID
|
|
|
|
|
|
GridInfoVaccinePrarmeterFormDTO formDTO = new GridInfoVaccinePrarmeterFormDTO(); |
|
|
|
|
|
formDTO.setGridName(list.get(i).getGridName()); |
|
|
|
|
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
|
|
Result<GridInfoByNameResultDTO> resultDTOResult = govOrgFeignClient.getGridInfoByGridName(formDTO); |
|
|
|
|
|
GridInfoByNameResultDTO gridInfoByNameResultDTO = resultDTOResult.getData(); |
|
|
|
|
|
if(gridInfoByNameResultDTO == null && !list.get(i).getAddStatus()){ |
|
|
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "所属网格匹配失败",i+1)); |
|
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
|
|
continue; |
|
|
|
|
|
}else{ |
|
|
|
|
|
list.get(i).setGridId(gridInfoByNameResultDTO.getDeptId()); |
|
|
|
|
|
list.get(i).setPid(gridInfoByNameResultDTO.getPid()); |
|
|
|
|
|
list.get(i).setPids(gridInfoByNameResultDTO.getPids()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Desc: 文件上传并返回url |
|
|
|
|
|
* @param errorRows |
|
|
|
|
|
* @param tClass |
|
|
|
|
|
* @author wgf |
|
|
|
|
|
* @date 2022/8/23 09:16 |
|
|
|
|
|
*/ |
|
|
|
|
|
public <T> String importOssUpload(Collection<?> errorRows, Class<T> tClass) throws IOException { |
|
|
|
|
|
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的数据列表","导入失败的数据列表"), |
|
|
|
|
|
tClass, errorRows); |
|
|
|
|
|
|
|
|
|
|
|
// 文件名
|
|
|
|
|
|
String resultDescFileName = UUID.randomUUID().toString().concat(".xls"); |
|
|
|
|
|
|
|
|
|
|
|
FileItemFactory factory = new DiskFileItemFactory(16, null); |
|
|
|
|
|
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName); |
|
|
|
|
|
OutputStream os = fileItem.getOutputStream(); |
|
|
|
|
|
Result<UploadImgResultDTO> uploadResult = null; |
|
|
|
|
|
try { |
|
|
|
|
|
workbook.write(os); |
|
|
|
|
|
uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
String errormsg = ExceptionUtils.getErrorStackTrace(e); |
|
|
|
|
|
log.error("上传错误描述文件:{}", errormsg); |
|
|
|
|
|
} finally { |
|
|
|
|
|
try { |
|
|
|
|
|
os.close(); |
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
String errormsg = ExceptionUtils.getErrorStackTrace(e); |
|
|
|
|
|
log.error("上传错误描述文件关闭输出流:{}", errormsg); |
|
|
|
|
|
} |
|
|
|
|
|
try { |
|
|
|
|
|
fileItem.delete(); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
String errormsg = ExceptionUtils.getErrorStackTrace(e); |
|
|
|
|
|
log.error("上传错误描述文件删除临时文件:{}", errormsg); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (uploadResult == null || !uploadResult.success()) { |
|
|
|
|
|
log.error("调用OSS上传结果描述文件失败"); |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
return uploadResult.getData().getUrl(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Desc: 关闭任务 |
|
|
|
|
|
* @param taskId |
|
|
|
|
|
* @param userId |
|
|
|
|
|
* @param status |
|
|
|
|
|
* @param url |
|
|
|
|
|
* @author wgf |
|
|
|
|
|
* @date 2022/8/23 09:05 |
|
|
|
|
|
*/ |
|
|
|
|
|
public void closeTask(String taskId,String userId,String status,String url){ |
|
|
|
|
|
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); |
|
|
|
|
|
input.setOperatorId(userId); |
|
|
|
|
|
input.setTaskId(taskId); |
|
|
|
|
|
input.setProcessStatus(status); |
|
|
|
|
|
input.setResultDescFilePath(url); |
|
|
|
|
|
commonServiceOpenFeignClient.finishImportTask(input); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Desc: 构造错误信息 |
|
|
|
|
|
* @param dto |
|
|
|
|
|
* @param info |
|
|
|
|
|
* @param num |
|
|
|
|
|
* @author wgf |
|
|
|
|
|
* @date 2022/8/23 17:17 |
|
|
|
|
|
*/ |
|
|
|
|
|
public PointNucleicMonitoringErrorModel getErrorInfo(IcVaccinePrarmeterImportExcel dto, String info, Integer num){ |
|
|
|
|
|
PointNucleicMonitoringErrorModel result = ConvertUtils.sourceToTarget(dto, PointNucleicMonitoringErrorModel.class); |
|
|
|
|
|
result.setErrorMsg(info); |
|
|
|
|
|
result.setNum(num); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |