合并分支 'dev_third_stage' 到 'master'

Dev third stage

查看合并请求 laws-nio/laws-weilai!188
This commit is contained in:
高嵩
2022-10-11 20:18:59 +08:00
7 changed files with 353 additions and 23 deletions
@@ -123,9 +123,12 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
@AutoLog(value = "对外报告数据表-添加")
@ApiOperation(value = "对外报告数据表-添加", notes = "对外报告数据表-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody ExtRepoData extRepoData) {
public Result<?> add(@Validated @RequestBody ExtRepoData extRepoData,HttpSession session) {
Result<ExtRepoData> result = new Result();
if (extRepoFolderService.haveManageAuth(extRepoData.getSupFolder())) {
//判断当前文件夹或者上级文件夹是否有权限
session.setAttribute("haveSuperiorManageAuth", false);
extRepoFolderService.haveSuperiorManageAuth(extRepoData.getSupFolder(),session);
if ((Boolean)session.getAttribute("haveSuperiorManageAuth")) {
log.info("对外报告数据表收到文件添加请求,开始处理文件:【" + sdf.format(new Date()) + "】");
int res = extRepoDataService.add(extRepoData);
if (CutEnum.CN.getValue().equals(extRepoData.getCut())) {
@@ -153,11 +156,14 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
@AutoLog(value = "对外报告数据表-编辑")
@ApiOperation(value = "对外报告数据表-编辑", notes = "对外报告数据表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody ExtRepoData extRepoData) {
public Result<?> edit(@Validated @RequestBody ExtRepoData extRepoData,HttpSession session) {
Result<ExtRepoData> result = new Result();
ExtRepoData erd = extRepoDataService.queryById(extRepoData.getId());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if (extRepoFolderService.isManager() || sysUser.getUsername().equals(erd.getCreateBy())) {
//LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//判断当前文件夹或者上级文件夹是否有权限
session.setAttribute("haveSuperiorManageAuth", false);
extRepoFolderService.haveSuperiorManageAuth(erd.getSupFolder(),session);
if (extRepoFolderService.isManager() || (Boolean)session.getAttribute("haveSuperiorManageAuth")) {
extRepoData.setSupFolder(erd.getSupFolder());
extRepoDataService.editById(extRepoData);
if (CutEnum.CN.getValue().equals(extRepoData.getCut())) {
@@ -185,12 +191,15 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
@ApiOperation(value = "对外报告数据表-通过id删除", notes = "对外报告数据表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam("id") String id,
@RequestParam(name = "cut", defaultValue = "cn") String cut) {
@RequestParam(name = "cut", defaultValue = "cn") String cut,HttpSession session) {
Result<ExtRepoData> result = new Result();
ExtRepoData erd = extRepoDataService.queryById(id);
if (null != erd) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if (extRepoFolderService.isManager() || sysUser.getUsername().equals(erd.getCreateBy())) {
//LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//判断当前文件夹或者上级文件夹是否有权限
session.setAttribute("haveSuperiorManageAuth", false);
extRepoFolderService.haveSuperiorManageAuth(erd.getSupFolder(),session);
if (extRepoFolderService.isManager() || (Boolean)session.getAttribute("haveSuperiorManageAuth")) {
extRepoDataService.deleteById(id);
CosBootUtil.delete(erd.getFileKey());
if (CutEnum.CN.getValue().equals(cut)) {
@@ -241,7 +241,6 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
List<ERFTreeData> resList = new ArrayList<>();
for (ExtRepoFolder erf : list) {
if (supId.equals(erf.getSupFolder())) {
//int childLevel = level + 1;
if (haveViewAuth(erf.getId())) {
ERFTreeData date = new ERFTreeData(erf.getFolderName(), erf.getId(), level, erf.getOrderId());
boolean parentRightClick = haveManageAuth(erf.getId());
@@ -252,7 +251,7 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
date.setAuthManageIds(erf.getAuthManageIds());
date.setAuthViewIdsName(erf.getAuthViewIdsName());
date.setAuthViewIds(erf.getAuthViewIds());
date.setChildren(subFolderTree(erf.getId(),new ArrayList<ERFTreeData>(),level,parentRightClick));
date.setChildren(subFolderTree(new ArrayList<ERFTreeData>(),date));
date.sortChildren();
resList.add(date);
} else {
@@ -265,19 +264,18 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
/**
* 父文件夹有权限则获取其下全部子文件夹
* @param folder
* @param level
* @param childTree
* @param father
* @return
*/
private List<ERFTreeData> subFolderTree(String folder,List<ERFTreeData> childTree,int level,boolean parentRightClick) {
int childLevel = level + 1;
List<ExtRepoFolder> listBySupFolder = getListBySupFolder(folder);
ExtRepoFolder father = queryById(folder);
private List<ERFTreeData> subFolderTree(List<ERFTreeData> childTree,ERFTreeData father) {
int childLevel = father.getLevel() + 1;
List<ExtRepoFolder> listBySupFolder = getListBySupFolder(father.getKey());
for (ExtRepoFolder extRepoFolder : listBySupFolder) {
ERFTreeData date = new ERFTreeData(extRepoFolder.getFolderName(), extRepoFolder.getId(), childLevel, extRepoFolder.getOrderId());
//是否有管理权限
boolean childRightClick = haveManageAuth(extRepoFolder.getId());
if (parentRightClick||childRightClick) {
if (father.isManager()||childRightClick) {
date.setManager(true);
}
//如果参数为空则延续父文件夹权限,反之用自己的
@@ -295,7 +293,7 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
date.setAuthViewIdsName(father.getAuthViewIdsName());
date.setAuthViewIds(father.getAuthViewIds());
}
date.setChildren(subFolderTree(extRepoFolder.getId(), new ArrayList<ERFTreeData>(),childLevel,childRightClick));
date.setChildren(subFolderTree(new ArrayList<ERFTreeData>(),date));
date.sortChildren();
childTree.add(date);
}
@@ -255,6 +255,14 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl
public void exportZip(HttpServletResponse response, HttpServletRequest request, LawsTechnologyEvaluationItemResultEO lawsTechnologyEvaluationItemResultEO, Map<String, Object> params) {
String ids = (String)params.get("ids");
String cut = (String)params.get("cut");
String serialNumber = (String)params.get("serialNumber");
if(StringUtils.isEmpty(serialNumber)){
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
throw new JeroBootException("编号为空,请检查!");
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
throw new JeroBootException("The serialNumber is empty, please check!");
}
}
QueryWrapper<LawsTechnologyEvaluationItemResultEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationItemResultEO, request.getParameterMap());
if(StringUtils.isNotEmpty(ids)){
List<String> idList = Arrays.asList(ids.split(","));
@@ -267,10 +275,10 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl
String fileName = "";
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
title = "条款号,条款名称,条款内容,评估人,评估方式,技术文件名称,章节,符合性结果,意见,附件,反馈时间";
fileName = "条款评估结果" + ".xls";
fileName = serialNumber + " 条款评估结果" + ".xls";
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
title = "Item No.,Item Name,Item Content,Assessor,Evaluation method,Name of technical document,Chapter,Compliance Results,Opinion,Enclosure,Feedback Time";
fileName = "Item Evaluation results" + ".xls";
fileName = serialNumber + " Item Evaluation results" + ".xls";
}
OutputStream os = null;
+3 -1
View File
@@ -11,6 +11,7 @@ import {
CACHE_INCLUDED_ROUTES
} from '@/store/mutation-types'
import { welcome } from '@/utils/util'
import { LZString } from '@/utils/compressedData'
import { queryPermissionsByUser } from '@/api/api'
import { getAction } from '@/api/manage'
@@ -146,7 +147,8 @@ const user = {
// if (!gData) {
// getAction('sys/user/queryUserTreeList', {}).then((res) => {
// if (res.success) {
// localStorage.setItem('gData', JSON.stringify(res.result))
// let index = LZString.compressToUint8Array(JSON.stringify(res.result)).join(',')
// localStorage.setItem('gData', LZString.compressToEncodedURIComponent(index))
// }
// })
// }
+313
View File
@@ -0,0 +1,313 @@
export const LZString = function() {
function f(h, e) {
if (!b[h]) {
b[h] = {};
for (var i = 0; i < h.length; i++) {
b[h][h.charAt(i)] = i
}
}
return b[h][e]
}
var c = String.fromCharCode,
g = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",
b = {},
a = {
compressToBase64: function(h) {
if (null == h) {
return ""
}
var e = a._compress(h, 6,
function(i) {
return g.charAt(i)
});
switch (e.length % 4) {
default:
case 0:
return e;
case 1:
return e + "===";
case 2:
return e + "==";
case 3:
return e + "="
}
},
decompressFromBase64: function(e) {
return null == e ? "": "" == e ? null: a._decompress(e.length, 32,
function(h) {
return f(g, e.charAt(h))
})
},
compressToUTF16: function(e) {
return null == e ? "": a._compress(e, 15,
function(h) {
return c(h + 32)
}) + " "
},
decompressFromUTF16: function(e) {
return null == e ? "": "" == e ? null: a._decompress(e.length, 16384,
function(h) {
return e.charCodeAt(h) - 32
})
},
compressToUint8Array: function(l) {
for (var j = a.compress(l), m = new Uint8Array(2 * j.length), k = 0, h = j.length; h > k; k++) {
var i = j.charCodeAt(k);
m[2 * k] = i >>> 8,
m[2 * k + 1] = i % 256
}
return m
},
decompressFromUint8Array: function(k) {
if (null === k || void 0 === k) {
return a.decompress(k)
}
for (var l = new Array(k.length / 2), j = 0, h = l.length; h > j; j++) {
l[j] = 256 * k[2 * j] + k[2 * j + 1]
}
var i = [];
return l.forEach(function(e) {
i.push(c(e))
}),
a.decompress(i.join(""))
},
compressToEncodedURIComponent: function(e) {
return null == e ? "": a._compress(e, 6,
function(h) {
return d.charAt(h)
})
},
decompressFromEncodedURIComponent: function(e) {
return null == e ? "": "" == e ? null: (e = e.replace(/ /g, "+"), a._decompress(e.length, 32,
function(h) {
return f(d, e.charAt(h))
}))
},
compress: function(e) {
return a._compress(e, 16,
function(h) {
return c(h)
})
},
_compress: function(q, j, w) {
if (null == q) {
return ""
}
var C, I, z, J = {},
k = {},
H = "",
E = "",
F = "",
y = 2,
B = 3,
A = 2,
D = [],
x = 0,
G = 0;
for (z = 0; z < q.length; z += 1) {
if (H = q.charAt(z), Object.prototype.hasOwnProperty.call(J, H) || (J[H] = B++, k[H] = !0), E = F + H, Object.prototype.hasOwnProperty.call(J, E)) {
F = E
} else {
if (Object.prototype.hasOwnProperty.call(k, F)) {
if (F.charCodeAt(0) < 256) {
for (C = 0; A > C; C++) {
x <<= 1,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++
}
for (I = F.charCodeAt(0), C = 0; 8 > C; C++) {
x = x << 1 | 1 & I,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++,
I >>= 1
}
} else {
for (I = 1, C = 0; A > C; C++) {
x = x << 1 | I,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++,
I = 0
}
for (I = F.charCodeAt(0), C = 0; 16 > C; C++) {
x = x << 1 | 1 & I,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++,
I >>= 1
}
}
y--,
0 == y && (y = Math.pow(2, A), A++),
delete k[F]
} else {
for (I = J[F], C = 0; A > C; C++) {
x = x << 1 | 1 & I,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++,
I >>= 1
}
}
y--,
0 == y && (y = Math.pow(2, A), A++),
J[E] = B++,
F = String(H)
}
}
if ("" !== F) {
if (Object.prototype.hasOwnProperty.call(k, F)) {
if (F.charCodeAt(0) < 256) {
for (C = 0; A > C; C++) {
x <<= 1,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++
}
for (I = F.charCodeAt(0), C = 0; 8 > C; C++) {
x = x << 1 | 1 & I,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++,
I >>= 1
}
} else {
for (I = 1, C = 0; A > C; C++) {
x = x << 1 | I,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++,
I = 0
}
for (I = F.charCodeAt(0), C = 0; 16 > C; C++) {
x = x << 1 | 1 & I,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++,
I >>= 1
}
}
y--,
0 == y && (y = Math.pow(2, A), A++),
delete k[F]
} else {
for (I = J[F], C = 0; A > C; C++) {
x = x << 1 | 1 & I,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++,
I >>= 1
}
}
y--,
0 == y && (y = Math.pow(2, A), A++)
}
for (I = 2, C = 0; A > C; C++) {
x = x << 1 | 1 & I,
G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++,
I >>= 1
}
for (;;) {
if (x <<= 1, G == j - 1) {
D.push(w(x));
break
}
G++
}
return D.join("")
},
decompress: function(e) {
return null == e ? "": "" == e ? null: a._decompress(e.length, 32768,
function(h) {
return e.charCodeAt(h)
})
},
_decompress: function(B, C, I) {
var r, F, x, z, q, K, L, E, H = [],
G = 4,
J = 4,
D = 3,
k = "",
j = [],
y = {
val: I(0),
position: C,
index: 1
};
for (F = 0; 3 > F; F += 1) {
H[F] = F
}
for (z = 0, K = Math.pow(2, 2), L = 1; L != K;) {
q = y.val & y.position,
y.position >>= 1,
0 == y.position && (y.position = C, y.val = I(y.index++)),
z |= (q > 0 ? 1 : 0) * L,
L <<= 1
}
switch (r = z) {
case 0:
for (z = 0, K = Math.pow(2, 8), L = 1; L != K;) {
q = y.val & y.position,
y.position >>= 1,
0 == y.position && (y.position = C, y.val = I(y.index++)),
z |= (q > 0 ? 1 : 0) * L,
L <<= 1
}
E = c(z);
break;
case 1:
for (z = 0, K = Math.pow(2, 16), L = 1; L != K;) {
q = y.val & y.position,
y.position >>= 1,
0 == y.position && (y.position = C, y.val = I(y.index++)),
z |= (q > 0 ? 1 : 0) * L,
L <<= 1
}
E = c(z);
break;
case 2:
return ""
}
for (H[3] = E, x = E, j.push(E);;) {
if (y.index > B) {
return ""
}
for (z = 0, K = Math.pow(2, D), L = 1; L != K;) {
q = y.val & y.position,
y.position >>= 1,
0 == y.position && (y.position = C, y.val = I(y.index++)),
z |= (q > 0 ? 1 : 0) * L,
L <<= 1
}
switch (E = z) {
case 0:
for (z = 0, K = Math.pow(2, 8), L = 1; L != K;) {
q = y.val & y.position,
y.position >>= 1,
0 == y.position && (y.position = C, y.val = I(y.index++)),
z |= (q > 0 ? 1 : 0) * L,
L <<= 1
}
H[J++] = c(z),
E = J - 1,
G--;
break;
case 1:
for (z = 0, K = Math.pow(2, 16), L = 1; L != K;) {
q = y.val & y.position,
y.position >>= 1,
0 == y.position && (y.position = C, y.val = I(y.index++)),
z |= (q > 0 ? 1 : 0) * L,
L <<= 1
}
H[J++] = c(z),
E = J - 1,
G--;
break;
case 2:
return j.join("")
}
if (0 == G && (G = Math.pow(2, D), D++), H[E]) {
k = H[E]
} else {
if (E !== J) {
return null
}
k = x + x.charAt(0)
}
j.push(k),
H[J++] = x + k.charAt(0),
G--,
x = k,
0 == G && (G = Math.pow(2, D), D++)
}
}
};
return a
} ();
// module.exports = LZString
@@ -306,7 +306,8 @@
let query = {
...this.queryParam,
ids: selectedRowKeys.join(','),
lawsTechnologyEvaluationId: this.$route.query.id
lawsTechnologyEvaluationId: this.$route.query.id,
serialNumber: this.$route.query.serialNumber
}
downloadFile(this.url.exportData, this.$route.query.serialNumber + ' ' + this.$t('regulatoryTechnicalEvaluationResults') + '.zip',
query, this.Deselect)
@@ -112,7 +112,6 @@
<PersonnelSelection
:query="{db_field_name:'certificationEngineer',db_field_txt:$t('certifiedEngineer')}"
:personneQuery="formInline"
:selectDepartment="true"
@change="PersonnelSelectionChange"
:disabled="disabled"
v-model="formInline.certificationEngineerName"/>