Commit 980d15e3 authored by liqin's avatar liqin 💬

bug fixed

parent 1b482ca7
...@@ -95,6 +95,11 @@ ...@@ -95,6 +95,11 @@
<artifactId>open-sdk-common</artifactId> <artifactId>open-sdk-common</artifactId>
<version>1.0.7-RELEASE</version> <version>1.0.7-RELEASE</version>
</dependency> </dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>1.9.2</version>
</dependency>
</dependencies> </dependencies>
<!-- MAVEN构建 --> <!-- MAVEN构建 -->
......
...@@ -17,14 +17,14 @@ public interface UserService { ...@@ -17,14 +17,14 @@ public interface UserService {
* @param userId 用户id * @param userId 用户id
* @return 用户信息 * @return 用户信息
*/ */
R<Integer> getById(String userId); R<User> getById(String userId);
/** /**
* 获取用户信息 * 获取用户信息
* @param userId 用户id * @param userId 用户id
* @return 用户信息 * @return 用户信息
*/ */
Integer getByUserId(String userId); R<User> getByUserId(String userId);
//根据手机号查询用户 //根据手机号查询用户
public User queryUsersByPhone(String id); public User queryUsersByPhone(String id);
......
...@@ -12,8 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -12,8 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.xml.transform.Result;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -36,24 +34,21 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U ...@@ -36,24 +34,21 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
private RecommendUserMapper recommendUserMapper; private RecommendUserMapper recommendUserMapper;
@Override @Override
public R<Integer> getById(String userId) { public R<User> getById(String userId) {
return R.ok(usersMapper.getByUserId(userId)); return R.ok(usersMapper.getByUserId(userId));
} }
@Override @Override
public Integer getByUserId(String userId) { public R<User> getByUserId(String userId) {
return usersMapper.getByUserId(userId); return R.ok(usersMapper.getByUserId(userId));
} }
@Override @Override
public User queryUsersByPhone(String phone) { public User queryUsersByPhone(String phone) {
Map<String,Object> param=new HashMap<String, Object>(); Map<String, Object> param = new HashMap<String, Object>();
param.put("phone",phone); param.put("phone", phone);
List<User> usersList=usersMapper.getUsersListByMap(param); List<User> usersList = usersMapper.getUsersListByMap(param);
if(!CollectionUtils.isEmpty(usersList)){ if (!CollectionUtils.isEmpty(usersList)) {
return usersList.get(0); return usersList.get(0);
} }
return null; return null;
...@@ -69,15 +64,13 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U ...@@ -69,15 +64,13 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
/** /**
* 判断用户等级是否为空,空的话填写0 * 判断用户等级是否为空,空的话填写0
*/ */
if(null==beInvitedCode || ""==beInvitedCode){ if (null == beInvitedCode || "".equals(beInvitedCode)) {
beInvitedCode= String.valueOf(1); beInvitedCode = String.valueOf(1);
} }
// 插入用户手机号与推荐人邀请码 //插入用户手机号与推荐人邀请码
usersMapper.insertbyint(userId,beInvitedCode); usersMapper.insertbyint(userId, beInvitedCode);
//根据插入的用户手机号,查询用户唯一ID
Integer yqm=usersMapper.getByUserId(userId);
//用户唯一ID调用生成6位邀请码 //用户唯一ID调用生成6位邀请码
String inviteCode= ShareCodeUtil.idToCode(yqm); String inviteCode = ShareCodeUtil.idToCode(usersMapper.getByUserId(userId).getId());
//根据用户手机号,更新用户信息 //根据用户手机号,更新用户信息
User user = new User(); User user = new User();
user.setInviteCode(inviteCode); user.setInviteCode(inviteCode);
...@@ -88,12 +81,12 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U ...@@ -88,12 +81,12 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
//插入用户团队表 //插入用户团队表
//根据邀请码查询推荐人的普通用户字段+1 //根据邀请码查询推荐人的普通用户字段+1
Integer a=recommendUserMapper.zcByUserId(userId); Integer a = recommendUserMapper.zcByUserId(userId);
if(null!=a && 0 != a){ if (null != a && 0 != a) {
return a;
} }
//根据邀请码递归所有团队成员普通用户+1 //根据邀请码递归所有团队成员普通用户+1
return null;
} }
} }
...@@ -53,7 +53,7 @@ public class UserController extends BaseController { ...@@ -53,7 +53,7 @@ public class UserController extends BaseController {
@ApiOperation(value = "获取用户信息", notes = "获取用户信息", httpMethod = "GET") @ApiOperation(value = "获取用户信息", notes = "获取用户信息", httpMethod = "GET")
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String") @ApiImplicitParam(name = "userId", value = "用户id", dataType = "String")
@GetMapping("/getByUserId") @GetMapping("/getByUserId")
public R<User> getByUserId(String userId){ public R<User> getByUserId(String userId) {
return userService.getById(userId); return userService.getById(userId);
} }
...@@ -68,12 +68,10 @@ public class UserController extends BaseController { ...@@ -68,12 +68,10 @@ public class UserController extends BaseController {
if (null == id) { if (null == id) {
return R.error("入参为空!"); return R.error("入参为空!");
} }
//用户信息 //用户信息
User user = userService.getByUserId(id); R<User> user = userService.getByUserId(id);
// 创建token // 创建token
String token = jwtUtil.generateToken(user); String token = jwtUtil.generateToken(user.getData());
// 保存Redis // 保存Redis
redisTemplate.opsForValue().set(RedisConsts.JWT_ACCESS_TOKEN + token, token); redisTemplate.opsForValue().set(RedisConsts.JWT_ACCESS_TOKEN + token, token);
return R.ok(token); return R.ok(token);
......
package cn.wisenergy.web.admin.controller.app; package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.utils.Constants;
import cn.wisenergy.web.sms.*; import cn.wisenergy.web.sms.*;
import cn.wisenergy.common.utils.RedisUtils; import cn.wisenergy.common.utils.RedisUtils;
import cn.wisenergy.common.utils.StringUtil; import cn.wisenergy.common.utils.StringUtil;
...@@ -84,7 +85,7 @@ public class loginController { ...@@ -84,7 +85,7 @@ public class loginController {
String tokenKey=StringUtil.formatKeyWithPrefix(Constants.RedisKey.PROJECT_PRIFIX,Constants.RedisKey.TOKEN_PRIFIX,token); String tokenKey=StringUtil.formatKeyWithPrefix(Constants.RedisKey.PROJECT_PRIFIX,Constants.RedisKey.TOKEN_PRIFIX,token);
UsersDto usersDto=new UsersDto(); UsersDto usersDto=new UsersDto();
BeanUtils.copyProperties(users,usersDto); BeanUtils.copyProperties(users,usersDto);
redisUtils.set(tokenKey, JSONObject.toJSONString(usersDto),Constants.Duration.HALF_HOUR_INT); redisUtils.set(tokenKey, JSONObject.toJSONString(usersDto), Constants.Duration.HALF_HOUR_INT);
return token; return token;
} }
......
### web ### web
server.port=8080 server.port=8090
server.servlet.context-path=/xxl-job-admin server.servlet.context-path=/job-admin
### actuator ### actuator
management.server.servlet.context-path=/actuator management.server.servlet.context-path=/actuator
...@@ -24,14 +24,14 @@ mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml ...@@ -24,14 +24,14 @@ mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
### xxl-job, datasource ### xxl-job, datasource
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
spring.datasource.username=root spring.datasource.username=qunzhihe
spring.datasource.password=root_pwd spring.datasource.password=j2kRn8HjrPez7trw
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
### datasource-pool ### datasource-pool
spring.datasource.type=com.zaxxer.hikari.HikariDataSource spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle=10 spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.maximum-pool-size=30 spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.auto-commit=true spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.idle-timeout=30000 spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.pool-name=HikariCP spring.datasource.hikari.pool-name=HikariCP
......
admin_name=Scheduling Center admin_name=Scheduling Center
admin_name_full=Distributed Task Scheduling Platform XXL-JOB admin_name_full=Distributed Task Scheduling Platform
admin_version=2.3.0 admin_version=2.3.0
admin_i18n=en admin_i18n=en
......
admin_name=任务调度中心 admin_name=任务调度中心
admin_name_full=分布式任务调度平台XXL-JOB admin_name_full=分布式任务调度平台
admin_version=2.3.0 admin_version=2.3.0
admin_i18n= admin_i18n=
......
admin_name=任務調度中心 admin_name=任務調度中心
admin_name_full=分布式任務調度平臺XXL-JOB admin_name_full=分布式任務調度平臺
admin_version=2.3.0 admin_version=2.3.0
admin_i18n= admin_i18n=
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<#macro commonHeader> <#macro commonHeader>
<header class="main-header"> <header class="main-header">
<a href="${request.contextPath}/" class="logo"> <a href="${request.contextPath}/" class="logo">
<span class="logo-mini"><b>XXL</b></span> <span class="logo-mini"><b>任务调度系统</b></span>
<span class="logo-lg"><b>${I18n.admin_name}</b></span> <span class="logo-lg"><b>${I18n.admin_name}</b></span>
</a> </a>
<nav class="navbar navbar-static-top" role="navigation"> <nav class="navbar navbar-static-top" role="navigation">
...@@ -226,14 +226,5 @@ ...@@ -226,14 +226,5 @@
</#macro> </#macro>
<#macro commonFooter > <#macro commonFooter >
<footer class="main-footer"> <footer class="main-footer"></footer>
Powered by <b>XXL-JOB</b> ${I18n.admin_version}
<div class="pull-right hidden-xs">
<strong>Copyright &copy; 2015-${.now?string('yyyy')} &nbsp;
<a href="https://www.xuxueli.com/" target="_blank" >xuxueli</a>
&nbsp;
<a href="https://github.com/xuxueli/xxl-job" target="_blank" >github</a>
</strong><!-- All rights reserved. -->
</div>
</footer>
</#macro> </#macro>
\ No newline at end of file
...@@ -25,12 +25,8 @@ ...@@ -25,12 +25,8 @@
<h4>${I18n.admin_name_full}</h4> <h4>${I18n.admin_name_full}</h4>
<br> <br>
<p> <p>
<a target="_blank" href="https://github.com/xuxueli/xxl-job">Github</a>&nbsp;&nbsp;&nbsp;&nbsp;
<iframe src="https://ghbtns.com/github-btn.html?user=xuxueli&repo=xxl-job&type=star&count=true" frameborder="0" scrolling="0" width="170px" height="20px" style="margin-bottom:-5px;"></iframe>
<br><br> <br><br>
<a target="_blank" href="https://www.xuxueli.com/xxl-job/">${I18n.job_help_document}</a>
<br><br> <br><br>
</p> </p>
<p></p> <p></p>
</div> </div>
......
...@@ -243,23 +243,23 @@ ...@@ -243,23 +243,23 @@
<input type="hidden" name="glueRemark" value="GLUE代码初始化" > <input type="hidden" name="glueRemark" value="GLUE代码初始化" >
<textarea name="glueSource" style="display:none;" ></textarea> <textarea name="glueSource" style="display:none;" ></textarea>
<textarea class="glueSource_java" style="display:none;" > <textarea class="glueSource_java" style="display:none;" >
package com.xxl.job.service.handler; package cn.wisenergy.job.service.handler;
import com.xxl.job.core.context.XxlJobHelper; import cn.wisenergy.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.IJobHandler; import cn.wisenergy.job.core.handler.IJobHandler;
public class DemoGlueJobHandler extends IJobHandler { public class DemoGlueJobHandler extends IJobHandler {
@Override @Override
public void execute() throws Exception { public void execute() throws Exception {
XxlJobHelper.log("XXL-JOB, Hello World."); JobHelper.log("Hello World.");
} }
} }
</textarea> </textarea>
<textarea class="glueSource_shell" style="display:none;" > <textarea class="glueSource_shell" style="display:none;" >
#!/bin/bash #!/bin/bash
echo "xxl-job: hello shell" echo "hello shell"
echo "${I18n.jobinfo_script_location}:$0" echo "${I18n.jobinfo_script_location}:$0"
echo "${I18n.jobinfo_field_executorparam}:$1" echo "${I18n.jobinfo_field_executorparam}:$1"
...@@ -281,7 +281,7 @@ exit 0 ...@@ -281,7 +281,7 @@ exit 0
import time import time
import sys import sys
print "xxl-job: hello python" print "hello python"
print "${I18n.jobinfo_script_location}:", sys.argv[0] print "${I18n.jobinfo_script_location}:", sys.argv[0]
print "${I18n.jobinfo_field_executorparam}:", sys.argv[1] print "${I18n.jobinfo_field_executorparam}:", sys.argv[1]
...@@ -303,7 +303,7 @@ logging.info("脚本文件:" + sys.argv[0]) ...@@ -303,7 +303,7 @@ logging.info("脚本文件:" + sys.argv[0])
<textarea class="glueSource_php" style="display:none;" > <textarea class="glueSource_php" style="display:none;" >
<?php <?php
echo "xxl-job: hello php \n"; echo "hello php \n";
echo "${I18n.jobinfo_script_location}:$argv[0] \n"; echo "${I18n.jobinfo_script_location}:$argv[0] \n";
echo "${I18n.jobinfo_field_executorparam}:$argv[1] \n"; echo "${I18n.jobinfo_field_executorparam}:$argv[1] \n";
...@@ -317,7 +317,7 @@ logging.info("脚本文件:" + sys.argv[0]) ...@@ -317,7 +317,7 @@ logging.info("脚本文件:" + sys.argv[0])
</textarea> </textarea>
<textarea class="glueSource_nodejs" style="display:none;" > <textarea class="glueSource_nodejs" style="display:none;" >
#!/usr/bin/env node #!/usr/bin/env node
console.log("xxl-job: hello nodejs") console.log("hello nodejs")
var arguments = process.argv var arguments = process.argv
...@@ -333,7 +333,7 @@ console.log("Good bye!") ...@@ -333,7 +333,7 @@ console.log("Good bye!")
process.exit(0) process.exit(0)
</textarea> </textarea>
<textarea class="glueSource_powershell" style="display:none;" > <textarea class="glueSource_powershell" style="display:none;" >
Write-Host "xxl-job: hello powershell" Write-Host "hello powershell"
Write-Host "${I18n.jobinfo_script_location}: " $MyInvocation.MyCommand.Definition Write-Host "${I18n.jobinfo_script_location}: " $MyInvocation.MyCommand.Definition
Write-Host "${I18n.jobinfo_field_executorparam}: " Write-Host "${I18n.jobinfo_field_executorparam}: "
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<body class="hold-transition login-page"> <body class="hold-transition login-page">
<div class="login-box"> <div class="login-box">
<div class="login-logo"> <div class="login-logo">
<a><b>XXL</b>JOB</a> <a><b>任务调度系统</b></a>
</div> </div>
<form id="loginForm" method="post" > <form id="loginForm" method="post" >
<div class="login-box-body"> <div class="login-box-body">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment