批量导入功能问题修改。
This commit is contained in:
parent
bb15f1e84d
commit
8166d7698f
@ -12,6 +12,7 @@ import com.cm.population.utils.ImportExcelHelper;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入excel的监听处理类
|
* 导入excel的监听处理类
|
||||||
@ -125,7 +126,7 @@ public class ImportExcelListener<T> extends AnalysisEventListener<T>{
|
|||||||
if(list.size() > BATCH_COUNT){
|
if(list.size() > BATCH_COUNT){
|
||||||
try {
|
try {
|
||||||
insertData();
|
insertData();
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,6 +144,8 @@ public class ImportExcelListener<T> extends AnalysisEventListener<T>{
|
|||||||
insertData();
|
insertData();
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,127 +201,127 @@ public class ImportExcelListener<T> extends AnalysisEventListener<T>{
|
|||||||
/**
|
/**
|
||||||
* 将数据插入数据库操作
|
* 将数据插入数据库操作
|
||||||
*/
|
*/
|
||||||
private void insertData() throws NoSuchMethodException {
|
private void insertData() throws Exception {
|
||||||
String value = "";
|
String value = "";
|
||||||
// 出租房
|
// 出租房
|
||||||
if(list.get(0) instanceof RentalHousingModel) {
|
if(list.get(0) instanceof RentalHousingModel) {
|
||||||
for(int i=0;i<listForDistinct.size();i++) {
|
List<RentalHousingModel> rentalHousingModelList = (List<RentalHousingModel>) list;
|
||||||
RentalHousingModel rentalHousingModel = (RentalHousingModel) listForDistinct.get(i);
|
// 用来临时储存数据
|
||||||
if(i == 0) {
|
List<String> houseNumber = new ArrayList<>();
|
||||||
value = rentalHousingModel.getHouseNumber();
|
// 过滤去重
|
||||||
continue;
|
List<RentalHousingModel> rentalHousingModelList1 = rentalHousingModelList.stream().filter(
|
||||||
}
|
v -> {
|
||||||
if(value.equals(rentalHousingModel.getHouseNumber())) {
|
boolean flag = !houseNumber.contains(v.getHouseNumber());
|
||||||
T t = (T) rentalHousingModel;
|
houseNumber.add(v.getHouseNumber());
|
||||||
String msg = "房屋编号重复";
|
if(!flag) {
|
||||||
ImportFailDto importFailDto = new ImportFailDto(t, msg);
|
String msg = "房屋编号重复";
|
||||||
importFailDtoList.add(importFailDto);
|
ImportFailDto importFailDto = new ImportFailDto(v, msg);
|
||||||
listForDistinct.remove(i);
|
importFailDtoList.add(importFailDto);
|
||||||
list.remove(i);
|
}
|
||||||
continue;
|
return flag;
|
||||||
}
|
}
|
||||||
}
|
).collect(Collectors.toList());
|
||||||
handleImportExcelService.saveRentalHousing(list);
|
handleImportExcelService.saveRentalHousing(rentalHousingModelList1, importFailDtoList);
|
||||||
}
|
}
|
||||||
// 户籍信息
|
// 户籍信息
|
||||||
if(list.get(0) instanceof CensusMsgModel) {
|
if(list.get(0) instanceof CensusMsgModel) {
|
||||||
for(int i=0;i<listForDistinct.size();i++) {
|
List<CensusMsgModel> censusMsgModelList = (List<CensusMsgModel>) list;
|
||||||
CensusMsgModel censusMsgModel = (CensusMsgModel) listForDistinct.get(i);
|
// 用来临时储存数据
|
||||||
if(i == 0) {
|
List<String> baseId = new ArrayList<>();
|
||||||
value = censusMsgModel.getBaseId();
|
// 过滤去重
|
||||||
continue;
|
List<CensusMsgModel> censusMsgModelList1 = censusMsgModelList.stream().filter(
|
||||||
}
|
v -> {
|
||||||
if(value.equals(censusMsgModel.getBaseId())) {
|
boolean flag = !baseId.contains(v.getBaseId());
|
||||||
T t = (T) censusMsgModel;
|
baseId.add(v.getBaseId());
|
||||||
String msg = "身份证号码重复";
|
if(!flag) {
|
||||||
ImportFailDto importFailDto = new ImportFailDto(t, msg);
|
String msg = "身份证号码重复";
|
||||||
importFailDtoList.add(importFailDto);
|
ImportFailDto importFailDto = new ImportFailDto(v, msg);
|
||||||
listForDistinct.remove(i);
|
importFailDtoList.add(importFailDto);
|
||||||
list.remove(i);
|
}
|
||||||
continue;
|
return flag;
|
||||||
}
|
}
|
||||||
}
|
).collect(Collectors.toList());
|
||||||
handleImportExcelService.saveCensusMsg(list);
|
handleImportExcelService.saveCensusMsg(censusMsgModelList1, importFailDtoList);
|
||||||
}
|
}
|
||||||
// 留守人员
|
// 留守人员
|
||||||
if(list.get(0) instanceof HomePersonModel) {
|
if(list.get(0) instanceof HomePersonModel) {
|
||||||
for(int i=0;i<listForDistinct.size();i++) {
|
List<HomePersonModel> homePersonModelList = (List<HomePersonModel>) list;
|
||||||
HomePersonModel homePersonModel = (HomePersonModel) listForDistinct.get(i);
|
// 用来临时储存数据
|
||||||
if(i == 0) {
|
List<String> baseId = new ArrayList<>();
|
||||||
value = homePersonModel.getBaseId();
|
// 过滤去重
|
||||||
continue;
|
List<HomePersonModel> homePersonModelList1 = homePersonModelList.stream().filter(
|
||||||
}
|
v -> {
|
||||||
if(value.equals(homePersonModel.getBaseId())) {
|
boolean flag = !baseId.contains(v.getBaseId());
|
||||||
T t = (T) homePersonModel;
|
baseId.add(v.getBaseId());
|
||||||
String msg = "身份证号码重复";
|
if(!flag) {
|
||||||
ImportFailDto importFailDto = new ImportFailDto(t, msg);
|
String msg = "身份证号码重复";
|
||||||
importFailDtoList.add(importFailDto);
|
ImportFailDto importFailDto = new ImportFailDto(v, msg);
|
||||||
listForDistinct.remove(i);
|
importFailDtoList.add(importFailDto);
|
||||||
list.remove(i);
|
}
|
||||||
continue;
|
return flag;
|
||||||
}
|
}
|
||||||
}
|
).collect(Collectors.toList());
|
||||||
handleImportExcelService.saveHomePerson(list);
|
handleImportExcelService.saveHomePerson(homePersonModelList1, importFailDtoList);
|
||||||
}
|
}
|
||||||
// 流动人口
|
// 流动人口
|
||||||
if(list.get(0) instanceof FloatingPopulationModel) {
|
if(list.get(0) instanceof FloatingPopulationModel) {
|
||||||
for(int i=0;i<listForDistinct.size();i++) {
|
List<FloatingPopulationModel> floatingPopulationModelList = (List<FloatingPopulationModel>) list;
|
||||||
FloatingPopulationModel floatingPopulationModel = (FloatingPopulationModel) listForDistinct.get(i);
|
// 用来临时储存数据
|
||||||
if(i == 0) {
|
List<String> baseId = new ArrayList<>();
|
||||||
value = floatingPopulationModel.getBaseId();
|
// 过滤去重
|
||||||
continue;
|
List<FloatingPopulationModel> floatingPopulationModelList1 = floatingPopulationModelList.stream().filter(
|
||||||
}
|
v -> {
|
||||||
if(value.equals(floatingPopulationModel.getBaseId())) {
|
boolean flag = !baseId.contains(v.getBaseId());
|
||||||
T t = (T) floatingPopulationModel;
|
baseId.add(v.getBaseId());
|
||||||
String msg = "身份证号码重复";
|
if(!flag) {
|
||||||
ImportFailDto importFailDto = new ImportFailDto(t, msg);
|
String msg = "身份证号码重复";
|
||||||
importFailDtoList.add(importFailDto);
|
ImportFailDto importFailDto = new ImportFailDto(v, msg);
|
||||||
listForDistinct.remove(i);
|
importFailDtoList.add(importFailDto);
|
||||||
list.remove(i);
|
}
|
||||||
continue;
|
return flag;
|
||||||
}
|
}
|
||||||
}
|
).collect(Collectors.toList());
|
||||||
handleImportExcelService.saveFloatingPopulation(list);
|
handleImportExcelService.saveFloatingPopulation(floatingPopulationModelList1, importFailDtoList);
|
||||||
}
|
}
|
||||||
// 重点青少年
|
// 重点青少年
|
||||||
if(list.get(0) instanceof KeyTeenagersModel) {
|
if(list.get(0) instanceof KeyTeenagersModel) {
|
||||||
for(int i=0;i<listForDistinct.size();i++) {
|
List<KeyTeenagersModel> keyTeenagersModelList = (List<KeyTeenagersModel>) list;
|
||||||
KeyTeenagersModel keyTeenagersModel = (KeyTeenagersModel) listForDistinct.get(i);
|
// 用来临时储存数据
|
||||||
if(i == 0) {
|
List<String> baseId = new ArrayList<>();
|
||||||
value = keyTeenagersModel.getBaseId();
|
// 过滤去重
|
||||||
continue;
|
List<KeyTeenagersModel> keyTeenagersModelList1 = keyTeenagersModelList.stream().filter(
|
||||||
}
|
v -> {
|
||||||
if(value.equals(keyTeenagersModel.getBaseId())) {
|
boolean flag = !baseId.contains(v.getBaseId());
|
||||||
T t = (T) keyTeenagersModel;
|
baseId.add(v.getBaseId());
|
||||||
String msg = "身份证号码重复";
|
if(!flag) {
|
||||||
ImportFailDto importFailDto = new ImportFailDto(t, msg);
|
String msg = "身份证号码重复";
|
||||||
importFailDtoList.add(importFailDto);
|
ImportFailDto importFailDto = new ImportFailDto(v, msg);
|
||||||
listForDistinct.remove(i);
|
importFailDtoList.add(importFailDto);
|
||||||
list.remove(i);
|
}
|
||||||
continue;
|
return flag;
|
||||||
}
|
}
|
||||||
}
|
).collect(Collectors.toList());
|
||||||
handleImportExcelService.saveKeyTeenagers(list);
|
handleImportExcelService.saveKeyTeenagers(keyTeenagersModelList1, importFailDtoList);
|
||||||
}
|
}
|
||||||
// 境外人员
|
// 境外人员
|
||||||
if(list.get(0) instanceof OverseaspersonnelModel) {
|
if(list.get(0) instanceof OverseaspersonnelModel) {
|
||||||
for(int i=0;i<listForDistinct.size();i++) {
|
List<OverseaspersonnelModel> overseaspersonnelModelList = (List<OverseaspersonnelModel>) list;
|
||||||
OverseaspersonnelModel overseaspersonnelModel = (OverseaspersonnelModel) listForDistinct.get(i);
|
// 用来临时储存数据
|
||||||
if(i == 0) {
|
List<String> cardNumber = new ArrayList<>();
|
||||||
value = overseaspersonnelModel.getCardNumber();
|
// 过滤去重
|
||||||
continue;
|
List<OverseaspersonnelModel> overseaspersonnelModelList1 = overseaspersonnelModelList.stream().filter(
|
||||||
}
|
v -> {
|
||||||
if(value.equals(overseaspersonnelModel.getCardNumber())) {
|
boolean flag = !cardNumber.contains(v.getCardNumber());
|
||||||
T t = (T) overseaspersonnelModel;
|
cardNumber.add(v.getCardNumber());
|
||||||
String msg = "证件号码重复";
|
if(!flag) {
|
||||||
ImportFailDto importFailDto = new ImportFailDto(t, msg);
|
String msg = "证件号码重复";
|
||||||
importFailDtoList.add(importFailDto);
|
ImportFailDto importFailDto = new ImportFailDto(v, msg);
|
||||||
listForDistinct.remove(i);
|
importFailDtoList.add(importFailDto);
|
||||||
list.remove(i);
|
}
|
||||||
continue;
|
return flag;
|
||||||
}
|
}
|
||||||
}
|
).collect(Collectors.toList());
|
||||||
handleImportExcelService.saveOverseaspersonnel(list);
|
handleImportExcelService.saveOverseaspersonnel(overseaspersonnelModelList1, importFailDtoList);
|
||||||
}
|
}
|
||||||
listForDistinct.clear();
|
listForDistinct.clear();
|
||||||
list.clear();
|
list.clear();
|
||||||
|
@ -48,6 +48,7 @@ public class RentalHousingModel {
|
|||||||
private String modifier;
|
private String modifier;
|
||||||
private String gmtModified;
|
private String gmtModified;
|
||||||
private String isDelete;
|
private String isDelete;
|
||||||
|
private String id;
|
||||||
|
|
||||||
public String getHouseNumber() {
|
public String getHouseNumber() {
|
||||||
return houseNumber == null ? "" : houseNumber;
|
return houseNumber == null ? "" : houseNumber;
|
||||||
@ -224,4 +225,12 @@ public class RentalHousingModel {
|
|||||||
public void setIsDelete(String isDelete) {
|
public void setIsDelete(String isDelete) {
|
||||||
this.isDelete = isDelete;
|
this.isDelete = isDelete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id == null ? "" : id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.cm.population.service.handleimportexcel;
|
package com.cm.population.service.handleimportexcel;
|
||||||
|
|
||||||
|
import com.cm.population.pojo.dtos.excel.ImportFailDto;
|
||||||
import com.cm.population.pojo.dtos.excel.ImportResultDto;
|
import com.cm.population.pojo.dtos.excel.ImportResultDto;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -38,42 +39,54 @@ public interface IHandleImportExcelService {
|
|||||||
/**
|
/**
|
||||||
* 批量保存出租房信息
|
* 批量保存出租房信息
|
||||||
* @param list
|
* @param list
|
||||||
|
* @param importFailDtoList
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public <T> void saveRentalHousing(List<T> list);
|
public <T> void saveRentalHousing(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量保存户籍信息
|
* 批量保存户籍信息
|
||||||
* @param list
|
* @param list
|
||||||
|
* @param importFailDtoList
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public <T> void saveCensusMsg(List<T> list);
|
public <T> void saveCensusMsg(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量保存留守人员
|
* 批量保存留守人员
|
||||||
* @param list
|
* @param list
|
||||||
|
* @param importFailDtoList
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public <T> void saveHomePerson(List<T> list);
|
public <T> void saveHomePerson(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量保存流动人员
|
* 批量保存流动人员
|
||||||
* @param list
|
* @param list
|
||||||
|
* @param importFailDtoList
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public <T> void saveFloatingPopulation(List<T> list);
|
public <T> void saveFloatingPopulation(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量保存重点青少年
|
* 批量保存重点青少年
|
||||||
* @param list
|
* @param list
|
||||||
|
* @param importFailDtoList
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public <T> void saveKeyTeenagers(List<T> list);
|
public <T> void saveKeyTeenagers(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量保存境外人员
|
* 批量保存境外人员
|
||||||
* @param list
|
* @param list
|
||||||
|
* @param importFailDtoList
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public <T> void saveOverseaspersonnel(List<T> list);
|
public <T> void saveOverseaspersonnel(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.cm.population.service.handleimportexcel.impl;
|
package com.cm.population.service.handleimportexcel.impl;
|
||||||
|
|
||||||
|
import com.alibaba.excel.util.StringUtils;
|
||||||
import com.cm.common.base.AbstractService;
|
import com.cm.common.base.AbstractService;
|
||||||
|
import com.cm.common.utils.HashMapUtil;
|
||||||
import com.cm.common.utils.UUIDUtil;
|
import com.cm.common.utils.UUIDUtil;
|
||||||
import com.cm.population.dao.censusmsg.ICensusMsgDao;
|
import com.cm.population.dao.censusmsg.ICensusMsgDao;
|
||||||
import com.cm.population.dao.floatingpopulation.IFloatingPopulationDao;
|
import com.cm.population.dao.floatingpopulation.IFloatingPopulationDao;
|
||||||
@ -8,6 +10,7 @@ import com.cm.population.dao.homeperson.IHomePersonDao;
|
|||||||
import com.cm.population.dao.keyteenagers.IKeyTeenagersDao;
|
import com.cm.population.dao.keyteenagers.IKeyTeenagersDao;
|
||||||
import com.cm.population.dao.overseaspersonnel.IOverseasPersonnelDao;
|
import com.cm.population.dao.overseaspersonnel.IOverseasPersonnelDao;
|
||||||
import com.cm.population.dao.rentalhousing.IRentalHousingDao;
|
import com.cm.population.dao.rentalhousing.IRentalHousingDao;
|
||||||
|
import com.cm.population.pojo.dtos.excel.ImportFailDto;
|
||||||
import com.cm.population.pojo.dtos.excel.ImportResultDto;
|
import com.cm.population.pojo.dtos.excel.ImportResultDto;
|
||||||
import com.cm.population.pojo.model.*;
|
import com.cm.population.pojo.model.*;
|
||||||
import com.cm.population.service.handleimportexcel.IHandleImportExcelService;
|
import com.cm.population.service.handleimportexcel.IHandleImportExcelService;
|
||||||
@ -57,7 +60,7 @@ public class HandleImportExcelServiceImpl extends AbstractService implements IHa
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void saveRentalHousing(List<T> list) {
|
public <T> void saveRentalHousing(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception {
|
||||||
List<RentalHousingModel> rentalHousingModelList = (List<RentalHousingModel>) list;
|
List<RentalHousingModel> rentalHousingModelList = (List<RentalHousingModel>) list;
|
||||||
for(RentalHousingModel rentalHousingModel: rentalHousingModelList) {
|
for(RentalHousingModel rentalHousingModel: rentalHousingModelList) {
|
||||||
String rentalHousingId = UUIDUtil.getUUID();
|
String rentalHousingId = UUIDUtil.getUUID();
|
||||||
@ -69,12 +72,19 @@ public class HandleImportExcelServiceImpl extends AbstractService implements IHa
|
|||||||
rentalHousingModel.setModifier(params.get("modifier").toString());
|
rentalHousingModel.setModifier(params.get("modifier").toString());
|
||||||
rentalHousingModel.setGmtModified(params.get("gmtModified").toString());
|
rentalHousingModel.setGmtModified(params.get("gmtModified").toString());
|
||||||
rentalHousingModel.setIsDelete("0");
|
rentalHousingModel.setIsDelete("0");
|
||||||
|
Map<String, Object> param = HashMapUtil.beanToMap(rentalHousingModel);
|
||||||
|
rentalHousingDao.saveRentalHousing(param);
|
||||||
|
if(StringUtils.isEmpty(param.get("id"))) {
|
||||||
|
String msg = "该数据已存在";
|
||||||
|
ImportFailDto importFailDto = new ImportFailDto(rentalHousingModel, msg);
|
||||||
|
importFailDtoList.add(importFailDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rentalHousingDao.saveRentalHousingList(rentalHousingModelList);
|
// rentalHousingDao.saveRentalHousingList(rentalHousingModelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void saveCensusMsg(List<T> list) {
|
public <T> void saveCensusMsg(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception {
|
||||||
List<CensusMsgModel> censusMsgModelList = (List<CensusMsgModel>) list;
|
List<CensusMsgModel> censusMsgModelList = (List<CensusMsgModel>) list;
|
||||||
for(CensusMsgModel censusMsgModel: censusMsgModelList) {
|
for(CensusMsgModel censusMsgModel: censusMsgModelList) {
|
||||||
String censusMsgId = UUIDUtil.getUUID();
|
String censusMsgId = UUIDUtil.getUUID();
|
||||||
@ -86,12 +96,19 @@ public class HandleImportExcelServiceImpl extends AbstractService implements IHa
|
|||||||
censusMsgModel.setModifier(params.get("modifier").toString());
|
censusMsgModel.setModifier(params.get("modifier").toString());
|
||||||
censusMsgModel.setGmtModified(params.get("gmtModified").toString());
|
censusMsgModel.setGmtModified(params.get("gmtModified").toString());
|
||||||
censusMsgModel.setIsDelete("0");
|
censusMsgModel.setIsDelete("0");
|
||||||
|
Map<String, Object> param = HashMapUtil.beanToMap(censusMsgModel);
|
||||||
|
censusMsgDao.saveCensusMsg(param);
|
||||||
|
if(StringUtils.isEmpty(param.get("id"))) {
|
||||||
|
String msg = "该数据已存在";
|
||||||
|
ImportFailDto importFailDto = new ImportFailDto(censusMsgModel, msg);
|
||||||
|
importFailDtoList.add(importFailDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
censusMsgDao.saveCensusMsgList(censusMsgModelList);
|
// censusMsgDao.saveCensusMsgList(censusMsgModelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void saveHomePerson(List<T> list) {
|
public <T> void saveHomePerson(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception {
|
||||||
List<HomePersonModel> homePersonModelList = (List<HomePersonModel>) list;
|
List<HomePersonModel> homePersonModelList = (List<HomePersonModel>) list;
|
||||||
for(HomePersonModel homePersonModel: homePersonModelList) {
|
for(HomePersonModel homePersonModel: homePersonModelList) {
|
||||||
String homePersonId = UUIDUtil.getUUID();
|
String homePersonId = UUIDUtil.getUUID();
|
||||||
@ -103,12 +120,19 @@ public class HandleImportExcelServiceImpl extends AbstractService implements IHa
|
|||||||
homePersonModel.setModifier(params.get("modifier").toString());
|
homePersonModel.setModifier(params.get("modifier").toString());
|
||||||
homePersonModel.setGmtModified(params.get("gmtModified").toString());
|
homePersonModel.setGmtModified(params.get("gmtModified").toString());
|
||||||
homePersonModel.setIsDelete("0");
|
homePersonModel.setIsDelete("0");
|
||||||
|
Map<String, Object> param = HashMapUtil.beanToMap(homePersonModel);
|
||||||
|
homePersonDao.saveHomePerson(param);
|
||||||
|
if(StringUtils.isEmpty(param.get("id"))) {
|
||||||
|
String msg = "该数据已存在";
|
||||||
|
ImportFailDto importFailDto = new ImportFailDto(homePersonModel, msg);
|
||||||
|
importFailDtoList.add(importFailDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
homePersonDao.saveHomePersonList(homePersonModelList);
|
// homePersonDao.saveHomePersonList(homePersonModelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void saveFloatingPopulation(List<T> list) {
|
public <T> void saveFloatingPopulation(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception {
|
||||||
List<FloatingPopulationModel> floatingPopulationModelList = (List<FloatingPopulationModel>) list;
|
List<FloatingPopulationModel> floatingPopulationModelList = (List<FloatingPopulationModel>) list;
|
||||||
for(FloatingPopulationModel floatingPopulationModel: floatingPopulationModelList) {
|
for(FloatingPopulationModel floatingPopulationModel: floatingPopulationModelList) {
|
||||||
String floatingPopulationId = UUIDUtil.getUUID();
|
String floatingPopulationId = UUIDUtil.getUUID();
|
||||||
@ -120,12 +144,19 @@ public class HandleImportExcelServiceImpl extends AbstractService implements IHa
|
|||||||
floatingPopulationModel.setModifier(params.get("modifier").toString());
|
floatingPopulationModel.setModifier(params.get("modifier").toString());
|
||||||
floatingPopulationModel.setGmtModified(params.get("gmtModified").toString());
|
floatingPopulationModel.setGmtModified(params.get("gmtModified").toString());
|
||||||
floatingPopulationModel.setIsDelete("0");
|
floatingPopulationModel.setIsDelete("0");
|
||||||
|
Map<String, Object> param = HashMapUtil.beanToMap(floatingPopulationModel);
|
||||||
|
floatingPopulationDao.saveFloatingPopulation(param);
|
||||||
|
if(StringUtils.isEmpty(param.get("id"))) {
|
||||||
|
String msg = "该数据已存在";
|
||||||
|
ImportFailDto importFailDto = new ImportFailDto(floatingPopulationModel, msg);
|
||||||
|
importFailDtoList.add(importFailDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
floatingPopulationDao.saveFloatingPopulationList(floatingPopulationModelList);
|
// floatingPopulationDao.saveFloatingPopulationList(floatingPopulationModelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void saveKeyTeenagers(List<T> list) {
|
public <T> void saveKeyTeenagers(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception {
|
||||||
List<KeyTeenagersModel> keyTeenagersModelList = (List<KeyTeenagersModel>) list;
|
List<KeyTeenagersModel> keyTeenagersModelList = (List<KeyTeenagersModel>) list;
|
||||||
for(KeyTeenagersModel keyTeenagersModel: keyTeenagersModelList) {
|
for(KeyTeenagersModel keyTeenagersModel: keyTeenagersModelList) {
|
||||||
String keyTeenagersId = UUIDUtil.getUUID();
|
String keyTeenagersId = UUIDUtil.getUUID();
|
||||||
@ -137,12 +168,19 @@ public class HandleImportExcelServiceImpl extends AbstractService implements IHa
|
|||||||
keyTeenagersModel.setModifier(params.get("modifier").toString());
|
keyTeenagersModel.setModifier(params.get("modifier").toString());
|
||||||
keyTeenagersModel.setGmtModified(params.get("gmtModified").toString());
|
keyTeenagersModel.setGmtModified(params.get("gmtModified").toString());
|
||||||
keyTeenagersModel.setIsDelete("0");
|
keyTeenagersModel.setIsDelete("0");
|
||||||
|
Map<String, Object> param = HashMapUtil.beanToMap(keyTeenagersModel);
|
||||||
|
keyTeenagersDao.saveKeyTeenagers(param);
|
||||||
|
if(StringUtils.isEmpty(param.get("id"))) {
|
||||||
|
String msg = "该数据已存在";
|
||||||
|
ImportFailDto importFailDto = new ImportFailDto(keyTeenagersModel, msg);
|
||||||
|
importFailDtoList.add(importFailDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
keyTeenagersDao.saveKeyTeenagersList(keyTeenagersModelList);
|
// keyTeenagersDao.saveKeyTeenagersList(keyTeenagersModelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void saveOverseaspersonnel(List<T> list) {
|
public <T> void saveOverseaspersonnel(List<T> list, List<ImportFailDto> importFailDtoList) throws Exception {
|
||||||
List<OverseaspersonnelModel> overseaspersonnelModelList = (List<OverseaspersonnelModel>) list;
|
List<OverseaspersonnelModel> overseaspersonnelModelList = (List<OverseaspersonnelModel>) list;
|
||||||
for(OverseaspersonnelModel overseaspersonnelModel: overseaspersonnelModelList) {
|
for(OverseaspersonnelModel overseaspersonnelModel: overseaspersonnelModelList) {
|
||||||
String overseasPersonnelId = UUIDUtil.getUUID();
|
String overseasPersonnelId = UUIDUtil.getUUID();
|
||||||
@ -154,8 +192,15 @@ public class HandleImportExcelServiceImpl extends AbstractService implements IHa
|
|||||||
overseaspersonnelModel.setModifier(params.get("modifier").toString());
|
overseaspersonnelModel.setModifier(params.get("modifier").toString());
|
||||||
overseaspersonnelModel.setGmtModified(params.get("gmtModified").toString());
|
overseaspersonnelModel.setGmtModified(params.get("gmtModified").toString());
|
||||||
overseaspersonnelModel.setIsDelete("0");
|
overseaspersonnelModel.setIsDelete("0");
|
||||||
|
Map<String, Object> param = HashMapUtil.beanToMap(overseaspersonnelModel);
|
||||||
|
overseasPersonnelDao.saveOverseasPersonnel(param);
|
||||||
|
if(StringUtils.isEmpty(param.get("id"))) {
|
||||||
|
String msg = "该数据已存在";
|
||||||
|
ImportFailDto importFailDto = new ImportFailDto(overseaspersonnelModel, msg);
|
||||||
|
importFailDtoList.add(importFailDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
overseasPersonnelDao.saveOverseaspersonnelList(overseaspersonnelModelList);
|
// overseasPersonnelDao.saveOverseaspersonnelList(overseaspersonnelModelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,40 +105,52 @@ public class ImportExcelHelper {
|
|||||||
*/
|
*/
|
||||||
private static String checkRentalHousingData(RentalHousingModel rentalHousingModel) {
|
private static String checkRentalHousingData(RentalHousingModel rentalHousingModel) {
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getHouseNumber())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getHouseNumber())) {
|
||||||
return "房屋编号必填";
|
rentalHousingModel.setHouseNumber("" + Math.random() * 1000000);
|
||||||
|
// return "房屋编号必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getHouseAddress())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getHouseAddress())) {
|
||||||
return "房屋地址必填";
|
// rentalHousingModel.setHouseAddress("无");
|
||||||
|
// return "房屋地址必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getCardCode())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getCardCode())) {
|
||||||
return "证件代码必填";
|
// rentalHousingModel.setCardCode("无");
|
||||||
|
// return "证件代码必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getCardNumber())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getCardNumber())) {
|
||||||
return "证件号码必填";
|
// rentalHousingModel.setCardNumber("无");
|
||||||
|
// return "证件号码必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getHouserName())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getHouserName())) {
|
||||||
return "房主姓名必填";
|
// rentalHousingModel.setHouserName("无");
|
||||||
|
// return "房主姓名必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getHouserPhone())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getHouserPhone())) {
|
||||||
return "房主联系方式必填";
|
// rentalHousingModel.setHouserPhone("无");
|
||||||
|
// return "房主联系方式必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getHouserAddress())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getHouserAddress())) {
|
||||||
return "房主现居地址必填";
|
// rentalHousingModel.setHouserAddress("无");
|
||||||
|
// return "房主现居地址必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getLeasePurpose())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getLeasePurpose())) {
|
||||||
return "出租用途必填";
|
// rentalHousingModel.setLeasePurpose("无");
|
||||||
|
// return "出租用途必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getHiddenDangerType())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getHiddenDangerType())) {
|
||||||
return "隐患类型必填";
|
// rentalHousingModel.setHiddenDangerType("无");
|
||||||
|
// return "隐患类型必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getLesseeCardNumber())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getLesseeCardNumber())) {
|
||||||
return "承租人身份证号必填";
|
// rentalHousingModel.setLesseeCardNumber("无");
|
||||||
|
// return "承租人身份证号必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getLesseeName())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getLesseeName())) {
|
||||||
return "承租人姓名必填";
|
// rentalHousingModel.setLesseeName("无");
|
||||||
|
// return "承租人姓名必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(rentalHousingModel.getLesseePhone())) {
|
if(StringUtils.isEmpty(rentalHousingModel.getLesseePhone())) {
|
||||||
return "承租人联系方式必填";
|
// rentalHousingModel.setLesseePhone("无");
|
||||||
|
// return "承租人联系方式必填";
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@ -159,13 +171,13 @@ public class ImportExcelHelper {
|
|||||||
return "须先完善人员基础信息";
|
return "须先完善人员基础信息";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(censusMsgModel.getPeopleSameCensus())) {
|
if(StringUtils.isEmpty(censusMsgModel.getPeopleSameCensus())) {
|
||||||
return "人户一致标识必填";
|
// return "人户一致标识必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(censusMsgModel.getCensusNumber())) {
|
if(StringUtils.isEmpty(censusMsgModel.getCensusNumber())) {
|
||||||
return "户号必填";
|
// return "户号必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(censusMsgModel.getIdCardOfHouseholder())) {
|
if(StringUtils.isEmpty(censusMsgModel.getIdCardOfHouseholder())) {
|
||||||
return "户主公民身份证号必填";
|
// return "户主公民身份证号必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(censusMsgModel.getNameOfHouseholder())) {
|
if(StringUtils.isEmpty(censusMsgModel.getNameOfHouseholder())) {
|
||||||
return "户主姓名必填";
|
return "户主姓名必填";
|
||||||
@ -192,7 +204,7 @@ public class ImportExcelHelper {
|
|||||||
return "须先完善人员基础信息";
|
return "须先完善人员基础信息";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(homePersonModel.getPeopleSameCensus())) {
|
if(StringUtils.isEmpty(homePersonModel.getPeopleSameCensus())) {
|
||||||
return "人户一致标识必填";
|
// return "人户一致标识必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(homePersonModel.getHomePersonType())) {
|
if(StringUtils.isEmpty(homePersonModel.getHomePersonType())) {
|
||||||
return "留守人员类型必填";
|
return "留守人员类型必填";
|
||||||
@ -224,6 +236,9 @@ public class ImportExcelHelper {
|
|||||||
if(StringUtils.isEmpty(floatingPopulationModel.getBaseId())) {
|
if(StringUtils.isEmpty(floatingPopulationModel.getBaseId())) {
|
||||||
return "身份证号码必填";
|
return "身份证号码必填";
|
||||||
}
|
}
|
||||||
|
if(19 == floatingPopulationModel.getBaseId().length()) {
|
||||||
|
floatingPopulationModel.setBaseId(floatingPopulationModel.getBaseId().substring(1, 18));
|
||||||
|
}
|
||||||
Map<String, Object> param = new HashMap<>();
|
Map<String, Object> param = new HashMap<>();
|
||||||
param.put("idCardNumber", floatingPopulationModel.getBaseId());
|
param.put("idCardNumber", floatingPopulationModel.getBaseId());
|
||||||
BasePopulationInfoDTO basePopulationInfoDTO = basePopulationInfoService.getBasePopulationInfo(param);
|
BasePopulationInfoDTO basePopulationInfoDTO = basePopulationInfoService.getBasePopulationInfo(param);
|
||||||
@ -231,7 +246,7 @@ public class ImportExcelHelper {
|
|||||||
return "须先完善人员基础信息";
|
return "须先完善人员基础信息";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(floatingPopulationModel.getInflowReason())) {
|
if(StringUtils.isEmpty(floatingPopulationModel.getInflowReason())) {
|
||||||
return "流入原因必填";
|
// return "流入原因必填";
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(floatingPopulationModel.getResidenceType())) {
|
if(StringUtils.isEmpty(floatingPopulationModel.getResidenceType())) {
|
||||||
return "住所类型必填";
|
return "住所类型必填";
|
||||||
@ -402,7 +417,9 @@ public class ImportExcelHelper {
|
|||||||
* @param rentalHousingModel
|
* @param rentalHousingModel
|
||||||
*/
|
*/
|
||||||
private static void rentalHousingCheck(RentalHousingModel rentalHousingModel) {
|
private static void rentalHousingCheck(RentalHousingModel rentalHousingModel) {
|
||||||
|
if(19 == rentalHousingModel.getLesseeCardNumber().length()) {
|
||||||
|
rentalHousingModel.setLesseeCardNumber(rentalHousingModel.getLesseeCardNumber().substring(1, 18));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -416,6 +433,13 @@ public class ImportExcelHelper {
|
|||||||
if(!StringUtils.isEmpty(basePopulationInfoDTO.getBasePopulationInfoId())) {
|
if(!StringUtils.isEmpty(basePopulationInfoDTO.getBasePopulationInfoId())) {
|
||||||
censusMsgModel.setBaseId(basePopulationInfoDTO.getBasePopulationInfoId());
|
censusMsgModel.setBaseId(basePopulationInfoDTO.getBasePopulationInfoId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(19 == censusMsgModel.getBaseId().length()) {
|
||||||
|
censusMsgModel.setBaseId(censusMsgModel.getBaseId().substring(1, 18));
|
||||||
|
}
|
||||||
|
if(19 == censusMsgModel.getIdCardOfHouseholder().length()) {
|
||||||
|
censusMsgModel.setIdCardOfHouseholder(censusMsgModel.getIdCardOfHouseholder().substring(1, 18));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -429,6 +453,14 @@ public class ImportExcelHelper {
|
|||||||
if(!StringUtils.isEmpty(basePopulationInfoDTO.getBasePopulationInfoId())) {
|
if(!StringUtils.isEmpty(basePopulationInfoDTO.getBasePopulationInfoId())) {
|
||||||
homePersonModel.setBaseId(basePopulationInfoDTO.getBasePopulationInfoId());
|
homePersonModel.setBaseId(basePopulationInfoDTO.getBasePopulationInfoId());
|
||||||
}
|
}
|
||||||
|
// 身份证号码
|
||||||
|
if(19 == homePersonModel.getBaseId().length()) {
|
||||||
|
homePersonModel.setBaseId(homePersonModel.getBaseId().substring(1, 18));
|
||||||
|
}
|
||||||
|
// 监护人身份证号码
|
||||||
|
if(19 == homePersonModel.getLeadingCard().length()) {
|
||||||
|
homePersonModel.setLeadingCard(homePersonModel.getLeadingCard().substring(1, 18));
|
||||||
|
}
|
||||||
// 人户一致标识
|
// 人户一致标识
|
||||||
if("一致".equals(homePersonModel.getPeopleSameCensus())) {
|
if("一致".equals(homePersonModel.getPeopleSameCensus())) {
|
||||||
homePersonModel.setPeopleSameCensus("01");
|
homePersonModel.setPeopleSameCensus("01");
|
||||||
@ -490,6 +522,12 @@ public class ImportExcelHelper {
|
|||||||
if(!StringUtils.isEmpty(basePopulationInfoDTO.getBasePopulationInfoId())) {
|
if(!StringUtils.isEmpty(basePopulationInfoDTO.getBasePopulationInfoId())) {
|
||||||
floatingPopulationModel.setBaseId(basePopulationInfoDTO.getBasePopulationInfoId());
|
floatingPopulationModel.setBaseId(basePopulationInfoDTO.getBasePopulationInfoId());
|
||||||
}
|
}
|
||||||
|
if(19 == floatingPopulationModel.getBaseId().length()) {
|
||||||
|
floatingPopulationModel.setBaseId(floatingPopulationModel.getBaseId().substring(1, 18));
|
||||||
|
}
|
||||||
|
if(19 == floatingPopulationModel.getCardNumber().length()) {
|
||||||
|
floatingPopulationModel.setCardNumber(floatingPopulationModel.getCardNumber().substring(1, 18));
|
||||||
|
}
|
||||||
/*// 办证类型
|
/*// 办证类型
|
||||||
switch (floatingPopulationModel.getRegistrationType()) {
|
switch (floatingPopulationModel.getRegistrationType()) {
|
||||||
case "居住证":
|
case "居住证":
|
||||||
@ -531,6 +569,12 @@ public class ImportExcelHelper {
|
|||||||
if(!StringUtils.isEmpty(basePopulationInfoDTO.getBasePopulationInfoId())) {
|
if(!StringUtils.isEmpty(basePopulationInfoDTO.getBasePopulationInfoId())) {
|
||||||
keyTeenagersModel.setBaseId(basePopulationInfoDTO.getBasePopulationInfoId());
|
keyTeenagersModel.setBaseId(basePopulationInfoDTO.getBasePopulationInfoId());
|
||||||
}
|
}
|
||||||
|
if(19 == keyTeenagersModel.getBaseId().length()) {
|
||||||
|
keyTeenagersModel.setBaseId(keyTeenagersModel.getBaseId().substring(1, 18));
|
||||||
|
}
|
||||||
|
if(19 == keyTeenagersModel.getGuardianCard().length()) {
|
||||||
|
keyTeenagersModel.setGuardianCard(keyTeenagersModel.getGuardianCard().substring(1, 18));
|
||||||
|
}
|
||||||
/*// 人员类型
|
/*// 人员类型
|
||||||
switch (keyTeenagersModel.getPersonType()) {
|
switch (keyTeenagersModel.getPersonType()) {
|
||||||
case "闲散青少年":
|
case "闲散青少年":
|
||||||
@ -591,6 +635,7 @@ public class ImportExcelHelper {
|
|||||||
* @param overseaspersonnelModel
|
* @param overseaspersonnelModel
|
||||||
*/
|
*/
|
||||||
private static void overseaspersonnelCheck(OverseaspersonnelModel overseaspersonnelModel) {
|
private static void overseaspersonnelCheck(OverseaspersonnelModel overseaspersonnelModel) {
|
||||||
|
overseaspersonnelModel.setCardNumber(overseaspersonnelModel.getCardNumber().substring(1, overseaspersonnelModel.getCardNumber().length() - 1));
|
||||||
/*// 性别
|
/*// 性别
|
||||||
switch (overseaspersonnelModel.getSex()) {
|
switch (overseaspersonnelModel.getSex()) {
|
||||||
case "未知的性别":
|
case "未知的性别":
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 新增户籍信息 -->
|
<!-- 新增户籍信息 -->
|
||||||
<insert id="saveCensusMsg" parameterType="map">
|
<insert id="saveCensusMsg" parameterType="map" useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO gen_census_msg(
|
INSERT IGNORE INTO gen_census_msg(
|
||||||
census_msg_id,
|
census_msg_id,
|
||||||
base_id,
|
base_id,
|
||||||
name_of_householder,
|
name_of_householder,
|
||||||
@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
<!-- 批量新增户籍信息 -->
|
<!-- 批量新增户籍信息 -->
|
||||||
<insert id="saveCensusMsgList" parameterType="java.util.List">
|
<insert id="saveCensusMsgList" parameterType="java.util.List">
|
||||||
INSERT INTO gen_census_msg(
|
INSERT IGNORE INTO gen_census_msg(
|
||||||
census_msg_id,
|
census_msg_id,
|
||||||
base_id,
|
base_id,
|
||||||
name_of_householder,
|
name_of_householder,
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 新增流动人口 -->
|
<!-- 新增流动人口 -->
|
||||||
<insert id="saveFloatingPopulation" parameterType="map">
|
<insert id="saveFloatingPopulation" parameterType="map" useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO gen_floating_population(
|
INSERT IGNORE INTO gen_floating_population(
|
||||||
floating_population_id,
|
floating_population_id,
|
||||||
base_id,
|
base_id,
|
||||||
card_expire_date,
|
card_expire_date,
|
||||||
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
<!-- 批量新增流动人口 -->
|
<!-- 批量新增流动人口 -->
|
||||||
<insert id="saveFloatingPopulationList" parameterType="java.util.List">
|
<insert id="saveFloatingPopulationList" parameterType="java.util.List">
|
||||||
INSERT INTO gen_floating_population(
|
INSERT IGNORE INTO gen_floating_population(
|
||||||
floating_population_id,
|
floating_population_id,
|
||||||
base_id,
|
base_id,
|
||||||
card_expire_date,
|
card_expire_date,
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 新增留守人员 -->
|
<!-- 新增留守人员 -->
|
||||||
<insert id="saveHomePerson" parameterType="map">
|
<insert id="saveHomePerson" parameterType="map" useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO gen_home_person(
|
INSERT IGNORE INTO gen_home_person(
|
||||||
home_person_id,
|
home_person_id,
|
||||||
healthy,
|
healthy,
|
||||||
relationship_with_home_people,
|
relationship_with_home_people,
|
||||||
@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
<!-- 批量新增留守人员 -->
|
<!-- 批量新增留守人员 -->
|
||||||
<insert id="saveHomePersonList" parameterType="java.util.List">
|
<insert id="saveHomePersonList" parameterType="java.util.List">
|
||||||
INSERT INTO gen_home_person(
|
INSERT IGNORE INTO gen_home_person(
|
||||||
home_person_id,
|
home_person_id,
|
||||||
healthy,
|
healthy,
|
||||||
relationship_with_home_people,
|
relationship_with_home_people,
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 新增重点青少年 -->
|
<!-- 新增重点青少年 -->
|
||||||
<insert id="saveKeyTeenagers" parameterType="map">
|
<insert id="saveKeyTeenagers" parameterType="map" useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO gen_key_teenagers(
|
INSERT IGNORE INTO gen_key_teenagers(
|
||||||
key_teenagers_id,
|
key_teenagers_id,
|
||||||
relationship_with_guardian,
|
relationship_with_guardian,
|
||||||
family_situation,
|
family_situation,
|
||||||
@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
<!-- 批量新增重点青少年 -->
|
<!-- 批量新增重点青少年 -->
|
||||||
<insert id="saveKeyTeenagersList" parameterType="java.util.List">
|
<insert id="saveKeyTeenagersList" parameterType="java.util.List">
|
||||||
INSERT INTO gen_key_teenagers(
|
INSERT IGNORE INTO gen_key_teenagers(
|
||||||
key_teenagers_id,
|
key_teenagers_id,
|
||||||
relationship_with_guardian,
|
relationship_with_guardian,
|
||||||
family_situation,
|
family_situation,
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 新增境外人员 -->
|
<!-- 新增境外人员 -->
|
||||||
<insert id="saveOverseasPersonnel" parameterType="map">
|
<insert id="saveOverseasPersonnel" parameterType="map" useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO gen_overseas_personnel(
|
INSERT IGNORE INTO gen_overseas_personnel(
|
||||||
overseas_personnel_id,
|
overseas_personnel_id,
|
||||||
to_china_purpose,
|
to_china_purpose,
|
||||||
service_address,
|
service_address,
|
||||||
@ -56,7 +56,8 @@
|
|||||||
modifier,
|
modifier,
|
||||||
gmt_modified,
|
gmt_modified,
|
||||||
is_delete
|
is_delete
|
||||||
) VALUES(
|
)
|
||||||
|
SELECT
|
||||||
#{overseasPersonnelId},
|
#{overseasPersonnelId},
|
||||||
#{toChinaPurpose},
|
#{toChinaPurpose},
|
||||||
#{serviceAddress},
|
#{serviceAddress},
|
||||||
@ -83,12 +84,23 @@
|
|||||||
#{modifier},
|
#{modifier},
|
||||||
#{gmtModified},
|
#{gmtModified},
|
||||||
#{isDelete}
|
#{isDelete}
|
||||||
)
|
FROM
|
||||||
|
DUAL
|
||||||
|
WHERE
|
||||||
|
NOT EXISTS (
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
gen_overseas_personnel
|
||||||
|
WHERE
|
||||||
|
card_number = #{cardNumber}
|
||||||
|
AND is_delete = 0
|
||||||
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 新增境外人员 -->
|
<!-- 新增境外人员 -->
|
||||||
<insert id="saveOverseaspersonnelList" parameterType="java.util.List">
|
<insert id="saveOverseaspersonnelList" parameterType="java.util.List">
|
||||||
INSERT INTO gen_overseas_personnel(
|
INSERT IGNORE INTO gen_overseas_personnel(
|
||||||
overseas_personnel_id,
|
overseas_personnel_id,
|
||||||
to_china_purpose,
|
to_china_purpose,
|
||||||
service_address,
|
service_address,
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 新增出租房 -->
|
<!-- 新增出租房 -->
|
||||||
<insert id="saveRentalHousing" parameterType="map">
|
<insert id="saveRentalHousing" parameterType="map" useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO gen_rental_housing(
|
INSERT IGNORE INTO gen_rental_housing(
|
||||||
rental_housing_id,
|
rental_housing_id,
|
||||||
lessee_name,
|
lessee_name,
|
||||||
longitude,
|
longitude,
|
||||||
@ -47,7 +47,7 @@
|
|||||||
modifier,
|
modifier,
|
||||||
gmt_modified,
|
gmt_modified,
|
||||||
is_delete
|
is_delete
|
||||||
) VALUES(
|
) SELECT
|
||||||
#{rentalHousingId},
|
#{rentalHousingId},
|
||||||
#{lesseeName},
|
#{lesseeName},
|
||||||
#{longitude},
|
#{longitude},
|
||||||
@ -70,12 +70,23 @@
|
|||||||
#{modifier},
|
#{modifier},
|
||||||
#{gmtModified},
|
#{gmtModified},
|
||||||
#{isDelete}
|
#{isDelete}
|
||||||
)
|
FROM
|
||||||
|
DUAL
|
||||||
|
WHERE
|
||||||
|
NOT EXISTS (
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
gen_rental_housing
|
||||||
|
WHERE
|
||||||
|
house_number = #{houseNumber}
|
||||||
|
AND is_delete = 0
|
||||||
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 批量导入出租房 -->
|
<!-- 批量导入出租房 -->
|
||||||
<insert id="saveRentalHousingList" parameterType="java.util.List">
|
<insert id="saveRentalHousingList" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO gen_rental_housing(
|
INSERT IGNORE INTO gen_rental_housing(
|
||||||
rental_housing_id,
|
rental_housing_id,
|
||||||
lessee_name,
|
lessee_name,
|
||||||
longitude,
|
longitude,
|
||||||
|
Loading…
Reference in New Issue
Block a user