Commit e3e1aa19 authored by hongguangwu's avatar hongguangwu

薪资批量更新

parent 6feb364c
...@@ -440,50 +440,54 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe ...@@ -440,50 +440,54 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
TSalaryEmployee emp; TSalaryEmployee emp;
// 开户行省市的区域暂存 // 开户行省市的区域暂存
String areaStr; String areaStr;
boolean curTaxMonth;
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i); excel = excelVOList.get(i);
if (excel != null) { if (excel != null) {
if (Common.isNotNull(excel.getEmpIdcard()) && Common.isNotNull(excel.getDeptNo())) { if (Common.isNotNull(excel.getEmpIdcard()) && Common.isNotNull(excel.getDeptNo())) {
emp = empMap.get(excel.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + excel.getDeptNo()); emp = empMap.get(excel.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + excel.getDeptNo());
if (Common.isNotNull(emp)) { if (Common.isNotNull(emp)) {
curTaxMonth = false;
if (Common.isNotNull(emp.getTaxMonth()) && Common.isNotNull(excel.getTaxMonth()) && emp.getTaxMonth().length()==6) { if (Common.isNotNull(emp.getTaxMonth()) && Common.isNotNull(excel.getTaxMonth()) && emp.getTaxMonth().length()==6) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), SalaryConstants.TAX_MONTH_CUR)); curTaxMonth = true;
} else { } else if (Common.isNotNull(excel.getTaxMonth())) {
if (Common.isNotNull(excel.getBankName())) { emp.setTaxMonth(excel.getTaxMonth());
emp.setBankName(excel.getBankName()); }
} if (Common.isNotNull(excel.getBankName())) {
if (Common.isNotNull(excel.getBankSubName())) { emp.setBankName(excel.getBankName());
emp.setBankSubName(excel.getBankSubName()); }
} if (Common.isNotNull(excel.getBankSubName())) {
if (Common.isNotNull(excel.getBankProvince())) { emp.setBankSubName(excel.getBankSubName());
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getBankProvince().trim()); }
if (Common.isNotNull(areaStr)) { if (Common.isNotNull(excel.getBankProvince())) {
emp.setBankProvince(areaStr); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getBankProvince().trim());
if (Common.isNotNull(excel.getBankName())) { if (Common.isNotNull(areaStr)) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getBankCity().trim() emp.setBankProvince(areaStr);
+ CommonConstants.DOWN_LINE_STRING + excel.getBankProvince().trim()); if (Common.isNotNull(excel.getBankName())) {
if (Common.isNotNull(areaStr)) { areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getBankCity().trim()
emp.setBankCity(areaStr); + CommonConstants.DOWN_LINE_STRING + excel.getBankProvince().trim());
} else { if (Common.isNotNull(areaStr)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), SalaryConstants.CITY_ERROR)); emp.setBankCity(areaStr);
continue; } else {
} errorMessageList.add(new ErrorMessage(excel.getRowIndex(), SalaryConstants.CITY_ERROR));
continue;
} }
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), SalaryConstants.PROVINCE_ERROR));
continue;
} }
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), SalaryConstants.PROVINCE_ERROR));
continue;
} }
if (Common.isNotNull(excel.getBankNo())) { }
emp.setBankNo(excel.getBankNo()); if (Common.isNotNull(excel.getBankNo())) {
} emp.setBankNo(excel.getBankNo());
if (Common.isNotNull(excel.getEmpPhone())) { }
emp.setEmpPhone(excel.getEmpPhone()); if (Common.isNotNull(excel.getEmpPhone())) {
} emp.setEmpPhone(excel.getEmpPhone());
if (Common.isNotNull(excel.getTaxMonth())) { }
emp.setTaxMonth(excel.getTaxMonth()); baseMapper.updateById(emp);
} if (curTaxMonth) {
baseMapper.updateById(emp); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), SalaryConstants.CUR_TAX_INFO));
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
} }
} else { } else {
......
...@@ -173,4 +173,5 @@ public class SalaryConstants { ...@@ -173,4 +173,5 @@ public class SalaryConstants {
public static final String TAX_MONTH_CUR = "计税月份已存在,不可更新,请清空计税月份单元格内容!"; public static final String TAX_MONTH_CUR = "计税月份已存在,不可更新,请清空计税月份单元格内容!";
public static final String PROVINCE_ERROR = "开户行省错误!"; public static final String PROVINCE_ERROR = "开户行省错误!";
public static final String CITY_ERROR = "开户行市错误!"; public static final String CITY_ERROR = "开户行市错误!";
public static final String CUR_TAX_INFO = "当前项目薪酬人员已维护计税月份,计税月份沿用系统原值,其他字段已更新!";
} }
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