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
a8450e23
Commit
a8450e23
authored
May 09, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础服务到期发短信提醒、余额欠费提醒
parent
4865592f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
0 deletions
+83
-0
BillingAccountApiService.java
.../com/gic/enterprise/service/BillingAccountApiService.java
+10
-0
EnterpriseApiService.java
...java/com/gic/enterprise/service/EnterpriseApiService.java
+10
-0
BillingAccountApiServiceImpl.java
...rise/service/outer/impl/BillingAccountApiServiceImpl.java
+24
-0
EnterpriseApiServiceImpl.java
...terprise/service/outer/impl/EnterpriseApiServiceImpl.java
+39
-0
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/BillingAccountApiService.java
View file @
a8450e23
...
...
@@ -86,4 +86,14 @@ public interface BillingAccountApiService {
* @throws
*/
ServiceResponse
<
Integer
>
deductAccount
(
double
totalFee
,
Integer
enterpriseId
);
/**
* 余额欠费提醒发短信
* @Title: balanceTask
* @Description:
* @author guojuxing
* @param param
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
balanceTask
(
String
param
);
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/EnterpriseApiService.java
View file @
a8450e23
...
...
@@ -230,4 +230,14 @@ public interface EnterpriseApiService {
* @return
*/
ServiceResponse
<
Void
>
overdueReminder
(
String
param
);
/**
* 商户基础服务到期提醒
* @Title: expireReminder
* @Description:
* @author guojuxing
* @param param
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
expireReminder
(
String
param
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/BillingAccountApiServiceImpl.java
View file @
a8450e23
...
...
@@ -16,6 +16,7 @@ import com.gic.enterprise.entity.TabEnterprise;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
com.gic.enterprise.service.*
;
import
com.gic.marketing.process.api.service.sms.SmsSendApiService
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -52,6 +53,8 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
private
BillingOrderApiService
billingOrderApiService
;
@Autowired
private
Config
config
;
@Autowired
private
SmsSendApiService
smsSendApiService
;
@Override
public
ServiceResponse
<
BillingAccountDTO
>
getByEnterpriseId
(
Integer
enterpriseId
)
{
...
...
@@ -248,6 +251,27 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
}
}
@Override
public
ServiceResponse
<
Void
>
balanceTask
(
String
param
)
{
//查询所有的商户
List
<
EnterpriseDTO
>
enterpriseDTOList
=
enterpriseService
.
listEnterprise
();
for
(
EnterpriseDTO
enterpriseDTO
:
enterpriseDTOList
)
{
Integer
enterpriseId
=
enterpriseDTO
.
getEnterpriseId
();
TabBillingAccount
account
=
this
.
billingAccountService
.
getByEnterpriseId
(
enterpriseId
);
if
(
account
.
getAccountBalance
()
<=
0
)
{
String
[]
smsArr
=
new
String
[]{
enterpriseDTO
.
getEnterpriseName
(),
String
.
valueOf
(-
account
.
getAccountBalance
())};
ServiceResponse
<
UserDTO
>
userResult
=
userApiService
.
getUserByEnterpriseId
(
enterpriseId
);
UserDTO
userDTO
=
userResult
.
getResult
();
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GICJFZX001"
,
enterpriseId
,
userDTO
.
getPhoneAreaCode
(),
userDTO
.
getPhoneNumber
(),
smsArr
);
if
(!
smsSendResult
.
isSuccess
())
{
LOGGER
.
warn
(
smsSendResult
.
getMessage
());
}
}
}
return
ServiceResponse
.
success
();
}
private
void
sendTotoItem
(
Integer
enterpriseId
)
{
TodoItemDTO
todoItemDTO
=
new
TodoItemDTO
();
UserDTO
userDTO
=
userApiService
.
getUserByEnterpriseId
(
enterpriseId
).
getResult
();
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/EnterpriseApiServiceImpl.java
View file @
a8450e23
...
...
@@ -3,6 +3,8 @@ package com.gic.enterprise.service.outer.impl;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
com.gic.enterprise.constant.BillingAuditStatusEnum
;
import
com.gic.marketing.process.api.service.sms.SmsSendApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -85,6 +87,8 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
private
PushMessageApiService
pushMessageApiService
;
@Autowired
private
DataConfigApiService
dataConfigApiService
;
@Autowired
private
SmsSendApiService
smsSendApiService
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -582,6 +586,16 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
if
(
days
<=
7
){
this
.
pushMessageApiService
.
pushMessage
(
enterpriseDTO
.
getEnterpriseId
(),
"系统消息"
,
"GIC版本即将过期"
,
"您的GIC版本即将在"
+
days
+
"天到期,为了不影响业务的开展,请及时续费"
);
//发送超级管理员短信通知
String
[]
smsArr
=
new
String
[]{
enterpriseDTO
.
getEnterpriseName
()};
ServiceResponse
<
UserDTO
>
userResult
=
userApiService
.
getUserByEnterpriseId
(
enterpriseDTO
.
getEnterpriseId
());
UserDTO
userDTO
=
userResult
.
getResult
();
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GICJFZX002"
,
userDTO
.
getEnterpriseId
(),
userDTO
.
getPhoneAreaCode
(),
userDTO
.
getPhoneNumber
(),
smsArr
);
if
(!
smsSendResult
.
isSuccess
())
{
LOGGER
.
warn
(
smsSendResult
.
getMessage
());
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
...
...
@@ -590,6 +604,31 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
return
null
;
}
@Override
public
ServiceResponse
<
Void
>
expireReminder
(
String
param
)
{
List
<
EnterpriseDTO
>
list
=
this
.
enterpriseService
.
listEnterprise
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
today
=
sdf
.
format
(
new
Date
());
for
(
EnterpriseDTO
enterpriseDTO
:
list
)
{
if
(
StringUtils
.
isNotBlank
(
enterpriseDTO
.
getVersionCode
()))
{
Date
expireDate
=
enterpriseDTO
.
getAuditTime
();
if
(
today
.
compareTo
(
sdf
.
format
(
expireDate
))
>=
0
)
{
//过期时间小于等于今天,发短信
//发送超级管理员短信通知
String
[]
smsArr
=
new
String
[]{
enterpriseDTO
.
getEnterpriseName
()};
ServiceResponse
<
UserDTO
>
userResult
=
userApiService
.
getUserByEnterpriseId
(
enterpriseDTO
.
getEnterpriseId
());
UserDTO
userDTO
=
userResult
.
getResult
();
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GICJFZX003"
,
userDTO
.
getEnterpriseId
(),
userDTO
.
getPhoneAreaCode
(),
userDTO
.
getPhoneNumber
(),
smsArr
);
if
(!
smsSendResult
.
isSuccess
())
{
LOGGER
.
warn
(
smsSendResult
.
getMessage
());
}
}
}
}
return
ServiceResponse
.
success
();
}
private
String
getVersionNameFromJson
(
String
jsonStr
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonStr
);
JSONObject
version
=
jsonObject
.
getJSONObject
(
"version"
);
...
...
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