Commit 25198d01 authored by hongguangwu's avatar hongguangwu

MVP1.6.2-工资原表识别-优化

parent 97d8641c
......@@ -185,7 +185,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
dataRow = 0;
dataRowFlag = true;
// 循环当前sheet的每行内容
for (int rowNum = 0; rowNum < sheetAt.getLastRowNum(); rowNum++) {
for (int rowNum = 0; rowNum <= sheetAt.getLastRowNum(); rowNum++) {
contentMap = new HashMap<>();
columnList = new ArrayList<>();
row = sheetAt.getRow(rowNum);
......@@ -308,7 +308,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
dataRow = 0;
dataRowFlag = true;
// 循环当前sheet的每行内容
for (int rowNum = 0; rowNum < sheetAt.getLastRowNum(); rowNum++) {
for (int rowNum = 0; rowNum <= sheetAt.getLastRowNum(); rowNum++) {
contentMap = new HashMap<>();
columnList = new ArrayList<>();
row = sheetAt.getRow(rowNum);
......@@ -499,6 +499,28 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
} else {
vo = readXls(inputStream, specialIdCardList, false, sheetName);
}
if (vo.getTitleList() != null && !vo.getTitleList().isEmpty()) {
ExcelColumnVo title;
for (int i=0;i<vo.getTitleList().size();i++) {
title = vo.getTitleList().get(i);
if (detailMap.get(String.valueOf(title.getLineNum())) == null) {
return R.failed("表头与导入的不一致,第"+title.getLineNum()+"列表头【"+title.getContent()+"】未找到配置,请先配置表头!");
} else if (!title.getContent().equals(detailMap.get(String.valueOf(title.getLineNum())).getExcelName())
&& (!"是否新员工(默认否)".equals(title.getContent())
|| !"开户行总行".equals(title.getContent())
|| !"开户行省".equals(title.getContent())
|| !"开户行市".equals(title.getContent())
|| !"开户行支行".equals(title.getContent())
|| !"银行卡号".equals(title.getContent())
|| !"手机号码".equals(title.getContent())
|| !"计税月份".equals(title.getContent()))
) {
return R.failed("表头与导入的不一致,第"+(i+1)+"列应为【"+detailMap.get(String.valueOf(title.getLineNum())).getExcelName()+"】,实际为【"+title.getContent()+"】");
}
}
} else {
return R.failed("表格没有表头,请检查表格数据!");
}
if (vo.getContentList() != null && !vo.getContentList().isEmpty()) {
// 智能识别表头
TSalaryStandardOriginalDetail detail;
......@@ -512,7 +534,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
newRowMap = new HashMap<>();
for (Map.Entry<String, String> column : rowMap.entrySet()) {
detail = detailMap.get(column.getKey());
if (detail != null) {
if (detail != null && Common.isNotNull(detail.getModelName())) {
value = column.getValue();
try {
if ("REDUCE".equals(detail.getFlag())) {
......
......@@ -41,6 +41,7 @@
<result property="attaSize" column="ATTA_SIZE"/>
<result property="attaType" column="ATTA_TYPE"/>
<result property="dateNum" column="DATE_NUM"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -59,7 +60,8 @@
a.ATTA_URL,
a.ATTA_SIZE,
a.ATTA_TYPE,
a.DATE_NUM
a.DATE_NUM,
a.DELETE_FLAG
</sql>
<sql id="TSalaryStandardOriginal_where">
<if test="tSalaryStandardOriginal != null">
......
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