|
|
@ -3,6 +3,7 @@ package com.epmet.excel.handler; |
|
|
|
import com.alibaba.excel.context.AnalysisContext; |
|
|
|
import com.alibaba.excel.read.listener.ReadListener; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
|
import com.epmet.commons.tools.exception.ValidateException; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
@ -37,7 +38,7 @@ public class IcSuperiorResourceExcelImportListener implements ReadListener<IcSup |
|
|
|
private String currentCustomerId; |
|
|
|
private String currentAgencyId; |
|
|
|
private String currentAgencyPids; |
|
|
|
|
|
|
|
private CustomerStaffInfoCacheResult staffInfo; |
|
|
|
//数据
|
|
|
|
private List<IcSuperiorResourceEntity> datas = new ArrayList<>(); |
|
|
|
//错误项列表
|
|
|
@ -51,8 +52,8 @@ public class IcSuperiorResourceExcelImportListener implements ReadListener<IcSup |
|
|
|
private Map<String, String> existMap = null; |
|
|
|
|
|
|
|
|
|
|
|
public IcSuperiorResourceExcelImportListener(String currentUserId, String currentCustomerId, String currentAgencyId, String currentAgencyPids, |
|
|
|
IcSuperiorResourceServiceImpl icSuperiorResourceServiceImpl, CoverageService coverageService, IcSuperiorResourceDao icSuperiorResourceDao) { |
|
|
|
public IcSuperiorResourceExcelImportListener(CustomerStaffInfoCacheResult staffInfo, String currentUserId, String currentCustomerId, String currentAgencyId, String currentAgencyPids, |
|
|
|
IcSuperiorResourceServiceImpl icSuperiorResourceServiceImpl, CoverageService coverageService, IcSuperiorResourceDao icSuperiorResourceDao) { |
|
|
|
this.currentUserId = currentUserId; |
|
|
|
this.currentCustomerId = currentCustomerId; |
|
|
|
this.currentAgencyId = currentAgencyId; |
|
|
@ -60,6 +61,7 @@ public class IcSuperiorResourceExcelImportListener implements ReadListener<IcSup |
|
|
|
this.icSuperiorResourceServiceImpl = icSuperiorResourceServiceImpl; |
|
|
|
this.coverageService = coverageService; |
|
|
|
this.icSuperiorResourceDao = icSuperiorResourceDao; |
|
|
|
this.staffInfo = staffInfo; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -96,7 +98,9 @@ public class IcSuperiorResourceExcelImportListener implements ReadListener<IcSup |
|
|
|
icSuperiorResourceEntity.setSourceType("import"); |
|
|
|
icSuperiorResourceEntity.setCategory(data.getCategoryName()); |
|
|
|
icSuperiorResourceEntity.setAreaCovered(data.getAreaCoveredName()); |
|
|
|
if(StringUtils.isNotBlank(data.getCapacityName())){ |
|
|
|
icSuperiorResourceEntity.setLatitude(staffInfo.getLatitude()); |
|
|
|
icSuperiorResourceEntity.setLongitude(staffInfo.getLongitude()); |
|
|
|
if (StringUtils.isNotBlank(data.getCapacityName())) { |
|
|
|
icSuperiorResourceEntity.setCapacity(Integer.parseInt(data.getCapacityName())); |
|
|
|
} |
|
|
|
icSuperiorResourceEntity.setCreatedBy(currentUserId); |
|
|
|