Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f6989d039 | ||
|
|
6f6e997fd3 | ||
|
|
d9987b41ea | ||
|
|
c33ad6075e | ||
|
|
a32c333a6c | ||
|
|
ed66f035e5 | ||
|
|
f5dd706e6e | ||
|
|
6766694272 | ||
|
|
2f22b64c0e | ||
|
|
4e6b108e7e | ||
|
|
24629f06b4 | ||
|
|
47c9251389 | ||
|
|
dda5f64910 | ||
|
|
704030729a | ||
|
|
c708809a19 | ||
|
|
2bbec9b79a | ||
|
|
e19f27f597 | ||
|
|
68781d4685 | ||
|
|
da69124968 | ||
|
|
8d9632bcaa | ||
|
|
1c0e63bf98 | ||
|
|
c04d45431c | ||
|
|
c5f8508a9e | ||
|
|
06f295bb66 | ||
|
|
bfc578e77c | ||
|
|
b5c10fc224 | ||
|
|
60580b40a4 | ||
|
|
af70808da6 | ||
|
|
c446ee8f75 | ||
|
|
86384a1f23 | ||
|
|
d63b6ab094 | ||
|
|
020d1d99e1 | ||
|
|
32fb562775 | ||
|
|
af50468743 | ||
|
|
cab794ecc4 | ||
|
|
0c511940aa | ||
|
|
60dea50e43 | ||
|
|
cbfeb09a22 |
@@ -1,3 +1,8 @@
|
||||
## 0.9.3
|
||||
|
||||
> 1,增加版本对比器,防止某些情况下版本对比失效;
|
||||
>
|
||||
|
||||
## 0.8.3
|
||||
|
||||
### 调整
|
||||
|
||||
20
pom.xml
20
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</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.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-login</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-web</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-util</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-message</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</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.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-ademo</artifactId>
|
||||
@@ -25,6 +25,12 @@
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
@EnableTransactionManagement
|
||||
@SpringBootApplication
|
||||
@EnableTieshengWeb(webConfigurer = DemoWebConfigurer.class)
|
||||
@EnableEncryptConfig
|
||||
//@EnableEncryptConfig
|
||||
public class DemoApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.tiesheng.demo.config;
|
||||
|
||||
|
||||
import com.tiesheng.core.service.CoreConfigService;
|
||||
import com.tiesheng.core.service.CoreJobService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Component
|
||||
public class TestJobConfig {
|
||||
|
||||
@Autowired
|
||||
CoreJobService coreJobService;
|
||||
@Autowired
|
||||
CoreConfigService coreConfigService;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
|
||||
coreConfigService.refreshFunc("230328001", "demo", "辅导员统计", "辅导员责任班级,学生展示");
|
||||
|
||||
// 辅导员职位
|
||||
coreJobService.refresh("class_fdy", "辅导员", "辅导员", 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,20 @@
|
||||
package com.tiesheng.demo.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.TimeInterval;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.hutool.log.LogFactory;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.sax.handler.RowHandler;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.read.listener.ReadListener;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.service.CoreMessageService;
|
||||
import com.tiesheng.demo.pojos.PoiBean;
|
||||
import com.tiesheng.demo.pojos.TestFile;
|
||||
import com.tiesheng.login.config.token.TsTokenConfig;
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.message.config.aliyun.AliyunSmsConfig;
|
||||
import com.tiesheng.message.pojos.MessageReqResp;
|
||||
import com.tiesheng.util.config.EncryptConfig;
|
||||
import com.tiesheng.util.config.GlobalConfig;
|
||||
@@ -19,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -31,17 +39,16 @@ public class TestController {
|
||||
@Autowired
|
||||
GlobalConfig globalConfig;
|
||||
@Autowired
|
||||
AliyunSmsConfig aliyunSmsConfig;
|
||||
@Autowired
|
||||
TsTokenConfig tsTokenConfig;
|
||||
@Autowired
|
||||
Ip2regionConfig ip2regionConfig;
|
||||
@Autowired
|
||||
EncryptConfig encryptConfig;
|
||||
@Autowired
|
||||
CoreMessageService coreMessageService;
|
||||
|
||||
|
||||
@RequestMapping("/index")
|
||||
@TokenIgnore
|
||||
public ApiResp<String> index() {
|
||||
|
||||
TokenBean tokenBean = new TokenBean("11", "", "fdfd");
|
||||
@@ -54,20 +61,22 @@ public class TestController {
|
||||
@TokenIgnore
|
||||
public void redirect(HttpServletResponse response) {
|
||||
// tsTokenConfig.validToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzYwMDY4NzUsImlkIjoiMSIsImVudmlyb25tZW50VHlwZSI6Im1vYmlsZSIsInNlcnZpY2UiOiJjb250ZXN0LXJlc2VydmUiLCJleHRyYSI6IiJ9.nsfxEFpCNHC7eNCS5DJXdu1VDdnHrTjSfgrozND70Lc", true);
|
||||
// globalConfig.redirect("mobile", "/test", response);
|
||||
globalConfig.redirect("mobile", "/test", response);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/send")
|
||||
@TokenIgnore
|
||||
public ApiResp<MessageReqResp> sendMessage() {
|
||||
MessageReqResp reqResp = aliyunSmsConfig.sendSms("13567116463", "SMS_154950909",
|
||||
JSONUtil.createObj().putOpt("code", "123456"));
|
||||
|
||||
MessageReqResp reqResp = coreMessageService.send("13567116463", "SMS_154950909",
|
||||
JSONUtil.createObj().putOpt("code", "123456"), "sms");
|
||||
|
||||
return ApiResp.respOK(reqResp);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/export")
|
||||
@TokenIgnore
|
||||
public ApiResp<String> export() {
|
||||
|
||||
// List<TestFile> list = new ArrayList<>();
|
||||
@@ -120,4 +129,43 @@ public class TestController {
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("poi")
|
||||
@TokenIgnore
|
||||
public ApiResp<String> poi() {
|
||||
TimeInterval timeInterval = new TimeInterval();
|
||||
|
||||
FileUploadPath file = FileUploadPath.file("/upload/test.xlsx");
|
||||
|
||||
EasyExcel.read(new File(file.getAbsolutePath()), PoiBean.class, new ReadListener<PoiBean>() {
|
||||
|
||||
@Override
|
||||
public void invoke(PoiBean poiBean, AnalysisContext analysisContext) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
|
||||
}
|
||||
}).sheet().doRead();
|
||||
|
||||
System.out.println("timeInterval: " + timeInterval.interval());
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
@RequestMapping("poiTool")
|
||||
@TokenIgnore
|
||||
public ApiResp<String> poiTool() {
|
||||
TimeInterval timeInterval = new TimeInterval();
|
||||
|
||||
FileUploadPath file = FileUploadPath.file("/upload/test.xlsx");
|
||||
|
||||
ExcelUtil.getReader(new File(file.getAbsolutePath())).read();
|
||||
|
||||
System.out.println("timeInterval: " + timeInterval.interval());
|
||||
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.tiesheng.demo.pojos;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
public class PoiBean {
|
||||
|
||||
@ExcelProperty("学院")
|
||||
private String college;
|
||||
private String type;
|
||||
private String name;
|
||||
private String no;
|
||||
private String sex;
|
||||
private String fdy;
|
||||
private String fdyNo;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getCollege() {
|
||||
return college;
|
||||
}
|
||||
|
||||
public void setCollege(String college) {
|
||||
this.college = college;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getNo() {
|
||||
return no;
|
||||
}
|
||||
|
||||
public void setNo(String no) {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getFdy() {
|
||||
return fdy;
|
||||
}
|
||||
|
||||
public void setFdy(String fdy) {
|
||||
this.fdy = fdy;
|
||||
}
|
||||
|
||||
public String getFdyNo() {
|
||||
return fdyNo;
|
||||
}
|
||||
|
||||
public void setFdyNo(String fdyNo) {
|
||||
this.fdyNo = fdyNo;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ tiesheng:
|
||||
id: "1111"
|
||||
global:
|
||||
version: 2
|
||||
host: http://localhost:8080
|
||||
host: http://localhost:8100
|
||||
aliyun:
|
||||
access-key-id: LTAI5tJtbgBCnTY5eS4SmrTf
|
||||
access-key-secret: JIHqpRUFffCHhXaJEVvWN31WcexWqG
|
||||
|
||||
@@ -20,3 +20,7 @@ spring:
|
||||
logging:
|
||||
file:
|
||||
name: runtime/logs/tiesheng.log
|
||||
tiesheng:
|
||||
token:
|
||||
ignore-paths:
|
||||
- /test/index
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
|
||||
<meta
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
||||
name="viewport"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
|
||||
<meta
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
||||
name="viewport"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,37 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
|
||||
<meta
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
||||
name="viewport"
|
||||
/>
|
||||
<title>钉钉授权</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="dingtalk.open.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function getQueryString(name) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return decodeURI(r[2]);
|
||||
return null;
|
||||
}
|
||||
|
||||
dd.runtime.permission.requestAuthCode({
|
||||
corpId: getQueryString("corpId"),
|
||||
onSuccess: function (result) {
|
||||
let search = window.location.search + "&code=" + result.code;
|
||||
window.location.href = "/auth/ding/oauth2/" + getQueryString("service") + search;
|
||||
},
|
||||
onFail: function (err) {
|
||||
window.location.href = "./error.html?message=" + JSON.stringify(err);
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,37 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
|
||||
<meta
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
||||
name="viewport"
|
||||
/>
|
||||
<title>钉钉授权</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="dingtalk.open.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function getQueryString(name) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return decodeURI(r[2]);
|
||||
return null;
|
||||
}
|
||||
|
||||
dd.runtime.permission.requestAuthCode({
|
||||
corpId: getQueryString("corpId"),
|
||||
onSuccess: function (result) {
|
||||
let search = window.location.search + "&code=" + result.code;
|
||||
window.location.href = "/auth/ding/oauth2/" + getQueryString("service") + search;
|
||||
},
|
||||
onFail: function (err) {
|
||||
window.location.href = "./error.html?message=" + JSON.stringify(err);
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-database</artifactId>
|
||||
|
||||
@@ -8,6 +8,7 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.db.Db;
|
||||
import cn.hutool.db.Entity;
|
||||
import cn.hutool.log.LogFactory;
|
||||
import com.tiesheng.database.config.DbMigrationConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.web.servlet.ServletContextInitializer;
|
||||
@@ -22,6 +23,7 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.zip.Checksum;
|
||||
|
||||
/**
|
||||
@@ -92,6 +94,8 @@ public class DbMigrationInitializer implements ServletContextInitializer {
|
||||
if (entity == null) {
|
||||
return;
|
||||
}
|
||||
AtomicReference<Integer> success= new AtomicReference<>(0);
|
||||
AtomicReference<Integer> fail= new AtomicReference<>(0);
|
||||
db.tx((VoidFunc1<Db>) parameter -> {
|
||||
List<String> split = StrUtil.split(readUtf8, ";");
|
||||
for (String sql : split) {
|
||||
@@ -104,11 +108,13 @@ public class DbMigrationInitializer implements ServletContextInitializer {
|
||||
}
|
||||
try {
|
||||
parameter.execute(sql);
|
||||
success.getAndSet(success.get() + 1);
|
||||
} catch (Exception ignore) {
|
||||
fail.getAndSet(fail.get() + 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
LogFactory.get().info("执行sql文件{},成功数:{},失败数:{}。",filename,success.get(),fail.get());
|
||||
entity.set("checksum", checksum.getValue());
|
||||
entity.set("update_time", DateUtil.date());
|
||||
db.update(entity, Entity.create(dbMigrationConfig.getTable()).set("id", entity.get("id")));
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-login</artifactId>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.tiesheng.login.config.token;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
@@ -50,8 +51,18 @@ public class TsTokenAspect {
|
||||
|
||||
// 过滤不要需要验证的接口(path)
|
||||
String requestURI = ServletKit.getRequest().getRequestURI();
|
||||
if (StrUtil.startWithAnyIgnoreCase(requestURI, tsTokenConfig.getIgnorePaths())) {
|
||||
return;
|
||||
String[] ignorePaths = tsTokenConfig.getIgnorePaths();
|
||||
if (ObjUtil.isNotEmpty(ignorePaths)) {
|
||||
for (String path : ignorePaths) {
|
||||
if (path.contains("/**") &&
|
||||
StrUtil.startWith(requestURI, path.replace("/**", ""))) {
|
||||
// 通配路径
|
||||
return;
|
||||
} else if (requestURI.equals(path)) {
|
||||
// 完整路径
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 过滤不要需要验证的接口(注解)
|
||||
|
||||
@@ -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.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-message</artifactId>
|
||||
|
||||
@@ -2,13 +2,13 @@ package com.tiesheng.message.config.aliyun;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.tiesheng.message.pojos.MessageReqResp;
|
||||
import com.tiesheng.message.service.TieshengMessageConfigurer;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.tiesheng.message.service.TieshengMessageSender;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -22,16 +22,13 @@ import java.util.*;
|
||||
*/
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "tiesheng.aliyun")
|
||||
public class AliyunSmsConfig {
|
||||
public class AliyunSmsSender implements TieshengMessageSender {
|
||||
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
private static final String ENDPOINT = "https://dysmsapi.aliyuncs.com";
|
||||
|
||||
@Autowired
|
||||
TieshengMessageConfigurer tieshengMessageConfigurer;
|
||||
|
||||
private String accessKeyId;
|
||||
private String accessKeySecret;
|
||||
private String signName;
|
||||
@@ -62,7 +59,7 @@ public class AliyunSmsConfig {
|
||||
*/
|
||||
public MessageReqResp sendSms(String phoneNumbers, String templateCode, JSONObject params) {
|
||||
|
||||
MessageReqResp reqResp = new MessageReqResp();
|
||||
MessageReqResp reqResp = new MessageReqResp("阿里云短信");
|
||||
reqResp.setTarget(phoneNumbers);
|
||||
reqResp.setResult(1);
|
||||
reqResp.setContent(JSONUtil.createObj()
|
||||
@@ -115,11 +112,24 @@ public class AliyunSmsConfig {
|
||||
reqResp.setToast(respObj.getStr("Message"));
|
||||
}
|
||||
|
||||
tieshengMessageConfigurer.onMessageSend("阿里云短信", reqResp);
|
||||
|
||||
return reqResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageReqResp send(String user, String title, Object body) {
|
||||
return sendSms(user, title, (JSONObject) body);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getChannel() {
|
||||
return "sms";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean support() {
|
||||
return StrUtil.isAllNotEmpty(accessKeyId, accessKeySecret, signName);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -2,6 +2,8 @@ package com.tiesheng.message.pojos;
|
||||
|
||||
public class MessageReqResp {
|
||||
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 发送对象
|
||||
*/
|
||||
@@ -28,10 +30,22 @@ public class MessageReqResp {
|
||||
*/
|
||||
private String toast;
|
||||
|
||||
public MessageReqResp(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.tiesheng.message.service;
|
||||
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.hutool.log.LogFactory;
|
||||
import com.tiesheng.message.pojos.MessageReqResp;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
public interface TieshengMessageConfigurer {
|
||||
|
||||
|
||||
/**
|
||||
* 消息发送后
|
||||
*
|
||||
* @param reqResp
|
||||
*/
|
||||
default void onMessageSend(String type, MessageReqResp reqResp) {
|
||||
LogFactory.get().info(JSONUtil.toJsonStr(reqResp));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.tiesheng.message.service;
|
||||
|
||||
|
||||
import com.tiesheng.message.pojos.MessageReqResp;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
public interface TieshengMessageSender {
|
||||
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
*
|
||||
* @param user
|
||||
* @param title
|
||||
* @param content
|
||||
* @param body
|
||||
* @param channel 消息通道,如果为空表示所有通道
|
||||
* @return 返回的内容,如果为空表示发送成功
|
||||
*/
|
||||
MessageReqResp send(String user, String title, Object body);
|
||||
|
||||
|
||||
/**
|
||||
* 获取通道
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getChannel();
|
||||
|
||||
/**
|
||||
* 是否支持
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean support();
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.tiesheng.message.service.impl;
|
||||
|
||||
import com.tiesheng.message.service.TieshengMessageConfigurer;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnMissingBean(value = TieshengMessageConfigurer.class, ignored = DefaultMessageConfigurer.class)
|
||||
public class DefaultMessageConfigurer implements TieshengMessageConfigurer {
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-util</artifactId>
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.tiesheng.util.config;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.comparator.VersionComparator;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.hutool.log.LogFactory;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -11,7 +14,10 @@ import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
@@ -23,6 +29,7 @@ public class GlobalConfig {
|
||||
private String host;
|
||||
private String service;
|
||||
private String version;
|
||||
private String uploadDir = System.getProperty("user.dir");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 逻辑方法
|
||||
@@ -61,15 +68,34 @@ public class GlobalConfig {
|
||||
* @param route
|
||||
*/
|
||||
public void redirect(String htmlDir, String route, HttpServletResponse response) {
|
||||
if (!StrUtil.endWith(htmlDir, "/")) {
|
||||
htmlDir = htmlDir + "/";
|
||||
}
|
||||
PathMatchingResourcePatternResolver patternResolver = new PathMatchingResourcePatternResolver();
|
||||
try {
|
||||
Resource[] resources = patternResolver.getResources(String.format("classpath*:static/%s/*/index.html", htmlDir));
|
||||
if (resources.length == 0) {
|
||||
List<String> versions = new ArrayList<>();
|
||||
|
||||
// jar包中的资源
|
||||
Resource[] resources = patternResolver.getResources(String.format("classpath*:static/%s*/index.html", htmlDir));
|
||||
for (Resource resource : resources) {
|
||||
String path = FileUtil.normalize(resource.getURL().getPath());
|
||||
versions.add(StrUtil.subBetween(path, htmlDir, "/index.html"));
|
||||
}
|
||||
|
||||
// 目录中的资源
|
||||
String folder = String.format("%s/static/%s", System.getProperty("user.dir"), htmlDir);
|
||||
if (FileUtil.exist(folder)) {
|
||||
File[] files = FileUtil.ls(folder);
|
||||
for (File file : files) {
|
||||
versions.add(StrUtil.subAfter(file.getAbsolutePath(), htmlDir, true));
|
||||
}
|
||||
}
|
||||
|
||||
if (CollUtil.isEmpty(versions)) {
|
||||
throw new ApiException("无法重定向,请检查资源");
|
||||
}
|
||||
String filename = resources[resources.length - 1].getURL().getPath();
|
||||
filename = FileUtil.normalize(filename);
|
||||
String path = buildPath(String.format("/%s%s#%s", htmlDir, StrUtil.subAfter(filename, htmlDir, true), route));
|
||||
CollUtil.sort(versions, (o1, o2) -> -VersionComparator.INSTANCE.compare(o1, o2));
|
||||
String path = buildPath(String.format("/%s%s/index.html#%s", htmlDir, versions.get(0), route));
|
||||
response.sendRedirect(path);
|
||||
} catch (IOException e) {
|
||||
LogFactory.get().info(e);
|
||||
@@ -80,6 +106,15 @@ public class GlobalConfig {
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public String getUploadDir() {
|
||||
return uploadDir;
|
||||
}
|
||||
|
||||
public void setUploadDir(String uploadDir) {
|
||||
this.uploadDir = uploadDir;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.CharUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.tiesheng.util.config.GlobalConfig;
|
||||
|
||||
public class FileUploadPath {
|
||||
|
||||
@@ -46,7 +48,7 @@ public class FileUploadPath {
|
||||
}
|
||||
pathBean.setHttpPath(tempPath);
|
||||
|
||||
String tempAbs = String.format("%s/static%s", System.getProperty("user.dir"), tempPath);
|
||||
String tempAbs = String.format("%s/static%s", SpringUtil.getBean(GlobalConfig.class).getUploadDir(), tempPath);
|
||||
tempAbs = FileUtil.normalize(tempAbs);
|
||||
pathBean.setAbsolutePath(tempAbs);
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.tiesheng.util.pojos;
|
||||
|
||||
public class IdName {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String extra;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getExtra() {
|
||||
return extra;
|
||||
}
|
||||
|
||||
public void setExtra(String extra) {
|
||||
this.extra = extra;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.8.4</version>
|
||||
<version>0.9.12</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-web</artifactId>
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package com.tiesheng.core.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigEnum;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.ConfigFuncDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.ConfigSystemDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.EnumTypeDTO;
|
||||
import com.tiesheng.core.service.CoreConfigService;
|
||||
@@ -16,6 +19,7 @@ import com.tiesheng.util.pojos.ApiResp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -95,4 +99,34 @@ public class ConfigController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 功能点列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/func/page")
|
||||
public ApiResp<List<CoreConfigFunc>> funcList(Integer isUsed, PageDTO dto) {
|
||||
QueryWrapper<CoreConfigFunc> queryWrapper = new QueryWrapper<CoreConfigFunc>().eq("is_deleted", 0);
|
||||
if (isUsed != null) {
|
||||
queryWrapper.eq("is_used", isUsed);
|
||||
}
|
||||
dto.likeColumns(queryWrapper, "name");
|
||||
Page<CoreConfigFunc> page = dto.pageObj();
|
||||
coreConfigService.getFuncMapper().selectPage(page, queryWrapper);
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能点更新
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/func/update")
|
||||
public ApiResp<String> funcUpdate(@Valid @RequestBody ConfigFuncDTO dto) {
|
||||
CoreConfigFunc configFunc = BeanUtil.copyProperties(dto, CoreConfigFunc.class);
|
||||
coreConfigService.getFuncMapper().updateById(configFunc);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.tiesheng.core.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJob;
|
||||
import com.tiesheng.core.pojos.dto.IdDTO;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUpdateDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUpdateRxDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUserAssignDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUserOwner;
|
||||
import com.tiesheng.core.service.CoreJobService;
|
||||
import com.tiesheng.login.config.token.TsTokenConfig;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/job")
|
||||
public class JobController {
|
||||
|
||||
@Autowired
|
||||
CoreJobService coreJobService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取职位列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ApiResp<List<CoreJob>> list(PageDTO dto) {
|
||||
QueryWrapper<CoreJob> queryWrapper = new QueryWrapper<CoreJob>().eq("is_deleted", 0);
|
||||
dto.likeColumns(queryWrapper, "name");
|
||||
List<CoreJob> jobList = coreJobService.list(queryWrapper);
|
||||
return ApiResp.respOK(jobList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加、编辑职位
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public ApiResp<String> update(@Valid @RequestBody JobUpdateDTO dto) {
|
||||
CoreJob job = BeanUtil.copyProperties(dto, CoreJob.class);
|
||||
if (!StrUtil.isEmpty(job.getId())) {
|
||||
CoreJob byId = coreJobService.getById(job.getId());
|
||||
if (byId != null && byId.getIsSystem() == 1) {
|
||||
throw new ApiException("系统配置,无法编辑");
|
||||
}
|
||||
}
|
||||
coreJobService.saveOrUpdate(job);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取关系
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/func/rx")
|
||||
public ApiResp<List<String>> funcRx(@Valid IdDTO dto) {
|
||||
List<String> list = coreJobService.getBaseMapper().getJobFunc(dto.getId(), null);
|
||||
return ApiResp.respOK(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新职位关系
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/func/rx")
|
||||
public ApiResp<String> updateJobRx(@Valid @RequestBody JobUpdateRxDTO dto) {
|
||||
coreJobService.updateJobRx(dto.getJobId(), StrUtil.split(dto.getPoints(), ","));
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户职位分配
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/user/assign")
|
||||
public ApiResp<String> userAssign(@Valid @RequestBody JobUserAssignDTO dto) {
|
||||
coreJobService.userAssign(dto.getUserId(), dto.getJobId());
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户自己的
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/user/owner")
|
||||
public ApiResp<List<JobUserOwner>> userOwner() {
|
||||
List<JobUserOwner> coreJobUsers = coreJobService.getJobUserMapper().list(TsTokenConfig.get().getId());
|
||||
coreJobUsers.forEach(it -> {
|
||||
List<String> list = coreJobService.getBaseMapper().getJobFunc(it.getJobId(), 1);
|
||||
it.setPoints(list);
|
||||
});
|
||||
return ApiResp.respOK(coreJobUsers);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogProcess;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.core.pojos.vo.ProcessDetailVo;
|
||||
import com.tiesheng.core.service.CoreLogService;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -88,4 +90,36 @@ public class LogController {
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 过程日志列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/process/page")
|
||||
public ApiResp<List<CoreLogProcess>> processPage(String type, @Valid PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreLogProcess> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
if (!StrUtil.isEmpty(type)) {
|
||||
queryWrapper.eq("type", type);
|
||||
}
|
||||
dto.likeColumns(queryWrapper, "title");
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
Page<CoreLogProcess> page = dto.pageObj();
|
||||
coreLogService.getCoreLogProcessMapper().selectPage(page, queryWrapper);
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 过程日志详情
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/process/detail")
|
||||
public ApiResp<ProcessDetailVo> processPage(String id) {
|
||||
ProcessDetailVo processDetail = coreLogService.getProcessDetail(id);
|
||||
return ApiResp.respOK(processDetail);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
||||
import com.tiesheng.util.pojos.IdName;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CoreConfigFuncMapper extends BaseMapper<CoreConfigFunc> {
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJob;
|
||||
import com.tiesheng.util.pojos.IdName;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CoreJobMapper extends BaseMapper<CoreJob> {
|
||||
|
||||
/**
|
||||
* 清除职位的关联关系
|
||||
*
|
||||
* @param jobId
|
||||
*/
|
||||
void clearJobFunc(@Param("jobId") String jobId);
|
||||
|
||||
|
||||
/**
|
||||
* 更新关联关系
|
||||
*
|
||||
* @param pointList
|
||||
*/
|
||||
void updateJobFunc(@Param("list") List<IdName> pointList);
|
||||
|
||||
|
||||
/**
|
||||
* 获取关联的func
|
||||
*
|
||||
* @param jobId
|
||||
* @return
|
||||
*/
|
||||
List<String> getJobFunc(@Param("jobId") String jobId, @Param("isUsed") Integer isUsed);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJobUser;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUserOwner;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CoreJobUserMapper extends BaseMapper<CoreJobUser> {
|
||||
/**
|
||||
* 获取指定用户的职位和功能点
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<JobUserOwner> list(@Param("userId") String userId);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogProcess;
|
||||
|
||||
public interface CoreLogProcessMapper extends BaseMapper<CoreLogProcess> {
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 职位-功能点
|
||||
*/
|
||||
@TableName(value = "core_config_func")
|
||||
public class CoreConfigFunc extends DaoBase {
|
||||
/**
|
||||
* 业务
|
||||
*/
|
||||
@TableField(value = "service")
|
||||
private String service;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 其他说明
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@TableField(value = "is_used")
|
||||
private Integer isUsed;
|
||||
|
||||
/**
|
||||
* 获取业务
|
||||
*
|
||||
* @return service - 业务
|
||||
*/
|
||||
public String getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置业务
|
||||
*
|
||||
* @param service 业务
|
||||
*/
|
||||
public void setService(String service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return name - 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取其他说明
|
||||
*
|
||||
* @return remark - 其他说明
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置其他说明
|
||||
*
|
||||
* @param remark 其他说明
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否启用
|
||||
*
|
||||
* @return is_used - 是否启用
|
||||
*/
|
||||
public Integer getIsUsed() {
|
||||
return isUsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否启用
|
||||
*
|
||||
* @param isUsed 是否启用
|
||||
*/
|
||||
public void setIsUsed(Integer isUsed) {
|
||||
this.isUsed = isUsed;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 职位
|
||||
*/
|
||||
@TableName(value = "core_job")
|
||||
public class CoreJob extends DaoBase {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 其他说明
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否系统
|
||||
*/
|
||||
@TableField(value = "is_system")
|
||||
private Integer isSystem;
|
||||
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return name - 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取其他说明
|
||||
*
|
||||
* @return remark - 其他说明
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置其他说明
|
||||
*
|
||||
* @param remark 其他说明
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否系统
|
||||
*
|
||||
* @return is_system - 是否系统
|
||||
*/
|
||||
public Integer getIsSystem() {
|
||||
return isSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否系统
|
||||
*
|
||||
* @param isSystem 是否系统
|
||||
*/
|
||||
public void setIsSystem(Integer isSystem) {
|
||||
this.isSystem = isSystem;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 职位-用户
|
||||
*/
|
||||
@TableName(value = "core_job_user")
|
||||
public class CoreJobUser extends DaoBase {
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableField(value = "user_id")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
@TableField(value = "job_id")
|
||||
private String jobId;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
*/
|
||||
@TableField(value = "ext1")
|
||||
private String ext1;
|
||||
|
||||
/**
|
||||
* 扩展2
|
||||
*/
|
||||
@TableField(value = "ext2")
|
||||
private String ext2;
|
||||
|
||||
/**
|
||||
* 扩展3
|
||||
*/
|
||||
@TableField(value = "ext3")
|
||||
private String ext3;
|
||||
|
||||
/**
|
||||
* 扩展文本
|
||||
*/
|
||||
@TableField(value = "ext_text")
|
||||
private String extText;
|
||||
|
||||
/**
|
||||
* 获取用户id
|
||||
*
|
||||
* @return user_id - 用户id
|
||||
*/
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户id
|
||||
*
|
||||
* @param userId 用户id
|
||||
*/
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户
|
||||
*
|
||||
* @return job_id - 用户
|
||||
*/
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户
|
||||
*
|
||||
* @param jobId 用户
|
||||
*/
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展1
|
||||
*
|
||||
* @return ext1 - 扩展1
|
||||
*/
|
||||
public String getExt1() {
|
||||
return ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展1
|
||||
*
|
||||
* @param ext1 扩展1
|
||||
*/
|
||||
public void setExt1(String ext1) {
|
||||
this.ext1 = ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展2
|
||||
*
|
||||
* @return ext2 - 扩展2
|
||||
*/
|
||||
public String getExt2() {
|
||||
return ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展2
|
||||
*
|
||||
* @param ext2 扩展2
|
||||
*/
|
||||
public void setExt2(String ext2) {
|
||||
this.ext2 = ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展3
|
||||
*
|
||||
* @return ext3 - 扩展3
|
||||
*/
|
||||
public String getExt3() {
|
||||
return ext3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展3
|
||||
*
|
||||
* @param ext3 扩展3
|
||||
*/
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展文本
|
||||
*
|
||||
* @return ext_text - 扩展文本
|
||||
*/
|
||||
public String getExtText() {
|
||||
return extText;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展文本
|
||||
*
|
||||
* @param extText 扩展文本
|
||||
*/
|
||||
public void setExtText(String extText) {
|
||||
this.extText = extText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 日志-过程
|
||||
*/
|
||||
@TableName(value = "core_log_process")
|
||||
public class CoreLogProcess extends DaoBase {
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@TableField(value = "title")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
@TableField(value = "total")
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 成功数
|
||||
*/
|
||||
@TableField(value = "success_num")
|
||||
private Integer successNum;
|
||||
|
||||
/**
|
||||
* 失败数
|
||||
*/
|
||||
@TableField(value = "fail_num")
|
||||
private Integer failNum;
|
||||
|
||||
/**
|
||||
* 失败的文件
|
||||
*/
|
||||
@TableField(value = "fail_file")
|
||||
private String failFile;
|
||||
|
||||
/**
|
||||
* 类型(import-导入,sync-同步)
|
||||
*/
|
||||
@TableField(value = "`type`")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 状态(0-未完成,1-完成)
|
||||
*/
|
||||
@TableField(value = "`status`")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 获取标题
|
||||
*
|
||||
* @return title - 标题
|
||||
*/
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置标题
|
||||
*
|
||||
* @param title 标题
|
||||
*/
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取总数
|
||||
*
|
||||
* @return total - 总数
|
||||
*/
|
||||
public Integer getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置总数
|
||||
*
|
||||
* @param total 总数
|
||||
*/
|
||||
public void setTotal(Integer total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成功数
|
||||
*
|
||||
* @return success_num - 成功数
|
||||
*/
|
||||
public Integer getSuccessNum() {
|
||||
return successNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置成功数
|
||||
*
|
||||
* @param successNum 成功数
|
||||
*/
|
||||
public void setSuccessNum(Integer successNum) {
|
||||
this.successNum = successNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取失败数
|
||||
*
|
||||
* @return fail_num - 失败数
|
||||
*/
|
||||
public Integer getFailNum() {
|
||||
return failNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置失败数
|
||||
*
|
||||
* @param failNum 失败数
|
||||
*/
|
||||
public void setFailNum(Integer failNum) {
|
||||
this.failNum = failNum;
|
||||
}
|
||||
|
||||
public String getFailFile() {
|
||||
return failFile;
|
||||
}
|
||||
|
||||
public void setFailFile(String failFile) {
|
||||
this.failFile = failFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型(import-导入,sync-同步)
|
||||
*
|
||||
* @return type - 类型(import-导入,sync-同步)
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置类型(import-导入,sync-同步)
|
||||
*
|
||||
* @param type 类型(import-导入,sync-同步)
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取状态(0-未完成,1-完成)
|
||||
*
|
||||
* @return status - 状态(0-未完成,1-完成)
|
||||
*/
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置状态(0-未完成,1-完成)
|
||||
*
|
||||
* @param status 状态(0-未完成,1-完成)
|
||||
*/
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.tiesheng.core.pojos.dto;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class IdDTO {
|
||||
|
||||
@NotEmpty(message = "需要ID")
|
||||
private String id;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.tiesheng.core.pojos.dto.config;
|
||||
|
||||
public class ConfigFuncDTO {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String remark;
|
||||
private Integer isUsed;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Integer getIsUsed() {
|
||||
return isUsed;
|
||||
}
|
||||
|
||||
public void setIsUsed(Integer isUsed) {
|
||||
this.isUsed = isUsed;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.tiesheng.core.pojos.dto.job;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class JobUpdateDTO {
|
||||
|
||||
private String id;
|
||||
|
||||
@NotEmpty(message = "请输入职位名称")
|
||||
private String name;
|
||||
private String remark;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.tiesheng.core.pojos.dto.job;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class JobUpdateRxDTO {
|
||||
|
||||
@NotEmpty(message = "请选择职位")
|
||||
private String jobId;
|
||||
private String points;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getPoints() {
|
||||
return points;
|
||||
}
|
||||
|
||||
public void setPoints(String points) {
|
||||
this.points = points;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.tiesheng.core.pojos.dto.job;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class JobUserAssignDTO {
|
||||
|
||||
@NotEmpty(message = "请选择用户")
|
||||
private String userId;
|
||||
@NotEmpty(message = "请选择职位")
|
||||
private String jobId;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.tiesheng.core.pojos.dto.job;
|
||||
|
||||
import com.tiesheng.util.pojos.IdName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class JobUserOwner {
|
||||
|
||||
private String jobId;
|
||||
private String jobName;
|
||||
private List<String> points;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getJobName() {
|
||||
return jobName;
|
||||
}
|
||||
|
||||
public void setJobName(String jobName) {
|
||||
this.jobName = jobName;
|
||||
}
|
||||
|
||||
public List<String> getPoints() {
|
||||
return points;
|
||||
}
|
||||
|
||||
public void setPoints(List<String> points) {
|
||||
this.points = points;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.tiesheng.core.pojos.vo;
|
||||
|
||||
/**
|
||||
* @author lgc
|
||||
*/
|
||||
public class ProcessDetailVo {
|
||||
|
||||
private String title;
|
||||
|
||||
private Integer total;
|
||||
|
||||
private Integer successNum;
|
||||
|
||||
private Integer failNum;
|
||||
|
||||
private String type;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private String failFile;
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Integer getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Integer total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public Integer getSuccessNum() {
|
||||
return successNum;
|
||||
}
|
||||
|
||||
public void setSuccessNum(Integer successNum) {
|
||||
this.successNum = successNum;
|
||||
}
|
||||
|
||||
public Integer getFailNum() {
|
||||
return failNum;
|
||||
}
|
||||
|
||||
public void setFailNum(Integer failNum) {
|
||||
this.failNum = failNum;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getFailFile() {
|
||||
return failFile;
|
||||
}
|
||||
|
||||
public void setFailFile(String failFile) {
|
||||
this.failFile = failFile;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.tiesheng.core.service;
|
||||
|
||||
import com.tiesheng.core.mapper.CoreConfigEnumMapper;
|
||||
import com.tiesheng.core.mapper.CoreConfigFuncMapper;
|
||||
import com.tiesheng.core.mapper.CoreConfigSystemMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -14,8 +16,37 @@ public class CoreConfigService extends TsServiceBase<CoreConfigSystemMapper, Cor
|
||||
|
||||
@Autowired
|
||||
CoreConfigEnumMapper coreConfigEnumMapper;
|
||||
@Autowired
|
||||
CoreConfigFuncMapper coreConfigFuncMapper;
|
||||
|
||||
public CoreConfigEnumMapper getEnumMapper() {
|
||||
return coreConfigEnumMapper;
|
||||
}
|
||||
|
||||
public CoreConfigFuncMapper getFuncMapper() {
|
||||
return coreConfigFuncMapper;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 刷新功能点
|
||||
*
|
||||
* @param id
|
||||
* @param service
|
||||
* @param name
|
||||
* @param remark
|
||||
*/
|
||||
public void refreshFunc(String id, String service, String name, String remark) {
|
||||
CoreConfigFunc jobPoint = new CoreConfigFunc();
|
||||
jobPoint.setId(id);
|
||||
jobPoint.setService(service);
|
||||
jobPoint.setName(name);
|
||||
jobPoint.setRemark(remark);
|
||||
try {
|
||||
coreConfigFuncMapper.insert(jobPoint);
|
||||
} catch (Exception e) {
|
||||
coreConfigFuncMapper.updateById(jobPoint);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.tiesheng.core.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.core.mapper.CoreJobMapper;
|
||||
import com.tiesheng.core.mapper.CoreJobUserMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJob;
|
||||
import com.tiesheng.core.pojos.dao.CoreJobUser;
|
||||
import com.tiesheng.util.pojos.IdName;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Service
|
||||
public class CoreJobService extends TsServiceBase<CoreJobMapper, CoreJob> {
|
||||
|
||||
@Autowired
|
||||
CoreJobUserMapper coreJobUserMapper;
|
||||
|
||||
public CoreJobUserMapper getJobUserMapper() {
|
||||
return coreJobUserMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新职位
|
||||
*
|
||||
* @param name
|
||||
* @param remark
|
||||
* @param isSystem
|
||||
*/
|
||||
public void refresh(String id, String name, String remark, Integer isSystem) {
|
||||
CoreJob coreJob = new CoreJob();
|
||||
coreJob.setId(id);
|
||||
coreJob.setName(name);
|
||||
coreJob.setRemark(remark);
|
||||
coreJob.setIsSystem(isSystem);
|
||||
saveOrUpdate(coreJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新关联关系
|
||||
*
|
||||
* @param jobId
|
||||
* @param points
|
||||
*/
|
||||
public void updateJobRx(String jobId, List<String> points) {
|
||||
List<IdName> nameList = new ArrayList<>();
|
||||
for (String s : points) {
|
||||
IdName id = new IdName();
|
||||
id.setId(IdUtil.getSnowflakeNextIdStr());
|
||||
id.setName(jobId);
|
||||
id.setExtra(s);
|
||||
nameList.add(id);
|
||||
}
|
||||
if (StrUtil.isEmpty(jobId)) {
|
||||
return;
|
||||
}
|
||||
getBaseMapper().clearJobFunc(jobId);
|
||||
if (CollUtil.isNotEmpty(nameList)) {
|
||||
getBaseMapper().updateJobFunc(nameList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分配职位
|
||||
*
|
||||
* @param userId
|
||||
* @param jobId
|
||||
*/
|
||||
public void userAssign(String userId, String jobId) {
|
||||
CoreJobUser jobUser = coreJobUserMapper.selectOne(new QueryWrapper<CoreJobUser>()
|
||||
.eq("is_deleted", 0)
|
||||
.eq("user_id", userId)
|
||||
.eq("job_id", jobId)
|
||||
);
|
||||
if (jobUser == null) {
|
||||
jobUser = new CoreJobUser();
|
||||
}
|
||||
jobUser.setUserId(userId);
|
||||
jobUser.setJobId(jobId);
|
||||
if (StrUtil.isEmpty(jobUser.getId())) {
|
||||
coreJobUserMapper.insert(jobUser);
|
||||
} else {
|
||||
coreJobUserMapper.updateById(jobUser);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,33 +1,40 @@
|
||||
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;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.core.mapper.CoreLogLoginMapper;
|
||||
import com.tiesheng.core.mapper.CoreLogMessageMapper;
|
||||
import com.tiesheng.core.mapper.CoreLogOperationMapper;
|
||||
import com.tiesheng.core.mapper.CoreLogProcessMapper;
|
||||
import com.tiesheng.core.pojos.RequestUserInfo;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
||||
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.message.pojos.MessageReqResp;
|
||||
import com.tiesheng.message.service.TieshengMessageConfigurer;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.config.Ip2regionConfig;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Service
|
||||
public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLogOperation> implements TieshengMessageConfigurer {
|
||||
public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLogOperation> {
|
||||
|
||||
@Autowired
|
||||
TieshengWebConfigurer tieshengWebConfigurer;
|
||||
@@ -37,6 +44,8 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
||||
CoreLogMessageMapper coreLogMessageMapper;
|
||||
@Autowired
|
||||
Ip2regionConfig ip2regionConfig;
|
||||
@Autowired
|
||||
CoreLogProcessMapper coreLogProcessMapper;
|
||||
|
||||
public CoreLogLoginMapper getLogLoginMapper() {
|
||||
return coreLogLoginMapper;
|
||||
@@ -46,6 +55,95 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
||||
return coreLogMessageMapper;
|
||||
}
|
||||
|
||||
public CoreLogProcessMapper getCoreLogProcessMapper() {
|
||||
return coreLogProcessMapper;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 导入日志
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 添加导入过程
|
||||
*
|
||||
* @param title 标题
|
||||
* @param list 要导入的数据
|
||||
*/
|
||||
public <T> CoreLogProcess addProcess(String title, List<T> list, ProcessImportConsumer<T> consumer) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
throw new ApiException("文件中不存在数据");
|
||||
}
|
||||
CoreLogProcess coreLogProcess = new CoreLogProcess();
|
||||
coreLogProcess.setTitle(title);
|
||||
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() + it.size() - accept);
|
||||
|
||||
if (coreLogProcess.getFailNum() + coreLogProcess.getSuccessNum() >= list.size()) {
|
||||
coreLogProcess.setFailFile(consumer.getFailFile());
|
||||
coreLogProcess.setStatus(1);
|
||||
}
|
||||
|
||||
coreLogProcessMapper.updateById(coreLogProcess);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
return coreLogProcess;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加同步过程
|
||||
*
|
||||
* @param title
|
||||
* @param consumer
|
||||
* @return
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id 获取过程详情
|
||||
*/
|
||||
public ProcessDetailVo getProcessDetail(String id) {
|
||||
QueryWrapper<CoreLogProcess> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("id", id);
|
||||
CoreLogProcess coreLogProcess = coreLogProcessMapper.selectOne(wrapper);
|
||||
return BeanUtil.copyProperties(coreLogProcess, ProcessDetailVo.class);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 操作日志
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -99,22 +197,4 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
||||
coreLogLoginMapper.insert(login);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 消息日志
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 添加消息日志
|
||||
*
|
||||
* @param type
|
||||
* @param reqResp
|
||||
*/
|
||||
@Override
|
||||
public void onMessageSend(String type, MessageReqResp reqResp) {
|
||||
CoreLogMessage coreLogMessage = BeanUtil.copyProperties(reqResp, CoreLogMessage.class);
|
||||
coreLogMessage.setType(type);
|
||||
coreLogMessageMapper.insert(coreLogMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.tiesheng.core.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tiesheng.core.mapper.CoreLogMessageMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
||||
import com.tiesheng.message.pojos.MessageReqResp;
|
||||
import com.tiesheng.message.service.TieshengMessageSender;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Service
|
||||
public class CoreMessageService {
|
||||
|
||||
@Autowired
|
||||
List<TieshengMessageSender> messageSenderList;
|
||||
@Autowired
|
||||
CoreLogMessageMapper coreLogMessageMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
*
|
||||
* @param user
|
||||
* @param title
|
||||
* @param body
|
||||
* @param channels 消息通道,如果为all时,表示发送全部通道
|
||||
*/
|
||||
public void multiple(String user, String title, Object body, String... channels) {
|
||||
if (StrUtil.isEmpty(user) || ArrayUtil.isEmpty(channels)) {
|
||||
return;
|
||||
}
|
||||
|
||||
messageSenderList.forEach(sender -> {
|
||||
boolean isChannel = ArrayUtil.contains(channels, sender.getChannel()) || ArrayUtil.contains(channels, "all");
|
||||
if (sender.support() && isChannel) {
|
||||
MessageReqResp reqResp = sender.send(user, title, body);
|
||||
coreLogMessageMapper.insert(BeanUtil.copyProperties(reqResp, CoreLogMessage.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
*
|
||||
* @param user
|
||||
* @param title
|
||||
* @param body
|
||||
*/
|
||||
public MessageReqResp send(String user, String title, Object body, String channel) {
|
||||
if (StrUtil.isEmpty(user) || StrUtil.isEmpty(channel)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
TieshengMessageSender messageSender = CollUtil.findOne(messageSenderList,
|
||||
sender -> Objects.equals(sender.getChannel(), channel) && sender.support());
|
||||
if (messageSender != null) {
|
||||
MessageReqResp reqResp = messageSender.send(user, title, body);
|
||||
coreLogMessageMapper.insert(BeanUtil.copyProperties(reqResp, CoreLogMessage.class));
|
||||
return reqResp;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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<T> {
|
||||
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
*
|
||||
* @param list
|
||||
* @param <T>
|
||||
* @return 返回成功的数量
|
||||
*/
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_log_login
|
||||
-- ----------------------------
|
||||
CREATE TABLE `core_log_login`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`user_id` varchar(50) DEFAULT NULL COMMENT '用户id',
|
||||
`user_name` varchar(255) DEFAULT NULL COMMENT '用户姓名',
|
||||
`platform` varchar(50) DEFAULT NULL COMMENT '登录方式',
|
||||
`ip` varchar(100) DEFAULT NULL COMMENT 'ip',
|
||||
`address` varchar(255) DEFAULT NULL COMMENT 'ip地址',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-登录';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -1,23 +0,0 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_log_message
|
||||
-- ----------------------------
|
||||
CREATE TABLE `core_log_message`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`type` varchar(50) DEFAULT NULL COMMENT '类型',
|
||||
`target` varchar(255) DEFAULT NULL COMMENT '发送对象',
|
||||
`content` text COMMENT '发送内容',
|
||||
`resp_body` text COMMENT '返回结果',
|
||||
`result` int(6) NOT NULL DEFAULT '0' COMMENT '结果',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='日志-消息';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -1,7 +1,6 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
|
||||
CREATE TABLE `core_config_enum`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
@@ -16,20 +15,6 @@ CREATE TABLE `core_config_enum`
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='配置-枚举';
|
||||
|
||||
CREATE TABLE `core_log_operation`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`user_id` varchar(50) DEFAULT NULL COMMENT '用户id',
|
||||
`user_name` varchar(255) DEFAULT NULL COMMENT '用户名称',
|
||||
`title` varchar(255) DEFAULT NULL COMMENT '标题',
|
||||
`subject` varchar(500) DEFAULT NULL COMMENT '小标题',
|
||||
`params` text COMMENT '其他参数',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-操作';
|
||||
|
||||
CREATE TABLE `core_config_system`
|
||||
(
|
||||
@@ -48,6 +33,27 @@ CREATE TABLE `core_config_system`
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='配置-系统';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_config_func
|
||||
-- ----------------------------
|
||||
CREATE TABLE `core_config_func`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`service` varchar(20) DEFAULT NULL COMMENT '业务',
|
||||
`name` varchar(255) DEFAULT NULL COMMENT '名称',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '其他说明',
|
||||
`is_used` int(6) NOT NULL DEFAULT '0' COMMENT '是否启用',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='职位-功能点';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table for data
|
||||
-- ----------------------------
|
||||
|
||||
INSERT INTO `core_config_system`(`id`, `create_time`, `update_time`, `is_deleted`, `config_key`, `config_val`,
|
||||
`config_type`, `remark`, `extra`, `read_only`)
|
||||
VALUES ('manager_web_copyright', '2022-02-23 16:52:48', '2022-02-23 16:52:49', 0, 'manager_web_copyright',
|
||||
@@ -0,0 +1,69 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_job
|
||||
-- ----------------------------
|
||||
CREATE TABLE `core_job`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`name` varchar(255) DEFAULT NULL COMMENT '名称',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '其他说明',
|
||||
`is_system` int(6) NOT NULL DEFAULT '0' COMMENT '是否系统',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='职位';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_job_func
|
||||
-- ----------------------------
|
||||
CREATE TABLE `core_job_func`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`job_id` varchar(50) DEFAULT NULL COMMENT '职位id',
|
||||
`point_id` varchar(50) DEFAULT NULL COMMENT ' 功能点id',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='职位-功能关系';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_job_user
|
||||
-- ----------------------------
|
||||
CREATE TABLE `core_job_user`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`user_id` varchar(50) NOT NULL COMMENT '用户id',
|
||||
`job_id` varchar(50) NOT NULL COMMENT '用户',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='职位-用户';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table change for core_job_user
|
||||
-- ----------------------------
|
||||
|
||||
alter table core_job_user
|
||||
add ext1 varchar(255) null comment '扩展1';
|
||||
|
||||
alter table core_job_user
|
||||
add ext2 varchar(255) null comment '扩展2';
|
||||
|
||||
alter table core_job_user
|
||||
add ext3 varchar(500) null comment '扩展3';
|
||||
|
||||
alter table core_job_user
|
||||
add ext_text text null comment '扩展文本';
|
||||
|
||||
alter table core_job_func
|
||||
change point_id func_id varchar(50) DEFAULT NULL COMMENT ' 功能点id';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -0,0 +1,87 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_log_login
|
||||
-- ----------------------------
|
||||
CREATE TABLE `core_log_login`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`user_id` varchar(50) DEFAULT NULL COMMENT '用户id',
|
||||
`user_name` varchar(255) DEFAULT NULL COMMENT '用户姓名',
|
||||
`platform` varchar(50) DEFAULT NULL COMMENT '登录方式',
|
||||
`ip` varchar(100) DEFAULT NULL COMMENT 'ip',
|
||||
`address` varchar(255) DEFAULT NULL COMMENT 'ip地址',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-登录';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_log_message
|
||||
-- ----------------------------
|
||||
CREATE TABLE `core_log_message`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`type` varchar(50) DEFAULT NULL COMMENT '类型',
|
||||
`target` varchar(255) DEFAULT NULL COMMENT '发送对象',
|
||||
`content` text COMMENT '发送内容',
|
||||
`resp_body` text COMMENT '返回结果',
|
||||
`result` int(6) NOT NULL DEFAULT '0' COMMENT '结果',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='日志-消息';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_log_process
|
||||
-- ----------------------------
|
||||
CREATE TABLE `core_log_process`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT 0,
|
||||
`title` varchar(255) NULL DEFAULT NULL COMMENT '标题',
|
||||
`total` int(11) NOT NULL DEFAULT 0 COMMENT '总数',
|
||||
`success_num` int(11) NOT NULL DEFAULT 0 COMMENT '成功数',
|
||||
`fail_num` int(11) NOT NULL DEFAULT 0 COMMENT '失败数',
|
||||
`type` varchar(50) NOT NULL DEFAULT 'import' COMMENT '类型(import-导入,sync-同步)',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
CHARACTER SET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT = '日志-过程'
|
||||
ROW_FORMAT = Dynamic;
|
||||
|
||||
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`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`user_id` varchar(50) DEFAULT NULL COMMENT '用户id',
|
||||
`user_name` varchar(255) DEFAULT NULL COMMENT '用户名称',
|
||||
`title` varchar(255) DEFAULT NULL COMMENT '标题',
|
||||
`subject` varchar(500) DEFAULT NULL COMMENT '小标题',
|
||||
`params` text COMMENT '其他参数',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-操作';
|
||||
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.core.mapper.CoreConfigFuncMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.core.pojos.dao.CoreConfigFunc">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_config_func-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
|
||||
<result column="service" jdbcType="VARCHAR" property="service"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
||||
<result column="is_used" jdbcType="INTEGER" property="isUsed"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, service, `name`, remark,is_used
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
49
springboot-web/src/main/resources/mapper/CoreJobMapper.xml
Normal file
49
springboot-web/src/main/resources/mapper/CoreJobMapper.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.core.mapper.CoreJobMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.core.pojos.dao.CoreJob">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_job-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="is_system" jdbcType="INTEGER" property="isSystem" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, `name`, remark, is_system
|
||||
</sql>
|
||||
|
||||
<delete id="clearJobFunc">
|
||||
delete from core_job_func where job_id=#{jobId}
|
||||
</delete>
|
||||
|
||||
<update id="updateJobFunc">
|
||||
insert into core_job_func(
|
||||
id, create_time, update_time, is_deleted, job_id, func_id
|
||||
) VALUES
|
||||
<foreach collection="list" index="index" item="as" separator=",">
|
||||
(#{as.id},
|
||||
now(),
|
||||
now(),
|
||||
0,
|
||||
#{as.name},
|
||||
#{as.extra}
|
||||
)
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getJobFunc" resultType="java.lang.String">
|
||||
select cjf.func_id from core_job_func cjf
|
||||
left join core_config_func ccf on ccf.id=cjf.func_id
|
||||
where cjf.job_id=#{jobId}
|
||||
<if test="isUsed != null">
|
||||
and ccf.is_used=#{isUsed}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.core.mapper.CoreJobUserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.core.pojos.dao.CoreJobUser">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_job_user-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="job_id" jdbcType="VARCHAR" property="jobId" />
|
||||
<result column="ext1" jdbcType="VARCHAR" property="ext1" />
|
||||
<result column="ext2" jdbcType="VARCHAR" property="ext2" />
|
||||
<result column="ext3" jdbcType="VARCHAR" property="ext3" />
|
||||
<result column="ext_text" jdbcType="LONGVARCHAR" property="extText" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, user_id, job_id, ext1, ext2, ext3, ext_text
|
||||
</sql>
|
||||
|
||||
<select id="list" resultType="com.tiesheng.core.pojos.dto.job.JobUserOwner">
|
||||
select cju.job_id,
|
||||
cj.name job_name
|
||||
from core_job_user cju
|
||||
left join core_job cj on cj.id = cju.job_id
|
||||
where cju.is_deleted=0 and cju.user_id=#{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.core.mapper.CoreLogProcessMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.core.pojos.dao.CoreLogProcess">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_log_process-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="title" jdbcType="VARCHAR" property="title" />
|
||||
<result column="total" jdbcType="INTEGER" property="total" />
|
||||
<result column="success_num" jdbcType="INTEGER" property="successNum" />
|
||||
<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`, fail_file
|
||||
</sql>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user