敏感及重要用户导入
This commit is contained in:
@@ -23,6 +23,7 @@ import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -127,6 +128,9 @@ public class ExcelUtil {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
//获取行
|
||||
Row row = sheetAt.getRow(i);
|
||||
if(Objects.isNull(row)){
|
||||
continue;
|
||||
}
|
||||
for (int j = 0; j < physicalNumberOfCells; j++) {
|
||||
//获取单元格对象
|
||||
Cell cell = row.getCell(j);
|
||||
|
||||
@@ -14,7 +14,8 @@ public class SensitiveUserExcel implements Serializable {
|
||||
/**
|
||||
* 所属地市
|
||||
*/
|
||||
@Excel(name = "供电单位", width = 30)
|
||||
@Excel(name = "*供电单位", width = 30)
|
||||
@NotBlank(message = "供电单位不能为空")
|
||||
private String city;
|
||||
|
||||
/**
|
||||
@@ -34,7 +35,7 @@ public class SensitiveUserExcel implements Serializable {
|
||||
/**
|
||||
* 用户状态
|
||||
*/
|
||||
@Excel(name = "用户状态", width = 20, replace = {"可研_0", "建设_1", "运行_2", "退运_3"})
|
||||
@Excel(name = "用户状态", width = 20, replace = {"可研_0", "建设_1", "运行_2", "退运_3", "_null"})
|
||||
private Integer userStatus;
|
||||
|
||||
/**
|
||||
|
||||
@@ -462,8 +462,8 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
|
||||
@Override
|
||||
public void downloadSensitiveUserTemplate() {
|
||||
ExportParams exportParams = new ExportParams("敏感及重要用户模板(带*字段均是必填,请严格按照模板标准填入数据)", "重要用户");
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setSheetName("敏感及重要用户");
|
||||
List<DictData> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||
List<DictData> industryType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDUSTRY_TYPE_JB.getCode()).getData();
|
||||
List<DictData> loadLevel = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.LOAD_LEVEL.getCode()).getData();
|
||||
@@ -519,7 +519,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
public String importSensitiveUserData(MultipartFile file, HttpServletResponse response) {
|
||||
ImportParams params = new ImportParams();
|
||||
params.setHeadRows(1);//表头
|
||||
params.setTitleRows(1);//标题
|
||||
// params.setTitleRows(1);//标题
|
||||
params.setNeedVerify(true);
|
||||
params.setStartSheetIndex(0);
|
||||
params.setSheetNum(1);
|
||||
@@ -556,7 +556,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
//该用户已经录入
|
||||
SensitiveUserExcel.SensitiveUserExcelMsg sensitiveUserExcelMsg = new SensitiveUserExcel.SensitiveUserExcelMsg();
|
||||
BeanUtils.copyProperties(sensitiveUserExcel, sensitiveUserExcelMsg);
|
||||
sensitiveUserExcelMsg.setMsg("该用户已录入,请联系管理员!");
|
||||
sensitiveUserExcelMsg.setMsg("该用户已录入!");
|
||||
sensitiveUserExcelMsgs.add(sensitiveUserExcelMsg);
|
||||
// }
|
||||
continue;
|
||||
@@ -610,7 +610,6 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
return null;
|
||||
}
|
||||
return CommonResponseEnum.SUCCESS.getCode();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user