【更新】业务模块增加导入导出等功能代码

pull/92/head
xuyuxiang 2 years ago
parent 4f71fd1006
commit 25e3b339c1

@ -70,6 +70,12 @@ export default {
grantRole(data) { grantRole(data) {
return request('grantRole', data) return request('grantRole', data)
}, },
// 下载用户导入模板
userDownloadImportUserTemplate(data) {
return request('downloadImportUserTemplate', data, 'get', {
responseType: 'blob'
})
},
// 用户导入 // 用户导入
userImport(data) { userImport(data) {
return request('import', data) return request('import', data)

@ -123,7 +123,7 @@
} }
// //
const downloadImportUserTemplate = () => { const downloadImportUserTemplate = () => {
userApi.userDownloadImportUserTemplate().then((res) => { bizUserApi.userDownloadImportUserTemplate().then((res) => {
downloadUtil.resultDownload(res) downloadUtil.resultDownload(res)
}) })
} }

@ -129,6 +129,9 @@
<a-menu-item v-if="hasPerm('bizUserGrantRole')"> <a-menu-item v-if="hasPerm('bizUserGrantRole')">
<a @click="selectRole(record)">{{ $t('user.grantRole') }}</a> <a @click="selectRole(record)">{{ $t('user.grantRole') }}</a>
</a-menu-item> </a-menu-item>
<a-menu-item v-if="hasPerm('bizUserGrantRole')">
<a @click="exportUserInfo(record)">{{ $t('user.exportUserInfo') }}</a>
</a-menu-item>
</a-menu> </a-menu>
</template> </template>
</a-dropdown> </a-dropdown>

@ -221,6 +221,7 @@ public class BizUserController {
@ApiOperationSupport(order = 11) @ApiOperationSupport(order = 11)
@ApiOperation("下载人员导入模板") @ApiOperation("下载人员导入模板")
@CommonLog("下载人员导入模板") @CommonLog("下载人员导入模板")
@SaCheckPermission("/biz/user/downloadImportUserTemplate")
@GetMapping(value = "/biz/user/downloadImportUserTemplate", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) @GetMapping(value = "/biz/user/downloadImportUserTemplate", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public CommonResult<String> downloadImportUserTemplate(HttpServletResponse response) throws IOException { public CommonResult<String> downloadImportUserTemplate(HttpServletResponse response) throws IOException {
bizUserService.downloadImportUserTemplate(response); bizUserService.downloadImportUserTemplate(response);
@ -236,6 +237,7 @@ public class BizUserController {
@ApiOperationSupport(order = 12) @ApiOperationSupport(order = 12)
@ApiOperation("人员导入") @ApiOperation("人员导入")
@CommonLog("人员导入") @CommonLog("人员导入")
@SaCheckPermission("/biz/user/import")
@PostMapping("/biz/user/import") @PostMapping("/biz/user/import")
public CommonResult<JSONObject> importUser(@RequestPart("file") @ApiParam(value="文件", required = true) MultipartFile file) { public CommonResult<JSONObject> importUser(@RequestPart("file") @ApiParam(value="文件", required = true) MultipartFile file) {
return CommonResult.data(bizUserService.importUser(file)); return CommonResult.data(bizUserService.importUser(file));
@ -250,6 +252,7 @@ public class BizUserController {
@ApiOperationSupport(order = 13) @ApiOperationSupport(order = 13)
@ApiOperation("人员导出") @ApiOperation("人员导出")
@CommonLog("人员导出") @CommonLog("人员导出")
@SaCheckPermission("/biz/user/export")
@GetMapping(value = "/biz/user/export", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) @GetMapping(value = "/biz/user/export", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public void exportUser(BizUserExportParam bizUserExportParam, HttpServletResponse response) throws IOException { public void exportUser(BizUserExportParam bizUserExportParam, HttpServletResponse response) throws IOException {
bizUserService.exportUser(bizUserExportParam, response); bizUserService.exportUser(bizUserExportParam, response);
@ -264,6 +267,7 @@ public class BizUserController {
@ApiOperationSupport(order = 14) @ApiOperationSupport(order = 14)
@ApiOperation("导出人员个人信息") @ApiOperation("导出人员个人信息")
@CommonLog("导出人员个人信息") @CommonLog("导出人员个人信息")
@SaCheckPermission("/biz/user/exportUserInfo")
@GetMapping(value = "/biz/user/exportUserInfo", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) @GetMapping(value = "/biz/user/exportUserInfo", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public void exportUserInfo(BizUserIdParam bizUserIdParam, HttpServletResponse response) throws IOException { public void exportUserInfo(BizUserIdParam bizUserIdParam, HttpServletResponse response) throws IOException {
bizUserService.exportUserInfo(bizUserIdParam, response); bizUserService.exportUserInfo(bizUserIdParam, response);

Loading…
Cancel
Save