Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
320eebc9
提交
320eebc9
authored
10月 19, 2023
作者:
huyufan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
冻结资金相关
上级
1d21085f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
32 行增加
和
13 行删除
+32
-13
OwnerAccountDaoImpl.java
...ava/com/clx/performance/dao/impl/OwnerAccountDaoImpl.java
+4
-2
OwnerAccountMapper.java
...n/java/com/clx/performance/mapper/OwnerAccountMapper.java
+16
-4
OwnerAccountSqlProvider.java
.../clx/performance/sqlProvider/OwnerAccountSqlProvider.java
+2
-2
JobTest.java
...rmance-web/src/test/java/com/clx/performance/JobTest.java
+10
-5
没有找到文件。
performance-web/src/main/java/com/clx/performance/dao/impl/OwnerAccountDaoImpl.java
浏览文件 @
320eebc9
...
...
@@ -9,6 +9,7 @@ import com.clx.performance.param.pc.PageOwnerAccountListParam;
import
com.clx.performance.struct.OwnerAccountStruct
;
import
com.clx.performance.vo.pc.OwnerAccountVO
;
import
com.msl.common.dao.impl.BaseDaoImpl
;
import
com.msl.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -45,10 +46,11 @@ public class OwnerAccountDaoImpl extends BaseDaoImpl<OwnerAccountMapper, OwnerAc
@Override
public
Integer
updateAccountCAS
(
OwnerAccount
account
,
LocalDateTime
now
,
boolean
flag
)
{
String
nowStr
=
DateUtils
.
formatDateTime
(
now
,
"yyyy-MM-dd HH:mm:ss"
).
get
();
if
(
flag
)
{
return
baseMapper
.
addAccount
(
account
,
now
);
return
baseMapper
.
addAccount
(
account
,
now
Str
);
}
else
{
return
baseMapper
.
subAccount
(
account
,
now
);
return
baseMapper
.
subAccount
(
account
,
now
Str
);
}
}
...
...
performance-web/src/main/java/com/clx/performance/mapper/OwnerAccountMapper.java
浏览文件 @
320eebc9
...
...
@@ -7,8 +7,11 @@ import com.clx.performance.model.OwnerAccount;
import
com.clx.performance.param.pc.PageOwnerAccountListParam
;
import
com.clx.performance.sqlProvider.OwnerAccountSqlProvider
;
import
com.clx.performance.vo.pc.OwnerAccountVO
;
import
com.msl.common.utils.DateUtils
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.SelectProvider
;
import
org.apache.ibatis.annotations.Update
;
import
java.time.LocalDateTime
;
import
java.util.List
;
...
...
@@ -22,11 +25,20 @@ public interface OwnerAccountMapper extends BaseMapper<OwnerAccount> {
@SelectProvider
(
type
=
OwnerAccountSqlProvider
.
class
,
method
=
"pageList"
)
IPage
<
OwnerAccountVO
>
pageList
(
Page
<
OwnerAccountVO
>
page
,
PageOwnerAccountListParam
param
);
@SelectProvider
(
type
=
OwnerAccountSqlProvider
.
class
,
method
=
"addAccount"
)
Integer
addAccount
(
OwnerAccount
account
,
LocalDateTime
now
);
// @SelectProvider(type = OwnerAccountSqlProvider.class, method = "addAccount")
@Update
(
"update owner_account set usable_balance = usable_balance + #{account.usableBalance}"
+
",account_balance = account_balance + #{account.accountBalance}"
+
",modified_time= #{now}"
+
"where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
Integer
addAccount
(
@Param
(
"account"
)
OwnerAccount
account
,
@Param
(
"now"
)
String
now
);
@SelectProvider
(
type
=
OwnerAccountSqlProvider
.
class
,
method
=
"subAccount"
)
Integer
subAccount
(
OwnerAccount
account
,
LocalDateTime
now
);
@Update
(
"update owner_account set usable_balance = usable_balance - #{account.usableBalance},"
+
"frozen_balance = frozen_balance + #{account.frozenBalance},account_balance = account_balance - #{account.accountBalance},"
+
"modified_time=#{now}"
+
"where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
Integer
subAccount
(
@Param
(
"account"
)
OwnerAccount
account
,
@Param
(
"now"
)
String
now
);
@SelectProvider
(
type
=
OwnerAccountSqlProvider
.
class
,
method
=
"updateOwnerAccountForConfirm"
)
Integer
updateOwnerAccountForConfirm
(
OwnerAccount
account
);
...
...
performance-web/src/main/java/com/clx/performance/sqlProvider/OwnerAccountSqlProvider.java
浏览文件 @
320eebc9
...
...
@@ -38,7 +38,7 @@ public class OwnerAccountSqlProvider {
return
sql
;
}
public
String
addAccount
(
OwnerAccount
account
,
LocalDateTime
now
)
{
public
String
addAccount
(
@Param
(
"account"
)
OwnerAccount
account
,
@Param
(
"now"
)
LocalDateTime
now
)
{
StringBuffer
sqlList
=
new
StringBuffer
();
sqlList
.
append
(
"update owner_account set usable_balance = usable_balance +"
+
...
...
@@ -51,7 +51,7 @@ public class OwnerAccountSqlProvider {
return
sqlList
.
toString
();
}
public
String
subAccount
(
OwnerAccount
account
,
LocalDateTime
now
)
{
public
String
subAccount
(
@Param
(
"account"
)
OwnerAccount
account
,
@Param
(
"now"
)
LocalDateTime
now
)
{
StringBuffer
sqlList
=
new
StringBuffer
();
sqlList
.
append
(
"update owner_account set usable_balance = usable_balance -"
+
...
...
performance-web/src/test/java/com/clx/performance/JobTest.java
浏览文件 @
320eebc9
...
...
@@ -16,6 +16,8 @@ import com.clx.performance.enums.OrderGoodsTruckBindEnum;
import
com.clx.performance.mapper.OrderGoodsMapper
;
import
com.clx.performance.model.OrderGoods
;
import
com.clx.performance.model.OwnerAccount
;
import
com.clx.performance.param.pc.OwnerCaseOutParam
;
import
com.clx.performance.service.OwnerAccountService
;
import
com.msl.common.base.Optional
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
...
...
@@ -58,12 +60,15 @@ public class JobTest {
@Autowired
private
OwnerAccountDao
ownerAccountDao
;
@Autowired
private
OwnerAccountService
ownerAccountService
;
@Test
public
void
test1
()
{
Owner
Account
account
=
new
OwnerAccount
();
account
.
setId
(
7
);
account
.
setModifiedTime
(
LocalDateTime
.
now
(
));
Integer
i
=
ownerAccountDao
.
updateAccountCAS
(
account
,
LocalDateTime
.
now
(),
false
);
System
.
out
.
println
(
i
);
Owner
CaseOutParam
param
=
new
OwnerCaseOutParam
();
param
.
setOwnerUserNo
(
1021181283626946629L
);
param
.
setCaseOutBalance
(
new
BigDecimal
(
"1"
));
param
.
setAccountType
(
1
);
ownerAccountService
.
accountCaseOut
(
param
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论