|  | @@ -1,9 +1,11 @@
 | 
	
		
			
				|  |  |  package com.jeeplus.modules.projectmaterialstorage.service;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import com.google.common.collect.Lists;
 | 
	
		
			
				|  |  |  import com.jeeplus.common.persistence.Page;
 | 
	
		
			
				|  |  |  import com.jeeplus.common.service.CrudService;
 | 
	
		
			
				|  |  |  import com.jeeplus.common.utils.IdGen;
 | 
	
		
			
				|  |  | +import com.jeeplus.common.utils.StringUtils;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectmaterialstorage.dao.ProjectMaterialStorageDao;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorageImport;
 | 
	
	
		
			
				|  | @@ -92,11 +94,12 @@ public class ProjectMaterialStorageService extends CrudService<ProjectMaterialSt
 | 
	
		
			
				|  |  |              return map;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  //        数据库判断
 | 
	
		
			
				|  |  | +        List<String> materialNameList = Lists.newArrayList();
 | 
	
		
			
				|  |  |          for(int j=0;j<projectMaterialStorageImports.size();j++){
 | 
	
		
			
				|  |  |              //材料列表数据库重复判断
 | 
	
		
			
				|  |  |              ProjectMaterialStorageImport projectMaterialStorageImport = projectMaterialStorageImports.get(j);
 | 
	
		
			
				|  |  |              if(projectMaterialStorageDao.selectCountAboutProjectMaterialStorage(projectMaterialStorageImport)!=0){
 | 
	
		
			
				|  |  | -                stringBuilder.append("第"+j+"行的材料已存在,请勿重复添加");
 | 
	
		
			
				|  |  | +                materialNameList.add(projectMaterialStorageImport.getMaterialName());
 | 
	
		
			
				|  |  |                  flag = true;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -105,6 +108,8 @@ public class ProjectMaterialStorageService extends CrudService<ProjectMaterialSt
 | 
	
		
			
				|  |  |              map.put("successful",stringBuilder);
 | 
	
		
			
				|  |  |              return  map;
 | 
	
		
			
				|  |  |          }else {
 | 
	
		
			
				|  |  | +            String join = StringUtils.join(materialNameList, ",");
 | 
	
		
			
				|  |  | +            stringBuilder.append("材料 " + join + " 已存在,请勿重复添加");
 | 
	
		
			
				|  |  |              map.put("failure",stringBuilder);
 | 
	
		
			
				|  |  |              return map;
 | 
	
		
			
				|  |  |          }
 |