Commit 34e6e8e6 authored by hongguangwu's avatar hongguangwu

1.7.21-0申报

parent bad4585b
...@@ -300,8 +300,7 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala ...@@ -300,8 +300,7 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
errorMessageList.add(new ErrorMessage(-1, "超过500条,不存储数据,请处理导入表格")); errorMessageList.add(new ErrorMessage(-1, "超过500条,不存储数据,请处理导入表格"));
cachedDataList.clear(); cachedDataList.clear();
// 中断读取 // 中断读取
context.interrupt(); throw new RuntimeException("超过500条,请减少数据条数!");
return;
} }
ReadRowHolder readRowHolder = context.readRowHolder(); ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex(); Integer rowIndex = readRowHolder.getRowIndex();
...@@ -395,8 +394,13 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala ...@@ -395,8 +394,13 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
}).sheet().doRead(); }).sheet().doRead();
} catch (Exception e) { } catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e); // 判断 为RuntimeException
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR); if (e instanceof RuntimeException) {
return R.failed(e.getMessage());
}
String errorInfo = "数据导入解析失败,请将单元格设为文本!" + e.getMessage();
log.error(errorInfo, e);
return R.failed(errorInfo);
} }
boolean isTrue = true; boolean isTrue = true;
for (ErrorMessage message : errorMessageList) { for (ErrorMessage message : errorMessageList) {
...@@ -482,6 +486,10 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala ...@@ -482,6 +486,10 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
continue; continue;
} }
if (judgeTaxMonth(excel.getTaxMonth())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "计税月份格式不正确!", excel));
continue;
}
insert = new TSalaryZero(); insert = new TSalaryZero();
BeanUtil.copyProperties(excel, insert); BeanUtil.copyProperties(excel, insert);
insert.setSettleMonth(settleMonth); insert.setSettleMonth(settleMonth);
...@@ -512,6 +520,21 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala ...@@ -512,6 +520,21 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
} }
} }
// 返回false则对
private boolean judgeTaxMonth(String taxMonth) {
if (Common.isEmpty(taxMonth)) {
return true;
}
if (taxMonth.length() > CommonConstants.dingleDigitIntArray[6]) {
taxMonth = taxMonth.substring(0, 6);
} else if (taxMonth.length() < CommonConstants.dingleDigitIntArray[6]) {
return true;
}
if (DateUtil.compareYearMonth(taxMonth, DateUtil.addMonth(0))) {
return true;
}
return false;
}
// 批量新增0申报 // 批量新增0申报
public void saveBatchWithTableName(List<TSalaryZero> insertList, String tableName) { public void saveBatchWithTableName(List<TSalaryZero> insertList, String tableName) {
if (insertList == null || insertList.isEmpty()) { if (insertList == null || insertList.isEmpty()) {
......
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