diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoDataController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoDataController.java index 5215dc1ab..b71be6192 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoDataController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoDataController.java @@ -123,9 +123,12 @@ public class ExtRepoDataController extends JeroController add(@Validated @RequestBody ExtRepoData extRepoData) { + public Result add(@Validated @RequestBody ExtRepoData extRepoData,HttpSession session) { Result 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 edit(@Validated @RequestBody ExtRepoData extRepoData) { + public Result edit(@Validated @RequestBody ExtRepoData extRepoData,HttpSession session) { Result 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 delete(@RequestParam("id") String id, - @RequestParam(name = "cut", defaultValue = "cn") String cut) { + @RequestParam(name = "cut", defaultValue = "cn") String cut,HttpSession session) { Result 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)) { diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/service/impl/ExtRepoFolderServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/service/impl/ExtRepoFolderServiceImpl.java index 429a8d72f..442ab9d67 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/service/impl/ExtRepoFolderServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/service/impl/ExtRepoFolderServiceImpl.java @@ -241,7 +241,6 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl 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(),level,parentRightClick)); + date.setChildren(subFolderTree(new ArrayList(),date)); date.sortChildren(); resList.add(date); } else { @@ -265,19 +264,18 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl subFolderTree(String folder,List childTree,int level,boolean parentRightClick) { - int childLevel = level + 1; - List listBySupFolder = getListBySupFolder(folder); - ExtRepoFolder father = queryById(folder); + private List subFolderTree(List childTree,ERFTreeData father) { + int childLevel = father.getLevel() + 1; + List 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(),childLevel,childRightClick)); + date.setChildren(subFolderTree(new ArrayList(),date)); date.sortChildren(); childTree.add(date); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java index 177e76a01..8664dec9c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java @@ -255,6 +255,14 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl public void exportZip(HttpServletResponse response, HttpServletRequest request, LawsTechnologyEvaluationItemResultEO lawsTechnologyEvaluationItemResultEO, Map 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 queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationItemResultEO, request.getParameterMap()); if(StringUtils.isNotEmpty(ids)){ List 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; diff --git a/jero-web/src/store/modules/user.js b/jero-web/src/store/modules/user.js index 2b9b58549..ccd43b585 100644 --- a/jero-web/src/store/modules/user.js +++ b/jero-web/src/store/modules/user.js @@ -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)) // } // }) // } diff --git a/jero-web/src/utils/compressedData.js b/jero-web/src/utils/compressedData.js new file mode 100644 index 000000000..f855f5083 --- /dev/null +++ b/jero-web/src/utils/compressedData.js @@ -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 \ No newline at end of file diff --git a/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsClause.vue b/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsClause.vue index 667c1dcd1..7fe05490c 100644 --- a/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsClause.vue +++ b/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsClause.vue @@ -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) diff --git a/jero-web/src/views/projectManagement/components/addModel.vue b/jero-web/src/views/projectManagement/components/addModel.vue index 30c6324e2..65b190bd4 100644 --- a/jero-web/src/views/projectManagement/components/addModel.vue +++ b/jero-web/src/views/projectManagement/components/addModel.vue @@ -112,7 +112,6 @@