master
wxy 2024-05-24 14:46:48 +08:00
parent 60d5e46746
commit 103cf2df92
10 changed files with 872 additions and 0 deletions

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="public" />
<option name="name" value="aliyun nexus" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

View File

@ -0,0 +1,182 @@
package com.jing.job.util;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.LinkedList;
import java.util.List;
import com.jing.common.core.utils.SpringUtils;
import com.jing.common.core.utils.StringUtils;
import com.jing.job.domain.SysJob;
/**
*
*
* @author ruoyi
*/
public class JobInvokeUtil
{
/**
*
*
* @param sysJob
*/
public static void invokeMethod(SysJob sysJob) throws Exception
{
String invokeTarget = sysJob.getInvokeTarget();
String beanName = getBeanName(invokeTarget);
String methodName = getMethodName(invokeTarget);
List<Object[]> methodParams = getMethodParams(invokeTarget);
if (!isValidClassName(beanName))
{
Object bean = SpringUtils.getBean(beanName);
invokeMethod(bean, methodName, methodParams);
}
else
{
Object bean = Class.forName(beanName).getDeclaredConstructor().newInstance();
invokeMethod(bean, methodName, methodParams);
}
}
/**
*
*
* @param bean
* @param methodName
* @param methodParams
*/
private static void invokeMethod(Object bean, String methodName, List<Object[]> methodParams)
throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException,
InvocationTargetException
{
if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0)
{
Method method = bean.getClass().getMethod(methodName, getMethodParamsType(methodParams));
method.invoke(bean, getMethodParamsValue(methodParams));
}
else
{
Method method = bean.getClass().getMethod(methodName);
method.invoke(bean);
}
}
/**
* class
*
* @param invokeTarget
* @return true false
*/
public static boolean isValidClassName(String invokeTarget)
{
return StringUtils.countMatches(invokeTarget, ".") > 1;
}
/**
* bean
*
* @param invokeTarget
* @return bean
*/
public static String getBeanName(String invokeTarget)
{
String beanName = StringUtils.substringBefore(invokeTarget, "(");
return StringUtils.substringBeforeLast(beanName, ".");
}
/**
* bean
*
* @param invokeTarget
* @return method
*/
public static String getMethodName(String invokeTarget)
{
String methodName = StringUtils.substringBefore(invokeTarget, "(");
return StringUtils.substringAfterLast(methodName, ".");
}
/**
* method
*
* @param invokeTarget
* @return method
*/
public static List<Object[]> getMethodParams(String invokeTarget)
{
String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")");
if (StringUtils.isEmpty(methodStr))
{
return null;
}
String[] methodParams = methodStr.split(",(?=([^\"']*[\"'][^\"']*[\"'])*[^\"']*$)");
List<Object[]> classs = new LinkedList<>();
for (int i = 0; i < methodParams.length; i++)
{
String str = StringUtils.trimToEmpty(methodParams[i]);
// String字符串类型以'或"开头
if (StringUtils.startsWithAny(str, "'", "\""))
{
classs.add(new Object[] { StringUtils.substring(str, 1, str.length() - 1), String.class });
}
// boolean布尔类型等于true或者false
else if ("true".equalsIgnoreCase(str) || "false".equalsIgnoreCase(str))
{
classs.add(new Object[] { Boolean.valueOf(str), Boolean.class });
}
// long长整形以L结尾
else if (StringUtils.endsWith(str, "L"))
{
classs.add(new Object[] { Long.valueOf(StringUtils.substring(str, 0, str.length() - 1)), Long.class });
}
// double浮点类型以D结尾
else if (StringUtils.endsWith(str, "D"))
{
classs.add(new Object[] { Double.valueOf(StringUtils.substring(str, 0, str.length() - 1)), Double.class });
}
// 其他类型归类为整形
else
{
classs.add(new Object[] { Integer.valueOf(str), Integer.class });
}
}
return classs;
}
/**
*
*
* @param methodParams
* @return
*/
public static Class<?>[] getMethodParamsType(List<Object[]> methodParams)
{
Class<?>[] classs = new Class<?>[methodParams.size()];
int index = 0;
for (Object[] os : methodParams)
{
classs[index] = (Class<?>) os[1];
index++;
}
return classs;
}
/**
*
*
* @param methodParams
* @return
*/
public static Object[] getMethodParamsValue(List<Object[]> methodParams)
{
Object[] classs = new Object[methodParams.size()];
int index = 0;
for (Object[] os : methodParams)
{
classs[index] = (Object) os[0];
index++;
}
return classs;
}
}

View File

