Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6766694272 | ||
|
|
2f22b64c0e | ||
|
|
4e6b108e7e | ||
|
|
24629f06b4 | ||
|
|
47c9251389 | ||
|
|
dda5f64910 | ||
|
|
704030729a | ||
|
|
c708809a19 | ||
|
|
2bbec9b79a |
20
pom.xml
20
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>springboot-parent</name>
|
||||
<description>杭州铁晟科技有限公司基础依赖</description>
|
||||
@@ -57,55 +57,55 @@
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-database</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-login</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-web</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-util</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-message</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
BIN
springboot-ademo/.DS_Store
vendored
Normal file
BIN
springboot-ademo/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-ademo</artifactId>
|
||||
|
||||
@@ -27,30 +27,28 @@ public class DemoWebConfigurer implements TieshengWebConfigurer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoginConfigurer loginConfigurer() {
|
||||
return new LoginConfigurer() {
|
||||
@Override
|
||||
public TokenBean doLogin(CorePlatformUnique platformUnique, String to) {
|
||||
public TokenBean login(CorePlatformUnique platformUnique) {
|
||||
TokenBean tokenBean = null;
|
||||
if (!StrUtil.isEmpty(platformUnique.getUserId())) {
|
||||
tokenBean = new TokenBean(platformUnique.getUserId(), "", globalConfig.getService());
|
||||
} else {
|
||||
// 获取用户信息判断是否可登录
|
||||
|
||||
// 默认跳转到mobile
|
||||
to = StrUtil.emptyToDefault(to, "mobile");
|
||||
}
|
||||
|
||||
TokenBean tokenBean = null;
|
||||
if (!StrUtil.isEmpty(platformUnique.getUserId())) {
|
||||
tokenBean = new TokenBean(platformUnique.getUserId(), to, globalConfig.getService());
|
||||
} else {
|
||||
// 获取用户信息判断是否可登录
|
||||
}
|
||||
|
||||
return tokenBean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void redirect(TokenBean bean, String to, String extra, HttpServletResponse response) {
|
||||
if (Objects.equals(bean.getEnvironmentType(), "mobile")) {
|
||||
globalConfig.redirect("mobile", "/?token=" + bean.toToken(), response);
|
||||
}
|
||||
}
|
||||
};
|
||||
return tokenBean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void redirect(TokenBean bean, String to, String extra, HttpServletResponse response) {
|
||||
|
||||
// 默认跳转到mobile
|
||||
to = StrUtil.emptyToDefault(to, "mobile");
|
||||
bean.setEnvironmentType(to);
|
||||
|
||||
if (Objects.equals(bean.getEnvironmentType(), "mobile")) {
|
||||
globalConfig.redirect("mobile", "/?token=" + bean.toToken(), response);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-database</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-login</artifactId>
|
||||
|
||||
@@ -58,8 +58,8 @@ public class LoginController {
|
||||
*/
|
||||
@GetMapping("/unique/redirect")
|
||||
public void uniqueIndex(UniqueIndexDTO dto, HttpServletResponse response) {
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("unique_index_web",
|
||||
dto.getNo(), "web", dto.getTo(), dto.getInfo()));
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("web_unique_redirect",
|
||||
dto.getNo(), dto.getPlatform(), dto.getInfo()));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
}
|
||||
|
||||
@@ -72,8 +72,8 @@ public class LoginController {
|
||||
*/
|
||||
@PostMapping("/unique/index")
|
||||
public ApiResp<String> uniqueIndex(@RequestBody UniqueIndexDTO dto) {
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("unique_index_web",
|
||||
dto.getNo(), "web", dto.getTo(), dto.getInfo()));
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("web_unique_index",
|
||||
dto.getNo(), dto.getPlatform(), dto.getInfo()));
|
||||
if (tokenBean == null) {
|
||||
throw new ApiException("登录失败");
|
||||
}
|
||||
@@ -120,8 +120,7 @@ public class LoginController {
|
||||
String ddUserId = platformDingConfig.getUserIdByCode(service, dto.getCode());
|
||||
DingUserInfo dingUserInfo = platformDingConfig.topapiV2UserGet(service, ddUserId);
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(dingUserInfo.getAppId(),
|
||||
dingUserInfo.getUserid(), "ding", dto.getTo(),
|
||||
JSON.toJSONString(dingUserInfo)));
|
||||
dingUserInfo.getUserid(), "ding", JSON.toJSONString(dingUserInfo)));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
}
|
||||
|
||||
@@ -167,7 +166,7 @@ public class LoginController {
|
||||
public void wxmpOauth2(@PathVariable String service, CodeExtraDTO dto, HttpServletResponse response) {
|
||||
WxUserInfo wxUserInfo = platformWxmpConfig.getOAuth2AccessToken(service, dto.getCode());
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(wxUserInfo.getAppId(),
|
||||
wxUserInfo.getOpenid(), "wxmp", dto.getTo(), JSON.toJSONString(wxUserInfo)));
|
||||
wxUserInfo.getOpenid(), "wxmp", JSON.toJSONString(wxUserInfo)));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
}
|
||||
|
||||
@@ -198,7 +197,7 @@ public class LoginController {
|
||||
String openid = platformWxminiConfig.jscode2session(service, code);
|
||||
WxConfigBean configBean = platformWxminiConfig.getConfigBean(service);
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(configBean.getAppId(),
|
||||
openid, "wxmini", "mini", "{}"));
|
||||
openid, "wxmini", "{}"));
|
||||
|
||||
WxminiLoginVo loginVo = new WxminiLoginVo();
|
||||
loginVo.setOpenid(openid);
|
||||
|
||||
@@ -5,15 +5,13 @@ public class DoLoginInfo {
|
||||
private String appId;
|
||||
private String unique;
|
||||
private String platform;
|
||||
private String to;
|
||||
private String info;
|
||||
private String extra;
|
||||
|
||||
public DoLoginInfo(String appId, String unique, String platform, String to, String info) {
|
||||
public DoLoginInfo(String appId, String unique, String platform, String info) {
|
||||
this.appId = appId;
|
||||
this.unique = unique;
|
||||
this.platform = platform;
|
||||
this.to = to;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
@@ -45,14 +43,6 @@ public class DoLoginInfo {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
public String getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public void setTo(String to) {
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ public class UniqueIndexDTO extends LoginToInfo {
|
||||
private String no;
|
||||
private String extra;
|
||||
private String info;
|
||||
private String platform = "web";
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
@@ -38,4 +39,12 @@ public class UniqueIndexDTO extends LoginToInfo {
|
||||
public void setInfo(String info) {
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public interface TieshengLoginConfigurer {
|
||||
/**
|
||||
* 授权登录回调
|
||||
*
|
||||
* @param tokenBean
|
||||
* @param bean
|
||||
*/
|
||||
void onLoginRedirect(TokenBean bean, String to, String extra, HttpServletResponse response);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-message</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-util</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-web</artifactId>
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -36,6 +37,12 @@ public class CoreLogProcess extends DaoBase {
|
||||
@TableField(value = "fail_num")
|
||||
private Integer failNum;
|
||||
|
||||
/**
|
||||
* 失败的文件
|
||||
*/
|
||||
@TableField(value = "fail_file")
|
||||
private String failFile;
|
||||
|
||||
/**
|
||||
* 类型(import-导入,sync-同步)
|
||||
*/
|
||||
@@ -120,6 +127,14 @@ public class CoreLogProcess extends DaoBase {
|
||||
this.failNum = failNum;
|
||||
}
|
||||
|
||||
public String getFailFile() {
|
||||
return failFile;
|
||||
}
|
||||
|
||||
public void setFailFile(String failFile) {
|
||||
this.failFile = failFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型(import-导入,sync-同步)
|
||||
*
|
||||
@@ -155,4 +170,4 @@ public class CoreLogProcess extends DaoBase {
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ public class ProcessDetailVo {
|
||||
|
||||
private Integer status;
|
||||
|
||||
private String failFile;
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
@@ -64,4 +66,12 @@ public class ProcessDetailVo {
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getFailFile() {
|
||||
return failFile;
|
||||
}
|
||||
|
||||
public void setFailFile(String failFile) {
|
||||
this.failFile = failFile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.tiesheng.core.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
@@ -15,6 +17,8 @@ import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogProcess;
|
||||
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.core.pojos.vo.ProcessDetailVo;
|
||||
import com.tiesheng.core.util.ProcessImportConsumer;
|
||||
import com.tiesheng.core.util.ProcessSyncConsumer;
|
||||
import com.tiesheng.login.config.token.TsTokenConfig;
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
@@ -24,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
@@ -53,37 +58,80 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
||||
public CoreLogProcessMapper getCoreLogProcessMapper() {
|
||||
return coreLogProcessMapper;
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 操作日志
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 导入日志
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 添加空的过程 返回id 用于更新
|
||||
* 添加导入过程
|
||||
*
|
||||
* @param title 标题
|
||||
* @param type 类型 import-导入,sync-同步
|
||||
* @param total 总数
|
||||
* @param list 要导入的数据
|
||||
*/
|
||||
public CoreLogProcess addProcess(String title, String type, Integer total) {
|
||||
public <T> CoreLogProcess addProcess(String title, List<T> list, ProcessImportConsumer consumer) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
throw new ApiException("文件中不存在数据");
|
||||
}
|
||||
CoreLogProcess coreLogProcess = new CoreLogProcess();
|
||||
coreLogProcess.setTitle(title);
|
||||
coreLogProcess.setTotal(total);
|
||||
coreLogProcess.setType(type);
|
||||
coreLogProcess.setTotal(list.size());
|
||||
coreLogProcess.setType("import");
|
||||
coreLogProcess.setSuccessNum(0);
|
||||
coreLogProcess.setFailNum(0);
|
||||
coreLogProcessMapper.insert(coreLogProcess);
|
||||
|
||||
ThreadUtil.execute(() -> {
|
||||
CollUtil.split(list, 100).forEach((it) -> {
|
||||
int accept = consumer.accept(it);
|
||||
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + accept);
|
||||
coreLogProcess.setFailNum(coreLogProcess.getFailNum() + 100 - accept);
|
||||
|
||||
if (coreLogProcess.getFailNum() + coreLogProcess.getSuccessNum() == list.size()) {
|
||||
coreLogProcess.setFailFile(consumer.getFailFile());
|
||||
coreLogProcess.setStatus(1);
|
||||
}
|
||||
|
||||
coreLogProcessMapper.updateById(coreLogProcess);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
return coreLogProcess;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新过程
|
||||
* 添加同步过程
|
||||
*
|
||||
* @param coreLogProcess 过程对象
|
||||
* @param title
|
||||
* @param consumer
|
||||
* @return
|
||||
*/
|
||||
public void upProcess(CoreLogProcess coreLogProcess) {
|
||||
if (coreLogProcess == null || coreLogProcess.getId().isEmpty()) {
|
||||
throw new ApiException("更新过程id不能为空");
|
||||
}
|
||||
coreLogProcessMapper.updateById(coreLogProcess);
|
||||
public CoreLogProcess addProcess(String title, ProcessSyncConsumer consumer) {
|
||||
CoreLogProcess coreLogProcess = new CoreLogProcess();
|
||||
coreLogProcess.setTitle(title);
|
||||
coreLogProcess.setTotal(0);
|
||||
coreLogProcess.setType("sync");
|
||||
coreLogProcess.setSuccessNum(0);
|
||||
coreLogProcess.setFailNum(0);
|
||||
coreLogProcessMapper.insert(coreLogProcess);
|
||||
|
||||
ThreadUtil.execute(() -> {
|
||||
int pageSize = 1000;
|
||||
int pageNum = 1, lastCount = pageSize;
|
||||
while (lastCount == pageSize) {
|
||||
lastCount = consumer.accept(pageNum, pageSize);
|
||||
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + lastCount);
|
||||
if (lastCount != pageSize) {
|
||||
coreLogProcess.setStatus(1);
|
||||
}
|
||||
coreLogProcessMapper.updateById(coreLogProcess);
|
||||
pageNum++;
|
||||
}
|
||||
});
|
||||
|
||||
return coreLogProcess;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,6 +144,10 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
||||
return BeanUtil.copyProperties(coreLogProcess, ProcessDetailVo.class);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 操作日志
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* 添加操作日志
|
||||
|
||||
@@ -29,13 +29,13 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
|
||||
if (platformUnique == null) {
|
||||
platformUnique = new CorePlatformUnique();
|
||||
platformUnique.setAppId(loginInfo.getAppId());
|
||||
platformUnique.setPlatform(loginInfo.getPlatform());
|
||||
platformUnique.setUniqueId(loginInfo.getUnique());
|
||||
}
|
||||
platformUnique.setPlatform(loginInfo.getPlatform());
|
||||
platformUnique.setInfo(loginInfo.getInfo());
|
||||
saveOrUpdate(platformUnique);
|
||||
|
||||
TokenBean tokenBean = tieshengWebConfigurer.loginConfigurer().doLogin(platformUnique, loginInfo.getTo());
|
||||
TokenBean tokenBean = tieshengWebConfigurer.login(platformUnique);
|
||||
if (tokenBean != null) {
|
||||
// 添加登录日志
|
||||
coreLogService.addLoginLog(platformUnique, tokenBean);
|
||||
@@ -45,7 +45,7 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
|
||||
|
||||
@Override
|
||||
public void onLoginRedirect(TokenBean bean, String to, String extra, HttpServletResponse response) {
|
||||
tieshengWebConfigurer.loginConfigurer().redirect(bean, to, extra, response);
|
||||
tieshengWebConfigurer.redirect(bean, to, extra, response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -54,36 +54,22 @@ public interface TieshengWebConfigurer {
|
||||
return uploadPath;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 配置登录
|
||||
* 登录逻辑
|
||||
*
|
||||
* @param platformUnique
|
||||
* @return
|
||||
*/
|
||||
LoginConfigurer loginConfigurer();
|
||||
TokenBean login(CorePlatformUnique platformUnique);
|
||||
|
||||
|
||||
interface LoginConfigurer {
|
||||
|
||||
/**
|
||||
* 登录逻辑
|
||||
*
|
||||
* @param platformUnique
|
||||
* @return
|
||||
*/
|
||||
TokenBean doLogin(CorePlatformUnique platformUnique, String to);
|
||||
|
||||
|
||||
/**
|
||||
* 登录重定向
|
||||
*
|
||||
* @param bean
|
||||
* @param extra
|
||||
* @param response
|
||||
*/
|
||||
void redirect(TokenBean bean, String to, String extra, HttpServletResponse response);
|
||||
|
||||
}
|
||||
/**
|
||||
* 登录重定向
|
||||
*
|
||||
* @param bean
|
||||
* @param extra
|
||||
* @param response
|
||||
*/
|
||||
void redirect(TokenBean bean, String to, String extra, HttpServletResponse response);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.tiesheng.core.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProcessImportConsumer {
|
||||
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
*
|
||||
* @param list
|
||||
* @param <T>
|
||||
* @return 返回成功的数量
|
||||
*/
|
||||
<T> int accept(List<T> list);
|
||||
|
||||
|
||||
/**
|
||||
* 获取失败的文件路径
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getFailFile();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.tiesheng.core.util;
|
||||
|
||||
public interface ProcessSyncConsumer {
|
||||
|
||||
|
||||
/**
|
||||
* 分页数据
|
||||
*
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return 返回成功的数量
|
||||
*/
|
||||
int accept(Integer pageNum, Integer pageSize);
|
||||
|
||||
|
||||
}
|
||||
@@ -61,6 +61,12 @@ CREATE TABLE `core_log_process`
|
||||
ALTER TABLE core_log_process
|
||||
ADD status int(6) default 0 COMMENT '状态(0-未完成,1-已完成)';
|
||||
|
||||
ALTER TABLE core_log_process
|
||||
ADD fail_file varchar(500) null default null COMMENT '失败的文件';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_log_operation
|
||||
-- ----------------------------
|
||||
|
||||
CREATE TABLE `core_log_operation`
|
||||
(
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
<result column="fail_num" jdbcType="INTEGER" property="failNum" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="fail_file" jdbcType="VARCHAR" property="failFile" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, title, total, success_num, fail_num, `type`,
|
||||
`status`
|
||||
id, create_time, update_time, is_deleted, title, total, success_num, fail_num, `type`,
|
||||
`status`, fail_file
|
||||
</sql>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user