线索24位加密修改

master
yqy 2 years ago
parent b20c4a4424
commit 39e1496d16

@ -314,7 +314,7 @@ public class ClueJpa {
Integer clueCallStatus = clueQueryCriteria.getClueCallStatus();
StringBuilder sql = new StringBuilder();
sql.append("SELECT tc.id as id,tc.nid as nid,tc.audio_url as audioUrl,tc.create_time as createTime,tc.name as name,tc.origin as origin,tc.cast_info as castInfo , tcm.task_id as taskId,tcm.member_status as memberStatus," +
sql.append("SELECT tc.id as id,tc.nid as nid,tc.audio_url as audioUrl,tc.create_time as createTime,tc.name as name,tc.origin as origin,tc.cast_info as castInfo, tc.is_encryption as isEncryption, tcm.task_id as taskId,tcm.member_status as memberStatus," +
"tcm.clue_stage as clueStage,tcm.clue_call_status as clueCallStatus,tcm.member_id as memberId,tcm.source_label as sourceLabel ,tcm.turnover_amount as turnoverAmount " +
"FROM tb_clue_middle tcm LEFT JOIN tb_clue tc ON tcm.clue_id = tc.id WHERE 1 = 1 ");
if (CollUtil.isNotEmpty(taskIds)) {
@ -396,6 +396,7 @@ public class ClueJpa {
Map row = (Map) obj;
Clue clue = new Clue();
BigInteger clueId = (BigInteger) row.get("id");
Integer isEncryption = (Integer) row.get("isEncryption");
String phone = (String) row.get("nid");
clue.setNid(phone);
clue.setId(clueId.longValue());
@ -403,7 +404,13 @@ public class ClueJpa {
clue.setCreateTime((Date) row.get("createTime"));
clue.setName((String) row.get("name"));
String nid = AESUtils.decrypt(phone, secret);
clue.setNid(nid);
if (isEncryption == 1){
StringBuilder stringBuilder = new StringBuilder(nid);
String strRep = stringBuilder.replace(3, 7, "****").toString();
clue.setNid(strRep);
}else {
clue.setNid(nid);
}
BigInteger taskId = (BigInteger) row.get("taskId");
clue.setTaskId(taskId.longValue());
Integer memberSta = (Integer) row.get("memberStatus");

@ -67,9 +67,6 @@ public class DynamicTaskListener extends AnalysisEventListener<DynamicTaskListen
if (StringUtils.isNotBlank(row.getNid())) {
Clue clue = new Clue();
String nid = row.getNid();
if (nid.length() == 24) {
nid = DecryptPnoUtil.decryptPno(nid);
}
BeanUtils.copyProperties(row, clue);
clue.setNid(nid);
clue.setOrigin(baseExcelListenerDto.getOrigin());

@ -77,8 +77,11 @@ public class ClueServiceImpl implements ClueService {
if (StringUtils.isNotBlank(clue.getNid())) {
// 24位的nid解密,查询时要加*显示的线索
if (clue.getNid().length() == DefaultNumberConstants.TWENTY_FOUR) {
clue.setNid(DecryptPnoUtil.decryptPno(clue.getNid()));
clue.setIsEncryption(DefaultNumberConstants.ONE_NUMBER);
String str = DecryptPnoUtil.decryptPno(clue.getNid());
if (str != null){
clue.setNid(str);
clue.setIsEncryption(DefaultNumberConstants.ONE_NUMBER);
}
}
boolean bool = MobileUtil.checkPhone(clue.getNid());
if (!bool) {

@ -56,11 +56,15 @@ public class UploadFileServiceImpl implements UploadFileService {
@Override
@SneakyThrows //处理异常try
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<Object> singleFileUpload(MultipartFile[] files, Integer uploadType, Long userId, Long dynamicTaskId) {
public ResponseEntity<Object> singleFileUpload(MultipartFile[] files, Integer uploadType, Long userId, Long taskId) {
List<ClueRecord> clueRecordList = new ArrayList<>();
String oneFileName = files[0].getOriginalFilename();
Long taskId = IdUtil.getSnowflake(workerId, datacenterId).nextId();
if (uploadType > 4 && taskId == null) {
throw new BadRequestException("上传错误,请联系管理员");
}
// 如果taskId是null就是小组任务动态任务都需要传taskId
if (taskId == null) taskId = IdUtil.getSnowflake(workerId, datacenterId).nextId();
// 文件是否需要审核,需要审核的不入库
Boolean flag = userClient.findIsReview(userId);
//处理文件数据
@ -75,13 +79,7 @@ public class UploadFileServiceImpl implements UploadFileService {
// 检测文件的内容格式
TestingUtil.testingExcel(file, uploadType);
//存入本地,保存上传记录
ClueRecord clueRecord = new ClueRecord();
// 如果是动态任务taskId不为null否则是小组任务
if (dynamicTaskId != null) {
clueRecord = saveFileUtil(name, file, uploadType, userId, dynamicTaskId, flag);
} else {
clueRecord = saveFileUtil(name, file, uploadType, userId, taskId, flag);
}
ClueRecord clueRecord = saveFileUtil(name, file, uploadType, userId, taskId, flag);
clueRecordList.add(clueRecord);
}
if (!flag) {

@ -42,7 +42,8 @@ public class DecryptPnoUtil {
// 解析响应内容
if (!MobileUtil.checkPhone(nid)) {
throw new BadRequestException("解密失败或者号码为空");
log.error("===========解密失败或者号码为空=======");
return null;
}
return nid;
}

Loading…
Cancel
Save