认证收集的参数导出 工程接口人角色只看到自己的数据
This commit is contained in:
+27
-2
@@ -2157,8 +2157,17 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
|||||||
// os.close(); // 后开先关
|
// os.close(); // 后开先关
|
||||||
// fis.close(); // 先开后关
|
// fis.close(); // 先开后关
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
if (e instanceof JeroBootException){
|
||||||
throw new JeroBootException("下载文件失败,请重试");
|
throw new JeroBootException(e.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
if (CutEnum.EN.getValue().equals(paramsCollectManifestVO.getCut())) {
|
||||||
|
throw new JeroBootException("Failed to download file, please try again");
|
||||||
|
} else {
|
||||||
|
throw new JeroBootException("下载文件失败,请重试");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
// IOUtils.closeQuietly(os);
|
// IOUtils.closeQuietly(os);
|
||||||
IOUtils.closeQuietly(excelOS);
|
IOUtils.closeQuietly(excelOS);
|
||||||
@@ -2250,10 +2259,26 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
|||||||
Integer paramsTemplatePublishVersion = paramsCollectManifestVO.getParamsTemplatePublishVersion();
|
Integer paramsTemplatePublishVersion = paramsCollectManifestVO.getParamsTemplatePublishVersion();
|
||||||
String cut = paramsCollectManifestVO.getCut();
|
String cut = paramsCollectManifestVO.getCut();
|
||||||
|
|
||||||
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
|
||||||
ParamsCollectManifestEO queryEO = new ParamsCollectManifestEO();
|
ParamsCollectManifestEO queryEO = new ParamsCollectManifestEO();
|
||||||
queryEO.setParamsManifestId(paramsManifestId);
|
queryEO.setParamsManifestId(paramsManifestId);
|
||||||
|
|
||||||
|
String userTypes = paramsCollectManifestVO.getUserTypes();
|
||||||
|
if (userTypes != null && CollectManifestUserTypeEnum.SDT.getValue().equals(userTypes)){
|
||||||
|
queryEO.setUserTypes(CollectManifestUserTypeEnum.SDT.getValue());
|
||||||
|
queryEO.setSdt(loginUser.getUsername());
|
||||||
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> dataList = paramsCollectManifestEOMapper.listInfoForExport(queryEO); // 查询导出数据
|
List<Map<String, Object>> dataList = paramsCollectManifestEOMapper.listInfoForExport(queryEO); // 查询导出数据
|
||||||
|
if (dataList == null || dataList.isEmpty()){
|
||||||
|
// 没有查到数据,进行提示
|
||||||
|
if (CutEnum.EN.getValue().equals(paramsCollectManifestVO.getCut())) {
|
||||||
|
throw new JeroBootException("No data, unable to export");
|
||||||
|
} else {
|
||||||
|
throw new JeroBootException("无数据,无法导出");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<ParamsConfigEO> paramsConfigEOList = paramsConfigEOService.queryList(paramsManifestId); // 查询所有配置列
|
List<ParamsConfigEO> paramsConfigEOList = paramsConfigEOService.queryList(paramsManifestId); // 查询所有配置列
|
||||||
|
|
||||||
|
|||||||
+3
@@ -74,4 +74,7 @@ public class ParamsCollectManifestVO {
|
|||||||
|
|
||||||
private String exportName; // 导出文件名
|
private String exportName; // 导出文件名
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户类型")
|
||||||
|
private String userTypes; // 用户类型
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -822,11 +822,13 @@
|
|||||||
paramsTemplateId: this.$route.query.paramsTemplateId,
|
paramsTemplateId: this.$route.query.paramsTemplateId,
|
||||||
paramsTemplatePublishVersion:1,
|
paramsTemplatePublishVersion:1,
|
||||||
cut: this.cut,
|
cut: this.cut,
|
||||||
|
userTypes: this.currentPersonRole,
|
||||||
exportName:this.$route.query.projectName + '(' + this.$route.query.title + ')'
|
exportName:this.$route.query.projectName + '(' + this.$route.query.title + ')'
|
||||||
}
|
}
|
||||||
console.log(query)
|
|
||||||
getAction('/params/collectManifest/exportAll', query).then((res) => {
|
getAction('/params/collectManifest/exportAll', query).then((res) => {
|
||||||
|
if (res && !res.success) {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
this.textLoading = false
|
this.textLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user