代码同步
parent
cc0c0f3578
commit
e54c8e1f57
|
@ -45,6 +45,11 @@
|
||||||
<groupId>org.jeecgframework.boot</groupId>
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
<artifactId>jeecg-boot-common</artifactId>
|
<artifactId>jeecg-boot-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 分布式锁依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-starter-lock</artifactId>
|
||||||
|
</dependency>
|
||||||
<!--集成springmvc框架并实现自动配置 -->
|
<!--集成springmvc框架并实现自动配置 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
package com.baomidou.mybatisplus.core.mapper;
|
package com.baomidou.mybatisplus.core.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
package org.jeecg.common.api.dto.message;
|
package org.jeecg.common.api.dto.message;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 带业务参数的消息
|
* 带业务参数的消息
|
||||||
*
|
*
|
||||||
* @author: taoyan
|
* @author: taoyan
|
||||||
* @date: 2022/8/17
|
* @date: 2022/8/17
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class BusMessageDTO extends MessageDTO implements Serializable {
|
public class BusMessageDTO extends MessageDTO implements Serializable {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class ProvinceCityArea {
|
||||||
|
|
||||||
public String getText(String code){
|
public String getText(String code){
|
||||||
this.initAreaList();
|
this.initAreaList();
|
||||||
if(this.areaList!=null || this.areaList.size()>0){
|
if(this.areaList != null && !this.areaList.isEmpty()){
|
||||||
List<String> ls = new ArrayList<String>();
|
List<String> ls = new ArrayList<String>();
|
||||||
getAreaByCode(code,ls);
|
getAreaByCode(code,ls);
|
||||||
return String.join("/",ls);
|
return String.join("/",ls);
|
||||||
|
@ -35,7 +35,7 @@ public class ProvinceCityArea {
|
||||||
|
|
||||||
public String getCode(String text){
|
public String getCode(String text){
|
||||||
this.initAreaList();
|
this.initAreaList();
|
||||||
if(areaList!=null && areaList.size()>0){
|
if(areaList != null && !areaList.isEmpty()){
|
||||||
for(int i=areaList.size()-1;i>=0;i--){
|
for(int i=areaList.size()-1;i>=0;i--){
|
||||||
//update-begin-author:taoyan date:2022-5-24 for:VUEN-1088 online 导入 省市区导入后 导入数据错乱 北京市/市辖区/西城区-->山西省/晋城市/城区
|
//update-begin-author:taoyan date:2022-5-24 for:VUEN-1088 online 导入 省市区导入后 导入数据错乱 北京市/市辖区/西城区-->山西省/晋城市/城区
|
||||||
String areaText = areaList.get(i).getText();
|
String areaText = areaList.get(i).getText();
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class PasswordUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取加密算法中使用的盐值,解密中使用的盐值必须与加密中使用的相同才能完成操作. 盐长度必须为8字节
|
* 获取加密算法中使用的盐值,解密中使用的盐值必须与加密中使用的相同才能完成操作. 盐长度必须为8字节
|
||||||
*
|
*
|
||||||
* @return byte[] 盐值
|
* @return byte[] 盐值
|
||||||
* */
|
* */
|
||||||
public static byte[] getSalt() throws Exception {
|
public static byte[] getSalt() throws Exception {
|
||||||
|
@ -58,7 +58,7 @@ public class PasswordUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据PBE密码生成一把密钥
|
* 根据PBE密码生成一把密钥
|
||||||
*
|
*
|
||||||
* @param password
|
* @param password
|
||||||
* 生成密钥时所使用的密码
|
* 生成密钥时所使用的密码
|
||||||
* @return Key PBE算法密钥
|
* @return Key PBE算法密钥
|
||||||
|
@ -84,7 +84,7 @@ public class PasswordUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密明文字符串
|
* 加密明文字符串
|
||||||
*
|
*
|
||||||
* @param plaintext
|
* @param plaintext
|
||||||
* 待加密的明文字符串
|
* 待加密的明文字符串
|
||||||
* @param password
|
* @param password
|
||||||
|
@ -113,7 +113,7 @@ public class PasswordUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解密密文字符串
|
* 解密密文字符串
|
||||||
*
|
*
|
||||||
* @param ciphertext
|
* @param ciphertext
|
||||||
* 待解密的密文字符串
|
* 待解密的密文字符串
|
||||||
* @param password
|
* @param password
|
||||||
|
@ -139,12 +139,12 @@ public class PasswordUtil {
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
// TODO: handle exception
|
// TODO: handle exception
|
||||||
}
|
}
|
||||||
return new String(passDec);
|
return passDec == null ? "" : new String(passDec);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将字节数组转换为十六进制字符串
|
* 将字节数组转换为十六进制字符串
|
||||||
*
|
*
|
||||||
* @param src
|
* @param src
|
||||||
* 字节数组
|
* 字节数组
|
||||||
* @return
|
* @return
|
||||||
|
@ -167,7 +167,7 @@ public class PasswordUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将十六进制字符串转换为字节数组
|
* 将十六进制字符串转换为字节数组
|
||||||
*
|
*
|
||||||
* @param hexString
|
* @param hexString
|
||||||
* 十六进制字符串
|
* 十六进制字符串
|
||||||
* @return
|
* @return
|
||||||
|
@ -192,4 +192,4 @@ public class PasswordUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @Author 张代浩
|
* @Author 张代浩
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -43,7 +43,7 @@ public class oConvertUtils {
|
||||||
}
|
}
|
||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isNotEmpty(Object object) {
|
public static boolean isNotEmpty(Object object) {
|
||||||
if (object != null && !"".equals(object) && !object.equals(CommonConstant.STRING_NULL)) {
|
if (object != null && !"".equals(object) && !object.equals(CommonConstant.STRING_NULL)) {
|
||||||
return (true);
|
return (true);
|
||||||
|
@ -170,7 +170,7 @@ public class oConvertUtils {
|
||||||
return (defval);
|
return (defval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Integer getInt(Object object) {
|
public static Integer getInt(Object object) {
|
||||||
if (isEmpty(object)) {
|
if (isEmpty(object)) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -214,7 +214,7 @@ public class oConvertUtils {
|
||||||
/*public static String escapeJava(Object s) {
|
/*public static String escapeJava(Object s) {
|
||||||
return StringEscapeUtils.escapeJava(getString(s));
|
return StringEscapeUtils.escapeJava(getString(s));
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
public static String getString(Object object) {
|
public static String getString(Object object) {
|
||||||
if (isEmpty(object)) {
|
if (isEmpty(object)) {
|
||||||
return "";
|
return "";
|
||||||
|
@ -271,7 +271,7 @@ public class oConvertUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断一个类是否为基本数据类型。
|
* 判断一个类是否为基本数据类型。
|
||||||
*
|
*
|
||||||
* @param clazz
|
* @param clazz
|
||||||
* 要判断的类。
|
* 要判断的类。
|
||||||
* @return true 表示为基本数据类型。
|
* @return true 表示为基本数据类型。
|
||||||
|
@ -339,7 +339,7 @@ public class oConvertUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* java去除字符串中的空格、回车、换行符、制表符
|
* java去除字符串中的空格、回车、换行符、制表符
|
||||||
*
|
*
|
||||||
* @param str
|
* @param str
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -357,7 +357,7 @@ public class oConvertUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断元素是否在数组内
|
* 判断元素是否在数组内
|
||||||
*
|
*
|
||||||
* @param child
|
* @param child
|
||||||
* @param all
|
* @param all
|
||||||
* @return
|
* @return
|
||||||
|
@ -424,7 +424,7 @@ public class oConvertUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SET转换MAP
|
* SET转换MAP
|
||||||
*
|
*
|
||||||
* @param str
|
* @param str
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -438,12 +438,12 @@ public class oConvertUtils {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isInnerIp(String ipAddress) {
|
/*public static boolean isInnerIp(String ipAddress) {
|
||||||
boolean isInnerIp = false;
|
boolean isInnerIp = false;
|
||||||
long ipNum = getIpNum(ipAddress);
|
long ipNum = getIpNum(ipAddress);
|
||||||
/**
|
*//**
|
||||||
* 私有IP:A类 10.0.0.0-10.255.255.255 B类 172.16.0.0-172.31.255.255 C类 192.168.0.0-192.168.255.255 当然,还有127这个网段是环回地址
|
* 私有IP:A类 10.0.0.0-10.255.255.255 B类 172.16.0.0-172.31.255.255 C类 192.168.0.0-192.168.255.255 当然,还有127这个网段是环回地址
|
||||||
**/
|
**//*
|
||||||
long aBegin = getIpNum("10.0.0.0");
|
long aBegin = getIpNum("10.0.0.0");
|
||||||
long aEnd = getIpNum("10.255.255.255");
|
long aEnd = getIpNum("10.255.255.255");
|
||||||
long bBegin = getIpNum("172.16.0.0");
|
long bBegin = getIpNum("172.16.0.0");
|
||||||
|
@ -453,7 +453,7 @@ public class oConvertUtils {
|
||||||
String localIp = "127.0.0.1";
|
String localIp = "127.0.0.1";
|
||||||
isInnerIp = isInner(ipNum, aBegin, aEnd) || isInner(ipNum, bBegin, bEnd) || isInner(ipNum, cBegin, cEnd) || localIp.equals(ipAddress);
|
isInnerIp = isInner(ipNum, aBegin, aEnd) || isInner(ipNum, bBegin, bEnd) || isInner(ipNum, cBegin, cEnd) || localIp.equals(ipAddress);
|
||||||
return isInnerIp;
|
return isInnerIp;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
private static long getIpNum(String ipAddress) {
|
private static long getIpNum(String ipAddress) {
|
||||||
String[] ip = ipAddress.split("\\.");
|
String[] ip = ipAddress.split("\\.");
|
||||||
|
@ -469,12 +469,12 @@ public class oConvertUtils {
|
||||||
private static boolean isInner(long userIp, long begin, long end) {
|
private static boolean isInner(long userIp, long begin, long end) {
|
||||||
return (userIp >= begin) && (userIp <= end);
|
return (userIp >= begin) && (userIp <= end);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将下划线大写方式命名的字符串转换为驼峰式。
|
* 将下划线大写方式命名的字符串转换为驼峰式。
|
||||||
* 如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。</br>
|
* 如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。</br>
|
||||||
* 例如:hello_world->helloWorld
|
* 例如:hello_world->helloWorld
|
||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
* 转换前的下划线大写方式命名的字符串
|
* 转换前的下划线大写方式命名的字符串
|
||||||
* @return 转换后的驼峰式命名的字符串
|
* @return 转换后的驼峰式命名的字符串
|
||||||
|
@ -511,12 +511,12 @@ public class oConvertUtils {
|
||||||
}
|
}
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将下划线大写方式命名的字符串转换为驼峰式。
|
* 将下划线大写方式命名的字符串转换为驼峰式。
|
||||||
* 如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。</br>
|
* 如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。</br>
|
||||||
* 例如:hello_world,test_id->helloWorld,testId
|
* 例如:hello_world,test_id->helloWorld,testId
|
||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
* 转换前的下划线大写方式命名的字符串
|
* 转换前的下划线大写方式命名的字符串
|
||||||
* @return 转换后的驼峰式命名的字符串
|
* @return 转换后的驼峰式命名的字符串
|
||||||
|
@ -534,13 +534,13 @@ public class oConvertUtils {
|
||||||
String result = sf.toString();
|
String result = sf.toString();
|
||||||
return result.substring(0, result.length() - 1);
|
return result.substring(0, result.length() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin--Author:zhoujf Date:20180503 for:TASK #2500 【代码生成器】代码生成器开发一通用模板生成功能
|
//update-begin--Author:zhoujf Date:20180503 for:TASK #2500 【代码生成器】代码生成器开发一通用模板生成功能
|
||||||
/**
|
/**
|
||||||
* 将下划线大写方式命名的字符串转换为驼峰式。(首字母写)
|
* 将下划线大写方式命名的字符串转换为驼峰式。(首字母写)
|
||||||
* 如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。</br>
|
* 如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。</br>
|
||||||
* 例如:hello_world->HelloWorld
|
* 例如:hello_world->HelloWorld
|
||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
* 转换前的下划线大写方式命名的字符串
|
* 转换前的下划线大写方式命名的字符串
|
||||||
* @return 转换后的驼峰式命名的字符串
|
* @return 转换后的驼峰式命名的字符串
|
||||||
|
@ -569,7 +569,7 @@ public class oConvertUtils {
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
//update-end--Author:zhoujf Date:20180503 for:TASK #2500 【代码生成器】代码生成器开发一通用模板生成功能
|
//update-end--Author:zhoujf Date:20180503 for:TASK #2500 【代码生成器】代码生成器开发一通用模板生成功能
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将驼峰命名转化成下划线
|
* 将驼峰命名转化成下划线
|
||||||
* @param para
|
* @param para
|
||||||
|
@ -578,19 +578,19 @@ public class oConvertUtils {
|
||||||
public static String camelToUnderline(String para){
|
public static String camelToUnderline(String para){
|
||||||
int length = 3;
|
int length = 3;
|
||||||
if(para.length()<length){
|
if(para.length()<length){
|
||||||
return para.toLowerCase();
|
return para.toLowerCase();
|
||||||
}
|
}
|
||||||
StringBuilder sb=new StringBuilder(para);
|
StringBuilder sb=new StringBuilder(para);
|
||||||
//定位
|
//定位
|
||||||
int temp=0;
|
int temp=0;
|
||||||
//从第三个字符开始 避免命名不规范
|
//从第三个字符开始 避免命名不规范
|
||||||
for(int i=2;i<para.length();i++){
|
for(int i=2;i<para.length();i++){
|
||||||
if(Character.isUpperCase(para.charAt(i))){
|
if(Character.isUpperCase(para.charAt(i))){
|
||||||
sb.insert(i+temp, "_");
|
sb.insert(i+temp, "_");
|
||||||
temp+=1;
|
temp+=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sb.toString().toLowerCase();
|
return sb.toString().toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -606,10 +606,10 @@ public class oConvertUtils {
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取类的所有属性,包括父类
|
* 获取类的所有属性,包括父类
|
||||||
*
|
*
|
||||||
* @param object
|
* @param object
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -624,7 +624,7 @@ public class oConvertUtils {
|
||||||
fieldList.toArray(fields);
|
fieldList.toArray(fields);
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将map的key全部转成小写
|
* 将map的key全部转成小写
|
||||||
* @param list
|
* @param list
|
||||||
|
@ -634,10 +634,10 @@ public class oConvertUtils {
|
||||||
List<Map<String, Object>> select = new ArrayList<>();
|
List<Map<String, Object>> select = new ArrayList<>();
|
||||||
for (Map<String, Object> row : list) {
|
for (Map<String, Object> row : list) {
|
||||||
Map<String, Object> resultMap = new HashMap<>(5);
|
Map<String, Object> resultMap = new HashMap<>(5);
|
||||||
Set<String> keySet = row.keySet();
|
Set<String> keySet = row.keySet();
|
||||||
for (String key : keySet) {
|
for (String key : keySet) {
|
||||||
String newKey = key.toLowerCase();
|
String newKey = key.toLowerCase();
|
||||||
resultMap.put(newKey, row.get(key));
|
resultMap.put(newKey, row.get(key));
|
||||||
}
|
}
|
||||||
select.add(resultMap);
|
select.add(resultMap);
|
||||||
}
|
}
|
||||||
|
@ -732,7 +732,7 @@ public class oConvertUtils {
|
||||||
}
|
}
|
||||||
return obj.getClass().isArray();
|
return obj.getClass().isArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断两个数组是否相等(数组元素不分顺序)
|
* 判断两个数组是否相等(数组元素不分顺序)
|
||||||
*
|
*
|
||||||
|
@ -782,7 +782,7 @@ public class oConvertUtils {
|
||||||
// Integer b = 1;
|
// Integer b = 1;
|
||||||
// System.out.println(oConvertUtils.isEqual(a, b));
|
// System.out.println(oConvertUtils.isEqual(a, b));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断 list 是否不为空
|
* 判断 list 是否不为空
|
||||||
*
|
*
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package org.jeecg.common.util.store;
|
||||||
|
|
||||||
|
import org.jeecg.common.util.store.adapter.FileStoreAdapter;
|
||||||
|
import org.jeecg.common.util.store.adapter.SimpleFileStoreAdapter;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class FileStoreConfiguration {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean
|
||||||
|
public FileStoreAdapter fileStoreAdapter() {
|
||||||
|
return new SimpleFileStoreAdapter();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package org.jeecg.common.util.store.adapter;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.StrPool;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件存储适配器
|
||||||
|
*/
|
||||||
|
public interface FileStoreAdapter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件存储key,不包含桶名 bucketName
|
||||||
|
*
|
||||||
|
* @param fpxx 发票信息
|
||||||
|
* @param ext 文件扩展,如”.pdf“
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getObjectName(Map<String, Object> fpxx, String ext);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件名称
|
||||||
|
*
|
||||||
|
* @param fpxx 发票信息
|
||||||
|
* @param ext 文件扩展,如”.pdf“
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getFileName(Map<String, Object> fpxx, String ext);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理文件扩展名
|
||||||
|
*
|
||||||
|
* @param ext 文件扩展名
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
default String handleFileExtension(String ext) {
|
||||||
|
if (!StrUtil.startWith(ext, StrPool.DOT)) {
|
||||||
|
ext = StrPool.DOT + ext;
|
||||||
|
}
|
||||||
|
return ext;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package org.jeecg.common.util.store.adapter;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class SimpleFileStoreAdapter implements FileStoreAdapter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getObjectName(Map<String, Object> fpxx, String ext) {
|
||||||
|
|
||||||
|
String kprq = MapUtil.getStr(fpxx, "kprq");
|
||||||
|
String xsfnsrsbh = MapUtil.getStr(fpxx, "xsfNsrsbh");
|
||||||
|
|
||||||
|
DateTime date = DateUtil.parse(kprq, DatePattern.NORM_DATETIME_PATTERN);
|
||||||
|
String issueDate = DateUtil.format(date, DatePattern.PURE_DATE_PATTERN);
|
||||||
|
|
||||||
|
String fileName = this.getFileName(fpxx, ext);
|
||||||
|
//taxId + StrPool.SLASH + issueDate + StrPool.SLASH + fileName;
|
||||||
|
|
||||||
|
return StrUtil.format("{}/{}/{}", xsfnsrsbh, issueDate, fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFileName(Map<String, Object> fpxx, String ext) {
|
||||||
|
ext = this.handleFileExtension(ext);
|
||||||
|
|
||||||
|
String kprq = MapUtil.getStr(fpxx, "kprq");
|
||||||
|
String fphm = MapUtil.getStr(fpxx, "fpHm");
|
||||||
|
String gmfmc = MapUtil.getStr(fpxx, "gmfMc");
|
||||||
|
String sgfplx = MapUtil.getStr(fpxx, "sgfplxDm");
|
||||||
|
if (StrUtil.equals(sgfplx, "01")) {
|
||||||
|
gmfmc = MapUtil.getStr(fpxx, "xsfmc");
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime date = DateUtil.parse(kprq, DatePattern.NORM_DATETIME_PATTERN);
|
||||||
|
String issueDate = DateUtil.format(date, DatePattern.PURE_DATETIME_PATTERN);
|
||||||
|
|
||||||
|
// "dzfp" + StrPool.UNDERLINE + fphm + StrPool.UNDERLINE + gmfMc.trim() + StrPool.UNDERLINE + kprq + typeEnum.getCode() ;
|
||||||
|
|
||||||
|
return StrUtil.format("dzfp_{}_{}_{}{}", fphm, gmfmc, issueDate, ext);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package org.jeecg.config.mybatis;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
|
||||||
|
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.boot.starter.lock.client.RedissonLockClient;
|
||||||
|
import org.redisson.api.RLock;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在容器化部署的时候,idworker获取id会出现冲突,所以搞了一个基于redis获取workerid和dataCenterId的方法
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Configuration
|
||||||
|
public class IdGeneratorConfig {
|
||||||
|
|
||||||
|
private static final String TMS_REDIS_LOCK_PREFIX = "idworker:lock";
|
||||||
|
private static final String TMS_WORK_INCREMENT = "idworker:workid";
|
||||||
|
private static final String TMS_DATA_INCREMENT = "idworker:datacenterid";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisTemplate<String, String> redisTemplate;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
RedissonLockClient redissonLock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更换默认的idWorker
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public IdentifierGenerator defaultIdentifierGenerator() {
|
||||||
|
RLock lock = redissonLock.getLock(TMS_REDIS_LOCK_PREFIX);
|
||||||
|
try {
|
||||||
|
try {
|
||||||
|
lock.tryLock(15, 15, TimeUnit.SECONDS);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
log.error("获取workerid锁,出现问题", e);
|
||||||
|
}
|
||||||
|
long workerId = 0;
|
||||||
|
|
||||||
|
//redis中取值
|
||||||
|
String workerIdStr = redisTemplate.opsForValue().get(TMS_WORK_INCREMENT);
|
||||||
|
if (workerIdStr != null) {
|
||||||
|
workerId = Long.parseLong(workerIdStr);
|
||||||
|
} else {
|
||||||
|
workerId = redisTemplate.opsForValue().increment(TMS_WORK_INCREMENT, 1);
|
||||||
|
}
|
||||||
|
//判断值
|
||||||
|
Long dataCenterId = redisTemplate.opsForValue().increment(TMS_DATA_INCREMENT, 1);
|
||||||
|
if (dataCenterId > 31) {
|
||||||
|
dataCenterId = 0L;
|
||||||
|
redisTemplate.opsForValue().set(TMS_DATA_INCREMENT, String.valueOf(dataCenterId));
|
||||||
|
workerId = redisTemplate.opsForValue().increment(TMS_WORK_INCREMENT, 1);
|
||||||
|
if (workerId > 31) {
|
||||||
|
workerId = 0L;
|
||||||
|
redisTemplate.opsForValue().set(TMS_WORK_INCREMENT, String.valueOf(workerId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("Init IdentifierGenerator workId:{}, dataId:{}", workerId, dataCenterId);
|
||||||
|
return new DefaultIdentifierGenerator(workerId, dataCenterId);
|
||||||
|
} finally {
|
||||||
|
if (lock.isHeldByCurrentThread() && lock.isLocked()) {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -54,13 +54,17 @@ public class MybatisPlusSaasConfig {
|
||||||
//1.需要租户隔离的表请在此配置
|
//1.需要租户隔离的表请在此配置
|
||||||
if (MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
if (MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
||||||
//a.系统管理表
|
//a.系统管理表
|
||||||
TENANT_TABLE.add("sys_role");
|
// TENANT_TABLE.add("sys_role");
|
||||||
TENANT_TABLE.add("sys_user_role");
|
// TENANT_TABLE.add("sys_user_role");
|
||||||
TENANT_TABLE.add("sys_depart");
|
TENANT_TABLE.add("sys_depart");
|
||||||
TENANT_TABLE.add("sys_category");
|
TENANT_TABLE.add("sys_category");
|
||||||
//TENANT_TABLE.add("sys_data_source");
|
//TENANT_TABLE.add("sys_data_source");
|
||||||
TENANT_TABLE.add("sys_position");
|
TENANT_TABLE.add("sys_position");
|
||||||
TENANT_TABLE.add("sys_announcement");
|
TENANT_TABLE.add("sys_announcement");
|
||||||
|
// 以下为乐企SAAS配置 20240805
|
||||||
|
TENANT_TABLE.add("lqfw_qdfp_nsrjbxx");
|
||||||
|
TENANT_TABLE.add("lqfw_qdfp_fpxx");
|
||||||
|
TENANT_TABLE.add("lqfw_qdfp_hzjgb");
|
||||||
}
|
}
|
||||||
|
|
||||||
//2.示例测试
|
//2.示例测试
|
||||||
|
@ -105,7 +109,7 @@ public class MybatisPlusSaasConfig {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/*所有以cx_开头的 都开启租户模式*/
|
/*所有以cx_开头的 都开启租户模式*/
|
||||||
if(tableName.indexOf("cs_pt_")>-1){//平台
|
if(tableName.indexOf("cs_pt_")>-1){//平台
|
||||||
if(tableName.equalsIgnoreCase("cs_pt_city")){//省市县行政区划表
|
if(tableName.equalsIgnoreCase("cs_pt_city")){//省市县行政区划表
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -123,31 +127,31 @@ public class MybatisPlusSaasConfig {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(tableName.indexOf("cs_yus_")>-1){//预算
|
if(tableName.startsWith("cs_yus_")){//预算
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(tableName.indexOf("cs_ht_")>-1){//合同
|
if(tableName.startsWith("cs_ht_")){//合同
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(tableName.indexOf("cs_xx_")>-1){//销项
|
if(tableName.startsWith("cs_xx_")){//销项
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(tableName.indexOf("cs_ys_")>-1){//应收
|
if(tableName.startsWith("cs_ys_")){//应收
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(tableName.indexOf("cs_jx_")>-1){//进项
|
if(tableName.startsWith("cs_jx_")){//进项
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(tableName.indexOf("cs_fk_")>-1){//费控
|
if(tableName.startsWith("cs_fk_")){//费控
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(tableName.indexOf("cs_ss_")>-1){//算税
|
if(tableName.startsWith("cs_ss_")){//算税
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(tableName.indexOf("cs_bs_")>-1){//报税
|
if(tableName.startsWith("cs_bs_")){//报税
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(tableName.indexOf("cs_da_")>-1){//档案
|
if(tableName.startsWith("cs_da_")){//档案
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.jeecg.config.shiro;
|
package org.jeecg.config.shiro;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.shiro.authc.AuthenticationException;
|
import org.apache.shiro.authc.AuthenticationException;
|
||||||
import org.apache.shiro.authc.AuthenticationInfo;
|
import org.apache.shiro.authc.AuthenticationInfo;
|
||||||
|
@ -100,7 +101,7 @@ public class ShiroRealm extends AuthorizingRealm {
|
||||||
}
|
}
|
||||||
String username=JwtUtil.getUsername(token);
|
String username=JwtUtil.getUsername(token);
|
||||||
//通过username判断用户来源
|
//通过username判断用户来源
|
||||||
if(username.startsWith(CommonConstant.API)){//api接口获取的token
|
if(StrUtil.startWith(username, CommonConstant.API)){//api接口获取的token
|
||||||
String cacheToken = String.valueOf(redisUtil.get(CommonConstant.PREFIX_USER_TOKEN + token));
|
String cacheToken = String.valueOf(redisUtil.get(CommonConstant.PREFIX_USER_TOKEN + token));
|
||||||
if (oConvertUtils.isNotEmpty(cacheToken)) {
|
if (oConvertUtils.isNotEmpty(cacheToken)) {
|
||||||
if(!cacheToken.equals(token)){
|
if(!cacheToken.equals(token)){
|
||||||
|
@ -137,7 +138,7 @@ public class ShiroRealm extends AuthorizingRealm {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询用户信息
|
// 查询用户信息
|
||||||
log.debug("———校验token是否有效————checkUserTokenIsEffect——————— "+ token);
|
log.debug("———校验token是否有效————checkUserTokenIsEffect——————— {}", token);
|
||||||
LoginUser loginUser = TokenUtils.getLoginUser(username, commonApi, redisUtil);
|
LoginUser loginUser = TokenUtils.getLoginUser(username, commonApi, redisUtil);
|
||||||
//LoginUser loginUser = commonApi.getUserByName(username);
|
//LoginUser loginUser = commonApi.getUserByName(username);
|
||||||
if (loginUser == null) {
|
if (loginUser == null) {
|
||||||
|
@ -155,8 +156,8 @@ public class ShiroRealm extends AuthorizingRealm {
|
||||||
String userTenantIds = loginUser.getRelTenantIds();
|
String userTenantIds = loginUser.getRelTenantIds();
|
||||||
if(oConvertUtils.isNotEmpty(userTenantIds)){
|
if(oConvertUtils.isNotEmpty(userTenantIds)){
|
||||||
String contextTenantId = TenantContext.getTenant();
|
String contextTenantId = TenantContext.getTenant();
|
||||||
log.debug("登录租户:" + contextTenantId);
|
log.debug("登录租户:{}", contextTenantId);
|
||||||
log.debug("用户拥有那些租户:" + userTenantIds);
|
log.debug("用户拥有那些租户:{}", userTenantIds);
|
||||||
//登录用户无租户,前端header中租户ID值为 0
|
//登录用户无租户,前端header中租户ID值为 0
|
||||||
String str ="0";
|
String str ="0";
|
||||||
if(oConvertUtils.isNotEmpty(contextTenantId) && !str.equals(contextTenantId)){
|
if(oConvertUtils.isNotEmpty(contextTenantId) && !str.equals(contextTenantId)){
|
||||||
|
@ -179,8 +180,8 @@ public class ShiroRealm extends AuthorizingRealm {
|
||||||
|
|
||||||
//*********************************************
|
//*********************************************
|
||||||
if(!isAuthorization){
|
if(!isAuthorization){
|
||||||
log.info("租户异常——登录租户:" + contextTenantId);
|
log.info("租户异常——登录租户:{}", contextTenantId);
|
||||||
log.info("租户异常——用户拥有租户组:" + userTenantIds);
|
log.info("租户异常——用户拥有租户组:{}", userTenantIds);
|
||||||
throw new AuthenticationException("登录租户授权变更,请重新登陆!");
|
throw new AuthenticationException("登录租户授权变更,请重新登陆!");
|
||||||
}
|
}
|
||||||
//*********************************************
|
//*********************************************
|
||||||
|
@ -214,7 +215,7 @@ public class ShiroRealm extends AuthorizingRealm {
|
||||||
// 设置超时时间
|
// 设置超时时间
|
||||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, newAuthorization);
|
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, newAuthorization);
|
||||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME *2 / 1000);
|
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME *2 / 1000);
|
||||||
log.debug("——————————用户在线操作,更新token保证不掉线—————————jwtTokenRefresh——————— "+ token);
|
log.debug("——————————用户在线操作,更新token保证不掉线—————————jwtTokenRefresh——————— {}", token);
|
||||||
}
|
}
|
||||||
//update-begin--Author:scott Date:20191005 for:解决每次请求,都重写redis中 token缓存问题
|
//update-begin--Author:scott Date:20191005 for:解决每次请求,都重写redis中 token缓存问题
|
||||||
// else {
|
// else {
|
||||||
|
|
|
@ -6,10 +6,8 @@ import org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter;
|
||||||
import org.jeecg.common.config.TenantContext;
|
import org.jeecg.common.config.TenantContext;
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
import org.jeecg.common.system.util.JwtUtil;
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
import org.jeecg.common.util.RedisUtil;
|
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.jeecg.config.shiro.JwtToken;
|
import org.jeecg.config.shiro.JwtToken;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -29,9 +27,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
@Component
|
@Component
|
||||||
public class JwtFilter extends BasicHttpAuthenticationFilter {
|
public class JwtFilter extends BasicHttpAuthenticationFilter {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认开启跨域设置(使用单体)
|
* 默认开启跨域设置(使用单体)
|
||||||
* 微服务情况下,此属性设置为false
|
* 微服务情况下,此属性设置为false
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
|
||||||
<jeecgboot.version>3.5.3</jeecgboot.version>
|
<jeecgboot.version>3.5.3</jeecgboot.version>
|
||||||
|
<jeecg-nacos.version>2.2.3</jeecg-nacos.version>
|
||||||
<!-- 积木报表-->
|
<!-- 积木报表-->
|
||||||
<jimureport-spring-boot-starter.version>1.6.6</jimureport-spring-boot-starter.version>
|
<jimureport-spring-boot-starter.version>1.6.6</jimureport-spring-boot-starter.version>
|
||||||
<aviator.version>5.4.1</aviator.version>
|
<aviator.version>5.4.1</aviator.version>
|
||||||
|
@ -25,6 +26,39 @@
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- jeecg nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.nacos</groupId>
|
||||||
|
<artifactId>nacos-naming</artifactId>
|
||||||
|
<version>${jeecg-nacos.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>*</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.nacos</groupId>
|
||||||
|
<artifactId>nacos-istio</artifactId>
|
||||||
|
<version>${jeecg-nacos.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.nacos</groupId>
|
||||||
|
<artifactId>nacos-config</artifactId>
|
||||||
|
<version>${jeecg-nacos.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>*</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.nacos</groupId>
|
||||||
|
<artifactId>nacos-console</artifactId>
|
||||||
|
<version>${jeecg-nacos.version}</version>
|
||||||
|
</dependency>
|
||||||
<!-- jeecg tools -->
|
<!-- jeecg tools -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.boot</groupId>
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
|
|
@ -90,8 +90,9 @@
|
||||||
<qiniu-java-sdk.version>7.4.0</qiniu-java-sdk.version>
|
<qiniu-java-sdk.version>7.4.0</qiniu-java-sdk.version>
|
||||||
<!-- Log4j2爆雷漏洞 -->
|
<!-- Log4j2爆雷漏洞 -->
|
||||||
<log4j.version>1.2.17</log4j.version>
|
<log4j.version>1.2.17</log4j.version>
|
||||||
<log4j2.version>2.17.2</log4j2.version>
|
<log4j2.version>2.24.2</log4j2.version>
|
||||||
<logback.version>1.2.12</logback.version>
|
<logback.version>1.3.14</logback.version>
|
||||||
|
<slf4j.version>1.7.36</slf4j.version>
|
||||||
|
|
||||||
<!-- 链路追踪 -->
|
<!-- 链路追踪 -->
|
||||||
<transmittable.version>2.14.2</transmittable.version>
|
<transmittable.version>2.14.2</transmittable.version>
|
||||||
|
@ -543,6 +544,16 @@
|
||||||
<artifactId>log4j</artifactId>
|
<artifactId>log4j</artifactId>
|
||||||
<version>${log4j.version}</version>
|
<version>${log4j.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-core</artifactId>
|
||||||
|
<version>${logback.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-classic</artifactId>
|
||||||
|
<version>${logback.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 接口文档依赖 begin -->
|
<!-- 接口文档依赖 begin -->
|
||||||
<!-- knife4j -->
|
<!-- knife4j -->
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package org.jeecg.modules.common.util;
|
package org.jeecg.modules.common.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,4 +92,16 @@ public class MathUtil {
|
||||||
return b1.divide(b2,scale,BigDecimal.ROUND_HALF_UP).doubleValue();
|
return b1.divide(b2,scale,BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public static boolean equalsAny(BigDecimal b1, BigDecimal... bigDecimals) {
|
||||||
|
if (ArrayUtil.isEmpty(bigDecimals)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
for (BigDecimal bigDecimal : bigDecimals) {
|
||||||
|
if(NumberUtil.equals(b1, bigDecimal)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,178 @@
|
||||||
|
package org.jeecg.modules.cssz.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.cssz.entity.CsPtCssz;
|
||||||
|
import org.jeecg.modules.cssz.service.CsPtCsszService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 系统设置表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-01-02
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags = "系统设置表")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pt/cssz/csPtCssz")
|
||||||
|
@Slf4j
|
||||||
|
public class CsPtCsszController extends JeecgController<CsPtCssz, CsPtCsszService> {
|
||||||
|
|
||||||
|
final CsPtCsszService csPtCsszService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param csPtCssz
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "系统设置表-分页列表查询")
|
||||||
|
@ApiOperation(value = "系统设置表-分页列表查询", notes = "系统设置表-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<CsPtCssz>> queryPageList(CsPtCssz csPtCssz,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<CsPtCssz> queryWrapper = QueryGenerator.initQueryWrapper(csPtCssz, req.getParameterMap());
|
||||||
|
Page<CsPtCssz> page = new Page<CsPtCssz>(pageNo, pageSize);
|
||||||
|
IPage<CsPtCssz> pageList = csPtCsszService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param csPtCssz
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "系统设置表-添加")
|
||||||
|
@ApiOperation(value = "系统设置表-添加", notes = "系统设置表-添加")
|
||||||
|
@RequiresPermissions("pt.cssz:cs_pt_cssz:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody CsPtCssz csPtCssz) {
|
||||||
|
csPtCsszService.save(csPtCssz);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "系统设置表-批量添加")
|
||||||
|
@ApiOperation(value = "系统设置表-批量添加", notes = "系统设置表-批量添加")
|
||||||
|
@RequiresPermissions("pt.cssz:cs_pt_cssz:addall")
|
||||||
|
@PostMapping(value = "/addAll")
|
||||||
|
public Result<String> addAll(@RequestBody List<CsPtCssz> csPtCsszs) {
|
||||||
|
if (!csPtCsszs.isEmpty()) {
|
||||||
|
for (CsPtCssz csPtCssz : csPtCsszs) {
|
||||||
|
csPtCsszService.save(csPtCssz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.OK("批量添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param csPtCssz
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "系统设置表-编辑")
|
||||||
|
@ApiOperation(value = "系统设置表-编辑", notes = "系统设置表-编辑")
|
||||||
|
@RequiresPermissions("pt.cssz:cs_pt_cssz:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody CsPtCssz csPtCssz) {
|
||||||
|
csPtCsszService.updateById(csPtCssz);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "系统设置表-通过id删除")
|
||||||
|
@ApiOperation(value = "系统设置表-通过id删除", notes = "系统设置表-通过id删除")
|
||||||
|
@RequiresPermissions("pt.cssz:cs_pt_cssz:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
csPtCsszService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "系统设置表-批量删除")
|
||||||
|
@ApiOperation(value = "系统设置表-批量删除", notes = "系统设置表-批量删除")
|
||||||
|
@RequiresPermissions("pt.cssz:cs_pt_cssz:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.csPtCsszService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "系统设置表-通过id查询")
|
||||||
|
@ApiOperation(value = "系统设置表-通过id查询", notes = "系统设置表-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<CsPtCssz> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
CsPtCssz csPtCssz = csPtCsszService.getById(id);
|
||||||
|
if (csPtCssz == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(csPtCssz);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param csPtCssz
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("pt.cssz:cs_pt_cssz:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, CsPtCssz csPtCssz) {
|
||||||
|
return super.exportXls(request, csPtCssz, CsPtCssz.class, "系统设置表");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("pt.cssz:cs_pt_cssz:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, CsPtCssz.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,121 @@
|
||||||
|
package org.jeecg.modules.cssz.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 系统设置表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-01-02
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("cs_pt_cssz")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "cs_pt_cssz对象", description = "系统设置表")
|
||||||
|
public class CsPtCssz implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "所属部门")
|
||||||
|
private String sysOrgCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户编号
|
||||||
|
*/
|
||||||
|
@Excel(name = "租户编号", width = 15)
|
||||||
|
@ApiModelProperty(value = "租户编号")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数类型
|
||||||
|
*/
|
||||||
|
@Excel(name = "参数类型", width = 15)
|
||||||
|
@ApiModelProperty(value = "参数类型")
|
||||||
|
private String cslx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模块类型
|
||||||
|
*/
|
||||||
|
@Excel(name = "模块类型", width = 15)
|
||||||
|
@ApiModelProperty(value = "模块类型")
|
||||||
|
private String mklx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "参数名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "参数名称")
|
||||||
|
private String csmc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数值
|
||||||
|
*/
|
||||||
|
@Excel(name = "参数值", width = 15)
|
||||||
|
@ApiModelProperty(value = "参数值")
|
||||||
|
private String csz;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数类型
|
||||||
|
*/
|
||||||
|
@Excel(name = "参数类型", width = 15)
|
||||||
|
@ApiModelProperty(value = "参数类型")
|
||||||
|
private String cstype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数描述
|
||||||
|
*/
|
||||||
|
@Excel(name = "参数描述", width = 15)
|
||||||
|
@ApiModelProperty(value = "参数描述")
|
||||||
|
private String csms;
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.cssz.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.cssz.entity.CsPtCssz;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 系统设置表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-01-02
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface CsPtCsszMapper extends BaseMapper<CsPtCssz> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.cssz.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.cssz.entity.CsPtCssz;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 系统设置表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-01-02
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface CsPtCsszService extends IService<CsPtCssz> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.modules.cssz.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.cssz.entity.CsPtCssz;
|
||||||
|
import org.jeecg.modules.cssz.mapper.CsPtCsszMapper;
|
||||||
|
import org.jeecg.modules.cssz.service.CsPtCsszService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 系统设置表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-01-02
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CsPtCsszServiceImpl extends ServiceImpl<CsPtCsszMapper, CsPtCssz> implements CsPtCsszService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package org.jeecg.modules.tax.xxgx.spgl.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 税收分类编码
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-09-18
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("cs_pb_code")
|
||||||
|
@ApiModel(value="cs_pb_code对象", description="税收分类编码")
|
||||||
|
public class CsPbCode implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private String id;
|
||||||
|
/**分类编码*/
|
||||||
|
@Excel(name = "合并编码", width = 15)
|
||||||
|
@ApiModelProperty(value = "分类编码")
|
||||||
|
private String code;
|
||||||
|
/**上级*/
|
||||||
|
@Excel(name = "上级", width = 15)
|
||||||
|
@ApiModelProperty(value = "上级")
|
||||||
|
private String pid;
|
||||||
|
/**分类名称*/
|
||||||
|
@Excel(name = "货物和劳务名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "分类名称")
|
||||||
|
private String name;
|
||||||
|
/**特殊项*/
|
||||||
|
@Excel(name = "增值税特殊管理", width = 15)
|
||||||
|
@ApiModelProperty(value = "特殊项")
|
||||||
|
private String special;
|
||||||
|
/**税率*/
|
||||||
|
@Excel(name = "增值税税率", width = 15)
|
||||||
|
@ApiModelProperty(value = "税率")
|
||||||
|
private String tax;
|
||||||
|
/**分类简称*/
|
||||||
|
@Excel(name = "商品和服务分类简称", width = 15)
|
||||||
|
@ApiModelProperty(value = "分类简称")
|
||||||
|
private String shortName;
|
||||||
|
/**是否有子节点*/
|
||||||
|
@Excel(name = "是否汇总项", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否有子节点")
|
||||||
|
private String hasChild;
|
||||||
|
/** 编码说明 */
|
||||||
|
@Excel(name = "说明", width = 15)
|
||||||
|
@ApiModelProperty(value = "分类说明")
|
||||||
|
private String flsm;
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package org.jeecg.modules.tax.xxgx.spgl.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.tax.xxgx.spgl.entity.CsPbCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 税收分类编码
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-09-18
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface CsPbCodeMapper extends BaseMapper<CsPbCode> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package org.jeecg.modules.tax.xxgx.spgl.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.tax.xxgx.spgl.entity.CsPbCode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CsPbCodeService extends IService<CsPbCode> {
|
||||||
|
|
||||||
|
void syncData(CsPbCode csPbCode);
|
||||||
|
|
||||||
|
void syncData(List<CsPbCode> list);
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package org.jeecg.modules.tax.xxgx.spgl.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
|
import org.jeecg.modules.tax.xxgx.spgl.entity.CsPbCode;
|
||||||
|
import org.jeecg.modules.tax.xxgx.spgl.mapper.CsPbCodeMapper;
|
||||||
|
import org.jeecg.modules.tax.xxgx.spgl.service.CsPbCodeService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class CsPbCodeServiceImpl extends ServiceImpl<CsPbCodeMapper, CsPbCode> implements CsPbCodeService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS(CommonConstant.DS_CWGX)
|
||||||
|
public void syncData(CsPbCode csPbCode) {
|
||||||
|
List<CsPbCode> list = this.lambdaQuery()
|
||||||
|
.eq(CsPbCode::getCode, csPbCode.getCode())
|
||||||
|
.list();
|
||||||
|
for (CsPbCode item : list) {
|
||||||
|
csPbCode.setId(item.getId());
|
||||||
|
this.updateById(csPbCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS(CommonConstant.DS_CWGX)
|
||||||
|
public void syncData(List<CsPbCode> list) {
|
||||||
|
List<CsPbCode> updateList = new ArrayList<>();
|
||||||
|
List<CsPbCode> insertList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (CsPbCode item : list) {
|
||||||
|
CsPbCode one = this.lambdaQuery()
|
||||||
|
.eq(CsPbCode::getCode, item.getCode())
|
||||||
|
.one();
|
||||||
|
|
||||||
|
if (one != null) {
|
||||||
|
item.setId(one.getId());
|
||||||
|
updateList.add(item);
|
||||||
|
} else {
|
||||||
|
item.setId(IdUtil.getSnowflakeNextIdStr());
|
||||||
|
insertList.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(updateList)) {
|
||||||
|
this.updateBatchById(updateList);
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(insertList)) {
|
||||||
|
this.saveBatch(insertList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package org.jeecg.modules.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import org.jeecg.common.config.TenantContext;
|
||||||
|
import org.jeecg.common.util.SpringContextHolder;
|
||||||
|
import org.jeecg.modules.cssz.entity.CsPtCssz;
|
||||||
|
import org.jeecg.modules.cssz.service.CsPtCsszService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统参数工具类
|
||||||
|
*/
|
||||||
|
public class XtcsUtil {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统参数设置
|
||||||
|
*
|
||||||
|
* @param csmc
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getCssz(String csmc) {
|
||||||
|
return getCssz(csmc, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统参数设置
|
||||||
|
*
|
||||||
|
* @param csmc
|
||||||
|
* @param defaultValue
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getCssz(String csmc, String defaultValue) {
|
||||||
|
String tenantId = TenantContext.getTenant();
|
||||||
|
boolean isSystem = StrUtil.isBlank(tenantId) || StrUtil.equals(tenantId, "0");
|
||||||
|
|
||||||
|
final CsPtCsszService csPtCsszService = SpringContextHolder.getBean(CsPtCsszService.class);
|
||||||
|
CsPtCssz csPtCssz = csPtCsszService.lambdaQuery().
|
||||||
|
eq(CsPtCssz::getCsmc, csmc)
|
||||||
|
.and(isSystem, i -> i
|
||||||
|
.eq(CsPtCssz::getTenantId, 0)
|
||||||
|
.or()
|
||||||
|
.isNull(CsPtCssz::getTenantId)
|
||||||
|
)
|
||||||
|
.one();
|
||||||
|
|
||||||
|
if (csPtCssz == null || StrUtil.isBlank(csPtCssz.getCsz())) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return csPtCssz.getCsz();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
||||||
|
<artifactId>jeecg-module-deliver</artifactId>
|
||||||
|
<version>3.5.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>jeecg-deliver-byd</artifactId>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,58 @@
|
||||||
|
package org.jeecg.modules.deliver.byd.adapter;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.text.StrPool;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.util.store.adapter.FileStoreAdapter;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Component
|
||||||
|
public class BydFileStoreAdapter implements FileStoreAdapter {
|
||||||
|
|
||||||
|
|
||||||
|
@Value(value = "${jeecg.ossPrefix:}")
|
||||||
|
private String ossPrefix;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getObjectName(Map<String, Object> fpxx, String ext) {
|
||||||
|
// 环境(prod/test)/年月/xxfp/税号/业务类型_发票号码_时间.文件类型
|
||||||
|
|
||||||
|
DateTime now = DateUtil.date();
|
||||||
|
String yearMonth = DateUtil.format(now, DatePattern.SIMPLE_MONTH_PATTERN);
|
||||||
|
|
||||||
|
String xsfnsrsbh = MapUtil.getStr(fpxx, "xsfNsrsbh");
|
||||||
|
String fileName = this.getFileName(fpxx, ext);
|
||||||
|
|
||||||
|
String prefix = this.ossPrefix;
|
||||||
|
if (StrUtil.isNotBlank(prefix)){
|
||||||
|
prefix += StrPool.SLASH;
|
||||||
|
}
|
||||||
|
|
||||||
|
return StrUtil.format("{}{}/xxfp/{}/{}", prefix, yearMonth, xsfnsrsbh, fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFileName(Map<String, Object> fpxx, String ext) {
|
||||||
|
ext = this.handleFileExtension(ext);
|
||||||
|
|
||||||
|
// 业务类型_发票号码_时间.文件类型
|
||||||
|
String fplx = MapUtil.getStr(fpxx, "fplx");
|
||||||
|
String fphm = MapUtil.getStr(fpxx, "fpHm");
|
||||||
|
String kprq = MapUtil.getStr(fpxx, "kprq");
|
||||||
|
DateTime date = DateUtil.parse(kprq, DatePattern.NORM_DATETIME_PATTERN);
|
||||||
|
String issueDate = DateUtil.format(date, DatePattern.PURE_DATETIME_PATTERN);
|
||||||
|
|
||||||
|
|
||||||
|
return StrUtil.format("{}_{}_{}{}", fplx, fphm, issueDate, ext);
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,17 +11,4 @@
|
||||||
|
|
||||||
<artifactId>jeecg-deliver-zyzx</artifactId>
|
<artifactId>jeecg-deliver-zyzx</artifactId>
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
|
||||||
<artifactId>com.foresee.lqfw.sdk</artifactId>
|
|
||||||
<version>${jeecgboot.version}</version>
|
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>
|
|
||||||
${pom.basedir}/../../lib/com.foresee.lqfw.sdk-3.5.3.jar
|
|
||||||
</systemPath>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -51,4 +51,9 @@ public interface CmosConstants {
|
||||||
* 红字确认单明细下载
|
* 红字确认单明细下载
|
||||||
*/
|
*/
|
||||||
String HZQRD_MXXZ = "hzqrdmxxz";
|
String HZQRD_MXXZ = "hzqrdmxxz";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票回填失败重试
|
||||||
|
*/
|
||||||
|
String FPHTSBCS = "fphtsbcs";
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,18 +19,17 @@ public class CmosTaskController {
|
||||||
* <p>地址示例:发票上传任务 /cmos/task/fpsc</p>
|
* <p>地址示例:发票上传任务 /cmos/task/fpsc</p>
|
||||||
*
|
*
|
||||||
* @param type 任务类型
|
* @param type 任务类型
|
||||||
* @param sn 调度发出请求时自动生成的唯一编码
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("{type}")
|
@GetMapping("{type}")
|
||||||
public CsfResponse execute(@PathVariable("type") String type, @RequestHeader(value = "sn", required = false) String sn) {
|
public CsfResponse execute(@PathVariable("type") String type) {
|
||||||
|
|
||||||
CsfResponse response = new CsfResponse();
|
CsfResponse response = new CsfResponse();
|
||||||
response.setRtnCode(CsfResponse.RTN_CODE.SUCCESS);
|
response.setRtnCode(CsfResponse.RTN_CODE.SUCCESS);
|
||||||
response.setRtnMsg(CsfResponse.RTN_MSG.SUCCESS);
|
response.setRtnMsg(CsfResponse.RTN_MSG.SUCCESS);
|
||||||
|
|
||||||
// 业务逻辑处理
|
// 业务逻辑处理
|
||||||
this.cmosTaskService.execute(type, sn);
|
this.cmosTaskService.execute(type);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,7 @@ public interface CmosTaskService {
|
||||||
* 执行调度任务
|
* 执行调度任务
|
||||||
*
|
*
|
||||||
* @param type 任务类型
|
* @param type 任务类型
|
||||||
* @param sn 调度发出请求时自动生成的唯一编码
|
|
||||||
*/
|
*/
|
||||||
void execute(String type, String sn);
|
void execute(String type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@ import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.modules.common.util.ThreadExecutorsUtil;
|
import org.jeecg.modules.common.util.ThreadExecutorsUtil;
|
||||||
import org.jeecg.modules.deliver.cmos.job.service.CmosTaskService;
|
|
||||||
import org.jeecg.modules.deliver.cmos.job.CmosTask;
|
import org.jeecg.modules.deliver.cmos.job.CmosTask;
|
||||||
|
import org.jeecg.modules.deliver.cmos.job.service.CmosTaskService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -20,8 +20,8 @@ public class CmosTaskServiceImpl implements CmosTaskService {
|
||||||
final List<CmosTask> taskList;
|
final List<CmosTask> taskList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(final String type, String sn) {
|
public void execute(final String type) {
|
||||||
log.info("任务调度流水号:{}", sn);
|
log.info("任务调度:{}", type);
|
||||||
Optional<CmosTask> optional = this.taskList.stream()
|
Optional<CmosTask> optional = this.taskList.stream()
|
||||||
.filter(it -> StrUtil.equals(it.getType(), type))
|
.filter(it -> StrUtil.equals(it.getType(), type))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>jeecg-deliver-zyzx</module>
|
<module>jeecg-deliver-zyzx</module>
|
||||||
|
<module>jeecg-deliver-byd</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -26,6 +27,11 @@
|
||||||
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
||||||
<artifactId>jeecg-system-biz</artifactId>
|
<artifactId>jeecg-system-biz</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
||||||
|
<artifactId>jeecg-module-lqfw</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
|
|
@ -19,6 +19,6 @@ public interface SysMessageTemplateMapper extends BaseMapper<SysMessageTemplate>
|
||||||
* @param code 模板CODE
|
* @param code 模板CODE
|
||||||
* @return List<SysMessageTemplate>
|
* @return List<SysMessageTemplate>
|
||||||
*/
|
*/
|
||||||
@Select("SELECT * FROM SYS_SMS_TEMPLATE WHERE TEMPLATE_CODE = #{code}")
|
@Select("select * from sys_sms_template where template_code = #{code}")
|
||||||
List<SysMessageTemplate> selectByCode(String code);
|
List<SysMessageTemplate> selectByCode(String code);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,8 +69,8 @@ public class SysJobListener implements JobListener {
|
||||||
csPtJobLog.setMessage(message);
|
csPtJobLog.setMessage(message);
|
||||||
|
|
||||||
logService.save(csPtJobLog);
|
logService.save(csPtJobLog);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ex) {
|
||||||
|
log.error("调度执行记录插入失败:",ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
package org.jeecg.modules.sync;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
||||||
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||||
|
import org.jeecg.common.util.SpringContextHolder;
|
||||||
|
import org.jeecg.modules.sync.service.CwgxSyncDataService;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
public class CwgxDataHandler {
|
||||||
|
|
||||||
|
public static final String DS_NAME = "cwgx";
|
||||||
|
|
||||||
|
|
||||||
|
public static <T> T handle(Supplier<T> supplier) {
|
||||||
|
T result = null;
|
||||||
|
DynamicRoutingDataSource dataSource = SpringContextHolder.getBean(DynamicRoutingDataSource.class);
|
||||||
|
if (dataSource.getCurrentDataSources().containsKey(DS_NAME)) {
|
||||||
|
try {
|
||||||
|
DynamicDataSourceContextHolder.push(DS_NAME);
|
||||||
|
result = supplier.get();
|
||||||
|
} finally {
|
||||||
|
DynamicDataSourceContextHolder.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T handleAndSync(Supplier<T> supplier) {
|
||||||
|
T result = supplier.get();
|
||||||
|
if (isEmpty(result)) {
|
||||||
|
result = handle(supplier);
|
||||||
|
|
||||||
|
if (isNotEmpty(result)) {
|
||||||
|
CwgxSyncDataService cwgxSyncDataService = SpringContextHolder.getBean(CwgxSyncDataService.class);
|
||||||
|
cwgxSyncDataService.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T handleAndSync(String username, Supplier<T> supplier) {
|
||||||
|
T result = supplier.get();
|
||||||
|
if (isEmpty(result)) {
|
||||||
|
result = handle(supplier);
|
||||||
|
|
||||||
|
if (isNotEmpty(result)) {
|
||||||
|
CwgxSyncDataService cwgxSyncDataService = SpringContextHolder.getBean(CwgxSyncDataService.class);
|
||||||
|
cwgxSyncDataService.executeByUsername(username);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static <T> boolean isEmpty(T val) {
|
||||||
|
if (val instanceof Iterable) {
|
||||||
|
return CollectionUtil.isEmpty((Iterable<?>) val);
|
||||||
|
} else if (val instanceof Map) {
|
||||||
|
return CollectionUtil.isEmpty((Map<?, ?>) val);
|
||||||
|
}
|
||||||
|
return val == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static <T> boolean isNotEmpty(T val) {
|
||||||
|
if (val instanceof Iterable) {
|
||||||
|
return CollectionUtil.isNotEmpty((Iterable<?>) val);
|
||||||
|
} else if (val instanceof Map) {
|
||||||
|
return CollectionUtil.isNotEmpty((Map<?, ?>) val);
|
||||||
|
}
|
||||||
|
return val != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package org.jeecg.modules.sync.job;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.util.SpringContextHolder;
|
||||||
|
import org.jeecg.modules.common.util.ThreadExecutorsUtil;
|
||||||
|
import org.jeecg.modules.sync.service.SyncDataService;
|
||||||
|
import org.quartz.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@PersistJobDataAfterExecution
|
||||||
|
@DisallowConcurrentExecution
|
||||||
|
public class SyncDataTask implements Job {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||||
|
|
||||||
|
final Map<String, SyncDataService> syncDataServices = SpringContextHolder.getApplicationContext()
|
||||||
|
.getBeansOfType(SyncDataService.class);
|
||||||
|
for(Map.Entry<String, SyncDataService> entry : syncDataServices.entrySet()){
|
||||||
|
SyncDataService syncDataService = entry.getValue();
|
||||||
|
CompletableFuture.runAsync(()->{
|
||||||
|
try {
|
||||||
|
syncDataService.execute();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("{}[{}]异常:{}", syncDataService.getName(), entry.getKey(), e.getMessage());
|
||||||
|
}
|
||||||
|
}, ThreadExecutorsUtil.executor);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,237 @@
|
||||||
|
package org.jeecg.modules.sync.service;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.util.SpringContextHolder;
|
||||||
|
import org.jeecg.modules.sync.CwgxDataHandler;
|
||||||
|
import org.jeecg.modules.system.entity.*;
|
||||||
|
import org.jeecg.modules.system.mapper.SysDepartMapper;
|
||||||
|
import org.jeecg.modules.system.mapper.SysTenantMapper;
|
||||||
|
import org.jeecg.modules.system.mapper.SysUserMapper;
|
||||||
|
import org.jeecg.modules.system.service.ISysRoleService;
|
||||||
|
import org.jeecg.modules.system.service.ISysUserDepartService;
|
||||||
|
import org.jeecg.modules.system.service.ISysUserRoleService;
|
||||||
|
import org.jeecg.modules.system.service.ISysUserTenantService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 慧税组织架构数据同步
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class CwgxSyncDataService implements SyncDataService {
|
||||||
|
|
||||||
|
public static final Integer MAX_PAGE_SIZE = 500;
|
||||||
|
public static final String ROLE_ADMIN = "lqadmin";
|
||||||
|
public static final String ROLE_USER = "lquser";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "F7慧税组织架构数据同步";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
// 租户
|
||||||
|
this.syncTenant(entity -> {
|
||||||
|
});
|
||||||
|
// 部门
|
||||||
|
this.syncDepart(entity -> {
|
||||||
|
});
|
||||||
|
// 人员
|
||||||
|
List<SysUser> userList = this.syncUser(entity -> {
|
||||||
|
});
|
||||||
|
for (SysUser user : userList) {
|
||||||
|
// 人员部门
|
||||||
|
this.syncUserDepart(wrapper -> {
|
||||||
|
wrapper.eq(SysUserDepart::getUserId, user.getId());
|
||||||
|
});
|
||||||
|
// 人员租户
|
||||||
|
this.syncUserTenant(wrapper -> {
|
||||||
|
wrapper.eq(SysUserTenant::getUserId, user.getId());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void executeByUsername(String username) {
|
||||||
|
if(StrUtil.isBlank(username)) return;
|
||||||
|
// 人员
|
||||||
|
List<SysUser> userList = this.syncUser(entity -> entity.setUsername(username));
|
||||||
|
for (SysUser user : userList) {
|
||||||
|
String userId = user.getId();
|
||||||
|
|
||||||
|
// 人员租户
|
||||||
|
List<SysUserTenant> userTenantList = this.syncUserTenant(wrapper -> wrapper.eq(SysUserTenant::getUserId, userId));
|
||||||
|
|
||||||
|
// 租户
|
||||||
|
if (CollectionUtil.isNotEmpty(userTenantList)) {
|
||||||
|
for (SysUserTenant userTenant : userTenantList) {
|
||||||
|
this.syncTenant(entity -> entity.setId(userTenant.getTenantId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 人员部门
|
||||||
|
List<SysUserDepart> userDepartList = this.syncUserDepart(wrapper -> wrapper.eq(SysUserDepart::getUserId, userId));
|
||||||
|
|
||||||
|
// 部门
|
||||||
|
if (CollectionUtil.isNotEmpty(userDepartList)) {
|
||||||
|
for (SysUserDepart userDepart : userDepartList) {
|
||||||
|
this.syncDepart(entity -> entity.setId(userDepart.getDepId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<SysTenant> syncTenant(Consumer<SysTenant> consumer) {
|
||||||
|
SysTenantMapper tenantMapper = SpringContextHolder.getBean(SysTenantMapper.class);
|
||||||
|
SysTenant query = new SysTenant();
|
||||||
|
consumer.accept(query);
|
||||||
|
List<SysTenant> list = CwgxDataHandler.handle(() -> tenantMapper.selectIgnoreLogicDelete(query));
|
||||||
|
|
||||||
|
for (SysTenant item : list){
|
||||||
|
SysTenant one = tenantMapper.selectIgnoreLogicDeleteById(item.getId());
|
||||||
|
|
||||||
|
if (one != null) {
|
||||||
|
tenantMapper.updateIgnoreLogicDeleteById(item);
|
||||||
|
}else{
|
||||||
|
tenantMapper.insertIgnoreLogicDelete(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<SysDepart> syncDepart(Consumer<SysDepart> consumer) {
|
||||||
|
SysDepartMapper departMapper = SpringContextHolder.getBean(SysDepartMapper.class);
|
||||||
|
SysDepart query = new SysDepart();
|
||||||
|
consumer.accept(query);
|
||||||
|
List<SysDepart> list = CwgxDataHandler.handle(() -> departMapper.selectIgnoreLogicDelete(query));
|
||||||
|
|
||||||
|
for (SysDepart item : list){
|
||||||
|
SysDepart one = departMapper.selectIgnoreLogicDeleteById(item.getId());
|
||||||
|
|
||||||
|
if (one != null) {
|
||||||
|
departMapper.updateIgnoreLogicDeleteById(item);
|
||||||
|
}else{
|
||||||
|
departMapper.insertIgnoreLogicDelete(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<SysUser> syncUser(Consumer<SysUser> consumer) {
|
||||||
|
SysUserMapper userMapper = SpringContextHolder.getBean(SysUserMapper.class);
|
||||||
|
ISysRoleService roleService = SpringContextHolder.getBean(ISysRoleService.class);
|
||||||
|
ISysUserRoleService userRoleService = SpringContextHolder.getBean(ISysUserRoleService.class);
|
||||||
|
|
||||||
|
List<SysRole> roleList = roleService.lambdaQuery()
|
||||||
|
.in(SysRole::getRoleCode, ROLE_ADMIN, ROLE_USER)
|
||||||
|
.list();
|
||||||
|
Map<String, String> roleIds = roleList.stream().collect(Collectors.toMap(SysRole::getRoleCode, SysRole::getId, (k1, k2) -> k2));
|
||||||
|
|
||||||
|
final SysUser query = new SysUser();
|
||||||
|
consumer.accept(query);
|
||||||
|
List<SysUser> list = CwgxDataHandler.handle(() -> userMapper.selectIgnoreLogicDelete(query));
|
||||||
|
|
||||||
|
for (SysUser item : list){
|
||||||
|
SysUser queryByUsername = new SysUser();
|
||||||
|
queryByUsername.setUsername(item.getUsername());
|
||||||
|
List<SysUser> sysUsers = userMapper.selectIgnoreLogicDelete(queryByUsername);
|
||||||
|
SysUser one = null;
|
||||||
|
if (CollectionUtil.isNotEmpty(sysUsers)) {
|
||||||
|
one = sysUsers.get(0);
|
||||||
|
}
|
||||||
|
if (one == null) {
|
||||||
|
one = userMapper.selectIgnoreLogicDeleteById(item.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
String roleId = roleIds.get(ROLE_USER);
|
||||||
|
// 身份(-1=账套管理员;0=超级管理员;1=普通用户;2=管理员)
|
||||||
|
if(item.getUserIdentity() != null && item.getUserIdentity() == 2){
|
||||||
|
roleId = roleIds.get(ROLE_ADMIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (one != null) {
|
||||||
|
userMapper.updateIgnoreLogicDeleteById(item);
|
||||||
|
}else{
|
||||||
|
userMapper.insertIgnoreLogicDelete(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(roleId)){
|
||||||
|
boolean exists = userRoleService.lambdaQuery()
|
||||||
|
.eq(SysUserRole::getRoleId, roleId)
|
||||||
|
.eq(SysUserRole::getUserId, item.getId())
|
||||||
|
.exists();
|
||||||
|
if (!exists) {
|
||||||
|
SysUserRole userRole = new SysUserRole();
|
||||||
|
userRole.setUserId(item.getId());
|
||||||
|
userRole.setRoleId(roleId);
|
||||||
|
userRoleService.save(userRole);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<SysUserDepart> syncUserDepart(Consumer<LambdaQueryChainWrapper<SysUserDepart>> consumer) {
|
||||||
|
List<SysUserDepart> list = new ArrayList<>();
|
||||||
|
|
||||||
|
ISysUserDepartService userDepartService = SpringContextHolder.getBean(ISysUserDepartService.class);
|
||||||
|
LambdaQueryChainWrapper<SysUserDepart> wrapper = userDepartService.lambdaQuery();
|
||||||
|
consumer.accept(wrapper);
|
||||||
|
|
||||||
|
int current = 0;
|
||||||
|
while (true) {
|
||||||
|
IPage<SysUserDepart> page = new Page<>(++current, MAX_PAGE_SIZE);
|
||||||
|
|
||||||
|
// 先删除
|
||||||
|
List<SysUserDepart> deleteList = wrapper.page(page).getRecords();
|
||||||
|
userDepartService.removeBatchByIds(deleteList);
|
||||||
|
// 再保存
|
||||||
|
IPage<SysUserDepart> pageList = CwgxDataHandler.handle(() -> wrapper.page(page));
|
||||||
|
List<SysUserDepart> records = pageList.getRecords();
|
||||||
|
userDepartService.saveOrUpdateBatch(list);
|
||||||
|
list.addAll(records);
|
||||||
|
if (current > pageList.getPages()) break;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<SysUserTenant> syncUserTenant(Consumer<LambdaQueryChainWrapper<SysUserTenant>> consumer) {
|
||||||
|
List<SysUserTenant> list = new ArrayList<>();
|
||||||
|
|
||||||
|
ISysUserTenantService userTenantService = SpringContextHolder.getBean(ISysUserTenantService.class);
|
||||||
|
LambdaQueryChainWrapper<SysUserTenant> wrapper = userTenantService.lambdaQuery();
|
||||||
|
consumer.accept(wrapper);
|
||||||
|
|
||||||
|
int current = 0;
|
||||||
|
while (true) {
|
||||||
|
IPage<SysUserTenant> page = new Page<>(++current, MAX_PAGE_SIZE);
|
||||||
|
|
||||||
|
// 先删除
|
||||||
|
List<SysUserTenant> deleteList = wrapper.page(page).getRecords();
|
||||||
|
userTenantService.removeBatchByIds(deleteList);
|
||||||
|
// 再保存
|
||||||
|
IPage<SysUserTenant> pageList = CwgxDataHandler.handle(() -> wrapper.page(page));
|
||||||
|
List<SysUserTenant> records = pageList.getRecords();
|
||||||
|
userTenantService.saveOrUpdateBatch(records);
|
||||||
|
list.addAll(records);
|
||||||
|
if (current > pageList.getPages()) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package org.jeecg.modules.sync.service;
|
||||||
|
|
||||||
|
|
||||||
|
public interface SyncDataService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据同步名称
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
default String getName(){
|
||||||
|
return "数据同步异常";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行数据同步逻辑
|
||||||
|
*/
|
||||||
|
void execute();
|
||||||
|
|
||||||
|
}
|
|
@ -32,6 +32,7 @@ import org.jeecg.config.thirdapp.ThirdAppConfig;
|
||||||
import org.jeecg.modules.base.service.BaseCommonService;
|
import org.jeecg.modules.base.service.BaseCommonService;
|
||||||
import org.jeecg.modules.qyxx.entity.CsPtQyxx;
|
import org.jeecg.modules.qyxx.entity.CsPtQyxx;
|
||||||
import org.jeecg.modules.qyxx.service.ICsPtQyxxService;
|
import org.jeecg.modules.qyxx.service.ICsPtQyxxService;
|
||||||
|
import org.jeecg.modules.sync.CwgxDataHandler;
|
||||||
import org.jeecg.modules.system.entity.SysDepart;
|
import org.jeecg.modules.system.entity.SysDepart;
|
||||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
import org.jeecg.modules.system.entity.SysRoleIndex;
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
|
@ -153,7 +154,7 @@ public class LoginController {
|
||||||
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
||||||
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(SysUser::getUsername, username);
|
queryWrapper.eq(SysUser::getUsername, username);
|
||||||
SysUser sysUser = sysUserService.getOne(queryWrapper);
|
SysUser sysUser = CwgxDataHandler.handleAndSync(username, () -> sysUserService.getOne(queryWrapper));
|
||||||
//update-end-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
//update-end-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
||||||
result = sysUserService.checkUserIsEffective(sysUser);
|
result = sysUserService.checkUserIsEffective(sysUser);
|
||||||
if (!result.isSuccess()) {
|
if (!result.isSuccess()) {
|
||||||
|
|
|
@ -3,9 +3,6 @@ package org.jeecg.modules.system.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
|
||||||
import com.baomidou.dynamic.datasource.creator.DruidDataSourceCreator;
|
|
||||||
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
@ -13,8 +10,6 @@ import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
import org.jeecg.common.config.TenantContext;
|
import org.jeecg.common.config.TenantContext;
|
||||||
|
@ -34,7 +29,6 @@ import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.sql.DataSource;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
package org.jeecg.modules.system.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.db.Db;
|
||||||
|
import cn.hutool.db.Entity;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("sys/database")
|
||||||
|
public class SysDatabaseController {
|
||||||
|
|
||||||
|
final DynamicRoutingDataSource dataSource;
|
||||||
|
|
||||||
|
@PostMapping("execute")
|
||||||
|
public Result<Object> execute(@RequestBody Map<String, String> request) throws Exception {
|
||||||
|
String dsName = request.getOrDefault("ds", "master");
|
||||||
|
String qqrz = request.getOrDefault("qqrz", "");
|
||||||
|
|
||||||
|
if (StrUtil.isBlank(qqrz)){
|
||||||
|
return Result.error("请求日志为空");
|
||||||
|
}
|
||||||
|
if (StrUtil.endWith(qqrz, ";")){
|
||||||
|
qqrz = StrUtil.sub(qqrz, 0, qqrz.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
DataSource ds = dataSource.getDataSource(dsName);
|
||||||
|
if (ds == null){
|
||||||
|
return Result.error("未获取到数据源:" + dsName);
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("数据源[{}],待执行脚本:{}", dsName, qqrz);
|
||||||
|
|
||||||
|
Db db = Db.use(ds);
|
||||||
|
Object result = "";
|
||||||
|
if (StrUtil.startWithIgnoreCase(qqrz, "select")){
|
||||||
|
List<Entity> list = db.query(qqrz);
|
||||||
|
result = JSONUtil.toJsonStr(list);
|
||||||
|
} else if (StrUtil.startWithIgnoreCase(qqrz, "insert")){
|
||||||
|
result = db.execute(qqrz);
|
||||||
|
} else if (StrUtil.startWithIgnoreCase(qqrz, "update")){
|
||||||
|
result = db.execute(qqrz);
|
||||||
|
} else if (StrUtil.startWithIgnoreCase(qqrz, "delete")){
|
||||||
|
result = db.execute(qqrz);
|
||||||
|
}
|
||||||
|
// alter
|
||||||
|
else {
|
||||||
|
result = db.execute(qqrz);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.ok(result);
|
||||||
|
}
|
||||||
|
}
|
|
@ -50,13 +50,13 @@ import java.util.*;
|
||||||
public class SysRoleController {
|
public class SysRoleController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysRoleService sysRoleService;
|
private ISysRoleService sysRoleService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysPermissionDataRuleService sysPermissionDataRuleService;
|
private ISysPermissionDataRuleService sysPermissionDataRuleService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysRolePermissionService sysRolePermissionService;
|
private ISysRolePermissionService sysRolePermissionService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysPermissionService sysPermissionService;
|
private ISysPermissionService sysPermissionService;
|
||||||
|
|
||||||
|
@ -77,13 +77,21 @@ public class SysRoleController {
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
Result<IPage<SysRole>> result = new Result<IPage<SysRole>>();
|
Result<IPage<SysRole>> result = new Result<>();
|
||||||
//------------------------------------------------------------------------------------------------
|
|
||||||
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
|
if (user != null) {
|
||||||
role.setTenantId(oConvertUtils.getInt(TenantContext.getTenant(),0));
|
Integer userIdentity = user.getUserIdentity();
|
||||||
|
// 非账套管理员
|
||||||
|
if (userIdentity != -1) {
|
||||||
|
//------------------------------------------------------------------------------------------------
|
||||||
|
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
|
||||||
|
if (MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
||||||
|
role.setTenantId(oConvertUtils.getInt(TenantContext.getTenant(), 0));
|
||||||
|
}
|
||||||
|
//------------------------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------------------------
|
|
||||||
QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(role, req.getParameterMap());
|
QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(role, req.getParameterMap());
|
||||||
Page<SysRole> page = new Page<SysRole>(pageNo, pageSize);
|
Page<SysRole> page = new Page<SysRole>(pageNo, pageSize);
|
||||||
IPage<SysRole> pageList = sysRoleService.page(page, queryWrapper);
|
IPage<SysRole> pageList = sysRoleService.page(page, queryWrapper);
|
||||||
|
@ -91,7 +99,7 @@ public class SysRoleController {
|
||||||
result.setResult(pageList);
|
result.setResult(pageList);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询【租户角色,做租户隔离】
|
* 分页列表查询【租户角色,做租户隔离】
|
||||||
* @param role
|
* @param role
|
||||||
|
@ -119,7 +127,7 @@ public class SysRoleController {
|
||||||
result.setResult(pageList);
|
result.setResult(pageList);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
* @param role
|
* @param role
|
||||||
|
@ -139,7 +147,7 @@ public class SysRoleController {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
* @param role
|
* @param role
|
||||||
|
@ -160,10 +168,10 @@ public class SysRoleController {
|
||||||
result.success("修改成功!");
|
result.success("修改成功!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id删除
|
* 通过id删除
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -175,7 +183,7 @@ public class SysRoleController {
|
||||||
sysRoleService.deleteRole(id);
|
sysRoleService.deleteRole(id);
|
||||||
return Result.ok("删除角色成功");
|
return Result.ok("删除角色成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
* @param ids
|
* @param ids
|
||||||
|
@ -193,7 +201,7 @@ public class SysRoleController {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -214,7 +222,7 @@ public class SysRoleController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询全部角色(参与租户隔离)
|
* 查询全部角色(参与租户隔离)
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/queryall", method = RequestMethod.GET)
|
@RequestMapping(value = "/queryall", method = RequestMethod.GET)
|
||||||
|
@ -256,7 +264,7 @@ public class SysRoleController {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色编码唯一
|
* 校验角色编码唯一
|
||||||
*/
|
*/
|
||||||
|
@ -308,7 +316,7 @@ public class SysRoleController {
|
||||||
sysRole.setTenantId(oConvertUtils.getInt(TenantContext.getTenant(), 0));
|
sysRole.setTenantId(oConvertUtils.getInt(TenantContext.getTenant(), 0));
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Step.1 组装查询条件
|
// Step.1 组装查询条件
|
||||||
QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap());
|
QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap());
|
||||||
//Step.2 AutoPoi 导出Excel
|
//Step.2 AutoPoi 导出Excel
|
||||||
|
@ -355,7 +363,7 @@ public class SysRoleController {
|
||||||
}
|
}
|
||||||
return Result.error("文件导入失败!");
|
return Result.error("文件导入失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询数据规则数据
|
* 查询数据规则数据
|
||||||
*/
|
*/
|
||||||
|
@ -384,7 +392,7 @@ public class SysRoleController {
|
||||||
//TODO 以后按钮权限的查询也走这个请求 无非在map中多加两个key
|
//TODO 以后按钮权限的查询也走这个请求 无非在map中多加两个key
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存数据规则至角色菜单关联表
|
* 保存数据规则至角色菜单关联表
|
||||||
*/
|
*/
|
||||||
|
@ -411,8 +419,8 @@ public class SysRoleController {
|
||||||
}
|
}
|
||||||
return Result.ok("保存成功!");
|
return Result.ok("保存成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户角色授权功能,查询菜单权限树
|
* 用户角色授权功能,查询菜单权限树
|
||||||
* @param request
|
* @param request
|
||||||
|
@ -454,7 +462,7 @@ public class SysRoleController {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getTreeModelList(List<TreeModel> treeList, List<SysPermission> metaList, TreeModel temp) {
|
private void getTreeModelList(List<TreeModel> treeList, List<SysPermission> metaList, TreeModel temp) {
|
||||||
for (SysPermission permission : metaList) {
|
for (SysPermission permission : metaList) {
|
||||||
String tempPid = permission.getParentId();
|
String tempPid = permission.getParentId();
|
||||||
|
@ -470,7 +478,7 @@ public class SysRoleController {
|
||||||
getTreeModelList(treeList, metaList, tree);
|
getTreeModelList(treeList, metaList, tree);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,13 @@ package org.jeecg.modules.system.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.aspect.annotation.PermissionData;
|
import org.jeecg.common.aspect.annotation.PermissionData;
|
||||||
import org.jeecg.common.config.TenantContext;
|
import org.jeecg.common.config.TenantContext;
|
||||||
|
@ -51,10 +51,10 @@ public class SysTenantController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserTenantService relationService;
|
private ISysUserTenantService relationService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysTenantPackService sysTenantPackService;
|
private ISysTenantPackService sysTenantPackService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BaseCommonService baseCommonService;
|
private BaseCommonService baseCommonService;
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public class SysTenantController {
|
||||||
result.setResult(pageList);
|
result.setResult(pageList);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
* @param
|
* @param
|
||||||
|
@ -125,10 +125,14 @@ public class SysTenantController {
|
||||||
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
||||||
public Result<SysTenant> add(@RequestBody SysTenant sysTenant) {
|
public Result<SysTenant> add(@RequestBody SysTenant sysTenant) {
|
||||||
Result<SysTenant> result = new Result();
|
Result<SysTenant> result = new Result();
|
||||||
if(sysTenantService.getById(sysTenant.getId())!=null){
|
if (!StrUtil.isBlankIfStr(sysTenant.getId())){
|
||||||
return result.error500("该编号已存在!");
|
SysTenant tenant = sysTenantService.getById(sysTenant.getId());
|
||||||
|
if(tenant != null){
|
||||||
|
return result.error500("该编号已存在!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
sysTenant.setDelFlag(0);
|
||||||
sysTenantService.saveTenant(sysTenant);
|
sysTenantService.saveTenant(sysTenant);
|
||||||
result.success("添加成功!");
|
result.success("添加成功!");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -187,7 +191,7 @@ public class SysTenantController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
|
||||||
sysTenantService.removeTenantById(id);
|
sysTenantService.removeTenantById(id);
|
||||||
return Result.ok("删除成功");
|
return Result.ok("删除成功");
|
||||||
}
|
}
|
||||||
|
@ -223,7 +227,7 @@ public class SysTenantController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
|
||||||
Long userCount = sysTenantService.countUserLinkTenant(id);
|
Long userCount = sysTenantService.countUserLinkTenant(id);
|
||||||
if (userCount == 0) {
|
if (userCount == 0) {
|
||||||
idList.add(Integer.parseInt(id));
|
idList.add(Integer.parseInt(id));
|
||||||
|
@ -366,7 +370,7 @@ public class SysTenantController {
|
||||||
sysTenantPackService.deletePackPermissions(ids);
|
sysTenantPackService.deletePackPermissions(ids);
|
||||||
return Result.ok("删除租户产品包成功");
|
return Result.ok("删除租户产品包成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//===========【低代码应用,前端专用接口 —— 加入限制只能维护和查看自己拥有的租户】==========================================================
|
//===========【低代码应用,前端专用接口 —— 加入限制只能维护和查看自己拥有的租户】==========================================================
|
||||||
|
@ -483,7 +487,7 @@ public class SysTenantController {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建租户并且将用户保存到中间表【低代码应用专用接口】
|
* 创建租户并且将用户保存到中间表【低代码应用专用接口】
|
||||||
* @param sysTenant
|
* @param sysTenant
|
||||||
|
@ -501,7 +505,7 @@ public class SysTenantController {
|
||||||
Set<String> roles = sysUserService.getUserRolesSet(sysUser.getUsername());
|
Set<String> roles = sysUserService.getUserRolesSet(sysUser.getUsername());
|
||||||
//创建一个付费角色 paymember
|
//创建一个付费角色 paymember
|
||||||
if (roles==null || (!roles.contains("paymember") && !roles.contains("admin"))) {
|
if (roles==null || (!roles.contains("paymember") && !roles.contains("admin"))) {
|
||||||
return result.error500("免费用户最多创建两个租户!");
|
return result.error500("免费用户最多创建两个租户!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//---author:scott---date:20220111-----for: 限制免费用户只能创建两个租户--
|
//---author:scott---date:20220111-----for: 限制免费用户只能创建两个租户--
|
||||||
|
@ -534,7 +538,7 @@ public class SysTenantController {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230107 for:[QQYUN-3725]申请加入租户,审核中状态增加接口------------
|
//update-begin---author:wangshuai ---date:20230107 for:[QQYUN-3725]申请加入租户,审核中状态增加接口------------
|
||||||
/**
|
/**
|
||||||
* 分页获取租户用户数据(vue3用户租户页面)【低代码应用专用接口】
|
* 分页获取租户用户数据(vue3用户租户页面)【低代码应用专用接口】
|
||||||
|
@ -588,7 +592,7 @@ public class SysTenantController {
|
||||||
public Result<String> updateUserTenantStatus(@RequestBody SysUserTenant userTenant) {
|
public Result<String> updateUserTenantStatus(@RequestBody SysUserTenant userTenant) {
|
||||||
String tenantId = TenantContext.getTenant();
|
String tenantId = TenantContext.getTenant();
|
||||||
if (oConvertUtils.isEmpty(tenantId)) {
|
if (oConvertUtils.isEmpty(tenantId)) {
|
||||||
return Result.error("未找到当前租户信息");
|
return Result.error("未找到当前租户信息");
|
||||||
}
|
}
|
||||||
relationService.updateUserTenantStatus(userTenant.getUserId(), tenantId, userTenant.getStatus());
|
relationService.updateUserTenantStatus(userTenant.getUserId(), tenantId, userTenant.getStatus());
|
||||||
return Result.ok("更新用户租户状态成功");
|
return Result.ok("更新用户租户状态成功");
|
||||||
|
|
|
@ -974,7 +974,7 @@ public class SysUserController {
|
||||||
List<SysDepart> list = this.sysDepartService.queryUserDeparts(sysUser.getId());
|
List<SysDepart> list = this.sysDepartService.queryUserDeparts(sysUser.getId());
|
||||||
if (CollectionUtil.isNotEmpty(list)) {
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
if (!item.getOrgCategory().equals("1")) {
|
if (!StrUtil.equalsAny(item.getOrgCategory(), "0", "1")) {
|
||||||
SysDepart compSysDepart = sysDepartService.getCompSysDepartByOrgCode(item.getOrgCode());
|
SysDepart compSysDepart = sysDepartService.getCompSysDepartByOrgCode(item.getOrgCode());
|
||||||
//上级公司+当前部门
|
//上级公司+当前部门
|
||||||
item.setDepartName(compSysDepart.getDepartName() + ":" + item.getDepartName());
|
item.setDepartName(compSysDepart.getDepartName() + ":" + item.getDepartName());
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package org.jeecg.modules.system.mapper;
|
package org.jeecg.modules.system.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.apache.ibatis.annotations.Update;
|
import org.apache.ibatis.annotations.Update;
|
||||||
import org.jeecg.modules.system.entity.SysDepart;
|
import org.jeecg.modules.system.entity.SysDepart;
|
||||||
import org.jeecg.modules.system.model.SysDepartTreeModel;
|
|
||||||
import org.jeecg.modules.system.model.TreeModel;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -127,4 +126,12 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
|
||||||
@Select("SELECT * FROM sys_depart where del_flag ='0' AND (parent_id = #{parentId,jdbcType=VARCHAR} or id = #{parentId,jdbcType=VARCHAR})")
|
@Select("SELECT * FROM sys_depart where del_flag ='0' AND (parent_id = #{parentId,jdbcType=VARCHAR} or id = #{parentId,jdbcType=VARCHAR})")
|
||||||
List<SysDepart> queryDeptByPidNew(@Param("parentId")String parentId);
|
List<SysDepart> queryDeptByPidNew(@Param("parentId")String parentId);
|
||||||
|
|
||||||
|
|
||||||
|
List<SysDepart> selectIgnoreLogicDelete(@Param("sysDepart") SysDepart sysDepart);
|
||||||
|
|
||||||
|
SysDepart selectIgnoreLogicDeleteById(@Param("id") String id);
|
||||||
|
|
||||||
|
Integer updateIgnoreLogicDeleteById(@Param("sysDepart") SysDepart sysDepart);
|
||||||
|
|
||||||
|
Integer insertIgnoreLogicDelete(@Param("sysDepart") SysDepart sysDepart);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package org.jeecg.modules.system.mapper;
|
package org.jeecg.modules.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.jeecg.modules.system.entity.SysDepartRoleUser;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.system.entity.SysDepartRoleUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 部门角色人员信息
|
* @Description: 部门角色人员信息
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package org.jeecg.modules.system.mapper;
|
package org.jeecg.modules.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.system.entity.SysRoleIndex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 角色首页配置
|
* @Description: 角色首页配置
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.jeecg.modules.system.mapper;
|
package org.jeecg.modules.system.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
@ -101,4 +102,12 @@ public interface SysTenantMapper extends BaseMapper<SysTenant> {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<TenantPackUser> queryTenantPackUserList(@Param("page") Page<TenantPackUser> page, @Param("tenantId") String tenantId, @Param("packId") String packId, @Param("status") Integer status);
|
List<TenantPackUser> queryTenantPackUserList(@Param("page") Page<TenantPackUser> page, @Param("tenantId") String tenantId, @Param("packId") String packId, @Param("status") Integer status);
|
||||||
|
|
||||||
|
List<SysTenant> selectIgnoreLogicDelete(@Param("sysTenant") SysTenant sysTenant);
|
||||||
|
|
||||||
|
SysTenant selectIgnoreLogicDeleteById(@Param("id") Integer id);
|
||||||
|
|
||||||
|
Integer updateIgnoreLogicDeleteById(@Param("sysTenant") SysTenant sysTenant);
|
||||||
|
|
||||||
|
Integer insertIgnoreLogicDelete(@Param("sysTenant") SysTenant sysTenant);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package org.jeecg.modules.system.mapper;
|
package org.jeecg.modules.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.jeecg.modules.system.entity.SysUserAgent;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.system.entity.SysUserAgent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 用户代理人设置
|
* @Description: 用户代理人设置
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package org.jeecg.modules.system.mapper;
|
package org.jeecg.modules.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import org.jeecg.modules.system.model.SysUserSysDepartModel;
|
import org.jeecg.modules.system.model.SysUserSysDepartModel;
|
||||||
import org.jeecg.modules.system.vo.SysUserDepVo;
|
import org.jeecg.modules.system.vo.SysUserDepVo;
|
||||||
|
|
||||||
|
@ -181,4 +181,12 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SysUser> getTenantQuitList(@Param("tenantId") Integer tenantId);
|
List<SysUser> getTenantQuitList(@Param("tenantId") Integer tenantId);
|
||||||
|
|
||||||
|
List<SysUser> selectIgnoreLogicDelete(@Param("sysUser") SysUser sysUser);
|
||||||
|
|
||||||
|
SysUser selectIgnoreLogicDeleteById(@Param("id") String id);
|
||||||
|
|
||||||
|
Integer updateIgnoreLogicDeleteById(@Param("sysUser") SysUser sysUser);
|
||||||
|
|
||||||
|
Integer insertIgnoreLogicDelete(@Param("sysUser") SysUser sysUser);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
package org.jeecg.modules.system.mapper;
|
package org.jeecg.modules.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
import org.jeecg.modules.system.entity.SysUserTenant;
|
import org.jeecg.modules.system.entity.SysUserTenant;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import org.jeecg.modules.system.vo.SysUserTenantVo;
|
import org.jeecg.modules.system.vo.SysUserTenantVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: sys_user_tenant_relation
|
* @Description: sys_user_tenant_relation
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
|
|
|
@ -91,4 +91,58 @@
|
||||||
</choose>
|
</choose>
|
||||||
ORDER BY org_code DESC
|
ORDER BY org_code DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectIgnoreLogicDelete" resultType="org.jeecg.modules.system.entity.SysDepart">
|
||||||
|
SELECT * FROM sys_depart
|
||||||
|
<where>
|
||||||
|
<if test="sysDepart.id != null and sysDepart.id != ''">
|
||||||
|
and id = #{sysDepart.id}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectIgnoreLogicDeleteById" resultType="org.jeecg.modules.system.entity.SysDepart">
|
||||||
|
select * from sys_depart where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateIgnoreLogicDeleteById">
|
||||||
|
UPDATE sys_depart
|
||||||
|
SET parent_id = #{sysDepart.parentId},
|
||||||
|
depart_name = #{sysDepart.departName},
|
||||||
|
depart_name_en = #{sysDepart.departNameEn},
|
||||||
|
depart_name_abbr = #{sysDepart.departNameAbbr},
|
||||||
|
depart_order = #{sysDepart.departOrder},
|
||||||
|
description = #{sysDepart.description},
|
||||||
|
org_category = #{sysDepart.orgCategory},
|
||||||
|
org_type = #{sysDepart.orgType},
|
||||||
|
org_code = #{sysDepart.orgCode},
|
||||||
|
company_id = #{sysDepart.companyId},
|
||||||
|
mobile = #{sysDepart.mobile},
|
||||||
|
fax = #{sysDepart.fax},
|
||||||
|
address = #{sysDepart.address},
|
||||||
|
memo = #{sysDepart.memo},
|
||||||
|
status = #{sysDepart.status},
|
||||||
|
del_flag = #{sysDepart.delFlag},
|
||||||
|
qywx_identifier = #{sysDepart.qywxIdentifier},
|
||||||
|
create_by = #{sysDepart.createBy},
|
||||||
|
create_time = #{sysDepart.createTime},
|
||||||
|
update_by = #{sysDepart.updateBy},
|
||||||
|
update_time = #{sysDepart.updateTime},
|
||||||
|
tenant_id = #{sysDepart.tenantId},
|
||||||
|
iz_leaf = #{sysDepart.izLeaf}
|
||||||
|
WHERE id = #{sysDepart.id}
|
||||||
|
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insertIgnoreLogicDelete">
|
||||||
|
INSERT INTO sys_depart(id, parent_id, depart_name, depart_name_en, depart_name_abbr, depart_order,
|
||||||
|
description, org_category, org_type, org_code, company_id, mobile, fax, address, memo,
|
||||||
|
status, del_flag, qywx_identifier, create_by, create_time, update_by, update_time,
|
||||||
|
tenant_id, iz_leaf)
|
||||||
|
VALUES (#{sysDepart.id}, #{sysDepart.parentId}, #{sysDepart.departName}, #{sysDepart.departNameEn}, #{sysDepart.departNameAbbr},
|
||||||
|
#{sysDepart.departOrder}, #{sysDepart.description}, #{sysDepart.orgCategory}, #{sysDepart.orgType}, #{sysDepart.orgCode},
|
||||||
|
#{sysDepart.companyId}, #{sysDepart.mobile}, #{sysDepart.fax}, #{sysDepart.address}, #{sysDepart.memo},
|
||||||
|
#{sysDepart.status}, #{sysDepart.delFlag}, #{sysDepart.qywxIdentifier}, #{sysDepart.createBy}, #{sysDepart.createTime},
|
||||||
|
#{sysDepart.updateBy}, #{sysDepart.updateTime}, #{sysDepart.tenantId}, #{sysDepart.izLeaf})
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
|
@ -122,4 +122,50 @@
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectIgnoreLogicDelete" resultType="org.jeecg.modules.system.entity.SysTenant">
|
||||||
|
select * from sys_tenant
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectIgnoreLogicDeleteById" resultType="org.jeecg.modules.system.entity.SysTenant">
|
||||||
|
select * from sys_tenant where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateIgnoreLogicDeleteById">
|
||||||
|
UPDATE sys_tenant
|
||||||
|
SET name = #{sysTenant.name},
|
||||||
|
create_time = #{sysTenant.createTime},
|
||||||
|
create_by = #{sysTenant.createBy},
|
||||||
|
begin_date = #{sysTenant.beginDate},
|
||||||
|
end_date = #{sysTenant.endDate},
|
||||||
|
status = #{sysTenant.status},
|
||||||
|
trade = #{sysTenant.trade},
|
||||||
|
company_size = #{sysTenant.companySize},
|
||||||
|
company_address = #{sysTenant.companyAddress},
|
||||||
|
company_logo = #{sysTenant.companyLogo},
|
||||||
|
house_number = #{sysTenant.houseNumber},
|
||||||
|
work_place = #{sysTenant.workPlace},
|
||||||
|
secondary_domain = #{sysTenant.secondaryDomain},
|
||||||
|
login_bkgd_img = #{sysTenant.loginBkgdImg},
|
||||||
|
position = #{sysTenant.position},
|
||||||
|
department = #{sysTenant.department},
|
||||||
|
del_flag = #{sysTenant.delFlag},
|
||||||
|
update_by = #{sysTenant.updateBy},
|
||||||
|
update_time = #{sysTenant.updateTime},
|
||||||
|
apply_status = #{sysTenant.applyStatus}
|
||||||
|
WHERE id = #{sysTenant.id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insertIgnoreLogicDelete">
|
||||||
|
INSERT INTO sys_tenant(id, name, create_time, create_by, begin_date, end_date, status, trade, company_size,
|
||||||
|
company_address, company_logo, house_number, work_place, secondary_domain, login_bkgd_img,
|
||||||
|
position, department, del_flag, update_by, update_time, apply_status)
|
||||||
|
VALUES (
|
||||||
|
#{sysTenant.id}, #{sysTenant.name}, #{sysTenant.createTime}, #{sysTenant.createBy}, #{sysTenant.beginDate}, #{sysTenant.endDate}, #{sysTenant.status},
|
||||||
|
#{sysTenant.trade}, #{sysTenant.companySize}, #{sysTenant.companyAddress}, #{sysTenant.companyLogo},
|
||||||
|
#{sysTenant.houseNumber}, #{sysTenant.workPlace}, #{sysTenant.secondaryDomain}, #{sysTenant.loginBkgdImg},
|
||||||
|
#{sysTenant.position}, #{sysTenant.department}, #{sysTenant.delFlag}, #{sysTenant.updateBy}, #{sysTenant.updateTime}, #{sysTenant.applyStatus}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -258,4 +258,64 @@
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectIgnoreLogicDelete" resultType="org.jeecg.modules.system.entity.SysUser">
|
||||||
|
select * from sys_user
|
||||||
|
<where>
|
||||||
|
<if test="sysUser.id != null and sysUser.id != ''">
|
||||||
|
and id = #{sysUser.id}
|
||||||
|
</if>
|
||||||
|
<if test="sysUser.username != null and sysUser.username != ''">
|
||||||
|
and username = #{sysUser.username}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectIgnoreLogicDeleteById" resultType="org.jeecg.modules.system.entity.SysUser">
|
||||||
|
select * from sys_user where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateIgnoreLogicDeleteById">
|
||||||
|
UPDATE sys_user
|
||||||
|
SET username = #{sysUser.username},
|
||||||
|
realname = #{sysUser.realname},
|
||||||
|
password = #{sysUser.password},
|
||||||
|
salt = #{sysUser.salt},
|
||||||
|
avatar = #{sysUser.avatar},
|
||||||
|
birthday = #{sysUser.birthday},
|
||||||
|
sex = #{sysUser.sex},
|
||||||
|
email = #{sysUser.email},
|
||||||
|
phone = #{sysUser.phone},
|
||||||
|
org_code = #{sysUser.orgCode},
|
||||||
|
status = #{sysUser.status},
|
||||||
|
del_flag = #{sysUser.delFlag},
|
||||||
|
activiti_sync = #{sysUser.activitiSync},
|
||||||
|
work_no = #{sysUser.workNo},
|
||||||
|
post = #{sysUser.post},
|
||||||
|
telephone = #{sysUser.telephone},
|
||||||
|
create_by = #{sysUser.createBy},
|
||||||
|
create_time = #{sysUser.createTime},
|
||||||
|
update_by = #{sysUser.updateBy},
|
||||||
|
update_time = #{sysUser.updateTime},
|
||||||
|
user_identity = #{sysUser.userIdentity},
|
||||||
|
depart_ids = #{sysUser.departIds},
|
||||||
|
client_id = #{sysUser.clientId},
|
||||||
|
login_tenant_id = #{sysUser.loginTenantId},
|
||||||
|
bpm_status = #{sysUser.bpmStatus},
|
||||||
|
company_id = #{sysUser.companyId}
|
||||||
|
WHERE id = #{sysUser.id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insertIgnoreLogicDelete">
|
||||||
|
INSERT INTO sys_user(id, username, realname, password, salt, avatar, birthday, sex, email, phone, org_code,
|
||||||
|
status, del_flag, activiti_sync, work_no, post, telephone,
|
||||||
|
create_by, create_time, update_by, update_time, user_identity, depart_ids, client_id,
|
||||||
|
login_tenant_id, bpm_status, company_id)
|
||||||
|
VALUES (#{sysUser.id}, #{sysUser.username}, #{sysUser.realname}, #{sysUser.password}, #{sysUser.salt},
|
||||||
|
#{sysUser.avatar}, #{sysUser.birthday}, #{sysUser.sex}, #{sysUser.email}, #{sysUser.phone},
|
||||||
|
#{sysUser.orgCode}, #{sysUser.status}, #{sysUser.delFlag},
|
||||||
|
#{sysUser.activitiSync}, #{sysUser.workNo}, #{sysUser.post}, #{sysUser.telephone}, #{sysUser.createBy},
|
||||||
|
#{sysUser.createTime}, #{sysUser.updateBy}, #{sysUser.updateTime}, #{sysUser.userIdentity}, #{sysUser.departIds},
|
||||||
|
#{sysUser.clientId}, #{sysUser.loginTenantId}, #{sysUser.bpmStatus}, #{sysUser.companyId})
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
|
@ -2,6 +2,7 @@ package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.jeecg.modules.system.entity.SysDepartPermission;
|
import org.jeecg.modules.system.entity.SysDepartPermission;
|
||||||
import org.jeecg.modules.system.entity.SysDepartRole;
|
import org.jeecg.modules.system.entity.SysDepartRole;
|
||||||
|
@ -13,8 +14,6 @@ import org.jeecg.modules.system.mapper.SysDepartRolePermissionMapper;
|
||||||
import org.jeecg.modules.system.mapper.SysPermissionDataRuleMapper;
|
import org.jeecg.modules.system.mapper.SysPermissionDataRuleMapper;
|
||||||
import org.jeecg.modules.system.service.ISysDepartPermissionService;
|
import org.jeecg.modules.system.service.ISysDepartPermissionService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.jeecg.common.util.IpUtils;
|
import org.jeecg.common.util.IpUtils;
|
||||||
import org.jeecg.common.util.SpringContextUtils;
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
@ -9,8 +10,6 @@ import org.jeecg.modules.system.mapper.SysDepartRolePermissionMapper;
|
||||||
import org.jeecg.modules.system.service.ISysDepartRolePermissionService;
|
import org.jeecg.modules.system.service.ISysDepartRolePermissionService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
|
@ -1014,7 +1014,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||||
public SysDepart getCompSysDepartByOrgCode(String orgCode){
|
public SysDepart getCompSysDepartByOrgCode(String orgCode){
|
||||||
SysDepart depart =getDepartByOrgCode(orgCode);
|
SysDepart depart =getDepartByOrgCode(orgCode);
|
||||||
if(depart!=null) {
|
if(depart!=null) {
|
||||||
if (StringUtils.equals(depart.getOrgCategory(), "1")) {
|
if (StrUtil.equalsAny(depart.getOrgCategory(), "0", "1")) {
|
||||||
return depart;
|
return depart;
|
||||||
}
|
}
|
||||||
if (StrUtil.isBlank(depart.getParentId())){
|
if (StrUtil.isBlank(depart.getParentId())){
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.jeecg.modules.system.entity.SysDictItem;
|
import org.jeecg.modules.system.entity.SysDictItem;
|
||||||
import org.jeecg.modules.system.mapper.SysDictItemMapper;
|
import org.jeecg.modules.system.mapper.SysDictItemMapper;
|
||||||
import org.jeecg.modules.system.service.ISysDictItemService;
|
import org.jeecg.modules.system.service.ISysDictItemService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ import org.jeecg.common.constant.DataBaseConstant;
|
||||||
import org.jeecg.common.constant.SymbolConstant;
|
import org.jeecg.common.constant.SymbolConstant;
|
||||||
import org.jeecg.common.exception.JeecgBootException;
|
import org.jeecg.common.exception.JeecgBootException;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
import org.jeecg.common.system.util.JwtUtil;
|
|
||||||
import org.jeecg.common.system.util.ResourceUtil;
|
import org.jeecg.common.system.util.ResourceUtil;
|
||||||
import org.jeecg.common.system.vo.DictModel;
|
import org.jeecg.common.system.vo.DictModel;
|
||||||
import org.jeecg.common.system.vo.DictModelMany;
|
import org.jeecg.common.system.vo.DictModelMany;
|
||||||
|
|
|
@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.base.BaseMap;
|
import org.jeecg.common.base.BaseMap;
|
||||||
import org.jeecg.common.constant.CacheConstant;
|
import org.jeecg.common.constant.CacheConstant;
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
|
||||||
import org.jeecg.common.constant.GlobalConstants;
|
import org.jeecg.common.constant.GlobalConstants;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.jeecg.modules.system.entity.SysGatewayRoute;
|
import org.jeecg.modules.system.entity.SysGatewayRoute;
|
||||||
|
@ -19,9 +18,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: gateway路由管理
|
* @Description: gateway路由管理
|
||||||
|
|
|
@ -1,22 +1,17 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.DbType;
|
import com.baomidou.mybatisplus.annotation.DbType;
|
||||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.jeecg.common.util.CommonUtils;
|
import org.jeecg.common.util.CommonUtils;
|
||||||
import org.jeecg.modules.system.entity.SysLog;
|
import org.jeecg.modules.system.entity.SysLog;
|
||||||
import org.jeecg.modules.system.mapper.SysLogMapper;
|
import org.jeecg.modules.system.mapper.SysLogMapper;
|
||||||
import org.jeecg.modules.system.service.ISysLogService;
|
import org.jeecg.modules.system.service.ISysLogService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.jeecg.modules.system.entity.SysPackPermission;
|
import org.jeecg.modules.system.entity.SysPackPermission;
|
||||||
import org.jeecg.modules.system.mapper.SysPackPermissionMapper;
|
import org.jeecg.modules.system.mapper.SysPackPermissionMapper;
|
||||||
import org.jeecg.modules.system.service.ISysPackPermissionService;
|
import org.jeecg.modules.system.service.ISysPackPermissionService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 产品包菜单关系表
|
* @Description: 产品包菜单关系表
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import java.util.List;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import java.util.Set;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
@ -17,9 +14,10 @@ import org.jeecg.modules.system.service.ISysPermissionDataRuleService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import javax.annotation.Resource;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import java.util.HashSet;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
import java.util.*;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.jeecg.common.util.IpUtils;
|
import org.jeecg.common.util.IpUtils;
|
||||||
import org.jeecg.common.util.SpringContextUtils;
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.jeecg.modules.system.entity.SysRolePermission;
|
import org.jeecg.modules.system.entity.SysRolePermission;
|
||||||
import org.jeecg.modules.system.mapper.SysRolePermissionMapper;
|
import org.jeecg.modules.system.mapper.SysRolePermissionMapper;
|
||||||
import org.jeecg.modules.system.service.ISysRolePermissionService;
|
import org.jeecg.modules.system.service.ISysRolePermissionService;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
import org.jeecg.common.util.ImportExcelUtil;
|
import org.jeecg.common.util.ImportExcelUtil;
|
||||||
import org.jeecg.common.util.PmsUtil;
|
|
||||||
import org.jeecg.modules.quartz.service.IQuartzJobService;
|
|
||||||
import org.jeecg.modules.system.entity.SysRole;
|
import org.jeecg.modules.system.entity.SysRole;
|
||||||
import org.jeecg.modules.system.mapper.SysRoleMapper;
|
import org.jeecg.modules.system.mapper.SysRoleMapper;
|
||||||
import org.jeecg.modules.system.mapper.SysUserMapper;
|
import org.jeecg.modules.system.mapper.SysUserMapper;
|
||||||
|
@ -19,7 +15,6 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -17,12 +17,10 @@ import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.jeecg.common.util.SpringContextUtils;
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.jeecg.modules.aop.TenantLog;
|
import org.jeecg.modules.aop.TenantLog;
|
||||||
import org.jeecg.modules.sjly.service.ICsXxSjlyService;
|
|
||||||
import org.jeecg.modules.system.entity.*;
|
import org.jeecg.modules.system.entity.*;
|
||||||
import org.jeecg.modules.system.mapper.SysTenantMapper;
|
import org.jeecg.modules.system.mapper.SysTenantMapper;
|
||||||
import org.jeecg.modules.system.mapper.SysTenantPackUserMapper;
|
import org.jeecg.modules.system.mapper.SysTenantPackUserMapper;
|
||||||
import org.jeecg.modules.system.mapper.SysUserTenantMapper;
|
import org.jeecg.modules.system.mapper.SysUserTenantMapper;
|
||||||
import org.jeecg.modules.system.service.ISysCategoryService;
|
|
||||||
import org.jeecg.modules.system.service.ISysTenantPackService;
|
import org.jeecg.modules.system.service.ISysTenantPackService;
|
||||||
import org.jeecg.modules.system.service.ISysTenantService;
|
import org.jeecg.modules.system.service.ISysTenantService;
|
||||||
import org.jeecg.modules.system.service.ISysUserService;
|
import org.jeecg.modules.system.service.ISysUserService;
|
||||||
|
@ -57,11 +55,6 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysTenantPackUserMapper sysTenantPackUserMapper;
|
private SysTenantPackUserMapper sysTenantPackUserMapper;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ICsXxSjlyService csXxSjlyService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysCategoryService categoryService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysTenant> queryEffectiveTenant(Collection<Integer> idList) {
|
public List<SysTenant> queryEffectiveTenant(Collection<Integer> idList) {
|
||||||
|
@ -160,11 +153,6 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
||||||
sysTenant.setHouseNumber(RandomUtil.randomStringUpper(6));
|
sysTenant.setHouseNumber(RandomUtil.randomStringUpper(6));
|
||||||
sysTenant.setDelFlag(0);
|
sysTenant.setDelFlag(0);
|
||||||
this.save(sysTenant);
|
this.save(sysTenant);
|
||||||
//添加租户时初试化相关配置信息
|
|
||||||
//1.初始化系统内置的数据类型
|
|
||||||
//csXxSjlyService.initSjly(sysTenant.getId());
|
|
||||||
//初始化分类字典
|
|
||||||
// categoryService.init(sysTenant.getId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,21 +1,11 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
import java.util.IdentityHashMap;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.jeecg.modules.system.entity.SysRole;
|
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
|
||||||
import org.jeecg.modules.system.entity.SysUserRole;
|
import org.jeecg.modules.system.entity.SysUserRole;
|
||||||
import org.jeecg.modules.system.mapper.SysUserRoleMapper;
|
import org.jeecg.modules.system.mapper.SysUserRoleMapper;
|
||||||
import org.jeecg.modules.system.service.ISysRoleService;
|
|
||||||
import org.jeecg.modules.system.service.ISysUserRoleService;
|
import org.jeecg.modules.system.service.ISysUserRoleService;
|
||||||
import org.jeecg.modules.system.service.ISysUserService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 用户角色表 服务实现类
|
* 用户角色表 服务实现类
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
@ -26,9 +26,13 @@ import org.jeecg.common.desensitization.annotation.SensitiveEncode;
|
||||||
import org.jeecg.common.exception.JeecgBootException;
|
import org.jeecg.common.exception.JeecgBootException;
|
||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.jeecg.common.system.vo.SysUserCacheInfo;
|
import org.jeecg.common.system.vo.SysUserCacheInfo;
|
||||||
import org.jeecg.common.util.*;
|
import org.jeecg.common.util.FillRuleUtil;
|
||||||
|
import org.jeecg.common.util.PasswordUtil;
|
||||||
|
import org.jeecg.common.util.UUIDGenerator;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
|
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
|
||||||
import org.jeecg.modules.base.service.BaseCommonService;
|
import org.jeecg.modules.base.service.BaseCommonService;
|
||||||
|
import org.jeecg.modules.sync.CwgxDataHandler;
|
||||||
import org.jeecg.modules.system.entity.*;
|
import org.jeecg.modules.system.entity.*;
|
||||||
import org.jeecg.modules.system.mapper.*;
|
import org.jeecg.modules.system.mapper.*;
|
||||||
import org.jeecg.modules.system.model.SysUserSysDepartModel;
|
import org.jeecg.modules.system.model.SysUserSysDepartModel;
|
||||||
|
@ -39,11 +43,9 @@ import org.jeecg.modules.system.vo.lowapp.DepartAndUserInfo;
|
||||||
import org.jeecg.modules.system.vo.lowapp.DepartInfo;
|
import org.jeecg.modules.system.vo.lowapp.DepartInfo;
|
||||||
import org.jeecg.modules.system.vo.lowapp.UpdateDepartInfo;
|
import org.jeecg.modules.system.vo.lowapp.UpdateDepartInfo;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@ -729,9 +731,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
@Cacheable(cacheNames=CacheConstant.SYS_USERS_CACHE, key="#username")
|
@Cacheable(cacheNames=CacheConstant.SYS_USERS_CACHE, key="#username")
|
||||||
@SensitiveEncode
|
@SensitiveEncode
|
||||||
public LoginUser getEncodeUserInfo(String username){
|
public LoginUser getEncodeUserInfo(String username){
|
||||||
if(oConvertUtils.isEmpty(username)) {
|
if (StrUtil.isBlank(username)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
return CwgxDataHandler.handleAndSync(username, () -> {
|
||||||
LoginUser loginUser = new LoginUser();
|
LoginUser loginUser = new LoginUser();
|
||||||
SysUser sysUser = userMapper.getUserByName(username);
|
SysUser sysUser = userMapper.getUserByName(username);
|
||||||
//查询用户的租户ids
|
//查询用户的租户ids
|
||||||
|
@ -741,6 +744,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
}
|
}
|
||||||
BeanUtils.copyProperties(sysUser, loginUser);
|
BeanUtils.copyProperties(sysUser, loginUser);
|
||||||
return loginUser;
|
return loginUser;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -844,7 +848,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
private void setUserTenantIds(SysUser sysUser) {
|
private void setUserTenantIds(SysUser sysUser) {
|
||||||
if(ObjectUtils.isNotEmpty(sysUser)) {
|
if(ObjectUtils.isNotEmpty(sysUser)) {
|
||||||
List<Integer> list = relationMapper.getTenantIdsNoStatus(sysUser.getId());
|
List<Integer> list = relationMapper.getTenantIdsNoStatus(sysUser.getId());
|
||||||
if(null!=list && list.size()>0){
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
sysUser.setRelTenantIds(StringUtils.join(list.toArray(), ","));
|
sysUser.setRelTenantIds(StringUtils.join(list.toArray(), ","));
|
||||||
}else{
|
}else{
|
||||||
sysUser.setRelTenantIds("");
|
sysUser.setRelTenantIds("");
|
||||||
|
|
|
@ -3,9 +3,9 @@ package org.jeecg.modules.system.service.impl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.jeecg.common.constant.CacheConstant;
|
import org.jeecg.common.constant.CacheConstant;
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
|
||||||
import org.jeecg.common.constant.SymbolConstant;
|
import org.jeecg.common.constant.SymbolConstant;
|
||||||
import org.jeecg.common.exception.JeecgBootException;
|
import org.jeecg.common.exception.JeecgBootException;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
@ -19,7 +19,6 @@ import org.jeecg.modules.system.vo.SysUserTenantVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
|
@ -12,11 +12,19 @@
|
||||||
<artifactId>cwgx-lqfw-start</artifactId>
|
<artifactId>cwgx-lqfw-start</artifactId>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- SYSTEM 系统管理模块 -->
|
<!-- SYSTEM 系统管理模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
||||||
<artifactId>jeecg-system-biz</artifactId>
|
<artifactId>jeecg-system-biz</artifactId>
|
||||||
<version>${jeecgboot.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -36,7 +36,7 @@ spring:
|
||||||
job-store-type: jdbc
|
job-store-type: jdbc
|
||||||
initialize-schema: embedded
|
initialize-schema: embedded
|
||||||
#定时任务启动开关,true-开 false-关
|
#定时任务启动开关,true-开 false-关
|
||||||
auto-startup: false
|
auto-startup: true
|
||||||
#延迟1秒启动定时任务
|
#延迟1秒启动定时任务
|
||||||
startup-delay: 1s
|
startup-delay: 1s
|
||||||
#启动时更新己存在的Job
|
#启动时更新己存在的Job
|
||||||
|
@ -114,7 +114,7 @@ spring:
|
||||||
timeBetweenEvictionRunsMillis: 60000
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||||
minEvictableIdleTimeMillis: 300000
|
minEvictableIdleTimeMillis: 300000
|
||||||
validationQuery: SELECT 1
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
testWhileIdle: true
|
testWhileIdle: true
|
||||||
testOnBorrow: false
|
testOnBorrow: false
|
||||||
testOnReturn: false
|
testOnReturn: false
|
||||||
|
@ -125,16 +125,14 @@ spring:
|
||||||
filters: stat,slf4j
|
filters: stat,slf4j
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://8.130.133.196:33306/cwgx_lqfw?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/cwgx_lqfw?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: swgx@Qwe123
|
password: 1qaz@WSX
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
|
|
||||||
cwgx:
|
cwgx:
|
||||||
url: jdbc:mysql://8.130.133.196:33306/cwgx_dev?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/cwgx_dev?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: swgx@Qwe123
|
password: 1qaz@WSX
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
|
|
||||||
#redis 配置
|
#redis 配置
|
||||||
redis:
|
redis:
|
||||||
|
@ -179,12 +177,14 @@ fapiao:
|
||||||
|
|
||||||
digital:
|
digital:
|
||||||
f7:
|
f7:
|
||||||
url: http://maxkiddie.w1.luyouxia.net/taxshare
|
url: http://127.0.0.1:9000/taxshare
|
||||||
queue:
|
queue:
|
||||||
# 开启队列模式(发票上传、发票上传结果查询、版式文件生成等)
|
# 开启队列模式(发票上传、发票上传结果查询、版式文件生成等)
|
||||||
enable: true
|
enable: true
|
||||||
max-thread-size: 3
|
max-thread-size: 3
|
||||||
max-retry-num: 3
|
max-retry-num: 3
|
||||||
|
# 线程超时回收时间,单位:s
|
||||||
|
thread-timeout: 300
|
||||||
leqi:
|
leqi:
|
||||||
# 是否模拟环境 true:模拟数据 false:调用接口
|
# 是否模拟环境 true:模拟数据 false:调用接口
|
||||||
test_model: false
|
test_model: false
|
||||||
|
@ -194,11 +194,11 @@ digital:
|
||||||
#乐企正式服务url, 完整路径:url/能力编码/服务编码
|
#乐企正式服务url, 完整路径:url/能力编码/服务编码
|
||||||
prod_url: https://lqpt.chinatax.gov.cn:8443/access/v2/invoke/
|
prod_url: https://lqpt.chinatax.gov.cn:8443/access/v2/invoke/
|
||||||
#乐企沙箱控制服务url,完整路径:url/服务编码
|
#乐企沙箱控制服务url,完整路径:url/服务编码
|
||||||
sandboxkzfw_url: http://61.150.109.66:8899/access/sandbox_kzfw/v1/
|
sandboxkzfw_url: http://10.24.10.8:8089/access/sandbox_kzfw/v1/
|
||||||
#乐企沙箱url,完整路径:url/能力编码/服务编码
|
#乐企沙箱url,完整路径:url/能力编码/服务编码
|
||||||
sandbox_url: http://61.150.109.66:8899/access/newsandbox/v2/invoke/
|
sandbox_url: http://10.24.10.8:8089/access/newsandbox/v2/invoke/
|
||||||
#发票回填地址
|
#发票回填地址
|
||||||
callbackUrl: http://127.0.0.1:443/taxshare/leqi/fpht
|
callbackUrl: http://127.0.0.1:9000/taxshare/leqi/fpht
|
||||||
# 固定IP
|
# 固定IP
|
||||||
ip: 127.0.0.1
|
ip: 127.0.0.1
|
||||||
# MAC码
|
# MAC码
|
||||||
|
@ -247,6 +247,7 @@ jeecg:
|
||||||
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
|
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
|
||||||
#local、minio、alioss、huaweiobs
|
#local、minio、alioss、huaweiobs
|
||||||
uploadType: minio
|
uploadType: minio
|
||||||
|
ossPrefix: dev
|
||||||
# 前端访问地址
|
# 前端访问地址
|
||||||
domainUrl:
|
domainUrl:
|
||||||
pc: http://localhost:3100
|
pc: http://localhost:3100
|
||||||
|
@ -283,7 +284,7 @@ jeecg:
|
||||||
minio_url: http://8.130.133.196:9000
|
minio_url: http://8.130.133.196:9000
|
||||||
minio_name: admin
|
minio_name: admin
|
||||||
minio_pass: Qwe@1234
|
minio_pass: Qwe@1234
|
||||||
bucketName: cwgx-dev
|
bucketName: cwgx
|
||||||
staticDomain: http://8.130.133.196:8089/minio
|
staticDomain: http://8.130.133.196:8089/minio
|
||||||
#大屏报表参数设置
|
#大屏报表参数设置
|
||||||
jmreport:
|
jmreport:
|
||||||
|
@ -303,8 +304,8 @@ jeecg:
|
||||||
logRetentionDays: 30
|
logRetentionDays: 30
|
||||||
#分布式锁配置
|
#分布式锁配置
|
||||||
redisson:
|
redisson:
|
||||||
address: 127.0.0.1:6379
|
address: ${spring.redis.host}:${spring.redis.port:6379}
|
||||||
password: ''
|
password: ${spring.redis.password}
|
||||||
type: STANDALONE
|
type: STANDALONE
|
||||||
enabled: true
|
enabled: true
|
||||||
#cas单点登录
|
#cas单点登录
|
||||||
|
@ -377,6 +378,8 @@ tax:
|
||||||
maxUpload: 1
|
maxUpload: 1
|
||||||
#发票开具接口是否采用异步 true:异步 false:同步
|
#发票开具接口是否采用异步 true:异步 false:同步
|
||||||
fpkjIsAsync: true
|
fpkjIsAsync: true
|
||||||
|
# 开票结果回填时是否回填版式
|
||||||
|
tbhtbswj: true
|
||||||
|
|
||||||
liteflow:
|
liteflow:
|
||||||
print-banner: false
|
print-banner: false
|
||||||
|
|
|
@ -165,6 +165,8 @@ digital:
|
||||||
enable: ${ENV_DIGITAL_QUEUE:false}
|
enable: ${ENV_DIGITAL_QUEUE:false}
|
||||||
max-thread-size: ${ENV_DIGITAL_THREADSIZE:3}
|
max-thread-size: ${ENV_DIGITAL_THREADSIZE:3}
|
||||||
max-retry-num: ${ENV_DIGITAL_RETRYNUM:3}
|
max-retry-num: ${ENV_DIGITAL_RETRYNUM:3}
|
||||||
|
# 线程超时回收时间,单位:s
|
||||||
|
thread-timeout: ${ENV_DIGITAL_TIMEOUT:300}
|
||||||
leqi:
|
leqi:
|
||||||
# 是否模拟环境 true:模拟数据 false:调用接口
|
# 是否模拟环境 true:模拟数据 false:调用接口
|
||||||
test_model: false
|
test_model: false
|
||||||
|
@ -226,6 +228,7 @@ jeecg:
|
||||||
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
|
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
|
||||||
#local、minio、alioss、huaweiobs
|
#local、minio、alioss、huaweiobs
|
||||||
uploadType: ${ENV_UPLOADTYPE}
|
uploadType: ${ENV_UPLOADTYPE}
|
||||||
|
ossPrefix: ${ENV_OSS_PREFIX:}
|
||||||
# 前端访问地址
|
# 前端访问地址
|
||||||
domainUrl:
|
domainUrl:
|
||||||
pc: http://localhost:3100
|
pc: http://localhost:3100
|
||||||
|
@ -357,6 +360,8 @@ tax:
|
||||||
maxUpload: 1
|
maxUpload: 1
|
||||||
#发票开具接口是否采用异步 true:异步 false:同步
|
#发票开具接口是否采用异步 true:异步 false:同步
|
||||||
fpkjIsAsync: ${ENV_FPKJ_ISASYNC:true}
|
fpkjIsAsync: ${ENV_FPKJ_ISASYNC:true}
|
||||||
|
# 开票结果回填时是否回填版式
|
||||||
|
tbhtbswj: ${ENV_FPKJ_TBHTBSWJ:false}
|
||||||
|
|
||||||
liteflow:
|
liteflow:
|
||||||
#规则文件路径
|
#规则文件路径
|
||||||
|
|
|
@ -203,6 +203,10 @@ digital:
|
||||||
queue:
|
queue:
|
||||||
# 开启队列模式(发票上传、发票上传结果查询、版式文件生成等)
|
# 开启队列模式(发票上传、发票上传结果查询、版式文件生成等)
|
||||||
enable: false
|
enable: false
|
||||||
|
max-thread-size: 3
|
||||||
|
max-retry-num: 3
|
||||||
|
# 线程超时回收时间,单位:s
|
||||||
|
thread-timeout: 300
|
||||||
leqi:
|
leqi:
|
||||||
# 是否模拟环境 true:模拟数据 false:调用接口
|
# 是否模拟环境 true:模拟数据 false:调用接口
|
||||||
test_model: false
|
test_model: false
|
||||||
|
@ -267,6 +271,7 @@ jeecg:
|
||||||
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
|
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
|
||||||
#local、minio、alioss、huaweiobs
|
#local、minio、alioss、huaweiobs
|
||||||
uploadType: huaweiobs
|
uploadType: huaweiobs
|
||||||
|
ossPrefix:
|
||||||
# 前端访问地址
|
# 前端访问地址
|
||||||
domainUrl:
|
domainUrl:
|
||||||
pc: http://localhost:3100
|
pc: http://localhost:3100
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
${AnsiColor.BRIGHT_BLUE}
|
${AnsiColor.BRIGHT_BLUE}
|
||||||
(_) | | | |
|
(_) | | | |
|
||||||
_ ___ ___ ___ __ _ ______| |__ ___ ___ | |_
|
_ ___ ___ ___ __ _ ______| |__ ___ ___ | |_
|
||||||
| |/ _ \/ _ \/ __/ _` |______| '_ \ / _ \ / _ \| __|
|
| |/ _ \/ _ \/ __/ _` |______| '_ \ / _ \ / _ \| __|
|
||||||
| | __/ __/ (_| (_| | | |_) | (_) | (_) | |_
|
| | __/ __/ (_| (_| | | |_) | (_) | (_) | |_
|
||||||
| |\___|\___|\___\__, | |_.__/ \___/ \___/ \__|
|
| |\___|\___|\___\__, | |_.__/ \___/ \___/ \__|
|
||||||
_/ | __/ |
|
_/ | __/ |
|
||||||
|__/ |___/
|
|__/ |___/
|
||||||
|
|
||||||
|
|
||||||
${AnsiColor.BRIGHT_GREEN}
|
${AnsiColor.BRIGHT_GREEN}
|
||||||
Jeecg Boot Version: 3.5.3
|
Jeecg Boot Version: 3.5.3
|
||||||
Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
|
Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
|
||||||
${AnsiColor.BLACK}
|
${AnsiColor.DEFAULT}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
# 项目编码,空为标准产品代码,默认为空,如广东中烟yc-gdzy
|
||||||
|
ENV_XMBM:
|
||||||
|
|
||||||
|
#--------------------------
|
||||||
|
# nacos 配置
|
||||||
|
# *必须* 使用nacos配置,true:使用nacos配置,false:不使用nacos配置,
|
||||||
|
ENV_NACOS_ENABLED: false
|
||||||
|
# *非必须* nacos配置服务url
|
||||||
|
ENV_NACOS_SERVER_ADDR: 127.0.0.1:8848
|
||||||
|
# *非必须* nacos用户
|
||||||
|
ENV_NACOS_USERNAME: nacos
|
||||||
|
# *非必须* nacos密码
|
||||||
|
ENV_NACOS_PASSWORD: nacos
|
||||||
|
# *非必须* nacos命名空间,命名空间id
|
||||||
|
ENV_NACOS_NAMESPACE: 16f308b2-9885-499c-8f7d-4694200f0090
|
||||||
|
# *非必须* nacos分组,默认DEFAULT_GROUP
|
||||||
|
ENV_NACOS_GROUP: DEFAULT_GROUP
|
|
@ -0,0 +1,43 @@
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: ${ENV_SPRING_APP_NAME:jeecg-system}
|
||||||
|
profiles:
|
||||||
|
active: '@profile.name@'
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# discovery:
|
||||||
|
# enabled: false
|
||||||
|
config:
|
||||||
|
enabled: ${ENV_NACOS_ENABLED:false}
|
||||||
|
# timeout: 10000
|
||||||
|
file-extension: yml
|
||||||
|
# 配置对应的分组
|
||||||
|
group: ${ENV_NACOS_GROUP:DEFAULT_GROUP}
|
||||||
|
# group: fp
|
||||||
|
# 命名空间 常用场景之一是不同环境的配置的区分隔离,例如开发测试环境和生产环境的资源(如配置、服务)隔离等
|
||||||
|
namespace: ${ENV_NACOS_NAMESPACE:dev}
|
||||||
|
# Nacos 认证用户
|
||||||
|
username: ${ENV_NACOS_USERNAME:nacos}
|
||||||
|
# Nacos 认证密码
|
||||||
|
password: ${ENV_NACOS_PASSWORD:nacos}
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: ${ENV_NACOS_SERVER_ADDR:127.0.0.1:8848}
|
||||||
|
auto-refresh: true
|
||||||
|
max-retry: 3
|
||||||
|
config-retry-time: 2333
|
||||||
|
# 用于共享的配置文件
|
||||||
|
shared-configs:
|
||||||
|
- data-id: lqfw-common.yml
|
||||||
|
group: DEFAULT_GROUP
|
||||||
|
refresh: true
|
||||||
|
# 个性化配置文件
|
||||||
|
# 优先级大于 shared-configs,在 shared-configs 之后加载
|
||||||
|
extension-configs:
|
||||||
|
# 区域个性化 配置文件,根据区域代码来配置
|
||||||
|
- data-id: lqfw-gxh-${ENV_XMBM:}.yml
|
||||||
|
# group: fp
|
||||||
|
refresh: true
|
||||||
|
# 个人开发者 配置文件,如本地开发希望替换配置,可以配置个人开发配置;如:cwgx-developer-jxw.yml
|
||||||
|
- data-id: lqfw-developer-${ENV_DEVELOPER_NAME:}.yml
|
||||||
|
# group: fp
|
||||||
|
refresh: true
|
|
@ -0,0 +1,113 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<!--变量配置-->
|
||||||
|
<Properties>
|
||||||
|
<!--
|
||||||
|
%d{yyyy-MM-dd HH:mm:ss, SSS} : 日志生产时间,输出到毫秒的时间
|
||||||
|
%-5level : 输出日志级别,-5表示左对齐并且固定输出5个字符,如果不足在右边补0
|
||||||
|
%c : logger的名称(%logger)
|
||||||
|
%t : 输出当前线程名称
|
||||||
|
%p : 日志输出格式
|
||||||
|
%m : 日志内容,即 logger.info("message")
|
||||||
|
%n : 换行符
|
||||||
|
%C : Java类名(%F)
|
||||||
|
%L : 行号
|
||||||
|
%M : 方法名
|
||||||
|
%l : 输出语句所在的行数, 包括类名、方法名、文件名、行数
|
||||||
|
hostName : 本地机器名
|
||||||
|
hostAddress : 本地ip地址
|
||||||
|
-->
|
||||||
|
<property name="LOG_PATTERN" value="%date{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{50}:%L - %msg%n"/>
|
||||||
|
<!--日志编码-->
|
||||||
|
<property name="CHARSET" value="utf-8"/>
|
||||||
|
<!--单个日志文件大小-->
|
||||||
|
<property name="MAX_FILE_SIZE" value="200MB"/>
|
||||||
|
<!--日志保存时间-->
|
||||||
|
<property name="MAX_HISTORY" value="P30D"/>
|
||||||
|
<!-- 日志存储路径 -->
|
||||||
|
<property name="FILE_PATH" value="../logs"/>
|
||||||
|
<!--日志文件名,例如拼接完整的日志路径:/data/logs/app/app-info.log-->
|
||||||
|
<property name="FILE_NAME" value="lqfw"/>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<appenders>
|
||||||
|
<Console name="STDOUT" target="SYSTEM_OUT">
|
||||||
|
<!--设置日志格式及颜色-->
|
||||||
|
<PatternLayout
|
||||||
|
pattern="%style{%d{yyyy-MM-dd HH:mm:ss.SSS}}{bright,green} %highlight{%-5level} [%style{%t}{bright,blue}] %style{%C{50}}{bright,yellow}: %msg%n%style{%throwable}{red}"
|
||||||
|
disableAnsi="false" noConsoleNoAnsi="false"/>
|
||||||
|
</Console>
|
||||||
|
|
||||||
|
<RollingFile name="FILE" fileName="${FILE_PATH}/${FILE_NAME}.log"
|
||||||
|
filePattern="${FILE_PATH}/${FILE_NAME}-%d{yyyy-MM-dd}.%i.log.gz">
|
||||||
|
<PatternLayout pattern="${LOG_PATTERN}" charset="${CHARSET}"/>
|
||||||
|
<Policies>
|
||||||
|
<!--每天滚动一次-->
|
||||||
|
<TimeBasedTriggeringPolicy interval="1"/>
|
||||||
|
<!--或者日志达到10MB 滚动一次-->
|
||||||
|
<SizeBasedTriggeringPolicy size="10MB"/>
|
||||||
|
</Policies>
|
||||||
|
<!--日志删除策略-->
|
||||||
|
<!--DefaultRolloverStrategy 默认的max=7 代表的是dd(天)最多产生7个文件,多余自动删除,但是我们会自己定义删除策略所以要屏蔽这个配置,如果不屏蔽这个配置,则当天日志最多只有7个 -->
|
||||||
|
<!--源码:org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy.Builder.build ,当fileIndex=nomax,不在使用max变量 -->
|
||||||
|
<DefaultRolloverStrategy fileIndex="nomax">
|
||||||
|
<Delete basePath="${FILE_PATH}" maxDepth="2">
|
||||||
|
<!--删除,正则匹配到文件名-->
|
||||||
|
<IfFileName glob="${FILE_NAME}-*.html.gz"/>
|
||||||
|
<!--删除,日志距离现在多长事件,P1D代表是1天-->
|
||||||
|
<!--http://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/appender/rolling/action/Duration.html-->
|
||||||
|
<IfLastModified age="P7D"/>
|
||||||
|
</Delete>
|
||||||
|
</DefaultRolloverStrategy>
|
||||||
|
</RollingFile>
|
||||||
|
|
||||||
|
<RollingFile name="HTML" fileName="${FILE_PATH}/error.html"
|
||||||
|
filePattern="${FILE_PATH}/error-%d{yyyy-MM-dd}.%i.html.gz">
|
||||||
|
<!--
|
||||||
|
minLevel:最小日志级别
|
||||||
|
maxLevel:最大日志级别
|
||||||
|
onMatch:匹配成功接收
|
||||||
|
onMismatch:匹配失败丢弃
|
||||||
|
-->
|
||||||
|
<!-- <LevelRangeFilter minLevel="WARN" maxLevel="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>-->
|
||||||
|
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||||
|
<HTMLLayout charset="${CHARSET}"/>
|
||||||
|
<Policies>
|
||||||
|
<!--每天滚动一次,interval的单位 取决于filePattern 这里定义的是dd(天)也就是每天会产生一个新的日志文件 -->
|
||||||
|
<TimeBasedTriggeringPolicy interval="1" />
|
||||||
|
</Policies>
|
||||||
|
<!--日志删除策略-->
|
||||||
|
<DefaultRolloverStrategy max="7" />
|
||||||
|
</RollingFile>
|
||||||
|
|
||||||
|
<RollingFile name="FILE_HTML" fileName="${FILE_PATH}/${FILE_NAME}.html"
|
||||||
|
filePattern="${FILE_PATH}/${FILE_NAME}-%d{yyyy-MM-dd}.%i.html.gz">
|
||||||
|
<HTMLLayout charset="${CHARSET}"/>
|
||||||
|
<Policies>
|
||||||
|
<!--每天滚动一次,interval的单位 取决于filePattern 这里定义的是dd(天)也就是每天会产生一个新的日志文件 -->
|
||||||
|
<TimeBasedTriggeringPolicy interval="1"/>
|
||||||
|
<SizeBasedTriggeringPolicy size="10MB"/>
|
||||||
|
</Policies>
|
||||||
|
<!--日志删除策略-->
|
||||||
|
<DefaultRolloverStrategy max="7" />
|
||||||
|
</RollingFile>
|
||||||
|
|
||||||
|
</appenders>
|
||||||
|
|
||||||
|
<loggers>
|
||||||
|
<!-- logger 用来设置某一个包或者具体的某一个类的日志打印级别、以及指定 -->
|
||||||
|
<!--myibatis log configure -->
|
||||||
|
<logger name="com.apache.ibatis" level="TRACE" />
|
||||||
|
<logger name="java.sql.Connection" level="DEBUG" />
|
||||||
|
<logger name="java.sql.Statement" level="DEBUG" />
|
||||||
|
<logger name="java.sql.PreparedStatement" level="DEBUG" />
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="STDOUT" level="info"/>
|
||||||
|
<appender-ref ref="FILE"/>
|
||||||
|
<appender-ref ref="HTML" />
|
||||||
|
<appender-ref ref="FILE_HTML" />
|
||||||
|
</root>
|
||||||
|
</loggers>
|
||||||
|
|
||||||
|
</configuration>
|
|
@ -5,22 +5,18 @@
|
||||||
|
|
||||||
package org.jeecg.loader.repository;
|
package org.jeecg.loader.repository;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
import ch.qos.logback.classic.Logger;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.cloud.gateway.route.RouteDefinition;
|
import org.springframework.cloud.gateway.route.RouteDefinition;
|
||||||
import org.springframework.cloud.gateway.route.RouteDefinitionRepository;
|
import org.springframework.cloud.gateway.route.RouteDefinitionRepository;
|
||||||
import org.springframework.cloud.gateway.support.NotFoundException;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author qinfeng
|
* @author qinfeng
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -8,10 +8,9 @@
|
||||||
<version>3.5.3</version>
|
<version>3.5.3</version>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<artifactId>jeecg-server-cloud</artifactId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
||||||
<version>2.6.14</version>
|
<version>3.5.3</version>
|
||||||
<relativePath/>
|
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
@ -45,17 +44,14 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.nacos</groupId>
|
<groupId>org.jeecgframework.nacos</groupId>
|
||||||
<artifactId>nacos-naming</artifactId>
|
<artifactId>nacos-naming</artifactId>
|
||||||
<version>2.2.3</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.nacos</groupId>
|
<groupId>org.jeecgframework.nacos</groupId>
|
||||||
<artifactId>nacos-istio</artifactId>
|
<artifactId>nacos-istio</artifactId>
|
||||||
<version>2.2.3</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.nacos</groupId>
|
<groupId>org.jeecgframework.nacos</groupId>
|
||||||
<artifactId>nacos-config</artifactId>
|
<artifactId>nacos-config</artifactId>
|
||||||
<version>2.2.3</version>
|
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.apache.tomcat.embed</groupId>
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
|
@ -70,7 +66,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.nacos</groupId>
|
<groupId>org.jeecgframework.nacos</groupId>
|
||||||
<artifactId>nacos-console</artifactId>
|
<artifactId>nacos-console</artifactId>
|
||||||
<version>2.2.3</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.boot</groupId>
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
<artifactId>jeecg-boot-starter-cloud</artifactId>
|
<artifactId>jeecg-boot-starter-cloud</artifactId>
|
||||||
|
<!-- 3.2版本号后,可选择是否排除jeecg-system-cloud-api,不排除会优先通过fegin调用接口
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-system-cloud-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>-->
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
|
@ -31,16 +38,44 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
||||||
<artifactId>jeecg-system-biz</artifactId>
|
<artifactId>jeecg-system-biz</artifactId>
|
||||||
|
<!-- 排除demo模块,demo模块采用微服务独立启动 -->
|
||||||
|
<!-- <exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-module-demo</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>-->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- feign 熔断限流、分布式锁、xxljob示例
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-cloud-test-more</artifactId>
|
||||||
|
<version>${jeecgboot.version}</version>
|
||||||
|
</dependency>-->
|
||||||
|
<!-- rabbitmq例子
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-cloud-test-rabbitmq</artifactId>
|
||||||
|
<version>${jeecgboot.version}</version>
|
||||||
|
</dependency>-->
|
||||||
|
<!-- 分布式事务例子
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-cloud-test-seata</artifactId>
|
||||||
|
<version>${jeecgboot.version}</version>
|
||||||
|
</dependency>-->
|
||||||
|
<!-- 分库分表例子
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-cloud-test-shardingsphere</artifactId>
|
||||||
|
<version>${jeecgboot.version}</version>
|
||||||
|
</dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
<groupId>org.jeecgframework.boot.lqfw</groupId>
|
||||||
<artifactId>com.foresee.lqfw.sdk</artifactId>
|
<artifactId>jeecg-module-lqfw</artifactId>
|
||||||
<version>${jeecgboot.version}</version>
|
<version>${jeecgboot.version}</version>
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>
|
|
||||||
${pom.basedir}/../../lib/com.foresee.lqfw.sdk-3.5.3.jar
|
|
||||||
</systemPath>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
<artifactId>jeecg-server-cloud</artifactId>
|
<artifactId>jeecg-server-cloud</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>JEECG SERVER CLOUD</name>
|
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>jeecg-cloud-gateway</module>
|
<module>jeecg-cloud-gateway</module>
|
||||||
|
|
Binary file not shown.
126
pom.xml
126
pom.xml
|
@ -14,12 +14,6 @@
|
||||||
<relativePath/>
|
<relativePath/>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<scm>
|
|
||||||
<connection>http://www.jeecg.com</connection>
|
|
||||||
<developerConnection>https://qiaoqiaoyun.com</developerConnection>
|
|
||||||
<url>http://www.jeecg.com/vip</url>
|
|
||||||
</scm>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
@ -28,6 +22,7 @@
|
||||||
|
|
||||||
<jeecgboot.version>3.5.3</jeecgboot.version>
|
<jeecgboot.version>3.5.3</jeecgboot.version>
|
||||||
|
|
||||||
|
<logback.version>1.3.14</logback.version>
|
||||||
<lombok.version>1.18.24</lombok.version>
|
<lombok.version>1.18.24</lombok.version>
|
||||||
<mapstruct.version>1.5.2.Final</mapstruct.version>
|
<mapstruct.version>1.5.2.Final</mapstruct.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
@ -38,7 +33,6 @@
|
||||||
<module>jeecg-boot-base-core</module>
|
<module>jeecg-boot-base-core</module>
|
||||||
<module>jeecg-module-system</module>
|
<module>jeecg-module-system</module>
|
||||||
<module>jeecg-module-cspt</module>
|
<module>jeecg-module-cspt</module>
|
||||||
<module>jeecg-module-lqfw</module>
|
|
||||||
<module>jeecg-module-deliver</module>
|
<module>jeecg-module-deliver</module>
|
||||||
<module>jeecg-server-cloud</module>
|
<module>jeecg-server-cloud</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
@ -79,6 +73,27 @@
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- log4j2 begin -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-logging</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- log4j2 end -->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>ch.qos.logback</groupId>-->
|
||||||
|
<!-- <artifactId>logback-classic</artifactId>-->
|
||||||
|
<!-- <version>${logback.version}</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
|
@ -100,6 +115,99 @@
|
||||||
<artifactId>mapstruct-processor</artifactId>
|
<artifactId>mapstruct-processor</artifactId>
|
||||||
<version>${mapstruct.version}</version>
|
<version>${mapstruct.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpasyncclient</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.ulisesbocchio</groupId>
|
||||||
|
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.ofdrw</groupId>
|
||||||
|
<artifactId>ofdrw-full</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-collections</groupId>
|
||||||
|
<artifactId>commons-collections</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.huaweicloud</groupId>
|
||||||
|
<artifactId>esdk-obs-java</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.coobird</groupId>
|
||||||
|
<artifactId>thumbnailator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.javacrumbs.shedlock</groupId>
|
||||||
|
<artifactId>shedlock-spring</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!--每个外部存储实例所需依赖包不一样,这里是jdbc-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.javacrumbs.shedlock</groupId>
|
||||||
|
<artifactId>shedlock-provider-jdbc-template</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.velocity</groupId>
|
||||||
|
<artifactId>velocity-engine-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcpkix-jdk15on</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.itextpdf</groupId>
|
||||||
|
<artifactId>itextpdf</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.itextpdf</groupId>
|
||||||
|
<artifactId>font-asian</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.openhtmltopdf</groupId>
|
||||||
|
<artifactId>openhtmltopdf-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.openhtmltopdf</groupId>
|
||||||
|
<artifactId>openhtmltopdf-pdfbox</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sourceforge.htmlunit</groupId>
|
||||||
|
<artifactId>htmlunit</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
|
<artifactId>tomcat-embed-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okio</groupId>
|
||||||
|
<artifactId>okio</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.pagehelper</groupId>
|
||||||
|
<artifactId>pagehelper</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yomahub</groupId>
|
||||||
|
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
@ -164,6 +272,7 @@
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
<excludes>
|
<excludes>
|
||||||
|
<exclude>config/bootstrap*.yml</exclude>
|
||||||
<exclude>application*.yml</exclude>
|
<exclude>application*.yml</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</resource>
|
</resource>
|
||||||
|
@ -171,6 +280,8 @@
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
<includes>
|
<includes>
|
||||||
|
<include>config/bootstrap.yml</include>
|
||||||
|
<include>config/bootstrap-${profile.name}.yml</include>
|
||||||
<include>application.yml</include>
|
<include>application.yml</include>
|
||||||
<include>application-${profile.name}.yml</include>
|
<include>application-${profile.name}.yml</include>
|
||||||
</includes>
|
</includes>
|
||||||
|
@ -182,7 +293,6 @@
|
||||||
<include>**/*.json</include>
|
<include>**/*.json</include>
|
||||||
<include>**/*.ftl</include>
|
<include>**/*.ftl</include>
|
||||||
<include>**/*.yml</include>
|
<include>**/*.yml</include>
|
||||||
|
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue