人员基础信息导入2

This commit is contained in:
wans 2021-03-19 11:19:58 +08:00
parent a79bf7f9b7
commit e2ad26055e
3 changed files with 27 additions and 26 deletions

View File

@ -138,9 +138,8 @@ public class BasePopulationInfoController extends AbstractController {
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<List<String>> listHeaders = new ArrayList<>();
String [] headers = {
"姓名","曾用名","性别","身份证号","出生日期","联系方式","籍贯","民族","宗教信仰","学历","政治面貌",
"婚姻情况","职业类别","职业","服务处所","户籍地(省)","市/直辖","区/县","详细地址","现住地(省)",
"市/直辖","区/县","详细地址"
"公民身份证","姓名","曾用名","性别","出生日期","民族","籍贯","婚姻情况","政治面貌","学历","宗教信仰","职业类别",
"职业","服务处所","联系方式","户籍地","户籍地门(楼)详址","现住地", "市/直辖","区/县","现住地门(楼)详址"
};
List<List<String>> listHeader = new ArrayList<>();
for (String item : headers){

View File

@ -4,16 +4,16 @@ import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.cm.common.utils.UUIDUtil;
import com.cm.population.service.basepopulationinfo.IBasePopulationInfoService;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
* @author xwangs
* @create 2021-03-18 17:26
* @description
*/
public class PopulationBaseInfoUploadListener extends AnalysisEventListener<Map<String, Object>> {
public class PopulationBaseInfoUploadListener extends AnalysisEventListener<Map<Integer, Object>> {
private static final int BATCH_COUNT = 3000;
private IBasePopulationInfoService service;
@ -24,27 +24,29 @@ public class PopulationBaseInfoUploadListener extends AnalysisEventListener<Map<
}
@Override
public void invoke(Map<String, Object> data, AnalysisContext context) {
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
int columnCount = 19;
for (int i = 0; i < columnCount; i++){
data.put(i,StringUtils.isEmpty(data.get(i)) ? "" : data.get(i).toString().trim());
}
Map<String, Object> dataObj = new HashMap<>(32);
dataObj.put("fullName",data.get(0));
dataObj.put("nameUsedBefore",data.get(1));
dataObj.put("gender",data.get(2));
dataObj.put("idCardNumber",data.get(3));
dataObj.put("idCardNumber",data.get(0));
dataObj.put("fullName",data.get(1));
dataObj.put("nameUsedBefore",data.get(2));
dataObj.put("gender",data.get(3));
dataObj.put("birthDate",data.get(4));
dataObj.put("telephone",data.get(5));
dataObj.put("nation",data.get(5));
dataObj.put("nativePlace",data.get(6));
dataObj.put("nation",data.get(7));
dataObj.put("religion",data.get(8));
dataObj.put("maritalStatus",data.get(7));
dataObj.put("politicalStatus",data.get(8));
dataObj.put("education",data.get(9));
dataObj.put("politicalStatus",data.get(10));
dataObj.put("maritalStatus",data.get(11));
dataObj.put("occupationCategory",data.get(12));
dataObj.put("occupation",data.get(13));
dataObj.put("serviceSpace",data.get(14));
dataObj.put("registeredResidence",data.get(15).toString() + data.get(16).toString() + data.get(17).toString());
dataObj.put("registeredResidenceAddr",data.get(18));
dataObj.put("currentResidence",data.get(19).toString() + data.get(20).toString() + data.get(21).toString());
dataObj.put("currentResidenceAddr",data.get(22));
dataObj.put("religion",data.get(10));
dataObj.put("occupationCategory",data.get(11));
dataObj.put("occupation",data.get(12));
dataObj.put("serviceSpace",data.get(13));
dataObj.put("telephone",data.get(14));
dataObj.put("registeredResidenceAddr",data.get(15).toString() + data.get(16).toString());
dataObj.put("currentResidenceAddr",data.get(17).toString() + data.get(18).toString());
service.saveBasePopulationInfoImport(dataObj);
}

View File

@ -77,7 +77,7 @@
reloadTable(1);
}
,error: function(){
console.log("erererer");
console.log("error");
}
});
@ -175,7 +175,7 @@
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
return row['registeredResidenceAddr'];
}
return rowData + '-' + row['registeredResidenceAddr'];
}
@ -184,7 +184,7 @@
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
return row['currentResidenceAddr'];
}
return rowData + '-' + row['currentResidenceAddr'];
}