Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DuibaTestToolV2.1
Project
Project
Details
Activity
Releases
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
赵然
DuibaTestToolV2.1
Commits
d285c948
Commit
d285c948
authored
Oct 12, 2019
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
be7dc363
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
201 additions
and
225 deletions
+201
-225
CreatUrlModule.java
src/main/com/atguigu/springmvc/handlers/CreatUrlModule.java
+2
-1
NewSignModule.java
src/main/com/atguigu/springmvc/handlers/NewSignModule.java
+176
-215
SignModule.java
src/main/com/atguigu/springmvc/handlers/SignModule.java
+23
-9
No files found.
src/main/com/atguigu/springmvc/handlers/CreatUrlModule.java
View file @
d285c948
...
...
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.servlet.http.HttpServletRequest
;
import
java.net.URLEncoder
;
import
java.util.Base64
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -63,7 +64,7 @@ public class CreatUrlModule {
params
.
put
(
"uid"
,
userId
);
params
.
put
(
"credits"
,
credits
);
if
(
dcustom
!=
null
&&
dcustom
!=
""
&&
dcustom
!=
"null"
)
{
params
.
put
(
"dcustom"
,
dcustom
);
params
.
put
(
"dcustom"
,
URLEncoder
.
encode
(
dcustom
,
"UTF-8"
)
);
}
if
(
transfer
!=
null
&&
transfer
!=
""
&&
transfer
!=
"null"
){
params
.
put
(
"transfer"
,
transfer
);
...
...
src/main/com/atguigu/springmvc/handlers/NewSignModule.java
View file @
d285c948
This diff is collapsed.
Click to expand it.
src/main/com/atguigu/springmvc/handlers/SignModule.java
View file @
d285c948
package
main
.
com
.
atguigu
.
springmvc
.
handlers
;
import
main.com.atguigu.springmvc.common.MysqlUtils
;
import
main.com.atguigu.springmvc.service.SqlService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
...
@@ -16,6 +18,8 @@ import java.util.Locale;
@Controller
public
class
SignModule
{
@Autowired
SqlService
sqlService
;
private
MysqlUtils
jdbc
;
private
static
final
String
SUCCESS
=
"success"
;
...
...
@@ -35,12 +39,18 @@ public class SignModule {
//链接数据库
jdbc
=
MysqlUtils
.
mysqlDuiba
(
"sign_record"
);
//
jdbc = MysqlUtils.mysqlDuiba("sign_record");
//执行数据库
jdbc
.
update
(
"delete from sign_record.tb_sign_log where consumer_id="
+
consumer_id
+
" and source_relation_id="
+
source_relation_id
+
""
);
jdbc
.
update
(
"delete from sign_record.tb_sign_statics where consumer_id="
+
consumer_id
+
" and source_relation_id="
+
source_relation_id
+
""
);
//
jdbc.update("delete from sign_record.tb_sign_log where consumer_id="+consumer_id+" and source_relation_id="+source_relation_id+"");
//
jdbc.update("delete from sign_record.tb_sign_statics where consumer_id="+consumer_id+" and source_relation_id="+source_relation_id+"");
//释放数据库
jdbc
.
releaseConn
();
//jdbc.releaseConn();
String
sql1
=
"delete from sign_record.tb_sign_log where consumer_id='"
+
consumer_id
+
"' and source_relation_id='"
+
source_relation_id
+
"'"
;
String
sql2
=
"delete from sign_record.tb_sign_statics where consumer_id='"
+
consumer_id
+
"' and source_relation_id='"
+
source_relation_id
+
"'"
;
sqlService
.
update
(
sql1
);
sqlService
.
update
(
sql2
);
return
new
ModelAndView
(
SUCCESS
);
}
...
...
@@ -71,22 +81,26 @@ public class SignModule {
System
.
out
.
println
(
"签到类型为:"
+
sign_type
);
//链接数据库
jdbc
=
MysqlUtils
.
mysqlDuiba
(
"sign_record"
);
//
jdbc = MysqlUtils.mysqlDuiba("sign_record");
//执行数据库
jdbc
.
update
(
"INSERT INTO `tb_sign_statics` (`consumer_id`, `source_type`, `source_relation_id`, `continue_day`, `last_sign_day`, `gmt_create`, `gmt_modified`, `app_id`, `acm_day`) VALUES ( '"
+
consumer_id
+
"', '2', '"
+
source_relation_id
+
"', '"
+
continue_day
+
"', '"
+
last_sign_day
+
"', '"
+
last_sign_day
+
"', '"
+
last_sign_day
+
"', '"
+
app_id
+
"', '"
+
continue_day
+
"')"
,
null
);
//jdbc.update("INSERT INTO sign_record.tb_sign_statics (`consumer_id`, `source_type`, `source_relation_id`, `continue_day`, `last_sign_day`, `gmt_create`, `gmt_modified`, `app_id`, `acm_day`) VALUES ( '"+consumer_id+"', '2', '"+source_relation_id+"', '"+continue_day+"', '"+last_sign_day+"', '"+last_sign_day+"', '"+last_sign_day+"', '"+app_id+"', '"+continue_day+"')", null);
String
sql1
=
"INSERT INTO sign_record.tb_sign_statics (`consumer_id`, `source_type`, `source_relation_id`, `continue_day`, `last_sign_day`, `gmt_create`, `gmt_modified`, `app_id`, `acm_day`, `max_continue_day`) VALUES ( '"
+
consumer_id
+
"', '2', '"
+
source_relation_id
+
"', '"
+
continue_day
+
"', '"
+
last_sign_day
+
"', '"
+
last_sign_day
+
"', '"
+
last_sign_day
+
"', '"
+
app_id
+
"', '"
+
continue_day
+
"', '"
+
continue_day
+
"')"
;
sqlService
.
update
(
sql1
);
int
i
=
Integer
.
valueOf
(
continue_day
);
while
(
i
>
0
){
String
sign_date
=
this
.
getTime
(
i
*(-
1
));
Thread
.
sleep
(
500
);
String
log_id
=
String
.
valueOf
(
System
.
currentTimeMillis
());
jdbc
.
update
(
"INSERT INTO `tb_sign_log` ( `log_id`, `biz_id`, `consumer_id`, `credits`, `sign_type`, `log_statue`, `gmt_create`, `gmt_modified`, `source_type`, `source_relation_id`, `activity_count`, `activity_count_remark`, `credits_remark`, `activity_count_status`, `credits_status`, `sign_date`, `re_sign`, `sign_remark`, `app_id`) VALUES ( '"
+
log_id
+
"', NULL, '"
+
consumer_id
+
"', '0', '"
+
sign_type
+
"', '2', '"
+
sign_date
+
"', '"
+
sign_date
+
"', '2', '"
+
source_relation_id
+
"', '0', '{\\\"rw\\\":{}}', '{\\\"rw\\\":{}}', '2', '2', '"
+
sign_date
+
"', '0', NULL, '"
+
app_id
+
"')"
);
//jdbc.update("INSERT INTO sign_record.tb_sign_log ( `log_id`, `biz_id`, `consumer_id`, `credits`, `sign_type`, `log_statue`, `gmt_create`, `gmt_modified`, `source_type`, `source_relation_id`, `activity_count`, `activity_count_remark`, `credits_remark`, `activity_count_status`, `credits_status`, `sign_date`, `re_sign`, `sign_remark`, `app_id`) VALUES ( '"+log_id+"', NULL, '"+consumer_id+"', '0', '"+sign_type+"', '2', '"+sign_date+"', '"+sign_date+"', '2', '"+source_relation_id+"', '0', '{\\\"rw\\\":{}}', '{\\\"rw\\\":{}}', '2', '2', '"+sign_date+"', '0', NULL, '"+app_id+"')");
String
sql2
=
"INSERT INTO sign_record.tb_sign_log ( `log_id`, `biz_id`, `consumer_id`, `credits`, `sign_type`, `log_statue`, `gmt_create`, `gmt_modified`, `source_type`, `source_relation_id`, `activity_count`, `activity_count_remark`, `credits_remark`, `activity_count_status`, `credits_status`, `sign_date`, `re_sign`, `sign_remark`, `app_id`) VALUES ( '"
+
log_id
+
"', NULL, '"
+
consumer_id
+
"', '0', '"
+
sign_type
+
"', '2', '"
+
sign_date
+
"', '"
+
sign_date
+
"', '2', '"
+
source_relation_id
+
"', '0', '{\\\"rw\\\":{}}', '{\\\"rw\\\":{}}', '2', '2', '"
+
sign_date
+
"', '0', NULL, '"
+
app_id
+
"')"
;
sqlService
.
update
(
sql2
);
i
--;
}
//释放数据库
jdbc
.
releaseConn
();
//
jdbc.releaseConn();
return
new
ModelAndView
(
SUCCESS
);
}
...
...
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