身份证和手机号返回加密

This commit is contained in:
liang.chao 2025-07-04 13:43:51 +08:00
parent a1f349d231
commit a8edbfab2f
13 changed files with 79 additions and 12 deletions

View File

@ -5,10 +5,12 @@ import com.bonus.gs.sub.evaluate.evaluate.beans.OrganizationalBean;
import com.bonus.gs.sub.evaluate.evaluate.beans.PersonBean; import com.bonus.gs.sub.evaluate.evaluate.beans.PersonBean;
import com.bonus.gs.sub.evaluate.evaluate.beans.ProjectBean; import com.bonus.gs.sub.evaluate.evaluate.beans.ProjectBean;
import com.bonus.gs.sub.evaluate.evaluate.service.ProjectService; import com.bonus.gs.sub.evaluate.evaluate.service.ProjectService;
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.AjaxRes;
import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst; import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst;
import com.bonus.gs.sub.evaluate.outsourceEnterprise.beans.ViolationBean; import com.bonus.gs.sub.evaluate.outsourceEnterprise.beans.ViolationBean;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -92,6 +94,16 @@ public class ProjectController {
AjaxRes ar = new AjaxRes(); AjaxRes ar = new AjaxRes();
try { try {
List<ViolationBean> subcontractorList = service.getProjectSubcontractor(bean); List<ViolationBean> subcontractorList = service.getProjectSubcontractor(bean);
for (ViolationBean violationBean : subcontractorList) {
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(subcontractorList); ar.setListSucceed(subcontractorList);
} catch (Exception e) { } catch (Exception e) {
ar.setFailMsg(GlobalConst.DATA_FAIL); ar.setFailMsg(GlobalConst.DATA_FAIL);

View File

@ -78,6 +78,16 @@ public class TeamGroupController extends BaseController<TeamGroupBean> {
AjaxRes ar = new AjaxRes(); AjaxRes ar = new AjaxRes();
try { try {
List<TeamGroupBean> teamGroupList = teamGroupService.getTeamGroupPerson(teamGroupBean); List<TeamGroupBean> teamGroupList = teamGroupService.getTeamGroupPerson(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); ar.setListSucceed(teamGroupList);
} catch (Exception e) { } catch (Exception e) {
ar.setFailMsg(GlobalConst.DATA_FAIL); ar.setFailMsg(GlobalConst.DATA_FAIL);

View File

@ -51,7 +51,7 @@ public interface TeamGroupDao {
String getWorkTypeId(String workType); String getWorkTypeId(String workType);
String selectTeamLeaser(TeamGroupBean groupBean); TeamGroupBean selectTeamLeaser(TeamGroupBean groupBean);
List<TeamGroupBean> getTeamGroupPersons(TeamGroupBean teamGroupBean); List<TeamGroupBean> getTeamGroupPersons(TeamGroupBean teamGroupBean);
} }

View File

@ -2,6 +2,7 @@ package com.bonus.gs.sub.evaluate.evaluate.service;
import com.bonus.gs.sub.evaluate.evaluate.beans.TeamGroupBean; import com.bonus.gs.sub.evaluate.evaluate.beans.TeamGroupBean;
import com.bonus.gs.sub.evaluate.evaluate.dao.TeamGroupDao; import com.bonus.gs.sub.evaluate.evaluate.dao.TeamGroupDao;
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.AjaxRes;
import com.bonus.gs.sub.evaluate.manager.utils.UserUtil; import com.bonus.gs.sub.evaluate.manager.utils.UserUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -31,7 +32,14 @@ public class TeamGroupServiceImpl implements TeamGroupService {
public List<TeamGroupBean> getTeamGroupList(TeamGroupBean teamGroupBean) { public List<TeamGroupBean> getTeamGroupList(TeamGroupBean teamGroupBean) {
List<TeamGroupBean> teamGroupList = teamGroupDao.getTeamGroupList(teamGroupBean); List<TeamGroupBean> teamGroupList = teamGroupDao.getTeamGroupList(teamGroupBean);
for (TeamGroupBean groupBean : teamGroupList) { for (TeamGroupBean groupBean : teamGroupList) {
groupBean.setTeamLeader(teamGroupDao.selectTeamLeaser(groupBean)); TeamGroupBean bean = teamGroupDao.selectTeamLeaser(groupBean);
if (bean != null){
groupBean.setName(bean.getName());
String phone = bean.getPhone();
if (StringUtils.isNotBlank(phone)) {
groupBean.setPhone(AesCbcUtils.encrypt(phone));
}
}
} }
return teamGroupList; return teamGroupList;
} }

View File

@ -123,9 +123,7 @@
<select id="getWorkTypeId" resultType="java.lang.String"> <select id="getWorkTypeId" resultType="java.lang.String">
SELECT id FROM t_dict WHERE val = #{workType} and type = 'workType' SELECT id FROM t_dict WHERE val = #{workType} and type = 'workType'
</select> </select>
<select id="selectTeamLeaser" resultType="java.lang.String">
SELECT CONCAT( name, ' / ', phone ) FROM team_person WHERE team_id = #{id} and is_team_leader = 0
</select>
<select id="getTeamGroupPersons" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.TeamGroupBean"> <select id="getTeamGroupPersons" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.TeamGroupBean">
SELECT tp.id, SELECT tp.id,
tp.name, tp.name,
@ -166,4 +164,9 @@
and tp.work_type = #{workType} and tp.work_type = #{workType}
</if> </if>
</select> </select>
<select id="selectTeamLeaser" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.TeamGroupBean">
SELECT name,
phone
FROM team_person WHERE team_id = #{id} and is_team_leader = 0
</select>
</mapper> </mapper>

View File

@ -66,7 +66,12 @@ function initTable() {
}, },
{field: "enterpriseName", align: "center", title: "外包商名称"}, {field: "enterpriseName", align: "center", title: "外包商名称"},
{field: "corporateName", align: "center", title: "法人"}, {field: "corporateName", align: "center", title: "法人"},
{field: "phone", align: "center", title: "法人联系方式"}, { field: 'phone', title: '法人联系方式', width: '15%', align: "center",
templet: function (d) {
let phone = decryptCBC(d.phone);
return maskSensitiveInfo(phone, "phone");
}
},
{ {
fixed: "right", fixed: "right",
width: 180, width: 180,

View File

@ -14,8 +14,8 @@ function setParams(obj, layerIndex) {
$("#sex").val(2); $("#sex").val(2);
} }
$("#idCard").val(objParam.idCard); $("#idCard").val(decryptCBC(objParam.idCard));
$("#phone").val(objParam.phone); $("#phone").val(decryptCBC(objParam.phone));
if (objParam.faceUrl != null && objParam.faceUrl !== '') { if (objParam.faceUrl != null && objParam.faceUrl !== '') {
$('#fileInfo').html(objParam.faceUrl); $('#fileInfo').html(objParam.faceUrl);
} }

View File

@ -100,7 +100,18 @@ function initTable() {
{field: "subContractor", align: "center", title: "所属分包商"}, {field: "subContractor", align: "center", title: "所属分包商"},
{field: "project", align: "center", title: "所属项目"}, {field: "project", align: "center", title: "所属项目"},
{field: "teamGroupName", align: "center", title: "班组名称"}, {field: "teamGroupName", align: "center", title: "班组名称"},
{field: "teamLeader", align: "center", title: "班组长"}, {field: "name", align: "center", title: "班组长姓名"},
{
field: 'phone', title: '联系电话', width: '15%', align: "center",
templet: function (d) {
if (d.phone) {
let phone = decryptCBC(d.phone);
return maskSensitiveInfo(phone, "phone");
} else {
return "";
}
}
},
{field: "teamType", align: "center", title: "班组类型"}, {field: "teamType", align: "center", title: "班组类型"},
{ {
field: "teamPersonNum", field: "teamPersonNum",

View File

@ -86,8 +86,18 @@ function initTable() {
type: "numbers", type: "numbers",
}, },
{field: "name", align: "center", title: "姓名"}, {field: "name", align: "center", title: "姓名"},
{field: "idCard", align: "center", title: "身份证"}, { field: 'idCard', title: '身份证', width: '15%', align: "center",
{field: "phone", align: "center", title: "电话"}, 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: "sex", align: "center", title: "性别"},
{field: "workType", align: "center", title: "工种"}, {field: "workType", align: "center", title: "工种"},
{ {

View File

@ -55,6 +55,8 @@
</div> </div>
</div> </div>
<script src="../../../js/publicJs.js"></script> <script src="../../../js/publicJs.js"></script>
<script type="text/javascript" src="../../../js/AesCbc.js"></script>
<script type="text/javascript" src="../../../js/common_methon.js"></script>
<script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../../js/jq.js"></script> <script type="text/javascript" src="../../../js/jq.js"></script>
<script type="text/javascript" src="../../../js/my/permission.js"></script> <script type="text/javascript" src="../../../js/my/permission.js"></script>

View File

@ -150,6 +150,8 @@
</div> </div>
</body> </body>
<script src="../../../js/publicJs.js"></script> <script src="../../../js/publicJs.js"></script>
<script type="text/javascript" src="../../../js/AesCbc.js"></script>
<script type="text/javascript" src="../../../js/common_methon.js"></script>
<script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../../js/jq.js"></script> <script type="text/javascript" src="../../../js/jq.js"></script>
<script type="text/javascript" src="../../../js/my/permission.js"></script> <script type="text/javascript" src="../../../js/my/permission.js"></script>

View File

@ -64,6 +64,8 @@
</div> </div>
</div> </div>
<script src="../../../js/publicJs.js"></script> <script src="../../../js/publicJs.js"></script>
<script type="text/javascript" src="../../../js/AesCbc.js"></script>
<script type="text/javascript" src="../../../js/common_methon.js"></script>
<script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../../js/jq.js"></script> <script type="text/javascript" src="../../../js/jq.js"></script>
<script type="text/javascript" src="../../../js/my/permission.js"></script> <script type="text/javascript" src="../../../js/my/permission.js"></script>

View File

@ -74,6 +74,8 @@
</div> </div>
</div> </div>
<script src="../../../js/publicJs.js"></script> <script src="../../../js/publicJs.js"></script>
<script type="text/javascript" src="../../../js/AesCbc.js"></script>
<script type="text/javascript" src="../../../js/common_methon.js"></script>
<script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="../../../js/libs/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../../js/jq.js"></script> <script type="text/javascript" src="../../../js/jq.js"></script>
<script type="text/javascript" src="../../../js/my/permission.js"></script> <script type="text/javascript" src="../../../js/my/permission.js"></script>