|
@@ -64,7 +64,7 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public R importExcel(MultipartFile file) {
|
|
|
+ public R importExcel(MultipartFile file,String binSection) {
|
|
|
if (file.isEmpty()) {
|
|
|
return R.error("上传文件为空!");
|
|
|
}
|
|
@@ -83,14 +83,12 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
|
|
|
List<String> ids = strings.stream().map(row -> row[row.length - 1]).collect(Collectors.toList());
|
|
|
List<OrganizationRating> organizationRatings = baseMapper.selectBatchIds(ids);
|
|
|
if (!binSection.equals(organizationRatings.get(0).getBinSection())) {
|
|
|
- throw new CustomException("请导入" + binSection + "的数据");
|
|
|
+ return R.error("请导入" + binSection + "的数据");
|
|
|
}
|
|
|
//遍历Excel表每一行的数据
|
|
|
for (String[] str : strings) {
|
|
|
for (OrganizationRating or : organizationRatings) {
|
|
|
- if (str[0].equals(or.getOrganizationShortName())&&str[3].equals(or.getYear())) {
|
|
|
-// if (str[15].equals(or.getId())) {
|
|
|
-// or.setOrganizationShortName(str[0]);
|
|
|
+ if (str[0].equals(or.getOrganizationShortName())&&str[2].equals(or.getYear())) {
|
|
|
or.setSafetyEnvProtection(str[3]);
|
|
|
or.setVeto(str[4]);
|
|
|
or.setNetProfit(str[5]);
|