|
@@ -5,6 +5,7 @@ import java.util.*;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
import com.ruoyi.common.utils.uuid.IdUtils;
|
|
|
import com.ruoyi.powerdistribution.domain.PdmConstructor;
|
|
@@ -76,14 +77,6 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
|
constructor.setCreateBy(SecurityUtils.getUsername());
|
|
|
pdmConstructorMapper.insertPdmConstructor(constructor);
|
|
|
}
|
|
|
-// pdmConstructTeam.getConstructorList().forEach(constructor->{
|
|
|
-// constructor.setTeamNo(teamNo);
|
|
|
-// try {
|
|
|
-// pdmConstructorMapper.insertPdmConstructor(constructor);
|
|
|
-// }catch(Exception e){
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
-// });
|
|
|
return pdmConstructTeamMapper.insertPdmConstructTeam(pdmConstructTeam);
|
|
|
}
|
|
|
|
|
@@ -139,7 +132,7 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
|
public void importExcel(List<ConstructTeam> constructTeamList) {
|
|
|
Map<String,PdmConstructTeamVo> data=new HashMap<>();
|
|
|
for (ConstructTeam constructTeam : constructTeamList) {
|
|
|
- String key=constructTeam.getTeamNm()+","+constructTeam.getLegalPerson()+","+constructTeam.getLegalContactPhone()
|
|
|
+ String key=constructTeam.getCountyOrgNm()+","+constructTeam.getTeamNm()+","+constructTeam.getLegalPerson()+","+constructTeam.getLegalContactPhone()
|
|
|
+","+constructTeam.getTeamLeader()+","+constructTeam.getTeamLeaderPhone();
|
|
|
if(data.containsKey(key)){
|
|
|
PdmConstructor constructor=new PdmConstructor();
|
|
@@ -147,12 +140,15 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
|
PdmConstructTeamVo constructTeamVo=data.get(key);
|
|
|
constructTeamVo.getConstructorList().add(constructor);
|
|
|
}else{
|
|
|
- constructTeam.setCarNumber(constructTeam.getCarNumber().replaceAll(" ","").replaceAll("、",",")
|
|
|
- .replaceAll("\n",",").replaceAll("\r",",")
|
|
|
- );
|
|
|
+
|
|
|
PdmConstructTeamVo constructTeamVo=new PdmConstructTeamVo();
|
|
|
BeanUtils.copyProperties(constructTeam,constructTeamVo);
|
|
|
- constructTeamVo.setConstrucCarNumber(Arrays.asList(constructTeam.getCarNumber().split(",")));
|
|
|
+ if(StringUtils.isNotEmpty(constructTeam.getCarNumber())){
|
|
|
+ constructTeam.setCarNumber(constructTeam.getCarNumber().replaceAll(" ","").replaceAll("、",",")
|
|
|
+ .replaceAll("\n",",").replaceAll("\r",",")
|
|
|
+ );
|
|
|
+ constructTeamVo.setConstrucCarNumber(Arrays.asList(constructTeam.getCarNumber().split(",")));
|
|
|
+ }
|
|
|
PdmConstructor constructor=new PdmConstructor();
|
|
|
BeanUtils.copyProperties(constructTeam,constructor);
|
|
|
List<PdmConstructor> constructorList= new ArrayList<>();
|