修改JOB项目
parent
d54b63a42f
commit
3abf9dd40e
|
@ -1 +1 @@
|
|||
java -Dfile.encoding=utf-8 -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -jar ruoyi-modules/ruoyi-job/target/yanzhu-modules-job.jar
|
||||
java -Dfile.encoding=utf-8 -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -jar yanzhu-modules/yanzhu-job/target/yanzhu-modules-job.jar
|
||||
|
|
|
@ -1,173 +0,0 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 系统应用注册对象 sys_apply_config
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-01-13
|
||||
*/
|
||||
public class SysApplyConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 服务配置主键 */
|
||||
private Long cfgId;
|
||||
|
||||
/** 服务配置类型 */
|
||||
private String cfgType;
|
||||
|
||||
/** 应用主键 */
|
||||
@Excel(name = "应用主键")
|
||||
private String appId;
|
||||
|
||||
/** 公钥 */
|
||||
private String publicKey;
|
||||
|
||||
/** 私钥 */
|
||||
private String privateKey;
|
||||
|
||||
/** 项目主键 */
|
||||
@Excel(name = "项目主键")
|
||||
private Long projectId;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/** 部门主键 */
|
||||
@Excel(name = "部门主键")
|
||||
private Long deptId;
|
||||
|
||||
/** 部门名称 */
|
||||
@Excel(name = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
private String isDel;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setAppId(String appId)
|
||||
{
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public String getAppId()
|
||||
{
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setPublicKey(String publicKey)
|
||||
{
|
||||
this.publicKey = publicKey;
|
||||
}
|
||||
|
||||
public String getPublicKey()
|
||||
{
|
||||
return publicKey;
|
||||
}
|
||||
public void setPrivateKey(String privateKey)
|
||||
{
|
||||
this.privateKey = privateKey;
|
||||
}
|
||||
|
||||
public String getPrivateKey()
|
||||
{
|
||||
return privateKey;
|
||||
}
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setIsDel(String isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public String getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public Long getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
|
||||
public void setCfgId(Long cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
|
||||
public String getCfgType() {
|
||||
return cfgType;
|
||||
}
|
||||
|
||||
public void setCfgType(String cfgType) {
|
||||
this.cfgType = cfgType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("cfgId", getCfgId())
|
||||
.append("cfgType", getCfgType())
|
||||
.append("appId", getAppId())
|
||||
.append("publicKey", getPublicKey())
|
||||
.append("privateKey", getPrivateKey())
|
||||
.append("projectId", getProjectId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package com.yanzhu.job.mapper;
|
||||
|
||||
import com.yanzhu.job.domain.SysApplyConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统应用注册Mapper接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-01-13
|
||||
*/
|
||||
public interface SysApplyConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询系统应用注册
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 系统应用注册
|
||||
*/
|
||||
public SysApplyConfig selectSysApplyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询系统应用注册列表
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 系统应用注册集合
|
||||
*/
|
||||
public List<SysApplyConfig> selectSysApplyConfigList(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 新增系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysApplyConfig(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 修改系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysApplyConfig(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 删除系统应用注册
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysApplyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除系统应用注册
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysApplyConfigByIds(Long[] ids);
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package com.yanzhu.job.service;
|
||||
|
||||
import com.yanzhu.job.domain.SysApplyConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统应用注册Service接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-01-13
|
||||
*/
|
||||
public interface ISysApplyConfigService
|
||||
{
|
||||
/**
|
||||
* 查询系统应用注册
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 系统应用注册
|
||||
*/
|
||||
public SysApplyConfig selectSysApplyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询系统应用注册列表
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 系统应用注册集合
|
||||
*/
|
||||
public List<SysApplyConfig> selectSysApplyConfigList(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 新增系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysApplyConfig(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 修改系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysApplyConfig(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 批量删除系统应用注册
|
||||
*
|
||||
* @param ids 需要删除的系统应用注册主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysApplyConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除系统应用注册信息
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysApplyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 加载注册应用
|
||||
*/
|
||||
public void loadingSysApplyConfigCache();
|
||||
}
|
|
@ -1,161 +0,0 @@
|
|||
package com.yanzhu.job.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.constant.CacheConstants;
|
||||
import com.yanzhu.common.core.exception.ServiceException;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.RSAUtil;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.SysApplyConfig;
|
||||
import com.yanzhu.job.mapper.SysApplyConfigMapper;
|
||||
import com.yanzhu.job.service.ISysApplyConfigService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.security.KeyPair;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统应用注册Service业务层处理
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-01-13
|
||||
*/
|
||||
@Service
|
||||
public class SysApplyConfigServiceImpl implements ISysApplyConfigService
|
||||
{
|
||||
@Autowired
|
||||
private RedisService redisCache;
|
||||
|
||||
@Autowired
|
||||
private SysApplyConfigMapper sysApplyConfigMapper;
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化注册应用到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init()
|
||||
{
|
||||
loadingSysApplyConfigCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载注册应用
|
||||
*/
|
||||
@Override
|
||||
public void loadingSysApplyConfigCache()
|
||||
{
|
||||
List<SysApplyConfig> configList = sysApplyConfigMapper.selectSysApplyConfigList(new SysApplyConfig());
|
||||
if(CollectionUtils.isNotEmpty(configList)){
|
||||
for (SysApplyConfig sysApplyConfig : configList) {
|
||||
redisCache.setCacheObject(CacheConstants.YANZHU_SYSTEM_CONFIG + sysApplyConfig.getAppId(), sysApplyConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统应用注册
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 系统应用注册
|
||||
*/
|
||||
@Override
|
||||
public SysApplyConfig selectSysApplyConfigById(Long id)
|
||||
{
|
||||
return sysApplyConfigMapper.selectSysApplyConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统应用注册列表
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 系统应用注册
|
||||
*/
|
||||
@Override
|
||||
public List<SysApplyConfig> selectSysApplyConfigList(SysApplyConfig sysApplyConfig)
|
||||
{
|
||||
return sysApplyConfigMapper.selectSysApplyConfigList(sysApplyConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysApplyConfig(SysApplyConfig sysApplyConfig)
|
||||
{
|
||||
sysApplyConfig.setCreateBy(SecurityUtils.getUsername());
|
||||
sysApplyConfig.setCreateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
// 生成密钥对
|
||||
KeyPair keyPair = RSAUtil.getKeyPair();
|
||||
// 公匙
|
||||
String publicKey = RSAUtil.getPublicKeyBase64(keyPair);
|
||||
sysApplyConfig.setPublicKey(publicKey);
|
||||
// 私匙
|
||||
String privateKey = RSAUtil.getPrivateKeyBase64(keyPair);
|
||||
sysApplyConfig.setPrivateKey(privateKey);
|
||||
}catch (Exception e){
|
||||
throw new ServiceException();
|
||||
}
|
||||
int res = sysApplyConfigMapper.insertSysApplyConfig(sysApplyConfig);
|
||||
if(res>0){
|
||||
this.loadingSysApplyConfigCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysApplyConfig(SysApplyConfig sysApplyConfig)
|
||||
{
|
||||
sysApplyConfig.setUpdateBy(SecurityUtils.getUsername());
|
||||
sysApplyConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
int res = sysApplyConfigMapper.updateSysApplyConfig(sysApplyConfig);
|
||||
if(res>0){
|
||||
this.loadingSysApplyConfigCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除系统应用注册
|
||||
*
|
||||
* @param ids 需要删除的系统应用注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysApplyConfigByIds(Long[] ids)
|
||||
{
|
||||
int res = sysApplyConfigMapper.deleteSysApplyConfigByIds(ids);
|
||||
if(res>0){
|
||||
this.loadingSysApplyConfigCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统应用注册信息
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysApplyConfigById(Long id)
|
||||
{
|
||||
int res = sysApplyConfigMapper.deleteSysApplyConfigById(id);
|
||||
if(res>0){
|
||||
this.loadingSysApplyConfigCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.job.mapper.SysApplyConfigMapper">
|
||||
|
||||
<resultMap type="com.yanzhu.job.domain.SysApplyConfig" id="SysApplyConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgType" column="cfg_type" />
|
||||
<result property="cfgId" column="cfg_id" />
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="publicKey" column="public_key" />
|
||||
<result property="privateKey" column="private_key" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="projectName" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="deptName" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<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="selectSysApplyConfigVo">
|
||||
select sac.id, sac.cfg_type, sac.cfg_id, sac.app_id, sac.public_key, sac.private_key, sac.project_id, sp.project_name, sac.dept_id, sd.dept_name as deptName, sac.is_del, sac.create_by, sac.create_time, sac.update_by, sac.update_time, sac.remark from sys_apply_config sac
|
||||
left join pro_project_info sp on sac.project_id = sp.id
|
||||
left join sys_dept sd on sac.dept_id = sd.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSysApplyConfigList" parameterType="com.yanzhu.job.domain.SysApplyConfig" resultMap="SysApplyConfigResult">
|
||||
<include refid="selectSysApplyConfigVo"/>
|
||||
<where>
|
||||
<if test="cfgId != null "> and sac.cfg_id = #{cfgId}</if>
|
||||
<if test="cfgType != null "> and sac.cfg_type = #{cfgType}</if>
|
||||
<if test="appId != null "> and sac.app_id like concat('%', #{appId}, '%')</if>
|
||||
<if test="projectName != null "> and sp.project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="deptName != null "> and sd.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="isDel != null and isDel != ''"> and sac.is_del = #{isDel}</if>
|
||||
</where>
|
||||
order by sac.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysApplyConfigById" parameterType="Long" resultMap="SysApplyConfigResult">
|
||||
<include refid="selectSysApplyConfigVo"/>
|
||||
where sac.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysApplyConfig" parameterType="com.yanzhu.job.domain.SysApplyConfig">
|
||||
insert into sys_apply_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="cfgType != null">cfg_type,</if>
|
||||
<if test="cfgId != null">cfg_id,</if>
|
||||
<if test="appId != null">app_id,</if>
|
||||
<if test="publicKey != null">public_key,</if>
|
||||
<if test="privateKey != null">private_key,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</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="id != null">#{id},</if>
|
||||
<if test="cfgType != null">#{cfgType},</if>
|
||||
<if test="cfgId != null">#{cfgId},</if>
|
||||
<if test="appId != null">#{appId},</if>
|
||||
<if test="publicKey != null">#{publicKey},</if>
|
||||
<if test="privateKey != null">#{privateKey},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</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="updateSysApplyConfig" parameterType="com.yanzhu.job.domain.SysApplyConfig">
|
||||
update sys_apply_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cfgType != null">cfg_type = #{cfgType},</if>
|
||||
<if test="cfgId != null">cfg_id = #{cfgId},</if>
|
||||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="publicKey != null">public_key = #{publicKey},</if>
|
||||
<if test="privateKey != null">private_key = #{privateKey},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</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="deleteSysApplyConfigById" parameterType="Long">
|
||||
delete from sys_apply_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysApplyConfigByIds" parameterType="String">
|
||||
delete from sys_apply_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue