Commit 14b138a0 authored by wanghao's avatar wanghao

1 燃气用户界面 错误数据导出 再导入功能

parent 45b9a1c9
...@@ -452,13 +452,14 @@ public class TDetectorUserController extends BaseController ...@@ -452,13 +452,14 @@ public class TDetectorUserController extends BaseController
List<UserManageGasUserExportVo> userManageGasUserobjects = ExcelUtil.moreSheetImportExcel(file, 1, 2, UserManageGasUserExportVo.class, 0); List<UserManageGasUserExportVo> userManageGasUserobjects = ExcelUtil.moreSheetImportExcel(file, 1, 2, UserManageGasUserExportVo.class, 0);
tDetectorUserService.handleCustomMoreSheetImportData(userManageGasUserobjects,null,updateSupport,true); tDetectorUserService.handleCustomMoreSheetImportData(userManageGasUserobjects,null,updateSupport,true);
return AjaxResult.success();
} else{ } else{
List<UserManageGasUserExportVo> userManageGasUserobjects = ExcelUtil.moreSheetImportExcel(file, 1, 2, UserManageGasUserExportVo.class, 0); List<UserManageGasUserExportVo> userManageGasUserobjects = ExcelUtil.moreSheetImportExcel(file, 1, 2, UserManageGasUserExportVo.class, 0);
List<UserManageSafetyDeviceExportVo> userManageSafetyobjects = ExcelUtil.moreSheetImportExcel(file, 1, 2, UserManageSafetyDeviceExportVo.class, 1); List<UserManageSafetyDeviceExportVo> userManageSafetyobjects = ExcelUtil.moreSheetImportExcel(file, 1, 2, UserManageSafetyDeviceExportVo.class, 1);
tDetectorUserService.handleCustomMoreSheetImportData(userManageGasUserobjects,userManageSafetyobjects,updateSupport,false); tDetectorUserService.handleCustomMoreSheetImportData(userManageGasUserobjects,userManageSafetyobjects,updateSupport,false);
return AjaxResult.success();
} }
return AjaxResult.success();
} }
/** /**
......
...@@ -587,8 +587,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -587,8 +587,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
} }
//是要修改的 //是要修改的
List<TDetectorUser> updateCollect = successDataList.stream().filter(item -> item.getUserId() != null).collect(Collectors.toList()); List<TDetectorUser> updateCollect = successDataList.stream().filter(item -> item.getUserId() != null).collect(Collectors.toList());
if (updateCollect.size() > 0) { if (updateCollect.size() > 0 && reImportOfIncorrectDataFlag) {
// tDetectorUserMapper.updateBatch(updateCollect);
String sql = "UPDATE t_detector_user \n" + String sql = "UPDATE t_detector_user \n" +
"SET nick_name = ?,\n" + "SET nick_name = ?,\n" +
"user_type = ?,\n" + "user_type = ?,\n" +
......
...@@ -72,20 +72,7 @@ ...@@ -72,20 +72,7 @@
icon="el-icon-upload2" icon="el-icon-upload2"
size="mini" size="mini"
@click="handleImport">导入</el-button> @click="handleImport">导入</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-download"
size="mini"
@click="handleImportError"
class="button-with-badge"
>
<span>下载导入时错误数据</span>
<span class="badge" v-if="importError !== 0">{{importError}}</span>
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
...@@ -507,11 +494,39 @@ ...@@ -507,11 +494,39 @@
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip"> <div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div>
<span>仅允许导入xls、xlsx格式文件。</span> <span>仅允许导入xls、xlsx格式文件。</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link> <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
<br>
<!-- <el-form>
<el-form-item>
<div style="width: 100%; text-align: center;">
<el-button type="primary" @click="downloadImportError">下载错误数据</el-button>
<el-button type="danger" @click="clearImportErrorMethod">清除错误数据</el-button>
</div>
</el-form-item>
</el-form> -->
<el-divider v-if="this.importError > 0 " content-position="left">错误数据导出分隔</el-divider>
<br>
<el-badge v-if="this.importError > 0 " :value="importError" class="item">
<el-button
type="danger"
icon="el-icon-download"
size="small"
@click="handleImportError"
v-if="this.importError > 0 "
>
<span>下载导入时错误数据</span>
</el-button>
</el-badge>
<!-- <el-link v-if="this.importError > 0" type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="downloadImportError">下载错误数据</el-link>
<el-link v-if="this.importError > 0" type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="clearImportErrorMethod">清除错误数据</el-link> -->
</div> </div>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -826,14 +841,21 @@ export default { ...@@ -826,14 +841,21 @@ export default {
this.upload.open = false; this.upload.open = false;
this.upload.isUploading = false; this.upload.isUploading = false;
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true }); // this.getDataList();
this.getDataList();
this.countImportError(); countImportError().then(response => {
this.importError = response.data;
if(this.importError === 0) {
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
} else {
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + '有错误数据,请点击导入界面查看详情' + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
}
})
this.getList(); listUser(this.queryParams).then(response => {
// //导入后 刷新 任职岗位字典数据 this.userList = response.rows;
// this.peopleOccupationOptions = []; this.total = response.total;
// this.queryPeopleOccupationByGroupByMethod(); });
}, },
/**关联设备已经选中数据删除方法*/ /**关联设备已经选中数据删除方法*/
...@@ -1212,4 +1234,10 @@ export default { ...@@ -1212,4 +1234,10 @@ export default {
padding: 0 15px; padding: 0 15px;
transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%);
} }
.el-badge__content.is-fixed {
top: 0 !important;
right: 5px !important;
}
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment