Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fit-finance
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fitness-server
fit-finance
Commits
c85790ec
Commit
c85790ec
authored
Apr 03, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:page apply[
parent
0d09a590
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
10 deletions
+32
-10
app/src/main/java/com/jiejing/fitness/finance/app/controller/merchant/StudioMerchantController.java
+1
-1
repository/src/main/java/com/jiejing/fitness/finance/repository/mapper/StudioMerchantApplyMapper.xml
+4
-2
repository/src/main/java/com/jiejing/fitness/finance/repository/service/StudioMerchantApplyRpService.java
+4
-1
service/src/main/java/com/jiejing/fitness/finance/service/merchant/StudioMerchantService.java
+2
-1
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/MerchantConvert.java
+13
-0
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
+8
-5
No files found.
app/src/main/java/com/jiejing/fitness/finance/app/controller/merchant/StudioMerchantController.java
View file @
c85790ec
...
...
@@ -64,7 +64,7 @@ public class StudioMerchantController implements StudioMerchantApi {
@PostMapping
(
value
=
"/private/studioMerchant/bind"
)
@Override
public
JsonResult
<
Void
>
bind
(
@RequestBody
@Valid
BindStudioMerchantRequest
request
)
{
studioMerchantService
.
bind
(
request
.
getStudioId
(),
request
.
getMerchantId
());
studioMerchantService
.
bind
(
request
.
getStudioId
(),
request
.
getMerchantId
()
,
true
);
return
JsonResult
.
success
();
}
...
...
repository/src/main/java/com/jiejing/fitness/finance/repository/mapper/StudioMerchantApplyMapper.xml
View file @
c85790ec
...
...
@@ -25,7 +25,8 @@
select *
from studio_merchant_apply
where merchant_id = #{merchantId}
and open_state = 'S'
and open_state = 'SUCCESS'
and apply_type in ('OPEN', 'RE_OPEN')
order by id desc
limit 1
</select>
...
...
@@ -35,7 +36,8 @@
select *
from studio_merchant_apply
where studio_id = #{studioId}
and open_state = 'S'
and open_state = 'SUCCESS'
and apply_type in ('OPEN', 'RE_OPEN')
order by id desc
limit 1
</select>
...
...
repository/src/main/java/com/jiejing/fitness/finance/repository/service/StudioMerchantApplyRpService.java
View file @
c85790ec
...
...
@@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.google.common.collect.Lists
;
import
com.jiejing.common.utils.collection.CollectionUtil
;
import
com.jiejing.common.utils.text.StringUtil
;
import
com.jiejing.fitness.enums.finance.ApplyTypeEnum
;
import
com.jiejing.fitness.finance.repository.entity.StudioMerchantApply
;
import
com.jiejing.fitness.finance.repository.mapper.StudioMerchantApplyMapper
;
import
com.jiejing.fitness.finance.repository.query.PageStudioMerchantApplyQuery
;
...
...
@@ -95,7 +96,9 @@ public class StudioMerchantApplyRpService extends
QueryWrapper
<
StudioMerchantApply
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StudioMerchantApply
.
STUDIO_ID
,
studioId
);
wrapper
.
in
(
StudioMerchantApply
.
OPEN_STATE
,
Lists
.
newArrayList
(
OpenStateEnums
.
PROCESS
,
OpenStateEnums
.
INIT
));
Lists
.
newArrayList
(
OpenStateEnums
.
PROCESS
.
getCode
(),
OpenStateEnums
.
INIT
.
getCode
()));
wrapper
.
in
(
StudioMerchantApply
.
APPLY_TYPE
,
Lists
.
newArrayList
(
ApplyTypeEnum
.
OPEN
.
getCode
(),
ApplyTypeEnum
.
RE_OPEN
.
getCode
()));
Integer
count
=
this
.
baseMapper
.
selectCount
(
wrapper
);
return
Optional
.
ofNullable
(
count
).
orElse
(
0
);
}
...
...
service/src/main/java/com/jiejing/fitness/finance/service/merchant/StudioMerchantService.java
View file @
c85790ec
...
...
@@ -30,8 +30,9 @@ public interface StudioMerchantService {
*
* @param studioId 场馆ID
* @param merchantId 商户ID
* @param flag 是否添加绑定记录
*/
void
bind
(
Long
studioId
,
Long
merchantId
);
void
bind
(
Long
studioId
,
Long
merchantId
,
Boolean
flag
);
/**
* 解绑
...
...
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/MerchantConvert.java
View file @
c85790ec
...
...
@@ -2,6 +2,7 @@ package com.jiejing.fitness.finance.service.merchant.convert;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.jiejing.common.utils.convert.BeanUtil
;
import
com.jiejing.common.utils.crypt.AesUtil
;
import
com.jiejing.filecenter.api.resource.vo.ResourceInfoVO
;
import
com.jiejing.fitness.enums.finance.ApplyTypeEnum
;
...
...
@@ -559,4 +560,16 @@ public class MerchantConvert {
return
convertBrandMerchant
(
brandId
,
studioNames
,
e
,
dto
);
}).
collect
(
Collectors
.
toList
());
}
public
static
StudioMerchantApply
convertBindApply
(
Long
studioId
,
StudioMerchantApply
apply
)
{
StudioMerchantApply
toSave
=
BeanUtil
.
map
(
apply
,
StudioMerchantApply
.
class
);
toSave
.
setId
(
IdWorker
.
getId
());
toSave
.
setApplyNo
(
"-1"
);
toSave
.
setApplyType
(
ApplyTypeEnum
.
BIND
.
getCode
());
toSave
.
setStudioId
(
studioId
);
toSave
.
setCreateTime
(
new
Date
());
toSave
.
setUpdateTime
(
new
Date
());
return
toSave
;
}
}
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
View file @
c85790ec
...
...
@@ -125,10 +125,8 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
Exception
.
class
)
@Override
public
void
bind
(
Long
studioId
,
Long
merchantId
)
{
// 解绑后,绑定新商户
this
.
unbindAll
(
studioId
);
PartyToMerchant
relation
=
getRelation
(
studioId
);
public
void
bind
(
Long
studioId
,
Long
merchantId
,
Boolean
flag
)
{
PartyToMerchant
relation
=
this
.
getRelation
(
studioId
);
StudioMerchantApply
apply
=
studioMerchantApplyRpService
.
getLatestOneSuccessByMerchantId
(
merchantId
);
if
(
null
==
relation
)
{
partyToMerchantRpService
.
insert
(
...
...
@@ -138,6 +136,11 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
partyToMerchantRpService
.
updateById
(
MerchantConvert
.
convertPartyToMerchant
(
relation
.
getId
(),
merchantId
,
apply
.
getMerchantNo
()));
}
// 新增绑定记录
if
(
flag
)
{
StudioMerchantApply
bindApply
=
MerchantConvert
.
convertBindApply
(
studioId
,
apply
);
studioMerchantApplyRpService
.
insert
(
bindApply
);
}
}
@Override
...
...
@@ -257,7 +260,7 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
PartyToMerchant
old
=
getRelation
(
apply
.
getStudioId
());
// 1. 绑定场馆
this
.
bind
(
apply
.
getStudioId
(),
event
.
getMerchantId
());
this
.
bind
(
apply
.
getStudioId
(),
event
.
getMerchantId
()
,
false
);
// 2. 绑定品牌
brandMerchantService
.
bind
(
apply
.
getBrandId
(),
event
.
getMerchantId
());
...
...
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