Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
0960107c
Commit
0960107c
authored
Oct 29, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'fixbug/1026084' into 'master'"
This reverts merge request !1018
parent
7e3ab7f9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
32 deletions
+9
-32
BookBizException.java
...java/com/pcloud/book/base/exception/BookBizException.java
+0
-10
GiftCouponPackageBizImpl.java
...ud/book/giftcoupon/biz/impl/GiftCouponPackageBizImpl.java
+3
-12
ExceptionDTO.java
...ain/java/com/pcloud/book/giftcoupon/dto/ExceptionDTO.java
+1
-4
GiftCouponPackageFacade.java
...cloud/book/giftcoupon/facade/GiftCouponPackageFacade.java
+1
-5
GiftCategory.xml
...ook/src/main/resources/mapper/giftConpon/GiftCategory.xml
+2
-1
GiftCouplePackageDao.xml
...main/resources/mapper/giftConpon/GiftCouplePackageDao.xml
+2
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/base/exception/BookBizException.java
View file @
0960107c
...
@@ -35,16 +35,6 @@ public class BookBizException extends BizException{
...
@@ -35,16 +35,6 @@ public class BookBizException extends BizException{
* 参数为空
* 参数为空
*/
*/
public
static
final
int
PARAM_IS_NULL
=
20210002
;
public
static
final
int
PARAM_IS_NULL
=
20210002
;
/**
* 库存为空
*/
public
static
final
int
STOCK_IS_EMPTY
=
20210111
;
/**
* 库存为空
*/
public
static
final
int
HAS_RECEIVED
=
20210112
;
/**
/**
* 时间格式错误
* 时间格式错误
...
...
pcloud-service-book/src/main/java/com/pcloud/book/giftcoupon/biz/impl/GiftCouponPackageBizImpl.java
View file @
0960107c
...
@@ -339,11 +339,11 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
...
@@ -339,11 +339,11 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
Integer
giftReceiveCount
=
giftReceiveDao
.
getGiftReceiveCount
(
giftReceive
.
getWechatUserId
(),
giftReceive
.
getGiftPackageId
());
Integer
giftReceiveCount
=
giftReceiveDao
.
getGiftReceiveCount
(
giftReceive
.
getWechatUserId
(),
giftReceive
.
getGiftPackageId
());
//库存减一
//库存减一
if
(
giftCouponPackage
.
getStock
()<
1
){
if
(
giftCouponPackage
.
getStock
()<
1
){
throw
new
BookBizException
(
BookBizException
.
STOCK_IS_EMPTY
,
"今日库存已用完
"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"库存不够
"
);
}
}
//超过单个奖券领取上限
//超过单个奖券领取上限
if
(
giftReceiveCount
>=
giftCouponPackage
.
getReceiveLimit
()){
if
(
giftReceiveCount
>=
giftCouponPackage
.
getReceiveLimit
()){
throw
new
BookBizException
(
BookBizException
.
HAS_RECEIVED
,
"该类型的兑换券您已经领取过,请前往“我的券库”使用吧"
);
throw
new
BookBizException
(
BookBizException
.
SUCCESS
,
"该类型的兑换券您已经领取过,请前往“我的券库”使用吧"
);
}
}
//超过券库总领取上限
//超过券库总领取上限
Integer
giftAllReceiveCount
=
giftReceiveDao
.
getGiftAllReceiveCount
(
giftReceive
.
getWechatUserId
());
Integer
giftAllReceiveCount
=
giftReceiveDao
.
getGiftAllReceiveCount
(
giftReceive
.
getWechatUserId
());
...
@@ -589,9 +589,8 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
...
@@ -589,9 +589,8 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
List
<
Long
>
list
=
giftCategoryDao
.
getByParams
(
map
);
List
<
Long
>
list
=
giftCategoryDao
.
getByParams
(
map
);
Random
index
=
new
Random
();
Random
index
=
new
Random
();
List
<
Long
>
resultIds
=
new
ArrayList
<>();
List
<
Long
>
resultIds
=
new
ArrayList
<>();
List
<
Integer
>
indexList
=
new
ArrayList
<>();
if
(
list
.
size
()>=
COUPON_MAX_SHOW_SIZE
){
if
(
list
.
size
()>=
COUPON_MAX_SHOW_SIZE
){
List
<
Integer
>
indexList
=
new
ArrayList
<>();
for
(
int
i
=
0
,
j
;
i
<
COUPON_MAX_SHOW_SIZE
;
i
++){
for
(
int
i
=
0
,
j
;
i
<
COUPON_MAX_SHOW_SIZE
;
i
++){
//获取在 list.size 返回内的随机数
//获取在 list.size 返回内的随机数
j
=
index
.
nextInt
(
list
.
size
());
j
=
index
.
nextInt
(
list
.
size
());
...
@@ -605,18 +604,10 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
...
@@ -605,18 +604,10 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
}
}
}
}
}
else
{
}
else
{
List
<
Integer
>
indexList
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
list
)){
if
(!
ListUtils
.
isEmpty
(
list
)){
resultIds
.
addAll
(
list
);
resultIds
.
addAll
(
list
);
}
}
List
<
Long
>
list1
=
giftCategoryDao
.
getOtherByParams
(
map
);
List
<
Long
>
list1
=
giftCategoryDao
.
getOtherByParams
(
map
);
if
(
ListUtils
.
isEmpty
(
list1
)){
return
resultIds
;
}
if
(
list1
.
size
()+
resultIds
.
size
()<=
COUPON_MAX_SHOW_SIZE
){
resultIds
.
addAll
(
list1
);
return
resultIds
;
}
for
(
int
i
=
0
,
j
;
i
<
COUPON_MAX_SHOW_SIZE
-
list
.
size
();
i
++){
for
(
int
i
=
0
,
j
;
i
<
COUPON_MAX_SHOW_SIZE
-
list
.
size
();
i
++){
//获取在 list.size 返回内的随机数
//获取在 list.size 返回内的随机数
j
=
index
.
nextInt
(
list1
.
size
());
j
=
index
.
nextInt
(
list1
.
size
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/giftcoupon/dto/ExceptionDTO.java
View file @
0960107c
...
@@ -8,10 +8,7 @@ import lombok.Data;
...
@@ -8,10 +8,7 @@ import lombok.Data;
public
class
ExceptionDTO
{
public
class
ExceptionDTO
{
String
errorMsg
;
String
errorMsg
;
Integer
errorCode
;
public
ExceptionDTO
(
String
errorMsg
)
{
public
ExceptionDTO
(
String
errorMsg
,
Integer
errorCode
)
{
this
.
errorMsg
=
errorMsg
;
this
.
errorMsg
=
errorMsg
;
this
.
errorCode
=
errorCode
;
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/giftcoupon/facade/GiftCouponPackageFacade.java
View file @
0960107c
...
@@ -132,11 +132,7 @@ public class GiftCouponPackageFacade {
...
@@ -132,11 +132,7 @@ public class GiftCouponPackageFacade {
try
{
try
{
giftCouponPackageBiz
.
createGiftReceive
(
GiftReceive
);
giftCouponPackageBiz
.
createGiftReceive
(
GiftReceive
);
}
catch
(
BookBizException
e
){
}
catch
(
BookBizException
e
){
if
(
BookBizException
.
HAS_RECEIVED
==
e
.
getCode
()
||
BookBizException
.
STOCK_IS_EMPTY
==
e
.
getCode
())
{
return
new
ResponseDto
<>(
e
.
getCode
(),
e
.
getMsg
(),
new
ExceptionDTO
(
e
.
getMsg
()));
return
new
ResponseDto
<>(
BookBizException
.
SUCCESS
,
e
.
getMsg
(),
new
ExceptionDTO
(
e
.
getMsg
(),
e
.
getCode
()));
}
else
{
return
new
ResponseDto
<>(
e
.
getCode
(),
e
.
getMsg
(),
new
ExceptionDTO
(
e
.
getMsg
(),
e
.
getCode
()));
}
}
}
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
...
...
pcloud-service-book/src/main/resources/mapper/giftConpon/GiftCategory.xml
View file @
0960107c
...
@@ -141,6 +141,7 @@
...
@@ -141,6 +141,7 @@
)t on a.id=t.gift_package_id
)t on a.id=t.gift_package_id
where a.is_delete=0
where a.is_delete=0
and a.stock>0
and a.on_shelves=1
and a.on_shelves=1
and a.rec_to_page=1
and a.rec_to_page=1
and now()
<![CDATA[ < ]]>
a.valid_date_end
and now()
<![CDATA[ < ]]>
a.valid_date_end
...
@@ -152,8 +153,8 @@
...
@@ -152,8 +153,8 @@
from
from
gift_coupon_package a
gift_coupon_package a
where a.is_delete=0
where a.is_delete=0
and a.stock>0
and a.on_shelves=1
and a.on_shelves=1
and a.rec_to_page=1
and now()
<![CDATA[ < ]]>
a.valid_date_end
and now()
<![CDATA[ < ]]>
a.valid_date_end
and a.id not in
and a.id not in
(
(
...
...
pcloud-service-book/src/main/resources/mapper/giftConpon/GiftCouplePackageDao.xml
View file @
0960107c
...
@@ -234,6 +234,7 @@
...
@@ -234,6 +234,7 @@
from
from
gift_coupon_package a
gift_coupon_package a
where a.is_delete=0
where a.is_delete=0
and a.stock>0
<if
test=
"title !=null and title !=''"
>
<if
test=
"title !=null and title !=''"
>
and (a.title like concat('%',#{title},'%') or a.resource_number like concat('%',#{title},'%'))
and (a.title like concat('%',#{title},'%') or a.resource_number like concat('%',#{title},'%'))
</if>
</if>
...
@@ -377,6 +378,7 @@
...
@@ -377,6 +378,7 @@
from
from
gift_coupon_package a
gift_coupon_package a
where a.is_delete=0
where a.is_delete=0
and a.stock>0
<if
test=
"title !=null and title !=''"
>
<if
test=
"title !=null and title !=''"
>
and (a.title like concat('%',#{title},'%') or a.url_number like concat('%',#{title},'%'))
and (a.title like concat('%',#{title},'%') or a.url_number like concat('%',#{title},'%'))
</if>
</if>
...
...
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