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
d4a658a8
Commit
d4a658a8
authored
Jul 11, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://113.105.137.151:22280/youjj/cloud-platform
into base-modify
parents
d3a3af1f
242b6704
Changes
27
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
749 additions
and
60 deletions
+749
-60
AppUserManageDTO.java
...m/github/wxiaoqi/security/admin/dto/AppUserManageDTO.java
+6
-0
BaseUserMemberBiz.java
.../github/wxiaoqi/security/admin/biz/BaseUserMemberBiz.java
+1
-1
UserMemberController.java
...hub/wxiaoqi/security/admin/rest/UserMemberController.java
+3
-2
IntegralRule.java
.../java/com/xxfc/platform/activity/entity/IntegralRule.java
+2
-1
IntegralUserRecord.java
...com/xxfc/platform/activity/entity/IntegralUserRecord.java
+1
-1
IntegralToolsUtils.java
...a/com/xxfc/platform/activity/util/IntegralToolsUtils.java
+186
-0
IntegralRuleDto.java
...n/java/com/xxfc/platform/activity/vo/IntegralRuleDto.java
+114
-0
IntegralUserRecordDto.java
.../com/xxfc/platform/activity/vo/IntegralUserRecordDto.java
+13
-0
IntegralUserTotalDto.java
...a/com/xxfc/platform/activity/vo/IntegralUserTotalDto.java
+13
-0
IntegralRuleBiz.java
.../java/com/xxfc/platform/activity/biz/IntegralRuleBiz.java
+11
-10
IntegralSignRecordBiz.java
...com/xxfc/platform/activity/biz/IntegralSignRecordBiz.java
+198
-0
IntegralUserRecordBiz.java
...com/xxfc/platform/activity/biz/IntegralUserRecordBiz.java
+57
-4
IntegralUserTotalBiz.java
.../com/xxfc/platform/activity/biz/IntegralUserTotalBiz.java
+34
-29
IntegralRuleMapper.java
...com/xxfc/platform/activity/mapper/IntegralRuleMapper.java
+2
-1
IntegralSignRecordMapper.java
...fc/platform/activity/mapper/IntegralSignRecordMapper.java
+3
-0
IntegralUserRecordMapper.java
...fc/platform/activity/mapper/IntegralUserRecordMapper.java
+8
-0
IntegralUserTotalMapper.java
...xfc/platform/activity/mapper/IntegralUserTotalMapper.java
+2
-1
IntegralRuleController.java
...m/xxfc/platform/activity/rest/IntegralRuleController.java
+4
-2
IntegralSignRecordController.java
.../platform/activity/rest/IntegralSignRecordController.java
+7
-0
IntegralUserRecordController.java
.../platform/activity/rest/IntegralUserRecordController.java
+22
-0
IntegralUserTotalController.java
...c/platform/activity/rest/IntegralUserTotalController.java
+32
-0
IntegralRuleMapper.xml
...y-server/src/main/resources/mapper/IntegralRuleMapper.xml
+3
-5
IntegralSignRecordMapper.xml
...er/src/main/resources/mapper/IntegralSignRecordMapper.xml
+6
-0
IntegralUserRecordMapper.xml
...er/src/main/resources/mapper/IntegralUserRecordMapper.xml
+15
-1
IntegralUserTotalMapper.xml
...ver/src/main/resources/mapper/IntegralUserTotalMapper.xml
+1
-1
BaseOrderMapper.xml
...rder-server/src/main/resources/mapper/BaseOrderMapper.xml
+4
-1
TourUserController.java
.../java/com/xxfc/platform/tour/rest/TourUserController.java
+1
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/AppUserManageDTO.java
View file @
d4a658a8
...
@@ -52,4 +52,10 @@ public class AppUserManageDTO {
...
@@ -52,4 +52,10 @@ public class AppUserManageDTO {
*/
*/
private
Integer
source
;
private
Integer
source
;
/**
*
*/
private
String
registrationDate
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/BaseUserMemberBiz.java
View file @
d4a658a8
...
@@ -228,7 +228,7 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
...
@@ -228,7 +228,7 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
return
;
return
;
}
else
if
(
baseUserMembers
.
size
()==
1
){
}
else
if
(
baseUserMembers
.
size
()==
1
){
baseUserMember
.
setUpdTime
(
System
.
currentTimeMillis
());
baseUserMember
.
setUpdTime
(
System
.
currentTimeMillis
());
updateSelectiveById
(
baseUserMember
);
getMyBiz
().
updateSelectiveById
(
baseUserMember
);
}
else
{
}
else
{
throw
new
BaseException
(
"Member purchase repeat!"
);
throw
new
BaseException
(
"Member purchase repeat!"
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserMemberController.java
View file @
d4a658a8
...
@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.admin.AdminBootstrap;
...
@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.admin.AdminBootstrap;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberExportBiz
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberExportBiz
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.excel.ExcelImport
;
import
com.github.wxiaoqi.security.common.util.excel.ExcelImport
;
...
@@ -67,7 +68,7 @@ public class UserMemberController {
...
@@ -67,7 +68,7 @@ public class UserMemberController {
}
}
@PostMapping
(
"/user/export"
)
@PostMapping
(
"/user/export"
)
public
ObjectRestResponse
importUserMember
(
MultipartFile
userMemberExcel
)
{
public
ObjectRestResponse
importUserMember
(
@RequestPart
(
"file"
)
MultipartFile
userMemberExcel
)
{
List
<
String
[]>
userMemberData
=
ExcelImport
.
getExcelData
(
userMemberExcel
);
List
<
String
[]>
userMemberData
=
ExcelImport
.
getExcelData
(
userMemberExcel
);
if
(
userMemberData
.
size
()
<
1
)
{
if
(
userMemberData
.
size
()
<
1
)
{
return
ObjectRestResponse
.
createFailedResult
(
1001
,
"导入不能没数据!!!"
);
return
ObjectRestResponse
.
createFailedResult
(
1001
,
"导入不能没数据!!!"
);
...
@@ -86,7 +87,7 @@ public class UserMemberController {
...
@@ -86,7 +87,7 @@ public class UserMemberController {
}
}
}
}
@GetMapping
(
"/user/excel_model/dowload"
)
@GetMapping
(
"/
app/unauth/
user/excel_model/dowload"
)
public
ResponseEntity
<
byte
[]>
dowloadUserMemberExcelModel
(
HttpServletResponse
response
){
public
ResponseEntity
<
byte
[]>
dowloadUserMemberExcelModel
(
HttpServletResponse
response
){
// 重置response
// 重置response
response
.
reset
();
response
.
reset
();
...
...
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/entity/IntegralRule.java
View file @
d4a658a8
...
@@ -96,7 +96,7 @@ public class IntegralRule{
...
@@ -96,7 +96,7 @@ public class IntegralRule{
/**
/**
* 描述
* 描述
*/
*/
private
String
de
sc
;
private
String
de
tail
;
/**
/**
* 规则图片
* 规则图片
...
@@ -125,4 +125,5 @@ public class IntegralRule{
...
@@ -125,4 +125,5 @@ public class IntegralRule{
@Column
(
name
=
"other_rule"
)
@Column
(
name
=
"other_rule"
)
private
String
otherRule
;
private
String
otherRule
;
}
}
\ No newline at end of file
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/entity/IntegralUserRecord.java
View file @
d4a658a8
...
@@ -24,7 +24,7 @@ public class IntegralUserRecord {
...
@@ -24,7 +24,7 @@ public class IntegralUserRecord {
/**
/**
* 0-获取积分;1-抵扣积分
* 0-获取积分;1-抵扣积分
*/
*/
private
Boolean
type
;
private
Integer
type
;
/**
/**
* 积分数
* 积分数
...
...
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/util/IntegralToolsUtils.java
0 → 100644
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
util
;
import
org.apache.commons.lang3.StringUtils
;
import
java.text.SimpleDateFormat
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.TimeZone
;
public
class
IntegralToolsUtils
{
//获取数组中的最大值
public
static
Integer
getMax
(
Integer
point
,
Integer
otherRulePoint
,
Integer
finishPoint
)
{
int
[]
arr
=
{
point
,
otherRulePoint
,
finishPoint
};
Arrays
.
sort
(
arr
);
return
arr
[
arr
.
length
-
1
];
}
//获取两个时间戳相隔的天数
public
static
int
differentDaysByMillisecond
(
Long
date1
,
Long
date2
){
Date
startDate
=
new
Date
();
startDate
.
setTime
(
date1
);
Date
endDate
=
new
Date
();
endDate
.
setTime
(
date2
);
return
endDate
.
getDate
()
-
startDate
.
getDate
();
}
//获取当天的0点
public
static
Long
getDayStart
()
{
long
current
=
System
.
currentTimeMillis
();
long
zero
=
current
/(
1000
*
3600
*
24
)*(
1000
*
3600
*
24
)
-
TimeZone
.
getDefault
().
getRawOffset
();
return
zero
;
}
//获取当前时间的周一
public
static
Long
weekFirstDay
(
int
week
,
int
param
)
{
Calendar
c1
=
Calendar
.
getInstance
();
int
dow
=
c1
.
get
(
Calendar
.
DAY_OF_WEEK
);
c1
.
add
(
Calendar
.
DATE
,
-
dow
-
7
*
(
week
-
1
)
+
param
);
return
c1
.
getTime
().
getTime
()/(
1000
*
3600
*
24
)*(
1000
*
3600
*
24
)
-
TimeZone
.
getDefault
().
getRawOffset
();
}
public
static
Integer
getQuarter
()
{
Calendar
c
=
Calendar
.
getInstance
();
int
month
=
c
.
get
(
c
.
MONTH
)
+
1
;
int
quarter
=
0
;
if
(
month
>=
1
&&
month
<=
3
)
{
quarter
=
1
;
}
else
if
(
month
>=
4
&&
month
<=
6
)
{
quarter
=
2
;
}
else
if
(
month
>=
7
&&
month
<=
9
)
{
quarter
=
3
;
}
else
{
quarter
=
4
;
}
return
quarter
;
}
public
static
String
[]
getCurrQuarter
(
int
num
)
{
String
[]
s
=
new
String
[
2
];
String
str
=
""
;
// 设置本年的季
Calendar
quarterCalendar
=
null
;
switch
(
num
)
{
case
1
:
// 本年到现在经过了一个季度,在加上前4个季度
quarterCalendar
=
Calendar
.
getInstance
();
quarterCalendar
.
set
(
Calendar
.
MONTH
,
3
);
quarterCalendar
.
set
(
Calendar
.
DATE
,
1
);
quarterCalendar
.
add
(
Calendar
.
DATE
,
-
1
);
str
=
formatDate
(
quarterCalendar
.
getTime
(),
"yyyy-MM-dd"
);
s
[
0
]
=
str
.
substring
(
0
,
str
.
length
()
-
5
)
+
"01-01"
;
s
[
1
]
=
str
;
break
;
case
2
:
// 本年到现在经过了二个季度,在加上前三个季度
quarterCalendar
=
Calendar
.
getInstance
();
quarterCalendar
.
set
(
Calendar
.
MONTH
,
6
);
quarterCalendar
.
set
(
Calendar
.
DATE
,
1
);
quarterCalendar
.
add
(
Calendar
.
DATE
,
-
1
);
str
=
formatDate
(
quarterCalendar
.
getTime
(),
"yyyy-MM-dd"
);
s
[
0
]
=
str
.
substring
(
0
,
str
.
length
()
-
5
)
+
"04-01"
;
s
[
1
]
=
str
;
break
;
case
3
:
// 本年到现在经过了三个季度,在加上前二个季度
quarterCalendar
=
Calendar
.
getInstance
();
quarterCalendar
.
set
(
Calendar
.
MONTH
,
9
);
quarterCalendar
.
set
(
Calendar
.
DATE
,
1
);
quarterCalendar
.
add
(
Calendar
.
DATE
,
-
1
);
str
=
formatDate
(
quarterCalendar
.
getTime
(),
"yyyy-MM-dd"
);
s
[
0
]
=
str
.
substring
(
0
,
str
.
length
()
-
5
)
+
"07-01"
;
s
[
1
]
=
str
;
break
;
case
4
:
// 本年到现在经过了四个季度,在加上前一个季度
quarterCalendar
=
Calendar
.
getInstance
();
str
=
formatDate
(
quarterCalendar
.
getTime
(),
"yyyy-MM-dd"
);
s
[
0
]
=
str
.
substring
(
0
,
str
.
length
()
-
5
)
+
"10-01"
;
s
[
1
]
=
str
.
substring
(
0
,
str
.
length
()
-
5
)
+
"12-31"
;
break
;
}
return
s
;
}
public
static
String
formatDate
(
Date
currentDate
,
String
pattern
){
if
(
currentDate
==
null
||
""
.
equals
(
pattern
)
||
pattern
==
null
){
return
null
;
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
pattern
);
return
sdf
.
format
(
currentDate
);
}
public
static
Long
parseDate
(
String
currentDate
)
{
if
(
StringUtils
.
isBlank
(
currentDate
)){
return
null
;
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
date
=
null
;
try
{
date
=
sdf
.
parse
(
currentDate
);
}
catch
(
Exception
e
){
}
return
date
==
null
?
null
:
date
.
getTime
();
}
/**
* 获取指定日期所在月份开始的时间戳
*
* @param date
* 指定日期
* @return
*/
public
static
Long
getMonthBegin
(
Date
date
)
{
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
// 设置为1号,当前日期既为本月第一天
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
// 将小时至0
c
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
// 将分钟至0
c
.
set
(
Calendar
.
MINUTE
,
0
);
// 将秒至0
c
.
set
(
Calendar
.
SECOND
,
0
);
// 将毫秒至0
c
.
set
(
Calendar
.
MILLISECOND
,
0
);
// 获取本月第一天的时间戳
return
c
.
getTimeInMillis
();
}
/**
* 获取指定日期所在月份结束的时间戳
*
* @param date
* 指定日期
* @return
*/
public
static
Long
getMonthEnd
(
Date
date
)
{
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
// 设置为当月最后一天
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
c
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
// 将小时至23
c
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
// 将分钟至59
c
.
set
(
Calendar
.
MINUTE
,
59
);
// 将秒至59
c
.
set
(
Calendar
.
SECOND
,
59
);
// 将毫秒至999
c
.
set
(
Calendar
.
MILLISECOND
,
999
);
// 获取本月最后一天的时间戳
return
c
.
getTimeInMillis
();
}
public
static
Long
getLastDayOfYear
(
final
Date
date
)
{
final
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
final
int
last
=
cal
.
getActualMaximum
(
Calendar
.
DAY_OF_YEAR
);
cal
.
set
(
Calendar
.
DAY_OF_YEAR
,
last
);
return
cal
.
getTime
().
getTime
()/(
1000
*
3600
*
24
)*(
1000
*
3600
*
24
)
-
TimeZone
.
getDefault
().
getRawOffset
()
+
24
*
60
*
60
*
1000
-
1
;
}
public
static
Long
getFirstDayOfYear
(
final
Date
date
)
{
final
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
final
int
first
=
cal
.
getActualMinimum
(
Calendar
.
DAY_OF_YEAR
);
cal
.
set
(
Calendar
.
DAY_OF_YEAR
,
first
);
return
cal
.
getTime
().
getTime
()/(
1000
*
3600
*
24
)*(
1000
*
3600
*
24
)
-
TimeZone
.
getDefault
().
getRawOffset
();
}
}
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/vo/IntegralRuleDto.java
0 → 100644
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
vo
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
IntegralRuleDto
extends
PageParam
{
/**
* 主键id
*/
private
Integer
id
;
/**
* 周期单位:0-天,1-周;3-月;4-季;5-年
*/
private
Integer
period
;
/**
* 次数
*/
private
Integer
number
;
/**
* 积分
*/
private
Integer
point
;
/**
* 积分兑换:金额/分
*/
private
BigDecimal
price
;
/**
* 是否连续:0-不连续;1-连续
*/
private
Boolean
isContinuity
;
/**
* 多少天后连续算
*/
private
Integer
finishDay
;
/**
* n天获取的积分
*/
private
Integer
finishPoint
;
/**
* 是否启用:1-启用;0-停用
*/
private
Boolean
status
;
/**
* 创建时间
*/
private
Long
crtTime
;
/**
* 是否删除:0-正常;1-删除
*/
private
Boolean
isdel
;
/**
* 规则开始时间
*/
private
Long
startTime
;
/**
* 规则结束时间
*/
private
Long
endTime
;
/**
* 更新时间
*/
private
Long
updTime
;
/**
* 备注
*/
private
String
remarks
;
/**
* 描述
*/
private
String
desc
;
/**
* 规则图片
*/
private
String
img
;
/**
* 排序
*/
private
Integer
orderId
;
/**
* 规则名称
*/
private
String
name
;
/**
* 获取积分规则
*/
private
String
regulation
;
/**
* json字符串 如:[{"day":4,"integeral":8},{"day":4,"integeral":8}]
*/
private
String
otherRule
;
}
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/vo/IntegralUserRecordDto.java
0 → 100644
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
vo
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
@Data
public
class
IntegralUserRecordDto
extends
PageParam
{
Integer
userId
;
Long
startTime
;
Long
endTime
;
Integer
integralRuleId
;
}
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/vo/IntegralUserTotalDto.java
0 → 100644
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
vo
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
@Data
public
class
IntegralUserTotalDto
extends
PageParam
{
Integer
userId
;
private
Integer
point
;
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralRuleBiz.java
View file @
d4a658a8
...
@@ -4,8 +4,12 @@ import cn.hutool.core.bean.BeanUtil;
...
@@ -4,8 +4,12 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.xxfc.platform.activity.entity.IntegralRule
;
import
com.xxfc.platform.activity.entity.IntegralRule
;
import
com.xxfc.platform.activity.mapper.IntegralRuleMapper
;
import
com.xxfc.platform.activity.mapper.IntegralRuleMapper
;
import
com.xxfc.platform.activity.vo.IntegralRuleDto
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -31,10 +35,10 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
...
@@ -31,10 +35,10 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
BeanUtil
.
copyProperties
(
integralRule
,
oldValue
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
BeanUtil
.
copyProperties
(
integralRule
,
oldValue
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
mapper
.
updateByPrimaryKeySelectiv
e
(
oldValue
);
updateByIdR
e
(
oldValue
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
mapper
.
insertSelective
(
integralRule
);
insertSelective
(
integralRule
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
@@ -52,7 +56,7 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
...
@@ -52,7 +56,7 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
oldValue
.
setIsdel
(
true
);
oldValue
.
setIsdel
(
true
);
mapper
.
updateByPrimaryKeySelectiv
e
(
oldValue
);
updateByIdR
e
(
oldValue
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
@@ -61,17 +65,14 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
...
@@ -61,17 +65,14 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
return
ObjectRestResponse
.
paramIsEmpty
();
return
ObjectRestResponse
.
paramIsEmpty
();
}
}
IntegralRule
oldValue
=
mapper
.
selectByPrimaryKey
(
integralRule
.
getId
());
IntegralRule
oldValue
=
mapper
.
selectByPrimaryKey
(
integralRule
.
getId
());
if
(
oldValue
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
return
ObjectRestResponse
.
succ
(
oldValue
);
return
ObjectRestResponse
.
succ
(
oldValue
);
}
}
public
ObjectRestResponse
<
List
<
IntegralRule
>>
getAll
(
IntegralRule
integralRule
)
{
public
ObjectRestResponse
<
PageDataVO
>
getAll
(
IntegralRuleDto
integralRule
)
{
List
<
IntegralRule
>
integralRules
=
mapper
.
selectAllByParam
(
integralRule
);
Query
query
=
new
Query
(
integralRule
);
return
ObjectRestResponse
.
succ
(
integralRules
);
PageDataVO
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
selectAllByParam
(
integralRule
));
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
}
}
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralSignRecordBiz.java
View file @
d4a658a8
This diff is collapsed.
Click to expand it.
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralUserRecordBiz.java
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
biz
;
package
com
.
xxfc
.
platform
.
activity
.
biz
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.xxfc.platform.activity.entity.IntegralUserRecord
;
import
com.xxfc.platform.activity.entity.IntegralUserRecord
;
import
com.xxfc.platform.activity.entity.IntegralUserTotal
;
import
com.xxfc.platform.activity.mapper.IntegralUserRecordMapper
;
import
com.xxfc.platform.activity.mapper.IntegralUserRecordMapper
;
import
com.xxfc.platform.activity.user.UserInfoBiz
;
import
com.xxfc.platform.activity.user.UserInfoBiz
;
import
com.xxfc.platform.activity.vo.IntegralUserRecordDto
;
import
com.xxfc.platform.activity.vo.IntegralUserTotalDto
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Service
@Service
@Transactional
@Transactional
@Slf4j
@Slf4j
...
@@ -19,12 +30,45 @@ public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, Int
...
@@ -19,12 +30,45 @@ public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, Int
@Autowired
@Autowired
UserInfoBiz
userInfoBiz
;
UserInfoBiz
userInfoBiz
;
@Autowired
IntegralUserTotalBiz
integralUserTotalBiz
;
/**
/**
* 添加用户积分记录
* 添加用户积分记录
* @param integralUserRecord
* @param integralUserRecord
* @return
* @return
*/
*/
public
ObjectRestResponse
add
(
IntegralUserRecord
integralUserRecord
)
{
public
ObjectRestResponse
add
(
IntegralUserRecord
integralUserRecord
)
{
if
(
integralUserRecord
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
if
(
integralUserRecord
.
getType
()
==
0
)
{
//获取积分 增加总积分表
ObjectRestResponse
<
IntegralUserTotal
>
objectRestResponse
=
integralUserTotalBiz
.
getByUser
();
if
(
objectRestResponse
.
getStatus
()
==
RestCode
.
SUCCESS
.
getStatus
()
&&
objectRestResponse
.
getData
()
!=
null
)
{
IntegralUserTotal
integralUserTotal
=
objectRestResponse
.
getData
();
IntegralUserTotalDto
integralUserTotalDto
=
new
IntegralUserTotalDto
();
integralUserTotalDto
.
setUserId
(
integralUserTotal
.
getUserId
());
integralUserTotalDto
.
setPoint
(
integralUserRecord
.
getPoint
());
integralUserTotalBiz
.
add
(
integralUserTotalDto
);
}
else
{
IntegralUserTotalDto
integralUserTotalDto
=
new
IntegralUserTotalDto
();
integralUserTotalDto
.
setUserId
(
integralUserRecord
.
getUserId
());
integralUserTotalDto
.
setPoint
(
integralUserRecord
.
getPoint
());
integralUserTotalBiz
.
add
(
integralUserTotalDto
);
}
}
else
if
(
integralUserRecord
.
getType
()
==
1
)
{
//扣减积分
ObjectRestResponse
<
IntegralUserTotal
>
objectRestResponse
=
integralUserTotalBiz
.
getByUser
();
if
(
objectRestResponse
.
getStatus
()
==
RestCode
.
SUCCESS
.
getStatus
()
&&
objectRestResponse
.
getData
()
!=
null
)
{
IntegralUserTotal
integralUserTotal
=
objectRestResponse
.
getData
();
IntegralUserTotalDto
integralUserTotalDto
=
new
IntegralUserTotalDto
();
integralUserTotalDto
.
setUserId
(
integralUserTotal
.
getUserId
());
integralUserTotalDto
.
setPoint
(-
integralUserRecord
.
getPoint
());
integralUserTotalBiz
.
add
(
integralUserTotalDto
);
}
else
{
return
ObjectRestResponse
.
createFailedResult
(
1008
,
"用户积分不足"
);
}
}
insertSelective
(
integralUserRecord
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
@@ -43,7 +87,7 @@ public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, Int
...
@@ -43,7 +87,7 @@ public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, Int
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
integralUserRecord
.
setIsdel
(
true
);
integralUserRecord
.
setIsdel
(
true
);
mapper
.
updateByPrimaryKeySelectiv
e
(
integralUserRecord
);
updateByIdR
e
(
integralUserRecord
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
@@ -51,12 +95,21 @@ public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, Int
...
@@ -51,12 +95,21 @@ public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, Int
* 根据获取某个用户的列表
* 根据获取某个用户的列表
* @return
* @return
*/
*/
public
ObjectRestResponse
<
IntegralUserRecord
>
getUserList
(
)
{
public
ObjectRestResponse
<
PageDataVO
>
getUserList
(
IntegralUserRecordDto
integralUserRecordDto
)
{
AppUserDTO
appUserDTO
=
userInfoBiz
.
getUserInfo
();
AppUserDTO
appUserDTO
=
userInfoBiz
.
getUserInfo
();
if
(
appUserDTO
==
null
)
{
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
}
}
return
ObjectRestResponse
.
succ
();
Query
query
=
new
Query
(
integralUserRecordDto
);
PageDataVO
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
selectByUserId
(
appUserDTO
.
getUserid
()));
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
}
public
ObjectRestResponse
<
List
<
IntegralUserRecord
>>
getByUserAndTime
(
IntegralUserRecordDto
integralUserRecordDto
)
{
if
(
integralUserRecordDto
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
List
<
IntegralUserRecord
>
integralUserRecordList
=
mapper
.
selectByUserAndTime
(
integralUserRecordDto
);
return
ObjectRestResponse
.
succ
(
integralUserRecordList
);
}
}
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralUserTotalBiz.java
View file @
d4a658a8
...
@@ -5,9 +5,13 @@ import cn.hutool.core.bean.copier.CopyOptions;
...
@@ -5,9 +5,13 @@ import cn.hutool.core.bean.copier.CopyOptions;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.activity.entity.IntegralUserTotal
;
import
com.xxfc.platform.activity.entity.IntegralUserTotal
;
import
com.xxfc.platform.activity.mapper.IntegralUserTotalMapper
;
import
com.xxfc.platform.activity.mapper.IntegralUserTotalMapper
;
import
com.xxfc.platform.activity.user.UserInfoBiz
;
import
com.xxfc.platform.activity.user.UserInfoBiz
;
import
com.xxfc.platform.activity.vo.IntegralRuleDto
;
import
com.xxfc.platform.activity.vo.IntegralUserTotalDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -23,34 +27,36 @@ public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, Integ
...
@@ -23,34 +27,36 @@ public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, Integ
/**
/**
* 添加用户总积分
* 添加用户总积分
* @param integralUserTotal
* @param integralUserTotal
Dto
* @return
* @return
*/
*/
public
ObjectRestResponse
add
(
IntegralUserTotal
integralUserTotal
)
{
public
ObjectRestResponse
add
(
IntegralUserTotal
Dto
integralUserTotalDto
)
{
AppUserDTO
appUserDTO
=
userInfoBiz
.
getUserInfo
();
AppUserDTO
appUserDTO
=
userInfoBiz
.
getUserInfo
();
if
(
appUserDTO
==
null
)
{
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
}
}
if
(
integralUserTotal
==
null
)
{
if
(
integralUserTotal
Dto
==
null
||
integralUserTotalDto
.
getPoint
()
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
return
ObjectRestResponse
.
paramIsEmpty
();
}
}
integralUserTotal
.
setUserId
(
appUserDTO
.
getUserid
());
integralUserTotalDto
.
setUserId
(
appUserDTO
.
getUserid
());
if
(
integralUserTotal
.
getId
()
!=
null
)
{
List
<
IntegralUserTotal
>
integralUserTotalList
=
mapper
.
selectAllByParam
(
integralUserTotalDto
);
IntegralUserTotal
oldValue
=
mapper
.
selectByPrimaryKey
(
integralUserTotal
.
getId
());
if
(
integralUserTotalList
!=
null
&&
integralUserTotalList
.
size
()
>
0
)
{
if
(
oldValue
==
null
)
{
integralUserTotalList
.
get
(
0
).
setTotalPoint
(
integralUserTotalList
.
get
(
0
).
getTotalPoint
()
+
integralUserTotalDto
.
getPoint
());
return
ObjectRestResponse
.
createDefaultFail
();
integralUserTotalList
.
get
(
0
).
setRestPoint
(
integralUserTotalList
.
get
(
0
).
getRestPoint
()
+
integralUserTotalDto
.
getPoint
());
}
updateByIdRe
(
integralUserTotalList
.
get
(
0
));
BeanUtil
.
copyProperties
(
integralUserTotal
,
oldValue
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
mapper
.
updateByPrimaryKeySelective
(
oldValue
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
mapper
.
insertSelective
(
integralUserTotal
);
IntegralUserTotal
integralUserTotal
=
new
IntegralUserTotal
();
integralUserTotal
.
setUserId
(
appUserDTO
.
getUserid
());
integralUserTotal
.
setTotalPoint
(
integralUserTotalDto
.
getPoint
());
integralUserTotal
.
setRestPoint
(
integralUserTotalDto
.
getPoint
());
integralUserTotal
.
setIsdel
(
false
);
insertSelective
(
integralUserTotal
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
/**
/**
* 删除信息
* 删除信息
* @param id
* @return
* @return
*/
*/
public
ObjectRestResponse
deleteOne
()
{
public
ObjectRestResponse
deleteOne
()
{
...
@@ -58,14 +64,14 @@ public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, Integ
...
@@ -58,14 +64,14 @@ public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, Integ
if
(
appUserDTO
==
null
)
{
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
}
}
IntegralUserTotal
integralUserTotal
=
new
IntegralUserTotal
();
IntegralUserTotal
Dto
integralUserTotalDto
=
new
IntegralUserTotalDto
();
integralUserTotal
.
setUserId
(
appUserDTO
.
getUserid
());
integralUserTotal
Dto
.
setUserId
(
appUserDTO
.
getUserid
());
List
<
IntegralUserTotal
>
oldValue
=
mapper
.
selectAllByParam
(
integralUserTotal
);
List
<
IntegralUserTotal
>
oldValue
=
mapper
.
selectAllByParam
(
integralUserTotal
Dto
);
if
(
oldValue
==
null
||
oldValue
.
size
()
<=
0
)
{
if
(
oldValue
==
null
||
oldValue
.
size
()
<=
0
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
oldValue
.
get
(
0
).
setIsdel
(
true
);
oldValue
.
get
(
0
).
setIsdel
(
true
);
mapper
.
updateByPrimaryKeySelectiv
e
(
oldValue
.
get
(
0
));
updateByIdR
e
(
oldValue
.
get
(
0
));
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
@@ -78,23 +84,22 @@ public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, Integ
...
@@ -78,23 +84,22 @@ public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, Integ
if
(
appUserDTO
==
null
)
{
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
}
}
IntegralUserTotal
integralUserTotal
=
new
IntegralUserTotal
();
IntegralUserTotalDto
integralUserTotalDto
=
new
IntegralUserTotalDto
();
integralUserTotal
.
setUserId
(
appUserDTO
.
getUserid
());
integralUserTotalDto
.
setUserId
(
appUserDTO
.
getUserid
());
List
<
IntegralUserTotal
>
oldValue
=
mapper
.
selectAllByParam
(
integralUserTotal
);
List
<
IntegralUserTotal
>
oldValue
=
mapper
.
selectAllByParam
(
integralUserTotalDto
);
if
(
oldValue
==
null
||
oldValue
.
size
()
<=
0
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
succ
(
oldValue
==
null
||
oldValue
.
size
()
<=
0
?
null
:
oldValue
.
get
(
0
));
}
return
ObjectRestResponse
.
succ
(
oldValue
.
get
(
0
));
}
}
/**
/**
* 获取所有的信息
* 获取所有的信息
* @param integralUserTotal
* @return
* @return
*/
*/
public
ObjectRestResponse
<
List
<
IntegralUserTotal
>>
getAll
(
IntegralUserTotal
integralUserTotal
)
{
public
ObjectRestResponse
<
PageDataVO
>
getAll
(
IntegralUserTotalDto
integralUserTotalDto
)
{
List
<
IntegralUserTotal
>
integralUserTotals
=
mapper
.
selectAllByParam
(
integralUserTotal
);
Query
query
=
new
Query
(
integralUserTotalDto
);
return
ObjectRestResponse
.
succ
(
integralUserTotals
);
PageDataVO
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
selectAllByParam
(
integralUserTotalDto
));
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
}
}
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/mapper/IntegralRuleMapper.java
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
mapper
;
package
com
.
xxfc
.
platform
.
activity
.
mapper
;
import
com.xxfc.platform.activity.entity.IntegralRule
;
import
com.xxfc.platform.activity.entity.IntegralRule
;
import
com.xxfc.platform.activity.vo.IntegralRuleDto
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.List
;
public
interface
IntegralRuleMapper
extends
Mapper
<
IntegralRule
>
{
public
interface
IntegralRuleMapper
extends
Mapper
<
IntegralRule
>
{
public
List
<
IntegralRule
>
selectAllByParam
(
IntegralRule
integralRule
);
public
List
<
IntegralRule
>
selectAllByParam
(
IntegralRule
Dto
integralRuleDto
);
}
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/mapper/IntegralSignRecordMapper.java
View file @
d4a658a8
...
@@ -3,5 +3,8 @@ package com.xxfc.platform.activity.mapper;
...
@@ -3,5 +3,8 @@ package com.xxfc.platform.activity.mapper;
import
com.xxfc.platform.activity.entity.IntegralSignRecord
;
import
com.xxfc.platform.activity.entity.IntegralSignRecord
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
IntegralSignRecordMapper
extends
Mapper
<
IntegralSignRecord
>
{
public
interface
IntegralSignRecordMapper
extends
Mapper
<
IntegralSignRecord
>
{
List
<
IntegralSignRecord
>
selectByUserId
(
Integer
userId
);
}
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/mapper/IntegralUserRecordMapper.java
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
mapper
;
package
com
.
xxfc
.
platform
.
activity
.
mapper
;
import
com.xxfc.platform.activity.entity.IntegralUserRecord
;
import
com.xxfc.platform.activity.entity.IntegralUserRecord
;
import
com.xxfc.platform.activity.vo.IntegralUserRecordDto
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
IntegralUserRecordMapper
extends
Mapper
<
IntegralUserRecord
>
{
public
interface
IntegralUserRecordMapper
extends
Mapper
<
IntegralUserRecord
>
{
List
<
IntegralUserRecord
>
selectByUserId
(
Integer
userId
);
List
<
IntegralUserRecord
>
selectByUserAndTime
(
IntegralUserRecordDto
integralUserRecordDto
);
}
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/mapper/IntegralUserTotalMapper.java
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
mapper
;
package
com
.
xxfc
.
platform
.
activity
.
mapper
;
import
com.xxfc.platform.activity.entity.IntegralUserTotal
;
import
com.xxfc.platform.activity.entity.IntegralUserTotal
;
import
com.xxfc.platform.activity.vo.IntegralUserTotalDto
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.List
;
public
interface
IntegralUserTotalMapper
extends
Mapper
<
IntegralUserTotal
>
{
public
interface
IntegralUserTotalMapper
extends
Mapper
<
IntegralUserTotal
>
{
List
<
IntegralUserTotal
>
selectAllByParam
(
IntegralUserTotal
integralUserTotal
);
List
<
IntegralUserTotal
>
selectAllByParam
(
IntegralUserTotal
Dto
integralUserTotalDto
);
}
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/IntegralRuleController.java
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
rest
;
package
com
.
xxfc
.
platform
.
activity
.
rest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.activity.biz.IntegralRuleBiz
;
import
com.xxfc.platform.activity.biz.IntegralRuleBiz
;
import
com.xxfc.platform.activity.entity.IntegralRule
;
import
com.xxfc.platform.activity.entity.IntegralRule
;
import
com.xxfc.platform.activity.vo.IntegralRuleDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -41,8 +43,8 @@ public class IntegralRuleController {
...
@@ -41,8 +43,8 @@ public class IntegralRuleController {
@GetMapping
(
value
=
"/list"
)
@GetMapping
(
value
=
"/list"
)
@ApiOperation
(
value
=
"获取所有的规则"
)
@ApiOperation
(
value
=
"获取所有的规则"
)
public
ObjectRestResponse
<
List
<
IntegralRule
>>
getList
(
IntegralRule
integralRule
)
{
public
ObjectRestResponse
<
PageDataVO
>
getList
(
IntegralRuleDto
integralRuleDto
)
{
return
integralRuleBiz
.
getAll
(
integralRule
);
return
integralRuleBiz
.
getAll
(
integralRule
Dto
);
}
}
}
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/IntegralSignRecordController.java
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
rest
;
package
com
.
xxfc
.
platform
.
activity
.
rest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.activity.biz.IntegralSignRecordBiz
;
import
com.xxfc.platform.activity.biz.IntegralSignRecordBiz
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -14,4 +16,9 @@ public class IntegralSignRecordController {
...
@@ -14,4 +16,9 @@ public class IntegralSignRecordController {
@Autowired
@Autowired
IntegralSignRecordBiz
integralSignRecordBiz
;
IntegralSignRecordBiz
integralSignRecordBiz
;
@PostMapping
(
value
=
"/add"
)
public
ObjectRestResponse
add
(
Integer
integralRuleId
)
{
return
integralSignRecordBiz
.
add
(
integralRuleId
);
}
}
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/IntegralUserRecordController.java
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
rest
;
package
com
.
xxfc
.
platform
.
activity
.
rest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.activity.biz.IntegralUserRecordBiz
;
import
com.xxfc.platform.activity.biz.IntegralUserRecordBiz
;
import
com.xxfc.platform.activity.entity.IntegralUserRecord
;
import
com.xxfc.platform.activity.vo.IntegralUserRecordDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -14,4 +19,21 @@ public class IntegralUserRecordController {
...
@@ -14,4 +19,21 @@ public class IntegralUserRecordController {
@Autowired
@Autowired
IntegralUserRecordBiz
integralUserRecordBiz
;
IntegralUserRecordBiz
integralUserRecordBiz
;
@PostMapping
(
value
=
"/add"
)
public
ObjectRestResponse
add
(
IntegralUserRecord
integralUserRecord
)
{
return
integralUserRecordBiz
.
add
(
integralUserRecord
);
}
@PostMapping
(
value
=
"/delete"
)
public
ObjectRestResponse
deleteById
(
Integer
id
)
{
return
integralUserRecordBiz
.
deleteOne
(
id
);
}
@GetMapping
(
value
=
"/getListByUser"
)
public
ObjectRestResponse
getByUser
(
IntegralUserRecordDto
integralUserRecordDto
)
{
return
integralUserRecordBiz
.
getUserList
(
integralUserRecordDto
);
}
}
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/IntegralUserTotalController.java
View file @
d4a658a8
package
com
.
xxfc
.
platform
.
activity
.
rest
;
package
com
.
xxfc
.
platform
.
activity
.
rest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.activity.biz.IntegralUserTotalBiz
;
import
com.xxfc.platform.activity.entity.IntegralUserTotal
;
import
com.xxfc.platform.activity.vo.IntegralUserTotalDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -8,4 +15,29 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -8,4 +15,29 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping
(
value
=
"integralUserTotal"
)
@RequestMapping
(
value
=
"integralUserTotal"
)
@Api
(
value
=
"用户总积分"
)
@Api
(
value
=
"用户总积分"
)
public
class
IntegralUserTotalController
{
public
class
IntegralUserTotalController
{
@Autowired
IntegralUserTotalBiz
integralUserTotalBiz
;
@PostMapping
(
value
=
"/add"
)
public
ObjectRestResponse
add
(
IntegralUserTotalDto
integralUserTotalDto
)
{
return
integralUserTotalBiz
.
add
(
integralUserTotalDto
);
}
@PostMapping
(
value
=
"/delete"
)
public
ObjectRestResponse
deleteById
()
{
return
integralUserTotalBiz
.
deleteOne
();
}
@GetMapping
(
value
=
"/getByUser"
)
public
ObjectRestResponse
getByUser
()
{
return
integralUserTotalBiz
.
getByUser
();
}
@GetMapping
(
value
=
"/getAll"
)
public
ObjectRestResponse
getAll
(
IntegralUserTotalDto
integralUserTotalDto
)
{
return
integralUserTotalBiz
.
getAll
(
integralUserTotalDto
);
}
}
}
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralRuleMapper.xml
View file @
d4a658a8
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<result
column=
"end_time"
property=
"endTime"
jdbcType=
"BIGINT"
/>
<result
column=
"end_time"
property=
"endTime"
jdbcType=
"BIGINT"
/>
<result
column=
"upd_time"
property=
"updTime"
jdbcType=
"BIGINT"
/>
<result
column=
"upd_time"
property=
"updTime"
jdbcType=
"BIGINT"
/>
<result
column=
"remarks"
property=
"remarks"
jdbcType=
"VARCHAR"
/>
<result
column=
"remarks"
property=
"remarks"
jdbcType=
"VARCHAR"
/>
<result
column=
"de
sc"
property=
"desc
"
jdbcType=
"VARCHAR"
/>
<result
column=
"de
tail"
property=
"detail
"
jdbcType=
"VARCHAR"
/>
<result
column=
"img"
property=
"img"
jdbcType=
"VARCHAR"
/>
<result
column=
"img"
property=
"img"
jdbcType=
"VARCHAR"
/>
<result
column=
"order_id"
property=
"orderId"
jdbcType=
"INTEGER"
/>
<result
column=
"order_id"
property=
"orderId"
jdbcType=
"INTEGER"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
...
@@ -28,16 +28,14 @@
...
@@ -28,16 +28,14 @@
<result
column=
"other_rule"
property=
"otherRule"
jdbcType=
"LONGVARCHAR"
/>
<result
column=
"other_rule"
property=
"otherRule"
jdbcType=
"LONGVARCHAR"
/>
</resultMap>
</resultMap>
<select
id=
"selectAllByParam"
resultType=
"com.xxfc.platform.activity.entity.IntegralRule"
parameterType=
"com.xxfc.platform.activity.
entity.IntegralRule
"
>
<select
id=
"selectAllByParam"
resultType=
"com.xxfc.platform.activity.entity.IntegralRule"
parameterType=
"com.xxfc.platform.activity.
vo.IntegralRuleDto
"
>
select * from integral_rule
select * from integral_rule
<where>
<where>
<if
test=
"id != null"
>
<if
test=
"id != null"
>
and id = #{id}
and id = #{id}
</if>
</if>
<if
test=
"name != null"
>
and isdel = 0 and status = 1
and name like concat("%", #{name}, "%")
</if>
</where>
</where>
order by order_id DESC ,crt_time DESC
order by order_id DESC ,crt_time DESC
</select>
</select>
...
...
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralSignRecordMapper.xml
View file @
d4a658a8
...
@@ -11,4 +11,10 @@
...
@@ -11,4 +11,10 @@
<result
column=
"start_time"
property=
"startTime"
jdbcType=
"BIGINT"
/>
<result
column=
"start_time"
property=
"startTime"
jdbcType=
"BIGINT"
/>
<result
column=
"last_time"
property=
"lastTime"
jdbcType=
"BIGINT"
/>
<result
column=
"last_time"
property=
"lastTime"
jdbcType=
"BIGINT"
/>
</resultMap>
</resultMap>
<select
id=
"selectByUserId"
parameterType=
"java.lang.Integer"
resultType=
"com.xxfc.platform.activity.entity.IntegralSignRecord"
>
select * from integral_sign_record
where user_id = #{userId} and isdel = 0
order by last_time
</select>
</mapper>
</mapper>
\ No newline at end of file
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralUserRecordMapper.xml
View file @
d4a658a8
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
-->
-->
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"user_id"
property=
"userId"
jdbcType=
"INTEGER"
/>
<result
column=
"user_id"
property=
"userId"
jdbcType=
"INTEGER"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"
BIT
"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"
INTEGER
"
/>
<result
column=
"point"
property=
"point"
jdbcType=
"INTEGER"
/>
<result
column=
"point"
property=
"point"
jdbcType=
"INTEGER"
/>
<result
column=
"integral_rule_id"
property=
"integralRuleId"
jdbcType=
"INTEGER"
/>
<result
column=
"integral_rule_id"
property=
"integralRuleId"
jdbcType=
"INTEGER"
/>
<result
column=
"crt_time"
property=
"crtTime"
jdbcType=
"BIGINT"
/>
<result
column=
"crt_time"
property=
"crtTime"
jdbcType=
"BIGINT"
/>
...
@@ -15,4 +15,18 @@
...
@@ -15,4 +15,18 @@
<result
column=
"isdel"
property=
"isdel"
jdbcType=
"BIT"
/>
<result
column=
"isdel"
property=
"isdel"
jdbcType=
"BIT"
/>
<result
column=
"channel_id"
property=
"channelId"
jdbcType=
"INTEGER"
/>
<result
column=
"channel_id"
property=
"channelId"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
<select
id=
"selectByUserId"
parameterType=
"java.lang.Integer"
resultType=
"com.xxfc.platform.activity.entity.IntegralUserRecord"
>
select * from integral_user_record
<where>
<if
test=
"userId != null"
>
and user_id = #{userId}
</if>
</where>
order by crt_time DESC
</select>
<select
id=
"selectByUserAndTime"
resultType=
"com.xxfc.platform.activity.entity.IntegralUserRecord"
parameterType=
"com.xxfc.platform.activity.vo.IntegralUserRecordDto"
>
select * from integral_user_record
where user_id = #{userId} and crt_time between #{startTime} and #{endTime} and integral_rule_id = #{integralRuleId}
</select>
</mapper>
</mapper>
\ No newline at end of file
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralUserTotalMapper.xml
View file @
d4a658a8
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<result
column=
"upd_time"
property=
"updTime"
jdbcType=
"BIGINT"
/>
<result
column=
"upd_time"
property=
"updTime"
jdbcType=
"BIGINT"
/>
</resultMap>
</resultMap>
<select
id=
"selectAllByParam"
parameterType=
"com.xxfc.platform.activity.
entity.IntegralUserTotal
"
resultType=
"com.xxfc.platform.activity.entity.IntegralUserTotal"
>
<select
id=
"selectAllByParam"
parameterType=
"com.xxfc.platform.activity.
vo.IntegralUserTotalDto
"
resultType=
"com.xxfc.platform.activity.entity.IntegralUserTotal"
>
select * from integral_user_total
select * from integral_user_total
<where>
<where>
<if
test=
"userId != null"
>
<if
test=
"userId != null"
>
...
...
xx-order/xx-order-server/src/main/resources/mapper/BaseOrderMapper.xml
View file @
d4a658a8
...
@@ -152,7 +152,10 @@
...
@@ -152,7 +152,10 @@
<if
test=
"no != null"
>
<if
test=
"no != null"
>
and no like CONCAT ("%", #{no}, "%")
and no like CONCAT ("%", #{no}, "%")
</if>
</if>
<if
test=
"startTime != null"
>
<if
test=
"startTime != null and status == 4"
>
and r.start_time between #{startTime} and #{endTime}
</if>
<if
test=
"startTime != null and status == 5"
>
and r.start_time between #{startTime} and #{endTime}
and r.start_time between #{startTime} and #{endTime}
</if>
</if>
<if
test=
"startCompanyId != null"
>
<if
test=
"startCompanyId != null"
>
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/rest/TourUserController.java
View file @
d4a658a8
...
@@ -72,6 +72,7 @@ public class TourUserController extends TourBaseController<TourUserBiz> {
...
@@ -72,6 +72,7 @@ public class TourUserController extends TourBaseController<TourUserBiz> {
TourUser
tourUser1
=
new
TourUser
();
TourUser
tourUser1
=
new
TourUser
();
tourUser1
.
setUserid
(
userid
);
tourUser1
.
setUserid
(
userid
);
tourUser1
.
setIdCard
(
tourUser
.
getIdCard
());
tourUser1
.
setIdCard
(
tourUser
.
getIdCard
());
tourUser1
.
setIsdel
(
0
);
tourUser1
=
baseBiz
.
selectOne
(
tourUser1
);
tourUser1
=
baseBiz
.
selectOne
(
tourUser1
);
if
(
tourUser1
!=
null
){
if
(
tourUser1
!=
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"出游人证件号一样"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"出游人证件号一样"
);
...
...
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