资源服务代码提交
parent
88d66726c4
commit
e8d45b648f
@ -0,0 +1,53 @@
|
|||||||
|
package com.baiye.config;
|
||||||
|
|
||||||
|
import cn.hutool.core.thread.NamedThreadFactory;
|
||||||
|
import org.apache.tomcat.util.threads.ThreadPoolExecutor;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
import java.util.concurrent.LinkedBlockingDeque;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线程池配置总类,用于配置线程池
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@EnableAsync
|
||||||
|
public class ThreadPoolConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从配置文件中加载线程池相关的配置
|
||||||
|
*/
|
||||||
|
|
||||||
|
//常驻线程数量
|
||||||
|
@Value(value = "${save.task.thread_pool.corePoolSize}")
|
||||||
|
private int saveCorePoolSize = 4;
|
||||||
|
//最大线程数量
|
||||||
|
@Value(value = "${save.task.thread_pool.maxPoolSize}")
|
||||||
|
private int saveMaxPoolSize = 32;
|
||||||
|
//阻塞队列数量
|
||||||
|
@Value(value = "${save.task.thread_pool.queueCapacity}")
|
||||||
|
private int saveQueueCapacity = 100;
|
||||||
|
//线程名称前缀
|
||||||
|
@Value(value = "${save.task.thread_pool.ThreadNamePrefix}")
|
||||||
|
private String saveThreadNamePrefix = "SourceSaveFileTaskExecutor-";
|
||||||
|
|
||||||
|
|
||||||
|
@Bean(value = "SendBigDataTaskExecutor")
|
||||||
|
public Executor SendBigDataTaskExecutor(){
|
||||||
|
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
|
||||||
|
saveCorePoolSize,
|
||||||
|
saveMaxPoolSize,
|
||||||
|
3,
|
||||||
|
TimeUnit.SECONDS,
|
||||||
|
new LinkedBlockingDeque<>(saveQueueCapacity),
|
||||||
|
new NamedThreadFactory(saveThreadNamePrefix, false),
|
||||||
|
new ThreadPoolExecutor.DiscardOldestPolicy()
|
||||||
|
);
|
||||||
|
return threadPoolExecutor;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,19 +0,0 @@
|
|||||||
package com.baiye.controller;
|
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Enzo
|
|
||||||
* @date : 2021/12/16
|
|
||||||
*/
|
|
||||||
@RequestMapping("/test")
|
|
||||||
@RestController
|
|
||||||
public class TestController {
|
|
||||||
|
|
||||||
@GetMapping
|
|
||||||
public String helloWorld(){
|
|
||||||
return "Hello Source";
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.baiye.feign;
|
||||||
|
|
||||||
|
import com.baiye.feign.fallback.TaskClientFallback;
|
||||||
|
import com.baiye.module.entity.Task;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
@FeignClient(value = "ad-platform-management",fallback = TaskClientFallback.class)
|
||||||
|
public interface TaskClient {
|
||||||
|
String PAY_PREFIX = "/api/task";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加任务
|
||||||
|
* @param task
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = PAY_PREFIX + "/saveTask")
|
||||||
|
ResponseEntity<Object> saveTask(@RequestBody Task task);
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.baiye.feign.fallback;
|
||||||
|
|
||||||
|
import com.baiye.feign.TaskClient;
|
||||||
|
import com.baiye.module.entity.Task;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class TaskClientFallback implements TaskClient {
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Object> saveTask(Task task) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
package com.baiye.module.controller;
|
||||||
|
|
||||||
|
import com.baiye.http.CommonResponse;
|
||||||
|
import com.baiye.http.ResponseCode;
|
||||||
|
import com.baiye.model.dto.ClueQueryCriteria;
|
||||||
|
import com.baiye.model.dto.DistributeResponseDTO;
|
||||||
|
import com.baiye.module.entity.Clue;
|
||||||
|
import com.baiye.module.service.ClueService;
|
||||||
|
import com.baiye.module.service.dto.ClueRecordCriteria;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "资源管理")
|
||||||
|
@RequestMapping("/source/clue")
|
||||||
|
@Slf4j
|
||||||
|
public class ClueController {
|
||||||
|
|
||||||
|
private final ClueService clueService;
|
||||||
|
|
||||||
|
@ApiOperation("任务id查询资源列表")
|
||||||
|
@GetMapping("/queryList")
|
||||||
|
public ResponseEntity<List<Clue>> queryList(@RequestParam("taskId") Long taskId){
|
||||||
|
if (taskId != null){
|
||||||
|
return new ResponseEntity<>(clueService.queryList(taskId), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询资源记录列表")
|
||||||
|
@GetMapping("/queryRecordList")
|
||||||
|
public ResponseEntity<Object> queryRecordList(ClueRecordCriteria clueRecordCriteria, Pageable pageable){
|
||||||
|
return new ResponseEntity<>(clueService.queryRecordList(clueRecordCriteria,pageable), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量更新组信息")
|
||||||
|
@PostMapping("/batchUpdateOrganize")
|
||||||
|
public ResponseEntity<Object> batchUpdateOrganize(@RequestBody DistributeResponseDTO distributeResponseDTO){
|
||||||
|
if (distributeResponseDTO != null){
|
||||||
|
clueService.batchUpdateOrganize(distributeResponseDTO);
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(CommonResponse.createBySuccess(ResponseCode.EMPTY_ARGUMENT), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("小组id查询")
|
||||||
|
@GetMapping("/queryOrganizeIdList")
|
||||||
|
public ResponseEntity<List<Clue>> queryOrganizeIdList(@RequestParam("organizeId") Long organizeId){
|
||||||
|
if (organizeId != null){
|
||||||
|
return new ResponseEntity<>(clueService.queryOrganizeIdList(organizeId), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量更新组员信息")
|
||||||
|
@PostMapping("/batchUpdateUserId")
|
||||||
|
public ResponseEntity<Object> batchUpdateUserId(@RequestBody List<Map<Long, List<Long>>> mapList){
|
||||||
|
if ( mapList.size() > 0){
|
||||||
|
clueService.batchUpdateUserId(mapList);
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(CommonResponse.createBySuccess(ResponseCode.EMPTY_ARGUMENT), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("分页查询资源信息")
|
||||||
|
@PostMapping("/queryAll")
|
||||||
|
public ResponseEntity<Map<String,Object>> queryAll(@RequestBody ClueQueryCriteria clueQueryCriteria){
|
||||||
|
return new ResponseEntity<>(clueService.queryAll(clueQueryCriteria),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.baiye.module.controller;
|
||||||
|
|
||||||
|
import com.baiye.http.CommonResponse;
|
||||||
|
import com.baiye.http.ResponseCode;
|
||||||
|
import com.baiye.module.service.UploadFileService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "文件上传管理")
|
||||||
|
@RequestMapping("/source/uploadFile")
|
||||||
|
@Slf4j
|
||||||
|
public class UploadFileController {
|
||||||
|
|
||||||
|
private final UploadFileService uploadFileService;
|
||||||
|
@Value("${storage.download-template}")
|
||||||
|
private String rootPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件上传接口
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ApiOperation("文件上传")
|
||||||
|
@PostMapping("/fileUpload")
|
||||||
|
public ResponseEntity<Object> singleFileUpload(@RequestParam("file") MultipartFile[] file,
|
||||||
|
@RequestParam(value = "uploadType") Integer uploadType,
|
||||||
|
@RequestParam(value = "userId") Long userId) {
|
||||||
|
|
||||||
|
if (file.length > 0 && uploadType != null && userId != null){
|
||||||
|
return uploadFileService.singleFileUpload(file,uploadType,userId);
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(CommonResponse.createBySuccess(ResponseCode.EMPTY_ARGUMENT.getDesc()), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("模板下载")
|
||||||
|
@PostMapping("/downLoadTemplate")
|
||||||
|
public ResponseEntity<Object> downloadFileAction() {
|
||||||
|
return new ResponseEntity<>(rootPath, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.baiye.module.dao;
|
||||||
|
|
||||||
|
import com.baiye.module.entity.ClueRecord;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface ClueRecordRepository extends JpaRepository<ClueRecord, Long>, JpaSpecificationExecutor<ClueRecord> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务id查询
|
||||||
|
* @param taskId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ClueRecord> findByTaskId(Long taskId);
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.baiye.module.dao;
|
||||||
|
|
||||||
|
import com.baiye.module.entity.Clue;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface ClueRepository extends JpaRepository<Clue, Long>, JpaSpecificationExecutor<Clue> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据recordId查询
|
||||||
|
* @param recordId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Clue> findByRecordId(Long recordId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新组信息
|
||||||
|
* @param id
|
||||||
|
* @param deptId
|
||||||
|
*/
|
||||||
|
@Modifying
|
||||||
|
@Query(value = " update tb_clue set organize_id = ?2 where id = ?1 ",nativeQuery = true)
|
||||||
|
void updateOrganizeIdById(Long id,Long deptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小组id查询
|
||||||
|
* @param organizeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Clue> findByOrganizeId(Long organizeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新组员信息
|
||||||
|
* @param clueId
|
||||||
|
* @param userId
|
||||||
|
*/
|
||||||
|
@Modifying
|
||||||
|
@Query(value = " update tb_clue set member_id = ?3,member_status = ?2 where id = ?1 ",nativeQuery = true)
|
||||||
|
void updateUserId(Long clueId, Integer memberStatus,Long userId);
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.baiye.module.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class BaseExcelVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "记录表id")
|
||||||
|
private Long clueRecordId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "数据来源类型")
|
||||||
|
private Integer origin;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务id")
|
||||||
|
private Long taskId;
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package com.baiye.module.entity.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "快手表")
|
||||||
|
@ToString
|
||||||
|
public class KsVo {
|
||||||
|
|
||||||
|
@ExcelProperty(value = "姓名", index = 3)
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "电话", index = 4)
|
||||||
|
@ApiModelProperty(value = "nid")
|
||||||
|
private String nid;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "微信", index = 5)
|
||||||
|
@ApiModelProperty(value = "微信")
|
||||||
|
private String wx;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "收集日期", index = 11)
|
||||||
|
@ApiModelProperty(value = "线索获取时间")
|
||||||
|
private Date collectTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "线索归属地", index = 24)
|
||||||
|
@ApiModelProperty(value = "线索归属地")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "金额", index = 32)
|
||||||
|
@ApiModelProperty(value = "金额")
|
||||||
|
private String amount;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.baiye.module.entity.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "UC表")
|
||||||
|
@ToString
|
||||||
|
public class UcVo{
|
||||||
|
|
||||||
|
@ExcelProperty(value = "时间", index = 2)
|
||||||
|
@ApiModelProperty(value = "线索获取时间")
|
||||||
|
private Date collectTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "第一行", index = 3)
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "第二行", index = 4)
|
||||||
|
@ApiModelProperty(value = "nid")
|
||||||
|
private String nid;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "第三行", index = 5)
|
||||||
|
@ApiModelProperty(value = "金额")
|
||||||
|
private String amount;
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package com.baiye.module.entity.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "自定义表")
|
||||||
|
@ToString
|
||||||
|
public class ZdyVo {
|
||||||
|
|
||||||
|
@ExcelProperty(value = "姓名", index = 0)
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "电话", index = 1)
|
||||||
|
@ApiModelProperty(value = "nid")
|
||||||
|
private String nid;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "微信", index = 2)
|
||||||
|
@ApiModelProperty(value = "微信")
|
||||||
|
private String wx;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "金额", index = 3)
|
||||||
|
@ApiModelProperty(value = "金额")
|
||||||
|
private String amount;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "日期", index = 4)
|
||||||
|
@ApiModelProperty(value = "线索获取时间")
|
||||||
|
private Date collectTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "线索归属地", index = 5)
|
||||||
|
@ApiModelProperty(value = "线索归属地")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.baiye.module.service;
|
||||||
|
|
||||||
|
import com.baiye.model.dto.ClueQueryCriteria;
|
||||||
|
import com.baiye.model.dto.DistributeResponseDTO;
|
||||||
|
import com.baiye.module.entity.Clue;
|
||||||
|
import com.baiye.module.entity.ClueRecord;
|
||||||
|
import com.baiye.module.service.dto.ClueRecordCriteria;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface ClueService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入数据
|
||||||
|
* @param clueList
|
||||||
|
*/
|
||||||
|
void saveClue(List<Clue> clueList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务id查询资源列表
|
||||||
|
* @param taskId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Clue> queryList(Long taskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id查询资源记录列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<ClueRecord> queryRecordList(ClueRecordCriteria clueRecordCriteria, Pageable pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新组信息
|
||||||
|
* @param distributeResponseDTO
|
||||||
|
*/
|
||||||
|
void batchUpdateOrganize(DistributeResponseDTO distributeResponseDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小组id查询
|
||||||
|
* @param organizeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Clue> queryOrganizeIdList(Long organizeId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新组员信息
|
||||||
|
* Map<Long, List<Long>> ,用户id->所属资源集合
|
||||||
|
* @param mapList
|
||||||
|
*/
|
||||||
|
void batchUpdateUserId(List<Map<Long, List<Long>>> mapList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询资源信息
|
||||||
|
* @param clueQueryCriteria
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String,Object> queryAll(ClueQueryCriteria clueQueryCriteria);
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.baiye.module.service;
|
||||||
|
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
public interface UploadFileService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件上传
|
||||||
|
* @param file
|
||||||
|
* @param uploadType
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ResponseEntity<Object> singleFileUpload(MultipartFile[] file, Integer uploadType,Long userId);
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.baiye.module.service.dto;
|
||||||
|
|
||||||
|
import com.baiye.annotation.Query;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小组公共查询类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ClueRecordCriteria {
|
||||||
|
|
||||||
|
@Query
|
||||||
|
private Long createBy;
|
||||||
|
|
||||||
|
@Query
|
||||||
|
private String oldFile;
|
||||||
|
|
||||||
|
@Query(type = Query.Type.BETWEEN)
|
||||||
|
private List<Timestamp> createTime;
|
||||||
|
}
|
@ -0,0 +1,104 @@
|
|||||||
|
package com.baiye.module.service.impl;
|
||||||
|
|
||||||
|
import com.baiye.constant.DefaultNumberConstants;
|
||||||
|
import com.baiye.model.dto.ClueDto;
|
||||||
|
import com.baiye.model.dto.ClueQueryCriteria;
|
||||||
|
import com.baiye.model.dto.DistributeResponseDTO;
|
||||||
|
import com.baiye.module.dao.ClueRecordRepository;
|
||||||
|
import com.baiye.module.dao.ClueRepository;
|
||||||
|
import com.baiye.module.entity.Clue;
|
||||||
|
import com.baiye.module.entity.ClueRecord;
|
||||||
|
import com.baiye.module.service.ClueService;
|
||||||
|
import com.baiye.module.service.dto.ClueRecordCriteria;
|
||||||
|
import com.baiye.module.service.mapstruct.ClueMapper;
|
||||||
|
import com.baiye.util.PageUtil;
|
||||||
|
import com.baiye.util.QueryHelp;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.PageRequest;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ClueServiceImpl implements ClueService {
|
||||||
|
|
||||||
|
private final ClueRepository clueRepository;
|
||||||
|
private final ClueRecordRepository clueRecordRepository;
|
||||||
|
private final ClueMapper clueMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveClue(List<Clue> clueList) {
|
||||||
|
if (clueList.size() > 0){
|
||||||
|
clueRepository.saveAll(clueList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Clue> queryList(Long taskId) {
|
||||||
|
List<Clue> clueLists = new ArrayList<>();
|
||||||
|
List<ClueRecord> clueRecordList = clueRecordRepository.findByTaskId(taskId);
|
||||||
|
if (clueRecordList.size() > 0) {
|
||||||
|
for (ClueRecord clueRecord : clueRecordList) {
|
||||||
|
List<Clue> clueList = clueRepository.findByRecordId(clueRecord.getId());
|
||||||
|
clueLists.addAll(clueList);
|
||||||
|
}
|
||||||
|
return clueLists;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<ClueRecord> queryRecordList(ClueRecordCriteria clueRecordCriteria, Pageable pageable) {
|
||||||
|
Page<ClueRecord> clueAll = clueRecordRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, clueRecordCriteria, criteriaBuilder), pageable);
|
||||||
|
return clueAll;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void batchUpdateOrganize(DistributeResponseDTO distributeResponseDTO) {
|
||||||
|
List<Long> responseList = distributeResponseDTO.getResponseList();
|
||||||
|
Long deptId = distributeResponseDTO.getDeptId();
|
||||||
|
for (Long id : responseList) {
|
||||||
|
clueRepository.updateOrganizeIdById(id,deptId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Clue> queryOrganizeIdList(Long organizeId) {
|
||||||
|
|
||||||
|
return clueRepository.findByOrganizeId(organizeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void batchUpdateUserId(List<Map<Long, List<Long>>> mapList) {
|
||||||
|
for (Map<Long, List<Long>> map : mapList) {
|
||||||
|
for (Long userId : map.keySet()) {
|
||||||
|
List<Long> userIdList = map.get(userId);
|
||||||
|
for (Long clueId : userIdList) {
|
||||||
|
clueRepository.updateUserId(clueId, DefaultNumberConstants.ONE_NUMBER, userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询资源信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String,Object> queryAll(ClueQueryCriteria clueQueryCriteria ) {
|
||||||
|
Sort sort = Sort.by(Sort.Direction.ASC, "createTime");
|
||||||
|
Pageable pageable = PageRequest.of(clueQueryCriteria.getPage(), clueQueryCriteria.getSize(),sort);
|
||||||
|
Page<Clue> cluePage = clueRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, clueQueryCriteria, criteriaBuilder), pageable);
|
||||||
|
return PageUtil.toPage(cluePage.map(clueMapper::toDto));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.baiye.module.service.mapstruct;
|
||||||
|
|
||||||
|
import com.baiye.model.base.BaseMapper;
|
||||||
|
import com.baiye.model.dto.ClueDto;
|
||||||
|
import com.baiye.module.entity.Clue;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
|
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||||
|
public interface ClueMapper extends BaseMapper<ClueDto, Clue> {
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.baiye.task;
|
||||||
|
|
||||||
|
import com.alibaba.excel.EasyExcelFactory;
|
||||||
|
import com.baiye.module.constant.FileConstant;
|
||||||
|
import com.baiye.module.entity.ClueRecord;
|
||||||
|
import com.baiye.module.entity.vo.BaseExcelVo;
|
||||||
|
import com.baiye.module.entity.vo.KsVo;
|
||||||
|
import com.baiye.module.entity.vo.ZdyVo;
|
||||||
|
import com.baiye.module.listener.KsExcelListener;
|
||||||
|
import com.baiye.module.listener.UcCsvListener;
|
||||||
|
import com.baiye.module.listener.ZdyExcelListener;
|
||||||
|
import com.baiye.module.service.ClueService;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class FileAnalysisTask {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ClueService clueService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取文件处理数据
|
||||||
|
* @param clueRecords
|
||||||
|
*/
|
||||||
|
@Async(value = "SendBigDataTaskExecutor")
|
||||||
|
@SneakyThrows //处理异常try
|
||||||
|
public void runFileAnalysisTask(List<ClueRecord> clueRecords) {
|
||||||
|
|
||||||
|
|
||||||
|
for (ClueRecord clueRecord : clueRecords) {
|
||||||
|
BaseExcelVo baseExcelVo = new BaseExcelVo();
|
||||||
|
baseExcelVo.setUserId(clueRecord.getCreateBy());
|
||||||
|
baseExcelVo.setClueRecordId(clueRecord.getId());
|
||||||
|
baseExcelVo.setOrigin(clueRecord.getUploadType());
|
||||||
|
|
||||||
|
FileInputStream file = new FileInputStream(clueRecord.getNewFileUrl());
|
||||||
|
switch (clueRecord.getUploadType()){
|
||||||
|
case FileConstant.ZERO_NUMBER:
|
||||||
|
log.info("==============开始导入自定义表单============{}",Thread.currentThread().getName());
|
||||||
|
EasyExcelFactory.read(file, ZdyVo.class, new ZdyExcelListener(clueService,baseExcelVo)).build().readAll();
|
||||||
|
break;
|
||||||
|
case FileConstant.ONE_NUMBER:
|
||||||
|
log.info("==============开始导入UC表单============",Thread.currentThread().getName());
|
||||||
|
//EasyExcelFactory.read(file, UcVo.class, new UcExcelListener(clueService,baseExcelVo)).build().readAll();
|
||||||
|
new UcCsvListener(clueService,baseExcelVo).readUcCsv(clueRecord.getNewFileUrl());
|
||||||
|
break;
|
||||||
|
case FileConstant.TWO_NUMBER:
|
||||||
|
log.info("==============开始导入快手表单============{}",Thread.currentThread().getName());
|
||||||
|
EasyExcelFactory.read(file, KsVo.class, new KsExcelListener(clueService,baseExcelVo)).build().readAll();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,178 @@
|
|||||||
|
package com.baiye.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baiye.annotation.Query;
|
||||||
|
import com.baiye.constant.DefaultNumberConstants;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.persistence.criteria.*;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@SuppressWarnings({"unchecked", "all"})
|
||||||
|
public class QueryHelp {
|
||||||
|
|
||||||
|
public static <R, Q> Predicate getPredicate(Root<R> root, Q query, CriteriaBuilder cb) {
|
||||||
|
List<Predicate> list = new ArrayList<>();
|
||||||
|
|
||||||
|
if (query == null) {
|
||||||
|
return cb.and(list.toArray(new Predicate[0]));
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
List<Field> fields = getAllFields(query.getClass(), new ArrayList<>());
|
||||||
|
for (Field field : fields) {
|
||||||
|
boolean accessible = field.isAccessible();
|
||||||
|
field.setAccessible(true);
|
||||||
|
Query q = field.getAnnotation(Query.class);
|
||||||
|
if (q != null) {
|
||||||
|
String propName = q.propName();
|
||||||
|
String joinName = q.joinName();
|
||||||
|
String blurry = q.blurry();
|
||||||
|
String attributeName = isBlank(propName) ? field.getName() : propName;
|
||||||
|
Class<?> fieldType = field.getType();
|
||||||
|
Object val = field.get(query);
|
||||||
|
if (ObjectUtil.isNull(val) || StrUtil.EMPTY.equals(val) || StrUtil.NULL.equals(val) || "undefined".equals(val)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Join join = null;
|
||||||
|
// 模糊多字段
|
||||||
|
if (ObjectUtil.isNotEmpty(blurry)) {
|
||||||
|
String[] blurrys = blurry.split(StrUtil.COMMA);
|
||||||
|
List<Predicate> orPredicate = new ArrayList<>();
|
||||||
|
for (String s : blurrys) {
|
||||||
|
orPredicate.add(cb.like(root.get(s)
|
||||||
|
.as(String.class), DefaultNumberConstants.NAT_DELIM + val.toString() + DefaultNumberConstants.NAT_DELIM));
|
||||||
|
}
|
||||||
|
Predicate[] p = new Predicate[orPredicate.size()];
|
||||||
|
list.add(cb.or(orPredicate.toArray(p)));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(joinName)) {
|
||||||
|
String[] joinNames = joinName.split(">");
|
||||||
|
for (String name : joinNames) {
|
||||||
|
switch (q.join()) {
|
||||||
|
case LEFT:
|
||||||
|
if (ObjectUtil.isNotNull(join)) {
|
||||||
|
join = join.join(name, JoinType.LEFT);
|
||||||
|
} else {
|
||||||
|
join = root.join(name, JoinType.LEFT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case RIGHT:
|
||||||
|
if (ObjectUtil.isNotNull(join)) {
|
||||||
|
join = join.join(name, JoinType.RIGHT);
|
||||||
|
} else {
|
||||||
|
join = root.join(name, JoinType.RIGHT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case INNER:
|
||||||
|
if (ObjectUtil.isNotNull(join)) {
|
||||||
|
join = join.join(name, JoinType.INNER);
|
||||||
|
} else {
|
||||||
|
join = root.join(name, JoinType.INNER);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch (q.type()) {
|
||||||
|
case EQUAL:
|
||||||
|
list.add(cb.equal(getExpression(attributeName, join, root)
|
||||||
|
.as((Class<? extends Comparable>) fieldType), val));
|
||||||
|
break;
|
||||||
|
case GREATER_THAN:
|
||||||
|
list.add(cb.greaterThanOrEqualTo(getExpression(attributeName, join, root)
|
||||||
|
.as((Class<? extends Comparable>) fieldType), (Comparable) val));
|
||||||
|
break;
|
||||||
|
case LESS_THAN:
|
||||||
|
list.add(cb.lessThanOrEqualTo(getExpression(attributeName, join, root)
|
||||||
|
.as((Class<? extends Comparable>) fieldType), (Comparable) val));
|
||||||
|
break;
|
||||||
|
case LESS_THAN_NQ:
|
||||||
|
list.add(cb.lessThan(getExpression(attributeName, join, root)
|
||||||
|
.as((Class<? extends Comparable>) fieldType), (Comparable) val));
|
||||||
|
break;
|
||||||
|
case INNER_LIKE:
|
||||||
|
list.add(cb.like(getExpression(attributeName, join, root)
|
||||||
|
.as(String.class), DefaultNumberConstants.NAT_DELIM + val.toString() + DefaultNumberConstants.NAT_DELIM));
|
||||||
|
break;
|
||||||
|
case LEFT_LIKE:
|
||||||
|
list.add(cb.like(getExpression(attributeName, join, root)
|
||||||
|
.as(String.class), DefaultNumberConstants.NAT_DELIM + val.toString()));
|
||||||
|
break;
|
||||||
|
case RIGHT_LIKE:
|
||||||
|
list.add(cb.like(getExpression(attributeName, join, root)
|
||||||
|
.as(String.class), val.toString() + DefaultNumberConstants.NAT_DELIM));
|
||||||
|
break;
|
||||||
|
case IN:
|
||||||
|
if (CollUtil.isNotEmpty((Collection<Long>) val)) {
|
||||||
|
list.add(getExpression(attributeName, join, root).in((Collection<Long>) val));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case NOT_IN:
|
||||||
|
if (CollUtil.isNotEmpty((Collection<Long>) val)) {
|
||||||
|
list.add(cb.not(getExpression(attributeName, join, root).in((Collection<Long>) val)));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case NOT_EQUAL:
|
||||||
|
list.add(cb.notEqual(getExpression(attributeName, join, root), val));
|
||||||
|
break;
|
||||||
|
case NOT_NULL:
|
||||||
|
list.add(cb.isNotNull(getExpression(attributeName, join, root)));
|
||||||
|
break;
|
||||||
|
case BETWEEN:
|
||||||
|
List<Object> between = new ArrayList<>((List<Object>) val);
|
||||||
|
list.add(cb.between(getExpression(attributeName, join, root).as((Class<? extends Comparable>) between.get(0).getClass()),
|
||||||
|
(Comparable) between.get(0), (Comparable) between.get(1)));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
field.setAccessible(accessible);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
int size = list.size();
|
||||||
|
return cb.and(list.toArray(new Predicate[size]));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private static <T, R> Expression<T> getExpression(String attributeName, Join join, Root<R> root) {
|
||||||
|
if (ObjectUtil.isNotEmpty(join)) {
|
||||||
|
return join.get(attributeName);
|
||||||
|
} else {
|
||||||
|
return root.get(attributeName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isBlank(final CharSequence cs) {
|
||||||
|
int strLen;
|
||||||
|
if (cs == null || (strLen = cs.length()) == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < strLen; i++) {
|
||||||
|
if (!Character.isWhitespace(cs.charAt(i))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<Field> getAllFields(Class clazz, List<Field> fields) {
|
||||||
|
if (clazz != null) {
|
||||||
|
fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
|
||||||
|
getAllFields(clazz.getSuperclass(), fields);
|
||||||
|
}
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
#配置数据源
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: ${NACOS_HOST:118.178.137.129}:${NACOS_PORT:8848}
|
||||||
|
datasource:
|
||||||
|
druid:
|
||||||
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
|
url: jdbc:mysql://118.178.137.129:3306/ad-platform?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||||
|
username: root
|
||||||
|
password: root
|
||||||
|
# 初始连接数
|
||||||
|
initial-size: 5
|
||||||
|
# 最小连接数
|
||||||
|
min-idle: 15
|
||||||
|
# 最大连接数
|
||||||
|
max-active: 30
|
||||||
|
# 超时时间(以秒数为单位)
|
||||||
|
remove-abandoned-timeout: 180
|
||||||
|
# 获取连接超时时间
|
||||||
|
max-wait: 3000
|
||||||
|
# 连接有效性检测时间
|
||||||
|
time-between-eviction-runs-millis: 60000
|
||||||
|
# 连接在池中最小生存的时间
|
||||||
|
min-evictable-idle-time-millis: 300000
|
||||||
|
# 连接在池中最大生存的时间
|
||||||
|
max-evictable-idle-time-millis: 900000
|
||||||
|
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
|
||||||
|
test-while-idle: true
|
||||||
|
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
|
||||||
|
test-on-borrow: true
|
||||||
|
# 是否在归还到池中前进行检验
|
||||||
|
test-on-return: false
|
||||||
|
# 检测连接是否有效
|
||||||
|
validation-query: select 1
|
||||||
|
# 配置监控统计
|
||||||
|
webStatFilter:
|
||||||
|
enabled: true
|
||||||
|
stat-view-servlet:
|
||||||
|
enabled: true
|
||||||
|
url-pattern: /druid/*
|
||||||
|
reset-enable: false
|
||||||
|
filter:
|
||||||
|
stat:
|
||||||
|
enabled: true
|
||||||
|
# 记录慢SQL
|
||||||
|
log-slow-sql: true
|
||||||
|
slow-sql-millis: 1000
|
||||||
|
merge-sql: true
|
||||||
|
wall:
|
||||||
|
config:
|
||||||
|
multi-statement-allow: true
|
||||||
|
|
||||||
|
|
||||||
|
# 文件存储
|
||||||
|
storage:
|
||||||
|
# url: /usr/local/webapp/services/source/
|
||||||
|
# symbol:/
|
||||||
|
url: C:\Users\Admin\Desktop\
|
||||||
|
de_symbol: \\
|
||||||
|
se_symbol: \
|
||||||
|
download-template: /usr/local/webapp/ad-platform/ad-platform-source/custom.xlsx
|
||||||
|
|
||||||
|
# 线程池配置
|
||||||
|
save:
|
||||||
|
task:
|
||||||
|
thread_pool:
|
||||||
|
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==
|
@ -0,0 +1,76 @@
|
|||||||
|
#配置数据源
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: ${NACOS_HOST:118.178.137.129}:${NACOS_PORT:8848}
|
||||||
|
datasource:
|
||||||
|
druid:
|
||||||
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
|
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:eladmin}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
||||||
|
username: ${DB_USER:root}
|
||||||
|
password: ${DB_PWD:123456}
|
||||||
|
# 初始连接数
|
||||||
|
initial-size: 5
|
||||||
|
# 最小连接数
|
||||||
|
min-idle: 15
|
||||||
|
# 最大连接数
|
||||||
|
max-active: 30
|
||||||
|
# 超时时间(以秒数为单位)
|
||||||
|
remove-abandoned-timeout: 180
|
||||||
|
# 获取连接超时时间
|
||||||
|
max-wait: 3000
|
||||||
|
# 连接有效性检测时间
|
||||||
|
time-between-eviction-runs-millis: 60000
|
||||||
|
# 连接在池中最小生存的时间
|
||||||
|
min-evictable-idle-time-millis: 300000
|
||||||
|
# 连接在池中最大生存的时间
|
||||||
|
max-evictable-idle-time-millis: 900000
|
||||||
|
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
|
||||||
|
test-while-idle: true
|
||||||
|
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
|
||||||
|
test-on-borrow: true
|
||||||
|
# 是否在归还到池中前进行检验
|
||||||
|
test-on-return: false
|
||||||
|
# 检测连接是否有效
|
||||||
|
validation-query: select 1
|
||||||
|
# 配置监控统计
|
||||||
|
webStatFilter:
|
||||||
|
enabled: true
|
||||||
|
stat-view-servlet:
|
||||||
|
enabled: true
|
||||||
|
url-pattern: /druid/*
|
||||||
|
reset-enable: false
|
||||||
|
filter:
|
||||||
|
stat:
|
||||||
|
enabled: true
|
||||||
|
# 记录慢SQL
|
||||||
|
log-slow-sql: true
|
||||||
|
slow-sql-millis: 1000
|
||||||
|
merge-sql: true
|
||||||
|
wall:
|
||||||
|
config:
|
||||||
|
multi-statement-allow: true
|
||||||
|
|
||||||
|
# 文件存储
|
||||||
|
storage:
|
||||||
|
url: /usr/local/webapp/services/source/
|
||||||
|
de_symbol: /
|
||||||
|
|
||||||
|
|
||||||
|
# 线程池配置
|
||||||
|
save:
|
||||||
|
task:
|
||||||
|
thread_pool:
|
||||||
|
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==
|
@ -1,10 +1,37 @@
|
|||||||
server:
|
server:
|
||||||
port: 7788
|
port: 7325
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
cloud:
|
main:
|
||||||
nacos:
|
allow-bean-definition-overriding: true
|
||||||
discovery:
|
freemarker:
|
||||||
server-addr: ${NACOS_HOST:118.178.137.129}:${NACOS_PORT:8848}
|
check-template-location: false
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
application:
|
application:
|
||||||
name: @artifactId@
|
name: @artifactId@
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
data:
|
||||||
|
redis:
|
||||||
|
repositories:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
# servlet:
|
||||||
|
# multipart:
|
||||||
|
# max-file-size: 200MB #单个文件上传大小
|
||||||
|
# max-request-size: 600MB #连续上传文件大小
|
||||||
|
|
||||||
|
#配置 Jpa
|
||||||
|
jpa:
|
||||||
|
hibernate:
|
||||||
|
ddl-auto: none
|
||||||
|
open-in-view: true
|
||||||
|
properties:
|
||||||
|
hibernate:
|
||||||
|
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
|
||||||
|
|
||||||
|
|
||||||
|
#hutool雪花算法
|
||||||
|
snowflake:
|
||||||
|
workerId: 9
|
||||||
|
datacenterId: 9
|
Loading…
Reference in New Issue