diff --git a/bin/mac-modules-job b/bin/mac-modules-job index b14bcb55..00c74aa9 100755 --- a/bin/mac-modules-job +++ b/bin/mac-modules-job @@ -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 diff --git a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/domain/SysApplyConfig.java b/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/domain/SysApplyConfig.java deleted file mode 100644 index 813a99e5..00000000 --- a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/domain/SysApplyConfig.java +++ /dev/null @@ -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(); - } -} diff --git a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/mapper/SysApplyConfigMapper.java b/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/mapper/SysApplyConfigMapper.java deleted file mode 100644 index bcc02a24..00000000 --- a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/mapper/SysApplyConfigMapper.java +++ /dev/null @@ -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 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); -} diff --git a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/ISysApplyConfigService.java b/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/ISysApplyConfigService.java deleted file mode 100644 index 76f67736..00000000 --- a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/ISysApplyConfigService.java +++ /dev/null @@ -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 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(); -} diff --git a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/impl/SysApplyConfigServiceImpl.java b/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/impl/SysApplyConfigServiceImpl.java deleted file mode 100644 index 7fe1b15d..00000000 --- a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/impl/SysApplyConfigServiceImpl.java +++ /dev/null @@ -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 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 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; - } -} diff --git a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/SysApplyConfigMapper.xml b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/SysApplyConfigMapper.xml deleted file mode 100644 index 76043900..00000000 --- a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/SysApplyConfigMapper.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - - - - insert into sys_apply_config - - id, - cfg_type, - cfg_id, - app_id, - public_key, - private_key, - project_id, - dept_id, - is_del, - create_by, - create_time, - update_by, - update_time, - remark, - - - #{id}, - #{cfgType}, - #{cfgId}, - #{appId}, - #{publicKey}, - #{privateKey}, - #{projectId}, - #{deptId}, - #{isDel}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - #{remark}, - - - - - update sys_apply_config - - cfg_type = #{cfgType}, - cfg_id = #{cfgId}, - app_id = #{appId}, - public_key = #{publicKey}, - private_key = #{privateKey}, - project_id = #{projectId}, - dept_id = #{deptId}, - is_del = #{isDel}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - remark = #{remark}, - - where id = #{id} - - - - delete from sys_apply_config where id = #{id} - - - - delete from sys_apply_config where id in - - #{id} - - - - \ No newline at end of file