|
|
@@ -124,8 +124,8 @@ public class RDServiceImpl extends BaseMybatisDao<RdDetailsMapper> implements RD
|
|
|
if (StringUtils.isNotEmpty(in.getRdName())){
|
|
|
RdCount++;
|
|
|
OkCount++;
|
|
|
- int i = rdDetailsMapper.selectByRDName(in.getRdName());
|
|
|
- if (i==0){
|
|
|
+ RdDetails details = rdDetailsMapper.selectByRDName(in.getRdName());
|
|
|
+ if (details==null){
|
|
|
try {
|
|
|
in.setStatus(1);
|
|
|
in.setAid(aid);
|
|
|
@@ -138,10 +138,15 @@ public class RDServiceImpl extends BaseMybatisDao<RdDetailsMapper> implements RD
|
|
|
errors.add(String.format("%s.数据第%s行,项目名称[%s]数据异常!",erCount,errorsCount,in.getRdName()));
|
|
|
}
|
|
|
}else {
|
|
|
- OkCount--;
|
|
|
- erCount++;
|
|
|
- int errorsCount=RdCount+3;
|
|
|
- errors.add(String.format("%s.数据第%s行,名称[%s]导入失败,名称已存在!",erCount,errorsCount,in.getRdName()));
|
|
|
+ try {
|
|
|
+ in.setId(details.getId());
|
|
|
+ rdDetailsMapper.updateByPrimaryKeySelective(in);
|
|
|
+ }catch (Exception e ){
|
|
|
+ int errorsCount=RdCount+3;
|
|
|
+ erCount++;
|
|
|
+ OkCount--;
|
|
|
+ errors.add(String.format("%s.数据第%s行,项目名称[%s]数据更新异常!",erCount,errorsCount,in.getRdName()));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|