记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
f023cff6
Commit
f023cff6
authored
Dec 13, 2021
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre' into 'master'
Pre See merge request
!136
parents
759451f8
8b7cf274
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
35 deletions
+92
-35
application-dev.yml
liquidnet-bus-config/liquidnet-config/application-dev.yml
+1
-1
TempScore.java
...in/java/com/liquidnet/service/stone/entity/TempScore.java
+48
-0
TempScoreMapper.java
...a/com/liquidnet/service/stone/mapper/TempScoreMapper.java
+17
-0
StoneServerImpl.java
.../service/platform/service/impl/stone/StoneServerImpl.java
+26
-34
No files found.
liquidnet-bus-config/liquidnet-config/application-dev.yml
View file @
f023cff6
...
...
@@ -35,7 +35,7 @@ liquidnet:
dbs
:
0,16
database
:
15
host
:
39.107.71.112
port
:
63
6
9
port
:
63
7
9
password
:
3Xa%8p
dragon
:
dbs
:
0,16
...
...
liquidnet-bus-do/liquidnet-service-stone-do/src/main/java/com/liquidnet/service/stone/entity/TempScore.java
0 → 100644
View file @
f023cff6
package
com
.
liquidnet
.
service
.
stone
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
/**
* <p>
* 积分日志表
* </p>
*
* @author liquidnet
* @since 2021-10-19
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
TempScore
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
uid
;
/**
* id
*/
private
String
mobile
;
/**
* 用户id
*/
private
BigDecimal
priceCost
;
private
static
final
TempScore
obj
=
new
TempScore
();
public
static
TempScore
getNew
()
{
try
{
return
(
TempScore
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
TempScore
();
}
}
liquidnet-bus-do/liquidnet-service-stone-do/src/main/java/com/liquidnet/service/stone/mapper/TempScoreMapper.java
0 → 100644
View file @
f023cff6
package
com
.
liquidnet
.
service
.
stone
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.liquidnet.service.stone.entity.StoneScoreItems
;
import
com.liquidnet.service.stone.entity.TempScore
;
/**
* <p>
* 积分物品表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-10-19
*/
public
interface
TempScoreMapper
extends
BaseMapper
<
TempScore
>
{
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/stone/StoneServerImpl.java
View file @
f023cff6
...
...
@@ -16,8 +16,11 @@ import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper;
import
com.liquidnet.service.stone.constant.StoneConstant
;
import
com.liquidnet.service.stone.entity.StoneScoreLogs
;
import
com.liquidnet.service.stone.entity.StoneScoreUser
;
import
com.liquidnet.service.stone.entity.TempScore
;
import
com.liquidnet.service.stone.mapper.StoneScoreItemsMapper
;
import
com.liquidnet.service.stone.mapper.StoneScoreLogsMapper
;
import
com.liquidnet.service.stone.mapper.StoneScoreUserMapper
;
import
com.liquidnet.service.stone.mapper.TempScoreMapper
;
import
com.liquidnet.service.stone.vo.StoneUserVo
;
import
com.liquidnet.service.sweet.constant.SweetConstant
;
import
com.liquidnet.service.sweet.vo.SweetAppletUsersVo
;
...
...
@@ -54,44 +57,33 @@ public class StoneServerImpl {
StoneScoreLogsMapper
stoneScoreLogsMapper
;
@Autowired
FeignStoneIntegralClient
stoneIntegralClient
;
private
static
final
String
SQL_URL
=
"jdbc:mysql://zhengzai.mysql.polardb.rds.aliyuncs.com:3306/ln_scene"
;
private
static
final
String
SQL_USER
=
"zhengzai"
;
private
static
final
String
SQL_PWD
=
"GDDHBJOEcJw!"
;
@Autowired
TempScoreMapper
tempScoreMapper
;
public
boolean
initScore
(
String
uid
)
{
try
{
String
sql
=
"select * from temp_score where uid = "
+
uid
;
Connection
connection
=
DriverManager
.
getConnection
(
SQL_URL
,
SQL_USER
,
SQL_PWD
);
//查询数据
PreparedStatement
preparedStatement
=
connection
.
prepareStatement
(
sql
);
ResultSetImpl
row
=
(
ResultSetImpl
)
preparedStatement
.
executeQuery
();
//数据迁移
while
(
row
.
next
())
{
int
score
=
row
.
getInt
(
"price_cost"
);
int
isLog
=
stoneScoreLogsMapper
.
selectCount
(
Wrappers
.
lambdaQuery
(
StoneScoreLogs
.
class
).
eq
(
StoneScoreLogs:
:
getUid
,
uid
).
eq
(
StoneScoreLogs:
:
getContent
,
"历史积分"
));
if
(
isLog
>
0
)
{
return
true
;
}
//创建 用户积分数据
int
isExists
=
stoneScoreUserMapper
.
selectCount
(
Wrappers
.
lambdaQuery
(
StoneScoreUser
.
class
).
eq
(
StoneScoreUser:
:
getUid
,
uid
));
if
(
isExists
<=
0
)
{
StoneScoreUser
data
=
StoneScoreUser
.
getNew
();
data
.
setStatus
(
1
);
data
.
setScoreId
(
IDGenerator
.
nextTimeId2
());
data
.
setUid
(
uid
);
data
.
setCreatedAt
(
LocalDateTime
.
now
());
stoneScoreUserMapper
.
insert
(
data
);
StoneUserVo
userTaskVo
=
StoneUserVo
.
getNew
();
userTaskVo
.
getTask
();
userTaskVo
.
setUid
(
uid
);
userTaskVo
.
setStatus
(
1
);
userCreate
(
userTaskVo
);
}
stoneIntegralClient
.
in2111
(
uid
,
score
,
"历史积分"
);
TempScore
dataBean
=
tempScoreMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
TempScore
.
class
).
eq
(
TempScore:
:
getUid
,
uid
));
int
score
=
dataBean
.
getPriceCost
().
intValue
();
int
isLog
=
stoneScoreLogsMapper
.
selectCount
(
Wrappers
.
lambdaQuery
(
StoneScoreLogs
.
class
).
eq
(
StoneScoreLogs:
:
getUid
,
uid
).
eq
(
StoneScoreLogs:
:
getContent
,
"历史积分"
));
if
(
isLog
>
0
)
{
return
true
;
}
//创建 用户积分数据
int
isExists
=
stoneScoreUserMapper
.
selectCount
(
Wrappers
.
lambdaQuery
(
StoneScoreUser
.
class
).
eq
(
StoneScoreUser:
:
getUid
,
uid
));
if
(
isExists
<=
0
)
{
StoneScoreUser
data
=
StoneScoreUser
.
getNew
();
data
.
setStatus
(
1
);
data
.
setScoreId
(
IDGenerator
.
nextTimeId2
());
data
.
setUid
(
uid
);
data
.
setCreatedAt
(
LocalDateTime
.
now
());
stoneScoreUserMapper
.
insert
(
data
);
StoneUserVo
userTaskVo
=
StoneUserVo
.
getNew
();
userTaskVo
.
getTask
();
userTaskVo
.
setUid
(
uid
);
userTaskVo
.
setStatus
(
1
);
userCreate
(
userTaskVo
);
}
row
.
close
();
preparedStatement
.
close
();
stoneIntegralClient
.
in2111
(
uid
,
score
,
"历史积分"
);
}
catch
(
Exception
e
)
{
log
.
info
(
"异常 : {} "
,
e
);
e
.
printStackTrace
();
...
...
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