@ -0,0 +1,34 @@
package com.jing.product;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.jing.common.security.annotation.EnableCustomConfig;
import com.jing.common.security.annotation.EnableRyFeignClients;
import com.jing.common.swagger.annotation.EnableCustomSwagger2;
/**
*
*
* @author ruoyi
*/
@EnableCustomConfig
@EnableCustomSwagger2
@EnableRyFeignClients
@SpringBootApplication
public class JingProductApplication
{
public static void main(String[] args)
{
SpringApplication.run(JingProductApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 商品模块启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}

View File

@ -0,0 +1,99 @@
package com.jing.system.service;
import java.util.List;
import com.jing.system.domain.SysPost;
/**
*
*
* @author ruoyi
*/
public interface ISysPostService
{
/**
*
*
* @param post
* @return
*/
public List<SysPost> selectPostList(SysPost post);
/**
*
*
* @return
*/
public List<SysPost> selectPostAll();
/**
* ID
*
* @param postId ID
* @return
*/
public SysPost selectPostById(Long postId);
/**
* ID
*
* @param userId ID
* @return ID
*/
public List<Long> selectPostListByUserId(Long userId);
/**
*
*
* @param post
* @return
*/
public boolean checkPostNameUnique(SysPost post);
/**
*
*
* @param post
* @return
*/
public boolean checkPostCodeUnique(SysPost post);
/**
* ID使
*
* @param postId ID
* @return
*/
public int countUserPostById(Long postId);
/**
*
*
* @param postId ID
* @return
*/
public int deletePostById(Long postId);
/**
*
*
* @param postIds ID
* @return
*/
public int deletePostByIds(Long[] postIds);
/**
*
*
* @param post
* @return
*/
public int insertPost(SysPost post);
/**
*
*
* @param post
* @return
*/
public int updatePost(SysPost post);
}

View File

@ -0,0 +1,173 @@
package com.jing.system.service;
import java.util.List;
import java.util.Set;
import com.jing.system.api.domain.SysRole;
import com.jing.system.domain.SysUserRole;
/**
*
*
* @author ruoyi
*/
public interface ISysRoleService
{
/**
*
*
* @param role
* @return
*/
public List<SysRole> selectRoleList(SysRole role);
/**
* ID
*
* @param userId ID
* @return
*/
public List<SysRole> selectRolesByUserId(Long userId);
/**
* ID
*
* @param userId ID
* @return
*/
public Set<String> selectRolePermissionByUserId(Long userId);
/**
*
*
* @return
*/
public List<SysRole> selectRoleAll();
/**
* ID
*
* @param userId ID
* @return ID
*/
public List<Long> selectRoleListByUserId(Long userId);
/**
* ID
*
* @param roleId ID
* @return
*/
public SysRole selectRoleById(Long roleId);
/**
*
*
* @param role
* @return
*/
public boolean checkRoleNameUnique(SysRole role);
/**
*
*
* @param role
* @return
*/
public boolean checkRoleKeyUnique(SysRole role);
/**
*
*
* @param role
*/
public void checkRoleAllowed(SysRole role);
/**
*
*
* @param roleId id
*/
public void checkRoleDataScope(Long roleId);
/**
* ID使
*
* @param roleId ID
* @return
*/
public int countUserRoleByRoleId(Long roleId);
/**
*
*
* @param role
* @return
*/
public int insertRole(SysRole role);
/**
*
*
* @param role
* @return
*/
public int updateRole(SysRole role);
/**
*
*
* @param role
* @return
*/
public int updateRoleStatus(SysRole role);
/**
*
*
* @param role
* @return
*/
public int authDataScope(SysRole role);
/**
* ID
*
* @param roleId ID
* @return
*/
public int deleteRoleById(Long roleId);
/**
*
*
* @param roleIds ID
* @return
*/
public int deleteRoleByIds(Long[] roleIds);
/**
*
*
* @param userRole
* @return
*/
public int deleteAuthUser(SysUserRole userRole);
/**
*
*
* @param roleId ID
* @param userIds ID
* @return
*/
public int deleteAuthUsers(Long roleId, Long[] userIds);
/**
*
*
* @param roleId ID
* @param userIds ID
* @return
*/
public int insertAuthUsers(Long roleId, Long[] userIds);
}

View File

@ -0,0 +1,48 @@
package com.jing.system.service;
import com.jing.system.api.model.LoginUser;
import com.jing.system.domain.SysUserOnline;
/**
* 线
*
* @author ruoyi
*/
public interface ISysUserOnlineService
{
/**
*
*
* @param ipaddr
* @param user
* @return 线
*/
public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user);
/**
*
*
* @param userName
* @param user
* @return 线
*/
public SysUserOnline selectOnlineByUserName(String userName, LoginUser user);
/**
* /
*
* @param ipaddr
* @param userName
* @param user
* @return 线
*/
public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user);
/**
* 线
*
* @param user
* @return 线
*/
public SysUserOnline loginUserToUserOnline(LoginUser user);
}

View File

