相关人员bug修改
This commit is contained in:
+3
-2
@@ -172,10 +172,11 @@ public class ProjectRelatedPersonnelController extends JeroController<ProjectRel
|
||||
@RequiresPermissions("projectRelatedPersonnel:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(MultipartFile file,
|
||||
@RequestParam(name="projectId",required=true) String projectId,
|
||||
HttpServletRequest request,
|
||||
@RequestParam(name="projectId",required=true) String projectId,
|
||||
@RequestParam(name="cut",required=true) String cut) throws IOException, InvalidFormatException {
|
||||
|
||||
return projectRelatedPersonnelService.importExcel(file, ProjectRelatedPersonnel.class, projectId, cut);
|
||||
return projectRelatedPersonnelService.importExcel(file, ProjectRelatedPersonnel.class, projectId, cut, request);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ public interface IProjectRelatedPersonnelService extends IService<ProjectRelated
|
||||
/**设置导出模板*/
|
||||
void exportTemplate(ProjectRelatedPersonnel projectRelatedPersonnel, HttpServletResponse response, HttpServletRequest request);
|
||||
|
||||
Result<?> importExcel(MultipartFile file, Class<ProjectRelatedPersonnel> clazz, String projectId, String cut) throws IOException, InvalidFormatException;
|
||||
Result<?> importExcel(MultipartFile file, Class<ProjectRelatedPersonnel> clazz, String projectId, String cut, HttpServletRequest request) throws IOException, InvalidFormatException;
|
||||
|
||||
|
||||
Result<?> oppositeDisposeData(List<ProjectRelatedPersonnel> records, String projectId, String cut);
|
||||
|
||||
+18
-8
@@ -697,8 +697,10 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
*/
|
||||
@Override
|
||||
public Result<?> importExcel(MultipartFile file,
|
||||
Class<ProjectRelatedPersonnel> clazz, String projectId, String cut) throws IOException, InvalidFormatException {
|
||||
|
||||
Class<ProjectRelatedPersonnel> clazz, String projectId, String cut, HttpServletRequest request) throws IOException, InvalidFormatException {
|
||||
//验证token
|
||||
String token = request.getHeader("X-Access-Token");
|
||||
TokenUtils.verifyToken(token, sysBaseAPI, redisUtil);
|
||||
String explainInfo= null;
|
||||
String titleOne = "";
|
||||
|
||||
@@ -780,14 +782,22 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
if (i == 1) {//校验填写说明
|
||||
row = sheet.getRow(i);
|
||||
int columNos = row.getLastCellNum();
|
||||
for (int k = 0; k < columNos; k++){
|
||||
if (row.getPhysicalNumberOfCells()>1 && StringUtils.isNotBlank(row.getCell(k).getStringCellValue())) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
throw new JeroBootException("填写说明列数不对,请按照模板格式填写内容");
|
||||
} else {
|
||||
throw new JeroBootException("The number of columns of filling explanation is wrong. Please fill in the contents according to the template format.");
|
||||
if (StringUtils.isNotBlank(row.getCell(0).getStringCellValue())){
|
||||
for (int k = 1; k < columNos; k++){
|
||||
if(StringUtils.isNotBlank(row.getCell(k).getStringCellValue())){
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
throw new JeroBootException("第二行填写说明列数不对,请按照模板格式填写内容");
|
||||
} else {
|
||||
throw new JeroBootException("The number of explanatory columns in the second line is incorrect. Please fill in the contents according to the template format.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
throw new JeroBootException("填写说明不能为空,请按照模板格式填写内容");
|
||||
} else {
|
||||
throw new JeroBootException("The description cannot be blank. Please fill in the content according to the template format.");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i > 1) {//读取数据
|
||||
|
||||
Reference in New Issue
Block a user