记得上下班打卡 | 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
f37f10c3
Commit
f37f10c3
authored
Oct 11, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
券码退回逻辑调整;
parent
ab8a0e35
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
100 additions
and
65 deletions
+100
-65
CandyCouponCodeAdminController.java
...roller/zhengzai/candy/CandyCouponCodeAdminController.java
+34
-24
code.html
.../resources/templates/zhengzai/candy/coupon/code/code.html
+22
-21
coupon1.html
...esources/templates/zhengzai/candy/coupon/mgt/coupon1.html
+2
-1
coupon2.html
...esources/templates/zhengzai/candy/coupon/mgt/coupon2.html
+3
-2
coupon3.html
...esources/templates/zhengzai/candy/coupon/mgt/coupon3.html
+2
-1
coupon4.html
...esources/templates/zhengzai/candy/coupon/mgt/coupon4.html
+2
-1
ICandyUserCouponAdminService.java
.../zhengzai/candy/service/ICandyUserCouponAdminService.java
+7
-0
CandyUserCouponAdminServiceImpl.java
...i/candy/service/impl/CandyUserCouponAdminServiceImpl.java
+11
-0
CandyCouponCodeOptParam.java
...dnet/service/candy/dto/admin/CandyCouponCodeOptParam.java
+4
-0
CandyMgtCouponMapper.xml
...m/liquidnet/service/candy/mapper/CandyMgtCouponMapper.xml
+4
-7
TestAdam.java
...m/liquidnet-service-adam-impl/src/test/java/TestAdam.java
+9
-8
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/candy/CandyCouponCodeAdminController.java
View file @
f37f10c3
package
com
.
liquidnet
.
client
.
admin
.
web
.
controller
.
zhengzai
.
candy
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
...
...
@@ -9,9 +8,11 @@ import com.liquidnet.client.admin.common.core.controller.BaseController;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.common.enums.BusinessType
;
import
com.liquidnet.client.admin.common.utils.ShiroUtils
;
import
com.liquidnet.client.admin.common.utils.poi.ExcelUtil
;
import
com.liquidnet.client.admin.zhengzai.candy.dto.CandyCouponCodeExcelDto
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponCodeAdminService
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyUserCouponAdminService
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
...
...
@@ -21,6 +22,7 @@ import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto;
import
com.liquidnet.service.candy.dto.admin.CandyCouponCodeListParam
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponCodeOptParam
;
import
com.liquidnet.service.candy.entity.CandyCouponCode
;
import
com.liquidnet.service.candy.entity.CandyUserCoupon
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -42,6 +44,8 @@ public class CandyCouponCodeAdminController extends BaseController {
private
RedisUtil
redisUtil
;
@Autowired
private
ICandyCouponCodeAdminService
candyCouponCodeAdminService
;
@Autowired
private
ICandyUserCouponAdminService
candyUserCouponAdminService
;
@GetMapping
()
public
String
view
(
@RequestParam
String
couponId
,
ModelMap
mmap
)
{
...
...
@@ -65,6 +69,7 @@ public class CandyCouponCodeAdminController extends BaseController {
.
select
(
CandyCouponCode:
:
getCcode
,
CandyCouponCode:
:
getCouponId
,
CandyCouponCode:
:
getUcouponId
,
CandyCouponCode:
:
getRedeemMobile
,
CandyCouponCode:
:
getState
);
...
...
@@ -142,13 +147,13 @@ public class CandyCouponCodeAdminController extends BaseController {
return
AjaxResult
.
warn
(
"无效传参"
);
}
String
couponId
=
optParam
.
getCouponId
();
List
<
String
>
ccodes
=
optParam
.
getCcode
s
();
if
(
StringUtils
.
isBlank
(
couponId
)
||
CollectionUtils
.
isEmpty
(
ccode
s
))
{
List
<
String
>
ucouponIds
=
optParam
.
getUcouponId
s
();
if
(
StringUtils
.
isBlank
(
couponId
)
||
CollectionUtils
.
isEmpty
(
ucouponId
s
))
{
return
AjaxResult
.
warn
(
"参数无效"
);
}
LambdaQueryWrapper
<
CandyCouponCode
>
couponCodeLambdaQueryWrapper
=
Wrappers
.
lambdaQuery
(
CandyCouponCode
.
class
);
couponCodeLambdaQueryWrapper
.
in
(
CandyCouponCode:
:
get
Ccode
,
ccode
s
);
couponCodeLambdaQueryWrapper
.
in
(
CandyCouponCode:
:
get
UcouponId
,
ucouponId
s
);
couponCodeLambdaQueryWrapper
.
eq
(
CandyCouponCode:
:
getCouponId
,
couponId
);
List
<
CandyCouponCode
>
list
=
candyCouponCodeAdminService
.
list
(
couponCodeLambdaQueryWrapper
);
...
...
@@ -158,34 +163,39 @@ public class CandyCouponCodeAdminController extends BaseController {
List
<
CandyUserCouponBasicDto
>
vos
=
(
List
<
CandyUserCouponBasicDto
>)
redisUtil
.
get
(
uckey
);
if
(!
CollectionUtils
.
isEmpty
(
vos
))
{
CandyUserCouponBasicDto
userCouponBasicDto
=
vos
.
stream
().
filter
(
v
->
v
.
getCouponId
().
equals
(
couponId
)).
findAny
().
orElse
(
null
);
vos
.
removeIf
(
rv
->
rv
.
getUcouponId
().
equals
(
r
.
getUcouponId
()));
}
if
(
null
!=
userCouponBasicDto
&&
userCouponBasicDto
.
getState
()
==
1
)
{
String
cckey
=
CandyRedisConst
.
BASIC_COUPON_CODE
.
concat
(
r
.
getCcode
());
CandyCouponCodeDto
dto
=
(
CandyCouponCodeDto
)
redisUtil
.
get
(
cckey
);
ccodeUpdateList
.
add
(
r
.
getUcouponId
());
});
if
(
null
!=
dto
&&
dto
.
getState
()
==
1
)
{
dto
.
setState
(
5
);
redisUtil
.
set
(
cckey
,
dto
)
;
if
(!
CollectionUtils
.
isEmpty
(
ccodeUpdateList
)
)
{
LocalDateTime
now
=
LocalDateTime
.
now
(
);
String
loginName
=
ShiroUtils
.
getLoginName
(),
comment
=
"RECOVER"
;
vos
.
removeIf
(
vr
->
vr
.
getCouponId
().
equals
(
couponId
));
redisUtil
.
set
(
uckey
,
vos
);
LambdaUpdateWrapper
<
CandyUserCoupon
>
userCouponLambdaUpdateWrapper
=
Wrappers
.
lambdaUpdate
(
CandyUserCoupon
.
class
);
userCouponLambdaUpdateWrapper
.
in
(
CandyUserCoupon:
:
getUcouponId
,
ccodeUpdateList
);
userCouponLambdaUpdateWrapper
.
eq
(
CandyUserCoupon:
:
getCouponId
,
couponId
);
ccodeUpdateList
.
add
(
dto
.
getCcode
());
}
}
}
});
userCouponLambdaUpdateWrapper
.
set
(
CandyUserCoupon:
:
getState
,
2
);
userCouponLambdaUpdateWrapper
.
set
(
CandyUserCoupon:
:
getUpdatedAt
,
now
);
userCouponLambdaUpdateWrapper
.
set
(
CandyUserCoupon:
:
getOperator
,
loginName
);
userCouponLambdaUpdateWrapper
.
set
(
CandyUserCoupon:
:
getComment
,
comment
);
boolean
update
=
candyUserCouponAdminService
.
update
(
userCouponLambdaUpdateWrapper
);
logger
.
info
(
"Recover:coupon.code:[couponId={},updateUserCouponRst={}]"
,
couponId
,
update
);
if
(!
CollectionUtils
.
isEmpty
(
ccodeUpdateList
))
{
LambdaUpdateWrapper
<
CandyCouponCode
>
couponCodeUpdateWrapper
=
Wrappers
.
lambdaUpdate
(
CandyCouponCode
.
class
);
couponCodeUpdateWrapper
.
in
(
CandyCouponCode:
:
getCcode
,
ccodeUpdateList
).
eq
(
CandyCouponCode:
:
getCouponId
,
couponId
);
couponCodeUpdateWrapper
.
in
(
CandyCouponCode:
:
getUcouponId
,
ccodeUpdateList
);
couponCodeUpdateWrapper
.
eq
(
CandyCouponCode:
:
getCouponId
,
couponId
);
CandyCouponCode
updateCouponCode
=
new
CandyCouponCode
();
updateCouponCode
.
setState
(
5
);
updateCouponCode
.
setUpdatedAt
(
LocalDateTime
.
now
());
couponCodeUpdateWrapper
.
set
(
CandyCouponCode:
:
getState
,
5
);
couponCodeUpdateWrapper
.
set
(
CandyCouponCode:
:
getUpdatedAt
,
now
);
couponCodeUpdateWrapper
.
set
(
CandyCouponCode:
:
getOperator
,
loginName
);
couponCodeUpdateWrapper
.
set
(
CandyCouponCode:
:
getComment
,
comment
);
update
=
candyCouponCodeAdminService
.
update
(
couponCodeUpdateWrapper
);
logger
.
info
(
"Recover:coupon.code:[couponId={},updateCouponCodeRst={}]"
,
couponId
,
update
);
return
toAjax
(
candyCouponCodeAdminService
.
update
(
updateCouponCode
,
couponCodeUpdateWrapper
)
);
return
toAjax
(
update
);
}
return
toAjax
(
false
);
}
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/code/code.html
View file @
f37f10c3
...
...
@@ -31,12 +31,12 @@
<a
class=
"btn btn-warning multiple disabled"
onclick=
"$.table.exportExcel()"
shiro:hasPermission=
"candy:coupon:code:export"
>
<i
class=
"fa fa-download"
></i>
导出
</a>
<a
class=
"btn btn-primary multiple disabled selectChangeShowInvalid"
style=
"display: none"
onclick=
"invalidHandler()"
shiro:hasPermission=
"candy:coupon:code:invalid"
>
<i
class=
"fa fa-edit"
></i>
批量失效
</a
>
<a
class=
"btn btn-danger multiple disabled selectChangeShowRecover"
style=
"display: none"
onclick=
"recoverHandler()"
shiro:hasPermission=
"candy:coupon:code:recover"
>
<i
class=
"fa fa-remove"
></i>
批量退回
</a
>
<!-- <a class="btn btn-primary multiple disabled selectChangeShowInvalid" style="display: none" onclick="invalidHandler()" shiro:hasPermission="candy:coupon:code:invalid">--
>
<!-- <i class="fa fa-edit"></i> 批量失效-->
<!-- </a>--
>
<!-- <a class="btn btn-danger multiple disabled selectChangeShowRecover" style="display: none" onclick="recoverHandler()" shiro:hasPermission="candy:coupon:code:recover">--
>
<!-- <i class="fa fa-remove"></i> 批量退回-->
<!-- </a>--
>
</div>
<div
class=
"col-sm-12 select-table table-striped"
>
...
...
@@ -92,7 +92,7 @@
if
(
row
.
state
===
0
)
{
actions
.
push
(
'<a class="btn btn-primary btn-xs '
+
invalidFlag
+
'" href="javascript:void(0)" onclick="invalidHandler(
\'
'
+
row
.
ccode
+
'
\'
)"><i class="fa fa-edit"></i>失效</a> '
);
}
else
if
(
row
.
state
===
1
)
{
actions
.
push
(
'<a class="btn btn-danger btn-xs '
+
recoverFlag
+
'" href="javascript:void(0)" onclick="recoverHandler(
\'
'
+
row
.
ccode
+
'
\'
)"><i class="fa fa-remove"></i>退回</a>'
);
actions
.
push
(
'<a class="btn btn-danger btn-xs '
+
recoverFlag
+
'" href="javascript:void(0)" onclick="recoverHandler(
\'
'
+
row
.
ccode
+
'
\'
,'
+
row
.
ucouponId
+
'
\'
)"><i class="fa fa-remove"></i>退回</a>'
);
}
return
actions
.
join
(
''
);
}
...
...
@@ -120,26 +120,27 @@
}
}
function
recoverHandler
(
ccode
)
{
function
recoverHandler
(
ccode
,
ucouponId
)
{
if
(
ccode
!==
null
&&
ccode
!==
undefined
)
{
var
data
=
{
"couponId"
:
couponId
,
"ccodes"
:
ccode
};
var
data
=
{
"
ucouponId"
:
ucouponId
,
"
couponId"
:
couponId
,
"ccodes"
:
ccode
};
$
.
operate
.
submit
(
'code/recover'
,
"post"
,
"json"
,
data
);
}
else
{
$
.
operate
.
batchProcessingForCouponCode
(
couponId
,
2
);
}
// else {
// $.operate.batchProcessingForCouponCode(couponId, 2);
// }
}
function
selectChange
()
{
let
val
=
$
(
".selectChange"
).
val
();
console
.
log
(
typeof
val
);
if
(
val
===
'0'
)
{
$
(
".selectChangeShowInvalid"
).
show
();
}
else
if
(
val
===
'1'
)
{
// $(".selectChangeShowRecover").show();
}
else
{
$
(
".selectChangeShowInvalid"
).
hide
();
$
(
".selectChangeShowRecover"
).
hide
();
}
//
let val = $(".selectChange").val();
//
console.log(typeof val);
//
if (val === '0') {
//
$(".selectChangeShowInvalid").show();
//
} else if (val === '1') {
//
// $(".selectChangeShowRecover").show();
//
} else {
//
$(".selectChangeShowInvalid").hide();
//
$(".selectChangeShowRecover").hide();
//
}
}
</script>
</body>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/coupon1.html
View file @
f37f10c3
...
...
@@ -66,6 +66,7 @@
// updateUrl: prefix + "/edit/{id}",
// exportUrl: prefix + "/export",
sortName
:
"createdAt"
,
sortOrder
:
"desc"
,
modalName
:
"代金券"
,
columns
:
[
{
...
...
@@ -145,7 +146,7 @@
/* 查看码列表 */
function couponCodeList(couponId) {
var url = '
candy
/
coupon
/
code
?
couponId
=
' + couponId;
$.modal.openTab("
查看
码列表", url);
$.modal.openTab("
代金
码列表", url);
}
</script>
</body>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/coupon2.html
View file @
f37f10c3
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
xmlns:shiro=
"http://www.pollix.at/thymeleaf/shiro"
>
<head>
<th:block
th:include=
"include :: header('
代金
券')"
/>
<th:block
th:include=
"include :: header('
满减
券')"
/>
</head>
<body
class=
"gray-bg"
>
<div
class=
"container-div"
>
...
...
@@ -66,6 +66,7 @@
// updateUrl: prefix + "/edit/{id}",
// exportUrl: prefix + "/export",
sortName
:
"createdAt"
,
sortOrder
:
"desc"
,
modalName
:
"满减券"
,
columns
:
[
{
...
...
@@ -145,7 +146,7 @@
/* 查看码列表 */
function couponCodeList(couponId) {
var url = '
candy
/
coupon
/
code
?
couponId
=
' + couponId;
$.modal.openTab("
查看
码列表", url);
$.modal.openTab("
满减
码列表", url);
}
</script>
</body>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/coupon3.html
View file @
f37f10c3
...
...
@@ -64,6 +64,7 @@
// updateUrl: prefix + "/edit/{id}",
// exportUrl: prefix + "/export",
sortName
:
"createdAt"
,
sortOrder
:
"desc"
,
modalName
:
"兑换券"
,
columns
:
[
{
...
...
@@ -126,7 +127,7 @@
/* 查看码列表 */
function couponCodeList(couponId) {
var url = '
candy
/
coupon
/
code
?
couponId
=
' + couponId;
$.modal.openTab("
查看
码列表", url);
$.modal.openTab("
兑换
码列表", url);
}
</script>
</body>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/coupon4.html
View file @
f37f10c3
...
...
@@ -66,6 +66,7 @@
// updateUrl: prefix + "/edit/{id}",
// exportUrl: prefix + "/export",
sortName
:
"createdAt"
,
sortOrder
:
"desc"
,
modalName
:
"折扣券"
,
columns
:
[
{
...
...
@@ -145,7 +146,7 @@
/* 查看码列表 */
function couponCodeList(couponId) {
var url = '
candy
/
coupon
/
code
?
couponId
=
' + couponId;
$.modal.openTab("
查看
码列表", url);
$.modal.openTab("
折扣
码列表", url);
}
</script>
</body>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/candy/service/ICandyUserCouponAdminService.java
0 → 100644
View file @
f37f10c3
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
candy
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.liquidnet.service.candy.entity.CandyUserCoupon
;
public
interface
ICandyUserCouponAdminService
extends
IService
<
CandyUserCoupon
>
{
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/candy/service/impl/CandyUserCouponAdminServiceImpl.java
0 → 100644
View file @
f37f10c3
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
candy
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyUserCouponAdminService
;
import
com.liquidnet.service.candy.entity.CandyUserCoupon
;
import
com.liquidnet.service.candy.mapper.CandyUserCouponMapper
;
import
org.springframework.stereotype.Service
;
@Service
public
class
CandyUserCouponAdminServiceImpl
extends
ServiceImpl
<
CandyUserCouponMapper
,
CandyUserCoupon
>
implements
ICandyUserCouponAdminService
{
}
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/dto/admin/CandyCouponCodeOptParam.java
View file @
f37f10c3
...
...
@@ -6,6 +6,10 @@ import java.util.List;
@Data
public
class
CandyCouponCodeOptParam
{
/**
* ~candy_user_coupon.ucoupon_id
*/
private
List
<
String
>
ucouponIds
;
/**
* ~candy_coupon.coupon_id
*/
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/resources/com/liquidnet/service/candy/mapper/CandyMgtCouponMapper.xml
View file @
f37f10c3
...
...
@@ -114,13 +114,12 @@
cmc.event_limit,
cmc.event_at,
cmc.`operator`,
cmc.created_at,
cmc.created_at
created_at
,
cmc.updated_at
FROM candy_mgt_coupon cmc
, candy_coupon cc
WHERE
cmc.coupon_id = cc.coupon_id
AND
cmc.state
<![CDATA[<>]]>
2
FROM candy_mgt_coupon cmc
LEFT JOIN candy_coupon cc ON
cmc.coupon_id = cc.coupon_id
WHERE
cmc.state
<![CDATA[<>]]>
2
AND cc.`exclusive` = 0
<if
test=
"mcouponId != null and mcouponId != ''"
>
AND cmc.mcoupon_id = #{mcouponId,jdbcType=VARCHAR}
</if>
...
...
@@ -136,8 +135,6 @@
<if
test=
"busiType != null"
>
AND cc.busi_type = #{busiType,jdbcType=SMALLINT}
</if>
ORDER BY cmc.created_at DESC
</select>
<select
id=
"selectMultiForMgtCouponMemberDto"
resultMap=
"Rst_MgtCouponMemberDto"
>
select cc.coupon_id,
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/test/java/TestAdam.java
View file @
f37f10c3
...
...
@@ -13,15 +13,16 @@ public class TestAdam {
"adam:blacklist:member:uid"
,
"adam:identity:mobile:13724286255"
,
"adam:i
nfo:user:27053556090372096380751
7"
,
"adam:info:
morder:2104440
"
,
"adam:info:morder:
2104440
"
,
"adam:info:umember:
2104440
"
,
"adam:info:real_name:
2104440
"
,
"adam:info:third_party:
2104440
"
,
"adam:info:enters:
2104440
"
,
"adam:info:addresses:
2104440
"
,
"adam:i
dentity:mobile:1552928273
7"
,
"adam:info:
user:882883
"
,
"adam:info:morder:
882883
"
,
"adam:info:umember:
882883
"
,
"adam:info:real_name:
882883
"
,
"adam:info:third_party:
882883
"
,
"adam:info:enters:
882883
"
,
"adam:info:addresses:
882883
"
,
"adam:info:member:code:GMRGBUQB30"
,
"adam:info:certification:1141181199209160192"
,
"adam:identity:mobile:18505123456"
,
"adam:identity:sso:245482441472573441815566"
,
...
...
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