代码提交

master
yqy 3 years ago
parent 543af053b6
commit ae7f5f5417

@ -22,6 +22,8 @@ import com.google.common.collect.Lists;
import feign.FeignException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@ -83,6 +85,7 @@ public class OrganizeServiceImpl implements OrganizeService {
*/
@Override
@Transactional(rollbackFor = Exception.class)
@CacheEvict(key = "'organize:' + #organize.getId()")
public void updateOrganize(Organize organize) {
if (organize.getOrganizeName() != null) {
Organize updateOrganize = organizeRepository.findById(organize.getId()).orElseGet(Organize::new);
@ -288,10 +291,10 @@ public class OrganizeServiceImpl implements OrganizeService {
}
}
//发送通知
userIdList.add(SecurityUtils.getCurrentUserId());
// userIdList.add(SecurityUtils.getCurrentUserId());
MessageNotification messageNotification = new MessageNotification();
messageNotification.setMessageType(2);
messageNotification.setMessageContext(task.getTaskName() + "分配成功");
messageNotification.setMessageContext("接收到" + organizeSaveDTO.getOrganizeTaskName() + "任务分配");
userMessageService.createUserMessage(userIdList,messageNotification);
return new ResponseEntity<>(CommonResponse.createBySuccess(ResponseCode.SUCCESS), HttpStatus.OK);
}
@ -365,7 +368,8 @@ public class OrganizeServiceImpl implements OrganizeService {
@Override
public Map<String, Object> queryLeaderTaskList(TaskOrganizeQueryCriteria taskOrganizeQueryCriteria, Pageable pageable) {
PageRequest pageRequest = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by(Sort.Direction.DESC, "updateTime"));
PageRequest pageRequest = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by(Sort.Direction.DESC, "updateTime")
.and( Sort.by(Sort.Direction.ASC,"taskStatus")));
Long currentUserId = SecurityUtils.getCurrentUserId();
Organize organize = organizeRepository.findOrganize(currentUserId);
if (organize != null) {
@ -430,11 +434,11 @@ public class OrganizeServiceImpl implements OrganizeService {
}
taskOrganizeRepository.save(updateTaskOrganize);
//发送通知
userIds.add(SecurityUtils.getCurrentUserId());
// userIds.add(SecurityUtils.getCurrentUserId());
List<Long> userIdList = new ArrayList<>(userIds);
MessageNotification messageNotification = new MessageNotification();
messageNotification.setMessageType(2);
messageNotification.setMessageContext(updateTaskOrganize.getOrganizeTaskName() + "分配成功");
messageNotification.setMessageContext("接收到" + updateTaskOrganize.getOrganizeTaskName() + "任务分配");
userMessageService.createUserMessage(userIdList,messageNotification);
return new ResponseEntity<>(CommonResponse.createBySuccess(ResponseCode.SUCCESS), HttpStatus.OK);
}

@ -0,0 +1,50 @@
package com.baiye.util;
import cn.hutool.core.util.RandomUtil;
import java.util.Random;
public class InvitationCodeUtil {
/** 自定义进制(0,1没有加入,容易与o,l混淆) */
private static final char[] r=new char[]{'Q', 'W', 'E', '8', 'A', 'S', '2', 'D', 'Z', 'X', '9', 'C', '7', 'P', '5', 'I', 'K', '3', 'M', 'J', 'U', 'F', 'R', '4', 'V', 'Y', 'l', 'T', 'N', '6', 'B', 'G', 'H'};
/** (不能与自定义进制有重复) */
private static final char b='O';
/** 进制长度 */
private static final int binLen=r.length;
/** 序列最小长度 */
private static final int s=6;
/**
* ID
* @return
*/
public static String toSerialCode() {
Random rnd=new Random();
// long id = IdUtil.getSnowflake(9, 9).nextId();
int id = RandomUtil.randomInt(0, 999999999);
char[] buf=new char[32];
int charPos=32;
while((id / binLen) > 0) {
int ind=(int)(id % binLen);
buf[--charPos]=r[ind];
id /= binLen;
}
buf[--charPos]=r[(int)(id % binLen)];
String str=new String(buf, charPos, (32 - charPos));
// 不够长度的自动随机补全
if(str.length() < s) {
StringBuilder sb=new StringBuilder();
sb.append(b);
for(int i=1; i < s - str.length(); i++) {
sb.append(r[rnd.nextInt(binLen)]);
}
str+=sb.toString();
}
return str;
}
}

@ -5,6 +5,7 @@ import com.baiye.http.ResponseCode;
import com.baiye.model.dto.ClueDto;
import com.baiye.model.dto.ClueQueryCriteria;
import com.baiye.model.dto.DistributeResponseDTO;
import com.baiye.module.entity.Clue;
import com.baiye.module.entity.ClueMiddle;
import com.baiye.module.service.ClueService;
import com.baiye.module.service.dto.ClueRecordCriteria;
@ -86,6 +87,12 @@ public class ClueController {
return new ResponseEntity<>(clueService.query(clueQueryCriteria), HttpStatus.OK);
}
@ApiOperation("查询资源详情")
@GetMapping("/queryDetails")
public ResponseEntity<Clue> queryDetails(@RequestParam("clueId") Long clueId) {
return new ResponseEntity<>(clueService.queryDetails(clueId), HttpStatus.OK);
}
@ApiOperation("更新资源信息")
@PostMapping("/update")
public CommonResponse<Object> update(@Validated @RequestBody ClueMiddle clueMiddle) {

@ -134,7 +134,9 @@ public class ClueJpa {
String phone = (String) row.get("nid");
if (StringUtils.isNotBlank(phone)) {
String nid = AESUtils.decrypt(phone, secret);
clueDto.setNid(nid);
StringBuilder stringBuilder = new StringBuilder(nid);
String str = stringBuilder.replace(3, 7, "****").toString();
clueDto.setNid(str);
}
clueDto.setWx((String) row.get("wx"));
clueDto.setAddress((String) row.get("address"));

@ -131,4 +131,11 @@ public interface ClueService {
* @return
*/
Integer countClueByGroupId(Long groupId);
/**
*
* @param clueId
* @return
*/
Clue queryDetails(Long clueId);
}

@ -259,4 +259,9 @@ public class ClueServiceImpl implements ClueService {
public Integer countClueByGroupId(Long groupId) {
return clueMiddleRepository.countByOrganizeId(groupId);
}
@Override
public Clue queryDetails(Long clueId) {
return clueRepository.findById(clueId).orElseGet(Clue::new);
}
}

@ -75,11 +75,4 @@ save:
corePoolSize: 2
maxPoolSize: 16
queueCapacity: 3
ThreadNamePrefix: SaveFileTaskExecutor-
# IP 本地解析
ip:
local-parsing: true
#密码加密传输,前端公钥加密,后端私钥解密
rsa:
private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
ThreadNamePrefix: SaveFileTaskExecutor-

@ -63,7 +63,7 @@ spring:
storage:
url: /usr/local/webapp/source/files/
de_symbol: /
download-template: /api-source/download/custom.xlsx
download-template: 47.97.90.60/api-source/download/custom.xlsx
# 线程池配置
@ -74,10 +74,3 @@ save:
maxPoolSize: 16
queueCapacity: 3
ThreadNamePrefix: SaveFileTaskExecutor-
## IP 本地解析
#ip:
# local-parsing: true
##密码加密传输,前端公钥加密,后端私钥解密
#rsa:
# private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==

@ -63,7 +63,7 @@ spring:
storage:
url: /usr/local/webapp/source/files/
de_symbol: /
download-template: /api-source/download/custom.xlsx
download-template: 118.178.137.129/api-source/download/custom.xlsx
# 线程池配置
save:
@ -72,13 +72,4 @@ save:
corePoolSize: 2
maxPoolSize: 16
queueCapacity: 3
ThreadNamePrefix: SaveFileTaskExecutor-
## IP 本地解析
#ip:
# local-parsing: true
##密码加密传输,前端公钥加密,后端私钥解密
#rsa:
# private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
ThreadNamePrefix: SaveFileTaskExecutor-

@ -40,9 +40,8 @@ snowflake:
aes:
secret: ad-platform
#ribbon:
# #建立连接超时时间
# ConnectTimeout: 50000
# #建立连接之后,读取响应资源超时时间
# ReadTimeout: 50000
ribbon:
#建立连接超时时间
ConnectTimeout: 3000
#建立连接之后,读取响应资源超时时间
ReadTimeout: 3000

Loading…
Cancel
Save