|
@@ -2885,7 +2885,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public HttpRespMsg importData(String userId, MultipartFile multipartFile, HttpServletRequest request) {
|
|
|
|
|
|
+ public HttpRespMsg importData(String userId, MultipartFile multipartFile,Integer key, HttpServletRequest request) {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
User user = userMapper.selectById(userId);
|
|
User user = userMapper.selectById(userId);
|
|
//然后处理文件
|
|
//然后处理文件
|
|
@@ -2993,6 +2993,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
if (!StringUtils.isEmpty(code)) {
|
|
if (!StringUtils.isEmpty(code)) {
|
|
int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
|
|
int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
|
|
if (cnt > 0) {
|
|
if (cnt > 0) {
|
|
|
|
+ if(key==0){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
// throw new Exception("项目编号存在重复: " + code);
|
|
// throw new Exception("项目编号存在重复: " + code);
|
|
existCodeList.add(code);
|
|
existCodeList.add(code);
|
|
//跳过编号重复的数据
|
|
//跳过编号重复的数据
|
|
@@ -3124,7 +3127,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
msg.data = "成功导入"+importCount+"条数据。";
|
|
msg.data = "成功导入"+importCount+"条数据。";
|
|
if (existCodeList.size() > 0) {
|
|
if (existCodeList.size() > 0) {
|
|
String collect = existCodeList.stream().collect(Collectors.joining(","));
|
|
String collect = existCodeList.stream().collect(Collectors.joining(","));
|
|
- msg.data += "自动更新"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
|
|
|
+ if(key==1){
|
|
|
|
+ msg.data += "自动更新"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
|
+ }else msg.data += "自动跳过"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
}
|
|
}
|
|
OperationRecord operationRecord=new OperationRecord();
|
|
OperationRecord operationRecord=new OperationRecord();
|
|
operationRecord.setCompanyId(user.getCompanyId());
|
|
operationRecord.setCompanyId(user.getCompanyId());
|
|
@@ -3408,6 +3413,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
if (!StringUtils.isEmpty(code)) {
|
|
if (!StringUtils.isEmpty(code)) {
|
|
int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
|
|
int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
|
|
if (cnt > 0) {
|
|
if (cnt > 0) {
|
|
|
|
+ if(key==0){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
// throw new Exception("项目编号存在重复: " + code);
|
|
// throw new Exception("项目编号存在重复: " + code);
|
|
existCodeList.add(code);
|
|
existCodeList.add(code);
|
|
//跳过编号重复的数据
|
|
//跳过编号重复的数据
|
|
@@ -3974,7 +3982,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
msg.data = "成功导入"+importCount+"条数据。";
|
|
msg.data = "成功导入"+importCount+"条数据。";
|
|
if (existCodeList.size() > 0) {
|
|
if (existCodeList.size() > 0) {
|
|
String collect = existCodeList.stream().collect(Collectors.joining(","));
|
|
String collect = existCodeList.stream().collect(Collectors.joining(","));
|
|
- msg.data += "自动更新"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
|
|
|
+ if(key==1){
|
|
|
|
+ msg.data += "自动更新"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
|
+ }else msg.data += "自动跳过"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
}
|
|
}
|
|
OperationRecord operationRecord=new OperationRecord();
|
|
OperationRecord operationRecord=new OperationRecord();
|
|
operationRecord.setCompanyId(user.getCompanyId());
|
|
operationRecord.setCompanyId(user.getCompanyId());
|