Compare commits
2 Commits
2.0.0.rc42
...
2.0.0.rc44
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90029faa53 | ||
|
|
ecb5aa1b29 |
22
pom.xml
22
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>springboot-parent</name>
|
<name>springboot-parent</name>
|
||||||
<description>杭州铁晟科技有限公司基础依赖</description>
|
<description>杭州铁晟科技有限公司基础依赖</description>
|
||||||
@@ -58,61 +58,61 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-database</artifactId>
|
<artifactId>springboot-database</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-login</artifactId>
|
<artifactId>springboot-login</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-web</artifactId>
|
<artifactId>springboot-web</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-util</artifactId>
|
<artifactId>springboot-util</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-platform</artifactId>
|
<artifactId>springboot-platform</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-message</artifactId>
|
<artifactId>springboot-message</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-encrypt</artifactId>
|
<artifactId>springboot-encrypt</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-role</artifactId>
|
<artifactId>springboot-role</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-annotation</artifactId>
|
<artifactId>springboot-annotation</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-poi</artifactId>
|
<artifactId>springboot-poi</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-ademo</artifactId>
|
<artifactId>springboot-ademo</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.tiesheng.demo.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.tiesheng.util.pojos.TokenBean;
|
||||||
|
import com.tiesheng.web.pojos.imex.ImportDealDTO;
|
||||||
|
import com.tiesheng.web.service.imex.TsImportHandler;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserImportHandler implements TsImportHandler<String> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> ready(ImportDealDTO dto, TokenBean token) {
|
||||||
|
return CollUtil.newArrayList("11111");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTemplateUrl() {
|
||||||
|
return "/template/xsxxzx_teacher_leader.xlsx";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getAction() {
|
||||||
|
return "user_import";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchHandler(List<String> list) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFailFile() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-annotation</artifactId>
|
<artifactId>springboot-annotation</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-database</artifactId>
|
<artifactId>springboot-database</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-encrypt</artifactId>
|
<artifactId>springboot-encrypt</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-login</artifactId>
|
<artifactId>springboot-login</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-message</artifactId>
|
<artifactId>springboot-message</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-platform</artifactId>
|
<artifactId>springboot-platform</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-poi</artifactId>
|
<artifactId>springboot-poi</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-role</artifactId>
|
<artifactId>springboot-role</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-util</artifactId>
|
<artifactId>springboot-util</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>2.0.0.rc42</version>
|
<version>2.0.0.rc44</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-web</artifactId>
|
<artifactId>springboot-web</artifactId>
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
package com.tiesheng.web.config.template;
|
|
||||||
|
|
||||||
import com.tiesheng.web.pojos.dto.TemplateDealDTO;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class TieshengTemplateHandler implements ToolTemplateHandler {
|
|
||||||
@Override
|
|
||||||
public String handler(TemplateDealDTO dto) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTemplateUrl() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object getParms(Object params) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getAction() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getSort() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
package com.tiesheng.web.config.template;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.tiesheng.web.pojos.dto.TemplateDealDTO;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public interface ToolTemplateHandler {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理对象
|
|
||||||
*
|
|
||||||
* @param dto
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
String handler(TemplateDealDTO dto);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取模版地址
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
String getTemplateUrl();
|
|
||||||
|
|
||||||
Object getParms(Object params);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动作说明(唯一)
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
String getAction();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序,如果action相同,只会使用sort大的来处理
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
int getSort();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取模版ID
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
default String getTeamplateId() {
|
|
||||||
return StrUtil.format("{}_{}", getAction(), getSort());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -4,19 +4,33 @@ package com.tiesheng.web.controller.comm;
|
|||||||
import cn.hutool.captcha.LineCaptcha;
|
import cn.hutool.captcha.LineCaptcha;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.tiesheng.annotation.operation.OperationIgnore;
|
||||||
import com.tiesheng.annotation.token.TokenIgnore;
|
import com.tiesheng.annotation.token.TokenIgnore;
|
||||||
import com.tiesheng.util.service.TsCacheService;
|
|
||||||
import com.tiesheng.web.config.template.ToolTemplateHandler;
|
|
||||||
import com.tiesheng.web.pojos.dto.*;
|
|
||||||
import com.tiesheng.web.pojos.vo.TemplateInfoVO;
|
|
||||||
import com.tiesheng.web.pojos.vo.PicVerifyVo;
|
|
||||||
import com.tiesheng.web.service.FileUploadService;
|
|
||||||
import com.tiesheng.util.exception.ApiException;
|
import com.tiesheng.util.exception.ApiException;
|
||||||
import com.tiesheng.util.pojos.ApiResp;
|
import com.tiesheng.util.pojos.ApiResp;
|
||||||
|
import com.tiesheng.util.pojos.TokenBean;
|
||||||
|
import com.tiesheng.util.service.TsCacheService;
|
||||||
|
import com.tiesheng.web.pojos.dao.CoreLogProcess;
|
||||||
|
import com.tiesheng.web.pojos.dto.ChunkCheckDTO;
|
||||||
|
import com.tiesheng.web.pojos.dto.ChunkMergeDTO;
|
||||||
|
import com.tiesheng.web.pojos.dto.ChunkStartDTO;
|
||||||
|
import com.tiesheng.web.pojos.dto.ImageCodeDTO;
|
||||||
|
import com.tiesheng.web.pojos.imex.ExportDealDTO;
|
||||||
|
import com.tiesheng.web.pojos.imex.ImportDealDTO;
|
||||||
|
import com.tiesheng.web.pojos.imex.ImportInfoDTO;
|
||||||
|
import com.tiesheng.web.pojos.imex.ImportInfoVO;
|
||||||
|
import com.tiesheng.web.pojos.vo.PicVerifyVo;
|
||||||
|
import com.tiesheng.web.service.CoreLogService;
|
||||||
|
import com.tiesheng.web.service.FileUploadService;
|
||||||
|
import com.tiesheng.web.service.imex.TsExportHandler;
|
||||||
|
import com.tiesheng.web.service.imex.TsImportHandler;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -35,7 +49,11 @@ public class ToolController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
FileUploadService fileUploadService;
|
FileUploadService fileUploadService;
|
||||||
@Autowired
|
@Autowired
|
||||||
List<ToolTemplateHandler> templateHandlerList;
|
List<TsImportHandler> importHandlers;
|
||||||
|
@Autowired
|
||||||
|
List<TsExportHandler> exportHandlers;
|
||||||
|
@Autowired
|
||||||
|
CoreLogService coreLogService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -124,40 +142,102 @@ public class ToolController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@TokenIgnore
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@GetMapping("/template/info")
|
// import
|
||||||
public ApiResp<TemplateInfoVO> templateInfo(TemplateInfoDTO dto) {
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
List<ToolTemplateHandler> collect = templateHandlerList.stream()
|
@TokenIgnore
|
||||||
.filter(it -> Objects.equals(it.getAction(), dto.getAction()))
|
@GetMapping("/imex/info")
|
||||||
.sorted((it, it2) -> it2.getSort() - it.getSort())
|
public ApiResp<ImportInfoVO> importInfo(@Valid ImportInfoDTO dto) {
|
||||||
.collect(Collectors.toList());
|
|
||||||
if (CollUtil.isEmpty(collect)) {
|
ImportInfoVO template = new ImportInfoVO();
|
||||||
throw new ApiException("没有找到对应的模版");
|
|
||||||
|
if (Objects.equals(dto.getType(), "import")) {
|
||||||
|
List<TsImportHandler> collect = importHandlers.stream()
|
||||||
|
.filter(it -> Objects.equals(it.getAction(), dto.getAction()))
|
||||||
|
.sorted((it, it2) -> it2.getSort() - it.getSort())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(collect)) {
|
||||||
|
TsImportHandler toolTemplateHandler = collect.get(0);
|
||||||
|
template.setTemplateUrl(toolTemplateHandler.getTemplateUrl());
|
||||||
|
template.setImexId(toolTemplateHandler.getImexId());
|
||||||
|
}
|
||||||
|
} else if (Objects.equals(dto.getType(), "export")) {
|
||||||
|
List<TsExportHandler> collect = exportHandlers.stream()
|
||||||
|
.filter(it -> Objects.equals(it.getAction(), dto.getAction()))
|
||||||
|
.sorted((it, it2) -> it2.getSort() - it.getSort())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(collect)) {
|
||||||
|
TsExportHandler toolTemplateHandler = collect.get(0);
|
||||||
|
template.setImexId(toolTemplateHandler.getImexId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolTemplateHandler toolTemplateHandler = collect.get(0);
|
if (StrUtil.isEmpty(template.getImexId())) {
|
||||||
|
throw new ApiException("没有找到对应的模版");
|
||||||
TemplateInfoVO template = new TemplateInfoVO();
|
}
|
||||||
template.setTemplateUrl(toolTemplateHandler.getTemplateUrl());
|
|
||||||
template.setParams(toolTemplateHandler.getParms(dto.getParams()));
|
|
||||||
template.setTemplateId(toolTemplateHandler.getTeamplateId());
|
|
||||||
|
|
||||||
return ApiResp.respOK(template);
|
return ApiResp.respOK(template);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TokenIgnore
|
|
||||||
@PostMapping("/template/deal")
|
|
||||||
public ApiResp<String> templateDeal(@RequestBody TemplateDealDTO dto) {
|
|
||||||
|
|
||||||
List<ToolTemplateHandler> collect = templateHandlerList.stream().
|
@TokenIgnore
|
||||||
filter(it -> Objects.equals(it.getTeamplateId(), dto.getTemplateId()))
|
@OperationIgnore
|
||||||
|
@PostMapping("/import/deal")
|
||||||
|
public ApiResp<String> importDeal(@RequestBody @Valid ImportDealDTO dto, TokenBean token) {
|
||||||
|
|
||||||
|
List<TsImportHandler> collect = importHandlers.stream().
|
||||||
|
filter(it -> Objects.equals(it.getImexId(), dto.getImexId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (CollUtil.isEmpty(collect)) {
|
if (CollUtil.isEmpty(collect)) {
|
||||||
throw new ApiException("模版ID不存在");
|
throw new ApiException("导入ID不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResp.respOK(collect.get(0).handler(dto));
|
TsImportHandler tsImportHandler = collect.get(0);
|
||||||
|
tsImportHandler.validToken(token);
|
||||||
|
List read = tsImportHandler.ready(dto, token);
|
||||||
|
if (CollUtil.isEmpty(read)) {
|
||||||
|
throw new ApiException("没有数据可以导入");
|
||||||
|
}
|
||||||
|
CoreLogProcess coreLogProcess = coreLogService.addProcess(tsImportHandler.getImexId(), read, tsImportHandler);
|
||||||
|
coreLogProcess.setParams(JSON.toJSONString(dto));
|
||||||
|
coreLogService.getCoreLogProcessMapper().updateById(coreLogProcess);
|
||||||
|
|
||||||
|
return ApiResp.respOK(coreLogProcess.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// export
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@TokenIgnore
|
||||||
|
@OperationIgnore
|
||||||
|
@PostMapping("/export/deal")
|
||||||
|
public ApiResp<String> exportDeal(@RequestBody @Valid ExportDealDTO dto, TokenBean token) {
|
||||||
|
|
||||||
|
List<TsExportHandler> collect = exportHandlers.stream().
|
||||||
|
filter(it -> Objects.equals(it.getImexId(), dto.getImexId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollUtil.isEmpty(collect)) {
|
||||||
|
throw new ApiException("导出ID不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
TsExportHandler tsExportHandler = collect.get(0);
|
||||||
|
tsExportHandler.validToken(token);
|
||||||
|
List read = tsExportHandler.ready(dto, token);
|
||||||
|
if (CollUtil.isEmpty(read)) {
|
||||||
|
throw new ApiException("没有数据可以导出");
|
||||||
|
}
|
||||||
|
CoreLogProcess coreLogProcess = coreLogService.addProcess(tsExportHandler.getImexId(), read, tsExportHandler);
|
||||||
|
coreLogProcess.setType("export");
|
||||||
|
coreLogProcess.setParams(JSON.toJSONString(dto));
|
||||||
|
coreLogService.getCoreLogProcessMapper().updateById(coreLogProcess);
|
||||||
|
|
||||||
|
return ApiResp.respOK(coreLogProcess.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,18 +51,18 @@ public class CoreLogProcess extends DaoBase {
|
|||||||
@TableField(value = "fail_file")
|
@TableField(value = "fail_file")
|
||||||
private String failFile;
|
private String failFile;
|
||||||
|
|
||||||
/**
|
|
||||||
* 异常说明
|
|
||||||
*/
|
|
||||||
@TableField(value = "error")
|
|
||||||
private String error;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 进度
|
* 进度
|
||||||
*/
|
*/
|
||||||
@TableField(value = "`process`")
|
@TableField(value = "`process`")
|
||||||
private Integer process;
|
private Integer process;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常说明
|
||||||
|
*/
|
||||||
|
@TableField(value = "params")
|
||||||
|
private String params;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取标题
|
* 获取标题
|
||||||
*
|
*
|
||||||
@@ -189,24 +189,6 @@ public class CoreLogProcess extends DaoBase {
|
|||||||
this.failFile = failFile;
|
this.failFile = failFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取异常说明
|
|
||||||
*
|
|
||||||
* @return error - 异常说明
|
|
||||||
*/
|
|
||||||
public String getError() {
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置异常说明
|
|
||||||
*
|
|
||||||
* @param error 异常说明
|
|
||||||
*/
|
|
||||||
public void setError(String error) {
|
|
||||||
this.error = error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取进度
|
* 获取进度
|
||||||
*
|
*
|
||||||
@@ -224,4 +206,22 @@ public class CoreLogProcess extends DaoBase {
|
|||||||
public void setProcess(Integer process) {
|
public void setProcess(Integer process) {
|
||||||
this.process = process;
|
this.process = process;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取异常说明
|
||||||
|
*
|
||||||
|
* @return params - 异常说明
|
||||||
|
*/
|
||||||
|
public String getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置异常说明
|
||||||
|
*
|
||||||
|
* @param params 异常说明
|
||||||
|
*/
|
||||||
|
public void setParams(String params) {
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.tiesheng.web.pojos.imex;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
public class ExportDealDTO {
|
||||||
|
|
||||||
|
@NotEmpty(message = "模版ID")
|
||||||
|
private String imexId;
|
||||||
|
private JSONObject params;
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// setter\getter
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
public String getImexId() {
|
||||||
|
return imexId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImexId(String imexId) {
|
||||||
|
this.imexId = imexId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONObject getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParams(JSONObject params) {
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,25 +1,27 @@
|
|||||||
package com.tiesheng.web.pojos.dto;
|
package com.tiesheng.web.pojos.imex;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
public class TemplateDealDTO {
|
public class ImportDealDTO {
|
||||||
|
|
||||||
@NotEmpty(message = "模版ID")
|
@NotEmpty(message = "模版ID")
|
||||||
private String templateId;
|
private String imexId;
|
||||||
@NotEmpty(message = "文件路径必填")
|
@NotEmpty(message = "文件路径必填")
|
||||||
private String file;
|
private String file;
|
||||||
private Object params;
|
private JSONObject params;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// setter\getter
|
// setter\getter
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public String getTemplateId() {
|
public String getImexId() {
|
||||||
return templateId;
|
return imexId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTemplateId(String templateId) {
|
public void setImexId(String imexId) {
|
||||||
this.templateId = templateId;
|
this.imexId = imexId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFile() {
|
public String getFile() {
|
||||||
@@ -30,11 +32,11 @@ public class TemplateDealDTO {
|
|||||||
this.file = file;
|
this.file = file;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getParams() {
|
public JSONObject getParams() {
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParams(Object params) {
|
public void setParams(JSONObject params) {
|
||||||
this.params = params;
|
this.params = params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,15 @@
|
|||||||
package com.tiesheng.web.pojos.dto;
|
package com.tiesheng.web.pojos.imex;
|
||||||
|
|
||||||
|
|
||||||
public class TemplateInfoDTO {
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
public class ImportInfoDTO {
|
||||||
|
|
||||||
|
@NotEmpty(message = "操作必须存在")
|
||||||
private String action;
|
private String action;
|
||||||
private Object params;
|
|
||||||
|
@NotEmpty(message = "类型必须存在")
|
||||||
|
private String type;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// setter\getter
|
// setter\getter
|
||||||
@@ -18,11 +23,11 @@ public class TemplateInfoDTO {
|
|||||||
this.action = action;
|
this.action = action;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getParams() {
|
public String getType() {
|
||||||
return params;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParams(Object params) {
|
public void setType(String type) {
|
||||||
this.params = params;
|
this.type = type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.tiesheng.web.pojos.imex;
|
||||||
|
|
||||||
|
|
||||||
|
public class ImportInfoVO {
|
||||||
|
|
||||||
|
private String imexId;
|
||||||
|
private String templateUrl;
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// setter\getter
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
public String getImexId() {
|
||||||
|
return imexId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImexId(String imexId) {
|
||||||
|
this.imexId = imexId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTemplateUrl() {
|
||||||
|
return templateUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTemplateUrl(String templateUrl) {
|
||||||
|
this.templateUrl = templateUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.tiesheng.web.pojos.vo;
|
|
||||||
|
|
||||||
|
|
||||||
public class TemplateInfoVO {
|
|
||||||
|
|
||||||
private String templateId;
|
|
||||||
private String templateUrl;
|
|
||||||
private Object params;
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// setter\getter
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
public String getTemplateId() {
|
|
||||||
return templateId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTemplateId(String templateId) {
|
|
||||||
this.templateId = templateId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTemplateUrl() {
|
|
||||||
return templateUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTemplateUrl(String templateUrl) {
|
|
||||||
this.templateUrl = templateUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getParams() {
|
|
||||||
return params;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParams(Object params) {
|
|
||||||
this.params = params;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -79,33 +79,24 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
|||||||
coreLogProcess.setSuccessNum(0);
|
coreLogProcess.setSuccessNum(0);
|
||||||
coreLogProcess.setFailNum(0);
|
coreLogProcess.setFailNum(0);
|
||||||
coreLogProcess.setProcess(0);
|
coreLogProcess.setProcess(0);
|
||||||
coreLogProcess.setError("");
|
coreLogProcess.setParams("");
|
||||||
coreLogProcessMapper.insert(coreLogProcess);
|
coreLogProcessMapper.insert(coreLogProcess);
|
||||||
|
|
||||||
ThreadUtil.execute(() -> {
|
ThreadUtil.execute(() -> {
|
||||||
List<Exception> errorList = new ArrayList<>();
|
|
||||||
CollUtil.split(list, 100).forEach((it) -> {
|
CollUtil.split(list, 100).forEach((it) -> {
|
||||||
int accept = 0;
|
int accept = consumer.batchHandler(it);
|
||||||
try {
|
|
||||||
accept = consumer.accept(it);
|
|
||||||
} catch (Exception e) {
|
|
||||||
errorList.add(e);
|
|
||||||
}
|
|
||||||
coreLogProcess.setProcess(coreLogProcess.getProcess() + it.size());
|
coreLogProcess.setProcess(coreLogProcess.getProcess() + it.size());
|
||||||
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + accept);
|
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + accept);
|
||||||
coreLogProcess.setFailNum(coreLogProcess.getFailNum() + it.size() - accept);
|
coreLogProcess.setFailNum(coreLogProcess.getFailNum() + it.size() - accept);
|
||||||
coreLogProcess.setError(JSON.toJSONString(errorList));
|
|
||||||
coreLogProcessMapper.updateById(coreLogProcess);
|
coreLogProcessMapper.updateById(coreLogProcess);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 执行结束
|
// 执行结束
|
||||||
coreLogProcess.setFailFile(consumer.getFailFile());
|
coreLogProcess.setFailFile(consumer.getFailFile());
|
||||||
coreLogProcess.setStatus(1);
|
coreLogProcess.setStatus(1);
|
||||||
coreLogProcess.setError(JSON.toJSONString(errorList));
|
|
||||||
coreLogProcessMapper.updateById(coreLogProcess);
|
coreLogProcessMapper.updateById(coreLogProcess);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return coreLogProcess;
|
return coreLogProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,29 +117,24 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
|||||||
coreLogProcess.setFailNum(0);
|
coreLogProcess.setFailNum(0);
|
||||||
coreLogProcess.setTotal(0);
|
coreLogProcess.setTotal(0);
|
||||||
coreLogProcess.setProcess(0);
|
coreLogProcess.setProcess(0);
|
||||||
coreLogProcess.setError("");
|
|
||||||
coreLogProcessMapper.insert(coreLogProcess);
|
coreLogProcessMapper.insert(coreLogProcess);
|
||||||
|
|
||||||
ThreadUtil.execute(() -> {
|
ThreadUtil.execute(() -> {
|
||||||
int pageSize = 1000;
|
int pageSize = 1000;
|
||||||
int pageNum = 1, lastCount = pageSize;
|
int pageNum = 1, lastCount = pageSize;
|
||||||
List<Exception> errorList = new ArrayList<>();
|
|
||||||
while (lastCount == pageSize) {
|
while (lastCount == pageSize) {
|
||||||
try {
|
try {
|
||||||
lastCount = consumer.accept(pageNum, pageSize);
|
lastCount = consumer.accept(pageNum, pageSize);
|
||||||
coreLogProcess.setTotal(coreLogProcess.getTotal() + lastCount);
|
coreLogProcess.setTotal(coreLogProcess.getTotal() + lastCount);
|
||||||
coreLogProcess.setProcess(coreLogProcess.getTotal());
|
coreLogProcess.setProcess(coreLogProcess.getTotal());
|
||||||
coreLogProcess.setError(JSON.toJSONString(errorList));
|
|
||||||
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + lastCount);
|
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + lastCount);
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
errorList.add(e);
|
|
||||||
}
|
}
|
||||||
coreLogProcessMapper.updateById(coreLogProcess);
|
coreLogProcessMapper.updateById(coreLogProcess);
|
||||||
pageNum++;
|
pageNum++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行结束
|
// 执行结束
|
||||||
coreLogProcess.setError(JSON.toJSONString(errorList));
|
|
||||||
coreLogProcess.setStatus(1);
|
coreLogProcess.setStatus(1);
|
||||||
coreLogProcessMapper.updateById(coreLogProcess);
|
coreLogProcessMapper.updateById(coreLogProcess);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.tiesheng.web.service.imex;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.tiesheng.util.pojos.TokenBean;
|
||||||
|
import com.tiesheng.web.pojos.imex.ExportDealDTO;
|
||||||
|
import com.tiesheng.web.pojos.imex.ImportDealDTO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DefaultImexHandler implements TsImportHandler<String>, TsExportHandler<String> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> ready(ExportDealDTO dto, TokenBean token) {
|
||||||
|
return CollUtil.newArrayList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> ready(ImportDealDTO dto, TokenBean token) {
|
||||||
|
return CollUtil.newArrayList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTemplateUrl() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getAction() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchHandler(List<String> list) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFailFile() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.tiesheng.web.service.imex;
|
||||||
|
|
||||||
|
import com.tiesheng.util.pojos.TokenBean;
|
||||||
|
import com.tiesheng.web.pojos.imex.ExportDealDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TsExportHandler<T> extends TsImexBase<T> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据准备中
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<T> ready(ExportDealDTO dto, TokenBean token);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.tiesheng.web.service.imex;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.tiesheng.util.exception.ApiException;
|
||||||
|
import com.tiesheng.util.pojos.TokenBean;
|
||||||
|
import com.tiesheng.web.util.ProcessImportConsumer;
|
||||||
|
|
||||||
|
public interface TsImexBase<T> extends ProcessImportConsumer<T> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动作说明(唯一)
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getAction();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序,如果action相同,只会使用sort大的来处理
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
default int getSort() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证是否登录
|
||||||
|
*
|
||||||
|
* @param tokenBean
|
||||||
|
*/
|
||||||
|
default void validToken(TokenBean tokenBean) {
|
||||||
|
if (tokenBean == null || StrUtil.isEmpty(tokenBean.getId())) {
|
||||||
|
throw new ApiException("请先登录");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模版ID
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
default String getImexId() {
|
||||||
|
return StrUtil.format("{}_{}", getAction(), getSort());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.tiesheng.web.service.imex;
|
||||||
|
|
||||||
|
import com.tiesheng.util.pojos.TokenBean;
|
||||||
|
import com.tiesheng.web.pojos.imex.ImportDealDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TsImportHandler<T> extends TsImexBase<T> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取文件内容
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<T> ready(ImportDealDTO dto, TokenBean token);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模版地址
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getTemplateUrl();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,13 +6,12 @@ public interface ProcessImportConsumer<T> {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理数据
|
* 分批处理
|
||||||
*
|
*
|
||||||
* @param list
|
* @param list
|
||||||
* @param <T>
|
|
||||||
* @return 返回成功的数量
|
* @return 返回成功的数量
|
||||||
*/
|
*/
|
||||||
int accept(List<T> list);
|
int batchHandler(List<T> list);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -72,4 +72,7 @@ CREATE TABLE `core_log_operation`
|
|||||||
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-操作';
|
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-操作';
|
||||||
|
|
||||||
|
|
||||||
|
alter table core_log_process
|
||||||
|
modify params longtext null comment '异常说明';
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||||
<result column="status" jdbcType="INTEGER" property="status" />
|
<result column="status" jdbcType="INTEGER" property="status" />
|
||||||
<result column="fail_file" jdbcType="VARCHAR" property="failFile" />
|
<result column="fail_file" jdbcType="VARCHAR" property="failFile" />
|
||||||
<result column="error" jdbcType="LONGVARCHAR" property="error" />
|
|
||||||
<result column="process" jdbcType="INTEGER" property="process" />
|
<result column="process" jdbcType="INTEGER" property="process" />
|
||||||
|
<result column="params" jdbcType="LONGVARCHAR" property="params" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
|
|||||||
Reference in New Issue
Block a user