parent
07a3bbdd34
commit
482a91dc2c
@ -1,94 +0,0 @@
|
||||
package com.bs.cm.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.bs.common.annotation.Excel;
|
||||
import com.bs.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 附件信息对象 cm_attach
|
||||
*
|
||||
* @author bs
|
||||
* @date 2024-03-03
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("cm_attach")
|
||||
@Data
|
||||
public class CmAttach extends BaseEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户id */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long id;
|
||||
|
||||
/** 文件组id */
|
||||
|
||||
@Excel(name = "文件组id")
|
||||
@ApiModelProperty(value = "文件组id")
|
||||
private String fileId;
|
||||
|
||||
/** 文件排序 */
|
||||
|
||||
@Excel(name = "文件排序")
|
||||
@ApiModelProperty(value = "文件排序")
|
||||
private Integer fileSort;
|
||||
|
||||
/** 文件名称(编译后) */
|
||||
|
||||
@Excel(name = "文件名称", readConverterExp = "编=译后")
|
||||
@ApiModelProperty(value = "文件名称(编译后)")
|
||||
private String attachName;
|
||||
|
||||
/** 文件类型 */
|
||||
|
||||
@Excel(name = "文件类型")
|
||||
@ApiModelProperty(value = "文件类型")
|
||||
private String attachFileType;
|
||||
|
||||
/** 文件编码类型 */
|
||||
|
||||
@Excel(name = "文件编码类型")
|
||||
@ApiModelProperty(value = "文件编码类型")
|
||||
private String attachContentType;
|
||||
|
||||
/** 文件大小 */
|
||||
|
||||
@Excel(name = "文件大小")
|
||||
@ApiModelProperty(value = "文件大小")
|
||||
private Long attachFileSize;
|
||||
|
||||
/** 文件路径 */
|
||||
|
||||
@Excel(name = "文件路径")
|
||||
@ApiModelProperty(value = "文件路径")
|
||||
private String attachFileUrl;
|
||||
|
||||
/** 文件名(原始) */
|
||||
|
||||
@Excel(name = "文件名", readConverterExp = "原=始")
|
||||
@ApiModelProperty(value = "文件名(原始)")
|
||||
private String oldName;
|
||||
|
||||
/** 文件版本号 */
|
||||
|
||||
@Excel(name = "文件版本号")
|
||||
@ApiModelProperty(value = "文件版本号")
|
||||
private String versionNo;
|
||||
|
||||
/** 备注 */
|
||||
|
||||
@Excel(name = "备注")
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package com.bs.cm.mapper;
|
||||
|
||||
import com.bs.common.mybatis.mapper.BaseMapperX;
|
||||
import com.bs.cm.domain.CmAttach;
|
||||
|
||||
/**
|
||||
* 附件信息Mapper接口
|
||||
*
|
||||
* @author bs
|
||||
* @date 2024-03-03
|
||||
*/
|
||||
public interface CmAttachMapper extends BaseMapperX<CmAttach> {
|
||||
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package com.bs.cm.service;
|
||||
|
||||
import com.bs.cm.domain.CmAttach;
|
||||
import com.bs.common.core.domain.AjaxResult;
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
|
||||
/**
|
||||
* 附件信息Service接口
|
||||
*
|
||||
* @author bs
|
||||
* @date 2024-03-03
|
||||
*/
|
||||
public interface ICmAttachService extends MPJBaseService<CmAttach>{
|
||||
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.bs.cm.service.impl;
|
||||
|
||||
import com.bs.cm.mapper.CmAttachMapper;
|
||||
import com.bs.cm.domain.CmAttach;
|
||||
import com.bs.cm.service.ICmAttachService;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
/**
|
||||
* 附件信息Service业务层处理
|
||||
*
|
||||
* @author bs
|
||||
* @date 2024-03-03
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class CmAttachServiceImpl extends MPJBaseServiceImpl<CmAttachMapper, CmAttach> implements ICmAttachService {
|
||||
|
||||
}
|
@ -1,231 +0,0 @@
|
||||
package com.bs.web.controller.system;
|
||||
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.bs.common.annotation.Log;
|
||||
import com.bs.common.config.BsConfig;
|
||||
import com.bs.common.core.controller.BaseController;
|
||||
import com.bs.common.core.domain.AjaxResult;
|
||||
import com.bs.common.core.domain.entity.TenantConfig;
|
||||
import com.bs.common.core.page.TableDataInfo;
|
||||
import com.bs.common.enums.BusinessType;
|
||||
import com.bs.common.utils.file.FileUploadUtils;
|
||||
import com.bs.common.utils.file.MimeTypeUtils;
|
||||
import com.bs.common.utils.poi.ExcelUtil;
|
||||
import com.bs.system.service.ITenantConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户配置Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-04-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/tenant/config")
|
||||
public class TenantConfigController extends BaseController {
|
||||
@Autowired
|
||||
private ITenantConfigService tenantConfigService;
|
||||
|
||||
/**
|
||||
* 分页查询租户配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tenant:config:pageList')")
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(TenantConfig tenantConfig) {
|
||||
startPage();
|
||||
LambdaQueryWrapper<TenantConfig> queryWrapper = new LambdaQueryWrapper();
|
||||
condition(queryWrapper, tenantConfig);
|
||||
List<TenantConfig> list = tenantConfigService.list(queryWrapper);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tenant:config:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(TenantConfig tenantConfig) {
|
||||
LambdaQueryWrapper<TenantConfig> queryWrapper = new LambdaQueryWrapper();
|
||||
condition(queryWrapper, tenantConfig);
|
||||
List<TenantConfig> list = tenantConfigService.list(queryWrapper);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出租户配置列表
|
||||
*/
|
||||
@Log(title = "租户配置导出", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TenantConfig tenantConfig) {
|
||||
LambdaQueryWrapper<TenantConfig> queryWrapper = new LambdaQueryWrapper();
|
||||
condition(queryWrapper, tenantConfig);
|
||||
List<TenantConfig> list = tenantConfigService.list(queryWrapper);
|
||||
ExcelUtil<TenantConfig> util = new ExcelUtil<TenantConfig>(TenantConfig.class);
|
||||
util.exportExcel(response, list, "租户配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户配置详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
TenantConfig tenantConfig = tenantConfigService.getById(id);
|
||||
tenantConfig.setTenantId(tenantConfig.getId()) ;
|
||||
return success(tenantConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户配置
|
||||
*/
|
||||
@Log(title = "租户配置新增", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TenantConfig tenantConfig) {
|
||||
tenantConfig.setId(tenantConfig.getTenantId()) ;
|
||||
return toAjax(tenantConfigService.save(tenantConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户配置
|
||||
*/
|
||||
@Log(title = "租户配置修改", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TenantConfig tenantConfig) {
|
||||
tenantConfig.setId(tenantConfig.getTenantId()) ;
|
||||
return toAjax(tenantConfigService.updateById(tenantConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户配置
|
||||
*/
|
||||
@Log(title = "租户配置删除", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(tenantConfigService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户logo图片上传
|
||||
*/
|
||||
@Log(title = "租户logo图片上传", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/logo")
|
||||
public AjaxResult avatar(@RequestParam("tenantLogo") MultipartFile file) throws Exception {
|
||||
if (!file.isEmpty()) {
|
||||
String logo = FileUploadUtils.upload(BsConfig.getUploadPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
AjaxResult ajax = success();
|
||||
ajax.put("imgUrl", logo);
|
||||
return ajax;
|
||||
}
|
||||
return error("上传图片异常,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 条件设置
|
||||
*/
|
||||
private void condition(LambdaQueryWrapper<TenantConfig> queryWrapper, TenantConfig tenantConfig) {
|
||||
|
||||
|
||||
//${column.columnComment}
|
||||
if (Validator.isNotEmpty(tenantConfig.getId())) {
|
||||
queryWrapper.eq(TenantConfig::getId, tenantConfig.getId());
|
||||
}
|
||||
|
||||
//开始时间
|
||||
if (tenantConfig.getStartData() != null) {
|
||||
queryWrapper.eq(TenantConfig::getStartData, tenantConfig.getStartData());
|
||||
}
|
||||
|
||||
//结束时间
|
||||
if (tenantConfig.getStopData() != null) {
|
||||
queryWrapper.eq(TenantConfig::getStopData, tenantConfig.getStopData());
|
||||
}
|
||||
|
||||
//是否限制用户数
|
||||
if (Validator.isNotEmpty(tenantConfig.getIsUserAstrict())) {
|
||||
queryWrapper.eq(TenantConfig::getIsUserAstrict, tenantConfig.getIsUserAstrict());
|
||||
}
|
||||
|
||||
//用户数
|
||||
if (tenantConfig.getUserQuantity() != null) {
|
||||
queryWrapper.eq(TenantConfig::getUserQuantity, tenantConfig.getUserQuantity());
|
||||
}
|
||||
|
||||
//是否限制在线数
|
||||
if (Validator.isNotEmpty(tenantConfig.getIsOnLine())) {
|
||||
queryWrapper.eq(TenantConfig::getIsOnLine, tenantConfig.getIsOnLine());
|
||||
}
|
||||
|
||||
//在线数
|
||||
if (tenantConfig.getOnLineUserQuantity() != null) {
|
||||
queryWrapper.eq(TenantConfig::getOnLineUserQuantity, tenantConfig.getOnLineUserQuantity());
|
||||
}
|
||||
|
||||
//是否定义系统名称
|
||||
if (Validator.isNotEmpty(tenantConfig.getIsDefinitionName())) {
|
||||
queryWrapper.eq(TenantConfig::getIsDefinitionName, tenantConfig.getIsDefinitionName());
|
||||
}
|
||||
|
||||
//系统名称
|
||||
if (Validator.isNotEmpty(tenantConfig.getSysName())) {
|
||||
queryWrapper.like(TenantConfig::getSysName, tenantConfig.getSysName());
|
||||
}
|
||||
|
||||
//是否定义系统logo
|
||||
if (Validator.isNotEmpty(tenantConfig.getIsDefinitionLogo())) {
|
||||
queryWrapper.eq(TenantConfig::getIsDefinitionLogo, tenantConfig.getIsDefinitionLogo());
|
||||
}
|
||||
|
||||
//系统log
|
||||
if (Validator.isNotEmpty(tenantConfig.getSysLog())) {
|
||||
queryWrapper.eq(TenantConfig::getSysLog, tenantConfig.getSysLog());
|
||||
}
|
||||
|
||||
//是否定义系统色调
|
||||
if (Validator.isNotEmpty(tenantConfig.getIsDefinitionHue())) {
|
||||
queryWrapper.eq(TenantConfig::getIsDefinitionHue, tenantConfig.getIsDefinitionHue());
|
||||
}
|
||||
|
||||
//系统色调
|
||||
if (Validator.isNotEmpty(tenantConfig.getSysHue())) {
|
||||
queryWrapper.eq(TenantConfig::getSysHue, tenantConfig.getSysHue());
|
||||
}
|
||||
|
||||
//定制化数据,键值对{key:{type1:"",type2:"",value:""},key2:{type1:"",type2:"",value:""}}具体操作时候,做具体说明
|
||||
if (Validator.isNotEmpty(tenantConfig.getCustomizationFields())) {
|
||||
queryWrapper.eq(TenantConfig::getCustomizationFields, tenantConfig.getCustomizationFields());
|
||||
}
|
||||
|
||||
|
||||
//创建人员
|
||||
if (Validator.isNotEmpty(tenantConfig.getCreateBy())) {
|
||||
queryWrapper.eq(TenantConfig::getCreateBy, tenantConfig.getCreateBy());
|
||||
}
|
||||
|
||||
|
||||
//修改人员
|
||||
if (Validator.isNotEmpty(tenantConfig.getUpdateBy())) {
|
||||
queryWrapper.eq(TenantConfig::getUpdateBy, tenantConfig.getUpdateBy());
|
||||
}
|
||||
|
||||
|
||||
//部门ID
|
||||
if (Validator.isNotEmpty(tenantConfig.getCreateDept())) {
|
||||
queryWrapper.eq(TenantConfig::getCreateDept, tenantConfig.getCreateDept());
|
||||
}
|
||||
|
||||
//删除标示 默认为1 有效数据 ,0为无效已删除
|
||||
if (Validator.isNotEmpty(tenantConfig.getDelFlag())) {
|
||||
queryWrapper.eq(TenantConfig::getDelFlag, tenantConfig.getDelFlag());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,68 +1,61 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
#url: jdbc:mysql://124.71.134.146:63306/bs-jxc-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
|
||||
#username: root
|
||||
#password: fastrise@chain
|
||||
url: jdbc:mysql://localhost:3306/my-base?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: abcd123
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: bs
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
bs:
|
||||
tenant:
|
||||
#开启租户
|
||||
openTenant: true
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/bs-jxc-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: abcd123
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: bs
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
|
@ -1,68 +0,0 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
#url: jdbc:mysql://124.71.134.146:63306/bs-jxc-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
|
||||
#username: root
|
||||
#password: fastrise@chain
|
||||
url: jdbc:mysql://localhost:3306/bs-jxc-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: abcd123
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: bs
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
bs:
|
||||
tenant:
|
||||
#关闭租户
|
||||
openTenant: false
|
@ -1,66 +0,0 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://124.71.134.146:63306/bs-jxc-prot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: fastrise@chain
|
||||
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: bs
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
bs:
|
||||
tenant:
|
||||
#开启租户
|
||||
openTenant: true
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bs.cm.mapper.CmAttachMapper">
|
||||
|
||||
</mapper>
|
@ -1,57 +0,0 @@
|
||||
|
||||
package com.bs.common.core.domain.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.bs.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SysTenant extends BaseEntity {
|
||||
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String name;
|
||||
private String simpleName;
|
||||
private String contactUser;
|
||||
private String contactPhone;
|
||||
private Integer status;
|
||||
private String userName;
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "行政区划")
|
||||
private String areaCode;
|
||||
/**
|
||||
* 所有模块集合
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String systemNames;
|
||||
@TableField(exist = false)
|
||||
private Long tenantId;
|
||||
@TableField(exist = false)
|
||||
private String deptId;
|
||||
@TableField(exist = false)
|
||||
private TenantConfig tenantConfig;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 所属系统
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<String> systems;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String areaName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<Long> roleIds;
|
||||
|
||||
|
||||
}
|
@ -1,137 +0,0 @@
|
||||
package com.bs.common.utils;
|
||||
|
||||
|
||||
public class OsInfoUtil {
|
||||
private static String OS = System.getProperty("os.name").toLowerCase();
|
||||
|
||||
private static OsInfoUtil _instance = new OsInfoUtil();
|
||||
|
||||
private SystemEnum platform;
|
||||
|
||||
private OsInfoUtil() {
|
||||
}
|
||||
|
||||
public static boolean isLinux() {
|
||||
return OS.indexOf("linux") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isMacOS() {
|
||||
return OS.indexOf("mac") >= 0 && OS.indexOf("os") > 0 && OS.indexOf("x") < 0;
|
||||
}
|
||||
|
||||
public static boolean isMacOSX() {
|
||||
return OS.indexOf("mac") >= 0 && OS.indexOf("os") > 0 && OS.indexOf("x") > 0;
|
||||
}
|
||||
|
||||
public static boolean isWindows() {
|
||||
return OS.indexOf("windows") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isOS2() {
|
||||
return OS.indexOf("os/2") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isSolaris() {
|
||||
return OS.indexOf("solaris") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isSunOS() {
|
||||
return OS.indexOf("sunos") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isMPEiX() {
|
||||
return OS.indexOf("mpe/ix") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isHPUX() {
|
||||
return OS.indexOf("hp-ux") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isAix() {
|
||||
return OS.indexOf("aix") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isOS390() {
|
||||
return OS.indexOf("os/390") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isFreeBSD() {
|
||||
return OS.indexOf("freebsd") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isIrix() {
|
||||
return OS.indexOf("irix") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isDigitalUnix() {
|
||||
return OS.indexOf("digital") >= 0 && OS.indexOf("unix") > 0;
|
||||
}
|
||||
|
||||
public static boolean isNetWare() {
|
||||
return OS.indexOf("netware") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isOSF1() {
|
||||
return OS.indexOf("osf1") >= 0;
|
||||
}
|
||||
|
||||
public static boolean isOpenVMS() {
|
||||
return OS.indexOf("openvms") >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取操作系统名字
|
||||
*
|
||||
* @return 操作系统名
|
||||
*/
|
||||
public static SystemEnum getOSname() {
|
||||
if (isAix()) {
|
||||
_instance.platform = SystemEnum.AIX;
|
||||
} else if (isDigitalUnix()) {
|
||||
_instance.platform = SystemEnum.DIGITAL_UNIX;
|
||||
} else if (isFreeBSD()) {
|
||||
_instance.platform = SystemEnum.FreeBSD;
|
||||
} else if (isHPUX()) {
|
||||
_instance.platform = SystemEnum.HP_UX;
|
||||
} else if (isIrix()) {
|
||||
_instance.platform = SystemEnum.IRIX;
|
||||
} else if (isLinux()) {
|
||||
_instance.platform = SystemEnum.LINUX;
|
||||
} else if (isMacOS()) {
|
||||
_instance.platform = SystemEnum.MAC_OS;
|
||||
} else if (isMacOSX()) {
|
||||
_instance.platform = SystemEnum.MAC_OS_X;
|
||||
} else if (isMPEiX()) {
|
||||
_instance.platform = SystemEnum.MPEiX;
|
||||
} else if (isNetWare()) {
|
||||
_instance.platform = SystemEnum.NETWARE_411;
|
||||
} else if (isOpenVMS()) {
|
||||
_instance.platform = SystemEnum.OPENVMS;
|
||||
} else if (isOS2()) {
|
||||
_instance.platform = SystemEnum.OS2;
|
||||
} else if (isOS390()) {
|
||||
_instance.platform = SystemEnum.OS390;
|
||||
} else if (isOSF1()) {
|
||||
_instance.platform = SystemEnum.OSF1;
|
||||
} else if (isSolaris()) {
|
||||
_instance.platform = SystemEnum.SOLARIS;
|
||||
} else if (isSunOS()) {
|
||||
_instance.platform = SystemEnum.SUNOS;
|
||||
} else if (isWindows()) {
|
||||
_instance.platform = SystemEnum.WINDOWS;
|
||||
} else {
|
||||
_instance.platform = SystemEnum.OTHERS;
|
||||
}
|
||||
return _instance.platform;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
System.out.println(OsInfoUtil.getOSname());// 获取系统类型
|
||||
System.out.println(OsInfoUtil.isMacOSX());// 判断是否为windows系统
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
package com.bs.common.utils;
|
||||
|
||||
public enum SystemEnum {
|
||||
|
||||
ANY("any"),
|
||||
LINUX("Linux"),
|
||||
MAC_OS("Mac OS"),
|
||||
MAC_OS_X("Mac OS X"),
|
||||
WINDOWS("Windows"),
|
||||
OS2("OS/2"),
|
||||
SOLARIS("Solaris"),
|
||||
SUNOS("SunOS"),
|
||||
MPEiX("MPE/iX"),
|
||||
HP_UX("HP-UX"),
|
||||
AIX("AIX"),
|
||||
OS390("OS/390"),
|
||||
FreeBSD("FreeBSD"),
|
||||
IRIX("Irix"),
|
||||
DIGITAL_UNIX("Digital Unix"),
|
||||
NETWARE_411("NetWare"),
|
||||
OSF1("OSF1"),
|
||||
OPENVMS("OpenVMS"),
|
||||
OTHERS("Others");
|
||||
|
||||
SystemEnum(String desc) {
|
||||
this.description = desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return description;
|
||||
}
|
||||
|
||||
private String description;
|
||||
|
||||
}
|
@ -1,187 +0,0 @@
|
||||
package com.bs.common.utils.collection;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BinaryOperator;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Collection 工具类
|
||||
*
|
||||
* hasPermi
|
||||
*/
|
||||
public class CollectionUtils {
|
||||
|
||||
public static boolean containsAny(Object source, Object... targets) {
|
||||
return Arrays.asList(targets).contains(source);
|
||||
}
|
||||
|
||||
public static boolean isAnyEmpty(Collection<?>... collections) {
|
||||
return Arrays.stream(collections).anyMatch(CollectionUtil::isEmpty);
|
||||
}
|
||||
|
||||
public static <T> List<T> filterList(Collection<T> from, Predicate<T> predicate) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return from.stream().filter(predicate).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static <T, R> List<T> distinct(Collection<T> from, Function<T, R> keyMapper) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return distinct(from, keyMapper, (t1, t2) -> t1);
|
||||
}
|
||||
|
||||
public static <T, R> List<T> distinct(Collection<T> from, Function<T, R> keyMapper, BinaryOperator<T> cover) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return new ArrayList<>(convertMap(from, keyMapper, Function.identity(), cover).values());
|
||||
}
|
||||
|
||||
public static <T, U> List<U> convertList(Collection<T> from, Function<T, U> func) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return from.stream().map(func).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static <T, U> List<U> convertList(Collection<T> from, Function<T, U> func, Predicate<T> filter) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return from.stream().filter(filter).map(func).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static <T, U> Set<U> convertSet(Collection<T> from, Function<T, U> func) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new HashSet<>();
|
||||
}
|
||||
return from.stream().map(func).filter(Objects::nonNull).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
public static <T, U> Set<U> convertSet(Collection<T> from, Function<T, U> func, Predicate<T> filter) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new HashSet<>();
|
||||
}
|
||||
return from.stream().filter(filter).map(func).filter(Objects::nonNull).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
public static <T, K> Map<K, T> convertMap(Collection<T> from, Function<T, K> keyFunc) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return convertMap(from, keyFunc, Function.identity());
|
||||
}
|
||||
|
||||
public static <T, K> Map<K, T> convertMap(Collection<T> from, Function<T, K> keyFunc, Supplier<? extends Map<K, T>> supplier) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return supplier.get();
|
||||
}
|
||||
return convertMap(from, keyFunc, Function.identity(), supplier);
|
||||
}
|
||||
|
||||
public static <T, K, V> Map<K, V> convertMap(Collection<T> from, Function<T, K> keyFunc, Function<T, V> valueFunc) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return convertMap(from, keyFunc, valueFunc, (v1, v2) -> v1);
|
||||
}
|
||||
|
||||
public static <T, K, V> Map<K, V> convertMap(Collection<T> from, Function<T, K> keyFunc, Function<T, V> valueFunc, BinaryOperator<V> mergeFunction) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return convertMap(from, keyFunc, valueFunc, mergeFunction, HashMap::new);
|
||||
}
|
||||
|
||||
public static <T, K, V> Map<K, V> convertMap(Collection<T> from, Function<T, K> keyFunc, Function<T, V> valueFunc, Supplier<? extends Map<K, V>> supplier) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return supplier.get();
|
||||
}
|
||||
return convertMap(from, keyFunc, valueFunc, (v1, v2) -> v1, supplier);
|
||||
}
|
||||
|
||||
public static <T, K, V> Map<K, V> convertMap(Collection<T> from, Function<T, K> keyFunc, Function<T, V> valueFunc, BinaryOperator<V> mergeFunction, Supplier<? extends Map<K, V>> supplier) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return from.stream().collect(Collectors.toMap(keyFunc, valueFunc, mergeFunction, supplier));
|
||||
}
|
||||
|
||||
public static <T, K> Map<K, List<T>> convertMultiMap(Collection<T> from, Function<T, K> keyFunc) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return from.stream().collect(Collectors.groupingBy(keyFunc, Collectors.mapping(t -> t, Collectors.toList())));
|
||||
}
|
||||
|
||||
public static <T, K, V> Map<K, List<V>> convertMultiMap(Collection<T> from, Function<T, K> keyFunc, Function<T, V> valueFunc) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return from.stream()
|
||||
.collect(Collectors.groupingBy(keyFunc, Collectors.mapping(valueFunc, Collectors.toList())));
|
||||
}
|
||||
|
||||
// 暂时没想好名字,先以 2 结尾噶
|
||||
public static <T, K, V> Map<K, Set<V>> convertMultiMap2(Collection<T> from, Function<T, K> keyFunc, Function<T, V> valueFunc) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return from.stream().collect(Collectors.groupingBy(keyFunc, Collectors.mapping(valueFunc, Collectors.toSet())));
|
||||
}
|
||||
|
||||
public static <T, K> Map<K, T> convertImmutableMap(Collection<T> from, Function<T, K> keyFunc) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
ImmutableMap.Builder<K, T> builder = ImmutableMap.builder();
|
||||
from.forEach(item -> builder.put(keyFunc.apply(item), item));
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static boolean containsAny(Collection<?> source, Collection<?> candidates) {
|
||||
return org.springframework.util.CollectionUtils.containsAny(source, candidates);
|
||||
}
|
||||
|
||||
public static <T> T getFirst(List<T> from) {
|
||||
return !CollectionUtil.isEmpty(from) ? from.get(0) : null;
|
||||
}
|
||||
|
||||
public static <T> T findFirst(List<T> from, Predicate<T> predicate) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return null;
|
||||
}
|
||||
return from.stream().filter(predicate).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
public static <T, V extends Comparable<? super V>> V getMaxValue(List<T> from, Function<T, V> valueFunc) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return null;
|
||||
}
|
||||
assert from.size() > 0; // 断言,避免告警
|
||||
T t = from.stream().max(Comparator.comparing(valueFunc)).get();
|
||||
return valueFunc.apply(t);
|
||||
}
|
||||
|
||||
public static <T> void addIfNotNull(Collection<T> coll, T item) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
coll.add(item);
|
||||
}
|
||||
|
||||
public static <T> Collection<T> singleton(T deptId) {
|
||||
return deptId == null ? Collections.emptyList() : Collections.singleton(deptId);
|
||||
}
|
||||
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
package com.bs.generator.util;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder;
|
||||
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
|
||||
import com.baomidou.mybatisplus.generator.config.rules.DateType;
|
||||
import com.bs.common.utils.spring.SpringUtils;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class GenTableUtils {
|
||||
|
||||
private static final String DATASOURCE_DYNAMIC_KEY = "spring.datasource.druid.master";
|
||||
|
||||
public static Environment environment = SpringUtils.getBean(Environment.class);
|
||||
|
||||
public static List<TableInfo> getTableList(String nameLike, String commentLike) {
|
||||
List<TableInfo> tables = getTableList0(null);
|
||||
return tables.stream().filter(tableInfo -> (StrUtil.isEmpty(nameLike) || tableInfo.getName().contains(nameLike))
|
||||
&& (StrUtil.isEmpty(commentLike) || tableInfo.getComment().contains(commentLike)))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static TableInfo getTable(String name) {
|
||||
return CollUtil.getFirst(getTableList0(name));
|
||||
}
|
||||
|
||||
public static List<TableInfo> getTableList0(String name) {
|
||||
String url = environment.getProperty(DATASOURCE_DYNAMIC_KEY + ".url");
|
||||
String username = environment.getProperty(DATASOURCE_DYNAMIC_KEY + ".username");
|
||||
String password = environment.getProperty(DATASOURCE_DYNAMIC_KEY + ".password");
|
||||
// 使用 MyBatis Plus Generator 解析表结构
|
||||
DataSourceConfig dataSourceConfig = new DataSourceConfig.Builder(url, username,
|
||||
password).build();
|
||||
StrategyConfig.Builder strategyConfig = new StrategyConfig.Builder();
|
||||
if (StrUtil.isNotEmpty(name)) {
|
||||
strategyConfig.addInclude(name);
|
||||
}
|
||||
// 只使用 Date 类型,不使用 LocalDate
|
||||
GlobalConfig globalConfig = new GlobalConfig.Builder().dateType(DateType.ONLY_DATE).build();
|
||||
ConfigBuilder builder = new ConfigBuilder(null, dataSourceConfig, strategyConfig.build(),
|
||||
null, globalConfig, null);
|
||||
// 按照名字排序
|
||||
List<TableInfo> tables = builder.getTableInfoList();
|
||||
tables.sort(Comparator.comparing(TableInfo::getName));
|
||||
return tables;
|
||||
}
|
||||
|
||||
}
|
@ -1,14 +1,60 @@
|
||||
package com.bs.system.mapper;
|
||||
|
||||
import com.bs.common.mybatis.mapper.BaseMapperX;
|
||||
import java.util.List;
|
||||
import com.bs.system.domain.SysNotice;
|
||||
|
||||
/**
|
||||
* 通知公告Mapper接口
|
||||
* 通知公告表 数据层
|
||||
*
|
||||
* @author bs
|
||||
* @date 2023-08-06
|
||||
*/
|
||||
public interface SysNoticeMapper extends BaseMapperX<SysNotice> {
|
||||
public interface SysNoticeMapper
|
||||
{
|
||||
/**
|
||||
* 查询公告信息
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @return 公告信息
|
||||
*/
|
||||
public SysNotice selectNoticeById(Long noticeId);
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 公告集合
|
||||
*/
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 新增公告
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNotice(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 修改公告
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNotice(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 批量删除公告
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeById(Long noticeId);
|
||||
|
||||
/**
|
||||
* 批量删除公告信息
|
||||
*
|
||||
* @param noticeIds 需要删除的公告ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeByIds(Long[] noticeIds);
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
|
||||
package com.bs.system.mapper;
|
||||
|
||||
|
||||
import com.bs.common.core.domain.entity.SysTenant;
|
||||
import com.bs.common.mybatis.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysTenantMapper extends BaseMapperX<SysTenant> {
|
||||
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package com.bs.system.mapper;
|
||||
|
||||
|
||||
import com.bs.common.core.domain.entity.TenantConfig;
|
||||
import com.bs.common.mybatis.mapper.BaseMapperX;
|
||||
|
||||
/**
|
||||
* 租户配置Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-04-02
|
||||
*/
|
||||
public interface TenantConfigMapper extends BaseMapperX<TenantConfig> {
|
||||
|
||||
}
|
@ -1,14 +1,60 @@
|
||||
package com.bs.system.service;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import java.util.List;
|
||||
import com.bs.system.domain.SysNotice;
|
||||
|
||||
/**
|
||||
* 通知公告Service接口
|
||||
* 公告 服务层
|
||||
*
|
||||
* @author bs
|
||||
* @date 2023-08-06
|
||||
*/
|
||||
public interface ISysNoticeService extends MPJBaseService<SysNotice>{
|
||||
public interface ISysNoticeService
|
||||
{
|
||||
/**
|
||||
* 查询公告信息
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @return 公告信息
|
||||
*/
|
||||
public SysNotice selectNoticeById(Long noticeId);
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 公告集合
|
||||
*/
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 新增公告
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNotice(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 修改公告
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNotice(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 删除公告信息
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeById(Long noticeId);
|
||||
|
||||
/**
|
||||
* 批量删除公告信息
|
||||
*
|
||||
* @param noticeIds 需要删除的公告ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeByIds(Long[] noticeIds);
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
package com.bs.system.service;
|
||||
|
||||
|
||||
import com.bs.common.core.domain.entity.TenantConfig;
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
|
||||
/**
|
||||
* 租户配置Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-04-02
|
||||
*/
|
||||
public interface ITenantConfigService extends MPJBaseService<TenantConfig> {
|
||||
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
|
||||
package com.bs.system.service;
|
||||
|
||||
|
||||
import com.bs.common.core.domain.entity.SysTenant;
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysTenantService extends MPJBaseService<SysTenant> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tenant
|
||||
* @return
|
||||
*/
|
||||
int disableTenant(SysTenant tenant);
|
||||
}
|
@ -1,19 +1,92 @@
|
||||
package com.bs.system.service.impl;
|
||||
|
||||
import com.bs.system.mapper.SysNoticeMapper;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bs.system.domain.SysNotice;
|
||||
import com.bs.system.mapper.SysNoticeMapper;
|
||||
import com.bs.system.service.ISysNoticeService;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 通知公告Service业务层处理
|
||||
* 公告 服务层实现
|
||||
*
|
||||
* @author bs
|
||||
* @date 2023-08-06
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SysNoticeServiceImpl extends MPJBaseServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService {
|
||||
public class SysNoticeServiceImpl implements ISysNoticeService
|
||||
{
|
||||
@Autowired
|
||||
private SysNoticeMapper noticeMapper;
|
||||
|
||||
/**
|
||||
* 查询公告信息
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @return 公告信息
|
||||
*/
|
||||
@Override
|
||||
public SysNotice selectNoticeById(Long noticeId)
|
||||
{
|
||||
return noticeMapper.selectNoticeById(noticeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 公告集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice)
|
||||
{
|
||||
return noticeMapper.selectNoticeList(notice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公告
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertNotice(SysNotice notice)
|
||||
{
|
||||
return noticeMapper.insertNotice(notice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公告
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateNotice(SysNotice notice)
|
||||
{
|
||||
return noticeMapper.updateNotice(notice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公告对象
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNoticeById(Long noticeId)
|
||||
{
|
||||
return noticeMapper.deleteNoticeById(noticeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除公告信息
|
||||
*
|
||||
* @param noticeIds 需要删除的公告ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNoticeByIds(Long[] noticeIds)
|
||||
{
|
||||
return noticeMapper.deleteNoticeByIds(noticeIds);
|
||||
}
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
|
||||
package com.bs.system.service.impl;
|
||||
|
||||
|
||||
import com.bs.common.core.domain.entity.SysTenant;
|
||||
import com.bs.system.mapper.SysTenantMapper;
|
||||
import com.bs.system.service.SysTenantService;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SysTenantServiceImpl extends MPJBaseServiceImpl<SysTenantMapper, SysTenant> implements SysTenantService {
|
||||
|
||||
@Resource
|
||||
private SysTenantMapper sysTenantMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int disableTenant(SysTenant tenant) {
|
||||
return sysTenantMapper.updateById(tenant);
|
||||
}
|
||||
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.bs.system.service.impl;
|
||||
|
||||
import com.bs.common.core.domain.entity.TenantConfig;
|
||||
import com.bs.system.mapper.TenantConfigMapper;
|
||||
import com.bs.system.service.ITenantConfigService;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
/**
|
||||
* 租户配置Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-04-02
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class TenantConfigServiceImpl extends MPJBaseServiceImpl<TenantConfigMapper, TenantConfig> implements ITenantConfigService {
|
||||
|
||||
}
|
@ -1,7 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bs.system.mapper.SysNoticeMapper">
|
||||
|
||||
<resultMap type="SysNotice" id="SysNoticeResult">
|
||||
<result property="noticeId" column="notice_id" />
|
||||
<result property="noticeTitle" column="notice_title" />
|
||||
<result property="noticeType" column="notice_type" />
|
||||
<result property="noticeContent" column="notice_content" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNoticeVo">
|
||||
select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark
|
||||
from sys_notice
|
||||
</sql>
|
||||
|
||||
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
where notice_id = #{noticeId}
|
||||
</select>
|
||||
|
||||
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
<where>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">
|
||||
AND notice_title like concat('%', #{noticeTitle}, '%')
|
||||
</if>
|
||||
<if test="noticeType != null and noticeType != ''">
|
||||
AND notice_type = #{noticeType}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND create_by like concat('%', #{createBy}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertNotice" parameterType="SysNotice">
|
||||
insert into sys_notice (
|
||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
||||
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
||||
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
|
||||
<if test="status != null and status != '' ">status, </if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
|
||||
<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
|
||||
<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
|
||||
<if test="status != null and status != ''">#{status}, </if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateNotice" parameterType="SysNotice">
|
||||
update sys_notice
|
||||
<set>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
||||
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
|
||||
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
|
||||
<if test="status != null and status != ''">status = #{status}, </if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where notice_id = #{noticeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNoticeById" parameterType="Long">
|
||||
delete from sys_notice where notice_id = #{noticeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNoticeByIds" parameterType="Long">
|
||||
delete from sys_notice where notice_id in
|
||||
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
|
||||
#{noticeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@ -1,14 +1,11 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 保税仓库管理系统
|
||||
VUE_APP_TITLE = 若依管理系统
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
# 保税仓库管理系统/开发环境
|
||||
#VUE_APP_BASE_API = 'http://124.71.134.146:8096/prod-api'
|
||||
VUE_APP_BASE_API = 'http://localhost:8080'
|
||||
# VUE_APP_BASE_API = 'http://tanjunwei.test.jiutianda.cn'
|
||||
# VUE_APP_BASE_API = 'http://wangyi.test.jiutianda.cn'
|
||||
# 若依管理系统/开发环境
|
||||
VUE_APP_BASE_API = '/dev-api'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
@ -1,8 +1,8 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 保税仓库管理系统
|
||||
VUE_APP_TITLE = 若依管理系统
|
||||
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
||||
# 保税仓库管理系统/生产环境
|
||||
# 若依管理系统/生产环境
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
|
@ -1,10 +1,10 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 保税仓库管理系统
|
||||
VUE_APP_TITLE = 若依管理系统
|
||||
|
||||
NODE_ENV = production
|
||||
|
||||
# 测试环境配置
|
||||
ENV = 'staging'
|
||||
|
||||
# 保税仓库管理系统/测试环境
|
||||
# 若依管理系统/测试环境
|
||||
VUE_APP_BASE_API = '/stage-api'
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue