Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
1fb3e16d
Commit
1fb3e16d
authored
Aug 23, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
dc5951d4
a5f518e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
7 deletions
+53
-7
UserCouponBiz.java
...in/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
+51
-5
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+1
-1
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+1
-1
No files found.
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
View file @
1fb3e16d
...
@@ -91,6 +91,26 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -91,6 +91,26 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
log
.
error
(
userId
+
"----已领优惠卷"
);
log
.
error
(
userId
+
"----已领优惠卷"
);
return
null
;
return
null
;
}
}
falg
=
checkLed
(
userId
,
couponId
,
coupon
.
getLimitCollar
(),
coupon
.
getQuota
());
if
(
falg
){
log
.
error
(
userId
+
"----已超过领取限制"
);
return
null
;
}
return
led
(
coupon
,
userId
);
}
//后台领劵(一个劵可以发多张)
public
String
adminUserLedCoupon
(
Integer
userId
,
Integer
couponId
){
Coupon
coupon
=
couponBiz
.
selectById
(
couponId
);
if
(
coupon
==
null
||
coupon
.
getIsDel
()!=
0
||
coupon
.
getStatus
()!=
1
){
log
.
error
(
userId
+
"----无可领取优惠卷"
);
return
null
;
}
boolean
falg
=
checkLed
(
userId
,
couponId
,
coupon
.
getLimitCollar
(),
coupon
.
getQuota
());
if
(
falg
){
log
.
error
(
userId
+
"----已超过领取限制"
);
return
null
;
}
return
led
(
coupon
,
userId
);
return
led
(
coupon
,
userId
);
}
}
...
@@ -123,7 +143,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -123,7 +143,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
//检查用户是否领卷
//检查用户是否领卷
public
boolean
checkUserLed
(
Integer
userId
,
Integer
id
){
public
boolean
checkUserLed
(
Integer
userId
,
Integer
id
){
Example
example
=
new
Example
(
UserCoupon
.
class
);
Example
example
=
new
Example
(
UserCoupon
.
class
);
example
.
createCriteria
().
andEqualTo
(
"userId"
,
userId
).
andEqualTo
(
"couponId"
,
id
);
example
.
createCriteria
().
andEqualTo
(
"userId"
,
userId
).
andEqualTo
(
"couponId"
,
id
)
.
andEqualTo
(
"isDel"
,
0
)
;
List
<
UserCoupon
>
list
=
selectByExample
(
example
);
List
<
UserCoupon
>
list
=
selectByExample
(
example
);
if
(
list
.
size
()>
0
){
if
(
list
.
size
()>
0
){
log
.
error
(
userId
+
"----已领优惠卷"
);
log
.
error
(
userId
+
"----已领优惠卷"
);
...
@@ -132,6 +152,31 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -132,6 +152,31 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
return
false
;
return
false
;
}
}
//检查用户是否可领卷
public
boolean
checkLed
(
Integer
userId
,
Integer
id
,
Integer
limitCollar
,
Integer
quota
){
Example
example
=
new
Example
(
UserCoupon
.
class
);
example
.
createCriteria
().
andEqualTo
(
"userId"
,
userId
).
andEqualTo
(
"couponId"
,
id
).
andEqualTo
(
"isDel"
,
0
);
Integer
num
=
selectCountByExample
(
example
);
log
.
info
(
"-用户已领劵--userId==="
+
userId
+
"----num==="
+
num
+
"----couponid==="
+
id
);
if
(
num
==
null
||
num
==
0
){
log
.
error
(
userId
+
"----无领此优惠卷----couponid==="
+
id
);
return
false
;
}
if
(
limitCollar
==
null
||
num
>=
limitCollar
){
log
.
error
(
userId
+
"----此优惠卷超过每人限领次数----couponid==="
+
id
+
"----limitCollar==="
+
limitCollar
);
return
true
;
}
example
.
clear
();
example
.
createCriteria
().
andEqualTo
(
"couponId"
,
id
).
andEqualTo
(
"isDel"
,
0
);
num
=
selectCountByExample
(
example
);
log
.
info
(
"---发劵数量----num==="
+
num
+
"----limitCollar==="
+
limitCollar
+
"----quota==="
+
quota
+
"----couponid==="
+
id
);
if
(
quota
==
null
||
quota
==
0
||(
num
!=
null
&&
num
>
0
&&
num
>=
quota
)){
log
.
error
(
userId
+
"----此优惠卷超过发券数量----couponid==="
+
id
+
"----quota==="
+
quota
);
return
true
;
}
return
false
;
}
//获取我的优惠卷
//获取我的优惠卷
public
ObjectRestResponse
getCouponList
(
Integer
userId
,
int
type
,
Integer
channel
,
BigDecimal
amout
){
public
ObjectRestResponse
getCouponList
(
Integer
userId
,
int
type
,
Integer
channel
,
BigDecimal
amout
){
if
(
userId
==
null
||
userId
==
0
){
if
(
userId
==
null
||
userId
==
0
){
...
@@ -206,7 +251,6 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -206,7 +251,6 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
result
.
put
(
"array"
,
array
);
result
.
put
(
"array"
,
array
);
return
ObjectRestResponse
.
succ
(
result
);
return
ObjectRestResponse
.
succ
(
result
);
}
}
//获取我的优惠卷
//获取我的优惠卷
public
ObjectRestResponse
getUserCouponList
(
Integer
userId
,
int
type
,
Integer
channel
,
BigDecimal
amout
)
{
public
ObjectRestResponse
getUserCouponList
(
Integer
userId
,
int
type
,
Integer
channel
,
BigDecimal
amout
)
{
if
(
userId
==
null
||
userId
==
0
)
{
if
(
userId
==
null
||
userId
==
0
)
{
...
@@ -378,16 +422,17 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -378,16 +422,17 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
UserCoupon
userCoupon
;
UserCoupon
userCoupon
;
List
<
UserCoupon
>
userCoupons
=
new
ArrayList
<>();
List
<
UserCoupon
>
userCoupons
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
userCouponSendDTO
.
getCouponNum
();
i
++){
for
(
int
i
=
0
;
i
<
userCouponSendDTO
.
getCouponNum
();
i
++){
userCoupon
=
new
UserCoupon
();
/*
userCoupon = new UserCoupon();
userCoupon.setCouponId(userCouponSendDTO.getCouponId());
userCoupon.setCouponId(userCouponSendDTO.getCouponId());
userCoupon.setUserId(appUserLogin.getId());
userCoupon.setUserId(appUserLogin.getId());
userCoupon.setCrtTime(Instant.now().toEpochMilli());
userCoupon.setCrtTime(Instant.now().toEpochMilli());
userCoupon.setStartTime(couponVo.getValidStartTime());
userCoupon.setStartTime(couponVo.getValidStartTime());
userCoupon.setExpireTime(couponVo.getValidEndTime());
userCoupon.setExpireTime(couponVo.getValidEndTime());
userCoupon.setTickerNo(Snowflake.build()+"");
userCoupon.setTickerNo(Snowflake.build()+"");
userCoupons
.
add
(
userCoupon
);
userCoupons.add(userCoupon);*/
adminUserLedCoupon
(
appUserLogin
.
getId
(),
userCouponSendDTO
.
getCouponId
());
}
}
return
mapper
.
inserBatch
(
userCoupons
)
;
return
1
;
}
}
public
long
importUserCoupon
(
Integer
couponId
,
List
<
String
[]>
userCounponData
)
{
public
long
importUserCoupon
(
Integer
couponId
,
List
<
String
[]>
userCounponData
)
{
...
@@ -426,6 +471,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -426,6 +471,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
UserCoupon
userCoupon
=
new
UserCoupon
();
UserCoupon
userCoupon
=
new
UserCoupon
();
userCoupon
.
setUserId
(
userId
);
userCoupon
.
setUserId
(
userId
);
userCoupon
.
setIsUse
(
0
);
userCoupon
.
setIsUse
(
0
);
userCoupon
.
setIsDel
(
0
);
Long
couponNumber
=
selectCount
(
userCoupon
);
Long
couponNumber
=
selectCount
(
userCoupon
);
userInfoDTO
.
setCouponNumber
(
couponNumber
);
userInfoDTO
.
setCouponNumber
(
couponNumber
);
return
userInfoDTO
;
return
userInfoDTO
;
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
1fb3e16d
...
@@ -531,7 +531,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -531,7 +531,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
((
vehicleBookInfo
.
getBookedDate
()
&
andOperationFactor
)
!=
andOperationRs
)){
//已经被预定
((
vehicleBookInfo
.
getBookedDate
()
&
andOperationFactor
)
!=
andOperationRs
)){
//已经被预定
//当天已经被预定检查小时是否也被预定
//当天已经被预定检查小时是否也被预定
return
filterHourInfoBooked
(
vehicleId
,
hourInfo
);
return
filterHourInfoBooked
(
vehicleId
,
hourInfo
);
}
else
if
((
vehicleBookInfo
.
getBookedDate
()
&
andOperationFactor
)
==
0
){
//未被预定,查看时间是否被预定
}
else
if
(
vehicleBookInfo
!=
null
&&
vehicleBookInfo
.
getBookedDate
()
!=
null
&&
(
vehicleBookInfo
.
getBookedDate
()
&
andOperationFactor
)
==
0
){
//未被预定,查看时间是否被预定
return
filterHourInfoBooked
(
vehicleId
,
hourInfo
);
return
filterHourInfoBooked
(
vehicleId
,
hourInfo
);
}
}
return
Boolean
.
TRUE
;
return
Boolean
.
TRUE
;
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
1fb3e16d
...
@@ -588,7 +588,7 @@
...
@@ -588,7 +588,7 @@
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
hasVehicle desc,
hasVehicle desc,
</if>
</if>
distance asc
distance asc
, model_id asc
</if>
</if>
</select>
</select>
...
...
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