Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
shop-Mall
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
licc
shop-Mall
Commits
980d15e3
Commit
980d15e3
authored
Mar 04, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
1b482ca7
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
49 additions
and
65 deletions
+49
-65
pom.xml
wisenergy-service/pom.xml
+5
-0
UserService.java
...e/src/main/java/cn/wisenergy/service/app/UserService.java
+2
-2
UserServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
+16
-23
UserController.java
...cn/wisenergy/web/admin/controller/app/UserController.java
+3
-5
loginController.java
...n/wisenergy/web/admin/controller/app/loginController.java
+2
-1
application.properties
...b/xxl-job-admin/src/main/resources/application.properties
+6
-6
message_en.properties
...l-job-admin/src/main/resources/i18n/message_en.properties
+1
-1
message_zh_CN.properties
...ob-admin/src/main/resources/i18n/message_zh_CN.properties
+1
-1
message_zh_TC.properties
...ob-admin/src/main/resources/i18n/message_zh_TC.properties
+1
-1
common.macro.ftl
...dmin/src/main/resources/templates/common/common.macro.ftl
+2
-11
help.ftl
xxl-job/xxl-job-admin/src/main/resources/templates/help.ftl
+0
-4
jobinfo.index.ftl
...in/src/main/resources/templates/jobinfo/jobinfo.index.ftl
+9
-9
login.ftl
xxl-job/xxl-job-admin/src/main/resources/templates/login.ftl
+1
-1
No files found.
wisenergy-service/pom.xml
View file @
980d15e3
...
...
@@ -95,6 +95,11 @@
<artifactId>
open-sdk-common
</artifactId>
<version>
1.0.7-RELEASE
</version>
</dependency>
<dependency>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
<version>
1.9.2
</version>
</dependency>
</dependencies>
<!-- MAVEN构建 -->
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/UserService.java
View file @
980d15e3
...
...
@@ -17,14 +17,14 @@ public interface UserService {
* @param userId 用户id
* @return 用户信息
*/
R
<
Integ
er
>
getById
(
String
userId
);
R
<
Us
er
>
getById
(
String
userId
);
/**
* 获取用户信息
* @param userId 用户id
* @return 用户信息
*/
Integer
getByUserId
(
String
userId
);
R
<
User
>
getByUserId
(
String
userId
);
//根据手机号查询用户
public
User
queryUsersByPhone
(
String
id
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
View file @
980d15e3
...
...
@@ -12,8 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
javax.xml.transform.Result
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -36,24 +34,21 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
private
RecommendUserMapper
recommendUserMapper
;
@Override
public
R
<
Integer
>
getById
(
String
userId
)
{
public
R
<
User
>
getById
(
String
userId
)
{
return
R
.
ok
(
usersMapper
.
getByUserId
(
userId
));
}
@Override
public
Integer
getByUserId
(
String
userId
)
{
return
usersMapper
.
getByUserId
(
userId
);
public
R
<
User
>
getByUserId
(
String
userId
)
{
return
R
.
ok
(
usersMapper
.
getByUserId
(
userId
)
);
}
@Override
public
User
queryUsersByPhone
(
String
phone
)
{
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
param
.
put
(
"phone"
,
phone
);
List
<
User
>
usersList
=
usersMapper
.
getUsersListByMap
(
param
);
if
(!
CollectionUtils
.
isEmpty
(
usersList
))
{
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
param
.
put
(
"phone"
,
phone
);
List
<
User
>
usersList
=
usersMapper
.
getUsersListByMap
(
param
);
if
(!
CollectionUtils
.
isEmpty
(
usersList
))
{
return
usersList
.
get
(
0
);
}
return
null
;
...
...
@@ -69,15 +64,13 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
/**
* 判断用户等级是否为空,空的话填写0
*/
if
(
null
==
beInvitedCode
||
""
==
beInvitedCode
)
{
beInvitedCode
=
String
.
valueOf
(
1
);
if
(
null
==
beInvitedCode
||
""
.
equals
(
beInvitedCode
))
{
beInvitedCode
=
String
.
valueOf
(
1
);
}
// 插入用户手机号与推荐人邀请码
usersMapper
.
insertbyint
(
userId
,
beInvitedCode
);
//根据插入的用户手机号,查询用户唯一ID
Integer
yqm
=
usersMapper
.
getByUserId
(
userId
);
//插入用户手机号与推荐人邀请码
usersMapper
.
insertbyint
(
userId
,
beInvitedCode
);
//用户唯一ID调用生成6位邀请码
String
inviteCode
=
ShareCodeUtil
.
idToCode
(
yqm
);
String
inviteCode
=
ShareCodeUtil
.
idToCode
(
usersMapper
.
getByUserId
(
userId
).
getId
()
);
//根据用户手机号,更新用户信息
User
user
=
new
User
();
user
.
setInviteCode
(
inviteCode
);
...
...
@@ -88,12 +81,12 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
//插入用户团队表
//根据邀请码查询推荐人的普通用户字段+1
Integer
a
=
recommendUserMapper
.
zcByUserId
(
userId
);
if
(
null
!=
a
&&
0
!=
a
)
{
Integer
a
=
recommendUserMapper
.
zcByUserId
(
userId
);
if
(
null
!=
a
&&
0
!=
a
)
{
return
a
;
}
//根据邀请码递归所有团队成员普通用户+1
return
null
;
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UserController.java
View file @
980d15e3
...
...
@@ -53,7 +53,7 @@ public class UserController extends BaseController {
@ApiOperation
(
value
=
"获取用户信息"
,
notes
=
"获取用户信息"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
dataType
=
"String"
)
@GetMapping
(
"/getByUserId"
)
public
R
<
User
>
getByUserId
(
String
userId
){
public
R
<
User
>
getByUserId
(
String
userId
)
{
return
userService
.
getById
(
userId
);
}
...
...
@@ -68,12 +68,10 @@ public class UserController extends BaseController {
if
(
null
==
id
)
{
return
R
.
error
(
"入参为空!"
);
}
//用户信息
User
user
=
userService
.
getByUserId
(
id
);
R
<
User
>
user
=
userService
.
getByUserId
(
id
);
// 创建token
String
token
=
jwtUtil
.
generateToken
(
user
);
String
token
=
jwtUtil
.
generateToken
(
user
.
getData
()
);
// 保存Redis
redisTemplate
.
opsForValue
().
set
(
RedisConsts
.
JWT_ACCESS_TOKEN
+
token
,
token
);
return
R
.
ok
(
token
);
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/loginController.java
View file @
980d15e3
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.Constants
;
import
cn.wisenergy.web.sms.*
;
import
cn.wisenergy.common.utils.RedisUtils
;
import
cn.wisenergy.common.utils.StringUtil
;
...
...
@@ -84,7 +85,7 @@ public class loginController {
String
tokenKey
=
StringUtil
.
formatKeyWithPrefix
(
Constants
.
RedisKey
.
PROJECT_PRIFIX
,
Constants
.
RedisKey
.
TOKEN_PRIFIX
,
token
);
UsersDto
usersDto
=
new
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
;
}
...
...
xxl-job/xxl-job-admin/src/main/resources/application.properties
View file @
980d15e3
### web
server.port
=
80
8
0
server.servlet.context-path
=
/
xxl-
job-admin
server.port
=
80
9
0
server.servlet.context-path
=
/job-admin
### actuator
management.server.servlet.context-path
=
/actuator
...
...
@@ -24,14 +24,14 @@ mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
### 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.username
=
root
spring.datasource.password
=
root_pwd
spring.datasource.username
=
qunzhihe
spring.datasource.password
=
j2kRn8HjrPez7trw
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
### datasource-pool
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle
=
10
spring.datasource.hikari.maximum-pool-size
=
3
0
spring.datasource.hikari.minimum-idle
=
5
spring.datasource.hikari.maximum-pool-size
=
1
0
spring.datasource.hikari.auto-commit
=
true
spring.datasource.hikari.idle-timeout
=
30000
spring.datasource.hikari.pool-name
=
HikariCP
...
...
xxl-job/xxl-job-admin/src/main/resources/i18n/message_en.properties
View file @
980d15e3
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_i18n
=
en
...
...
xxl-job/xxl-job-admin/src/main/resources/i18n/message_zh_CN.properties
View file @
980d15e3
admin_name
=
任务调度中心
admin_name_full
=
分布式任务调度平台
XXL-JOB
admin_name_full
=
分布式任务调度平台
admin_version
=
2.3.0
admin_i18n
=
...
...
xxl-job/xxl-job-admin/src/main/resources/i18n/message_zh_TC.properties
View file @
980d15e3
admin_name
=
任務調度中心
admin_name_full
=
分布式任務調度平臺
XXL-JOB
admin_name_full
=
分布式任務調度平臺
admin_version
=
2.3.0
admin_i18n
=
...
...
xxl-job/xxl-job-admin/src/main/resources/templates/common/common.macro.ftl
View file @
980d15e3
...
...
@@ -67,7 +67,7 @@
<#macro commonHeader>
<header class="main-header">
<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>
</a>
<nav class="navbar navbar-static-top" role="navigation">
...
...
@@ -226,14 +226,5 @@
</#macro>
<#macro commonFooter >
<footer class="main-footer">
Powered by <b>XXL-JOB</b> ${I18n.admin_version}
<div class="pull-right hidden-xs">
<strong>Copyright © 2015-${.now?string('yyyy')}
<a href="https://www.xuxueli.com/" target="_blank" >xuxueli</a>
<a href="https://github.com/xuxueli/xxl-job" target="_blank" >github</a>
</strong><!-- All rights reserved. -->
</div>
</footer>
<footer class="main-footer"></footer>
</#macro>
\ No newline at end of file
xxl-job/xxl-job-admin/src/main/resources/templates/help.ftl
View file @
980d15e3
...
...
@@ -25,12 +25,8 @@
<h4>
${I18n.admin_name_full}
</h4>
<br>
<p>
<a
target=
"_blank"
href=
"https://github.com/xuxueli/xxl-job"
>
Github
</a>
<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>
<a
target=
"_blank"
href=
"https://www.xuxueli.com/xxl-job/"
>
${I18n.job_help_document}
</a>
<br><br>
</p>
<p></p>
</div>
...
...
xxl-job/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl
View file @
980d15e3
...
...
@@ -243,23 +243,23 @@
<input
type=
"hidden"
name=
"glueRemark"
value=
"GLUE代码初始化"
>
<textarea
name=
"glueSource"
style=
"display:none;"
></textarea>
<textarea
class=
"glueSource_java"
style=
"display:none;"
>
package c
om.xxl
.job.service.handler;
package c
n.wisenergy
.job.service.handler;
import c
om.xxl
.job.core.context.XxlJobHelper;
import c
om.xxl
.job.core.handler.IJobHandler;
import c
n.wisenergy
.job.core.context.XxlJobHelper;
import c
n.wisenergy
.job.core.handler.IJobHandler;
public class DemoGlueJobHandler extends IJobHandler {
@Override
public void execute() throws Exception {
XxlJobHelper.log("XXL-JOB,
Hello World.");
JobHelper.log("
Hello World.");
}
}
</textarea>
<textarea
class=
"glueSource_shell"
style=
"display:none;"
>
#!/bin/bash
echo "
xxl-job:
hello shell"
echo "hello shell"
echo "${I18n.jobinfo_script_location}:$0"
echo "${I18n.jobinfo_field_executorparam}:$1"
...
...
@@ -281,7 +281,7 @@ exit 0
import time
import sys
print "
xxl-job:
hello python"
print "hello python"
print "${I18n.jobinfo_script_location}:", sys.argv[0]
print "${I18n.jobinfo_field_executorparam}:", sys.argv[1]
...
...
@@ -303,7 +303,7 @@ logging.info("脚本文件:" + sys.argv[0])
<textarea
class=
"glueSource_php"
style=
"display:none;"
>
<?php
echo "
xxl-job:
hello php \n";
echo "hello php \n";
echo "${I18n.jobinfo_script_location}:$argv[0] \n";
echo "${I18n.jobinfo_field_executorparam}:$argv[1] \n";
...
...
@@ -317,7 +317,7 @@ logging.info("脚本文件:" + sys.argv[0])
</textarea>
<textarea
class=
"glueSource_nodejs"
style=
"display:none;"
>
#!/usr/bin/env node
console.log("
xxl-job:
hello nodejs")
console.log("hello nodejs")
var arguments = process.argv
...
...
@@ -333,7 +333,7 @@ console.log("Good bye!")
process.exit(0)
</textarea>
<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_field_executorparam}: "
...
...
xxl-job/xxl-job-admin/src/main/resources/templates/login.ftl
View file @
980d15e3
...
...
@@ -9,7 +9,7 @@
<body
class=
"hold-transition login-page"
>
<div
class=
"login-box"
>
<div
class=
"login-logo"
>
<a><b>
XXL
</b>
JOB
</a>
<a><b>
任务调度系统
</b>
</a>
</div>
<form
id=
"loginForm"
method=
"post"
>
<div
class=
"login-box-body"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment