Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
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
base_platform_enterprise
gic-platform-enterprise
Commits
649b60c7
Commit
649b60c7
authored
Apr 01, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
952f5021
00061a07
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
138 additions
and
34 deletions
+138
-34
SmsAppEnum.java
...src/main/java/com/gic/enterprise/constant/SmsAppEnum.java
+17
-18
RecordQO.java
...ise-api/src/main/java/com/gic/enterprise/qo/RecordQO.java
+12
-0
TabBillingInternationalSmsRecordMapper.xml
...sources/mapper/TabBillingInternationalSmsRecordMapper.xml
+6
-0
TabBillingSmsRecordMapper.xml
...e/src/main/resources/mapper/TabBillingSmsRecordMapper.xml
+6
-0
TabPushMessageMapper.xml
...ervice/src/main/resources/mapper/TabPushMessageMapper.xml
+2
-2
BillingRecordController.java
...ic/enterprise/web/controller/BillingRecordController.java
+92
-12
dubbo-gic-platform-enterprise-web.xml
.../src/main/resources/dubbo-gic-platform-enterprise-web.xml
+1
-0
PushMessageController.java
...m/gic/operation/web/controller/PushMessageController.java
+2
-2
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/constant/SmsAppEnum.java
View file @
649b60c7
...
...
@@ -9,41 +9,40 @@ import org.apache.commons.lang3.StringUtils;
*/
public
enum
SmsAppEnum
{
MEMBER_OPEN_CARD
(
"MEMBER_OPEN_CARD"
,
"会员开卡"
),
GIC_MALL
(
"GIC_MALL"
,
"微商城"
),
GIC_INTEGRAL
(
"GIC_INTEGRAL"
,
"积分商城"
),
SMS
(
"sms"
,
"短信营销"
),
ECM
(
"ecm"
,
"触点营销"
),
ECM_TIMER
(
"ecm-timer"
,
"定时营销"
),
GAME_DZP
(
"dzp"
,
"大转盘"
),
GAME_GGK
(
"ggk"
,
"刮刮卡"
),
GAME_KLFL
(
"klfl"
,
"口令福利"
),
GAME_PTYX
(
"ptyx"
,
"拼图游戏"
),
OTHER
(
"other"
,
"其他"
),
MEMBER_OPEN_CARD
(
"MEMBER_OPEN_CARD"
,
"会员开卡"
,
false
),
GIC_MALL
(
"GIC_MALL"
,
"微商城"
,
true
),
GIC_INTEGRAL
(
"GIC_INTEGRAL"
,
"积分商城"
,
true
),
SMS
(
"sms"
,
"短信营销"
,
true
),
ECM
(
"ecm"
,
"触点营销"
,
true
),
ECM_TIMER
(
"ecm-timer"
,
"定时营销"
,
true
),
GAME_DZP
(
"dzp"
,
"大转盘"
,
true
),
GAME_GGK
(
"ggk"
,
"刮刮卡"
,
true
),
GAME_KLFL
(
"klfl"
,
"口令福利"
,
true
),
GAME_PTYX
(
"ptyx"
,
"拼图游戏"
,
true
),
OTHER
(
"other"
,
"其他"
,
false
),
;
private
String
code
;
private
String
name
;
// 需要权限控制
private
boolean
isCtrl
;
SmsAppEnum
(
String
code
,
String
name
)
{
SmsAppEnum
(
String
code
,
String
name
,
boolean
isCtrl
)
{
this
.
code
=
code
;
this
.
name
=
name
;
this
.
isCtrl
=
isCtrl
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
public
boolean
isCtrl
(
)
{
return
isCtrl
;
}
public
static
String
getNameByCode
(
String
code
)
{
...
...
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/qo/RecordQO.java
View file @
649b60c7
package
com
.
gic
.
enterprise
.
qo
;
import
java.util.List
;
/**
*
* @Description:
...
...
@@ -42,6 +44,8 @@ public class RecordQO extends PageQO {
private
Integer
payType
;
private
List
<
String
>
appCodeList
;
public
String
getStartTime
()
{
return
startTime
;
}
...
...
@@ -113,4 +117,12 @@ public class RecordQO extends PageQO {
public
void
setPayType
(
Integer
payType
)
{
this
.
payType
=
payType
;
}
public
List
<
String
>
getAppCodeList
()
{
return
appCodeList
;
}
public
void
setAppCodeList
(
List
<
String
>
appCodeList
)
{
this
.
appCodeList
=
appCodeList
;
}
}
gic-platform-enterprise-service/src/main/resources/mapper/TabBillingInternationalSmsRecordMapper.xml
View file @
649b60c7
...
...
@@ -467,6 +467,12 @@
<if
test=
"appCode != null "
>
and app_code = #{appCode}
</if>
<if
test=
"null != appCodeList and appCodeList.size > 0"
>
and app_code in
<foreach
collection=
"appCodeList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"smsContent != null and smsContent != '' "
>
and ( sms_content like concat('%', #{smsContent}, '%') or receive_phone like concat('%', #{smsContent}, '%') )
</if>
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabBillingSmsRecordMapper.xml
View file @
649b60c7
...
...
@@ -477,6 +477,12 @@
<if
test=
"appCode != null and appCode != '' "
>
and app_code = #{appCode}
</if>
<if
test=
"null != appCodeList and appCodeList.size > 0"
>
and app_code in
<foreach
collection=
"appCodeList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"smsContent != null and smsContent != '' "
>
and (sms_content like concat('%', #{smsContent}, '%') or receive_phone like concat('%', #{smsContent}, '%') )
</if>
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabPushMessageMapper.xml
View file @
649b60c7
...
...
@@ -251,7 +251,7 @@
and (update_time
>
= #{startTime} or push_time
>
= #{startTime})
</if>
<if
test=
"endTime != null"
>
and (update_time
<
= #{endTime} or
update
_time
<
= #{endTime})
and (update_time
<
= #{endTime} or
push
_time
<
= #{endTime})
</if>
<if
test=
"pushClassifyId != null"
>
and push_classify_id = #{pushClassifyId}
...
...
@@ -264,7 +264,7 @@
where t1.user_id=#{userId}
and (t1.status = 1 or t1.status = 2) and t1.message_id=t3.message_id
<if
test=
"search != null and search != ''"
>
and (t
itle like concat('%', #{search}, '%') or
content like concat('%', #{search}, '%'))
and (t
1.title like concat('%', #{search}, '%') or t1.
content like concat('%', #{search}, '%'))
</if>
<if
test=
"status != null"
>
and t1.status = #{status}
...
...
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/BillingRecordController.java
View file @
649b60c7
...
...
@@ -2,25 +2,35 @@ package com.gic.enterprise.web.controller;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.service.MenuApiService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.constant.SmsAppEnum
;
import
com.gic.enterprise.dto.*
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.qo.RecordQO
;
import
com.gic.enterprise.service.BillingRecordApiService
;
import
com.gic.enterprise.service.DictApiService
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.enterprise.web.vo.*
;
import
com.gic.open.api.dto.ApplicationDTO
;
import
com.gic.open.api.service.ApplicationApiService
;
import
com.google.common.cache.CacheBuilder
;
import
com.google.common.cache.CacheLoader
;
import
com.google.common.cache.LoadingCache
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.
ArrayList
;
import
java.util.
HashMap
;
import
java.util.
Lis
t
;
import
java.util.
Map
;
import
java.util.
*
;
import
java.util.
concurrent.ExecutionException
;
import
java.util.
concurrent.TimeUni
t
;
import
java.util.
stream.Collectors
;
/**
*
...
...
@@ -31,10 +41,32 @@ import java.util.Map;
@RestController
public
class
BillingRecordController
{
private
Logger
logger
=
LogManager
.
getLogger
(
BillingRecordController
.
class
);
@Autowired
private
BillingRecordApiService
billingRecordApiService
;
@Autowired
private
DictApiService
dictApiService
;
@Autowired
ApplicationApiService
applicationApiService
;
@Autowired
MenuApiService
menuApiService
;
LoadingCache
<
String
,
Long
>
appCache
=
CacheBuilder
.
newBuilder
()
.
maximumSize
(
20
)
.
expireAfterWrite
(
1L
,
TimeUnit
.
HOURS
)
.
build
(
new
CacheLoader
<
String
,
Long
>()
{
@Override
public
Long
load
(
String
s
)
throws
Exception
{
ApplicationDTO
applicationDTO
=
applicationApiService
.
getApplicationByModule
(
s
).
getResult
();
if
(
applicationDTO
!=
null
)
{
return
applicationDTO
.
getApplicationId
();
}
else
{
return
null
;
}
}
});
@RequestMapping
(
"/list-account-balance"
)
public
RestResponse
listAccountBalanceRecord
(
RecordQO
recordQO
)
{
...
...
@@ -101,10 +133,23 @@ public class BillingRecordController {
if
(
StringUtils
.
isNotBlank
(
recordQO
.
getEndTime
()))
{
recordQO
.
setEndTime
(
recordQO
.
getEndTime
()
+
" 23:59:59"
);
}
if
(
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getSuperAdmin
()
==
0
&&
StringUtils
.
isBlank
(
recordQO
.
getAppCode
()))
{
Set
<
String
>
appIdList
=
menuApiService
.
getAppIdSetByUserId
(
UserDetailUtils
.
getUserDetail
().
getUserId
()).
getResult
();
if
(
CollectionUtils
.
isEmpty
(
appIdList
))
{
return
RestResponse
.
success
(
new
Page
<>());
}
List
<
ApplicationDTO
>
applicationList
=
applicationApiService
.
listApplicationByIdIn
(
appIdList
.
stream
().
map
(
Long:
:
valueOf
).
collect
(
Collectors
.
toList
())).
getResult
();
if
(
CollectionUtils
.
isEmpty
(
applicationList
))
{
return
RestResponse
.
success
(
new
Page
<>());
}
List
<
String
>
appCodeList
=
applicationList
.
stream
().
map
(
ApplicationDTO:
:
getModuleCode
).
collect
(
Collectors
.
toList
());
recordQO
.
setAppCodeList
(
appCodeList
);
}
ServiceResponse
<
Page
<
SmsRecordDTO
>>
serviceResponse
=
billingRecordApiService
.
listSmsRecord
(
recordQO
);
if
(
serviceResponse
.
isSuccess
())
{
Page
page
=
new
Page
(
serviceResponse
.
getResult
().
getCurrentPage
(),
serviceResponse
.
getResult
().
getPageSize
(),
serviceResponse
.
getResult
().
getTotalPage
(),
serviceResponse
.
getResult
().
getTotalCount
());
Page
page
=
new
Page
(
serviceResponse
.
getResult
().
getCurrentPage
(),
serviceResponse
.
getResult
().
getPageSize
(),
serviceResponse
.
getResult
().
getTotalPage
(),
serviceResponse
.
getResult
().
getTotalCount
());
List
<
SmsRecordVO
>
list
=
EntityUtil
.
changeEntityListByJSON
(
SmsRecordVO
.
class
,
serviceResponse
.
getResult
().
getResult
());
page
.
setResult
(
list
);
return
RestResponse
.
success
(
page
);
...
...
@@ -116,6 +161,24 @@ public class BillingRecordController {
@RequestMapping
(
"/list-international-sms"
)
public
RestResponse
listInternationalSmsRecord
(
RecordQO
recordQO
)
{
recordQO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
if
(
StringUtils
.
isNotBlank
(
recordQO
.
getStartTime
()))
{
recordQO
.
setStartTime
(
recordQO
.
getStartTime
()
+
" 00:00:00"
);
}
if
(
StringUtils
.
isNotBlank
(
recordQO
.
getEndTime
()))
{
recordQO
.
setEndTime
(
recordQO
.
getEndTime
()
+
" 23:59:59"
);
}
if
(
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getSuperAdmin
()
==
0
&&
StringUtils
.
isBlank
(
recordQO
.
getAppCode
()))
{
Set
<
String
>
appIdList
=
menuApiService
.
getAppIdSetByUserId
(
UserDetailUtils
.
getUserDetail
().
getUserId
()).
getResult
();
if
(
CollectionUtils
.
isEmpty
(
appIdList
))
{
return
RestResponse
.
success
(
new
Page
<>());
}
List
<
ApplicationDTO
>
applicationList
=
applicationApiService
.
listApplicationByIdIn
(
appIdList
.
stream
().
map
(
Long:
:
valueOf
).
collect
(
Collectors
.
toList
())).
getResult
();
if
(
CollectionUtils
.
isEmpty
(
applicationList
))
{
return
RestResponse
.
success
(
new
Page
<>());
}
List
<
String
>
appCodeList
=
applicationList
.
stream
().
map
(
ApplicationDTO:
:
getModuleCode
).
collect
(
Collectors
.
toList
());
recordQO
.
setAppCodeList
(
appCodeList
);
}
ServiceResponse
<
Page
<
InternationalSmsRecordDTO
>>
serviceResponse
=
billingRecordApiService
.
listInternationalSmsRecord
(
recordQO
);
if
(
serviceResponse
.
isSuccess
())
{
Page
page
=
new
Page
(
serviceResponse
.
getResult
().
getCurrentPage
(),
serviceResponse
.
getResult
().
getPageSize
(),
serviceResponse
.
getResult
().
getTotalPage
(),
serviceResponse
.
getResult
().
getTotalCount
());
...
...
@@ -149,14 +212,31 @@ public class BillingRecordController {
@RequestMapping
(
"/list-sms-app-type"
)
public
RestResponse
listSmsAppType
()
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<>();
for
(
SmsAppEnum
app
:
SmsAppEnum
.
values
())
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"key"
,
app
.
getName
());
map
.
put
(
"value"
,
app
.
getCode
());
list
.
add
(
map
);
Set
<
String
>
appIdSet
;
if
(
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getSuperAdmin
()
==
0
)
{
appIdSet
=
menuApiService
.
getAppIdSetByUserId
(
UserDetailUtils
.
getUserDetail
().
getUserId
()).
getResult
();
}
else
{
appIdSet
=
new
HashSet
<>();
}
try
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<>();
for
(
SmsAppEnum
app
:
SmsAppEnum
.
values
())
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
app
.
isCtrl
()
&&
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getSuperAdmin
()
==
0
)
{
Long
appId
=
appCache
.
get
(
app
.
getCode
());
if
(!
appIdSet
.
contains
(
appId
.
toString
()))
{
continue
;
}
}
map
.
put
(
"key"
,
app
.
getName
());
map
.
put
(
"value"
,
app
.
getCode
());
list
.
add
(
map
);
}
return
RestResponse
.
success
(
list
);
}
catch
(
ExecutionException
e
)
{
logger
.
info
(
"获取缓存失败"
,
e
);
}
return
RestResponse
.
success
(
list
);
return
RestResponse
.
failure
(
ErrorCode
.
SYSTEM_ERROR
.
getCode
(),
ErrorCode
.
SYSTEM_ERROR
.
getMsg
()
);
}
...
...
gic-platform-enterprise-web/src/main/resources/dubbo-gic-platform-enterprise-web.xml
View file @
649b60c7
...
...
@@ -115,4 +115,5 @@
<dubbo:reference
interface=
"com.gic.marketing.api.service.coupon.CouponShelfApiService"
id=
"couponShelfApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.open.api.service.AppTokenApiService"
id=
"appTokenApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.open.api.service.ApplicationApiService"
id=
"applicationApiService"
timeout=
"6000"
/>
</beans>
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/PushMessageController.java
View file @
649b60c7
...
...
@@ -79,11 +79,11 @@ public class PushMessageController {
@RequestMapping
(
"page-push-message"
)
public
RestResponse
pagePushMessage
(
String
search
,
Integer
pushStatus
,
Integer
classifyId
,
String
startTime
,
String
endTime
,
PageQO
pageQO
){
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd
HH:mm:ss
"
);
ServiceResponse
<
Page
<
PushMessageDTO
>>
response
=
null
;
try
{
response
=
this
.
pushMessageApiService
.
pagePushMessage
(
search
,
pushStatus
,
StringUtils
.
isBlank
(
startTime
)
?
null
:
simpleDateFormat
.
parse
(
startTime
),
StringUtils
.
isBlank
(
endTime
)
?
null
:
simpleDateFormat
.
parse
(
endTime
),
pageQO
.
getCurrentPage
(),
pageQO
.
getPageSize
(),
classifyId
);
StringUtils
.
isBlank
(
startTime
)
?
null
:
simpleDateFormat
.
parse
(
startTime
+
" 00:00:00"
),
StringUtils
.
isBlank
(
endTime
)
?
null
:
simpleDateFormat
.
parse
(
endTime
+
" 23:59:59"
),
pageQO
.
getCurrentPage
(),
pageQO
.
getPageSize
(),
classifyId
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
...
...
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