@ -0,0 +1,206 @@
package com.jing.system.service;
import java.util.List;
import com.jing.system.api.domain.SysUser;
/**
*
*
* @author ruoyi
*/
public interface ISysUserService
{
/**
*
*
* @param user
* @return
*/
public List<SysUser> selectUserList(SysUser user);
/**
*
*
* @param user
* @return
*/
public List<SysUser> selectAllocatedList(SysUser user);
/**
*
*
* @param user
* @return
*/
public List<SysUser> selectUnallocatedList(SysUser user);
/**
*
*
* @param userName
* @return
*/
public SysUser selectUserByUserName(String userName);
/**
* ID
*
* @param userId ID
* @return
*/
public SysUser selectUserById(Long userId);
/**
* ID
*
* @param userName
* @return
*/
public String selectUserRoleGroup(String userName);
/**
* ID
*
* @param userName
* @return
*/
public String selectUserPostGroup(String userName);
/**
*
*
* @param user
* @return
*/
public boolean checkUserNameUnique(SysUser user);
/**
*
*
* @param user
* @return
*/
public boolean checkPhoneUnique(SysUser user);
/**
* email
*
* @param user
* @return
*/
public boolean checkEmailUnique(SysUser user);
/**
*
*
* @param user
*/
public void checkUserAllowed(SysUser user);
/**
*
*
* @param userId id
*/
public void checkUserDataScope(Long userId);
/**
*
*
* @param user
* @return
*/
public int insertUser(SysUser user);
/**
*
*
* @param user
* @return
*/
public boolean registerUser(SysUser user);
/**
*
*
* @param user
* @return
*/
public int updateUser(SysUser user);
/**
*
*
* @param userId ID
* @param roleIds
*/
public void insertUserAuth(Long userId, Long[] roleIds);
/**
*
*
* @param user
* @return
*/
public int updateUserStatus(SysUser user);
/**
*
*
* @param user
* @return
*/
public int updateUserProfile(SysUser user);
/**
*
*
* @param userName
* @param avatar
* @return
*/
public boolean updateUserAvatar(String userName, String avatar);
/**
*
*
* @param user
* @return
*/
public int resetPwd(SysUser user);
/**
*
*
* @param userName
* @param password
* @return
*/
public int resetUserPwd(String userName, String password);
/**
* ID
*
* @param userId ID
* @return
*/
public int deleteUserById(Long userId);
/**
*
*
* @param userIds ID
* @return
*/
public int deleteUserByIds(Long[] userIds);
/**
*
*
* @param userList
* @param isUpdateSupport
* @param operName
* @return
*/
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
}

View File

@ -0,0 +1,71 @@
import request from '@/utils/request'
// 查询定时任务调度列表
export function listJob(query) {
return request({
url: '/schedule/job/list',
method: 'get',
params: query
})
}
// 查询定时任务调度详细
export function getJob(jobId) {
return request({
url: '/schedule/job/' + jobId,
method: 'get'
})
}
// 新增定时任务调度
export function addJob(data) {
return request({
url: '/schedule/job',
method: 'post',
data: data
})
}
// 修改定时任务调度
export function updateJob(data) {
return request({
url: '/schedule/job',
method: 'put',
data: data
})
}
// 删除定时任务调度
export function delJob(jobId) {
return request({
url: '/schedule/job/' + jobId,
method: 'delete'
})
}
// 任务状态修改
export function changeJobStatus(jobId, status) {
const data = {
jobId,
status
}
return request({
url: '/schedule/job/changeStatus',
method: 'put',
data: data
})
}
// 定时任务立即执行一次
export function runJob(jobId, jobGroup) {
const data = {
jobId,
jobGroup
}
return request({
url: '/schedule/job/run',
method: 'put',
data: data
})
}

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566036191400" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5472" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M934.912 1016.832H192c-14.336 0-25.6-11.264-25.6-25.6v-189.44c0-14.336 11.264-25.6 25.6-25.6s25.6 11.264 25.6 25.6v163.84h691.712V64H217.6v148.48c0 14.336-11.264 25.6-25.6 25.6s-25.6-11.264-25.6-25.6v-174.08c0-14.336 11.264-25.6 25.6-25.6h742.912c14.336 0 25.6 11.264 25.6 25.6v952.832c0 14.336-11.264 25.6-25.6 25.6z" p-id="5473"></path><path d="M232.96 371.2h-117.76c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h117.76c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM232.96 540.16h-117.76c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h117.76c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM232.96 698.88h-117.76c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h117.76c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM574.464 762.88c-134.144 0-243.2-109.056-243.2-243.2S440.32 276.48 574.464 276.48s243.2 109.056 243.2 243.2-109.056 243.2-243.2 243.2z m0-435.2c-105.984 0-192 86.016-192 192S468.48 711.68 574.464 711.68s192-86.016 192-192S680.448 327.68 574.464 327.68z" p-id="5474"></path><path d="M663.04 545.28h-87.04c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h87.04c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6z" p-id="5475"></path><path d="M576 545.28c-14.336 0-25.6-11.264-25.6-25.6v-87.04c0-14.336 11.264-25.6 25.6-25.6s25.6 11.264 25.6 25.6v87.04c0 14.336-11.264 25.6-25.6 25.6z" p-id="5476"></path></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,33 @@
<script>
export default {
name: 'MenuItem',
functional: true,
props: {
icon: {
type: String,
default: ''
},
title: {
type: String,
default: ''
}
},
render(h, context) {
const { icon, title } = context.props
const vnodes = []
if (icon) {
vnodes.push(<svg-icon icon-class={icon}/>)
}
if (title) {
if (title.length > 5) {
vnodes.push(<span slot='title' title={(title)}>{(title)}</span>)
} else {
vnodes.push(<span slot='title'>{(title)}</span>)
}
}
return vnodes
}
}
</script>