From a1f349d231cc91d88f88d03bf8ebac8154b4ed0f Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Fri, 4 Jul 2025 11:21:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AF=81=E5=92=8C=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E5=8F=B7=E8=BF=94=E5=9B=9E=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluate/controller/PersonController.java | 35 +++++++++++----- .../controller/TeamGroupController.java | 11 +++++ .../manager/controller/UserController.java | 6 +++ .../controller/ViolationController.java | 11 +++++ .../static/js/evaluate/person/person.js | 40 +++++++++++-------- .../js/evaluate/teamGroup/teamMemBerPerson.js | 14 ++++++- .../outsourceEnterpriseFrom.html | 2 +- .../outsourceEnterpriseList.html | 15 ++++++- .../pages/evaluate/person/editPerson.html | 2 + .../pages/evaluate/person/evaluatePerson.html | 1 + .../evaluate/teamGroup/teamMemBerPerson.html | 2 + .../resources/static/pages/user/userList.html | 35 +++++++++------- 12 files changed, 129 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/PersonController.java b/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/PersonController.java index a50350f..b68f04f 100644 --- a/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/PersonController.java +++ b/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/PersonController.java @@ -6,10 +6,12 @@ import com.bonus.gs.sub.evaluate.evaluate.beans.SetTemplateBean; import com.bonus.gs.sub.evaluate.evaluate.dao.PersonDao; import com.bonus.gs.sub.evaluate.evaluate.service.PersonService; import com.bonus.gs.sub.evaluate.manager.model.Role; +import com.bonus.gs.sub.evaluate.manager.utils.AesCbcUtils; import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes; import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -39,7 +41,7 @@ public class PersonController { AjaxRes ar = new AjaxRes(); try { List list = dao.getDeptTree(o); - List nodeBeans = convertToTree(list,o.getOrgId()); + List nodeBeans = convertToTree(list, o.getOrgId()); //将数据转换为树形结构 ar.setSucceed(nodeBeans); } catch (Exception e) { @@ -50,7 +52,7 @@ public class PersonController { @GetMapping("getUserList") @ResponseBody - public AjaxRes getInitiateEvaluateList(PersonBean o){ + public AjaxRes getInitiateEvaluateList(PersonBean o) { AjaxRes ar = new AjaxRes(); String[] id; if (o.getId() == null || o.getId().isEmpty()) { @@ -58,7 +60,7 @@ public class PersonController { } else { id = o.getId().split(","); } - List list = dao.getUserList(id,o); + List list = dao.getUserList(id, o); ar.setListSucceed(list); return ar; } @@ -68,6 +70,7 @@ public class PersonController { public List getRoleSelect() { return dao.getRoleSelect(); } + @PostMapping("/getDeptSelect") @ApiOperation(value = "获取部门下拉选") public List getDeptSelect() { @@ -81,7 +84,7 @@ public class PersonController { AjaxRes ar = new AjaxRes(); try { ar = service.addPersonInfo(o); - }catch(Exception e) { + } catch (Exception e) { ar.setFailMsg(GlobalConst.DATA_FAIL); } return ar; @@ -89,9 +92,19 @@ public class PersonController { @GetMapping("getPersonList") @ResponseBody - public AjaxRes getPersonList(PersonBean o){ + public AjaxRes getPersonList(PersonBean o) { AjaxRes ar = new AjaxRes(); List list = dao.getPersonList(o); + for (PersonBean personBean : list) { + String phone = personBean.getPhone(); + if (StringUtils.isNotBlank(phone)) { + personBean.setPhone(AesCbcUtils.encrypt(phone)); + } + String idCard = personBean.getIdCard(); + if (StringUtils.isNotBlank(idCard)) { + personBean.setIdCard(AesCbcUtils.encrypt(idCard)); + } + } ar.setListSucceed(list); return ar; } @@ -102,11 +115,12 @@ public class PersonController { AjaxRes ar = new AjaxRes(); try { ar = service.updatePerson(o); - }catch(Exception e) { + } catch (Exception e) { ar.setFailMsg(GlobalConst.DATA_FAIL); } return ar; } + @RequestMapping("deletePersonById") @ResponseBody public AjaxRes deletePersonById(String id) { @@ -114,20 +128,21 @@ public class PersonController { try { dao.deletePersonRole(id); int result = dao.deletePersonById(id); - if(result > 0) { + if (result > 0) { ar.setRes(GlobalConst.SUCCEED); ar.setResMsg("删除成功"); - }else { + } else { ar.setFailMsg(GlobalConst.DATA_FAIL); ar.setResMsg("删除失败,请联系系统管理员"); } - }catch(Exception e) { + } catch (Exception e) { ar.setFailMsg(GlobalConst.DATA_FAIL); } return ar; } - private List convertToTree(List nodes,String orgId) { + + private List convertToTree(List nodes, String orgId) { Map nodeMap = new HashMap<>(); List tree = new ArrayList<>(); diff --git a/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/TeamGroupController.java b/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/TeamGroupController.java index 20e55b1..e6bd4ea 100644 --- a/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/TeamGroupController.java +++ b/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/TeamGroupController.java @@ -5,6 +5,7 @@ import com.bonus.gs.sub.evaluate.evaluate.beans.ProjectBean; import com.bonus.gs.sub.evaluate.evaluate.beans.TeamGroupBean; import com.bonus.gs.sub.evaluate.evaluate.service.TeamGroupService; import com.bonus.gs.sub.evaluate.manager.controller.BaseController; +import com.bonus.gs.sub.evaluate.manager.utils.AesCbcUtils; import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes; import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst; import com.bonus.gs.sub.evaluate.manager.utils.UserUtil; @@ -90,6 +91,16 @@ public class TeamGroupController extends BaseController { AjaxRes ar = new AjaxRes(); try { List teamGroupList = teamGroupService.getTeamGroupPersons(teamGroupBean); + for (TeamGroupBean groupBean : teamGroupList) { + String phone = groupBean.getPhone(); + if (StringUtils.isNotBlank(phone)) { + groupBean.setPhone(AesCbcUtils.encrypt(phone)); + } + String idCard = groupBean.getIdCard(); + if (StringUtils.isNotBlank(idCard)) { + groupBean.setIdCard(AesCbcUtils.encrypt(idCard)); + } + } ar.setListSucceed(teamGroupList); } catch (Exception e) { ar.setFailMsg(GlobalConst.DATA_FAIL); diff --git a/src/main/java/com/bonus/gs/sub/evaluate/manager/controller/UserController.java b/src/main/java/com/bonus/gs/sub/evaluate/manager/controller/UserController.java index d1be023..3c1e4a6 100644 --- a/src/main/java/com/bonus/gs/sub/evaluate/manager/controller/UserController.java +++ b/src/main/java/com/bonus/gs/sub/evaluate/manager/controller/UserController.java @@ -138,6 +138,12 @@ public class UserController { @Override public List list(PageTableRequest request) { List list = userDao.list(request.getParams(), request.getOffset(), request.getLimit()); + for (SysUser sysUser : list) { + String phone = sysUser.getPhone(); + if (StringUtils.isNotBlank(phone)) { + sysUser.setPhone(AesCbcUtils.encrypt(phone)); + } + } return list; } }).handle(request); diff --git a/src/main/java/com/bonus/gs/sub/evaluate/outsourceEnterprise/controller/ViolationController.java b/src/main/java/com/bonus/gs/sub/evaluate/outsourceEnterprise/controller/ViolationController.java index 57b50df..1f227bc 100644 --- a/src/main/java/com/bonus/gs/sub/evaluate/outsourceEnterprise/controller/ViolationController.java +++ b/src/main/java/com/bonus/gs/sub/evaluate/outsourceEnterprise/controller/ViolationController.java @@ -56,6 +56,16 @@ public class ViolationController extends BaseController { public AjaxRes outsourceEnterpriseByPage(ViolationBean o){ AjaxRes ar = getAjaxRes(); List list = service.getOutsourceEnterpriseByPage(o); + for (ViolationBean violationBean : list) { + String phone = violationBean.getPhone(); + if (StringUtils.isNotBlank(phone)) { + violationBean.setPhone(AesCbcUtils.encrypt(phone)); + } + String idCard = violationBean.getIdCard(); + if (StringUtils.isNotBlank(idCard)) { + violationBean.setIdCard(AesCbcUtils.encrypt(idCard)); + } + } ar.setListSucceed(list); return ar; } @@ -171,6 +181,7 @@ public class ViolationController extends BaseController { ViolationBean o = new ViolationBean(); o.setId(id); ViolationBean result = service.toViewOutsourceEnterprise(o); + result.setPhone(AesCbcUtils.encrypt(result.getPhone())); ar.setSucceed(result); }catch(Exception e) { diff --git a/src/main/resources/static/js/evaluate/person/person.js b/src/main/resources/static/js/evaluate/person/person.js index 4328628..c76c1d5 100644 --- a/src/main/resources/static/js/evaluate/person/person.js +++ b/src/main/resources/static/js/evaluate/person/person.js @@ -1,6 +1,5 @@ let layer, treeTable, tableIns, table; const token = localStorage.getItem("token"); - layui.use(["layer", "treeTable", "table"], function () { layer = layui.layer; treeTable = layui.treeTable; @@ -58,21 +57,27 @@ function initTreeTable() { unresize: true, align: "center", },*/ - // { - // field: "idCard", - // title: "身份证号码", - // width: "20%", - // unresize: true, - // align: "center", - // templet: (d) => maskSensitiveInfo(d.idCard, "idCard"), - // }, + /* { + field: "idCard", + title: "身份证号码", + width: "20%", + unresize: true, + align: "center", + templet: function (d) { + let idCard = decryptCBC(d.idCard); + return maskSensitiveInfo(idCard, "idCard"); + } + },*/ { field: "phone", title: "联系电话", width: "20%", unresize: true, align: "center", - templet: (d) => maskSensitiveInfo(d.phone, "phone"), + templet: function (d) { + let phone = decryptCBC(d.phone); + return maskSensitiveInfo(phone, "phone"); + } }, { field: "deptName", @@ -150,14 +155,14 @@ function del(data) { $.ajax({ type: "POST", url: ctxPath + "/evaluatePerson/deletePersonById", - data: { id: data }, + data: {id: data}, success: function (data) { layer.close(index); if (data.res === 1) { - layer.msg(data.resMsg, { icon: 1, time: 2000 }); + layer.msg(data.resMsg, {icon: 1, time: 2000}); searchTable(1); } else { - layer.msg(data.resMsg, { icon: 2, time: 2000 }); + layer.msg(data.resMsg, {icon: 2, time: 2000}); } }, }); @@ -174,7 +179,8 @@ function add() { btn: ["确定"], maxmin: false, area: ["60%", "65%"], - success: function (layero, index) {}, + success: function (layero, index) { + }, yes: function (index, layero) { //提交子页面时执行 // 获取弹出层中的form表单元素 @@ -196,7 +202,8 @@ function edit(data) { content: "./editPerson.html", maxmin: false, area: ["40%", "60%"], - success: function (layero, index) {}, + success: function (layero, index) { + }, }; layerOptions.btn = ["确定"]; @@ -220,7 +227,8 @@ function openPage(title, url) { content: url, maxmin: false, area: ["90%", "95%"], - success: function (layero, index) {}, + success: function (layero, index) { + }, }; if (title === "查看人员") { diff --git a/src/main/resources/static/js/evaluate/teamGroup/teamMemBerPerson.js b/src/main/resources/static/js/evaluate/teamGroup/teamMemBerPerson.js index be86387..0c5e264 100644 --- a/src/main/resources/static/js/evaluate/teamGroup/teamMemBerPerson.js +++ b/src/main/resources/static/js/evaluate/teamGroup/teamMemBerPerson.js @@ -115,8 +115,18 @@ function initTable() { {field: "project", align: "center", title: "所属项目"}, {field: "teamGroupName", align: "center", title: "所属班组"}, {field: "name", align: "center", title: "姓名"}, - {field: "idCard", align: "center", title: "身份证"}, - {field: "phone", align: "center", title: "电话"}, + { field: 'idCard', title: '身份证', width: '15%', align: "center", + templet: function (d) { + let idCard = decryptCBC(d.idCard); + return maskSensitiveInfo(idCard, "idCard"); + } + }, + { field: 'phone', title: '电话', width: '15%', align: "center", + templet: function (d) { + let phone = decryptCBC(d.phone); + return maskSensitiveInfo(phone, "phone"); + } + }, {field: "sex", align: "center", title: "性别"}, {field: "workType", align: "center", title: "工种"}, { diff --git a/src/main/resources/static/pages/evaluate/outsourceEnterprise/outsourceEnterpriseFrom.html b/src/main/resources/static/pages/evaluate/outsourceEnterprise/outsourceEnterpriseFrom.html index bbd7d8f..aeb7347 100644 --- a/src/main/resources/static/pages/evaluate/outsourceEnterprise/outsourceEnterpriseFrom.html +++ b/src/main/resources/static/pages/evaluate/outsourceEnterprise/outsourceEnterpriseFrom.html @@ -134,7 +134,7 @@ $("#setTime").val(obj.setTime); $("#corporateName").val(obj.corporateName); $("#idCard").val(obj.idCard); - $("#phone").val(obj.phone); + $("#phone").val(decryptCBC(obj.phone)); $("#address").val(obj.address); } else { layer.msg(data.resMsg, {icon: 2, time: 2000}); diff --git a/src/main/resources/static/pages/evaluate/outsourceEnterprise/outsourceEnterpriseList.html b/src/main/resources/static/pages/evaluate/outsourceEnterprise/outsourceEnterpriseList.html index 8395048..c857371 100644 --- a/src/main/resources/static/pages/evaluate/outsourceEnterprise/outsourceEnterpriseList.html +++ b/src/main/resources/static/pages/evaluate/outsourceEnterprise/outsourceEnterpriseList.html @@ -79,6 +79,7 @@ + @@ -131,8 +132,18 @@ , {field: 'socialCreditCode', align: 'center', title: '统一社会信用代码'} , {field: 'setTime', align: 'center', title: '成立日期'} , {field: 'corporateName', align: 'center', title: '法人姓名'}, - // { field: 'idCard', title: '身份证号码', width: '20%', align: "center", templet: d => maskSensitiveInfo(d.idCard, 'idCard') }, - { field: 'phone', title: '联系电话', width: '15%', align: "center", templet: d => maskSensitiveInfo(d.phone, 'phone') }, + // { field: 'idCard', title: '身份证号码', width: '20%', align: "center", + // templet: function (d) { + // let idCard = decryptCBC(d.idCard); + // return maskSensitiveInfo(idCard, "idCard"); + // } + // }, + { field: 'phone', title: '联系电话', width: '15%', align: "center", + templet: function (d) { + let phone = decryptCBC(d.phone); + return maskSensitiveInfo(phone, "phone"); + } + }, { field: 'address', title: '单位地址', width: '15%', align: "center" }, {field: 'proNum', align: 'center', title: '项目数量'}, { diff --git a/src/main/resources/static/pages/evaluate/person/editPerson.html b/src/main/resources/static/pages/evaluate/person/editPerson.html index ce301ce..c38e6ea 100644 --- a/src/main/resources/static/pages/evaluate/person/editPerson.html +++ b/src/main/resources/static/pages/evaluate/person/editPerson.html @@ -70,6 +70,7 @@ + @@ -95,6 +96,7 @@ }) let data = localStorage.getItem("personInfo"); personInfo = JSON.parse(data); + personInfo.phone = decryptCBC(personInfo.phone); getDeptSelect(); getRoleSelect(); initData(personInfo); diff --git a/src/main/resources/static/pages/evaluate/person/evaluatePerson.html b/src/main/resources/static/pages/evaluate/person/evaluatePerson.html index 3a28d52..357260a 100644 --- a/src/main/resources/static/pages/evaluate/person/evaluatePerson.html +++ b/src/main/resources/static/pages/evaluate/person/evaluatePerson.html @@ -57,6 +57,7 @@ + diff --git a/src/main/resources/static/pages/evaluate/teamGroup/teamMemBerPerson.html b/src/main/resources/static/pages/evaluate/teamGroup/teamMemBerPerson.html index efda9d6..419430d 100644 --- a/src/main/resources/static/pages/evaluate/teamGroup/teamMemBerPerson.html +++ b/src/main/resources/static/pages/evaluate/teamGroup/teamMemBerPerson.html @@ -76,6 +76,8 @@ + + diff --git a/src/main/resources/static/pages/user/userList.html b/src/main/resources/static/pages/user/userList.html index 4c653be..a9a299b 100644 --- a/src/main/resources/static/pages/user/userList.html +++ b/src/main/resources/static/pages/user/userList.html @@ -12,6 +12,7 @@ width: 100%; text-align: center; /* 这会让整个表格内的文字居中 */ } + #dt-table th, #myTable td { text-align: center; /* 这会确保每个单元格内的文字也居中 */ } @@ -30,21 +31,21 @@ 角色: - - - + + + - - - - - - + + + + + + @@ -61,7 +62,7 @@ 角色 手机号 邮箱 - + 操作 @@ -76,6 +77,7 @@ + @@ -133,9 +135,14 @@ }, "dom": "<'dt-toolbar'r>t<'dt-toolbar-footer'<'col-sm-10 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-10' p v>>", "columns": [ - {"data": "username", "defaultContent": "" ,"text-align":"center" }, + {"data": "username", "defaultContent": "", "text-align": "center"}, {"data": "roleName", "defaultContent": ""}, - {"data": "phone", "defaultContent": "", "render": function(data, type, row) { return maskSensitiveInfo(data, 'phone'); }}, + { + "data": "phone", "defaultContent": "", "render": function (data, type, row) { + let phone = decryptCBC(data); + return maskSensitiveInfo(phone, 'phone'); + } + }, {"data": "email", "defaultContent": ""}, // { // "data": "status", @@ -152,7 +159,7 @@ var id = row['id']; var href = "updateUser.html?id=" + id; // var edit = buttonEdit(href, "sys:user:add", pers); - var change = buttonChange(id,row['phone'], "sys:user:add", pers); + var change = buttonChange(id, row['phone'], "sys:user:add", pers); // return edit + change; return change; } @@ -169,7 +176,7 @@ init(); - function changePassWord(id,phone) { + function changePassWord(id, phone) { layer.prompt({title: '请输入修改后的密码'}, function (value, index, elem) { if (value === '') { layer.msg('密码不能为空');