Commit cf43fece authored by fangxinjiang's avatar fangxinjiang

社保公积金基数批量导入导出-fxj

parent 3d1b27b8
......@@ -257,21 +257,22 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
sysBaseSetInfo.setBaseType(baseType);
sysBaseSetInfo.setDeleteFlag(CommonConstants.STATUS_NORMAL);
sysBaseSetInfo.setStatus(CommonConstants.ZERO_INT);
sysBaseSetInfo.setApplyStartDate(new Date());
// 查询符合条件的基数列表
List<SysBaseSetInfo> sysBaseSetInfoList = baseMapper.getSysBaseSetInfoNoPage(sysBaseSetInfo);
// 返回的map
Map<String, SysBaseSetInfo> setInfoMap = new HashMap<>();
if (sysBaseSetInfoList != null && !sysBaseSetInfoList.isEmpty()) {
// map的键
String key;
SysBaseSetInfo temp;
for (SysBaseSetInfo setInfo : sysBaseSetInfoList) {
/*key = setInfo.getDepartId() + CommonConstants.DOWN_LINE_STRING + setInfo.getProvince()
+ CommonConstants.DOWN_LINE_STRING + setInfo.getCity();
if (setInfo.getTown() != null) {
key += CommonConstants.DOWN_LINE_STRING + setInfo.getTown();
}*/
setInfoMap.put(setInfo.getDepartName(), setInfo);
temp = setInfoMap.get(setInfo.getDepartName());
if (temp != null) {
if (setInfo.getApplyStartDate().getTime() > temp.getApplyStartDate().getTime()) {
setInfoMap.put(setInfo.getDepartName(), setInfo);
}
}else {
setInfoMap.put(setInfo.getDepartName(), setInfo);
}
}
}
return setInfoMap;
......@@ -532,7 +533,18 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR,e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
boolean isTrue = true;
for (ErrorMessage message : errorMessageList) {
if (!CommonConstants.SAVE_SUCCESS.equals(message.getMessage())) {
isTrue = false;
break;
}
}
if (isTrue) {
return R.ok();
} else {
return R.ok(errorMessageList);
}
}
@Override
......@@ -588,7 +600,18 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR,e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
boolean isTrue = true;
for (ErrorMessage message : errorMessageList) {
if (!CommonConstants.SAVE_SUCCESS.equals(message.getMessage())) {
isTrue = false;
break;
}
}
if (isTrue) {
return R.ok();
} else {
return R.ok(errorMessageList);
}
}
private void importSysBaseSetSocial(List<SysBaseSetSocialInsertVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 区域数据初始化
......@@ -1174,7 +1197,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
// 插入
try {
insertFundExcel(temp,infoVo,fundProList);
insertFundExcel(temp,infoVo,fundProList,fundSetInfoMap);
}catch (Exception e){
errorMsg = new ErrorMessage(excel.getRowIndex(),"数据保存失败,请修改后重新提交");
errorMessageList.add(errorMsg);
......@@ -1187,7 +1210,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
/**
* 插入excel bad record
*/
private void insertFundExcel(SysBaseSetInfo old,SysBaseSetInfo insert,List<SysPayProportion> fundProList) {
private void insertFundExcel(SysBaseSetInfo old,SysBaseSetInfo insert,List<SysPayProportion> fundProList,Map<String, SysBaseSetInfo> fundSetInfoMap) {
if (Common.isNotNull(old) && Common.isNotNull(old.getId()));{
baseMapper.updateById( old);
}
......@@ -1198,6 +1221,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
sysPayProportionService.save(fundPro);
}
}
fundSetInfoMap.put(insert.getDepartName(), insert);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment