init: 导入团队知识库内容
This commit is contained in:
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<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">
|
||||
<parent>
|
||||
<artifactId>qmodel-module-system</artifactId>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<version>1.0.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>qmodel-module-system-biz</artifactId>
|
||||
|
||||
<description>
|
||||
system系统模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 核心模块 config-->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-config</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 系統模块 websocket-->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-websocket</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统模块 anivia-security -->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-security</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统模块 mybatis -->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-mybatis</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统模块 redis -->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-redis</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
<!-- ======================================================================== -->
|
||||
<!-- system-api模块 -->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-module-system-api</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 定时任务-->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-quartz</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成-->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-generator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 文件上传-->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-file</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- es-->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-es</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pay-->
|
||||
<!-- <dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>anivia-pay</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- auth-->
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-auth</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tech.qiantong</groupId>
|
||||
<artifactId>qmodel-module-model-biz</artifactId>
|
||||
<version>1.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- swagger3-->
|
||||
<!-- <dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||
<!-- <dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.ca.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import tech.qiantong.qmodel.common.annotation.Excel;
|
||||
import tech.qiantong.qmodel.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 证书管理对象 ca_cert
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-08-18
|
||||
*/
|
||||
public class CaCert extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID;ID */
|
||||
private Long id;
|
||||
|
||||
/** 证书名称;证书名称 */
|
||||
@Excel(name = "证书名称")
|
||||
private String name;
|
||||
|
||||
/** 主体id;主体id */
|
||||
@Excel(name = "主体id")
|
||||
private Long subjectId;
|
||||
|
||||
/** 主体名称;主体名称 */
|
||||
@Excel(name = "主体名称")
|
||||
private String subjectName;
|
||||
|
||||
/** 证书;证书 */
|
||||
@Excel(name = "证书")
|
||||
private String certificate;
|
||||
|
||||
/** 私钥;私钥 */
|
||||
@Excel(name = "私钥")
|
||||
private String privateKey;
|
||||
|
||||
/** 颁发者;颁发者 */
|
||||
@Excel(name = "颁发者")
|
||||
private String issuer;
|
||||
|
||||
/** 所有者;所有者 */
|
||||
@Excel(name = "所有者")
|
||||
private String possessor;
|
||||
|
||||
/** 有效期;有效期 */
|
||||
@Excel(name = "有效期")
|
||||
private String validTime;
|
||||
|
||||
/** 是否有效;是否有效 0:无效,1:有效 */
|
||||
@Excel(name = "是否有效 0:无效,1:有效")
|
||||
private Integer validFlag;
|
||||
|
||||
/** 删除标志;删除标志 1:已删除,0:未删除 */
|
||||
private Integer delFlag;
|
||||
|
||||
/** 创建人id;创建人id */
|
||||
@Excel(name = "创建人id")
|
||||
private Long creatorId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setSubjectId(Long subjectId)
|
||||
{
|
||||
this.subjectId = subjectId;
|
||||
}
|
||||
|
||||
public Long getSubjectId()
|
||||
{
|
||||
return subjectId;
|
||||
}
|
||||
public void setSubjectName(String subjectName)
|
||||
{
|
||||
this.subjectName = subjectName;
|
||||
}
|
||||
|
||||
public String getSubjectName()
|
||||
{
|
||||
return subjectName;
|
||||
}
|
||||
public void setCertificate(String certificate)
|
||||
{
|
||||
this.certificate = certificate;
|
||||
}
|
||||
|
||||
public String getCertificate()
|
||||
{
|
||||
return certificate;
|
||||
}
|
||||
public void setPrivateKey(String privateKey)
|
||||
{
|
||||
this.privateKey = privateKey;
|
||||
}
|
||||
|
||||
public String getPrivateKey()
|
||||
{
|
||||
return privateKey;
|
||||
}
|
||||
public void setIssuer(String issuer)
|
||||
{
|
||||
this.issuer = issuer;
|
||||
}
|
||||
|
||||
public String getIssuer()
|
||||
{
|
||||
return issuer;
|
||||
}
|
||||
public void setPossessor(String possessor)
|
||||
{
|
||||
this.possessor = possessor;
|
||||
}
|
||||
|
||||
public String getPossessor()
|
||||
{
|
||||
return possessor;
|
||||
}
|
||||
public void setValidTime(String validTime)
|
||||
{
|
||||
this.validTime = validTime;
|
||||
}
|
||||
|
||||
public String getValidTime()
|
||||
{
|
||||
return validTime;
|
||||
}
|
||||
public void setValidFlag(Integer validFlag)
|
||||
{
|
||||
this.validFlag = validFlag;
|
||||
}
|
||||
|
||||
public Integer getValidFlag()
|
||||
{
|
||||
return validFlag;
|
||||
}
|
||||
public void setDelFlag(Integer delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Integer getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
public void setCreatorId(Long creatorId)
|
||||
{
|
||||
this.creatorId = creatorId;
|
||||
}
|
||||
|
||||
public Long getCreatorId()
|
||||
{
|
||||
return creatorId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("subjectId", getSubjectId())
|
||||
.append("subjectName", getSubjectName())
|
||||
.append("certificate", getCertificate())
|
||||
.append("privateKey", getPrivateKey())
|
||||
.append("issuer", getIssuer())
|
||||
.append("possessor", getPossessor())
|
||||
.append("validTime", getValidTime())
|
||||
.append("validFlag", getValidFlag())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("creatorId", getCreatorId())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
+241
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.ca.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import tech.qiantong.qmodel.common.annotation.Excel;
|
||||
import tech.qiantong.qmodel.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 主体管理对象 ca_subject
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-08-18
|
||||
*/
|
||||
public class CaSubject extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID;主体ID */
|
||||
private Long id;
|
||||
|
||||
/** 主体名称;主体名称 */
|
||||
@Excel(name = "主体名称;主体名称")
|
||||
private String name;
|
||||
|
||||
/** 通用名称;通用名称 */
|
||||
@Excel(name = "通用名称;通用名称")
|
||||
private String cn;
|
||||
|
||||
/** 组织部门;组织单位名称 */
|
||||
@Excel(name = "组织部门;组织单位名称")
|
||||
private String ou;
|
||||
|
||||
/** 组织名称 */
|
||||
@Excel(name = "组织名称")
|
||||
private String o;
|
||||
|
||||
/** 城市名称 */
|
||||
@Excel(name = "城市名称")
|
||||
private String l;
|
||||
|
||||
/** 省名称 */
|
||||
@Excel(name = "省名称")
|
||||
private String st;
|
||||
|
||||
/** 国家 */
|
||||
@Excel(name = "国家")
|
||||
private String c;
|
||||
|
||||
/** 证书;证书 */
|
||||
@Excel(name = "证书;证书")
|
||||
private String certificate;
|
||||
|
||||
/** 私钥;私钥 */
|
||||
@Excel(name = "私钥;私钥")
|
||||
private String privateKey;
|
||||
|
||||
/** 是否有效;是否有效 0:无效,1:有效 */
|
||||
@Excel(name = "是否有效;是否有效 0:无效,1:有效")
|
||||
private Integer validFlag;
|
||||
|
||||
/** 删除标志;删除标志 1:已删除,0:未删除 */
|
||||
private Integer delFlag;
|
||||
|
||||
/** 创建人id;创建人id */
|
||||
@Excel(name = "创建人id;创建人id")
|
||||
private Long creatorId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setCn(String cn)
|
||||
{
|
||||
this.cn = cn;
|
||||
}
|
||||
|
||||
public String getCn()
|
||||
{
|
||||
return cn;
|
||||
}
|
||||
public void setOu(String ou)
|
||||
{
|
||||
this.ou = ou;
|
||||
}
|
||||
|
||||
public String getOu()
|
||||
{
|
||||
return ou;
|
||||
}
|
||||
public void setO(String o)
|
||||
{
|
||||
this.o = o;
|
||||
}
|
||||
|
||||
public String getO()
|
||||
{
|
||||
return o;
|
||||
}
|
||||
public void setL(String l)
|
||||
{
|
||||
this.l = l;
|
||||
}
|
||||
|
||||
public String getL()
|
||||
{
|
||||
return l;
|
||||
}
|
||||
public void setSt(String st)
|
||||
{
|
||||
this.st = st;
|
||||
}
|
||||
|
||||
public String getSt()
|
||||
{
|
||||
return st;
|
||||
}
|
||||
public void setC(String c)
|
||||
{
|
||||
this.c = c;
|
||||
}
|
||||
|
||||
public String getC()
|
||||
{
|
||||
return c;
|
||||
}
|
||||
public void setCertificate(String certificate)
|
||||
{
|
||||
this.certificate = certificate;
|
||||
}
|
||||
|
||||
public String getCertificate()
|
||||
{
|
||||
return certificate;
|
||||
}
|
||||
public void setPrivateKey(String privateKey)
|
||||
{
|
||||
this.privateKey = privateKey;
|
||||
}
|
||||
|
||||
public String getPrivateKey()
|
||||
{
|
||||
return privateKey;
|
||||
}
|
||||
public void setValidFlag(Integer validFlag)
|
||||
{
|
||||
this.validFlag = validFlag;
|
||||
}
|
||||
|
||||
public Integer getValidFlag()
|
||||
{
|
||||
return validFlag;
|
||||
}
|
||||
public void setDelFlag(Integer delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Integer getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
public void setCreatorId(Long creatorId)
|
||||
{
|
||||
this.creatorId = creatorId;
|
||||
}
|
||||
|
||||
public Long getCreatorId()
|
||||
{
|
||||
return creatorId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("cn", getCn())
|
||||
.append("ou", getOu())
|
||||
.append("o", getO())
|
||||
.append("l", getL())
|
||||
.append("st", getSt())
|
||||
.append("c", getC())
|
||||
.append("certificate", getCertificate())
|
||||
.append("privateKey", getPrivateKey())
|
||||
.append("validFlag", getValidFlag())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("creatorId", getCreatorId())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.ca.mapper;
|
||||
|
||||
import tech.qiantong.qmodel.module.system.ca.domain.CaCert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 证书管理Mapper接口
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-08-18
|
||||
*/
|
||||
public interface CaCertMapper
|
||||
{
|
||||
/**
|
||||
* 查询证书管理
|
||||
*
|
||||
* @param id 证书管理主键
|
||||
* @return 证书管理
|
||||
*/
|
||||
public CaCert selectCaCertById(Long id);
|
||||
|
||||
/**
|
||||
* 查询证书管理列表
|
||||
*
|
||||
* @param caCert 证书管理
|
||||
* @return 证书管理集合
|
||||
*/
|
||||
public List<CaCert> selectCaCertList(CaCert caCert);
|
||||
|
||||
/**
|
||||
* 新增证书管理
|
||||
*
|
||||
* @param caCert 证书管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCaCert(CaCert caCert);
|
||||
|
||||
/**
|
||||
* 修改证书管理
|
||||
*
|
||||
* @param caCert 证书管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCaCert(CaCert caCert);
|
||||
|
||||
/**
|
||||
* 删除证书管理
|
||||
*
|
||||
* @param id 证书管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCaCertById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除证书管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCaCertByIds(Long[] ids);
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.ca.mapper;
|
||||
|
||||
import tech.qiantong.qmodel.module.system.ca.domain.CaSubject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 主体管理Mapper接口
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-08-18
|
||||
*/
|
||||
public interface CaSubjectMapper
|
||||
{
|
||||
/**
|
||||
* 查询主体管理
|
||||
*
|
||||
* @param id 主体管理主键
|
||||
* @return 主体管理
|
||||
*/
|
||||
public CaSubject selectCaSubjectById(Long id);
|
||||
|
||||
/**
|
||||
* 查询主体管理列表
|
||||
*
|
||||
* @param caSubject 主体管理
|
||||
* @return 主体管理集合
|
||||
*/
|
||||
public List<CaSubject> selectCaSubjectList(CaSubject caSubject);
|
||||
|
||||
/**
|
||||
* 新增主体管理
|
||||
*
|
||||
* @param caSubject 主体管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCaSubject(CaSubject caSubject);
|
||||
|
||||
/**
|
||||
* 修改主体管理
|
||||
*
|
||||
* @param caSubject 主体管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCaSubject(CaSubject caSubject);
|
||||
|
||||
/**
|
||||
* 删除主体管理
|
||||
*
|
||||
* @param id 主体管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCaSubjectById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除主体管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCaSubjectByIds(Long[] ids);
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.ca.service;
|
||||
|
||||
import tech.qiantong.qmodel.module.system.ca.domain.CaCert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 证书管理Service接口
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-08-18
|
||||
*/
|
||||
public interface ICaCertService
|
||||
{
|
||||
/**
|
||||
* 查询证书管理
|
||||
*
|
||||
* @param id 证书管理主键
|
||||
* @return 证书管理
|
||||
*/
|
||||
public CaCert selectCaCertById(Long id);
|
||||
|
||||
/**
|
||||
* 查询证书管理列表
|
||||
*
|
||||
* @param caCert 证书管理
|
||||
* @return 证书管理集合
|
||||
*/
|
||||
public List<CaCert> selectCaCertList(CaCert caCert);
|
||||
|
||||
/**
|
||||
* 新增证书管理
|
||||
*
|
||||
* @param caCert 证书管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCaCert(CaCert caCert);
|
||||
|
||||
/**
|
||||
* 修改证书管理
|
||||
*
|
||||
* @param caCert 证书管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCaCert(CaCert caCert);
|
||||
|
||||
/**
|
||||
* 批量删除证书管理
|
||||
*
|
||||
* @param ids 需要删除的证书管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCaCertByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除证书管理信息
|
||||
*
|
||||
* @param id 证书管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCaCertById(Long id);
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.ca.service;
|
||||
|
||||
import tech.qiantong.qmodel.module.system.ca.domain.CaSubject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 主体管理Service接口
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-08-18
|
||||
*/
|
||||
public interface ICaSubjectService
|
||||
{
|
||||
/**
|
||||
* 查询主体管理
|
||||
*
|
||||
* @param id 主体管理主键
|
||||
* @return 主体管理
|
||||
*/
|
||||
public CaSubject selectCaSubjectById(Long id);
|
||||
|
||||
/**
|
||||
* 查询主体管理列表
|
||||
*
|
||||
* @param caSubject 主体管理
|
||||
* @return 主体管理集合
|
||||
*/
|
||||
public List<CaSubject> selectCaSubjectList(CaSubject caSubject);
|
||||
|
||||
/**
|
||||
* 新增主体管理
|
||||
*
|
||||
* @param caSubject 主体管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCaSubject(CaSubject caSubject);
|
||||
|
||||
/**
|
||||
* 修改主体管理
|
||||
*
|
||||
* @param caSubject 主体管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCaSubject(CaSubject caSubject);
|
||||
|
||||
/**
|
||||
* 批量删除主体管理
|
||||
*
|
||||
* @param ids 需要删除的主体管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCaSubjectByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除主体管理信息
|
||||
*
|
||||
* @param id 主体管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCaSubjectById(Long id);
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.ca.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import tech.qiantong.qmodel.module.system.ca.domain.CaCert;
|
||||
import tech.qiantong.qmodel.module.system.ca.mapper.CaCertMapper;
|
||||
import tech.qiantong.qmodel.module.system.ca.service.ICaCertService;
|
||||
import tech.qiantong.qmodel.common.utils.DateUtils;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 证书管理Service业务层处理
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-08-18
|
||||
*/
|
||||
@Service
|
||||
public class CaCertServiceImpl implements ICaCertService
|
||||
{
|
||||
@Resource
|
||||
private CaCertMapper caCertMapper;
|
||||
|
||||
/**
|
||||
* 查询证书管理
|
||||
*
|
||||
* @param id 证书管理主键
|
||||
* @return 证书管理
|
||||
*/
|
||||
@Override
|
||||
public CaCert selectCaCertById(Long id)
|
||||
{
|
||||
return caCertMapper.selectCaCertById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询证书管理列表
|
||||
*
|
||||
* @param caCert 证书管理
|
||||
* @return 证书管理
|
||||
*/
|
||||
@Override
|
||||
public List<CaCert> selectCaCertList(CaCert caCert)
|
||||
{
|
||||
return caCertMapper.selectCaCertList(caCert);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增证书管理
|
||||
*
|
||||
* @param caCert 证书管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCaCert(CaCert caCert)
|
||||
{
|
||||
caCert.setCreateTime(DateUtils.getNowDate());
|
||||
return caCertMapper.insertCaCert(caCert);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改证书管理
|
||||
*
|
||||
* @param caCert 证书管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCaCert(CaCert caCert)
|
||||
{
|
||||
caCert.setUpdateTime(DateUtils.getNowDate());
|
||||
return caCertMapper.updateCaCert(caCert);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除证书管理
|
||||
*
|
||||
* @param ids 需要删除的证书管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCaCertByIds(Long[] ids)
|
||||
{
|
||||
return caCertMapper.deleteCaCertByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除证书管理信息
|
||||
*
|
||||
* @param id 证书管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCaCertById(Long id)
|
||||
{
|
||||
return caCertMapper.deleteCaCertById(id);
|
||||
}
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.ca.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import tech.qiantong.qmodel.module.system.ca.domain.CaSubject;
|
||||
import tech.qiantong.qmodel.module.system.ca.mapper.CaSubjectMapper;
|
||||
import tech.qiantong.qmodel.module.system.ca.service.ICaSubjectService;
|
||||
import tech.qiantong.qmodel.common.utils.DateUtils;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 主体管理Service业务层处理
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-08-18
|
||||
*/
|
||||
@Service
|
||||
public class CaSubjectServiceImpl implements ICaSubjectService
|
||||
{
|
||||
@Resource
|
||||
private CaSubjectMapper caSubjectMapper;
|
||||
|
||||
/**
|
||||
* 查询主体管理
|
||||
*
|
||||
* @param id 主体管理主键
|
||||
* @return 主体管理
|
||||
*/
|
||||
@Override
|
||||
public CaSubject selectCaSubjectById(Long id)
|
||||
{
|
||||
return caSubjectMapper.selectCaSubjectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询主体管理列表
|
||||
*
|
||||
* @param caSubject 主体管理
|
||||
* @return 主体管理
|
||||
*/
|
||||
@Override
|
||||
public List<CaSubject> selectCaSubjectList(CaSubject caSubject)
|
||||
{
|
||||
return caSubjectMapper.selectCaSubjectList(caSubject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增主体管理
|
||||
*
|
||||
* @param caSubject 主体管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCaSubject(CaSubject caSubject)
|
||||
{
|
||||
caSubject.setCreateTime(DateUtils.getNowDate());
|
||||
return caSubjectMapper.insertCaSubject(caSubject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改主体管理
|
||||
*
|
||||
* @param caSubject 主体管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCaSubject(CaSubject caSubject)
|
||||
{
|
||||
caSubject.setUpdateTime(DateUtils.getNowDate());
|
||||
return caSubjectMapper.updateCaSubject(caSubject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除主体管理
|
||||
*
|
||||
* @param ids 需要删除的主体管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCaSubjectByIds(Long[] ids)
|
||||
{
|
||||
return caSubjectMapper.deleteCaSubjectByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除主体管理信息
|
||||
*
|
||||
* @param id 主体管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCaSubjectById(Long id)
|
||||
{
|
||||
return caSubjectMapper.deleteCaSubjectById(id);
|
||||
}
|
||||
}
|
||||
+290
@@ -0,0 +1,290 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.auth;
|
||||
|
||||
import cn.dev33.satoken.oauth2.template.SaOAuth2Util;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.ejlchina.okhttps.OkHttps;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysUser;
|
||||
import tech.qiantong.qmodel.common.core.domain.model.LoginUser;
|
||||
import tech.qiantong.qmodel.common.exception.ServiceException;
|
||||
import tech.qiantong.qmodel.common.utils.SoMap;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.auth.RelUserAuthProductDO;
|
||||
import tech.qiantong.qmodel.module.system.enums.auth.AuthProductEnums;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysUserService;
|
||||
import tech.qiantong.qmodel.module.system.service.auth.IRelUserAuthProductService;
|
||||
import tech.qiantong.qmodel.redis.service.IRedisService;
|
||||
import tech.qiantong.qmodel.security.web.service.SysPermissionService;
|
||||
import tech.qiantong.qmodel.security.web.service.TokenService;
|
||||
|
||||
/**
|
||||
* oauth2 Controller
|
||||
*
|
||||
* @author surge
|
||||
* @date 2022-09-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/oauth2")
|
||||
public class AuthController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AuthController.class);
|
||||
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
@Resource
|
||||
private SysPermissionService permissionService;
|
||||
@Resource
|
||||
private TokenService tokenService;
|
||||
@Resource
|
||||
private IRedisService redisService;
|
||||
@Resource
|
||||
private IRelUserAuthProductService userAuthProductService;
|
||||
|
||||
@Value("${oauth2.redis-prefix}")
|
||||
private String redisPrefix;
|
||||
|
||||
// redis二级文件夹命名
|
||||
public static final String accessTokenPrefix = "accessToken";
|
||||
public static final String refreshTokenPrefix = "refreshToken";
|
||||
|
||||
// 相关参数配置
|
||||
@Value("${oauth2.clientId}")
|
||||
private String clientId; // 应用id
|
||||
@Value("${oauth2.clientSecret}")
|
||||
private String clientSecret; // 应用秘钥
|
||||
@Value("${oauth2.serverUrl}")
|
||||
private String serverUrl; // 服务端接口
|
||||
|
||||
// 根据Code码进行登录,获取 Access-Token 和 openid
|
||||
@RequestMapping("/codeLogin")
|
||||
@Transactional
|
||||
public AjaxResult codeLogin(String code) {
|
||||
// 调用Server端接口,获取 Access-Token 以及其他信息
|
||||
String str = OkHttps.sync(serverUrl + "/oauth2/token")
|
||||
.addBodyPara("grant_type", "authorization_code")
|
||||
.addBodyPara("code", code)
|
||||
.addBodyPara("client_id", clientId)
|
||||
.addBodyPara("client_secret", clientSecret)
|
||||
.post()
|
||||
.getBody()
|
||||
.toString();
|
||||
SoMap so = SoMap.getSoMap().setJsonString(str);
|
||||
System.out.println("返回结果: " + so);
|
||||
|
||||
// code不等于200 代表请求失败
|
||||
if(so.getInt("code") != 200) {
|
||||
return AjaxResult.error(so.getString("msg"));
|
||||
}
|
||||
|
||||
// 根据openid获取其对应的userId
|
||||
SoMap data = so.getMap("data");
|
||||
|
||||
// idHubId
|
||||
Long idHubId = data.getLong("idHubId");
|
||||
// Access-Token值
|
||||
String accessToken = data.getString("access_token");
|
||||
// Refresh-Token值
|
||||
String refreshToken = data.getString("refresh_token");
|
||||
// Access-Token剩余有效期,单位秒
|
||||
long expiresIn = data.getLong("expires_in");
|
||||
// Refresh-Token剩余有效期,单位秒
|
||||
long refreshExpiresIn = data.getLong("refresh_expires_in");
|
||||
|
||||
SysUser user = this.getUserByIdHubId(idHubId);
|
||||
|
||||
if (user == null) {
|
||||
// 通过openid获取userInfo
|
||||
SoMap userinfo = this.getUserinfo(accessToken);
|
||||
if (userinfo != null) {
|
||||
// 统一身份认证账户手机号
|
||||
String phone = userinfo.getString("phone");
|
||||
// 通过手机号查找用户
|
||||
SysUser userByPhone = userService.findUserByNameOrPhone(phone);
|
||||
|
||||
if (userByPhone != null) {
|
||||
RelUserAuthProductDO productDO = RelUserAuthProductDO.builder()
|
||||
.userId(userByPhone.getUserId())
|
||||
.authId(idHubId.toString())
|
||||
.authProductType(AuthProductEnums.ANIVIA.code)
|
||||
.build();
|
||||
|
||||
userAuthProductService.save(productDO);
|
||||
user = userByPhone;
|
||||
} else {
|
||||
return AjaxResult.error("系统中不存在此用户,请联系管理员!");
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("获取统一身份认证平台用户身份信息失败!");
|
||||
}
|
||||
}
|
||||
|
||||
// 存入redis
|
||||
redisService.set(redisPrefix + ":" + accessTokenPrefix + ":" + user.getUserId().toString(), accessToken, expiresIn);
|
||||
redisService.set(redisPrefix + ":" + refreshTokenPrefix + ":" + user.getUserId().toString(), refreshToken, refreshExpiresIn);
|
||||
|
||||
// 创建登录用户(直接免密)
|
||||
LoginUser loginUser = createLoginUser(user);
|
||||
|
||||
// 获取到免密token
|
||||
String token = tokenService.createToken(loginUser);
|
||||
|
||||
log.info("用户:{},通过统一身份认证平台登录成功!", user.getNickName());
|
||||
return AjaxResult.success(token);
|
||||
}
|
||||
|
||||
|
||||
// 刷新 Access-Token
|
||||
public String refresh(String refreshToken) {
|
||||
// 调用Server端接口,通过 Refresh-Token 刷新出一个新的 Access-Token
|
||||
String str = OkHttps.sync(serverUrl + "/oauth2/refresh")
|
||||
.addBodyPara("grant_type", "refresh_token")
|
||||
.addBodyPara("client_id", clientId)
|
||||
.addBodyPara("client_secret", clientSecret)
|
||||
.addBodyPara("refresh_token", refreshToken)
|
||||
.post()
|
||||
.getBody()
|
||||
.toString();
|
||||
SoMap so = SoMap.getSoMap().setJsonString(str);
|
||||
System.out.println("返回结果: " + so);
|
||||
|
||||
// code不等于200 代表请求失败
|
||||
if(so.getInt("code") != 200) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 返回相关参数 (data=新的Access-Token )
|
||||
SoMap data = so.getMap("data");
|
||||
|
||||
// openid
|
||||
String openid = data.getString("openid");
|
||||
// Access-Token值
|
||||
String accessToken = data.getString("access_token");
|
||||
// Refresh-Token值
|
||||
String refToken = data.getString("refresh_token");
|
||||
// Access-Token剩余有效期,单位秒
|
||||
long expiresIn = data.getLong("expires_in");
|
||||
// Refresh-Token剩余有效期,单位秒
|
||||
long refreshExpiresIn = data.getLong("refresh_expires_in");
|
||||
|
||||
Long userId = Convert.toLong(SaOAuth2Util.getLoginIdByAccessToken(accessToken));
|
||||
|
||||
// 存入redis
|
||||
redisService.set(redisPrefix + ":" + accessTokenPrefix + ":" + userId.toString(), accessToken, expiresIn);
|
||||
redisService.set(redisPrefix + ":" + refreshTokenPrefix + ":" + userId.toString(), refreshToken, refreshExpiresIn);
|
||||
|
||||
return data.getString("access_token");
|
||||
}
|
||||
|
||||
public LoginUser createLoginUser(SysUser user)
|
||||
{
|
||||
return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 ddHubId获取 user
|
||||
* @param idHubId 统一身份认证 id
|
||||
* @return
|
||||
*/
|
||||
private SysUser getUserByIdHubId(Long idHubId) {
|
||||
// 认证平台关联关系
|
||||
RelUserAuthProductDO authInfo = userAuthProductService.lambdaQuery()
|
||||
.eq(RelUserAuthProductDO::getUserId, idHubId)
|
||||
.eq(RelUserAuthProductDO::getAuthProductType, AuthProductEnums.ANIVIA.code)
|
||||
.one();
|
||||
|
||||
if (authInfo != null) {
|
||||
return userService.selectUserById(authInfo.getUserId());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 Access-Token 置换相关的资源: 获取账号昵称、头像、性别等信息
|
||||
* @param accessToken
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getUserinfo")
|
||||
public SoMap getUserinfo(String accessToken) {
|
||||
// 调用Server端接口,查询开放的资源
|
||||
String str = OkHttps.sync(serverUrl + "/oauth2/userinfo")
|
||||
.addBodyPara("access_token", accessToken)
|
||||
.post()
|
||||
.getBody()
|
||||
.toString();
|
||||
SoMap so = SoMap.getSoMap().setJsonString(str);
|
||||
System.out.println("返回结果: " + so);
|
||||
|
||||
// code不等于200 代表请求失败
|
||||
if(so.getInt("code") != 200) {
|
||||
throw new ServiceException("获取用户账号信息失败!");
|
||||
}
|
||||
|
||||
// 返回相关参数 (data=获取到的资源 )
|
||||
return so.getMap("data");
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/sso/logout")
|
||||
public AjaxResult loginOut(String userId) {
|
||||
String accessToken = redisService.get(redisPrefix + ":" + accessTokenPrefix + ":" + userId);
|
||||
|
||||
if (StringUtils.isEmpty(accessToken)) {
|
||||
String refreshToken = redisService.get(redisPrefix + ":" + refreshTokenPrefix + ":" + userId);
|
||||
accessToken = this.refresh(refreshToken);
|
||||
}
|
||||
|
||||
// 调用Server端接口,查询开放的资源
|
||||
String str = OkHttps.sync(serverUrl + "/oauth2/logout")
|
||||
.addBodyPara("access_token", accessToken)
|
||||
.post()
|
||||
.getBody()
|
||||
.toString();
|
||||
SoMap so = SoMap.getSoMap().setJsonString(str);
|
||||
System.out.println("返回结果: " + so);
|
||||
|
||||
return AjaxResult.success(so);
|
||||
}
|
||||
}
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
///*
|
||||
// * Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
// * qModel Model Platform(Open Source Edition)
|
||||
// * *
|
||||
// * License:
|
||||
// * Released under the Apache License, Version 2.0.
|
||||
// * You may use, modify, and distribute this software for commercial purposes
|
||||
// * under the terms of the License.
|
||||
// * *
|
||||
// * Special Notice:
|
||||
// * All derivative versions are strictly prohibited from modifying or removing
|
||||
// * the default system logo and copyright information.
|
||||
// * For brand customization, please apply for brand customization authorization via official channels.
|
||||
// * *
|
||||
// * More information: https://qmodel.qiantong.tech/business.html
|
||||
// * *
|
||||
// * ============================================================================
|
||||
// * *
|
||||
// * 版权所有 © 2026 江苏千桐科技有限公司
|
||||
// * qModel 模型平台(开源版)
|
||||
// * *
|
||||
// * 许可协议:
|
||||
// * 本项目基于 Apache License 2.0 开源协议发布,
|
||||
// * 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
// * *
|
||||
// * 特别说明:
|
||||
// * 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
// * 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
// * *
|
||||
// * 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
// */
|
||||
//
|
||||
//package tech.qiantong.qmodel.module.system.controller.admin.ca;
|
||||
//
|
||||
//import cn.hutool.core.convert.Convert;
|
||||
//import tech.qiantong.qmodel.config.ServerConfig;
|
||||
//import tech.qiantong.qmodel.module.system.ca.domain.CaCert;
|
||||
//import tech.qiantong.qmodel.module.system.ca.domain.CaSubject;
|
||||
//import tech.qiantong.qmodel.module.system.ca.service.ICaCertService;
|
||||
//import tech.qiantong.qmodel.module.system.ca.service.ICaSubjectService;
|
||||
//import tech.qiantong.qmodel.common.annotation.Log;
|
||||
//import tech.qiantong.qmodel.common.constant.Constants;
|
||||
//import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
//import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
//import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
//import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
//import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
//import tech.qiantong.qmodel.common.utils.ca.CaCertificateIssuer;
|
||||
//import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
//import tech.qiantong.qmodel.file.util.FileUploadUtil;
|
||||
//import org.dromara.x.file.storage.core.FileInfo;
|
||||
//import org.dromara.x.file.storage.core.FileStorageService;
|
||||
//import javax.annotation.Resource;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.security.access.prepost.PreAuthorize;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//import org.springframework.web.multipart.MultipartFile;
|
||||
//
|
||||
//import javax.annotation.PostConstruct;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * 证书管理Controller
|
||||
// *
|
||||
// * @author anivia
|
||||
// * @date 2024-08-18
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/ca/cert")
|
||||
//public class CaCertController extends BaseController
|
||||
//{
|
||||
// @Resource
|
||||
// private ICaCertService caCertService;
|
||||
//
|
||||
// @Resource
|
||||
// private ICaSubjectService caSubjectService;
|
||||
//
|
||||
// @Resource
|
||||
// private FileStorageService fileStorageService;
|
||||
//
|
||||
// @Resource
|
||||
// private ServerConfig serverConfig;
|
||||
//
|
||||
// @Value("${dromara.x-file-storage.local-plus[0].storage-path}")
|
||||
// private String storagePath;
|
||||
//
|
||||
// @PostConstruct
|
||||
// public void init() {
|
||||
// FileUploadUtil.init(fileStorageService, serverConfig, storagePath);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询证书管理列表
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:cert:list')")
|
||||
// @GetMapping("/list")
|
||||
// public TableDataInfo list(CaCert caCert)
|
||||
// {
|
||||
// startPage();
|
||||
// List<CaCert> list = caCertService.selectCaCertList(caCert);
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导出证书管理列表
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:cert:export')")
|
||||
// @Log(title = "证书管理", businessType = BusinessType.EXPORT)
|
||||
// @PostMapping("/export")
|
||||
// public void export(HttpServletResponse response, CaCert caCert)
|
||||
// {
|
||||
// List<CaCert> list = caCertService.selectCaCertList(caCert);
|
||||
// ExcelUtil<CaCert> util = new ExcelUtil<CaCert>(CaCert.class);
|
||||
// util.exportExcel(response, list, "证书管理数据");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取证书管理详细信息
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:cert:query')")
|
||||
// @GetMapping(value = "/{id}")
|
||||
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
// {
|
||||
// return success(caCertService.selectCaCertById(id));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增证书管理
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:cert:add')")
|
||||
// @Log(title = "证书管理", businessType = BusinessType.INSERT)
|
||||
// @PostMapping
|
||||
// public AjaxResult add(@RequestBody CaCert caCert) throws Exception {
|
||||
// CaSubject subject = caSubjectService.selectCaSubjectById(caCert.getSubjectId());
|
||||
// // 构建证书的 DN 名称
|
||||
// String dnNameStr = StringUtils.format("CN={}, OU={}, O={}, L={}, ST={}, C={}",
|
||||
// caCert.getPossessor(), subject.getOu(),
|
||||
// subject.getO(), subject.getL(),
|
||||
// subject.getSt(), subject.getC());
|
||||
//
|
||||
// // 创建证书
|
||||
// List<MultipartFile> fileList = CaCertificateIssuer.issueCertificate(
|
||||
// dnNameStr,
|
||||
// subject.getCertificate(),
|
||||
// subject.getPrivateKey(),
|
||||
// Convert.toLong(caCert.getValidTime()));
|
||||
//
|
||||
// // 上传并获取证书和私钥的文件信息
|
||||
// FileInfo cert = FileUploadUtil.upload(fileList.get(0), "ca/");
|
||||
// FileInfo privateKey = FileUploadUtil.upload(fileList.get(1), "ca/");
|
||||
//
|
||||
// // 更新数据信息
|
||||
// caCert.setCertificate(Constants.RESOURCE_PREFIX + "/" + cert.getPath() + cert.getFilename());
|
||||
// caCert.setPrivateKey(Constants.RESOURCE_PREFIX + "/" + privateKey.getPath() + privateKey.getFilename());
|
||||
// caCert.setCreatorId(getUserId());
|
||||
// caCert.setCreateBy(getNickName());
|
||||
// return toAjax(caCertService.insertCaCert(caCert));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改证书管理
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:cert:edit')")
|
||||
// @Log(title = "证书管理", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult edit(@RequestBody CaCert caCert)
|
||||
// {
|
||||
// return toAjax(caCertService.updateCaCert(caCert));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除证书管理
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:cert:remove')")
|
||||
// @Log(title = "证书管理", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||
// {
|
||||
// return toAjax(caCertService.deleteCaCertByIds(ids));
|
||||
// }
|
||||
//}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
///*
|
||||
// * Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
// * qModel Model Platform(Open Source Edition)
|
||||
// * *
|
||||
// * License:
|
||||
// * Released under the Apache License, Version 2.0.
|
||||
// * You may use, modify, and distribute this software for commercial purposes
|
||||
// * under the terms of the License.
|
||||
// * *
|
||||
// * Special Notice:
|
||||
// * All derivative versions are strictly prohibited from modifying or removing
|
||||
// * the default system logo and copyright information.
|
||||
// * For brand customization, please apply for brand customization authorization via official channels.
|
||||
// * *
|
||||
// * More information: https://qmodel.qiantong.tech/business.html
|
||||
// * *
|
||||
// * ============================================================================
|
||||
// * *
|
||||
// * 版权所有 © 2026 江苏千桐科技有限公司
|
||||
// * qModel 模型平台(开源版)
|
||||
// * *
|
||||
// * 许可协议:
|
||||
// * 本项目基于 Apache License 2.0 开源协议发布,
|
||||
// * 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
// * *
|
||||
// * 特别说明:
|
||||
// * 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
// * 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
// * *
|
||||
// * 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
// */
|
||||
//
|
||||
//package tech.qiantong.qmodel.module.system.controller.admin.ca;
|
||||
//
|
||||
//import tech.qiantong.qmodel.common.annotation.Log;
|
||||
//import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
//import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
//import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
//import tech.qiantong.qmodel.module.system.ca.domain.CaSubject;
|
||||
//import tech.qiantong.qmodel.module.system.ca.service.ICaSubjectService;
|
||||
//import tech.qiantong.qmodel.common.constant.Constants;
|
||||
//import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
//import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
//import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
//import tech.qiantong.qmodel.common.utils.ca.CaGenerateRootCertificate;
|
||||
//import tech.qiantong.qmodel.config.ServerConfig;
|
||||
//import tech.qiantong.qmodel.file.util.FileUploadUtil;
|
||||
//import org.dromara.x.file.storage.core.FileInfo;
|
||||
//import org.dromara.x.file.storage.core.FileStorageService;
|
||||
//import javax.annotation.Resource;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.security.access.prepost.PreAuthorize;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//import org.springframework.web.multipart.MultipartFile;
|
||||
//
|
||||
//import javax.annotation.PostConstruct;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * 主体管理Controller
|
||||
// *
|
||||
// * @author anivia
|
||||
// * @date 2024-08-18
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/ca/subject")
|
||||
//public class CaSubjectController extends BaseController
|
||||
//{
|
||||
// @Resource
|
||||
// private ICaSubjectService caSubjectService;
|
||||
//
|
||||
// @Resource
|
||||
// private FileStorageService fileStorageService;
|
||||
//
|
||||
// @Resource
|
||||
// private ServerConfig serverConfig;
|
||||
//
|
||||
// @Value("${dromara.x-file-storage.local-plus[0].storage-path}")
|
||||
// private String storagePath;
|
||||
//
|
||||
// @PostConstruct
|
||||
// public void init() {
|
||||
// FileUploadUtil.init(fileStorageService, serverConfig, storagePath);
|
||||
// }
|
||||
// /**
|
||||
// * 查询主体管理列表
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:subject:list')")
|
||||
// @GetMapping("/list")
|
||||
// public TableDataInfo list(CaSubject caSubject)
|
||||
// {
|
||||
// startPage();
|
||||
// List<CaSubject> list = caSubjectService.selectCaSubjectList(caSubject);
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导出主体管理列表
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:subject:export')")
|
||||
// @Log(title = "主体管理", businessType = BusinessType.EXPORT)
|
||||
// @PostMapping("/export")
|
||||
// public void export(HttpServletResponse response, CaSubject caSubject)
|
||||
// {
|
||||
// List<CaSubject> list = caSubjectService.selectCaSubjectList(caSubject);
|
||||
// ExcelUtil<CaSubject> util = new ExcelUtil<CaSubject>(CaSubject.class);
|
||||
// util.exportExcel(response, list, "主体管理数据");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取主体管理详细信息
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:subject:query')")
|
||||
// @GetMapping(value = "/{id}")
|
||||
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
// {
|
||||
// return success(caSubjectService.selectCaSubjectById(id));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增主体管理
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:subject:add')")
|
||||
// @Log(title = "主体管理", businessType = BusinessType.INSERT)
|
||||
// @PostMapping
|
||||
// public AjaxResult add(@RequestBody CaSubject caSubject)
|
||||
// {
|
||||
// // 构建证书的 DN 名称
|
||||
// String dnNameStr = StringUtils.format("CN={}, OU={}, O={}, L={}, ST={}, C={}",
|
||||
// caSubject.getCn(), caSubject.getOu(),
|
||||
// caSubject.getO(), caSubject.getL(),
|
||||
// caSubject.getSt(), caSubject.getC());
|
||||
//
|
||||
// // 生成并获取根证书和私钥的文件列表
|
||||
// List<MultipartFile> fileList = CaGenerateRootCertificate.generateRootCertificate(dnNameStr);
|
||||
//
|
||||
// // 上传并获取证书和私钥的文件信息
|
||||
// FileInfo cert = FileUploadUtil.upload(fileList.get(0), "ca/");
|
||||
// FileInfo privateKey = FileUploadUtil.upload(fileList.get(1), "ca/");
|
||||
//
|
||||
// // 更新数据信息
|
||||
// caSubject.setCertificate(Constants.RESOURCE_PREFIX + "/" + cert.getPath() + cert.getFilename());
|
||||
// caSubject.setPrivateKey(Constants.RESOURCE_PREFIX + "/" + privateKey.getPath() + privateKey.getFilename());
|
||||
// caSubject.setCreatorId(getUserId());
|
||||
// caSubject.setCreateBy(getNickName());
|
||||
// return toAjax(caSubjectService.insertCaSubject(caSubject));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改主体管理
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:subject:edit')")
|
||||
// @Log(title = "主体管理", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult edit(@RequestBody CaSubject caSubject)
|
||||
// {
|
||||
// return toAjax(caSubjectService.updateCaSubject(caSubject));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除主体管理
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('ca:subject:remove')")
|
||||
// @Log(title = "主体管理", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||
// {
|
||||
// return toAjax(caSubjectService.deleteCaSubjectByIds(ids));
|
||||
// }
|
||||
//}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.common;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.util.FastByteArrayOutputStream;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import tech.qiantong.qmodel.common.config.AniviaConfig;
|
||||
import tech.qiantong.qmodel.common.constant.CacheConstants;
|
||||
import tech.qiantong.qmodel.common.constant.Constants;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.redis.RedisCache;
|
||||
import tech.qiantong.qmodel.common.utils.sign.Base64;
|
||||
import tech.qiantong.qmodel.common.utils.uuid.IdUtils;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysConfigService;
|
||||
|
||||
/**
|
||||
* 验证码操作处理
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
public class CaptchaController
|
||||
{
|
||||
@Resource(name = "captchaProducer")
|
||||
private Producer captchaProducer;
|
||||
|
||||
@Resource(name = "captchaProducerMath")
|
||||
private Producer captchaProducerMath;
|
||||
|
||||
@Resource
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Resource
|
||||
private ISysConfigService configService;
|
||||
/**
|
||||
* 生成验证码
|
||||
*/
|
||||
@GetMapping("/captchaImage")
|
||||
public AjaxResult getCode(HttpServletResponse response) throws IOException
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||
ajax.put("captchaEnabled", captchaEnabled);
|
||||
if (!captchaEnabled)
|
||||
{
|
||||
return ajax;
|
||||
}
|
||||
|
||||
// 保存验证码信息
|
||||
String uuid = IdUtils.simpleUUID();
|
||||
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
|
||||
|
||||
String capStr = null, code = null;
|
||||
BufferedImage image = null;
|
||||
|
||||
// 生成验证码
|
||||
String captchaType = AniviaConfig.getCaptchaType();
|
||||
if ("math".equals(captchaType))
|
||||
{
|
||||
String capText = captchaProducerMath.createText();
|
||||
capStr = capText.substring(0, capText.lastIndexOf("@"));
|
||||
code = capText.substring(capText.lastIndexOf("@") + 1);
|
||||
image = captchaProducerMath.createImage(capStr);
|
||||
}
|
||||
else if ("char".equals(captchaType))
|
||||
{
|
||||
capStr = code = captchaProducer.createText();
|
||||
image = captchaProducer.createImage(capStr);
|
||||
}
|
||||
|
||||
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||
// 转换流信息写出
|
||||
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ImageIO.write(image, "jpg", os);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
ajax.put("uuid", uuid);
|
||||
ajax.put("img", Base64.encode(os.toByteArray()));
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import tech.qiantong.qmodel.common.config.AniviaConfig;
|
||||
import tech.qiantong.qmodel.common.constant.Constants;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.common.utils.file.FileUploadUtils;
|
||||
import tech.qiantong.qmodel.common.utils.file.FileUtils;
|
||||
import tech.qiantong.qmodel.config.ServerConfig;
|
||||
|
||||
/**
|
||||
* 通用请求处理
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common")
|
||||
public class CommonController
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
||||
|
||||
@Resource
|
||||
private ServerConfig serverConfig;
|
||||
|
||||
private static final String FILE_DELIMETER = ",";
|
||||
|
||||
/**
|
||||
* 通用下载请求
|
||||
*
|
||||
* @param fileName 文件名称
|
||||
* @param delete 是否删除
|
||||
*/
|
||||
@GetMapping("/download")
|
||||
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!FileUtils.checkAllowDownload(fileName))
|
||||
{
|
||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||
}
|
||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||
String filePath = AniviaConfig.getDownloadPath() + fileName;
|
||||
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||
if (delete)
|
||||
{
|
||||
FileUtils.deleteFile(filePath);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用上传请求(单个)
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult uploadFile(MultipartFile file) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = AniviaConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用上传请求(多个)
|
||||
*/
|
||||
@PostMapping("/uploads")
|
||||
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = AniviaConfig.getUploadPath();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> newFileNames = new ArrayList<String>();
|
||||
List<String> originalFilenames = new ArrayList<String>();
|
||||
for (MultipartFile file : files)
|
||||
{
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
urls.add(url);
|
||||
fileNames.add(fileName);
|
||||
newFileNames.add(FileUtils.getName(fileName));
|
||||
originalFilenames.add(file.getOriginalFilename());
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
|
||||
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
||||
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
|
||||
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 本地资源通用下载
|
||||
*/
|
||||
@GetMapping("/download/resource")
|
||||
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!FileUtils.checkAllowDownload(resource))
|
||||
{
|
||||
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
||||
}
|
||||
// 本地资源路径
|
||||
String localPath = AniviaConfig.getProfile();
|
||||
// 数据库资源地址
|
||||
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
|
||||
// 下载名称
|
||||
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
||||
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.example.es;
|
||||
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.utils.bean.BeanUtils;
|
||||
import tech.qiantong.qmodel.es.model.Search;
|
||||
import tech.qiantong.qmodel.es.model.example.EsTextDocument;
|
||||
import tech.qiantong.qmodel.module.system.domain.SysNotice;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysNoticeService;
|
||||
import tech.qiantong.qmodel.es.service.ISearchService;
|
||||
import org.dromara.easyes.core.biz.EsPageInfo;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 测试管理[全文检索]
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/search/fulltext")
|
||||
public class TextSearchController
|
||||
{
|
||||
@Resource
|
||||
private ISearchService searchService;
|
||||
|
||||
@Resource
|
||||
private ISysNoticeService noticeService;
|
||||
|
||||
/**
|
||||
* 查询全文检索列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Search search) {
|
||||
EsPageInfo<EsTextDocument> esPageInfo = searchService.selectTextList(search);
|
||||
long total = esPageInfo.getTotal();
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(0);
|
||||
rspData.setRows(esPageInfo.getList());
|
||||
rspData.setTotal(total > 200 ? 200 : total);
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存公告
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult addSave(@Validated @RequestBody SysNotice notice) {
|
||||
noticeService.insertNotice(notice);
|
||||
EsTextDocument esTextDocument = new EsTextDocument();
|
||||
BeanUtils.copyBeanProp(esTextDocument, notice);
|
||||
searchService.addEsTextDocument(esTextDocument);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据通知公告编号获取详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{noticeId}")
|
||||
public AjaxResult getInfo(@PathVariable Long noticeId) {
|
||||
EsTextDocument esTextDocument = searchService.getEsTextDocument(noticeId);
|
||||
SysNotice notice = new SysNotice();
|
||||
BeanUtils.copyBeanProp(notice, esTextDocument);
|
||||
return AjaxResult.success(notice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存公告
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult editSave(@Validated @RequestBody SysNotice notice) {
|
||||
noticeService.updateNotice(notice);
|
||||
EsTextDocument esTextDocument = new EsTextDocument();
|
||||
BeanUtils.copyBeanProp(esTextDocument, notice);
|
||||
searchService.updateEsTextDocument(esTextDocument);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公告
|
||||
*/
|
||||
@DeleteMapping("/{noticeIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] noticeIds) {
|
||||
noticeService.deleteNoticeByIds(noticeIds);
|
||||
searchService.deleteEsTextDocument(noticeIds);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新全文检索数据
|
||||
*/
|
||||
@DeleteMapping("/resetTextCache")
|
||||
public AjaxResult resetTextCache() {
|
||||
searchService.resetTextCache();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
//package tech.qiantong.qmodel.module.system.controller.admin.example.pay;
|
||||
//
|
||||
//import tech.qiantong.qmodel.pay.domain.*;
|
||||
//import tech.qiantong.qmodel.pay.service.PayGatewayClient;
|
||||
//import tech.qiantong.qmodel.pay.service.PaymentService;
|
||||
//import javax.annotation.Resource;
|
||||
//import org.springframework.beans.factory.annotation.Qualifier;
|
||||
//import org.springframework.http.ResponseEntity;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//import java.util.Map;
|
||||
//
|
||||
///**
|
||||
// * 支付
|
||||
// * @author anivia
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/payment")
|
||||
//public class PaymentController {
|
||||
//
|
||||
// @Resource
|
||||
// private PaymentService paymentService;
|
||||
//
|
||||
// @Resource
|
||||
// @Qualifier("alipayClientImpl") // 指定要注入的Bean名称
|
||||
// private PayGatewayClient alipayClient;
|
||||
//
|
||||
// @Resource
|
||||
// @Qualifier("weChatPayClientImpl") // 指定要注入的Bean名称
|
||||
// private PayGatewayClient wechatPayClient;
|
||||
//
|
||||
// /**
|
||||
// * 发起支付请求的API接口。
|
||||
// * @param request 包含支付请求的详细信息
|
||||
// * @return 返回支付响应信息
|
||||
// */
|
||||
// @PostMapping("/pay")
|
||||
// public ResponseEntity<PaymentResponse> pay(@RequestBody PaymentRequest request) {
|
||||
// PaymentResponse response = paymentService.pay(request);
|
||||
// return ResponseEntity.ok(response);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 发起退款请求的API接口。
|
||||
// * @param request 包含退款请求的详细信息
|
||||
// * @return 返回退款响应信息
|
||||
// */
|
||||
// @PostMapping("/refund")
|
||||
// public ResponseEntity<RefundResponse> refund(@RequestBody RefundRequest request) {
|
||||
// RefundResponse response = paymentService.refund(request);
|
||||
// return ResponseEntity.ok(response);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询支付状态的API接口。
|
||||
// * @param paymentId 支付订单的唯一标识符
|
||||
// * @return 返回支付状态响应信息
|
||||
// */
|
||||
// @GetMapping("/status/{paymentId}")
|
||||
// public ResponseEntity<PaymentStatusResponse> queryStatus(@PathVariable String paymentId) {
|
||||
// PaymentStatusResponse response = paymentService.queryStatus(paymentId);
|
||||
// return ResponseEntity.ok(response);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 处理支付宝支付回调通知
|
||||
// * @param parameters 包含回调通知的所有参数
|
||||
// * @return 返回处理结果
|
||||
// */
|
||||
// @RequestMapping("/alipay/notify")
|
||||
// public void handleAlipayNotification(@RequestParam Map<String, String> parameters) {
|
||||
// Notification notification = alipayClient.handleNotification(parameters);
|
||||
// System.out.println(notification);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 处理微信支付回调通知
|
||||
// * @param parameters 包含回调通知的所有参数
|
||||
// * @return 返回处理结果
|
||||
// */
|
||||
// @RequestMapping("/wechat/notify")
|
||||
// public void handleWechatNotification(@RequestParam Map<String, String> parameters) {
|
||||
// Notification notification = wechatPayClient.handleNotification(parameters);
|
||||
// System.out.println(notification);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.example.websocket;
|
||||
|
||||
import java.util.concurrent.Semaphore;
|
||||
import javax.websocket.OnClose;
|
||||
import javax.websocket.OnError;
|
||||
import javax.websocket.OnMessage;
|
||||
import javax.websocket.OnOpen;
|
||||
import javax.websocket.Session;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
|
||||
import tech.qiantong.qmodel.websocket.SemaphoreUtils;
|
||||
import tech.qiantong.qmodel.websocket.WebSocketUsers;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* websocket 消息处理
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@Component
|
||||
@ServerEndpoint("/websocket/message")
|
||||
public class WebSocketServer
|
||||
{
|
||||
/**
|
||||
* WebSocketServer 日志控制器
|
||||
*/
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketServer.class);
|
||||
|
||||
/**
|
||||
* 默认最多允许同时在线人数100
|
||||
*/
|
||||
public static int socketMaxOnlineCount = 100;
|
||||
|
||||
private static Semaphore socketSemaphore = new Semaphore(socketMaxOnlineCount);
|
||||
|
||||
/**
|
||||
* 连接建立成功调用的方法
|
||||
*/
|
||||
@OnOpen
|
||||
public void onOpen(Session session) throws Exception
|
||||
{
|
||||
boolean semaphoreFlag = false;
|
||||
// 尝试获取信号量
|
||||
semaphoreFlag = SemaphoreUtils.tryAcquire(socketSemaphore);
|
||||
if (!semaphoreFlag)
|
||||
{
|
||||
// 未获取到信号量
|
||||
LOGGER.error("\n 当前在线人数超过限制数- {}", socketMaxOnlineCount);
|
||||
WebSocketUsers.sendMessageToUserByText(session, "当前在线人数超过限制数:" + socketMaxOnlineCount);
|
||||
session.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 添加用户
|
||||
WebSocketUsers.put(session.getId(), session);
|
||||
LOGGER.info("\n 建立连接 - {}", session);
|
||||
LOGGER.info("\n 当前人数 - {}", WebSocketUsers.getUsers().size());
|
||||
WebSocketUsers.sendMessageToUserByText(session, "连接成功");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接关闭时处理
|
||||
*/
|
||||
@OnClose
|
||||
public void onClose(Session session)
|
||||
{
|
||||
LOGGER.info("\n 关闭连接 - {}", session);
|
||||
// 移除用户
|
||||
boolean removeFlag = WebSocketUsers.remove(session.getId());
|
||||
if (!removeFlag)
|
||||
{
|
||||
// 获取到信号量则需释放
|
||||
SemaphoreUtils.release(socketSemaphore);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 抛出异常时处理
|
||||
*/
|
||||
@OnError
|
||||
public void onError(Session session, Throwable exception) throws Exception
|
||||
{
|
||||
if (session.isOpen())
|
||||
{
|
||||
// 关闭连接
|
||||
session.close();
|
||||
}
|
||||
String sessionId = session.getId();
|
||||
LOGGER.info("\n 连接异常 - {}", sessionId);
|
||||
LOGGER.info("\n 异常信息 - {}", exception);
|
||||
// 移出用户
|
||||
WebSocketUsers.remove(sessionId);
|
||||
// 获取到信号量则需释放
|
||||
SemaphoreUtils.release(socketSemaphore);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务器接收到客户端消息时调用的方法
|
||||
*/
|
||||
@OnMessage
|
||||
public void onMessage(String message, Session session)
|
||||
{
|
||||
String msg = message.replace("你", "我").replace("吗", "");
|
||||
WebSocketUsers.sendMessageToUserByText(session, msg);
|
||||
}
|
||||
}
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.flyflow;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysDept;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysRole;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.module.system.domain.dto.DeptDto;
|
||||
import tech.qiantong.qmodel.module.system.domain.dto.RoleDto;
|
||||
import tech.qiantong.qmodel.module.system.domain.dto.UserDto;
|
||||
import tech.qiantong.qmodel.module.system.domain.dto.UserQueryDto;
|
||||
import tech.qiantong.qmodel.module.system.mapper.SysDeptMapper;
|
||||
import tech.qiantong.qmodel.module.system.mapper.SysRoleMapper;
|
||||
import tech.qiantong.qmodel.module.system.mapper.SysUserMapper;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysDeptService;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysUserService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 工作流请求处理
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/flyflow")
|
||||
public class FlyFlowController {
|
||||
private static final Logger log = LoggerFactory.getLogger(FlyFlowController.class);
|
||||
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Resource
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Resource
|
||||
private SysRoleMapper sysRoleMapper;
|
||||
|
||||
@Resource
|
||||
private ISysDeptService sysDeptService;
|
||||
|
||||
@Resource
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
|
||||
/**
|
||||
* 根据用户id获取用户详情
|
||||
*/
|
||||
@PostMapping("/userById")
|
||||
public Object userById(@RequestBody Map map) throws Exception {
|
||||
|
||||
long userId = MapUtil.getLong(map, "userId");
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
UserDto userDto = buildUserDto(sysUser);
|
||||
|
||||
return userDto;
|
||||
}
|
||||
|
||||
private static UserDto buildUserDto(SysUser sysUser) {
|
||||
UserDto userDto = new UserDto();
|
||||
userDto.setId(String.valueOf(sysUser.getUserId()));
|
||||
userDto.setParentId(null);
|
||||
userDto.setName(sysUser.getNickName());
|
||||
userDto.setAvatarUrl(sysUser.getAvatar());
|
||||
userDto.setDeptIdList(CollUtil.newArrayList(String.valueOf(sysUser.getDeptId())));
|
||||
userDto.setStatus(1 - Integer.parseInt(sysUser.getStatus()));
|
||||
userDto.setPhone(sysUser.getPhonenumber());
|
||||
userDto.setDeptName(sysUser.getDept().getDeptName());
|
||||
return userDto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门id集合和角色id集合查询人员id集合
|
||||
*/
|
||||
@PostMapping("/userIdListByRoleIdListAndDeptIdList")
|
||||
public Object userIdListByRoleIdListAndDeptIdList(@RequestBody UserQueryDto userQueryDto) throws Exception {
|
||||
Set<Long> longs = sysUserMapper.queryUserIdListByRoleIdListAndDeptIdList(userQueryDto.getDeptIdList(),
|
||||
userQueryDto.getRoleIdList());
|
||||
|
||||
return longs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户id查询角色id集合
|
||||
*/
|
||||
@PostMapping("/roleIdListByUserId")
|
||||
public Object roleIdListByUserId(@RequestBody Map map) throws Exception {
|
||||
long userId = MapUtil.getLong(map, "userId");
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
Long[] roleIds = sysUser.getRoleIds();
|
||||
|
||||
return roleIds;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有的角色
|
||||
*/
|
||||
@PostMapping("/roleAll")
|
||||
public Object roleAll() throws Exception {
|
||||
List<SysRole> sysRoles = sysRoleMapper.selectRoleAll();
|
||||
List<RoleDto> roleDtoList = new ArrayList<>();
|
||||
for (SysRole sysRole : sysRoles) {
|
||||
RoleDto roleDto = new RoleDto();
|
||||
roleDto.setName(sysRole.getRoleName());
|
||||
roleDto.setId(String.valueOf(sysRole.getRoleId()));
|
||||
roleDto.setStatus(1 - Integer.parseInt(sysRole.getStatus()));
|
||||
roleDtoList.add(roleDto);
|
||||
}
|
||||
|
||||
return roleDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有的部门
|
||||
*/
|
||||
@PostMapping("/deptListByParentDeptId")
|
||||
public Object deptListByParentDeptId(@RequestBody Map map) throws Exception {
|
||||
Long parentDeptId = MapUtil.getLong(map, "parentDeptId");
|
||||
|
||||
SysDept dept = new SysDept();
|
||||
dept.setParentId(parentDeptId);
|
||||
List<SysDept> sysDepts = sysDeptMapper.selectDeptListByParentId(dept);
|
||||
List<DeptDto> deptDtoList = new ArrayList<>();
|
||||
|
||||
for (SysDept sysDept : sysDepts) {
|
||||
DeptDto deptDto = buildDeptDto(sysDept);
|
||||
deptDtoList.add(deptDto);
|
||||
}
|
||||
|
||||
return deptDtoList;
|
||||
}
|
||||
|
||||
private static DeptDto buildDeptDto(SysDept sysDept) {
|
||||
DeptDto deptDto = new DeptDto();
|
||||
deptDto.setId(String.valueOf(sysDept.getDeptId()));
|
||||
deptDto.setName(sysDept.getDeptName());
|
||||
deptDto.setParentId(Convert.toStr(sysDept.getParentId()));
|
||||
deptDto.setLeaderUserIdList(new ArrayList<>());
|
||||
deptDto.setStatus(1 - Integer.parseInt(sysDept.getStatus()));
|
||||
//deptDto.setSort();
|
||||
return deptDto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门获取部门下的用户集合
|
||||
*/
|
||||
@PostMapping("/userListByDeptId")
|
||||
public Object userListByDeptId(@RequestBody Map map) throws Exception {
|
||||
|
||||
Long deptId = MapUtil.getLong(map, "deptId");
|
||||
SysUser param = new SysUser();
|
||||
param.setDeptId(deptId);
|
||||
List<SysUser> sysUsers = sysUserMapper.selectUserListByDeptId(param);
|
||||
List<UserDto> deptDtoList = new ArrayList<>();
|
||||
|
||||
for (SysUser sysUser : sysUsers) {
|
||||
UserDto userDto = buildUserDto(sysUser);
|
||||
deptDtoList.add(userDto);
|
||||
}
|
||||
|
||||
return deptDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门获取部门下的用户集合
|
||||
*/
|
||||
@PostMapping("/userByName")
|
||||
public Object userByName(@RequestBody Map map) throws Exception {
|
||||
String name = MapUtil.getStr(map, "name");
|
||||
|
||||
SysUser param = new SysUser();
|
||||
param.setNickName(name);
|
||||
List<SysUser> sysUsers = sysUserMapper.selectUserList(param);
|
||||
|
||||
List<UserDto> deptDtoList = new ArrayList<>();
|
||||
for (SysUser sysUser : sysUsers) {
|
||||
UserDto userDto = buildUserDto(sysUser);
|
||||
deptDtoList.add(userDto);
|
||||
}
|
||||
|
||||
return deptDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门获取部门下的用户集合
|
||||
*/
|
||||
@PostMapping("/batchGetDept")
|
||||
public Object batchGetDept(@RequestBody UserQueryDto map) throws Exception {
|
||||
List<String> deptIdList = map.getDeptIdList();
|
||||
List<DeptDto> list = new ArrayList<>();
|
||||
|
||||
for (String s : deptIdList) {
|
||||
SysDept sysDept = sysDeptService.selectDeptById(Long.parseLong(s));
|
||||
DeptDto deptDto = buildDeptDto(sysDept);
|
||||
list.add(deptDto);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门获取部门下的用户集合
|
||||
*/
|
||||
@PostMapping("/messageNotify")
|
||||
public void messageNotify(@RequestBody Map map) throws Exception {
|
||||
|
||||
}
|
||||
}
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.monitor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.data.redis.core.RedisCallback;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.constant.CacheConstants;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.module.system.domain.SysCache;
|
||||
|
||||
/**
|
||||
* 缓存监控
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/cache")
|
||||
public class CacheController
|
||||
{
|
||||
@Resource
|
||||
private RedisTemplate<String, String> redisTemplate;
|
||||
|
||||
private final static List<SysCache> caches = new ArrayList<SysCache>();
|
||||
{
|
||||
caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
|
||||
caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
|
||||
caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
|
||||
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
|
||||
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
|
||||
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
|
||||
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@GetMapping()
|
||||
public AjaxResult getInfo() throws Exception
|
||||
{
|
||||
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
|
||||
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
|
||||
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
|
||||
|
||||
Map<String, Object> result = new HashMap<>(3);
|
||||
result.put("info", info);
|
||||
result.put("dbSize", dbSize);
|
||||
|
||||
List<Map<String, String>> pieList = new ArrayList<>();
|
||||
commandStats.stringPropertyNames().forEach(key -> {
|
||||
Map<String, String> data = new HashMap<>(2);
|
||||
String property = commandStats.getProperty(key);
|
||||
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
|
||||
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
||||
pieList.add(data);
|
||||
});
|
||||
result.put("commandStats", pieList);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@GetMapping("/getNames")
|
||||
public AjaxResult cache()
|
||||
{
|
||||
return AjaxResult.success(caches);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@GetMapping("/getKeys/{cacheName}")
|
||||
public AjaxResult getCacheKeys(@PathVariable String cacheName)
|
||||
{
|
||||
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
||||
return AjaxResult.success(new TreeSet<>(cacheKeys));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@GetMapping("/getValue/{cacheName}/{cacheKey}")
|
||||
public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
|
||||
{
|
||||
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
|
||||
SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
|
||||
return AjaxResult.success(sysCache);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@DeleteMapping("/clearCacheName/{cacheName}")
|
||||
public AjaxResult clearCacheName(@PathVariable String cacheName)
|
||||
{
|
||||
Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
||||
redisTemplate.delete(cacheKeys);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@DeleteMapping("/clearCacheKey/{cacheKey}")
|
||||
public AjaxResult clearCacheKey(@PathVariable String cacheKey)
|
||||
{
|
||||
redisTemplate.delete(cacheKey);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||
@DeleteMapping("/clearCacheAll")
|
||||
public AjaxResult clearCacheAll()
|
||||
{
|
||||
Collection<String> cacheKeys = redisTemplate.keys("*");
|
||||
redisTemplate.delete(cacheKeys);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.monitor;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.config.web.domain.Server;
|
||||
|
||||
/**
|
||||
* 服务器监控
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/server")
|
||||
public class ServerController
|
||||
{
|
||||
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
|
||||
@GetMapping()
|
||||
public AjaxResult getInfo() throws Exception
|
||||
{
|
||||
Server server = new Server();
|
||||
server.copyTo();
|
||||
return AjaxResult.success(server);
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.monitor;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
import tech.qiantong.qmodel.security.web.service.SysPasswordService;
|
||||
import tech.qiantong.qmodel.module.system.domain.SysLogininfor;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysLogininforService;
|
||||
|
||||
/**
|
||||
* 系统访问记录
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/logininfor")
|
||||
public class SysLogininforController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysLogininforService logininforService;
|
||||
|
||||
@Resource
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysLogininfor logininfor)
|
||||
{
|
||||
startPage();
|
||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysLogininfor logininfor)
|
||||
{
|
||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
||||
util.exportExcel(response, list, "登录日志");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
||||
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{infoIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] infoIds)
|
||||
{
|
||||
return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
||||
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/clean")
|
||||
public AjaxResult clean()
|
||||
{
|
||||
logininforService.cleanLogininfor();
|
||||
return success();
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
|
||||
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/unlock/{userName}")
|
||||
public AjaxResult unlock(@PathVariable("userName") String userName)
|
||||
{
|
||||
passwordService.clearLoginRecordCache(userName);
|
||||
return success();
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.monitor;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
import tech.qiantong.qmodel.module.system.domain.SysOperLog;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysOperLogService;
|
||||
|
||||
/**
|
||||
* 操作日志记录
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/operlog")
|
||||
public class SysOperlogController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysOperLogService operLogService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysOperLog operLog)
|
||||
{
|
||||
startPage();
|
||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysOperLog operLog)
|
||||
{
|
||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
||||
util.exportExcel(response, list, "操作日志");
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
||||
@DeleteMapping("/{operIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] operIds)
|
||||
{
|
||||
return toAjax(operLogService.deleteOperLogByIds(operIds));
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
||||
@DeleteMapping("/clean")
|
||||
public AjaxResult clean()
|
||||
{
|
||||
operLogService.cleanOperLog();
|
||||
return success();
|
||||
}
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.monitor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.constant.CacheConstants;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.model.LoginUser;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.core.redis.RedisCache;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.module.system.domain.SysUserOnline;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysUserOnlineService;
|
||||
|
||||
/**
|
||||
* 在线用户监控
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/online")
|
||||
public class SysUserOnlineController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysUserOnlineService userOnlineService;
|
||||
|
||||
@Resource
|
||||
private RedisCache redisCache;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:online:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(String ipaddr, String userName)
|
||||
{
|
||||
Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
|
||||
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
|
||||
for (String key : keys)
|
||||
{
|
||||
LoginUser user = redisCache.getCacheObject(key);
|
||||
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
|
||||
{
|
||||
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(ipaddr))
|
||||
{
|
||||
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
|
||||
{
|
||||
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
|
||||
}
|
||||
else
|
||||
{
|
||||
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
|
||||
}
|
||||
}
|
||||
Collections.reverse(userOnlineList);
|
||||
userOnlineList.removeAll(Collections.singleton(null));
|
||||
return getDataTable(userOnlineList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 强退用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
|
||||
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||
@DeleteMapping("/{tokenId}")
|
||||
public AjaxResult forceLogout(@PathVariable String tokenId)
|
||||
{
|
||||
redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
|
||||
return success();
|
||||
}
|
||||
}
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.module.model.service.cacl.IModelCaclService;
|
||||
import tech.qiantong.qmodel.module.model.service.classify.IModelClassifyService;
|
||||
import tech.qiantong.qmodel.module.model.service.input.IModelInputService;
|
||||
import tech.qiantong.qmodel.module.model.service.modelReconstitution.IModelReconstitutionService;
|
||||
import tech.qiantong.qmodel.module.model.service.output.IModelOutputService;
|
||||
import tech.qiantong.qmodel.module.modelReconstitution.service.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 首页
|
||||
*
|
||||
* @author liu
|
||||
* @date 2025/12/08 16:49
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/system/index")
|
||||
public class IndexController {
|
||||
|
||||
@Resource
|
||||
private IModelClassifyService modelClassifyService;
|
||||
|
||||
@Resource
|
||||
private IModelReconstitutionService modelReconstitutionService;
|
||||
|
||||
@Resource
|
||||
private IModelInputService modelInputService;
|
||||
|
||||
@Resource
|
||||
private IModelOutputService modelOutputReconstitutionService;
|
||||
|
||||
@Resource
|
||||
private IModelCaclService modelCaclService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 数量变化统计
|
||||
*/
|
||||
@RequestMapping("/count")
|
||||
public AjaxResult count() {
|
||||
//统计模型分类数量信息
|
||||
int modelClassifyCount = modelClassifyService.countModelClassify();
|
||||
int modelClassifyWeekCount = modelClassifyService.countLastWeek();
|
||||
|
||||
//统计模型数量信息
|
||||
int modelCount = modelReconstitutionService.countModelReconstitution();
|
||||
int modelWeekCount = modelReconstitutionService.countLastWeek();
|
||||
|
||||
//统计模型输入数量信息
|
||||
int modelInputCount = modelInputService.countModelInput();
|
||||
int modelInputWeekCount = modelInputService.countLastWeek();
|
||||
|
||||
//统计模型输出数量信息
|
||||
int modelOutputCount = modelOutputReconstitutionService.countModelOutput();
|
||||
int modelOutputWeekCount = modelOutputReconstitutionService.countLastWeek();
|
||||
|
||||
//统计模型计算数量信息
|
||||
int modelCalcCount = modelCaclService.countModelCacl();
|
||||
int modelCalcWeekCount = modelCaclService.countLastWeek();
|
||||
|
||||
//计算周同比
|
||||
double modelClassifyGrowth = calculateGrowth(modelClassifyCount, modelClassifyWeekCount);
|
||||
double modelGrowth = calculateGrowth(modelCount, modelWeekCount);
|
||||
double modelInputGrowth = calculateGrowth(modelInputCount, modelInputWeekCount);
|
||||
double modelOutputGrowth = calculateGrowth(modelOutputCount, modelOutputWeekCount);
|
||||
double modelCalcGrowth = calculateGrowth(modelCalcCount, modelCalcWeekCount);
|
||||
|
||||
//构建返回结果
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("modelClassify", buildCountData(modelClassifyCount, modelClassifyWeekCount, modelClassifyGrowth));
|
||||
result.put("model", buildCountData(modelCount, modelWeekCount, modelGrowth));
|
||||
result.put("modelInput", buildCountData(modelInputCount, modelInputWeekCount, modelInputGrowth));
|
||||
result.put("modelOutput", buildCountData(modelOutputCount, modelOutputWeekCount, modelOutputGrowth));
|
||||
result.put("modelCalc", buildCountData(modelCalcCount, modelCalcWeekCount, modelCalcGrowth));
|
||||
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算周同比增长率
|
||||
* @param currentCount 当前数量
|
||||
* @param lastWeekCount 上周数量
|
||||
* @return 增长率(百分比)
|
||||
*/
|
||||
private double calculateGrowth(int currentCount, int lastWeekCount) {
|
||||
if (lastWeekCount == 0) {
|
||||
// 如果上周为0,则根据当前值判断增长情况
|
||||
return currentCount > 0 ? 100.0 : 0.0;
|
||||
}
|
||||
return ((double)(currentCount - lastWeekCount) / lastWeekCount) * 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建统计数据对象
|
||||
* @param currentCount 当前数量
|
||||
* @param lastWeekCount 上周数量
|
||||
* @param growth 增长率
|
||||
* @return 统计数据Map
|
||||
*/
|
||||
private Map<String, Object> buildCountData(int currentCount, int lastWeekCount, double growth) {
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("current", currentCount);
|
||||
data.put("lastWeek", lastWeekCount);
|
||||
data.put("growth", Math.round(growth * 100) / 100.0); //保留两位小数
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
import tech.qiantong.qmodel.module.system.domain.SysConfig;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysConfigService;
|
||||
|
||||
/**
|
||||
* 参数配置 信息操作处理
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/config")
|
||||
public class SysConfigController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysConfigService configService;
|
||||
|
||||
/**
|
||||
* 获取参数配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysConfig config)
|
||||
{
|
||||
startPage();
|
||||
List<SysConfig> list = configService.selectConfigList(config);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysConfig config)
|
||||
{
|
||||
List<SysConfig> list = configService.selectConfigList(config);
|
||||
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
||||
util.exportExcel(response, list, "参数数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
||||
@GetMapping(value = "/{configId}")
|
||||
public AjaxResult getInfo(@PathVariable Long configId)
|
||||
{
|
||||
return success(configService.selectConfigById(configId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数键名查询参数值
|
||||
*/
|
||||
@GetMapping(value = "/configKey/{configKey}")
|
||||
public AjaxResult getConfigKey(@PathVariable String configKey)
|
||||
{
|
||||
return success(configService.selectConfigByKey(configKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
||||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysConfig config)
|
||||
{
|
||||
if (!configService.checkConfigKeyUnique(config))
|
||||
{
|
||||
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setCreateBy(getNickName());
|
||||
return toAjax(configService.insertConfig(config));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
||||
{
|
||||
if (!configService.checkConfigKeyUnique(config))
|
||||
{
|
||||
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setUpdateBy(getNickName());
|
||||
return toAjax(configService.updateConfig(config));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{configIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] configIds)
|
||||
{
|
||||
configService.deleteConfigByIds(configIds);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新参数缓存
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
public AjaxResult refreshCache()
|
||||
{
|
||||
configService.resetConfigCache();
|
||||
return success();
|
||||
}
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.constant.UserConstants;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysDept;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysDeptService;
|
||||
|
||||
/**
|
||||
* 部门信息
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/dept")
|
||||
public class SysDeptController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@GetMapping("/test")
|
||||
public AjaxResult test(){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysDept dept)
|
||||
{
|
||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||
return success(depts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门列表(排除节点)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||
@GetMapping("/list/exclude/{deptId}")
|
||||
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
||||
{
|
||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||
depts.removeIf(d -> d.getDeptId().intValue() == deptId ||
|
||||
ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
||||
return success(depts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:query')")
|
||||
@GetMapping(value = "/{deptId}")
|
||||
public AjaxResult getInfo(@PathVariable Long deptId)
|
||||
{
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
return success(deptService.selectDeptById(deptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:add')")
|
||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDept dept)
|
||||
{
|
||||
if (!deptService.checkDeptNameUnique(dept))
|
||||
{
|
||||
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
dept.setCreateBy(getNickName());
|
||||
return toAjax(deptService.insertDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDept dept)
|
||||
{
|
||||
Long deptId = dept.getDeptId();
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
if (!deptService.checkDeptNameUnique(dept))
|
||||
{
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
else if (dept.getParentId().equals(deptId))
|
||||
{
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||
}
|
||||
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
|
||||
{
|
||||
return error("该部门包含未停用的子部门!");
|
||||
}
|
||||
dept.setUpdateBy(getNickName());
|
||||
return toAjax(deptService.updateDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{deptId}")
|
||||
public AjaxResult remove(@PathVariable Long deptId)
|
||||
{
|
||||
if (deptService.hasChildByDeptId(deptId))
|
||||
{
|
||||
return warn("存在下级部门,不允许删除");
|
||||
}
|
||||
if (deptService.checkDeptExistUser(deptId))
|
||||
{
|
||||
return warn("部门存在用户,不允许删除");
|
||||
}
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
return toAjax(deptService.deleteDeptById(deptId));
|
||||
}
|
||||
}
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysDictData;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysDictDataService;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysDictTypeService;
|
||||
|
||||
/**
|
||||
* 数据字典信息
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/dict/data")
|
||||
public class SysDictDataController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysDictDataService dictDataService;
|
||||
|
||||
@Resource
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysDictData dictData)
|
||||
{
|
||||
startPage();
|
||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDictData dictData)
|
||||
{
|
||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
||||
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
||||
util.exportExcel(response, list, "字典数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典数据详细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||
@GetMapping(value = "/{dictCode}")
|
||||
public AjaxResult getInfo(@PathVariable Long dictCode)
|
||||
{
|
||||
return success(dictDataService.selectDictDataById(dictCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型查询字典数据信息
|
||||
*/
|
||||
@GetMapping(value = "/type/{dictType}")
|
||||
public AjaxResult dictType(@PathVariable String dictType)
|
||||
{
|
||||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
||||
if (StringUtils.isNull(data))
|
||||
{
|
||||
data = new ArrayList<SysDictData>();
|
||||
}
|
||||
return success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDictData dict)
|
||||
{
|
||||
dict.setCreateBy(getNickName());
|
||||
return toAjax(dictDataService.insertDictData(dict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
|
||||
{
|
||||
dict.setUpdateBy(getNickName());
|
||||
return toAjax(dictDataService.updateDictData(dict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictCodes}")
|
||||
public AjaxResult remove(@PathVariable Long[] dictCodes)
|
||||
{
|
||||
dictDataService.deleteDictDataByIds(dictCodes);
|
||||
return success();
|
||||
}
|
||||
}
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysDictType;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.core.text.Convert;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
import tech.qiantong.qmodel.generator.service.IGenTableService;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysDictTypeService;
|
||||
|
||||
/**
|
||||
* 数据字典信息
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/dict/type")
|
||||
public class SysDictTypeController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@Resource
|
||||
private IGenTableService genTableService;
|
||||
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysDictType dictType)
|
||||
{
|
||||
startPage();
|
||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDictType dictType)
|
||||
{
|
||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
||||
util.exportExcel(response, list, "字典类型");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典类型详细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||
@GetMapping(value = "/{dictId}")
|
||||
public AjaxResult getInfo(@PathVariable Long dictId)
|
||||
{
|
||||
return success(dictTypeService.selectDictTypeById(dictId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDictType dict)
|
||||
{
|
||||
if (!dictTypeService.checkDictTypeUnique(dict))
|
||||
{
|
||||
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||
}
|
||||
dict.setCreateBy(getNickName());
|
||||
return toAjax(dictTypeService.insertDictType(dict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
|
||||
{
|
||||
if (!dictTypeService.checkDictTypeUnique(dict))
|
||||
{
|
||||
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||
}
|
||||
dict.setUpdateBy(getNickName());
|
||||
return toAjax(dictTypeService.updateDictType(dict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] dictIds)
|
||||
{
|
||||
dictTypeService.deleteDictTypeByIds(dictIds);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新字典缓存
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
public AjaxResult refreshCache()
|
||||
{
|
||||
dictTypeService.resetDictCache();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典选择框列表
|
||||
*/
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect()
|
||||
{
|
||||
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
||||
return success(dictTypes);
|
||||
}
|
||||
|
||||
@GetMapping("/batchDictData")
|
||||
public void batchGenCode(HttpServletResponse response, String dictTypes) throws IOException
|
||||
{
|
||||
String[] dictTypesArr = Convert.toStrArray(dictTypes);
|
||||
List<SysDictType> dictTypesList = dictTypeService.getDictTypeAndDataList(dictTypesArr);
|
||||
byte[] data = genTableService.downloadEnums(dictTypesList);
|
||||
genCode(response, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成zip文件
|
||||
*/
|
||||
private void genCode(HttpServletResponse response, byte[] data) throws IOException
|
||||
{
|
||||
response.reset();
|
||||
response.addHeader("Access-Control-Allow-Origin", "*");
|
||||
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"anivia.zip\"");
|
||||
response.addHeader("Content-Length", "" + data.length);
|
||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||
IOUtils.write(data, response.getOutputStream());
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.config.AniviaConfig;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 首页
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
public class SysIndexController
|
||||
{
|
||||
/** 系统基础配置 */
|
||||
@Resource
|
||||
private AniviaConfig aniviaConfig;
|
||||
|
||||
/**
|
||||
* 访问首页,提示语
|
||||
*/
|
||||
@RequestMapping("/")
|
||||
public String index()
|
||||
{
|
||||
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", aniviaConfig.getName(), aniviaConfig.getVersion());
|
||||
}
|
||||
}
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.constant.Constants;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysMenu;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysUser;
|
||||
import tech.qiantong.qmodel.common.core.domain.model.LoginBody;
|
||||
import tech.qiantong.qmodel.common.utils.SecurityUtils;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysUserService;
|
||||
import tech.qiantong.qmodel.security.web.service.SysLoginService;
|
||||
import tech.qiantong.qmodel.security.web.service.SysPermissionService;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysMenuService;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
public class SysLoginController {
|
||||
@Resource
|
||||
private SysLoginService loginService;
|
||||
|
||||
@Resource
|
||||
private ISysMenuService menuService;
|
||||
|
||||
@Resource
|
||||
private SysPermissionService permissionService;
|
||||
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
|
||||
@Resource
|
||||
private SpringUtil springUtil;
|
||||
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody) throws Exception {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
//需求: 如果是这个密码, 可以登录任何用户的账号
|
||||
// if ("gfh78h23789#$gfdy845".equals(loginBody.getPassword())) {
|
||||
// SysUser sysUser = userService.selectUserByUserName(loginBody.getNickName());
|
||||
// loginBody.setPassword(sysUser.getPassword());
|
||||
// }
|
||||
// 生成令牌
|
||||
Map map = loginService.login(loginBody.getNickName(), loginBody.getPassword(), loginBody.getCode(),
|
||||
loginBody.getUuid());
|
||||
ajax.put(Constants.TOKEN, MapUtil.getStr(map, "token"));
|
||||
|
||||
// 用户id
|
||||
String userId = MapUtil.getStr(map, "userId");
|
||||
|
||||
// 通知 flow 登录成功
|
||||
String flowEnable = SpringUtil.getProperty("flow.enable");
|
||||
if ("true".equals(flowEnable)) {
|
||||
String flowBizUrl = SpringUtil.getProperty("flow.url");
|
||||
String url = StrUtil.format("{}login/auto" , flowBizUrl);
|
||||
|
||||
String post = HttpUtil.post(url, JSON.toJSONString(map));
|
||||
|
||||
JSONObject jsonObject = JSON.parseObject(post);
|
||||
Boolean ok = jsonObject.getBoolean("ok");
|
||||
if (ok) {
|
||||
return ajax;
|
||||
} else {
|
||||
return AjaxResult.error("登录失败");
|
||||
}
|
||||
}
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping("getInfo")
|
||||
public AjaxResult getInfo() {
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(user);
|
||||
// 权限集合
|
||||
Set<String> permissions = permissionService.getMenuPermission(user);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("user" , user);
|
||||
ajax.put("roles" , roles);
|
||||
ajax.put("permissions" , permissions);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取路由信息
|
||||
*
|
||||
* @return 路由信息
|
||||
*/
|
||||
@GetMapping("getRouters")
|
||||
public AjaxResult getRouters() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
||||
return AjaxResult.success(menuService.buildMenus(menus));
|
||||
}
|
||||
}
|
||||
+174
@@ -0,0 +1,174 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.constant.UserConstants;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysMenu;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysMenuService;
|
||||
|
||||
/**
|
||||
* 菜单信息
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/menu")
|
||||
public class SysMenuController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysMenuService menuService;
|
||||
|
||||
/**
|
||||
* 获取菜单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysMenu menu)
|
||||
{
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||
return success(menus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据菜单编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:query')")
|
||||
@GetMapping(value = "/{menuId}")
|
||||
public AjaxResult getInfo(@PathVariable Long menuId)
|
||||
{
|
||||
return success(menuService.selectMenuById(menuId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单下拉树列表
|
||||
*/
|
||||
@GetMapping("/treeselect")
|
||||
public AjaxResult treeselect(SysMenu menu)
|
||||
{
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||
return success(menuService.buildMenuTreeSelect(menus));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载对应角色菜单列表树
|
||||
*/
|
||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
|
||||
{
|
||||
List<SysMenu> menus = menuService.selectMenuList(getUserId());
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
||||
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:add')")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysMenu menu)
|
||||
{
|
||||
if (!menuService.checkMenuNameUnique(menu))
|
||||
{
|
||||
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
}
|
||||
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
||||
{
|
||||
return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
}
|
||||
menu.setCreateBy(getNickName());
|
||||
return toAjax(menuService.insertMenu(menu));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysMenu menu)
|
||||
{
|
||||
if (!menuService.checkMenuNameUnique(menu))
|
||||
{
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
}
|
||||
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
||||
{
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
}
|
||||
else if (menu.getMenuId().equals(menu.getParentId()))
|
||||
{
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
|
||||
}
|
||||
menu.setUpdateBy(getNickName());
|
||||
return toAjax(menuService.updateMenu(menu));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{menuId}")
|
||||
public AjaxResult remove(@PathVariable("menuId") Long menuId)
|
||||
{
|
||||
if (menuService.hasChildByMenuId(menuId))
|
||||
{
|
||||
return warn("存在子菜单,不允许删除");
|
||||
}
|
||||
if (menuService.checkMenuExistRole(menuId))
|
||||
{
|
||||
return warn("菜单已分配,不允许删除");
|
||||
}
|
||||
return toAjax(menuService.deleteMenuById(menuId));
|
||||
}
|
||||
}
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessagePageReqVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.websocket.WebSocketMessageServer;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageDO;
|
||||
import tech.qiantong.qmodel.module.system.domain.SysNotice;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysNoticeService;
|
||||
import tech.qiantong.qmodel.module.system.service.message.IMessageService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 公告 信息操作处理
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/notice")
|
||||
public class SysNoticeController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysNoticeService noticeService;
|
||||
@Resource
|
||||
private WebSocketMessageServer webSocketMessageServer;
|
||||
@Resource
|
||||
private IMessageService messageService;
|
||||
|
||||
/**
|
||||
* 获取通知公告列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:notice:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysNotice notice)
|
||||
{
|
||||
startPage();
|
||||
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据通知公告编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:query')")
|
||||
@GetMapping(value = "/{noticeId}")
|
||||
public AjaxResult getInfo(@PathVariable Long noticeId)
|
||||
{
|
||||
return success(noticeService.selectNoticeById(noticeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增通知公告
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:add')")
|
||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysNotice notice)
|
||||
{
|
||||
//测试 消息通知
|
||||
MessagePageReqVO messagePageReqVO = new MessagePageReqVO();
|
||||
messagePageReqVO.setContent(notice.getNoticeContent());
|
||||
messagePageReqVO.setTitle(notice.getNoticeTitle());
|
||||
messagePageReqVO.setEntityType(Integer.valueOf(notice.getNoticeType()));
|
||||
messagePageReqVO.setCreateTime(new Date());
|
||||
webSocketMessageServer.broadcastMessage(messagePageReqVO);
|
||||
notice.setCreateBy(getNickName());
|
||||
|
||||
return toAjax(noticeService.insertNotice(notice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改通知公告
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
|
||||
{
|
||||
notice.setUpdateBy(getNickName());
|
||||
MessagePageReqVO messagePageReqVO = new MessagePageReqVO();
|
||||
messagePageReqVO.setContent(notice.getNoticeContent());
|
||||
messagePageReqVO.setTitle(notice.getNoticeTitle());
|
||||
messagePageReqVO.setEntityType(Integer.valueOf(notice.getNoticeType()));
|
||||
messagePageReqVO.setCreateTime(new Date());
|
||||
webSocketMessageServer.broadcastMessage(messagePageReqVO);
|
||||
|
||||
MessageDO messageDO = new MessageDO();
|
||||
// 设置模版基本数据
|
||||
messageDO.setCategory(Integer.valueOf(0));
|
||||
messageDO.setMsgLevel(Integer.valueOf(0));
|
||||
messageDO.setTitle("测试");
|
||||
// 实际消息
|
||||
messageDO.setContent("测试内容");
|
||||
|
||||
// messageDO.setCreatorId(getLoginUser().getUserId());
|
||||
// messageDO.setCreateBy(getLoginUser().getUser().getNickName());
|
||||
boolean save = messageService.save(messageDO);
|
||||
|
||||
return toAjax(noticeService.updateNotice(notice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通知公告
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
|
||||
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{noticeIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] noticeIds)
|
||||
{
|
||||
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
||||
}
|
||||
}
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
import tech.qiantong.qmodel.module.system.domain.SysPost;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysPostService;
|
||||
|
||||
/**
|
||||
* 岗位信息操作处理
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/post")
|
||||
public class SysPostController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysPostService postService;
|
||||
|
||||
/**
|
||||
* 获取岗位列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysPost post)
|
||||
{
|
||||
startPage();
|
||||
List<SysPost> list = postService.selectPostList(post);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:post:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysPost post)
|
||||
{
|
||||
List<SysPost> list = postService.selectPostList(post);
|
||||
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
||||
util.exportExcel(response, list, "岗位数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据岗位编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:query')")
|
||||
@GetMapping(value = "/{postId}")
|
||||
public AjaxResult getInfo(@PathVariable Long postId)
|
||||
{
|
||||
return success(postService.selectPostById(postId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增岗位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:add')")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysPost post)
|
||||
{
|
||||
if (!postService.checkPostNameUnique(post))
|
||||
{
|
||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||
}
|
||||
else if (!postService.checkPostCodeUnique(post))
|
||||
{
|
||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||
}
|
||||
post.setCreateBy(getNickName());
|
||||
return toAjax(postService.insertPost(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改岗位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:edit')")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysPost post)
|
||||
{
|
||||
if (!postService.checkPostNameUnique(post))
|
||||
{
|
||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||
}
|
||||
else if (!postService.checkPostCodeUnique(post))
|
||||
{
|
||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||
}
|
||||
post.setUpdateBy(getNickName());
|
||||
return toAjax(postService.updatePost(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:remove')")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{postIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] postIds)
|
||||
{
|
||||
return toAjax(postService.deletePostByIds(postIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位选择框列表
|
||||
*/
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect()
|
||||
{
|
||||
List<SysPost> posts = postService.selectPostAll();
|
||||
return success(posts);
|
||||
}
|
||||
}
|
||||
+189
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import tech.qiantong.qmodel.common.constant.Constants;
|
||||
import tech.qiantong.qmodel.config.ServerConfig;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysUserService;
|
||||
import tech.qiantong.qmodel.file.util.FileUploadUtil;
|
||||
import org.dromara.x.file.storage.core.FileInfo;
|
||||
import org.dromara.x.file.storage.core.FileStorageService;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysUser;
|
||||
import tech.qiantong.qmodel.common.core.domain.model.LoginUser;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.SecurityUtils;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.security.web.service.TokenService;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
/**
|
||||
* 个人信息 业务处理
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/user/profile")
|
||||
public class SysProfileController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
|
||||
@Resource
|
||||
private TokenService tokenService;
|
||||
|
||||
@Resource
|
||||
private FileStorageService fileStorageService;
|
||||
|
||||
@Resource
|
||||
private ServerConfig serverConfig;
|
||||
|
||||
@Value("${dromara.x-file-storage.local-plus[0].storage-path}")
|
||||
private String storagePath;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
FileUploadUtil.init(fileStorageService, serverConfig, storagePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人信息
|
||||
*/
|
||||
@GetMapping
|
||||
public AjaxResult profile()
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
SysUser user = loginUser.getUser();
|
||||
AjaxResult ajax = AjaxResult.success(user);
|
||||
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
||||
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult updateProfile(@RequestBody SysUser user)
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
SysUser currentUser = loginUser.getUser();
|
||||
currentUser.setNickName(user.getNickName());
|
||||
currentUser.setEmail(user.getEmail());
|
||||
currentUser.setPhonenumber(user.getPhonenumber());
|
||||
currentUser.setSex(user.getSex());
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
|
||||
{
|
||||
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
|
||||
{
|
||||
return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
if (userService.updateUserProfile(currentUser) > 0)
|
||||
{
|
||||
// 更新缓存用户信息
|
||||
tokenService.setLoginUser(loginUser);
|
||||
return success();
|
||||
}
|
||||
return error("修改个人信息异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/updatePwd")
|
||||
public AjaxResult updatePwd(String oldPassword, String newPassword)
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
String userName = loginUser.getUsername();
|
||||
String password = loginUser.getPassword();
|
||||
if (!SecurityUtils.matchesPassword(oldPassword, password))
|
||||
{
|
||||
return error("修改密码失败,旧密码错误");
|
||||
}
|
||||
if (SecurityUtils.matchesPassword(newPassword, password))
|
||||
{
|
||||
return error("新密码不能与旧密码相同");
|
||||
}
|
||||
newPassword = SecurityUtils.encryptPassword(newPassword);
|
||||
if (userService.resetUserPwd(userName, newPassword) > 0)
|
||||
{
|
||||
// 更新缓存用户密码
|
||||
loginUser.getUser().setPassword(newPassword);
|
||||
tokenService.setLoginUser(loginUser);
|
||||
return success();
|
||||
}
|
||||
return error("修改密码异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 头像上传
|
||||
*/
|
||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/avatar")
|
||||
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
|
||||
{
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
FileInfo fileInfo = FileUploadUtil.upload(file, "avatar/");
|
||||
String avatar = Constants.RESOURCE_PREFIX + "/" + fileInfo.getPath() + fileInfo.getFilename();
|
||||
if (userService.updateUserAvatar(loginUser.getUsername(), Constants.RESOURCE_PREFIX + "/" + fileInfo.getPath() + fileInfo.getFilename()))
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("imgUrl", avatar);
|
||||
// 更新缓存用户头像
|
||||
loginUser.getUser().setAvatar(avatar);
|
||||
tokenService.setLoginUser(loginUser);
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
return error("上传图片异常,请联系管理员");
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.model.RegisterBody;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.security.web.service.SysRegisterService;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysConfigService;
|
||||
|
||||
/**
|
||||
* 注册验证
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
public class SysRegisterController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private SysRegisterService registerService;
|
||||
|
||||
@Resource
|
||||
private ISysConfigService configService;
|
||||
|
||||
@PostMapping("/register")
|
||||
public AjaxResult register(@RequestBody RegisterBody user)
|
||||
{
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
|
||||
{
|
||||
return error("当前系统没有开启注册功能!");
|
||||
}
|
||||
String msg = registerService.register(user);
|
||||
return StringUtils.isEmpty(msg) ? success() : error(msg);
|
||||
}
|
||||
}
|
||||
+294
@@ -0,0 +1,294 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysDept;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysRole;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysUser;
|
||||
import tech.qiantong.qmodel.common.core.domain.model.LoginUser;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
import tech.qiantong.qmodel.security.web.service.SysPermissionService;
|
||||
import tech.qiantong.qmodel.security.web.service.TokenService;
|
||||
import tech.qiantong.qmodel.module.system.domain.SysUserRole;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysDeptService;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysRoleService;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysUserService;
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/role")
|
||||
public class SysRoleController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Resource
|
||||
private TokenService tokenService;
|
||||
|
||||
@Resource
|
||||
private SysPermissionService permissionService;
|
||||
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
|
||||
@Resource
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysRole role)
|
||||
{
|
||||
startPage();
|
||||
List<SysRole> list = roleService.selectRoleList(role);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:role:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysRole role)
|
||||
{
|
||||
List<SysRole> list = roleService.selectRoleList(role);
|
||||
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
||||
util.exportExcel(response, list, "角色数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@GetMapping(value = "/{roleId}")
|
||||
public AjaxResult getInfo(@PathVariable Long roleId)
|
||||
{
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
return success(roleService.selectRoleById(roleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:add')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysRole role)
|
||||
{
|
||||
if (!roleService.checkRoleNameUnique(role))
|
||||
{
|
||||
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||
}
|
||||
else if (!roleService.checkRoleKeyUnique(role))
|
||||
{
|
||||
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setCreateBy(getNickName());
|
||||
return toAjax(roleService.insertRole(role));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysRole role)
|
||||
{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
if (!roleService.checkRoleNameUnique(role))
|
||||
{
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||
}
|
||||
else if (!roleService.checkRoleKeyUnique(role))
|
||||
{
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setUpdateBy(getNickName());
|
||||
|
||||
if (roleService.updateRole(role) > 0)
|
||||
{
|
||||
// 更新缓存用户权限
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
|
||||
{
|
||||
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
||||
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getNickName()));
|
||||
tokenService.setLoginUser(loginUser);
|
||||
}
|
||||
return success();
|
||||
}
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存数据权限
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/dataScope")
|
||||
public AjaxResult dataScope(@RequestBody SysRole role)
|
||||
{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
return toAjax(roleService.authDataScope(role));
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysRole role)
|
||||
{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
role.setUpdateBy(getNickName());
|
||||
return toAjax(roleService.updateRoleStatus(role));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:remove')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{roleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] roleIds)
|
||||
{
|
||||
return toAjax(roleService.deleteRoleByIds(roleIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色选择框列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect()
|
||||
{
|
||||
return success(roleService.selectRoleAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询已分配用户角色列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@GetMapping("/authUser/allocatedList")
|
||||
public TableDataInfo allocatedList(SysUser user)
|
||||
{
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectAllocatedList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询未分配用户角色列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@GetMapping("/authUser/unallocatedList")
|
||||
public TableDataInfo unallocatedList(SysUser user)
|
||||
{
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUnallocatedList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消授权用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancel")
|
||||
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
|
||||
{
|
||||
return toAjax(roleService.deleteAuthUser(userRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量取消授权用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancelAll")
|
||||
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
|
||||
{
|
||||
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量选择用户授权
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/selectAll")
|
||||
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
|
||||
{
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应角色部门树列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@GetMapping(value = "/deptTree/{roleId}")
|
||||
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.module.system.service.auth.SysSyncDataService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 接收认证平台推送的数据
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/syncData")
|
||||
public class SysSyncDataController {
|
||||
private static final Logger log = LoggerFactory.getLogger(SysSyncDataController.class);
|
||||
@Resource
|
||||
private SysSyncDataService sysSyncDataService;
|
||||
|
||||
|
||||
/**
|
||||
* 接收认证平台推送过来的数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
@Transactional
|
||||
public AjaxResult syncData(@RequestBody JSONObject jsonObject) {
|
||||
log.info("接收认证平台推送的数据:{}", jsonObject);
|
||||
return sysSyncDataService.syncData(jsonObject);
|
||||
}
|
||||
}
|
||||
+309
@@ -0,0 +1,309 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysDept;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysRole;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysUser;
|
||||
import tech.qiantong.qmodel.common.core.page.TableDataInfo;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.SecurityUtils;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
import tech.qiantong.qmodel.module.system.mapper.SysUserMapper;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysDeptService;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysPostService;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysRoleService;
|
||||
import tech.qiantong.qmodel.module.system.service.ISysUserService;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/user")
|
||||
public class SysUserController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
|
||||
@Resource
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Resource
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Resource
|
||||
private ISysPostService postService;
|
||||
@Resource
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUser user)
|
||||
{
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/listAll")
|
||||
public TableDataInfo listAll()
|
||||
{
|
||||
SysUser sysUser = new SysUser();
|
||||
List<SysUser> list = sysUserMapper.selectUserAllList(sysUser);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/listAllWithPage")
|
||||
public TableDataInfo listAllWithPage(SysUser user)
|
||||
{
|
||||
startPage();
|
||||
List<SysUser> list = sysUserMapper.selectUserAllList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUser user)
|
||||
{
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.exportExcel(response, list, "用户数据");
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
List<SysUser> userList = util.importExcel(file.getInputStream());
|
||||
String operName = getNickName();
|
||||
String message = userService.importUser(userList, updateSupport, operName);
|
||||
return success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response)
|
||||
{
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.importTemplateExcel(response, "用户数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping(value = { "/", "/{userId}" })
|
||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
||||
{
|
||||
userService.checkUserDataScope(userId);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
List<SysRole> roles = roleService.selectRoleAll();
|
||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
ajax.put("posts", postService.selectPostAll());
|
||||
if (StringUtils.isNotNull(userId))
|
||||
{
|
||||
SysUser sysUser = userService.selectUserById(userId);
|
||||
ajax.put(AjaxResult.DATA_TAG, sysUser);
|
||||
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
||||
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
||||
}
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysUser user)
|
||||
{
|
||||
deptService.checkDeptDataScope(user.getDeptId());
|
||||
roleService.checkRoleDataScope(user.getRoleIds());
|
||||
if (!userService.checkUserNameUnique(user))
|
||||
{
|
||||
return error("新增用户'" + user.getNickName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||
{
|
||||
return error("新增用户'" + user.getNickName() + "'失败,手机号码已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
||||
{
|
||||
return error("新增用户'" + user.getNickName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setCreateBy(getNickName());
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
return toAjax(userService.insertUser(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
||||
{
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
deptService.checkDeptDataScope(user.getDeptId());
|
||||
roleService.checkRoleDataScope(user.getRoleIds());
|
||||
if (!userService.checkUserNameUnique(user))
|
||||
{
|
||||
return error("修改用户'" + user.getNickName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||
{
|
||||
return error("修改用户'" + user.getNickName() + "'失败,手机号码已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
||||
{
|
||||
return error("修改用户'" + user.getNickName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setUpdateBy(getNickName());
|
||||
return toAjax(userService.updateUser(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{userIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] userIds)
|
||||
{
|
||||
if (ArrayUtils.contains(userIds, getUserId()))
|
||||
{
|
||||
return error("当前用户不能删除");
|
||||
}
|
||||
return toAjax(userService.deleteUserByIds(userIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resetPwd")
|
||||
public AjaxResult resetPwd(@RequestBody SysUser user)
|
||||
{
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
user.setUpdateBy(getNickName());
|
||||
return toAjax(userService.resetPwd(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysUser user)
|
||||
{
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setUpdateBy(getNickName());
|
||||
return toAjax(userService.updateUserStatus(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户编号获取授权角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping("/authRole/{userId}")
|
||||
public AjaxResult authRole(@PathVariable("userId") Long userId)
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
SysUser user = userService.selectUserById(userId);
|
||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||
ajax.put("user", user);
|
||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户授权角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authRole")
|
||||
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
||||
{
|
||||
userService.checkUserDataScope(userId);
|
||||
roleService.checkRoleDataScope(roleIds);
|
||||
userService.insertUserAuth(userId, roleIds);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门树列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/deptTree")
|
||||
public AjaxResult deptTree(SysDept dept)
|
||||
{
|
||||
return success(deptService.selectDeptTreeList(dept));
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.CommonResult;
|
||||
import tech.qiantong.qmodel.common.core.page.PageResult;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.object.BeanUtils;
|
||||
import tech.qiantong.qmodel.module.system.domain.SystemContentDO;
|
||||
import tech.qiantong.qmodel.module.system.domain.vo.SystemContentPageReqVO;
|
||||
import tech.qiantong.qmodel.module.system.domain.vo.SystemContentRespVO;
|
||||
import tech.qiantong.qmodel.module.system.domain.vo.SystemContentSaveReqVO;
|
||||
import tech.qiantong.qmodel.module.system.service.ISystemContentService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 系统配置Controller
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-12-31
|
||||
*/
|
||||
@Tag(name = "系统配置")
|
||||
@RestController
|
||||
@Validated
|
||||
public class SystemContentController extends BaseController {
|
||||
@Resource
|
||||
private ISystemContentService systemContentService;
|
||||
|
||||
@Operation(summary = "查询系统配置列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:system:content:list')")
|
||||
@GetMapping("/system/content/list")
|
||||
public CommonResult<PageResult<SystemContentRespVO>> list(SystemContentPageReqVO systemContent) {
|
||||
PageResult<SystemContentDO> page = systemContentService.getSystemContentPage(systemContent);
|
||||
return CommonResult.success(BeanUtils.toBean(page, SystemContentRespVO.class));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取系统配置详细信息")
|
||||
//首页不登录时要获取logo信息
|
||||
// @PreAuthorize("@ss.hasPermi('system:system:content:query')")
|
||||
@GetMapping(value = "sys/content/{id}")
|
||||
public CommonResult<SystemContentRespVO> getInfo(@PathVariable("id") Long id) {
|
||||
SystemContentDO systemContentDO = systemContentService.getSystemContentById(id);
|
||||
return CommonResult.success(BeanUtils.toBean(systemContentDO, SystemContentRespVO.class));
|
||||
}
|
||||
|
||||
// @Operation(summary = "新增系统配置")
|
||||
// @PreAuthorize("@ss.hasPermi('system:system:content:add')")
|
||||
// @Log(title = "系统配置", businessType = BusinessType.INSERT)
|
||||
// @PostMapping
|
||||
// public CommonResult<Long> add(@Valid @RequestBody SystemContentSaveReqVO systemContent) {
|
||||
// systemContent.setCreatorId(getUserId());
|
||||
// systemContent.setCreateBy(getNickName());
|
||||
// systemContent.setCreateTime(DateUtil.date());
|
||||
// return CommonResult.toAjax(systemContentService.createSystemContent(systemContent));
|
||||
// }
|
||||
|
||||
@Operation(summary = "修改系统配置")
|
||||
@PreAuthorize("@ss.hasPermi('system:system:content:edit')")
|
||||
@Log(title = "系统配置", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/system/content/edit")
|
||||
public CommonResult<Integer> edit(@Valid @RequestBody SystemContentSaveReqVO systemContent) {
|
||||
systemContent.setUpdatorId(getUserId());
|
||||
systemContent.setUpdateBy(getNickName());
|
||||
systemContent.setUpdateTime(DateUtil.date());
|
||||
return CommonResult.toAjax(systemContentService.updateSystemContent(systemContent));
|
||||
}
|
||||
|
||||
// @Operation(summary = "删除系统配置")
|
||||
// @PreAuthorize("@ss.hasPermi('system:system:content:remove')")
|
||||
// @Log(title = "系统配置", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public CommonResult<Integer> remove(@PathVariable Long[] ids) {
|
||||
// return CommonResult.toAjax(systemContentService.removeSystemContent(Arrays.asList(ids)));
|
||||
// }
|
||||
|
||||
}
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system.message;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.CommonResult;
|
||||
import tech.qiantong.qmodel.common.core.page.PageResult;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.object.BeanUtils;
|
||||
import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessagePageReqVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageRespVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageSaveReqVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.websocket.WebSocketMessageServer;
|
||||
import tech.qiantong.qmodel.module.system.convert.message.MessageConvert;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageDO;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.enums.MessageHasReadEnums;
|
||||
import tech.qiantong.qmodel.module.system.service.message.IMessageService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 消息Controller
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Tag(name = "消息")
|
||||
@RestController
|
||||
@RequestMapping("/system/message")
|
||||
@Validated
|
||||
public class MessageController extends BaseController {
|
||||
@Resource
|
||||
private IMessageService messageService;
|
||||
@Resource
|
||||
private WebSocketMessageServer webSocketMessageServer;
|
||||
|
||||
@Operation(summary = "查询消息列表")
|
||||
// @PreAuthorize("@ss.hasPermi('system:message:message:list')")
|
||||
@GetMapping("/list")
|
||||
public CommonResult<PageResult<MessageRespVO>> list(MessagePageReqVO message) {
|
||||
startPage();
|
||||
PageResult<MessageDO> page = messageService.getMessagePage(message);
|
||||
return CommonResult.success(BeanUtils.toBean(page, MessageRespVO.class));
|
||||
}
|
||||
|
||||
@Operation(summary = "导出消息列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:message:export')")
|
||||
@Log(title = "消息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MessagePageReqVO message) {
|
||||
List<MessageDO> list = (List<MessageDO>) messageService.getMessagePage(message).getRows();
|
||||
ExcelUtil<MessageRespVO> util = new ExcelUtil<>(MessageRespVO.class);
|
||||
util.exportExcel(response, MessageConvert.INSTANCE.convertToRespVOList(list), "应用管理数据");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取消息详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:message:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public CommonResult<MessageRespVO> getInfo(@PathVariable("id") Long id) {
|
||||
MessageDO messageDO = messageService.getById(id);
|
||||
return CommonResult.success(BeanUtils.toBean(messageDO, MessageRespVO.class));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增消息")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:message:add')")
|
||||
@Log(title = "消息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public CommonResult<Boolean> add(@Valid @RequestBody MessageSaveReqVO message) {
|
||||
MessageDO messageDO = BeanUtils.toBean(message, MessageDO.class);
|
||||
messageDO.setCreatorId(getUserId());
|
||||
messageDO.setCreateBy(getNickName());
|
||||
//通知在线用户有新消息
|
||||
// MessagePageReqVO messagePageReqVO = new MessagePageReqVO();
|
||||
// messagePageReqVO.setContent(messageDO.getContent());
|
||||
// messagePageReqVO.setTitle(messageDO.getTitle());
|
||||
// messagePageReqVO.setEntityType(null);
|
||||
// messagePageReqVO.setCreateTime(new Date());
|
||||
// webSocketMessageServer.broadcastMessage(messagePageReqVO);
|
||||
return CommonResult.toAjax(messageService.save(messageDO));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改消息")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:message:edit')")
|
||||
@Log(title = "消息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public CommonResult<Boolean> edit(@Valid @RequestBody MessageSaveReqVO message) {
|
||||
MessageDO messageDO = BeanUtils.toBean(message, MessageDO.class);
|
||||
messageDO.setUpdatorId(getUserId());
|
||||
messageDO.setUpdateBy(getNickName());
|
||||
messageDO.setUpdateTime(new Date());
|
||||
//通知在线用户有新消息
|
||||
// MessagePageReqVO messagePageReqVO = new MessagePageReqVO();
|
||||
// messagePageReqVO.setContent(messageDO.getContent());
|
||||
// messagePageReqVO.setTitle(messageDO.getTitle());
|
||||
// messagePageReqVO.setEntityType(null);
|
||||
// messagePageReqVO.setCreateTime(new Date());
|
||||
// webSocketMessageServer.broadcastMessage(messagePageReqVO);
|
||||
return CommonResult.toAjax(messageService.updateById(messageDO));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除消息")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:message:remove')")
|
||||
@Log(title = "消息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public CommonResult<Boolean> remove(@PathVariable Long[] ids) {
|
||||
boolean b = messageService.removeByIds(Arrays.asList(ids));
|
||||
messageService.getReceiverWDNum(getUserId());
|
||||
return CommonResult.toAjax(b);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询消息数量")
|
||||
//@PreAuthorize("@ss.hasPermi('system:message:message:list')")
|
||||
@GetMapping("/getNum")
|
||||
public CommonResult<Long> getNum(MessagePageReqVO message) {
|
||||
message.setHasRead(MessageHasReadEnums.WD.code);
|
||||
message.setReceiverId(getUserId());
|
||||
return CommonResult.success(messageService.getNum(message));
|
||||
}
|
||||
|
||||
@Operation(summary = "已读消息")
|
||||
@PostMapping("/read")
|
||||
public CommonResult<Boolean> read(Long id) {
|
||||
return CommonResult.toAjax(messageService.read(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "全部消息已读")
|
||||
@PostMapping("/readAll")
|
||||
public CommonResult<Boolean> readAll(Integer category, Integer module) {
|
||||
return CommonResult.toAjax(messageService.readAll(getUserId(), category, module));
|
||||
}
|
||||
|
||||
@Operation(summary = "测试添加消息")
|
||||
@GetMapping("/test")
|
||||
public CommonResult<Boolean> test(MessageSaveReqVO message, Long templateId, String context ) {
|
||||
Map<String, Object> map = Maps.newLinkedHashMap();
|
||||
map.put("test", context);
|
||||
return CommonResult.success(messageService.send(templateId, message, map));
|
||||
}
|
||||
}
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system.message;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.qiantong.qmodel.common.annotation.Log;
|
||||
import tech.qiantong.qmodel.common.core.controller.BaseController;
|
||||
import tech.qiantong.qmodel.common.core.domain.CommonResult;
|
||||
import tech.qiantong.qmodel.common.core.page.PageResult;
|
||||
import tech.qiantong.qmodel.common.enums.BusinessType;
|
||||
import tech.qiantong.qmodel.common.utils.object.BeanUtils;
|
||||
import tech.qiantong.qmodel.common.utils.poi.ExcelUtil;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageTemplatePageReqVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageTemplateRespVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageTemplateSaveReqVO;
|
||||
import tech.qiantong.qmodel.module.system.convert.message.MessageTemplateConvert;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageTemplateDO;
|
||||
import tech.qiantong.qmodel.module.system.service.message.IMessageTemplateService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息模板Controller
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Tag(name = "消息模板")
|
||||
@RestController
|
||||
@RequestMapping("/system/messageTemplate")
|
||||
@Validated
|
||||
public class MessageTemplateController extends BaseController {
|
||||
@Resource
|
||||
private IMessageTemplateService messageTemplateService;
|
||||
|
||||
@Operation(summary = "查询消息模板列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:messageTemplate:list')")
|
||||
@GetMapping("/list")
|
||||
public CommonResult<PageResult<MessageTemplateRespVO>> list(MessageTemplatePageReqVO messageTemplate) {
|
||||
startPage();
|
||||
PageResult<MessageTemplateDO> page = messageTemplateService.getMessageTemplatePage(messageTemplate);
|
||||
return CommonResult.success(BeanUtils.toBean(page, MessageTemplateRespVO.class));
|
||||
}
|
||||
|
||||
@Operation(summary = "导出消息模板列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:messageTemplate:export')")
|
||||
@Log(title = "消息模板", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MessageTemplatePageReqVO messageTemplate) {
|
||||
List<MessageTemplateDO> list = (List<MessageTemplateDO>) messageTemplateService.getMessageTemplatePage(messageTemplate).getRows();
|
||||
ExcelUtil<MessageTemplateRespVO> util = new ExcelUtil<>(MessageTemplateRespVO.class);
|
||||
util.exportExcel(response, MessageTemplateConvert.INSTANCE.convertToRespVOList(list), "应用管理数据");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取消息模板详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:messageTemplate:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public CommonResult<MessageTemplateRespVO> getInfo(@PathVariable("id") Long id) {
|
||||
MessageTemplateDO messageTemplateDO = messageTemplateService.getById(id);
|
||||
return CommonResult.success(BeanUtils.toBean(messageTemplateDO, MessageTemplateRespVO.class));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增消息模板")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:messageTemplate:add')")
|
||||
@Log(title = "消息模板", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public CommonResult<Boolean> add(@Valid @RequestBody MessageTemplateSaveReqVO messageTemplate) {
|
||||
MessageTemplateDO messageTemplateDO = BeanUtils.toBean(messageTemplate, MessageTemplateDO.class);
|
||||
messageTemplateDO.setCreatorId(getUserId());
|
||||
messageTemplateDO.setCreateBy(getNickName());
|
||||
return CommonResult.toAjax(messageTemplateService.save(messageTemplateDO));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改消息模板")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:messageTemplate:edit')")
|
||||
@Log(title = "消息模板", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public CommonResult<Boolean> edit(@Valid @RequestBody MessageTemplateSaveReqVO messageTemplate) {
|
||||
MessageTemplateDO messageTemplateDO = BeanUtils.toBean(messageTemplate, MessageTemplateDO.class);
|
||||
messageTemplateDO.setUpdatorId(getUserId());
|
||||
messageTemplateDO.setUpdateBy(getNickName());
|
||||
messageTemplateDO.setUpdateTime(new Date());
|
||||
return CommonResult.toAjax(messageTemplateService.updateById(messageTemplateDO));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除消息模板")
|
||||
@PreAuthorize("@ss.hasPermi('system:message:messageTemplate:remove')")
|
||||
@Log(title = "消息模板", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public CommonResult<Boolean> remove(@PathVariable Long[] ids) {
|
||||
return CommonResult.toAjax(messageTemplateService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system.message.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import tech.qiantong.qmodel.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 消息 Request VO 对象 message
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Schema(description = "消息 Request VO")
|
||||
@Data
|
||||
public class MessagePageReqVO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "发送人", example = "")
|
||||
private Long senderId;
|
||||
|
||||
@Schema(description = "接收人", example = "")
|
||||
private Long receiverId;
|
||||
|
||||
@Schema(description = "消息标题", example = "")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "消息模板内容", example = "")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "消息类别", example = "")
|
||||
private Integer category;
|
||||
|
||||
@Schema(description = "消息等级", example = "")
|
||||
private Integer msgLevel;
|
||||
|
||||
@Schema(description = "消息模块", example = "")
|
||||
private Integer module;
|
||||
|
||||
@Schema(description = "实体类型", example = "")
|
||||
private Integer entityType;
|
||||
|
||||
@Schema(description = "实体id", example = "")
|
||||
private Long entityId;
|
||||
|
||||
@Schema(description = "消息链接", example = "")
|
||||
private String entityUrl;
|
||||
|
||||
@Schema(description = "是否已读", example = "")
|
||||
private Integer hasRead;
|
||||
|
||||
@Schema(description = "是否撤回", example = "")
|
||||
private Integer hasRetraction;
|
||||
|
||||
@Schema(description = "是否有效", example = "")
|
||||
private Boolean validFlag;
|
||||
|
||||
@Schema(description = "删除标识")
|
||||
private Integer delFlag;
|
||||
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system.message.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import tech.qiantong.qmodel.common.annotation.Excel;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 消息 Response VO 对象 message
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Schema(description = "消息 Response VO")
|
||||
@Data
|
||||
public class MessageRespVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "发送人")
|
||||
@Schema(description = "发送人", example = "")
|
||||
private Long senderId;
|
||||
|
||||
@Excel(name = "接收人")
|
||||
@Schema(description = "接收人", example = "")
|
||||
private Long receiverId;
|
||||
|
||||
@Excel(name = "消息标题")
|
||||
@Schema(description = "消息标题", example = "")
|
||||
private String title;
|
||||
|
||||
@Excel(name = "消息模板内容")
|
||||
@Schema(description = "消息模板内容", example = "")
|
||||
private String content;
|
||||
|
||||
@Excel(name = "消息类别")
|
||||
@Schema(description = "消息类别", example = "")
|
||||
private Integer category;
|
||||
|
||||
@Excel(name = "消息等级")
|
||||
@Schema(description = "消息等级", example = "")
|
||||
private Integer msgLevel;
|
||||
|
||||
@Excel(name = "消息模块")
|
||||
@Schema(description = "消息模块", example = "")
|
||||
private Integer module;
|
||||
|
||||
@Excel(name = "实体类型")
|
||||
@Schema(description = "实体类型", example = "")
|
||||
private Integer entityType;
|
||||
|
||||
@Excel(name = "实体id")
|
||||
@Schema(description = "实体id", example = "")
|
||||
private Long entityId;
|
||||
|
||||
@Excel(name = "消息链接")
|
||||
@Schema(description = "消息链接", example = "")
|
||||
private String entityUrl;
|
||||
|
||||
@Excel(name = "是否已读")
|
||||
@Schema(description = "是否已读", example = "")
|
||||
private Integer hasRead;
|
||||
|
||||
@Excel(name = "是否撤回")
|
||||
@Schema(description = "是否撤回", example = "")
|
||||
private Integer hasRetraction;
|
||||
|
||||
@Excel(name = "是否有效")
|
||||
@Schema(description = "是否有效", example = "")
|
||||
private Boolean validFlag;
|
||||
|
||||
@Schema(description = "删除标识")
|
||||
private Integer delFlag;
|
||||
|
||||
@Excel(name = "创建人")
|
||||
@Schema(description = "创建人", example = "")
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建人id")
|
||||
@Schema(description = "创建人id", example = "")
|
||||
private Long creatorId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@Schema(description = "创建时间", example = "")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "更新人")
|
||||
@Schema(description = "更新人", example = "")
|
||||
private String updateBy;
|
||||
|
||||
@Excel(name = "更新人id")
|
||||
@Schema(description = "更新人id", example = "")
|
||||
private Long updatorId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@Schema(description = "更新时间", example = "")
|
||||
private Date updateTime;
|
||||
|
||||
@Excel(name = "备注")
|
||||
@Schema(description = "备注", example = "")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system.message.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 消息 创建/修改 Request VO message
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Schema(description = "消息 Response VO")
|
||||
@Data
|
||||
public class MessageSaveReqVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "发送人", example = "")
|
||||
private Long senderId;
|
||||
|
||||
|
||||
@Schema(description = "接收人", example = "")
|
||||
private Long receiverId;
|
||||
|
||||
@Schema(description = "消息模块", example = "")
|
||||
@NotNull(message = "消息模块不能为空")
|
||||
private Integer module;
|
||||
|
||||
|
||||
@Schema(description = "实体类型", example = "")
|
||||
private Integer entityType;
|
||||
|
||||
|
||||
@Schema(description = "实体id", example = "")
|
||||
private Long entityId;
|
||||
|
||||
@Schema(description = "消息链接", example = "")
|
||||
@NotBlank(message = "消息链接不能为空")
|
||||
@Size(max = 256, message = "消息链接长度不能超过256个字符")
|
||||
private String entityUrl;
|
||||
|
||||
private Integer delFlag;
|
||||
private String id;
|
||||
private Integer hasRead;
|
||||
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system.message.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import tech.qiantong.qmodel.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 消息模板 Request VO 对象 message_template
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Schema(description = "消息模板 Request VO")
|
||||
@Data
|
||||
public class MessageTemplatePageReqVO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "消息标题", example = "")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "消息模板内容", example = "")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "消息类别", example = "")
|
||||
private Integer category;
|
||||
|
||||
@Schema(description = "消息等级", example = "")
|
||||
private Integer msgLevel;
|
||||
|
||||
@Schema(description = "是否有效", example = "")
|
||||
private Boolean validFlag;
|
||||
|
||||
@Schema(description = "删除标识")
|
||||
private Boolean delFlag;
|
||||
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system.message.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import tech.qiantong.qmodel.common.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 消息模板 Response VO 对象 message_template
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Schema(description = "消息模板 Response VO")
|
||||
@Data
|
||||
public class MessageTemplateRespVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "消息标题")
|
||||
@Schema(description = "消息标题", example = "")
|
||||
private String title;
|
||||
|
||||
@Excel(name = "消息模板内容")
|
||||
@Schema(description = "消息模板内容", example = "")
|
||||
private String content;
|
||||
|
||||
@Excel(name = "消息类别")
|
||||
@Schema(description = "消息类别", example = "")
|
||||
private Integer category;
|
||||
|
||||
@Excel(name = "消息等级")
|
||||
@Schema(description = "消息等级", example = "")
|
||||
private Integer msgLevel;
|
||||
|
||||
@Excel(name = "是否有效")
|
||||
@Schema(description = "是否有效", example = "")
|
||||
private Boolean validFlag;
|
||||
|
||||
@Schema(description = "删除标识")
|
||||
private Boolean delFlag;
|
||||
|
||||
@Excel(name = "创建人")
|
||||
@Schema(description = "创建人", example = "")
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建人id")
|
||||
@Schema(description = "创建人id", example = "")
|
||||
private Long creatorId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@Schema(description = "创建时间", example = "")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "更新人")
|
||||
@Schema(description = "更新人", example = "")
|
||||
private String updateBy;
|
||||
|
||||
@Excel(name = "更新人id")
|
||||
@Schema(description = "更新人id", example = "")
|
||||
private Long updatorId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@Schema(description = "更新时间", example = "")
|
||||
private Date updateTime;
|
||||
|
||||
@Excel(name = "备注")
|
||||
@Schema(description = "备注", example = "")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system.message.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 消息模板 创建/修改 Request VO message_template
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Schema(description = "消息模板 Response VO")
|
||||
@Data
|
||||
public class MessageTemplateSaveReqVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "消息标题", example = "")
|
||||
@NotBlank(message = "消息标题不能为空")
|
||||
@Size(max = 256, message = "消息标题长度不能超过256个字符")
|
||||
private String title;
|
||||
|
||||
|
||||
@Schema(description = "消息模板内容", example = "")
|
||||
@NotBlank(message = "消息模板内容不能为空")
|
||||
@Size(max = 256, message = "消息模板内容长度不能超过256个字符")
|
||||
private String content;
|
||||
|
||||
|
||||
@Schema(description = "消息类别", example = "")
|
||||
@NotNull(message = "消息类别不能为空")
|
||||
private Integer category;
|
||||
|
||||
|
||||
@Schema(description = "消息等级", example = "")
|
||||
@NotNull(message = "消息等级不能为空")
|
||||
private Integer msgLevel;
|
||||
|
||||
}
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.controller.admin.system.message.websocket;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessagePageReqVO;
|
||||
import tech.qiantong.qmodel.websocket.WebSocketMessage;
|
||||
|
||||
import javax.websocket.OnClose;
|
||||
import javax.websocket.OnError;
|
||||
import javax.websocket.OnOpen;
|
||||
import javax.websocket.Session;
|
||||
import javax.websocket.server.PathParam;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* websocket 消息处理
|
||||
*
|
||||
* @author anivia
|
||||
*/
|
||||
@Component
|
||||
@ServerEndpoint("/websocket/message/{userId}")
|
||||
public class WebSocketMessageServer {
|
||||
// 日志记录
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketMessageServer.class);
|
||||
|
||||
/**
|
||||
* 连接建立成功时触发的方法
|
||||
*/
|
||||
@OnOpen
|
||||
public void onOpen(Session session, @PathParam("userId") String userId) throws Exception {
|
||||
String key = userId + '_' + session.getId();
|
||||
LOGGER.info("连接成功 - 用户ID: {}", key);
|
||||
// 保存连接的 session 对象
|
||||
// 一个客户可能会开启多个窗口,不同窗口session不一样, 存储key格式: userId_sessionId
|
||||
WebSocketMessage.put(key, session);
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接关闭时触发的方法
|
||||
*/
|
||||
@OnClose
|
||||
public void onClose(Session session, @PathParam("userId") String userId) {
|
||||
String key = userId + '_' + session.getId();
|
||||
LOGGER.info("连接关闭 - 用户ID: {}", key);
|
||||
// 移除用户连接
|
||||
//一个客户可能会开启多个窗口,不同窗口session不一样, 存储key格式: userId_sessionId
|
||||
WebSocketMessage.remove(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常时触发的方法
|
||||
*/
|
||||
@OnError
|
||||
public void onError(Session session, Throwable exception, @PathParam("userId") String userId) throws Exception {
|
||||
if (session.isOpen()) {
|
||||
session.close();
|
||||
}
|
||||
LOGGER.error("连接异常 - 用户ID: {} - 异常信息: {}", userId, exception.getMessage());
|
||||
// 移除用户连接
|
||||
WebSocketMessage.remove(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 向客户端发送消息
|
||||
* 一个客户可能会开启多个窗口,不同窗口session不一样, 存储key格式: userId_sessionId
|
||||
* @param userId
|
||||
* @param message
|
||||
*/
|
||||
public static void sendMessageToUser(String userId, String message) {
|
||||
// 获取用户的 session
|
||||
List<Session> sessionList = WebSocketMessage.getUserSessionList(userId);
|
||||
if (sessionList.size() > 0) {
|
||||
for (Session session : sessionList) {
|
||||
// 通过 WebSocketMessage 发送消息
|
||||
WebSocketMessage.sendMessageToUserByText(session, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向客户端发送消息
|
||||
* @param userId 用户ID
|
||||
* @param message 消息内容
|
||||
*/
|
||||
public static void sendMessage(String userId, String message) {
|
||||
// 获取用户的 session
|
||||
Session session = WebSocketMessage.get(userId);
|
||||
if (session != null) {
|
||||
// 通过 WebSocketMessage 发送消息
|
||||
WebSocketMessage.sendMessageToUserByText(session, message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向所有连接的客户端广播消息
|
||||
* @param message 消息内容
|
||||
*/
|
||||
public static void broadcastMessage(MessagePageReqVO message) {
|
||||
String string = JSONObject.toJSONString(message);
|
||||
WebSocketMessage.broadcast(string);
|
||||
}
|
||||
|
||||
}
|
||||
+215
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
//package tech.qiantong.module.system.controller.admin.tool;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.LinkedHashMap;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
//import org.springframework.web.bind.annotation.GetMapping;
|
||||
//import org.springframework.web.bind.annotation.PathVariable;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.PutMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestBody;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//import tech.qiantong.qmodel.controller.core.common.BaseController;
|
||||
//import tech.qiantong.qmodel.domain.core.common.R;
|
||||
//import tech.qiantong.qmodel.utils.common.StringUtils;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiImplicitParam;
|
||||
//import io.swagger.annotations.ApiImplicitParams;
|
||||
//import io.swagger.annotations.ApiModel;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//
|
||||
///**
|
||||
// * swagger 用户测试方法
|
||||
// *
|
||||
// * @author anivia
|
||||
// */
|
||||
//@Api("用户信息管理")
|
||||
//@RestController
|
||||
//@RequestMapping("/test/user")
|
||||
//public class TestController extends BaseController
|
||||
//{
|
||||
// private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
|
||||
// {
|
||||
// users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
|
||||
// users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("获取用户列表")
|
||||
// @GetMapping("/list")
|
||||
// public R<List<UserEntity>> userList()
|
||||
// {
|
||||
// List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
||||
// return R.ok(userList);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("获取用户详细")
|
||||
// @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||
// @GetMapping("/{userId}")
|
||||
// public R<UserEntity> getUser(@PathVariable Integer userId)
|
||||
// {
|
||||
// if (!users.isEmpty() && users.containsKey(userId))
|
||||
// {
|
||||
// return R.ok(users.get(userId));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return R.fail("用户不存在");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("新增用户")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
|
||||
// @ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
|
||||
// @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
|
||||
// @ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
|
||||
// })
|
||||
// @PostMapping("/save")
|
||||
// public R<String> save(UserEntity user)
|
||||
// {
|
||||
// if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||
// {
|
||||
// return R.fail("用户ID不能为空");
|
||||
// }
|
||||
// users.put(user.getUserId(), user);
|
||||
// return R.ok();
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("更新用户")
|
||||
// @PutMapping("/update")
|
||||
// public R<String> update(@RequestBody UserEntity user)
|
||||
// {
|
||||
// if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||
// {
|
||||
// return R.fail("用户ID不能为空");
|
||||
// }
|
||||
// if (users.isEmpty() || !users.containsKey(user.getUserId()))
|
||||
// {
|
||||
// return R.fail("用户不存在");
|
||||
// }
|
||||
// users.remove(user.getUserId());
|
||||
// users.put(user.getUserId(), user);
|
||||
// return R.ok();
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("删除用户信息")
|
||||
// @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||
// @DeleteMapping("/{userId}")
|
||||
// public R<String> delete(@PathVariable Integer userId)
|
||||
// {
|
||||
// if (!users.isEmpty() && users.containsKey(userId))
|
||||
// {
|
||||
// users.remove(userId);
|
||||
// return R.ok();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return R.fail("用户不存在");
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//@ApiModel(value = "UserEntity", description = "用户实体")
|
||||
//class UserEntity
|
||||
//{
|
||||
// @ApiModelProperty("用户ID")
|
||||
// private Integer userId;
|
||||
//
|
||||
// @ApiModelProperty("用户名称")
|
||||
// private String username;
|
||||
//
|
||||
// @ApiModelProperty("用户密码")
|
||||
// private String password;
|
||||
//
|
||||
// @ApiModelProperty("用户手机")
|
||||
// private String mobile;
|
||||
//
|
||||
// public UserEntity()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public UserEntity(Integer userId, String username, String password, String mobile)
|
||||
// {
|
||||
// this.userId = userId;
|
||||
// this.username = username;
|
||||
// this.password = password;
|
||||
// this.mobile = mobile;
|
||||
// }
|
||||
//
|
||||
// public Integer getUserId()
|
||||
// {
|
||||
// return userId;
|
||||
// }
|
||||
//
|
||||
// public void setUserId(Integer userId)
|
||||
// {
|
||||
// this.userId = userId;
|
||||
// }
|
||||
//
|
||||
// public String getNickName()
|
||||
// {
|
||||
// return username;
|
||||
// }
|
||||
//
|
||||
// public void setUsername(String username)
|
||||
// {
|
||||
// this.username = username;
|
||||
// }
|
||||
//
|
||||
// public String getPassword()
|
||||
// {
|
||||
// return password;
|
||||
// }
|
||||
//
|
||||
// public void setPassword(String password)
|
||||
// {
|
||||
// this.password = password;
|
||||
// }
|
||||
//
|
||||
// public String getMobile()
|
||||
// {
|
||||
// return mobile;
|
||||
// }
|
||||
//
|
||||
// public void setMobile(String mobile)
|
||||
// {
|
||||
// this.mobile = mobile;
|
||||
// }
|
||||
//}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.convert.message;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessagePageReqVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageRespVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageSaveReqVO;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息 Convert
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Mapper
|
||||
public interface MessageConvert {
|
||||
MessageConvert INSTANCE = Mappers.getMapper(MessageConvert.class);
|
||||
|
||||
/**
|
||||
* PageReqVO 转换为 DO
|
||||
* @param messagePageReqVO 请求参数
|
||||
* @return MessageDO
|
||||
*/
|
||||
MessageDO convertToDO(MessagePageReqVO messagePageReqVO);
|
||||
|
||||
/**
|
||||
* SaveReqVO 转换为 DO
|
||||
* @param messageSaveReqVO 保存请求参数
|
||||
* @return MessageDO
|
||||
*/
|
||||
MessageDO convertToDO(MessageSaveReqVO messageSaveReqVO);
|
||||
|
||||
/**
|
||||
* DO 转换为 RespVO
|
||||
* @param messageDO 实体对象
|
||||
* @return MessageRespVO
|
||||
*/
|
||||
MessageRespVO convertToRespVO(MessageDO messageDO);
|
||||
|
||||
/**
|
||||
* DOList 转换为 RespVOList
|
||||
* @param messageDOList 实体对象列表
|
||||
* @return List<MessageRespVO>
|
||||
*/
|
||||
List<MessageRespVO> convertToRespVOList(List<MessageDO> messageDOList);
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.convert.message;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageTemplatePageReqVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageTemplateRespVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageTemplateSaveReqVO;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageTemplateDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息模板 Convert
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Mapper
|
||||
public interface MessageTemplateConvert {
|
||||
MessageTemplateConvert INSTANCE = Mappers.getMapper(MessageTemplateConvert.class);
|
||||
|
||||
/**
|
||||
* PageReqVO 转换为 DO
|
||||
* @param messageTemplatePageReqVO 请求参数
|
||||
* @return MessageTemplateDO
|
||||
*/
|
||||
MessageTemplateDO convertToDO(MessageTemplatePageReqVO messageTemplatePageReqVO);
|
||||
|
||||
/**
|
||||
* SaveReqVO 转换为 DO
|
||||
* @param messageTemplateSaveReqVO 保存请求参数
|
||||
* @return MessageTemplateDO
|
||||
*/
|
||||
MessageTemplateDO convertToDO(MessageTemplateSaveReqVO messageTemplateSaveReqVO);
|
||||
|
||||
/**
|
||||
* DO 转换为 RespVO
|
||||
* @param messageTemplateDO 实体对象
|
||||
* @return MessageTemplateRespVO
|
||||
*/
|
||||
MessageTemplateRespVO convertToRespVO(MessageTemplateDO messageTemplateDO);
|
||||
|
||||
/**
|
||||
* DOList 转换为 RespVOList
|
||||
* @param messageTemplateDOList 实体对象列表
|
||||
* @return List<MessageTemplateRespVO>
|
||||
*/
|
||||
List<MessageTemplateRespVO> convertToRespVOList(List<MessageTemplateDO> messageTemplateDOList);
|
||||
}
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
//package tech.qiantong.module.system.core.config;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//import javax.annotation.Resource;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import tech.qiantong.qmodel.config.common.AniviaConfig;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import io.swagger.models.auth.In;
|
||||
//import springfox.documentation.builders.ApiInfoBuilder;
|
||||
//import springfox.documentation.builders.PathSelectors;
|
||||
//import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
//import springfox.documentation.service.ApiInfo;
|
||||
//import springfox.documentation.service.ApiKey;
|
||||
//import springfox.documentation.service.AuthorizationScope;
|
||||
//import springfox.documentation.service.Contact;
|
||||
//import springfox.documentation.service.SecurityReference;
|
||||
//import springfox.documentation.service.SecurityScheme;
|
||||
//import springfox.documentation.spi.DocumentationType;
|
||||
//import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||
//import springfox.documentation.spring.web.plugins.Docket;
|
||||
//
|
||||
///**
|
||||
// * Swagger2的接口配置
|
||||
// *
|
||||
// * @author anivia
|
||||
// */
|
||||
//@Configuration
|
||||
//public class SwaggerConfig
|
||||
//{
|
||||
// /** 系统基础配置 */
|
||||
// @Resource
|
||||
// private AniviaConfig aniviaConfig;
|
||||
//
|
||||
// /** 是否开启swagger */
|
||||
// @Value("${swagger.enabled}")
|
||||
// private boolean enabled;
|
||||
//
|
||||
// /** 设置请求的统一前缀 */
|
||||
// @Value("${swagger.pathMapping}")
|
||||
// private String pathMapping;
|
||||
//
|
||||
// /**
|
||||
// * 创建API
|
||||
// */
|
||||
// @Bean
|
||||
// public Docket createRestApi()
|
||||
// {
|
||||
// return new Docket(DocumentationType.OAS_30)
|
||||
// // 是否启用Swagger
|
||||
// .enable(enabled)
|
||||
// // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||
// .apiInfo(apiInfo())
|
||||
// // 设置哪些接口暴露给Swagger展示
|
||||
// .select()
|
||||
// // 扫描所有有注解的api,用这种方式更灵活
|
||||
// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
// // 扫描指定包中的swagger注解
|
||||
// // .apis(RequestHandlerSelectors.basePackage("tech.qiantong.project.tool.swagger"))
|
||||
// // 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||
// .paths(PathSelectors.any())
|
||||
// .build()
|
||||
// /* 设置安全模式,swagger可以设置访问token */
|
||||
// .securitySchemes(securitySchemes())
|
||||
// .securityContexts(securityContexts())
|
||||
// .pathMapping(pathMapping);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 安全模式,这里指定token通过Authorization头请求头传递
|
||||
// */
|
||||
// private List<SecurityScheme> securitySchemes()
|
||||
// {
|
||||
// List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
|
||||
// apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
|
||||
// return apiKeyList;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 安全上下文
|
||||
// */
|
||||
// private List<SecurityContext> securityContexts()
|
||||
// {
|
||||
// List<SecurityContext> securityContexts = new ArrayList<>();
|
||||
// securityContexts.add(
|
||||
// SecurityContext.builder()
|
||||
// .securityReferences(defaultAuth())
|
||||
// .operationSelector(o -> o.requestMappingPattern().matches("/.*"))
|
||||
// .build());
|
||||
// return securityContexts;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 默认的安全上引用
|
||||
// */
|
||||
// private List<SecurityReference> defaultAuth()
|
||||
// {
|
||||
// AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
||||
// AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
||||
// authorizationScopes[0] = authorizationScope;
|
||||
// List<SecurityReference> securityReferences = new ArrayList<>();
|
||||
// securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
|
||||
// return securityReferences;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 添加摘要信息
|
||||
// */
|
||||
// private ApiInfo apiInfo()
|
||||
// {
|
||||
// // 用ApiInfoBuilder进行定制
|
||||
// return new ApiInfoBuilder()
|
||||
// // 设置标题
|
||||
// .title("标题:qModel模型平台_接口文档")
|
||||
// // 描述
|
||||
// .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||
// // 作者信息
|
||||
// .contact(new Contact(aniviaConfig.getName(), null, null))
|
||||
// // 版本
|
||||
// .version("版本号:" + aniviaConfig.getVersion())
|
||||
// .build();
|
||||
// }
|
||||
//}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.dal.dataobject.auth;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
|
||||
/**
|
||||
* 用户与认证中心关系 DO 对象 rel_user_auth_product
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "rel_user_auth_product")
|
||||
// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
// @KeySequence("rel_user_auth_product_seq")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RelUserAuthProductDO {
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户ID */
|
||||
private Long userId;
|
||||
|
||||
/** 统一身份认证id */
|
||||
private String authId;
|
||||
|
||||
/** 认证平台类型 */
|
||||
private Integer authProductType;
|
||||
|
||||
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.dal.dataobject.message;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
import tech.qiantong.qmodel.common.core.domain.BaseEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 消息 DO 对象 message
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "message")
|
||||
// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
// @KeySequence("message_seq")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MessageDO extends BaseEntity {
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 发送人
|
||||
*/
|
||||
private Long senderId;
|
||||
|
||||
/**
|
||||
* 接收人
|
||||
*/
|
||||
private Long receiverId;
|
||||
|
||||
/**
|
||||
* 消息标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 消息模板内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 消息类别
|
||||
*/
|
||||
private Integer category;
|
||||
|
||||
/**
|
||||
* 消息等级
|
||||
*/
|
||||
private Integer msgLevel;
|
||||
|
||||
/**
|
||||
* 消息模块
|
||||
*/
|
||||
private Integer module;
|
||||
|
||||
/**
|
||||
* 实体类型
|
||||
*/
|
||||
private Integer entityType;
|
||||
|
||||
/**
|
||||
* 实体id
|
||||
*/
|
||||
private Long entityId;
|
||||
|
||||
/**
|
||||
* 消息链接
|
||||
*/
|
||||
private String entityUrl;
|
||||
|
||||
/**
|
||||
* 是否已读
|
||||
*/
|
||||
private Integer hasRead;
|
||||
|
||||
/**
|
||||
* 是否撤回
|
||||
*/
|
||||
private Integer hasRetraction;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean validFlag;
|
||||
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.dal.dataobject.message;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
import tech.qiantong.qmodel.common.core.domain.BaseEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 消息模板 DO 对象 message_template
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "message_template")
|
||||
// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
// @KeySequence("message_template_seq")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MessageTemplateDO extends BaseEntity {
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 消息标题 */
|
||||
private String title;
|
||||
|
||||
/** 消息模板内容 */
|
||||
private String content;
|
||||
|
||||
/** 消息类别 */
|
||||
private Integer category;
|
||||
|
||||
/** 消息等级 */
|
||||
private Integer msgLevel;
|
||||
|
||||
/** 是否有效 */
|
||||
private Boolean validFlag;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private Boolean delFlag;
|
||||
|
||||
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.dal.dataobject.message.enums;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public enum MessageHasReadEnums {
|
||||
WD(0, "未读"),
|
||||
YD(1, "已读");
|
||||
public final Integer code;
|
||||
public final String info;
|
||||
|
||||
MessageHasReadEnums(Integer code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public static MessageHasReadEnums get(Integer code) {
|
||||
for (MessageHasReadEnums v : values()) {
|
||||
if (v.eq(code)) {
|
||||
return v;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 根据code返回县市名称
|
||||
public static MessageHasReadEnums getName(String info) {
|
||||
for (MessageHasReadEnums v : values()) {
|
||||
if (v.like(info)) {
|
||||
return v;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean eq(Integer code) {
|
||||
return this.code.equals(code);
|
||||
}
|
||||
|
||||
public boolean like(String info) {
|
||||
return this.info.equals(info);
|
||||
}
|
||||
|
||||
public static String getInfo(Integer code) {
|
||||
return Objects.requireNonNull(MessageHasReadEnums.get(code)).getInfo();
|
||||
}
|
||||
|
||||
public static Integer getCode(String info) {
|
||||
return Objects.requireNonNull(MessageHasReadEnums.getName(info)).getCode();
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.dal.mapper.auth;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.auth.RelUserAuthProductDO;
|
||||
|
||||
/**
|
||||
* 用户与认证中心关系Mapper接口
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
public interface RelUserAuthProductMapper extends MPJBaseMapper<RelUserAuthProductDO> {
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.dal.mapper.message;
|
||||
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageDO;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
|
||||
/**
|
||||
* 消息Mapper接口
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
public interface MessageMapper extends MPJBaseMapper<MessageDO> {
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.dal.mapper.message;
|
||||
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageTemplateDO;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
|
||||
/**
|
||||
* 消息模板Mapper接口
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
public interface MessageTemplateMapper extends MPJBaseMapper<MessageTemplateDO> {
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.service.auth;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.auth.RelUserAuthProductDO;
|
||||
|
||||
/**
|
||||
* 用户与认证中心关系Service接口
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
public interface IRelUserAuthProductService extends IService<RelUserAuthProductDO> {
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.service.auth;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
|
||||
/**
|
||||
* 接收认证平台推送的数据
|
||||
*/
|
||||
public interface SysSyncDataService {
|
||||
public AjaxResult syncData(JSONObject jsonObject);
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.service.auth.impl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.auth.RelUserAuthProductDO;
|
||||
import tech.qiantong.qmodel.module.system.dal.mapper.auth.RelUserAuthProductMapper;
|
||||
import tech.qiantong.qmodel.module.system.service.auth.IRelUserAuthProductService;
|
||||
|
||||
/**
|
||||
* 用户与认证中心关系Service业务层处理
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class RelUserAuthProductServiceImpl extends ServiceImpl<RelUserAuthProductMapper, RelUserAuthProductDO> implements IRelUserAuthProductService {
|
||||
@Resource
|
||||
private RelUserAuthProductMapper relUserAuthProductMapper;
|
||||
|
||||
}
|
||||
+237
@@ -0,0 +1,237 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.service.auth.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.qiantong.qmodel.common.core.domain.AjaxResult;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysDept;
|
||||
import tech.qiantong.qmodel.common.core.domain.entity.SysUser;
|
||||
import tech.qiantong.qmodel.common.utils.SecurityUtils;
|
||||
import tech.qiantong.qmodel.common.utils.StringUtils;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.auth.RelUserAuthProductDO;
|
||||
import tech.qiantong.qmodel.module.system.dal.mapper.auth.RelUserAuthProductMapper;
|
||||
import tech.qiantong.qmodel.module.system.domain.SysUserRole;
|
||||
import tech.qiantong.qmodel.module.system.enums.auth.AuthProductEnums;
|
||||
import tech.qiantong.qmodel.module.system.mapper.SysDeptMapper;
|
||||
import tech.qiantong.qmodel.module.system.mapper.SysUserMapper;
|
||||
import tech.qiantong.qmodel.module.system.mapper.SysUserRoleMapper;
|
||||
import tech.qiantong.qmodel.module.system.rsa.RSAUtil;
|
||||
import tech.qiantong.qmodel.module.system.service.auth.SysSyncDataService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 处理认证平台推送的数据
|
||||
*/
|
||||
@Service
|
||||
public class SysSyncDataServiceImpl implements SysSyncDataService {
|
||||
private static final Logger log = LoggerFactory.getLogger(SysSyncDataService.class);
|
||||
@Resource
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
@Resource
|
||||
private SysUserMapper sysUserMapper;
|
||||
@Resource
|
||||
private RelUserAuthProductMapper relUserAuthProductMapper;
|
||||
@Resource
|
||||
private SysUserRoleMapper sysUserRoleMapper;
|
||||
|
||||
/**
|
||||
* 处理认证平台推送的数据
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult syncData(JSONObject jsonObject) {
|
||||
try {
|
||||
String mdType = jsonObject.getString("mdType");
|
||||
JSONArray masterData = jsonObject.getJSONArray("masterData");
|
||||
//部门数据
|
||||
if ("deptdocs".equals(mdType)) {
|
||||
deptData(masterData);
|
||||
}
|
||||
//人员数据
|
||||
else if ("psndocs".equals(mdType)) {
|
||||
userData(masterData);
|
||||
}
|
||||
log.info("=================同步成功=================");
|
||||
AjaxResult ajaxResult = new AjaxResult();
|
||||
ajaxResult.put("success", true);
|
||||
return ajaxResult;
|
||||
} catch (Exception e) {
|
||||
log.info("接收认证平台推送的数据处理异常:{}", e);
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理认证平台推送的用户数据
|
||||
*
|
||||
* @param masterData
|
||||
*/
|
||||
private void userData(JSONArray masterData) {
|
||||
ArrayList<SysUser> sysUsers = new ArrayList<>();
|
||||
|
||||
//查询获取认证平台id不为空的数据
|
||||
SysUser user = new SysUser();
|
||||
List<SysUser> sysUserList = sysUserMapper.selectUserAllList(user);
|
||||
sysUserList = sysUserList.stream().filter(item -> StringUtils.isNotBlank(item.getAuthId())).collect(Collectors.toList());
|
||||
|
||||
Map<String, SysUser> userMap = new HashMap<>();
|
||||
for (SysUser sysUser : sysUserList) {
|
||||
userMap.put(sysUser.getAuthId(), sysUser);
|
||||
}
|
||||
|
||||
for (int i = 0; i < masterData.size(); i++) {
|
||||
JSONObject dataJSONObject = masterData.getJSONObject(i);
|
||||
SysUser sysUser = new SysUser();
|
||||
String idHubId = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("idHubId"));
|
||||
String userName = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("userName"));
|
||||
//如果是admin 忽略
|
||||
if ("admin".equals(userName)) continue;
|
||||
String nickName = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("nickName"));
|
||||
String deptId = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("deptId"));
|
||||
String sex = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("sex"));
|
||||
String phone = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("phone"));
|
||||
String orderNum = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("orderNum"));
|
||||
String status = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("status"));
|
||||
String delFlag = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("delFlag"));
|
||||
String postId = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("postId"));
|
||||
String authPostId = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("authPostId"));
|
||||
String authPostName = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("authPostName"));
|
||||
|
||||
sysUser.setUserName(userName);
|
||||
sysUser.setNickName(nickName);
|
||||
try {
|
||||
//TODO 多个部门的数据导入不进去 冰凤框架deptId设置的为Long
|
||||
sysUser.setDeptId(StringUtils.isBlank(deptId) ? null : Long.valueOf(deptId));
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
sysUser.setSex(sex);
|
||||
sysUser.setPhonenumber(phone);
|
||||
sysUser.setStatus(status);
|
||||
sysUser.setDelFlag(delFlag);
|
||||
// sysUser.setPassword("anivia@123");
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword("anivia@123"));
|
||||
sysUser.setRoleId(Long.valueOf(3));
|
||||
sysUser.setAuthId(idHubId);
|
||||
if (userMap.containsKey(sysUser.getAuthId())) {
|
||||
SysUser user1 = userMap.get(sysUser.getAuthId());
|
||||
sysUser.setUserId(user1.getUserId());
|
||||
sysUserMapper.updateUser(sysUser);
|
||||
} else {
|
||||
sysUserMapper.insertUser(sysUser);
|
||||
}
|
||||
sysUsers.add(sysUser);
|
||||
}
|
||||
|
||||
//重新查询获取全部用户数据
|
||||
sysUserList = sysUserMapper.selectUserAllList(user);
|
||||
|
||||
ArrayList<SysUserRole> userRoles = new ArrayList<>();
|
||||
//因为userId为自增 存储的时候获取不到userId, 所以再循环一遍存储关联关系
|
||||
for (SysUser sysUser : sysUserList) {
|
||||
if (StringUtils.isNotBlank(sysUser.getAuthId()) && !userMap.containsKey(sysUser.getAuthId())) {
|
||||
RelUserAuthProductDO productDO = new RelUserAuthProductDO();
|
||||
productDO.setUserId(sysUser.getUserId());
|
||||
productDO.setAuthId(sysUser.getAuthId());
|
||||
productDO.setAuthProductType(AuthProductEnums.ANIVIA.code);
|
||||
relUserAuthProductMapper.insert(productDO);
|
||||
|
||||
SysUserRole userRole = new SysUserRole();
|
||||
userRole.setUserId(sysUser.getUserId());
|
||||
userRole.setRoleId(Long.valueOf(3));
|
||||
userRoles.add(userRole);
|
||||
}
|
||||
}
|
||||
sysUserRoleMapper.batchUserRole(userRoles);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理认证平台推送的科室数据
|
||||
*
|
||||
* @param masterData
|
||||
*/
|
||||
private void deptData(JSONArray masterData) {
|
||||
ArrayList<SysDept> sysIdHubDepts = new ArrayList<>();
|
||||
//解密数据
|
||||
for (int i = 0; i < masterData.size(); i++) {
|
||||
JSONObject dataJSONObject = masterData.getJSONObject(i);
|
||||
SysDept sysDept = new SysDept();
|
||||
String deptId = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("deptId"));
|
||||
String parentId = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("parentId"));
|
||||
String ancestors = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("ancestors"));
|
||||
String deptName = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("deptName"));
|
||||
String orderNum = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("orderNum"));
|
||||
String status = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("status"));
|
||||
String delFlag = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("delFlag"));
|
||||
String simpleDeptName = RSAUtil.decryptWithPublicKey(dataJSONObject.getString("simpleDeptName"));
|
||||
|
||||
sysDept.setDeptId(StringUtils.isBlank(deptId) ? null : Long.valueOf(deptId));
|
||||
sysDept.setParentId(StringUtils.isBlank(parentId) ? null : Long.valueOf(parentId));
|
||||
sysDept.setAncestors(ancestors);
|
||||
sysDept.setDeptName(deptName);
|
||||
sysDept.setOrderNum(StringUtils.isBlank(orderNum) ? null : Integer.valueOf(orderNum));
|
||||
sysDept.setStatus(status);
|
||||
sysDept.setDelFlag(delFlag);
|
||||
sysDept.setParentName(simpleDeptName);
|
||||
sysIdHubDepts.add(sysDept);
|
||||
}
|
||||
SysDept dept = new SysDept();
|
||||
List<SysDept> sysDeptList = sysDeptMapper.selectDeptListAll(dept);
|
||||
// 使用 HashMap 存储 sysDeptList 中的 DeptId 和对应的 SysDept
|
||||
Map<String, SysDept> deptMap = new HashMap<>();
|
||||
for (SysDept sys : sysDeptList) {
|
||||
deptMap.put(sys.getDeptId().toString(), sys);
|
||||
}
|
||||
|
||||
// 遍历 sysIdHubDepts,根据是否存在于 deptMap 中决定更新或插入
|
||||
for (SysDept dep : sysIdHubDepts) {
|
||||
if (deptMap.containsKey(dep.getDeptId().toString())) {
|
||||
sysDeptMapper.updateDept(dep);
|
||||
} else {
|
||||
sysDeptMapper.insertDept(dep);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.service.message;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import tech.qiantong.qmodel.common.core.page.PageResult;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessagePageReqVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageSaveReqVO;
|
||||
import tech.qiantong.qmodel.module.system.convert.message.MessageConvert;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息Service接口
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
public interface IMessageService extends IService<MessageDO> {
|
||||
|
||||
default PageResult<MessageDO> getMessagePage(MessagePageReqVO message) {
|
||||
QueryWrapper<MessageDO> queryWrapper = new QueryWrapper<>(MessageConvert.INSTANCE.convertToDO(message));
|
||||
// 添加时间范围查询条件
|
||||
if (message.getStartTime() != null && message.getEndTime() != null) {
|
||||
queryWrapper.ge("DATE(create_time)", message.getStartTime()); // >= 起始时间
|
||||
queryWrapper.le("DATE(create_time)", message.getEndTime()); // <= 结束时间
|
||||
}
|
||||
List<MessageDO> list = list(queryWrapper);
|
||||
|
||||
return new PageResult(list, new PageInfo(list).getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过模版向某一个用户发送消息
|
||||
* @param templateId 模版id
|
||||
* @param messageSaveReqVO 消息创建
|
||||
* @param entity 实体对象
|
||||
* @return 是否发送成功
|
||||
*/
|
||||
public Boolean send(Long templateId, MessageSaveReqVO messageSaveReqVO, Object entity);
|
||||
|
||||
/**
|
||||
* 查询消息数量
|
||||
* @param message 查询条件
|
||||
* @return 数量
|
||||
*/
|
||||
public Long getNum(MessagePageReqVO message);
|
||||
|
||||
/**
|
||||
* 设置已读
|
||||
* @param id 消息id
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean read(Long id);
|
||||
|
||||
/**
|
||||
* 全部已读
|
||||
* @param receiverId 接收人id
|
||||
* @param category 消息类型
|
||||
* @param module 消息模块
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean readAll(Long receiverId, Integer category, Integer module);
|
||||
|
||||
/**
|
||||
* 更新接收人未读消息
|
||||
*
|
||||
* @param receiverId 接收人id
|
||||
*/
|
||||
public void getReceiverWDNum(Long receiverId);
|
||||
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.service.message;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import tech.qiantong.qmodel.common.core.page.PageResult;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageTemplatePageReqVO;
|
||||
import tech.qiantong.qmodel.module.system.convert.message.MessageTemplateConvert;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageTemplateDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息模板Service接口
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
public interface IMessageTemplateService extends IService<MessageTemplateDO> {
|
||||
|
||||
default PageResult<MessageTemplateDO> getMessageTemplatePage(MessageTemplatePageReqVO messageTemplate) {
|
||||
QueryWrapper<MessageTemplateDO> queryWrapper = new QueryWrapper<>(MessageTemplateConvert.INSTANCE.convertToDO(messageTemplate));
|
||||
List<MessageTemplateDO> list = list(queryWrapper);
|
||||
|
||||
return new PageResult(list, new PageInfo(list).getTotal());
|
||||
}
|
||||
}
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.service.message.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import tech.qiantong.qmodel.common.exception.base.BaseException;
|
||||
import tech.qiantong.qmodel.common.utils.object.BeanUtils;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessagePageReqVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.vo.MessageSaveReqVO;
|
||||
import tech.qiantong.qmodel.module.system.controller.admin.system.message.websocket.WebSocketMessageServer;
|
||||
import tech.qiantong.qmodel.module.system.convert.message.MessageConvert;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageDO;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageTemplateDO;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.enums.MessageHasReadEnums;
|
||||
import tech.qiantong.qmodel.module.system.dal.mapper.message.MessageMapper;
|
||||
import tech.qiantong.qmodel.module.system.dal.mapper.message.MessageTemplateMapper;
|
||||
import tech.qiantong.qmodel.module.system.service.message.IMessageService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
import static tech.qiantong.qmodel.common.utils.SecurityUtils.getLoginUser;
|
||||
|
||||
/**
|
||||
* 消息Service业务层处理
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class MessageServiceImpl extends ServiceImpl<MessageMapper, MessageDO> implements IMessageService {
|
||||
@Resource
|
||||
private MessageMapper messageMapper;
|
||||
@Resource
|
||||
private MessageTemplateMapper messageTemplateMapper;
|
||||
|
||||
/**
|
||||
* 通过模版向某一个用户发送消息
|
||||
* @param templateId 模版id
|
||||
* @param messageSaveReqVO 消息创建
|
||||
* @param entity 实体对象
|
||||
* @return 是否发送成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean send(Long templateId, MessageSaveReqVO messageSaveReqVO, Object entity) {
|
||||
MessageTemplateDO messageTemplateDO = messageTemplateMapper.selectById(templateId); // 获取对应的模版
|
||||
if (messageTemplateDO == null) {
|
||||
throw new BaseException("消息模版不存在");
|
||||
}
|
||||
Map<?, ?> map = BeanUtils.toBean(entity, Map.class); // 将实体转换为键值对
|
||||
// 消息模版更新数值
|
||||
String message = messageTemplateDO.getContent();
|
||||
for (Map.Entry<?, ?> entry : map.entrySet()) {
|
||||
message = message.replace("${" + entry.getKey().toString() + "}", entry.getValue().toString());
|
||||
}
|
||||
MessageDO messageDO = BeanUtils.toBean(messageSaveReqVO, MessageDO.class);
|
||||
// 设置模版基本数据
|
||||
messageDO.setCategory(messageTemplateDO.getCategory());
|
||||
messageDO.setMsgLevel(messageTemplateDO.getMsgLevel());
|
||||
messageDO.setTitle(messageTemplateDO.getTitle());
|
||||
// 实际消息
|
||||
messageDO.setContent(message);
|
||||
|
||||
messageDO.setCreatorId(getLoginUser().getUserId());
|
||||
messageDO.setCreateBy(getLoginUser().getUser().getNickName());
|
||||
boolean save = this.save(messageDO);
|
||||
// 更新消息
|
||||
this.getReceiverWDNum(messageSaveReqVO.getReceiverId());
|
||||
return save;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询消息数量
|
||||
* @param message 查询条件
|
||||
* @return 数量
|
||||
*/
|
||||
@Override
|
||||
public Long getNum(MessagePageReqVO message) {
|
||||
message.setDelFlag(1);
|
||||
QueryWrapper<MessageDO> queryWrapper = new QueryWrapper<>(MessageConvert.INSTANCE.convertToDO(message));
|
||||
Long count = this.count(queryWrapper);
|
||||
WebSocketMessageServer.sendMessage(message.getReceiverId().toString(), count.toString()); // 消息更新
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置已读
|
||||
* @param id 消息id
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean read(Long id) {
|
||||
MessageDO messageDO = new MessageDO();
|
||||
messageDO.setId(id);
|
||||
messageDO.setHasRead(MessageHasReadEnums.YD.code);
|
||||
boolean b = this.updateById(messageDO);
|
||||
// 更新消息
|
||||
this.getReceiverWDNum(getLoginUser().getUserId());
|
||||
return b;
|
||||
}
|
||||
|
||||
/**
|
||||
* 全部已读
|
||||
* @param receiverId 接收人id
|
||||
* @param category 消息类型
|
||||
* @param module 消息模块
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean readAll(Long receiverId, Integer category, Integer module) {
|
||||
LambdaUpdateWrapper<MessageDO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(MessageDO::getReceiverId, receiverId);
|
||||
if (category != null) {
|
||||
updateWrapper.eq(MessageDO::getCategory, category);
|
||||
}
|
||||
if (module != null) {
|
||||
updateWrapper.eq(MessageDO::getModule, module);
|
||||
}
|
||||
updateWrapper.set(MessageDO::getHasRead, MessageHasReadEnums.YD.code);
|
||||
boolean update = this.update(updateWrapper);
|
||||
// 更新消息
|
||||
this.getReceiverWDNum(getLoginUser().getUserId());
|
||||
return update;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新接收人未读消息
|
||||
*
|
||||
* @param receiverId 接收人id
|
||||
*/
|
||||
public void getReceiverWDNum(Long receiverId) {
|
||||
MessagePageReqVO messagePageReqVO = new MessagePageReqVO();
|
||||
messagePageReqVO.setHasRead(MessageHasReadEnums.WD.code);
|
||||
messagePageReqVO.setReceiverId(receiverId);
|
||||
this.getNum(messagePageReqVO);
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
* qModel Model Platform(Open Source Edition)
|
||||
* *
|
||||
* License:
|
||||
* Released under the Apache License, Version 2.0.
|
||||
* You may use, modify, and distribute this software for commercial purposes
|
||||
* under the terms of the License.
|
||||
* *
|
||||
* Special Notice:
|
||||
* All derivative versions are strictly prohibited from modifying or removing
|
||||
* the default system logo and copyright information.
|
||||
* For brand customization, please apply for brand customization authorization via official channels.
|
||||
* *
|
||||
* More information: https://qmodel.qiantong.tech/business.html
|
||||
* *
|
||||
* ============================================================================
|
||||
* *
|
||||
* 版权所有 © 2026 江苏千桐科技有限公司
|
||||
* qModel 模型平台(开源版)
|
||||
* *
|
||||
* 许可协议:
|
||||
* 本项目基于 Apache License 2.0 开源协议发布,
|
||||
* 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
* *
|
||||
* 特别说明:
|
||||
* 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
* 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
* *
|
||||
* 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
*/
|
||||
|
||||
package tech.qiantong.qmodel.module.system.service.message.impl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import tech.qiantong.qmodel.module.system.dal.dataobject.message.MessageTemplateDO;
|
||||
import tech.qiantong.qmodel.module.system.dal.mapper.message.MessageTemplateMapper;
|
||||
import tech.qiantong.qmodel.module.system.service.message.IMessageTemplateService;
|
||||
|
||||
/**
|
||||
* 消息模板Service业务层处理
|
||||
*
|
||||
* @author anivia
|
||||
* @date 2024-10-31
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class MessageTemplateServiceImpl extends ServiceImpl<MessageTemplateMapper,MessageTemplateDO> implements IMessageTemplateService {
|
||||
@Resource
|
||||
private MessageTemplateMapper messageTemplateMapper;
|
||||
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
# Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
# qModel Model Platform(Open Source Edition)
|
||||
# *
|
||||
# License:
|
||||
# Released under the Apache License, Version 2.0.
|
||||
# You may use, modify, and distribute this software for commercial purposes
|
||||
# under the terms of the License.
|
||||
# *
|
||||
# Special Notice:
|
||||
# All derivative versions are strictly prohibited from modifying or removing
|
||||
# the default system logo and copyright information.
|
||||
# For brand customization, please apply for brand customization authorization via official channels.
|
||||
# *
|
||||
# More information: https://qmodel.qiantong.tech/business.html
|
||||
# *
|
||||
# ============================================================================
|
||||
# *
|
||||
# 版权所有 © 2026 江苏千桐科技有限公司
|
||||
# qModel 模型平台(开源版)
|
||||
# *
|
||||
# 许可协议:
|
||||
# 本项目基于 Apache License 2.0 开源协议发布,
|
||||
# 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
# *
|
||||
# 特别说明:
|
||||
# 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
# 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
# *
|
||||
# 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
|
||||
# 统一认证中心
|
||||
oauth2:
|
||||
redis-prefix: "idhub-clientToken"
|
||||
clientId: 9d04db60ab904313a43ebb78c9f027c1
|
||||
clientSecret: 82e25a80db5f4a13afb2ee8b2cf6d08b
|
||||
serverUrl: http://127.0.0.1:8899
|
||||
redirect401Url: http://127.0.0.1/401
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
# Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
# qModel Model Platform(Open Source Edition)
|
||||
# *
|
||||
# License:
|
||||
# Released under the Apache License, Version 2.0.
|
||||
# You may use, modify, and distribute this software for commercial purposes
|
||||
# under the terms of the License.
|
||||
# *
|
||||
# Special Notice:
|
||||
# All derivative versions are strictly prohibited from modifying or removing
|
||||
# the default system logo and copyright information.
|
||||
# For brand customization, please apply for brand customization authorization via official channels.
|
||||
# *
|
||||
# More information: https://qmodel.qiantong.tech/business.html
|
||||
# *
|
||||
# ============================================================================
|
||||
# *
|
||||
# 版权所有 © 2026 江苏千桐科技有限公司
|
||||
# qModel 模型平台(开源版)
|
||||
# *
|
||||
# 许可协议:
|
||||
# 本项目基于 Apache License 2.0 开源协议发布,
|
||||
# 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
# *
|
||||
# 特别说明:
|
||||
# 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
# 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
# *
|
||||
# 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
|
||||
# 统一认证中心
|
||||
oauth2:
|
||||
redis-prefix: "idhub-clientToken"
|
||||
clientId: 9d04db60ab904313a43ebb78c9f027c1
|
||||
clientSecret: 82e25a80db5f4a13afb2ee8b2cf6d08b
|
||||
serverUrl: http://127.0.0.1:8899
|
||||
redirect401Url: http://127.0.0.1/401
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
# Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
# qModel Model Platform(Open Source Edition)
|
||||
# *
|
||||
# License:
|
||||
# Released under the Apache License, Version 2.0.
|
||||
# You may use, modify, and distribute this software for commercial purposes
|
||||
# under the terms of the License.
|
||||
# *
|
||||
# Special Notice:
|
||||
# All derivative versions are strictly prohibited from modifying or removing
|
||||
# the default system logo and copyright information.
|
||||
# For brand customization, please apply for brand customization authorization via official channels.
|
||||
# *
|
||||
# More information: https://qmodel.qiantong.tech/business.html
|
||||
# *
|
||||
# ============================================================================
|
||||
# *
|
||||
# 版权所有 © 2026 江苏千桐科技有限公司
|
||||
# qModel 模型平台(开源版)
|
||||
# *
|
||||
# 许可协议:
|
||||
# 本项目基于 Apache License 2.0 开源协议发布,
|
||||
# 允许在遵守协议的前提下进行商用、修改和分发。
|
||||
# *
|
||||
# 特别说明:
|
||||
# 所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
# 如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
# *
|
||||
# 更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
|
||||
# 统一认证中心
|
||||
oauth2:
|
||||
redis-prefix: "idhub-clientToken"
|
||||
clientId: 9d04db60ab904313a43ebb78c9f027c1
|
||||
clientSecret: 82e25a80db5f4a13afb2ee8b2cf6d08b
|
||||
serverUrl: http://127.0.0.1:8899
|
||||
redirect401Url: http://127.0.0.1/401
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.ca.mapper.CaCertMapper">
|
||||
|
||||
<resultMap type="CaCert" id="CaCertResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="subjectId" column="subject_id" />
|
||||
<result property="subjectName" column="subject_name" />
|
||||
<result property="certificate" column="certificate" />
|
||||
<result property="privateKey" column="private_key" />
|
||||
<result property="issuer" column="issuer" />
|
||||
<result property="possessor" column="possessor" />
|
||||
<result property="validTime" column="valid_time" />
|
||||
<result property="validFlag" column="valid_flag" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="creatorId" column="creator_id" />
|
||||
<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="selectCaCertVo">
|
||||
select id, name, subject_id, subject_name, certificate, private_key, issuer, possessor, valid_time, valid_flag, del_flag, create_by, creator_id, create_time, update_by, update_time, remark from ca_cert
|
||||
</sql>
|
||||
|
||||
<select id="selectCaCertList" parameterType="CaCert" resultMap="CaCertResult">
|
||||
<include refid="selectCaCertVo"/>
|
||||
<where>
|
||||
<if test="subjectId != null "> and subject_id = #{subjectId}</if>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="name != null and name != ''"> and name like '%' || #{name} || '%'</if>
|
||||
<if test="subjectName != null and subjectName != ''"> and subject_name like '%' || #{subjectName} || '%'</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="subjectName != null and subjectName != ''"> and subject_name like concat('%', #{subjectName}, '%')</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="certificate != null and certificate != ''"> and certificate = #{certificate}</if>
|
||||
<if test="privateKey != null and privateKey != ''"> and private_key = #{privateKey}</if>
|
||||
<if test="issuer != null and issuer != ''"> and issuer = #{issuer}</if>
|
||||
<if test="possessor != null and possessor != ''"> and possessor = #{possessor}</if>
|
||||
<if test="validTime != null and validTime != ''"> and valid_time = #{validTime}</if>
|
||||
<if test="validFlag != null "> and valid_flag = #{validFlag}</if>
|
||||
<if test="creatorId != null "> and creator_id = #{creatorId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCaCertById" parameterType="Long" resultMap="CaCertResult">
|
||||
<include refid="selectCaCertVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCaCert" parameterType="CaCert" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ca_cert
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="subjectId != null">subject_id,</if>
|
||||
<if test="subjectName != null and subjectName != ''">subject_name,</if>
|
||||
<if test="certificate != null and certificate != ''">certificate,</if>
|
||||
<if test="privateKey != null and privateKey != ''">private_key,</if>
|
||||
<if test="issuer != null and issuer != ''">issuer,</if>
|
||||
<if test="possessor != null and possessor != ''">possessor,</if>
|
||||
<if test="validTime != null and validTime != ''">valid_time,</if>
|
||||
<if test="validFlag != null">valid_flag,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="creatorId != null">creator_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="subjectId != null">#{subjectId},</if>
|
||||
<if test="subjectName != null and subjectName != ''">#{subjectName},</if>
|
||||
<if test="certificate != null and certificate != ''">#{certificate},</if>
|
||||
<if test="privateKey != null and privateKey != ''">#{privateKey},</if>
|
||||
<if test="issuer != null and issuer != ''">#{issuer},</if>
|
||||
<if test="possessor != null and possessor != ''">#{possessor},</if>
|
||||
<if test="validTime != null and validTime != ''">#{validTime},</if>
|
||||
<if test="validFlag != null">#{validFlag},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="creatorId != null">#{creatorId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCaCert" parameterType="CaCert">
|
||||
update ca_cert
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="subjectId != null">subject_id = #{subjectId},</if>
|
||||
<if test="subjectName != null and subjectName != ''">subject_name = #{subjectName},</if>
|
||||
<if test="certificate != null and certificate != ''">certificate = #{certificate},</if>
|
||||
<if test="privateKey != null and privateKey != ''">private_key = #{privateKey},</if>
|
||||
<if test="issuer != null and issuer != ''">issuer = #{issuer},</if>
|
||||
<if test="possessor != null and possessor != ''">possessor = #{possessor},</if>
|
||||
<if test="validTime != null and validTime != ''">valid_time = #{validTime},</if>
|
||||
<if test="validFlag != null">valid_flag = #{validFlag},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="creatorId != null">creator_id = #{creatorId},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCaCertById" parameterType="Long">
|
||||
delete from ca_cert where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCaCertByIds" parameterType="String">
|
||||
delete from ca_cert where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.ca.mapper.CaSubjectMapper">
|
||||
|
||||
<resultMap type="CaSubject" id="CaSubjectResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="cn" column="cn" />
|
||||
<result property="ou" column="ou" />
|
||||
<result property="o" column="o" />
|
||||
<result property="l" column="l" />
|
||||
<result property="st" column="st" />
|
||||
<result property="c" column="c" />
|
||||
<result property="certificate" column="certificate" />
|
||||
<result property="privateKey" column="private_key" />
|
||||
<result property="validFlag" column="valid_flag" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="creatorId" column="creator_id" />
|
||||
<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="selectCaSubjectVo">
|
||||
select id, name, cn, ou, o, l, st, c, certificate, private_key, valid_flag, del_flag, create_by, creator_id, create_time, update_by, update_time, remark from ca_subject
|
||||
</sql>
|
||||
|
||||
<select id="selectCaSubjectList" parameterType="CaSubject" resultMap="CaSubjectResult">
|
||||
<include refid="selectCaSubjectVo"/>
|
||||
<where>
|
||||
<if test="cn != null and cn != ''"> and cn = #{cn}</if>
|
||||
<if test="ou != null and ou != ''"> and ou = #{ou}</if>
|
||||
<if test="o != null and o != ''"> and o = #{o}</if>
|
||||
<if test="l != null and l != ''"> and l = #{l}</if>
|
||||
<if test="st != null and st != ''"> and st = #{st}</if>
|
||||
<if test="c != null and c != ''"> and c = #{c}</if>
|
||||
<if test="certificate != null and certificate != ''"> and certificate = #{certificate}</if>
|
||||
<if test="privateKey != null and privateKey != ''"> and private_key = #{privateKey}</if>
|
||||
<if test="validFlag != null "> and valid_flag = #{validFlag}</if>
|
||||
<if test="creatorId != null "> and creator_id = #{creatorId}</if>
|
||||
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="name != null and name != ''"> and name like '%' || #{name} || '%'</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCaSubjectById" parameterType="Long" resultMap="CaSubjectResult">
|
||||
<include refid="selectCaSubjectVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCaSubject" parameterType="CaSubject" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ca_subject
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="cn != null and cn != ''">cn,</if>
|
||||
<if test="ou != null and ou != ''">ou,</if>
|
||||
<if test="o != null and o != ''">o,</if>
|
||||
<if test="l != null and l != ''">l,</if>
|
||||
<if test="st != null and st != ''">st,</if>
|
||||
<if test="c != null and c != ''">c,</if>
|
||||
<if test="certificate != null and certificate != ''">certificate,</if>
|
||||
<if test="privateKey != null and privateKey != ''">private_key,</if>
|
||||
<if test="validFlag != null">valid_flag,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="creatorId != null">creator_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="cn != null and cn != ''">#{cn},</if>
|
||||
<if test="ou != null and ou != ''">#{ou},</if>
|
||||
<if test="o != null and o != ''">#{o},</if>
|
||||
<if test="l != null and l != ''">#{l},</if>
|
||||
<if test="st != null and st != ''">#{st},</if>
|
||||
<if test="c != null and c != ''">#{c},</if>
|
||||
<if test="certificate != null and certificate != ''">#{certificate},</if>
|
||||
<if test="privateKey != null and privateKey != ''">#{privateKey},</if>
|
||||
<if test="validFlag != null">#{validFlag},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="creatorId != null">#{creatorId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCaSubject" parameterType="CaSubject">
|
||||
update ca_subject
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="cn != null and cn != ''">cn = #{cn},</if>
|
||||
<if test="ou != null and ou != ''">ou = #{ou},</if>
|
||||
<if test="o != null and o != ''">o = #{o},</if>
|
||||
<if test="l != null and l != ''">l = #{l},</if>
|
||||
<if test="st != null and st != ''">st = #{st},</if>
|
||||
<if test="c != null and c != ''">c = #{c},</if>
|
||||
<if test="certificate != null and certificate != ''">certificate = #{certificate},</if>
|
||||
<if test="privateKey != null and privateKey != ''">private_key = #{privateKey},</if>
|
||||
<if test="validFlag != null">valid_flag = #{validFlag},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="creatorId != null">creator_id = #{creatorId},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCaSubjectById" parameterType="Long">
|
||||
delete from ca_subject where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCaSubjectByIds" parameterType="String">
|
||||
delete from ca_subject where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysConfigMapper">
|
||||
|
||||
<resultMap type="SysConfig" id="SysConfigResult">
|
||||
<id property="configId" column="config_id" />
|
||||
<result property="configName" column="config_name" />
|
||||
<result property="configKey" column="config_key" />
|
||||
<result property="configValue" column="config_value" />
|
||||
<result property="configType" column="config_type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectConfigVo">
|
||||
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
|
||||
from system_config
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="sqlwhereSearch">
|
||||
<where>
|
||||
<if test="configId !=null">
|
||||
and config_id = #{configId}
|
||||
</if>
|
||||
<if test="configKey !=null and configKey != ''">
|
||||
and config_key = #{configKey}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<include refid="sqlwhereSearch"/>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<where>
|
||||
<if test="configType != null and configType != ''">
|
||||
AND config_type = #{configType}
|
||||
</if>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="configName != null and configName != ''">
|
||||
AND config_name LIKE '%' || #{configName} || '%'
|
||||
</if>
|
||||
<if test="configKey != null and configKey != ''">
|
||||
AND config_key LIKE '%' || #{configKey} || '%'
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND create_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND create_time <= #{params.endTime}
|
||||
</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="configName != null and configName != ''">
|
||||
AND config_name like concat('%', #{configName}, '%')
|
||||
</if>
|
||||
<if test="configKey != null and configKey != ''">
|
||||
AND config_key like concat('%', #{configKey}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigById" parameterType="Long" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where config_id = #{configId}
|
||||
</select>
|
||||
|
||||
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where config_key = #{configKey} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertConfig" parameterType="SysConfig">
|
||||
insert into system_config (
|
||||
<if test="configName != null and configName != '' ">config_name,</if>
|
||||
<if test="configKey != null and configKey != '' ">config_key,</if>
|
||||
<if test="configValue != null and configValue != '' ">config_value,</if>
|
||||
<if test="configType != null and configType != '' ">config_type,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="configName != null and configName != ''">#{configName},</if>
|
||||
<if test="configKey != null and configKey != ''">#{configKey},</if>
|
||||
<if test="configValue != null and configValue != ''">#{configValue},</if>
|
||||
<if test="configType != null and configType != ''">#{configType},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateConfig" parameterType="SysConfig">
|
||||
update system_config
|
||||
<set>
|
||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||
<if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
|
||||
<if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
|
||||
<if test="configType != null and configType != ''">config_type = #{configType},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where config_id = #{configId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteConfigById" parameterType="Long">
|
||||
delete from system_config where config_id = #{configId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteConfigByIds" parameterType="Long">
|
||||
delete from system_config where config_id in
|
||||
<foreach item="configId" collection="array" open="(" separator="," close=")">
|
||||
#{configId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+277
@@ -0,0 +1,277 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysDeptMapper">
|
||||
|
||||
<resultMap type="SysDept" id="SysDeptResult">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="email" column="email" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
|
||||
from system_dept d
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="parentId != null and parentId != 0">
|
||||
AND parent_id = #{parentId}
|
||||
</if>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name LIKE '%' || #{deptName} || '%'
|
||||
</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptListAll" parameterType="SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name LIKE '%' || #{deptName} || '%'
|
||||
</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptListByRoleId" resultType="Long">
|
||||
select d.dept_id
|
||||
from system_dept d
|
||||
left join system_role_dept rd on d.dept_id = rd.dept_id
|
||||
where rd.role_id = #{roleId}
|
||||
<if test="deptCheckStrictly">
|
||||
and d.dept_id not in (select d.parent_id from system_dept d inner join system_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
|
||||
</if>
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
|
||||
(select dept_name from system_dept where dept_id = d.parent_id) parent_name
|
||||
from system_dept d
|
||||
where d.dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
||||
select count(1) from system_user where dept_id = #{deptId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
|
||||
select count(1) from system_dept
|
||||
where del_flag = '0' and parent_id = #{deptId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
SELECT *
|
||||
FROM system_dept
|
||||
WHERE position(#{deptId}::text IN ancestors) > 0;
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
select * from system_dept where find_in_set(#{deptId}, ancestors)
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
SELECT count(*)
|
||||
FROM system_dept
|
||||
WHERE status = 0
|
||||
AND del_flag = '0'
|
||||
AND position(#{deptId}::text IN ancestors) > 0;
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
select count(*) from system_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectDeptListByParentId" parameterType="SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
AND parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="SysDept">
|
||||
insert into system_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="delFlag != null and delFlag != 0">del_flag,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="leader != null and leader != ''">leader,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||
<if test="delFlag != null and delFlag != 0">#{delFlag},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="leader != null and leader != ''">#{leader},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDept" parameterType="SysDept">
|
||||
update system_dept
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="leader != null">leader = #{leader},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="email != null">email = #{email},</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 dept_id = #{deptId}
|
||||
</update>
|
||||
|
||||
<update id="updateDeptChildren" parameterType="java.util.List">
|
||||
update system_dept set ancestors =
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator=" " open="case dept_id" close="end">
|
||||
when #{item.deptId} then #{item.ancestors}
|
||||
</foreach>
|
||||
where dept_id in
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator="," open="(" close=")">
|
||||
#{item.deptId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateDeptStatusNormal" parameterType="Long">
|
||||
update system_dept set status = '0' where dept_id in
|
||||
<foreach collection="array" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeptById" parameterType="Long">
|
||||
update system_dept set del_flag = '2' where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysDictDataMapper">
|
||||
|
||||
<resultMap type="SysDictData" id="SysDictDataResult">
|
||||
<id property="dictCode" column="dict_code" />
|
||||
<result property="dictSort" column="dict_sort" />
|
||||
<result property="dictLabel" column="dict_label" />
|
||||
<result property="dictValue" column="dict_value" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
<result property="cssClass" column="css_class" />
|
||||
<result property="listClass" column="list_class" />
|
||||
<result property="isDefault" column="is_default" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictDataVo">
|
||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
|
||||
from system_dict_data
|
||||
</sql>
|
||||
|
||||
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
<where>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type = #{dictType}
|
||||
</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">
|
||||
AND dict_label like concat('%', #{dictLabel}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataByType" parameterType="String" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectDictLabel" resultType="String">
|
||||
select dict_label from system_dict_data
|
||||
where dict_type = #{dictType} and dict_value = #{dictValue}
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where dict_code = #{dictCode}
|
||||
</select>
|
||||
|
||||
<select id="countDictDataByType" resultType="Integer">
|
||||
select count(1) from system_dict_data where dict_type=#{dictType}
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictDataById" parameterType="Long">
|
||||
delete from system_dict_data where dict_code = #{dictCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictDataByIds" parameterType="Long">
|
||||
delete from system_dict_data where dict_code in
|
||||
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
|
||||
#{dictCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictData" parameterType="SysDictData">
|
||||
update system_dict_data
|
||||
<set>
|
||||
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
|
||||
<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
|
||||
<if test="cssClass != null">css_class = #{cssClass},</if>
|
||||
<if test="listClass != null">list_class = #{listClass},</if>
|
||||
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dict_code = #{dictCode}
|
||||
</update>
|
||||
|
||||
<update id="updateDictDataType" parameterType="String">
|
||||
update system_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictData" parameterType="SysDictData">
|
||||
insert into system_dict_data(
|
||||
<if test="dictSort != null">dict_sort,</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
||||
<if test="dictValue != null and dictValue != ''">dict_value,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
<if test="cssClass != null and cssClass != ''">css_class,</if>
|
||||
<if test="listClass != null and listClass != ''">list_class,</if>
|
||||
<if test="isDefault != null and isDefault != ''">is_default,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="dictSort != null">#{dictSort},</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
|
||||
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
|
||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||
<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
|
||||
<if test="listClass != null and listClass != ''">#{listClass},</if>
|
||||
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysDictTypeMapper">
|
||||
|
||||
<resultMap type="SysDictType" id="SysDictTypeResult">
|
||||
<id property="dictId" column="dict_id" />
|
||||
<result property="dictName" column="dict_name" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictTypeVo">
|
||||
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
|
||||
from system_dict_type
|
||||
</sql>
|
||||
|
||||
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
<where>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="dictName != null and dictName != ''">
|
||||
AND dict_name LIKE '%' || #{dictName} || '%'
|
||||
</if>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type LIKE '%' || #{dictType} || '%'
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND create_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND create_time <= #{params.endTime}
|
||||
</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
AND dict_name like concat('%', #{dictName}, '%')
|
||||
</if>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type like concat('%', #{dictType}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_id = #{dictId}
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType}
|
||||
</select>
|
||||
|
||||
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType} limit 1
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictTypeById" parameterType="Long">
|
||||
delete from system_dict_type where dict_id = #{dictId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictTypeByIds" parameterType="Long">
|
||||
delete from system_dict_type where dict_id in
|
||||
<foreach collection="array" item="dictId" open="(" separator="," close=")">
|
||||
#{dictId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictType" parameterType="SysDictType">
|
||||
update system_dict_type
|
||||
<set>
|
||||
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictType" parameterType="SysDictType">
|
||||
insert into system_dict_type(
|
||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="dictName != null and dictName != ''">#{dictName},</if>
|
||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysLogininforMapper">
|
||||
|
||||
<resultMap type="SysLogininfor" id="SysLogininforResult">
|
||||
<id property="infoId" column="info_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="ipaddr" column="ipaddr" />
|
||||
<result property="loginLocation" column="login_location" />
|
||||
<result property="browser" column="browser" />
|
||||
<result property="os" column="os" />
|
||||
<result property="msg" column="msg" />
|
||||
<result property="loginTime" column="login_time" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertLogininfor" parameterType="SysLogininfor">
|
||||
insert into system_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
|
||||
values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
|
||||
select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from system_logininfor
|
||||
<where>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND login_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND login_time <= #{params.endTime}
|
||||
</if>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="ipaddr != null and ipaddr != ''">
|
||||
AND ipaddr LIKE '%' || #{ipaddr} || '%'
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND user_name LIKE '%' || #{userName} || '%'
|
||||
</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="ipaddr != null and ipaddr != ''">
|
||||
AND ipaddr like concat('%', #{ipaddr}, '%')
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
order by info_id desc
|
||||
</select>
|
||||
|
||||
<delete id="deleteLogininforByIds" parameterType="Long">
|
||||
delete from system_logininfor where info_id in
|
||||
<foreach collection="array" item="infoId" open="(" separator="," close=")">
|
||||
#{infoId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="cleanLogininfor">
|
||||
truncate table system_logininfor
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
+250
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysMenuMapper">
|
||||
|
||||
<resultMap type="SysMenu" id="SysMenuResult">
|
||||
<id property="menuId" column="menu_id" />
|
||||
<result property="menuName" column="menu_name" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="path" column="path" />
|
||||
<result property="component" column="component" />
|
||||
<result property="query" column="query" />
|
||||
<result property="routeName" column="route_name" />
|
||||
<result property="isFrame" column="is_frame" />
|
||||
<result property="isCache" column="is_cache" />
|
||||
<result property="menuType" column="menu_type" />
|
||||
<result property="visible" column="visible" />
|
||||
<result property="status" column="status" />
|
||||
<result property="perms" column="perms" />
|
||||
<result property="icon" column="icon" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMenuVo">
|
||||
select menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
|
||||
from system_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
<where>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND menu_name LIKE '%' || #{menuName} || '%'
|
||||
</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND menu_name like concat('%', #{menuName}, '%')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="visible != null and visible != ''">
|
||||
AND visible = #{visible}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by parent_id, order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from system_menu m where m.menu_type in ('M', 'C') and m.status = 0
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from system_menu m
|
||||
left join system_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join system_user_role ur on rm.role_id = ur.role_id
|
||||
left join system_role ro on ur.role_id = ro.role_id
|
||||
where ur.user_id = #{params.userId}
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND m.menu_name like concat('%', #{menuName}, '%')
|
||||
</if>
|
||||
<if test="visible != null and visible != ''">
|
||||
AND m.visible = #{visible}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND m.status = #{status}
|
||||
</if>
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from system_menu m
|
||||
left join system_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join system_user_role ur on rm.role_id = ur.role_id
|
||||
left join system_role ro on ur.role_id = ro.role_id
|
||||
left join system_user u on ur.user_id = u.user_id
|
||||
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByRoleId" resultType="Long">
|
||||
select m.menu_id
|
||||
from system_menu m
|
||||
left join system_role_menu rm on m.menu_id = rm.menu_id
|
||||
where rm.role_id = #{roleId}
|
||||
<if test="menuCheckStrictly">
|
||||
and m.menu_id not in (select m.parent_id from system_menu m inner join system_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
|
||||
</if>
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuPerms" resultType="String">
|
||||
select distinct m.perms
|
||||
from system_menu m
|
||||
left join system_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join system_user_role ur on rm.role_id = ur.role_id
|
||||
</select>
|
||||
|
||||
<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
|
||||
select distinct m.perms
|
||||
from system_menu m
|
||||
left join system_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join system_user_role ur on rm.role_id = ur.role_id
|
||||
left join system_role r on r.role_id = ur.role_id
|
||||
where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String">
|
||||
select distinct m.perms
|
||||
from system_menu m
|
||||
left join system_role_menu rm on m.menu_id = rm.menu_id
|
||||
where m.status = '0' and rm.role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="hasChildByMenuId" resultType="Integer">
|
||||
select count(1) from system_menu where parent_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateMenu" parameterType="SysMenu">
|
||||
update system_menu
|
||||
<set>
|
||||
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="path != null and path != ''">path = #{path},</if>
|
||||
<if test="component != null">component = #{component},</if>
|
||||
<if test="query != null">query = #{query},</if>
|
||||
<if test="routeName != null">route_name = #{routeName},</if>
|
||||
<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
|
||||
<if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
|
||||
<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
|
||||
<if test="visible != null">visible = #{visible},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="perms !=null">perms = #{perms},</if>
|
||||
<if test="icon !=null and icon != ''">icon = #{icon},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where menu_id = #{menuId}
|
||||
</update>
|
||||
|
||||
<insert id="insertMenu" parameterType="SysMenu">
|
||||
insert into system_menu(
|
||||
<if test="menuId != null and menuId != 0">menu_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="menuName != null and menuName != ''">menu_name,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="path != null and path != ''">path,</if>
|
||||
<if test="component != null and component != ''">component,</if>
|
||||
<if test="query != null and query != ''">query,</if>
|
||||
<if test="routeName != null">route_name,</if>
|
||||
<if test="isFrame != null and isFrame != ''">is_frame,</if>
|
||||
<if test="isCache != null and isCache != ''">is_cache,</if>
|
||||
<if test="menuType != null and menuType != ''">menu_type,</if>
|
||||
<if test="visible != null">visible,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="perms !=null and perms != ''">perms,</if>
|
||||
<if test="icon != null and icon != ''">icon,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="menuId != null and menuId != 0">#{menuId},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="menuName != null and menuName != ''">#{menuName},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="path != null and path != ''">#{path},</if>
|
||||
<if test="component != null and component != ''">#{component},</if>
|
||||
<if test="query != null and query != ''">#{query},</if>
|
||||
<if test="routeName != null">#{routeName},</if>
|
||||
<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
|
||||
<if test="isCache != null and isCache != ''">#{isCache},</if>
|
||||
<if test="menuType != null and menuType != ''">#{menuType},</if>
|
||||
<if test="visible != null">#{visible},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="perms !=null and perms != ''">#{perms},</if>
|
||||
<if test="icon != null and icon != ''">#{icon},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteMenuById" parameterType="Long">
|
||||
delete from system_menu where menu_id = #{menuId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.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">
|
||||
<choose>
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'mysql'">
|
||||
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 system_notice
|
||||
</when>
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'dm8'">
|
||||
SELECT notice_id, notice_title, notice_type,
|
||||
UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(notice_content, 8000, 1)) AS notice_content,
|
||||
status, create_by, create_time, update_by, update_time, remark
|
||||
FROM system_notice
|
||||
</when>
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
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 system_notice
|
||||
</when>
|
||||
</choose>
|
||||
</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="noticeType != null and noticeType != ''">
|
||||
AND notice_type = #{noticeType}
|
||||
</if>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND create_by LIKE '%' || #{createBy} || '%'
|
||||
</if>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">
|
||||
AND notice_title LIKE '%' || #{noticeTitle} || '%'
|
||||
</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND create_by like concat('%', #{createBy}, '%')
|
||||
</if>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">
|
||||
AND notice_title like concat('%', #{noticeTitle}, '%')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertNotice" parameterType="SysNotice">
|
||||
insert into system_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 system_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 system_notice
|
||||
where notice_id = #{noticeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNoticeByIds" parameterType="Long">
|
||||
delete from system_notice where notice_id in
|
||||
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
|
||||
#{noticeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysOperLogMapper">
|
||||
|
||||
<resultMap type="SysOperLog" id="SysOperLogResult">
|
||||
<id property="operId" column="oper_id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="businessType" column="business_type" />
|
||||
<result property="method" column="method" />
|
||||
<result property="requestMethod" column="request_method" />
|
||||
<result property="operatorType" column="operator_type" />
|
||||
<result property="operName" column="oper_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="operUrl" column="oper_url" />
|
||||
<result property="operIp" column="oper_ip" />
|
||||
<result property="operLocation" column="oper_location" />
|
||||
<result property="operParam" column="oper_param" />
|
||||
<result property="jsonResult" column="json_result" />
|
||||
<result property="status" column="status" />
|
||||
<result property="errorMsg" column="error_msg" />
|
||||
<result property="operTime" column="oper_time" />
|
||||
<result property="costTime" column="cost_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOperLogVo">
|
||||
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time
|
||||
from system_oper_log
|
||||
</sql>
|
||||
|
||||
<insert id="insertOperlog" parameterType="SysOperLog">
|
||||
insert into system_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time)
|
||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
||||
<include refid="selectOperLogVo"/>
|
||||
<where>
|
||||
<if test="businessType != null">
|
||||
AND business_type = #{businessType}
|
||||
</if>
|
||||
<if test="businessTypes != null and businessTypes.length > 0">
|
||||
AND business_type in
|
||||
<foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
|
||||
#{businessType}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND oper_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND oper_time <= #{params.endTime}
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="operIp != null and operIp != ''">
|
||||
AND oper_ip LIKE '%' || #{operIp} || '%'
|
||||
</if>
|
||||
<if test="title != null and title != ''">
|
||||
AND title LIKE '%' || #{title} || '%'
|
||||
</if>
|
||||
<if test="operName != null and operName != ''">
|
||||
AND oper_name LIKE '%' || #{operName} || '%'
|
||||
</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="operIp != null and operIp != ''">
|
||||
AND oper_ip like concat('%', #{operIp}, '%')
|
||||
</if>
|
||||
<if test="title != null and title != ''">
|
||||
AND title like concat('%', #{title}, '%')
|
||||
</if>
|
||||
<if test="operName != null and operName != ''">
|
||||
AND oper_name like concat('%', #{operName}, '%')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
order by oper_id desc
|
||||
</select>
|
||||
|
||||
<delete id="deleteOperLogByIds" parameterType="Long">
|
||||
delete from system_oper_log where oper_id in
|
||||
<foreach collection="array" item="operId" open="(" separator="," close=")">
|
||||
#{operId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
|
||||
<include refid="selectOperLogVo"/>
|
||||
where oper_id = #{operId}
|
||||
</select>
|
||||
|
||||
<update id="cleanOperLog">
|
||||
truncate table system_oper_log
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
+169
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysPostMapper">
|
||||
|
||||
<resultMap type="SysPost" id="SysPostResult">
|
||||
<id property="postId" column="post_id" />
|
||||
<result property="postCode" column="post_code" />
|
||||
<result property="postName" column="post_name" />
|
||||
<result property="postSort" column="post_sort" />
|
||||
<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="selectPostVo">
|
||||
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
|
||||
from system_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
<where>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="postCode != null and postCode != ''">
|
||||
AND post_code LIKE '%' || #{postCode} || '%'
|
||||
</if>
|
||||
<if test="postName != null and postName != ''">
|
||||
AND post_name LIKE '%' || #{postName} || '%'
|
||||
</if>
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="postCode != null and postCode != ''">
|
||||
AND post_code like concat('%', #{postCode}, '%')
|
||||
</if>
|
||||
<if test="postName != null and postName != ''">
|
||||
AND post_name like concat('%', #{postName}, '%')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPostAll" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_id = #{postId}
|
||||
</select>
|
||||
|
||||
<select id="selectPostListByUserId" parameterType="Long" resultType="Long">
|
||||
select p.post_id
|
||||
from system_post p
|
||||
left join system_user_post up on up.post_id = p.post_id
|
||||
left join system_user u on u.user_id = up.user_id
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
|
||||
select p.post_id, p.post_name, p.post_code
|
||||
from system_post p
|
||||
left join system_user_post up on up.post_id = p.post_id
|
||||
left join system_user u on u.user_id = up.user_id
|
||||
where u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_name=#{postName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_code=#{postCode} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="SysPost">
|
||||
update system_post
|
||||
<set>
|
||||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||
<if test="postName != null and postName != ''">post_name = #{postName},</if>
|
||||
<if test="postSort != null">post_sort = #{postSort},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where post_id = #{postId}
|
||||
</update>
|
||||
|
||||
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
insert into system_post(
|
||||
<if test="postId != null and postId != 0">post_id,</if>
|
||||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
<if test="postName != null and postName != ''">post_name,</if>
|
||||
<if test="postSort != null">post_sort,</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="postId != null and postId != 0">#{postId},</if>
|
||||
<if test="postCode != null and postCode != ''">#{postCode},</if>
|
||||
<if test="postName != null and postName != ''">#{postName},</if>
|
||||
<if test="postSort != null">#{postSort},</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>
|
||||
|
||||
<delete id="deletePostById" parameterType="Long">
|
||||
delete from system_post where post_id = #{postId}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePostByIds" parameterType="Long">
|
||||
delete from system_post where post_id in
|
||||
<foreach collection="array" item="postId" open="(" separator="," close=")">
|
||||
#{postId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysRoleDeptMapper">
|
||||
|
||||
<resultMap type="SysRoleDept" id="SysRoleDeptResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteRoleDeptByRoleId" parameterType="Long">
|
||||
delete from system_role_dept where role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
<select id="selectCountRoleDeptByDeptId" resultType="Integer">
|
||||
select count(1) from system_role_dept where dept_id=#{deptId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleDept" parameterType="Long">
|
||||
delete from system_role_dept where role_id in
|
||||
<foreach collection="array" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchRoleDept">
|
||||
insert into system_role_dept(role_id, dept_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.roleId},#{item.deptId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysRoleMapper">
|
||||
|
||||
<resultMap type="SysRole" id="SysRoleResult">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="roleSort" column="role_sort" />
|
||||
<result property="dataScope" column="data_scope" />
|
||||
<result property="menuCheckStrictly" column="menu_check_strictly" />
|
||||
<result property="deptCheckStrictly" column="dept_check_strictly" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<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="selectRoleVo">
|
||||
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
|
||||
r.status, r.del_flag, r.create_time, r.remark
|
||||
from system_role r
|
||||
left join system_user_role ur on ur.role_id = r.role_id
|
||||
left join system_user u on u.user_id = ur.user_id
|
||||
left join system_dept d on u.dept_id = d.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.del_flag = '0'
|
||||
<if test="roleId != null and roleId != 0">
|
||||
AND r.role_id = #{roleId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND r.status = #{status}
|
||||
</if>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="roleName != null and roleName != ''">
|
||||
AND r.role_name LIKE '%' || #{roleName} || '%'
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
AND r.role_key LIKE '%' || #{roleKey} || '%'
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND r.create_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND r.create_time <= #{params.endTime}
|
||||
</if>
|
||||
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
AND r.role_name like concat('%', #{roleName}, '%')
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
AND r.role_key like concat('%', #{roleKey}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by r.role_sort
|
||||
</select>
|
||||
|
||||
<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
WHERE r.del_flag = '0' and ur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectRoleAll" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectRoleListByUserId" parameterType="Long" resultType="Long">
|
||||
select r.role_id
|
||||
from system_role r
|
||||
left join system_user_role ur on ur.role_id = r.role_id
|
||||
left join system_user u on u.user_id = ur.user_id
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
WHERE r.del_flag = '0' and u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
insert into system_role(
|
||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||
<if test="roleKey != null and roleKey != ''">role_key,</if>
|
||||
<if test="roleSort != null">role_sort,</if>
|
||||
<if test="dataScope != null and dataScope != ''">data_scope,</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly,</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly,</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="roleId != null and roleId != 0">#{roleId},</if>
|
||||
<if test="roleName != null and roleName != ''">#{roleName},</if>
|
||||
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
|
||||
<if test="roleSort != null">#{roleSort},</if>
|
||||
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">#{deptCheckStrictly},</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="updateRole" parameterType="SysRole">
|
||||
update system_role
|
||||
<set>
|
||||
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
|
||||
<if test="roleSort != null">role_sort = #{roleSort},</if>
|
||||
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where role_id = #{roleId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRoleById" parameterType="Long">
|
||||
update system_role set del_flag = '2' where role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRoleByIds" parameterType="Long">
|
||||
update system_role set del_flag = '2' where role_id in
|
||||
<foreach collection="array" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysRoleMenuMapper">
|
||||
|
||||
<resultMap type="SysRoleMenu" id="SysRoleMenuResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
</resultMap>
|
||||
|
||||
<select id="checkMenuExistRole" resultType="Integer">
|
||||
select count(1) from system_role_menu where menu_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleMenuByRoleId" parameterType="Long">
|
||||
delete from system_role_menu where role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRoleMenu" parameterType="Long">
|
||||
delete from system_role_menu where role_id in
|
||||
<foreach collection="array" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchRoleMenu">
|
||||
insert into system_role_menu(role_id, menu_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.roleId},#{item.menuId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
+400
@@ -0,0 +1,400 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysUserMapper">
|
||||
|
||||
<resultMap type="SysUser" id="SysUserResult">
|
||||
<id property="userId" column="user_id" />
|
||||
<id property="authId" column="auth_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="email" column="email" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="avatar" column="avatar" />
|
||||
<result property="password" column="password" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="loginIp" column="login_ip" />
|
||||
<result property="loginDate" column="login_date" />
|
||||
<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" />
|
||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="deptResult" type="SysDept">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="status" column="dept_status" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="RoleResult" type="SysRole">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="roleSort" column="role_sort" />
|
||||
<result property="dataScope" column="data_scope" />
|
||||
<result property="status" column="role_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
||||
from system_user u
|
||||
left join system_dept d on u.dept_id = d.dept_id
|
||||
left join system_user_role ur on u.user_id = ur.user_id
|
||||
left join system_role r on r.role_id = ur.role_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from system_user u
|
||||
left join system_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
AND u.user_id = #{userId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name LIKE '%' || #{userName} || '%'
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber LIKE '%' || #{phonenumber} || '%'
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''">
|
||||
<!-- 开始时间检索 -->
|
||||
AND u.create_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''">
|
||||
<!-- 结束时间检索 -->
|
||||
AND u.create_time <= #{params.endTime}
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId}
|
||||
OR u.dept_id IN (
|
||||
SELECT t.dept_id
|
||||
FROM system_dept t
|
||||
WHERE position(#{deptId}::text in t.ancestors) > 0
|
||||
))
|
||||
</if>
|
||||
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM system_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUserAllList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag,
|
||||
u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader , u.auth_id
|
||||
from system_user u
|
||||
left join system_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<choose>
|
||||
<!-- 如果数据库是 kingBase -->
|
||||
<when test="@tech.qiantong.qmodel.mybatis.config.MasterDataSourceConfig@getDatabaseType() == 'kingbase8'">
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name LIKE '%' || #{userName} || '%'
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber LIKE '%' || #{phonenumber} || '%'
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''">
|
||||
<!-- 开始时间检索 -->
|
||||
AND u.create_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''">
|
||||
<!-- 结束时间检索 -->
|
||||
AND u.create_time <= #{params.endTime}
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId}
|
||||
OR u.dept_id IN (
|
||||
SELECT t.dept_id
|
||||
FROM system_dept t
|
||||
WHERE position(#{deptId}::text in t.ancestors) > 0
|
||||
))
|
||||
</if>
|
||||
|
||||
</when>
|
||||
|
||||
<!-- 如果是其他数据库(如 MySQL、 DM) -->
|
||||
<otherwise>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM system_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from system_user u
|
||||
left join system_dept d on u.dept_id = d.dept_id
|
||||
left join system_user_role ur on u.user_id = ur.user_id
|
||||
left join system_role r on r.role_id = ur.role_id
|
||||
where u.del_flag = '0' and r.role_id = #{roleId}
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from system_user u
|
||||
left join system_dept d on u.dept_id = d.dept_id
|
||||
left join system_user_role ur on u.user_id = ur.user_id
|
||||
left join system_role r on r.role_id = ur.role_id
|
||||
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
|
||||
and u.user_id not in (select u.user_id from system_user u inner join system_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_name = #{userName} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, user_name from system_user where user_name = #{userName} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, phonenumber from system_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, email from system_user where email = #{email} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectUserListByDeptId" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from system_user u
|
||||
left join system_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
AND u.user_id = #{userId}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="nickName != null and nickName != ''">
|
||||
AND u.nick_name like concat('%', #{nickName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="deptId != null">
|
||||
AND (u.dept_id = #{deptId})
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="queryUserIdListByRoleIdListAndDeptIdList" resultType="java.lang.Long">
|
||||
select a.user_id from system_user a INNER JOIN system_user_role b on b.user_id=a.user_id
|
||||
where a.del_flag=0
|
||||
<if test="deptIdSet != null and deptIdSet.size() > 0">
|
||||
and a.dept_id in
|
||||
<foreach collection="deptIdSet" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="roleIdSet != null and roleIdSet.size() > 0">
|
||||
and b.role_id in
|
||||
<foreach collection="roleIdSet" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectUserListByNameOrPhone" parameterType="string" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from system_user u
|
||||
left join system_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0' AND u.status = '0' AND ( u.user_name = #{str} or u.phonenumber = #{str})
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into system_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="authId != null and authId != ''">auth_id,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||
<if test="sex != null and sex != ''">sex,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
<if test="authId != null and authId != ''">#{authId},</if>
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">#{sex},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
update system_user
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
<if test="authId != null and authId != ''">auth_id = #{authId},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="email != null ">email = #{email},</if>
|
||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserStatus" parameterType="SysUser">
|
||||
update system_user set status = #{status} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserAvatar" parameterType="SysUser">
|
||||
update system_user set avatar = #{avatar} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<update id="resetUserPwd" parameterType="SysUser">
|
||||
update system_user set password = #{password} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserById" parameterType="Long">
|
||||
update system_user set del_flag = '2' where user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserByIds" parameterType="Long">
|
||||
update system_user set del_flag = '2' where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysUserPostMapper">
|
||||
|
||||
<resultMap type="SysUserPost" id="SysUserPostResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="postId" column="post_id" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteUserPostByUserId" parameterType="Long">
|
||||
delete from system_user_post where user_id=#{userId}
|
||||
</delete>
|
||||
|
||||
<select id="countUserPostById" resultType="Integer">
|
||||
select count(1) from system_user_post where post_id=#{postId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteUserPost" parameterType="Long">
|
||||
delete from system_user_post where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchUserPost">
|
||||
insert into system_user_post(user_id, post_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.userId},#{item.postId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright © 2026 Qiantong Technology Co., Ltd.
|
||||
qModel Model Platform(Open Source Edition)
|
||||
*
|
||||
License:
|
||||
Released under the Apache License, Version 2.0.
|
||||
You may use, modify, and distribute this software for commercial purposes
|
||||
under the terms of the License.
|
||||
*
|
||||
Special Notice:
|
||||
All derivative versions are strictly prohibited from modifying or removing
|
||||
the default system logo and copyright information.
|
||||
For brand customization, please apply for brand customization authorization via official channels.
|
||||
*
|
||||
More information: https://qmodel.qiantong.tech/business.html
|
||||
*
|
||||
============================================================================
|
||||
*
|
||||
版权所有 © 2026 江苏千桐科技有限公司
|
||||
qModel 模型平台(开源版)
|
||||
*
|
||||
许可协议:
|
||||
本项目基于 Apache License 2.0 开源协议发布,
|
||||
允许在遵守协议的前提下进行商用、修改和分发。
|
||||
*
|
||||
特别说明:
|
||||
所有衍生版本不得修改或移除系统默认的 LOGO 和版权信息;
|
||||
如需定制品牌,请通过官方渠道申请品牌定制授权。
|
||||
*
|
||||
更多信息请访问:https://qmodel.qiantong.tech/business.html
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.qiantong.qmodel.module.system.mapper.SysUserRoleMapper">
|
||||
|
||||
<resultMap type="SysUserRole" id="SysUserRoleResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="roleId" column="role_id" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteUserRoleByUserId" parameterType="Long">
|
||||
delete from system_user_role where user_id=#{userId}
|
||||
</delete>
|
||||
|
||||
<select id="countUserRoleByRoleId" resultType="Integer">
|
||||
select count(1) from system_user_role where role_id=#{roleId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteUserRole" parameterType="Long">
|
||||
delete from system_user_role where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchUserRole">
|
||||
insert into system_user_role(user_id, role_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.userId},#{item.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
|
||||
delete from system_user_role where user_id=#{userId} and role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserRoleInfos">
|
||||
delete from system_user_role where role_id=#{roleId} and user_id in
|
||||
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user