This commit is contained in:
钱涛 2022-04-28 18:27:25 +08:00
parent 712e4edb0b
commit beb725fb8a
4 changed files with 6 additions and 10 deletions

View File

@ -8,14 +8,13 @@ import com.engine.salary.biz.EmployBiz;
import com.engine.salary.biz.TaxAgentBiz;
import com.engine.salary.entity.datacollection.AddUpDeduction;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
import com.engine.salary.entity.taxrate.TaxAgent;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.excel.ExcelParseHelper;
import com.google.common.collect.Maps;
import lombok.SneakyThrows;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
@ -48,7 +47,6 @@ public class AddUpDeductionImportCmd extends AbstractCommonCommand<Map<String, O
return null;
}
@SneakyThrows
@Override
public Map<String, Object> execute(CommandContext commandContext) {
Map<String, Object> apidatas = new HashMap<String, Object>();
@ -71,7 +69,7 @@ public class AddUpDeductionImportCmd extends AbstractCommonCommand<Map<String, O
InputStream fileInputStream = null;
try {
fileInputStream = ImageFileManager.getInputStreamById(Integer.valueOf(imageId));
List<AddUpDeductionDTO> addUpDeductions = ExcelParseHelper.parse2Map(fileInputStream, AddUpDeductionDTO.class, 0, 1, 12, "addUpDeductionTemplate.xlsx");
List<AddUpDeductionDTO> addUpDeductions = ExcelParseHelper.parse2Map(fileInputStream, AddUpDeductionDTO.class, 0, 1, 13, "addUpDeductionTemplate.xlsx");
int total = addUpDeductions.size();
int index = 0;
@ -84,7 +82,7 @@ public class AddUpDeductionImportCmd extends AbstractCommonCommand<Map<String, O
//税款所属期
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date declareMonth = simpleDateFormat.parse(declareMonthStr + "-01");
Date declareMonth = SalaryDateUtil.stringToDate(declareMonthStr + "-01");
// 错误excel内容

View File

@ -7,7 +7,6 @@ import com.engine.salary.biz.AddUpDeductionBiz;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
import com.engine.salary.util.excel.ExcelParseHelper;
import lombok.SneakyThrows;
import org.apache.commons.lang3.Validate;
import org.apache.poi.util.IOUtils;
import weaver.file.ImageFileManager;
@ -35,7 +34,6 @@ public class AddUpDeductionPreviewCmd extends AbstractCommonCommand<Map<String,
return null;
}
@SneakyThrows
@Override
public Map<String, Object> execute(CommandContext commandContext) {
Map<String, Object> apidatas = new HashMap<String, Object>();
@ -50,7 +48,7 @@ public class AddUpDeductionPreviewCmd extends AbstractCommonCommand<Map<String,
InputStream fileInputStream = null;
try {
fileInputStream = ImageFileManager.getInputStreamById(Integer.valueOf(imageId));
List<AddUpDeductionDTO> addUpDeductions = ExcelParseHelper.parse2Map(fileInputStream, AddUpDeductionDTO.class, 0, 1, 12, "addUpDeductionTemplate.xlsx");
List<AddUpDeductionDTO> addUpDeductions = ExcelParseHelper.parse2Map(fileInputStream, AddUpDeductionDTO.class, 0, 1, 13, "addUpDeductionTemplate.xlsx");
apidatas.put("preview", addUpDeductions);
} finally {
IOUtils.closeQuietly(fileInputStream);

View File

@ -67,7 +67,7 @@ public class AddUpSituationImportCmd extends AbstractCommonCommand<Map<String, O
try {
fileInputStream = ImageFileManager.getInputStreamById(Integer.valueOf(imageId));
List<AddUpSituationDTO> excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 21, "template.xlsx");
List<AddUpSituationDTO> excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 23, "template.xlsx");
int total = excelDates.size();
int index = 0;

View File

@ -51,7 +51,7 @@ public class AddUpSituationPreviewCmd extends AbstractCommonCommand<Map<String,
InputStream fileInputStream = null;
try {
fileInputStream = ImageFileManager.getInputStreamById(Integer.valueOf(imageId));
List<AddUpSituationDTO> excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 21, "template.xlsx");
List<AddUpSituationDTO> excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 23, "template.xlsx");
apidatas.put("preview", excelDates);
} finally {
IOUtils.closeQuietly(fileInputStream);