|
@@ -1,5 +1,6 @@
|
|
|
package cn.com.ty.lift.business.project.service;
|
|
|
|
|
|
+import cn.com.ty.lift.business.common.Judge;
|
|
|
import cn.com.ty.lift.business.framework.util.MessageUtils;
|
|
|
import cn.com.ty.lift.business.project.dao.entity.*;
|
|
|
import cn.com.ty.lift.business.project.dao.entity.model.ProjectImportModel;
|
|
@@ -212,9 +213,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper,Project> {
|
|
|
@Transactional
|
|
|
public RestResponse assemble(List<ProjectImportModel> projectImportModels,Long mtCompanyId){
|
|
|
//检查列表有效性
|
|
|
- if(ObjectUtil.isEmpty(projectImportModels)){
|
|
|
- return RestResponse.fail("没有数据");
|
|
|
- }
|
|
|
+ Judge.notNull(projectImportModels,"没有数据");
|
|
|
//存放新建的project
|
|
|
List<Project> projects = new ArrayList<>();
|
|
|
//存放新建的region
|
|
@@ -252,6 +251,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper,Project> {
|
|
|
//查找省
|
|
|
String provName = item.getProvince();
|
|
|
AreaCode province = provinceList.stream().filter(areaCode -> (StrUtil.equals(areaCode.getName(), provName))).distinct().limit(1).findFirst().get();
|
|
|
+
|
|
|
if(null == province){
|
|
|
log.error("表格数据有误,行数:{}, {}没有匹配省",rowNum,provName);
|
|
|
return RestResponse.fail(StrUtil.format("表格数据有误,行数:{}, {}没有匹配省",rowNum,provName));
|