Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
xunj
/
festival-activites
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit faadb547
authored
Feb 03, 2021
by
xunj
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化
1 parent
118d015c
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
120 additions
and
51 deletions
activity-admin/src/main/java/com/polysoft/activity/config/exception/BusinessException.java
activity-admin/src/main/java/com/polysoft/activity/controller/TestController.java
activity-admin/src/main/java/com/polysoft/activity/mapper/ActivityMapper.java
activity-admin/src/main/java/com/polysoft/activity/model/param/UserInfoParam.java
activity-admin/src/main/java/com/polysoft/activity/service/ActItemService.java
activity-admin/src/main/java/com/polysoft/activity/service/impl/ActItemServiceImpl.java
activity-admin/src/main/java/com/polysoft/activity/service/impl/UserInfoServiceImpl.java
activity-admin/src/main/java/com/polysoft/activity/service/impl/WishServiceImpl.java
activity-admin/src/main/java/com/polysoft/activity/task/CattleBrandCarveUpTask.java
activity-admin/src/main/java/com/polysoft/activity/task/UserSignTask.java
activity-admin/src/main/resources/application-prod.yml
activity-admin/src/main/resources/mapper/ActivityMapper.xml
activity-admin/src/main/resources/mapper/WishMapper.xml
activity-common/src/main/java/com/polysoft/activity/common/utils/PageQuery.java
activity-common/src/main/java/com/polysoft/activity/utils/FileUtils.java
activity-admin/src/main/java/com/polysoft/activity/config/exception/BusinessException.java
0 → 100644
View file @
faadb54
package
com
.
polysoft
.
activity
.
config
.
exception
;
import
javax.servlet.http.HttpServletResponse
;
/**
* @author by zhangbr
* @date 2020/4/20.
*/
public
class
BusinessException
extends
Exception
{
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
statusCode
;
public
BusinessException
()
{
super
();
this
.
statusCode
=
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
;
}
public
BusinessException
(
String
message
)
{
super
(
message
);
this
.
statusCode
=
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
;
}
public
BusinessException
(
Integer
statusCode
,
String
message
)
{
super
(
message
);
this
.
statusCode
=
statusCode
;
}
public
BusinessException
(
Long
statusCode
,
String
message
)
{
super
(
message
);
this
.
statusCode
=
Integer
.
parseInt
(
statusCode
.
toString
());
}
public
Integer
getStatusCode
()
{
return
statusCode
;
}
public
void
setStatusCode
(
Integer
statusCode
)
{
this
.
statusCode
=
statusCode
;
}
}
activity-admin/src/main/java/com/polysoft/activity/controller/TestController.java
View file @
faadb54
...
...
@@ -3,6 +3,7 @@ package com.polysoft.activity.controller;
import
com.polysoft.activity.constant.CommonTypeEnum
;
import
com.polysoft.activity.mapper.ActivityMapper
;
import
com.polysoft.activity.model.dto.AddRedRainDto
;
import
com.polysoft.activity.service.ActItemService
;
import
com.polysoft.activity.utils.ApiResult
;
import
com.polysoft.activity.utils.SnowFlakeUtil
;
import
io.swagger.annotations.Api
;
...
...
@@ -26,23 +27,14 @@ import java.util.Date;
public
class
TestController
{
@Resource
private
Act
ivityMapper
activityMapper
;
private
Act
ItemService
actItemService
;
@GetMapping
(
"/testOne"
)
@ResponseBody
public
ApiResult
testOne
(
@RequestParam
(
value
=
"amount"
)
double
amount
)
{
AddRedRainDto
rainDto
=
new
AddRedRainDto
();
rainDto
.
setRedId
(
SnowFlakeUtil
.
nextId
());
rainDto
.
setUserId
(
152L
);
rainDto
.
setRedType
(
CommonTypeEnum
.
REDPACK_TYPE1
.
getCode
());
rainDto
.
setRedAmount
(
BigDecimal
.
valueOf
(
0.00
));
rainDto
.
setBatchNum
(
98
);
rainDto
.
setIsEnble
(
CommonTypeEnum
.
RED_ISENBLE_NO
.
getCode
());
rainDto
.
setSourceType
(
CommonTypeEnum
.
REDPACK_SOURCE_TYPE4
.
getCode
());
rainDto
.
setCreateTime
(
new
Date
());
activityMapper
.
saveRedRainForOne
(
rainDto
);
return
ApiResult
.
ok
(
activityMapper
.
getRedIdToCattle
(
amount
));
public
ApiResult
testOne
()
throws
Exception
{
return
ApiResult
.
ok
(
actItemService
.
testOne
());
}
}
activity-admin/src/main/java/com/polysoft/activity/mapper/ActivityMapper.java
View file @
faadb54
...
...
@@ -44,6 +44,6 @@ public interface ActivityMapper extends BaseMapper<ActItemDto> {
GrapRedPackResultVO
getGrapRedPackResult
(
GrapRedPackResultDto
dto
);
List
<
GrapRedPackResultVO
>
getGrapRedRainRank
(
GrapRedPackResultDto
dto
);
RedAmountConfVO
getRedAmountConf
(
@Param
(
"redSource"
)
String
redSource
,
@Param
(
"batchNum"
)
Long
batchNum
);
List
<
Long
>
getRedIdToCattle
(
@Param
(
"redAmount"
)
double
redAmount
);
List
<
Long
>
getRedIdToCattle
(
@Param
(
"redAmount"
)
BigDecimal
redAmount
);
}
activity-admin/src/main/java/com/polysoft/activity/model/param/UserInfoParam.java
View file @
faadb54
package
com
.
polysoft
.
activity
.
model
.
param
;
import
com.polysoft.activity.common.utils.PageQuery
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
@ApiModel
(
"用户信息类"
)
@Data
public
class
UserInfoParam
extends
PageQuery
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
phone
;
private
Long
userId
;
private
Long
signId
;
...
...
activity-admin/src/main/java/com/polysoft/activity/service/ActItemService.java
View file @
faadb54
...
...
@@ -19,4 +19,5 @@ public interface ActItemService {
ApiResult
getSmashBasinInfo
(
QuerySmashBasinParam
param
);
ApiResult
getGrapRedPackResult
(
QueeryGrapRedPackResultParam
param
);
ApiResult
getGrapRedRainRank
(
QueeryGrapRedPackResultParam
param
);
ApiResult
testOne
();
}
activity-admin/src/main/java/com/polysoft/activity/service/impl/ActItemServiceImpl.java
View file @
faadb54
...
...
@@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper;
import
com.polysoft.activity.common.utils.BeanTransferUtils
;
import
com.polysoft.activity.common.utils.PageQuery
;
import
com.polysoft.activity.common.utils.PageResult
;
import
com.polysoft.activity.config.exception.BusinessException
;
import
com.polysoft.activity.constant.CommonTypeEnum
;
import
com.polysoft.activity.mapper.ActivityMapper
;
import
com.polysoft.activity.mapper.UserInfoMapper
;
...
...
@@ -21,6 +22,7 @@ import com.polysoft.activity.service.ActItemService;
import
com.polysoft.activity.utils.ApiResult
;
import
com.polysoft.activity.utils.SnowFlakeUtil
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
...
...
@@ -143,4 +145,32 @@ public class ActItemServiceImpl implements ActItemService{
return
ApiResult
.
ok
(
activityMapper
.
getGrapRedRainRank
(
dto
));
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
ApiResult
testOne
()
{
AddRedRainDto
rainDto
=
new
AddRedRainDto
();
rainDto
.
setRedId
(
SnowFlakeUtil
.
nextId
());
rainDto
.
setUserId
(
66L
);
rainDto
.
setRedType
(
CommonTypeEnum
.
REDPACK_TYPE1
.
getCode
());
rainDto
.
setRedAmount
(
BigDecimal
.
valueOf
(
0.00
));
rainDto
.
setBatchNum
(
98
);
rainDto
.
setIsEnble
(
CommonTypeEnum
.
RED_ISENBLE_NO
.
getCode
());
rainDto
.
setSourceType
(
CommonTypeEnum
.
REDPACK_SOURCE_TYPE1
.
getCode
());
rainDto
.
setCreateTime
(
new
Date
());
int
i
=
activityMapper
.
saveRedRainForOne
(
rainDto
);
AddRedRainDto
rainDto1
=
new
AddRedRainDto
();
rainDto1
.
setRedId
(
SnowFlakeUtil
.
nextId
());
rainDto1
.
setUserId
(
66L
);
rainDto1
.
setRedType
(
CommonTypeEnum
.
REDPACK_TYPE1
.
getCode
());
rainDto1
.
setRedAmount
(
BigDecimal
.
valueOf
(
0.00
));
rainDto1
.
setBatchNum
(
98
);
rainDto1
.
setIsEnble
(
CommonTypeEnum
.
RED_ISENBLE_NO
.
getCode
()+
"9999"
);
rainDto1
.
setSourceType
(
CommonTypeEnum
.
REDPACK_SOURCE_TYPE1
.
getCode
());
rainDto1
.
setCreateTime
(
new
Date
());
int
j
=
activityMapper
.
saveRedRainForOne
(
rainDto1
);
return
ApiResult
.
ok
();
}
}
activity-admin/src/main/java/com/polysoft/activity/service/impl/UserInfoServiceImpl.java
View file @
faadb54
...
...
@@ -63,7 +63,7 @@ public class UserInfoServiceImpl implements UserInfoService {
if
(
StringUtils
.
isNotBlank
(
param
.
getPhone
())
||
param
.
getUserId
()
!=
null
){
UserInfoVO
user
=
mapper
.
queryAuthUser
(
param
);
if
(
user
==
null
){
return
ApiResult
.
error
(
500
,
"【很抱歉,您非宝利成员无法
领取红包
】"
);
return
ApiResult
.
error
(
500
,
"【很抱歉,您非宝利成员无法
参与活动
】"
);
}
user
.
setSysCurretTime
(
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
return
ApiResult
.
ok
(
user
);
...
...
@@ -130,7 +130,7 @@ public class UserInfoServiceImpl implements UserInfoService {
if
(
cattleVO
==
null
){
object
.
put
(
"cardType"
,
param
.
getCardType
());
object
.
put
(
"isReceived"
,
false
);
return
ApiResult
.
ok
(
"200"
,
"牛牌已被
他人领取,领取牛牌失败
"
,
object
);
return
ApiResult
.
ok
(
"200"
,
"牛牌已被
领取
"
,
object
);
}
List
<
SaveUserCattleDto
>
list
=
new
ArrayList
<>();
SaveUserCattleDto
dto
=
new
SaveUserCattleDto
();
...
...
@@ -164,7 +164,7 @@ public class UserInfoServiceImpl implements UserInfoService {
CattleBrandConfVO
confVO
=
cattleBrandMapper
.
queryCattleBrandConf
(
today
);
if
(
param
.
getSignId
()
!=
null
){
//扣除金额
BigDecimal
kouchu
=
BigDecimal
.
valueOf
(
5
.00
);
BigDecimal
kouchu
=
BigDecimal
.
valueOf
(
20
.00
);
//查询余额是否大于 5 元
UserInfoParam
userInfoParam
=
new
UserInfoParam
();
userInfoParam
.
setUserId
(
param
.
getUserId
());
...
...
@@ -179,7 +179,7 @@ public class UserInfoServiceImpl implements UserInfoService {
AddRedRainDto
rainDto
=
new
AddRedRainDto
();
rainDto
.
setRedId
(
SnowFlakeUtil
.
nextId
());
rainDto
.
setUserId
(
param
.
getUserId
());
rainDto
.
setRedAmount
(
BigDecimal
.
valueOf
(-
5
.00
));
rainDto
.
setRedAmount
(
BigDecimal
.
valueOf
(-
20
.00
));
rainDto
.
setRedType
(
CommonTypeEnum
.
REDPACK_TYPE1
.
getCode
());
rainDto
.
setCreateTime
(
date
);
rainDto
.
setIsEnble
(
CommonTypeEnum
.
RED_ISENBLE_YES
.
getCode
());
...
...
activity-admin/src/main/java/com/polysoft/activity/service/impl/WishServiceImpl.java
View file @
faadb54
...
...
@@ -57,26 +57,27 @@ public class WishServiceImpl implements WishService {
@Override
public
ApiResult
addWish
(
AddWishParam
param
)
{
try
{
Date
date
=
new
Date
();
AddWishDto
dto
=
BeanTransferUtils
.
transfer
(
param
,
AddWishDto
.
class
);
Long
wishId
=
SnowFlakeUtil
.
nextId
();
CattleBrandVO
cattleBrandVO
=
null
;
//判断是否当天首次发布心愿
int
firstPushNum
=
mapper
.
getWishFirstPushOnDay
(
param
.
getUserId
(),
DateUtil
.
format
(
new
Date
()
,
"yyyy-MM-dd"
));
int
firstPushNum
=
mapper
.
getWishFirstPushOnDay
(
param
.
getUserId
(),
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
));
for
(
MultipartFile
multipartFile
:
param
.
getMultipartFiles
())
{
ApiResult
result
=
FileUtils
.
upload
(
multipartFile
,
saveWishPicPath
,
wishId
);
WishPicDto
wishPicDto
=
new
WishPicDto
();
wishPicDto
.
setPicId
(
SnowFlakeUtil
.
nextId
());
wishPicDto
.
setWishId
(
wishId
);
wishPicDto
.
setCreateTime
(
new
Date
()
);
wishPicDto
.
setCreateTime
(
date
);
wishPicDto
.
setPicUrl
(
callWishPicUrl
+
result
.
get
(
"data"
).
toString
());
wishPicMapper
.
insert
(
wishPicDto
);
}
dto
.
setWishId
(
wishId
);
dto
.
setCreateTime
(
new
Date
()
);
dto
.
setPushDate
(
new
Date
()
);
dto
.
setCreateTime
(
date
);
dto
.
setPushDate
(
date
);
int
i
=
mapper
.
insert
(
dto
);
//发放牛牌
if
(
i
>
0
&&
firstPushNum
==
0
){
if
(
i
>
0
&&
firstPushNum
<
2
){
CattleBrandConfVO
confVO
=
cattleBrandMapper
.
queryCattleBrandConf
(
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
));
MathRandom
random
=
new
MathRandom
(
confVO
.
getRate1
(),
confVO
.
getRate2
(),
confVO
.
getRate3
(),
confVO
.
getRate4
(),
confVO
.
getRate5
());
List
<
SaveUserCattleDto
>
list
=
new
ArrayList
<>();
...
...
activity-admin/src/main/java/com/polysoft/activity/task/CattleBrandCarveUpTask.java
View file @
faadb54
...
...
@@ -35,6 +35,7 @@ public class CattleBrandCarveUpTask {
private
ActivityMapper
activityMapper
;
// @Scheduled( cron = "0 20 20 * * ? ")
// @Scheduled(initialDelay = 60000, fixedRate = 1*15*60*1000)
@Scheduled
(
cron
=
"0 5 20 17 2 ? "
)
// 2021年2月17号 20时5分0秒 执行
public
void
execute
()
{
try
{
...
...
@@ -46,7 +47,8 @@ public class CattleBrandCarveUpTask {
private
void
sendWechat
()
{
log
.
info
(
"牛牌瓜分红包任务开始"
);
//查询已经合成牛牌的红包
List
<
Long
>
list
=
activityMapper
.
getRedIdToCattle
(
0
);
List
<
Long
>
list
=
activityMapper
.
getRedIdToCattle
(
null
);
List
<
Long
>
lastList
=
activityMapper
.
getRedIdToCattle
(
BigDecimal
.
valueOf
(
0.00
));
//第一批 牛牌瓜分
//生成数量
int
count_1
=
(
int
)
(
list
.
size
()*
0.05
);
...
...
@@ -71,12 +73,13 @@ public class CattleBrandCarveUpTask {
}
activityMapper
.
updateRedPackage
(
batchList_1
);
//第二批 牛牌瓜分
//未充值的牛牌红包
List
<
Long
>
redCattlePacke_2
=
activityMapper
.
getRedIdToCattle
(
BigDecimal
.
valueOf
(
0.00
));
//生成数量
int
count_2
=
(
int
)
(
list
.
size
()*
0.15
);
//生成范围
int
random_2
=
list
.
size
();
int
random_2
=
redCattlePacke_2
.
size
();
HashSet
<
Integer
>
set_2
=
getLuckUser
(
count_2
,
random_2
);
//第一批瓜分
//查询第二批红包配置
RedAmountConfVO
confVO_2
=
activityMapper
.
getRedAmountConf
(
"4"
,
2L
);
List
<
Double
>
redAmount_2
=
redpack
.
getMoney
(
confVO_2
.
getTotalMoney
(),
count_2
,
confVO_2
.
getRedMinAmount
(),
confVO_2
.
getRedMaxAmonut
(),
2.1
);
...
...
@@ -84,7 +87,7 @@ public class CattleBrandCarveUpTask {
int
bt_2
=
0
;
for
(
Integer
s:
set_2
)
{
AddRedRainDto
addRedRainDto
=
new
AddRedRainDto
();
addRedRainDto
.
setRedId
(
list
.
get
(
s
));
addRedRainDto
.
setRedId
(
redCattlePacke_2
.
get
(
s
));
addRedRainDto
.
setRedAmount
(
BigDecimal
.
valueOf
(
redAmount_2
.
get
(
bt_2
)));
addRedRainDto
.
setRedType
(
CommonTypeEnum
.
REDPACK_TYPE1
.
getCode
());
addRedRainDto
.
setIsEnble
(
CommonTypeEnum
.
RED_ISENBLE_NO
.
getCode
());
...
...
@@ -93,10 +96,12 @@ public class CattleBrandCarveUpTask {
}
activityMapper
.
updateRedPackage
(
batchList_2
);
//第三批 牛牌瓜分
//未充值的牛牌红包
List
<
Long
>
redCattlePacke_3
=
activityMapper
.
getRedIdToCattle
(
BigDecimal
.
valueOf
(
0.00
));
//生成数量
int
count_3
=
(
int
)
(
list
.
size
()*
0.40
);
//生成范围
int
random_3
=
list
.
size
();
int
random_3
=
redCattlePacke_3
.
size
();
HashSet
<
Integer
>
set_3
=
getLuckUser
(
count_3
,
random_3
);
//查询第三批红包配置
RedAmountConfVO
confVO_3
=
activityMapper
.
getRedAmountConf
(
"4"
,
3L
);
...
...
@@ -105,7 +110,7 @@ public class CattleBrandCarveUpTask {
int
bt_3
=
0
;
for
(
Integer
s:
set_3
)
{
AddRedRainDto
addRedRainDto
=
new
AddRedRainDto
();
addRedRainDto
.
setRedId
(
list
.
get
(
s
));
addRedRainDto
.
setRedId
(
redCattlePacke_3
.
get
(
s
));
addRedRainDto
.
setRedAmount
(
BigDecimal
.
valueOf
(
redAmount_3
.
get
(
bt_3
)));
addRedRainDto
.
setRedType
(
CommonTypeEnum
.
REDPACK_TYPE1
.
getCode
());
addRedRainDto
.
setIsEnble
(
CommonTypeEnum
.
RED_ISENBLE_NO
.
getCode
());
...
...
@@ -114,10 +119,12 @@ public class CattleBrandCarveUpTask {
}
activityMapper
.
updateRedPackage
(
batchList_3
);
//第四批 牛牌瓜分
//未充值的牛牌红包
List
<
Long
>
redCattlePacke_4
=
activityMapper
.
getRedIdToCattle
(
BigDecimal
.
valueOf
(
0.00
));
//生成数量
int
count_4
=
(
int
)
(
list
.
size
()*
0.25
);
int
count_4
=
redCattlePacke_4
.
size
(
);
//生成范围
int
random_4
=
list
.
size
();
int
random_4
=
redCattlePacke_4
.
size
();
HashSet
<
Integer
>
set_4
=
getLuckUser
(
count_4
,
random_4
);
//查询第四批红包配置
RedAmountConfVO
confVO_4
=
activityMapper
.
getRedAmountConf
(
"4"
,
4L
);
...
...
@@ -126,7 +133,7 @@ public class CattleBrandCarveUpTask {
int
bt_4
=
0
;
for
(
Integer
s:
set_4
)
{
AddRedRainDto
addRedRainDto
=
new
AddRedRainDto
();
addRedRainDto
.
setRedId
(
list
.
get
(
s
));
addRedRainDto
.
setRedId
(
redCattlePacke_4
.
get
(
s
));
addRedRainDto
.
setRedAmount
(
BigDecimal
.
valueOf
(
redAmount_4
.
get
(
bt_4
)));
addRedRainDto
.
setRedType
(
CommonTypeEnum
.
REDPACK_TYPE1
.
getCode
());
addRedRainDto
.
setIsEnble
(
CommonTypeEnum
.
RED_ISENBLE_NO
.
getCode
());
...
...
activity-admin/src/main/java/com/polysoft/activity/task/UserSignTask.java
View file @
faadb54
...
...
@@ -30,7 +30,8 @@ public class UserSignTask {
* 补签任务
*/
// @Scheduled( cron = "0 21 20 * * ? ")
@Scheduled
(
cron
=
"0 5 0 12,13,14,15,16,17 2 ? "
)
//2月12,13,14,15,16,17 0时5分0秒执行
// @Scheduled(initialDelay = 10000, fixedRate = 1*15*60*1000)
@Scheduled
(
cron
=
"0 5 0 4,13,14,15,16,17 2 ? "
)
//2月12,13,14,15,16,17 0时5分0秒执行
public
void
execute
()
{
try
{
sendWechat
();
...
...
activity-admin/src/main/resources/application-prod.yml
View file @
faadb54
...
...
@@ -70,3 +70,5 @@ wechat:
fileUpload
:
saveWishPicPath
:
/home/spring_fistival/images
callWishPicUrl
:
http://quality.item.polyhome.net/spfest/images
spring_user
:
userName
:
ypenglv
activity-admin/src/main/resources/mapper/ActivityMapper.xml
View file @
faadb54
...
...
@@ -178,7 +178,7 @@
FROM
t_red_rain t
WHERE
t.user_id = #{userId} and red_type = '1'
t.user_id = #{userId} and red_type = '1'
and t.is_enble='1'
ORDER BY
t.create_time DESC
</select>
...
...
@@ -257,8 +257,8 @@
FROM
t_red_rain
WHERE
red_amount = 0.00
AND
source_type = '4' and is_enble='0'
source_type = '4' and is_enble='0'
<if
test=
"redAmount != null"
>
and red_amount = #{redAmount}
</if>
...
...
activity-admin/src/main/resources/mapper/WishMapper.xml
View file @
faadb54
...
...
@@ -5,7 +5,7 @@
<select
id=
"queryWishList"
resultType=
"com.polysoft.activity.model.vo.WishVO"
parameterType=
"com.polysoft.activity.model.param.QueryWishParam"
>
SELECT
t1.wish_id
,
DISTINCT(t1.wish_id)
,
t1.user_id,
t1.address,
t1.wish_context,
...
...
activity-common/src/main/java/com/polysoft/activity/common/utils/PageQuery.java
View file @
faadb54
...
...
@@ -12,8 +12,8 @@ public class PageQuery {
@ApiModelProperty
(
"当前页码"
)
private
Integer
pageNum
=
1
;
@ApiModelProperty
(
"每页显示条数,默认
2
0"
)
private
Integer
pageSize
=
2
0
;
@ApiModelProperty
(
"每页显示条数,默认
1
0"
)
private
Integer
pageSize
=
1
0
;
@ApiModelProperty
(
value
=
"是否分页,默认:true"
)
private
Boolean
isPage
=
true
;
}
...
...
activity-common/src/main/java/com/polysoft/activity/utils/FileUtils.java
View file @
faadb54
...
...
@@ -31,7 +31,7 @@ public class FileUtils {
File
dest
=
null
;
try
{
// String path=uploadpath+File.separator+date+File.separator+uuid+fileName;
String
fileType
=
fileName
.
substring
(
fileName
.
i
ndexOf
(
"."
),
fileName
.
length
());
String
fileType
=
fileName
.
substring
(
fileName
.
lastI
ndexOf
(
"."
),
fileName
.
length
());
String
path
=
uploadpath
+
"/"
+
date
+
"/"
+
uuid
+
fileType
;
dest
=
new
File
(
path
);
if
(!
dest
.
getParentFile
().
exists
())
{
...
...
@@ -47,7 +47,7 @@ public class FileUtils {
}
public
static
void
main
(
String
[]
args
)
{
String
ss
=
"
0ab520bfbbcd4ca8b3c66c7b4dbd8e3eF5A3F540-D6A3-404F-807C-A55D5D2FBE1E
.jpeg"
;
System
.
out
.
println
(
ss
.
substring
(
ss
.
i
ndexOf
(
"."
),
ss
.
length
()));
String
ss
=
"
e0dc4a00e87e433284387484df6b921b.redocn.com_201206_4_88952_1338814806KZQi.jpg&refer=http___img.redocn
.jpeg"
;
System
.
out
.
println
(
ss
.
substring
(
ss
.
lastI
ndexOf
(
"."
),
ss
.
length
()));
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment