feat: 增加大汉,安徽卡的导入
parent
d010a3a792
commit
58691e83a8
@ -0,0 +1,41 @@
|
||||
package com.shxy.xymanager_service.excel;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.shxy.xymanager_common.constant.Constants;
|
||||
import com.shxy.xymanager_common.entity.SimInfo;
|
||||
import com.shxy.xymanager_common.util.StringUtils;
|
||||
import com.shxy.xymanager_service.service.SimService;
|
||||
|
||||
public class DahanExcelListener extends AnalysisEventListener<DahanLine> {
|
||||
|
||||
SimService service;
|
||||
|
||||
public DahanExcelListener(SimService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(DahanLine line, AnalysisContext analysisContext) {
|
||||
int rowidx = analysisContext.readRowHolder().getRowIndex();
|
||||
if (rowidx > 0) {
|
||||
processLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
private void processLine(DahanLine line) {
|
||||
if (StringUtils.isNotEmpty(line.getIccid()) && StringUtils.isNotEmpty(line.getMsisdn())) {
|
||||
SimInfo sim = new SimInfo();
|
||||
sim.setIccid(line.getIccid());
|
||||
sim.setMsisdn(line.getMsisdn());
|
||||
sim.setImsi(line.getImsi());
|
||||
sim.setType(Constants.NetType_Dahan);
|
||||
service.addOrUpdate(sim);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.shxy.xymanager_service.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DahanLine {
|
||||
|
||||
@ExcelProperty("ICCID")
|
||||
private String iccid;
|
||||
|
||||
@ExcelProperty("MSISDN")
|
||||
private String msisdn;
|
||||
|
||||
@ExcelProperty("IMSI")
|
||||
private String imsi;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.shxy.xymanager_service.excel;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.shxy.xymanager_common.constant.Constants;
|
||||
import com.shxy.xymanager_common.entity.SimInfo;
|
||||
import com.shxy.xymanager_common.util.StringUtils;
|
||||
import com.shxy.xymanager_service.service.SimService;
|
||||
|
||||
public class LwwlkjExcelListener extends AnalysisEventListener<LwwlkjLine> {
|
||||
|
||||
SimService service;
|
||||
|
||||
public LwwlkjExcelListener(SimService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(LwwlkjLine line, AnalysisContext analysisContext) {
|
||||
int rowidx = analysisContext.readRowHolder().getRowIndex();
|
||||
if (rowidx > 0) {
|
||||
processLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
private void processLine(LwwlkjLine line) {
|
||||
if (StringUtils.isNotEmpty(line.getIccid()) && StringUtils.isNotEmpty(line.getMsisdn())) {
|
||||
SimInfo sim = new SimInfo();
|
||||
sim.setIccid(line.getIccid());
|
||||
sim.setMsisdn(line.getMsisdn());
|
||||
sim.setType(Constants.NetType_LWWLKJ);
|
||||
service.addOrUpdate(sim);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.shxy.xymanager_service.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LwwlkjLine {
|
||||
|
||||
@ExcelProperty("运营商")
|
||||
private String provider;
|
||||
|
||||
@ExcelProperty("物联卡号")
|
||||
private String msisdn;
|
||||
|
||||
@ExcelProperty("ICCID")
|
||||
private String iccid;
|
||||
|
||||
}
|
Loading…
Reference in New Issue