Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
7670d9c9
Commit
7670d9c9
authored
Apr 27, 2020
by
dengshichuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dsc' into 'develop'
Dsc See merge request 8timerv2/8timerapiv200!52
parents
5ddb80b6
77d390ba
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
211 additions
and
47 deletions
+211
-47
src/main/java/cn/timer/api/callback/wx/WxCallBackController.java
+15
-5
src/main/java/cn/timer/api/controller/LoginController.java
+87
-11
src/main/java/cn/timer/api/controller/dzht/cn/tign/hz/constant/ConfigConstant.java
+19
-9
src/main/java/cn/timer/api/controller/oss/OSSController.java
+7
-4
src/main/java/cn/timer/api/utils/aliyun/AliyunSMS.java
+14
-5
src/main/java/cn/timer/api/utils/aliyun/OSSUtil.java
+0
-0
src/main/java/cn/timer/api/utils/schedule/RemindUtil.java
+6
-4
src/main/resources/application-dev.yml
+27
-3
src/main/resources/application-pro.yml
+18
-3
src/main/resources/application-test.yml
+18
-3
No files found.
src/main/java/cn/timer/api/callback/wx/WxCallBackController.java
View file @
7670d9c9
...
@@ -26,6 +26,7 @@ import cn.hutool.core.date.DateField;
...
@@ -26,6 +26,7 @@ import cn.hutool.core.date.DateField;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.timer.api.bean.qyzx.QyzxEntInfoM
;
import
cn.timer.api.bean.qyzx.businessService.QyzxBuyRecord
;
import
cn.timer.api.bean.qyzx.businessService.QyzxBuyRecord
;
import
cn.timer.api.bean.qyzx.businessService.QyzxOrderRecord
;
import
cn.timer.api.bean.qyzx.businessService.QyzxOrderRecord
;
import
cn.timer.api.bean.qyzx.businessService.QyzxRemainingQuantity
;
import
cn.timer.api.bean.qyzx.businessService.QyzxRemainingQuantity
;
...
@@ -82,9 +83,9 @@ public class WxCallBackController {
...
@@ -82,9 +83,9 @@ public class WxCallBackController {
return
ResultUtil
.
error
(
"请切换到开发/测试环境"
);
return
ResultUtil
.
error
(
"请切换到开发/测试环境"
);
}
}
// TODO 加套餐 如果已经存在可用的套餐 ,怎么搞
// TODO 加套餐 如果已经存在可用的套餐 ,怎么搞
// TODO 如果是系统续费 update企业信息表
updateAndInsert
(
orderNo
);
updateAndInsert
(
orderNo
);
return
ResultUtil
.
data
(
orderNo
,
"购买成功"
);
return
ResultUtil
.
data
(
orderNo
,
"购买成功"
);
}
}
...
@@ -102,7 +103,7 @@ public class WxCallBackController {
...
@@ -102,7 +103,7 @@ public class WxCallBackController {
Integer
expiration
=
jsonObject
.
getInt
(
"expiration"
);
// 商品有效期(天)
Integer
expiration
=
jsonObject
.
getInt
(
"expiration"
);
// 商品有效期(天)
Date
expireDate
=
DateUtil
.
offset
(
new
Date
(),
DateField
.
DAY_OF_YEAR
,
expiration
);
// 时间偏移
Date
expireDate
=
DateUtil
.
offset
(
new
Date
(),
DateField
.
DAY_OF_YEAR
,
expiration
);
// 时间偏移
String
content
=
jsonObject
.
getStr
(
"content"
);
// 商品名称
String
content
=
jsonObject
.
getStr
(
"content"
);
// 商品名称
Integer
specification
=
jsonObject
.
getInt
(
"specification"
);
// 商品规格
Integer
specification
=
jsonObject
.
getInt
(
"specification"
);
// 商品规格
-用于系统续费表示为系统版本0-试用 1-普通 2-专业
String
unit
=
jsonObject
.
getStr
(
"unit"
);
String
unit
=
jsonObject
.
getStr
(
"unit"
);
// Double originalPrice = jsonObject.getDouble("originalPrice"); // 商品原价
// Double originalPrice = jsonObject.getDouble("originalPrice"); // 商品原价
Double
nowPrice
=
jsonObject
.
getDouble
(
"nowPrice"
);
// 购买价
Double
nowPrice
=
jsonObject
.
getDouble
(
"nowPrice"
);
// 购买价
...
@@ -111,14 +112,23 @@ public class WxCallBackController {
...
@@ -111,14 +112,23 @@ public class WxCallBackController {
Integer
pcid
=
qyzxOrderRecord
.
getPcid
();
// 付费内容id
Integer
pcid
=
qyzxOrderRecord
.
getPcid
();
// 付费内容id
Integer
createdUser
=
qyzxOrderRecord
.
getCreateUser
();
// 订单创建人
Integer
createdUser
=
qyzxOrderRecord
.
getCreateUser
();
// 订单创建人
Integer
orgCode
=
qyzxOrderRecord
.
getOrgCode
();
// 公司
Integer
orgCode
=
qyzxOrderRecord
.
getOrgCode
();
// 公司
Integer
totalNum
=
specification
*
count
;
// 套餐总量
if
(
pmid
==
3
)
{
QyzxEntInfoM
qyzxEntInfoM
=
QyzxEntInfoM
.
builder
().
id
(
orgCode
).
build
().
selectById
();
// 企业信息
Date
endTime
=
qyzxEntInfoM
.
getEndTime
();
// 当前到期时间
// Integer level = qyzxEntInfoM.getLevel(); // 原系统版本
// Integer specification = jsonObject.getInt("specification"); // 新系统版本
Date
newEndTime
=
DateUtil
.
offsetDay
(
endTime
,
expiration
*
count
);
// 到期时间+商品有效期x购买数量=系统续费后的时间
qyzxEntInfoM
.
update
(
new
LambdaUpdateWrapper
<
QyzxEntInfoM
>().
eq
(
QyzxEntInfoM:
:
getId
,
orgCode
)
.
set
(
QyzxEntInfoM:
:
getEndTime
,
newEndTime
).
set
(
QyzxEntInfoM:
:
getLevel
,
specification
));
}
else
{
QyzxRemainingQuantity
quantity
=
new
QyzxRemainingQuantity
();
QyzxRemainingQuantity
quantity
=
new
QyzxRemainingQuantity
();
quantity
.
setOrderNo
(
orderNo
);
// 订单号
quantity
.
setOrderNo
(
orderNo
);
// 订单号
quantity
.
setContent
(
content
);
// 商品名称
quantity
.
setContent
(
content
);
// 商品名称
quantity
.
setExpireDate
(
expireDate
);
// 到期时间
quantity
.
setExpireDate
(
expireDate
);
// 到期时间
quantity
.
setSpecification
(
specification
);
// 套餐规格
quantity
.
setSpecification
(
specification
);
// 套餐规格
Integer
totalNum
=
specification
*
count
;
// 套餐总量
quantity
.
setTotalNum
(
totalNum
);
// 套餐总量
quantity
.
setTotalNum
(
totalNum
);
quantity
.
setRemainder
(
totalNum
);
// 套餐剩余数(同上)
quantity
.
setRemainder
(
totalNum
);
// 套餐剩余数(同上)
quantity
.
setCount
(
count
);
// 购买数量
quantity
.
setCount
(
count
);
// 购买数量
quantity
.
setPmid
(
pmid
);
// 付费模块id
quantity
.
setPmid
(
pmid
);
// 付费模块id
...
@@ -127,7 +137,7 @@ public class WxCallBackController {
...
@@ -127,7 +137,7 @@ public class WxCallBackController {
quantity
.
setCreateUser
(
createdUser
);
quantity
.
setCreateUser
(
createdUser
);
quantity
.
setOrgCode
(
orgCode
);
quantity
.
setOrgCode
(
orgCode
);
quantity
.
insert
();
quantity
.
insert
();
}
// 插入购买记录表
// 插入购买记录表
QyzxBuyRecord
qyzxBuyRecord
=
new
QyzxBuyRecord
();
QyzxBuyRecord
qyzxBuyRecord
=
new
QyzxBuyRecord
();
qyzxBuyRecord
.
setSpecification
(
specification
);
qyzxBuyRecord
.
setSpecification
(
specification
);
...
...
src/main/java/cn/timer/api/controller/LoginController.java
View file @
7670d9c9
...
@@ -3,9 +3,12 @@ package cn.timer.api.controller;
...
@@ -3,9 +3,12 @@ package cn.timer.api.controller;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
javax.annotation.PostConstruct
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpSession
;
import
javax.servlet.http.HttpSession
;
...
@@ -24,7 +27,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -24,7 +27,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper
;
import
com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
cn.hutool.core.date.BetweenFormater.Level
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
...
@@ -57,8 +59,85 @@ import io.swagger.annotations.ApiOperation;
...
@@ -57,8 +59,85 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping
(
value
=
"/login"
,
produces
=
{
"application/json"
})
@RequestMapping
(
value
=
"/login"
,
produces
=
{
"application/json"
})
public
class
LoginController
{
public
class
LoginController
{
@Value
(
"${configtest.patht}"
)
@Value
(
"${config-8timer.register-free-time}"
)
public
String
port
;
public
Integer
offset
;
// 系统赠送时间
@Value
(
"${config-8timer.Aliyun.PROJECT_NAME}"
)
private
String
PROJECT_NAME
;
@Value
(
"${config-8timer.Aliyun.REGION_ID}"
)
private
String
REGION_ID
;
@Value
(
"${config-8timer.Aliyun.ACCESSKEY_ID}"
)
private
String
ACCESSKEY_ID
;
@Value
(
"${config-8timer.Aliyun.SECRET}"
)
private
String
SECRET
;
public
static
String
host
;
public
static
String
PROJECT_ID
;
public
static
String
PROJECT_SECRET
;
@Value
(
"${config-8timer.esign.host}"
)
private
String
host_s
;
@Value
(
"${config-8timer.esign.PROJECT_ID}"
)
private
String
PROJECT_ID_s
;
@Value
(
"${config-8timer.esign.PROJECT_SECRET}"
)
private
String
PROJECT_SECRET_s
;
@PostConstruct
public
void
init
()
{
host
=
host_s
;
PROJECT_ID
=
PROJECT_ID_s
;
PROJECT_SECRET
=
PROJECT_SECRET_s
;
}
@Value
(
"${config-8timer.Aliyun.PROJECT_NAME}"
)
private
String
endpoint
;
@Value
(
"${config-8timer.Aliyun.ACCESSKEY_ID}"
)
private
String
accessKeyId
;
@Value
(
"${config-8timer.Aliyun.SECRET}"
)
private
String
accessKeySecret
;
@Value
(
"${config-8timer.Aliyun.bucketName}"
)
private
String
bucketName
;
@Value
(
"${config-8timer.Aliyun.bucketName_pri}"
)
private
String
bucketName_pri
;
@Value
(
"${config-8timer.Aliyun.project_package}"
)
private
String
project_package
;
@Value
(
"${config-8timer.Aliyun.expirationTime}"
)
private
String
expirationTime
;
@Value
(
"${config-8timer.Aliyun.expirationTime_pri}"
)
private
String
expirationTime_pri
;
@GetMapping
(
value
=
"/test"
)
public
Map
<
String
,
Object
>
test
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"1"
,
offset
);
map
.
put
(
"2"
,
PROJECT_NAME
);
map
.
put
(
"3"
,
REGION_ID
);
map
.
put
(
"4"
,
ACCESSKEY_ID
);
map
.
put
(
"5"
,
SECRET
);
map
.
put
(
"6"
,
host
);
map
.
put
(
"7"
,
PROJECT_ID
);
map
.
put
(
"8"
,
PROJECT_SECRET
);
map
.
put
(
"9"
,
endpoint
);
map
.
put
(
"10"
,
accessKeyId
);
map
.
put
(
"11"
,
accessKeySecret
);
map
.
put
(
"12"
,
bucketName
);
map
.
put
(
"13"
,
bucketName_pri
);
map
.
put
(
"14"
,
project_package
);
map
.
put
(
"15"
,
expirationTime
);
map
.
put
(
"16"
,
expirationTime_pri
);
return
map
;
}
@Autowired
@Autowired
private
HttpSession
session
;
private
HttpSession
session
;
...
@@ -72,12 +151,6 @@ public class LoginController {
...
@@ -72,12 +151,6 @@ public class LoginController {
// @Autowired
// @Autowired
// private DataSourceTransactionManager transactionManager;
// private DataSourceTransactionManager transactionManager;
@GetMapping
(
value
=
"/testPro"
)
public
Result
<
String
>
testPro
()
{
System
.
out
.
print
(
port
);
return
ResultUtil
.
success
(
"configtest:"
+
port
);
}
/**
/**
* 发送验证码
* 发送验证码
*
*
...
@@ -381,7 +454,9 @@ public class LoginController {
...
@@ -381,7 +454,9 @@ public class LoginController {
}
}
// 企业信息
// 企业信息
QyzxEntInfoM
qyzxEntInfoM
=
QyzxEntInfoM
.
builder
().
name
(
name
).
registerTime
(
DateUtil
.
date
()).
endTime
(
DateUtil
.
nextMonth
()).
level
(
CommonEnum
.
LEVEL_PROBATION
.
getType
()).
build
();
QyzxEntInfoM
qyzxEntInfoM
=
QyzxEntInfoM
.
builder
().
name
(
name
).
registerTime
(
DateUtil
.
date
())
.
endTime
(
DateUtil
.
offsetDay
(
new
Date
(),
offset
)).
level
(
CommonEnum
.
LEVEL_PROBATION
.
getType
())
.
build
();
boolean
b1
=
qyzxEntInfoM
.
insert
();
boolean
b1
=
qyzxEntInfoM
.
insert
();
if
(!
b1
)
{
if
(!
b1
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
...
@@ -397,7 +472,8 @@ public class LoginController {
...
@@ -397,7 +472,8 @@ public class LoginController {
* DateUtil.date()) .endTime(DateUtil.nextMonth()).build();
* DateUtil.date()) .endTime(DateUtil.nextMonth()).build();
*/
*/
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
phone
).
pw
(
Md5
.
md5
(
pw
))
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
phone
).
pw
(
Md5
.
md5
(
pw
))
.
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
orgId
(
qyzxEntInfoM
.
getId
()).
regTime
(
DateUtil
.
date
()).
build
();
.
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
orgId
(
qyzxEntInfoM
.
getId
()).
regTime
(
DateUtil
.
date
())
.
build
();
boolean
b2
=
qyzxEmpLogin
.
insert
();
boolean
b2
=
qyzxEmpLogin
.
insert
();
if
(!
b2
)
{
if
(!
b2
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
...
...
src/main/java/cn/timer/api/controller/dzht/cn/tign/hz/constant/ConfigConstant.java
View file @
7670d9c9
package
cn
.
timer
.
api
.
controller
.
dzht
.
cn
.
tign
.
hz
.
constant
;
package
cn
.
timer
.
api
.
controller
.
dzht
.
cn
.
tign
.
hz
.
constant
;
import
javax.annotation.PostConstruct
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
/**
/**
* @version 2.0
* @version 2.0
...
@@ -8,15 +11,22 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -8,15 +11,22 @@ import org.apache.commons.lang3.StringUtils;
*/
*/
public
class
ConfigConstant
{
public
class
ConfigConstant
{
// 模拟环境域名
public
static
String
host
;
public
static
final
String
host
=
"https://smlopenapi.esign.cn"
;
public
static
String
PROJECT_ID
;
// 生产环境域名
public
static
String
PROJECT_SECRET
;
// public static final String host = "https://openapi.esign.cn";
@Value
(
"${config-8timer.esign.host}"
)
private
String
host_s
;
// 项目Id(应用Id)
@Value
(
"${config-8timer.esign.PROJECT_ID}"
)
public
static
final
String
PROJECT_ID
=
"4438775940"
;
private
String
PROJECT_ID_s
;
// 项目密钥(应用密钥)
@Value
(
"${config-8timer.esign.PROJECT_SECRET}"
)
public
static
final
String
PROJECT_SECRET
=
"7b100813cca2746081c57837855ac5af"
;
private
String
PROJECT_SECRET_s
;
@PostConstruct
public
void
init
()
{
host
=
host_s
;
PROJECT_ID
=
PROJECT_ID_s
;
PROJECT_SECRET
=
PROJECT_SECRET_s
;
}
// 机构认证地址
// 机构认证地址
public
static
final
String
getJgrz_URL
(
String
accountId
)
{
public
static
final
String
getJgrz_URL
(
String
accountId
)
{
...
...
src/main/java/cn/timer/api/controller/oss/OSSController.java
View file @
7670d9c9
...
@@ -5,6 +5,7 @@ import java.util.ArrayList;
...
@@ -5,6 +5,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -25,6 +26,8 @@ import io.swagger.annotations.ApiOperation;
...
@@ -25,6 +26,8 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping
(
value
=
"/oss"
,
produces
=
{
"application/json"
})
@RequestMapping
(
value
=
"/oss"
,
produces
=
{
"application/json"
})
@RestController
@RestController
public
class
OSSController
{
public
class
OSSController
{
@Autowired
private
OSSUtil
oss
;
/**
/**
* 上传普通文件
* 上传普通文件
...
@@ -44,7 +47,7 @@ public class OSSController {
...
@@ -44,7 +47,7 @@ public class OSSController {
return
ResultUtil
.
error
(
"上传的文件为空,请重新选择!"
);
return
ResultUtil
.
error
(
"上传的文件为空,请重新选择!"
);
}
else
{
}
else
{
try
{
try
{
url
=
OSSUtil
.
uploadFile
(
path
,
file
.
getInputStream
());
url
=
oss
.
uploadFile
(
path
,
file
.
getInputStream
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -70,7 +73,7 @@ public class OSSController {
...
@@ -70,7 +73,7 @@ public class OSSController {
return
ResultUtil
.
error
(
"上传的文件为空,请重新选择!"
);
return
ResultUtil
.
error
(
"上传的文件为空,请重新选择!"
);
}
else
{
}
else
{
try
{
try
{
url
=
OSSUtil
.
uploadFile
(
path
,
file
.
getInputStream
());
url
=
oss
.
uploadFile
(
path
,
file
.
getInputStream
());
list
.
add
(
url
);
list
.
add
(
url
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -92,7 +95,7 @@ public class OSSController {
...
@@ -92,7 +95,7 @@ public class OSSController {
return
ResultUtil
.
error
(
"上传的文件为空,请重新选择!"
);
return
ResultUtil
.
error
(
"上传的文件为空,请重新选择!"
);
}
else
{
}
else
{
try
{
try
{
OSSUtil
.
uploadPrivateFile
(
path
,
file
.
getInputStream
());
oss
.
uploadPrivateFile
(
path
,
file
.
getInputStream
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -108,7 +111,7 @@ public class OSSController {
...
@@ -108,7 +111,7 @@ public class OSSController {
public
Result
<
String
>
getUrlPrivate
(
@CurrentUser
UserBean
userBean
,
@RequestParam
String
moudle
,
public
Result
<
String
>
getUrlPrivate
(
@CurrentUser
UserBean
userBean
,
@RequestParam
String
moudle
,
@RequestParam
String
fileName
)
{
@RequestParam
String
fileName
)
{
String
path
=
"8timer2.0/"
+
userBean
.
getOrgCode
()
+
"/"
+
moudle
+
"/"
+
fileName
;
String
path
=
"8timer2.0/"
+
userBean
.
getOrgCode
()
+
"/"
+
moudle
+
"/"
+
fileName
;
String
url
=
OSSUtil
.
getUrlP
(
path
);
String
url
=
oss
.
getUrlP
(
path
);
return
ResultUtil
.
data
(
url
,
"获取成功"
);
return
ResultUtil
.
data
(
url
,
"获取成功"
);
}
}
...
...
src/main/java/cn/timer/api/utils/aliyun/AliyunSMS.java
View file @
7670d9c9
...
@@ -2,6 +2,7 @@ package cn.timer.api.utils.aliyun;
...
@@ -2,6 +2,7 @@ package cn.timer.api.utils.aliyun;
import
java.util.Date
;
import
java.util.Date
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -32,12 +33,20 @@ import cn.timer.api.dto.qyzx.EntRegisterDto;
...
@@ -32,12 +33,20 @@ import cn.timer.api.dto.qyzx.EntRegisterDto;
*/
*/
@Transactional
@Transactional
public
class
AliyunSMS
{
public
class
AliyunSMS
{
@Value
(
"${config-8timer.Aliyun.PROJECT_NAME}"
)
private
String
PROJECT_NAME
;
@Value
(
"${config-8timer.Aliyun.REGION_ID}"
)
private
String
REGION_ID
;
@Value
(
"${config-8timer.Aliyun.ACCESSKEY_ID}"
)
private
String
ACCESSKEY_ID
;
@Value
(
"${config-8timer.Aliyun.SECRET}"
)
private
String
SECRET
;
final
static
String
CODE_NAME
=
"TemplateCode"
;
// 短信模板代码参数名
final
static
String
CODE_NAME
=
"TemplateCode"
;
// 短信模板代码参数名
final
static
String
REGION_ID
=
"cn-shenzhen"
;
// 地区参数
final
static
String
PROJECT_NAME
=
"8小时人事管家"
;
// 项目名
final
static
String
ACCESSKEY_ID
=
"LTAI4FuaShJWQ1dggsFWG5CC"
;
final
static
String
SECRET
=
"EJ6qToT4T4u0B5Rb6qrta9WkyGHvGR"
;
final
static
String
TEMPLATE_PARAM
=
"TemplateParam"
;
// 自定义参数
final
static
String
TEMPLATE_PARAM
=
"TemplateParam"
;
// 自定义参数
final
static
String
DOMAIN
=
"dysmsapi.aliyuncs.com"
;
final
static
String
DOMAIN
=
"dysmsapi.aliyuncs.com"
;
final
static
String
VERSION
=
"2017-05-25"
;
final
static
String
VERSION
=
"2017-05-25"
;
...
@@ -199,7 +208,7 @@ public class AliyunSMS {
...
@@ -199,7 +208,7 @@ public class AliyunSMS {
* @return
* @return
*/
*/
@SuppressWarnings
(
"deprecation"
)
@SuppressWarnings
(
"deprecation"
)
public
static
String
remind
(
String
name
,
String
htname
,
String
time
,
String
phone
)
{
public
String
remind
(
String
name
,
String
htname
,
String
time
,
String
phone
)
{
Integer
orgCode
=
QyzxEmpLogin
.
builder
().
build
()
Integer
orgCode
=
QyzxEmpLogin
.
builder
().
build
()
.
selectOne
(
new
LambdaQueryWrapper
<
QyzxEmpLogin
>().
eq
(
QyzxEmpLogin:
:
getPhone
,
phone
)).
getOrgId
();
.
selectOne
(
new
LambdaQueryWrapper
<
QyzxEmpLogin
>().
eq
(
QyzxEmpLogin:
:
getPhone
,
phone
)).
getOrgId
();
...
...
src/main/java/cn/timer/api/utils/aliyun/OSSUtil.java
View file @
7670d9c9
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/utils/schedule/RemindUtil.java
View file @
7670d9c9
...
@@ -58,6 +58,8 @@ public class RemindUtil implements SchedulingConfigurer {
...
@@ -58,6 +58,8 @@ public class RemindUtil implements SchedulingConfigurer {
*/
*/
// @Scheduled(cron = "0 0 8 * * ?") // 每天8点扫一下看有没要提醒的,有就发一个
// @Scheduled(cron = "0 0 8 * * ?") // 每天8点扫一下看有没要提醒的,有就发一个
public
static
String
reportCurrentTime
()
{
public
static
String
reportCurrentTime
()
{
AliyunSMS
sms
=
new
AliyunSMS
();
List
<
HtzzAssoHtgx
>
htgxs
=
HtzzAssoHtgx
.
builder
().
build
().
selectAll
();
List
<
HtzzAssoHtgx
>
htgxs
=
HtzzAssoHtgx
.
builder
().
build
().
selectAll
();
for
(
HtzzAssoHtgx
htgx
:
htgxs
)
{
for
(
HtzzAssoHtgx
htgx
:
htgxs
)
{
QueryWrapper
<
HtzzAdminZzda
>
q
=
new
QueryWrapper
<
HtzzAdminZzda
>();
QueryWrapper
<
HtzzAdminZzda
>
q
=
new
QueryWrapper
<
HtzzAdminZzda
>();
...
@@ -75,13 +77,13 @@ public class RemindUtil implements SchedulingConfigurer {
...
@@ -75,13 +77,13 @@ public class RemindUtil implements SchedulingConfigurer {
System
.
err
.
println
(
name
+
" 的 "
+
htname
+
"还有: "
+
betweenDay
+
" 天到期"
);
System
.
err
.
println
(
name
+
" 的 "
+
htname
+
"还有: "
+
betweenDay
+
" 天到期"
);
if
(
sjc
>
0
)
{
if
(
sjc
>
0
)
{
if
(
betweenDay
<=
1
)
{
if
(
betweenDay
<=
1
)
{
AliyunSMS
.
remind
(
name
,
htname
,
time
,
phone
);
// 少于1天短信提醒
sms
.
remind
(
name
,
htname
,
time
,
phone
);
// 少于1天短信提醒
}
else
if
(
betweenDay
==
3
)
{
}
else
if
(
betweenDay
==
3
)
{
AliyunSMS
.
remind
(
name
,
htname
,
time
,
phone
);
// 少于3天短信提醒
sms
.
remind
(
name
,
htname
,
time
,
phone
);
// 少于3天短信提醒
}
else
if
(
betweenDay
==
7
)
{
}
else
if
(
betweenDay
==
7
)
{
AliyunSMS
.
remind
(
name
,
htname
,
time
,
phone
);
// 少于7天短信提醒
sms
.
remind
(
name
,
htname
,
time
,
phone
);
// 少于7天短信提醒
}
else
if
(
betweenDay
==
30
)
{
}
else
if
(
betweenDay
==
30
)
{
AliyunSMS
.
remind
(
name
,
htname
,
time
,
phone
);
// 少于30天短信提醒
sms
.
remind
(
name
,
htname
,
time
,
phone
);
// 少于30天短信提醒
}
}
}
else
{
}
else
{
zzda
.
setTxkgType
(
1
);
// 关闭提醒
zzda
.
setTxkgType
(
1
);
// 关闭提醒
...
...
src/main/resources/application-dev.yml
View file @
7670d9c9
...
@@ -149,5 +149,29 @@ logging:
...
@@ -149,5 +149,29 @@ logging:
# ui-config:
# ui-config:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
configtest
:
config-8timer
:
patht
:
'
devPath-dev'
register-free-time
:
90
#系统赠送时间
\ No newline at end of file
Aliyun
:
# 阿里云
PROJECT_NAME
:
8小时人事管家
REGION_ID
:
cn-shenzhen
ACCESSKEY_ID
:
LTAI4FuaShJWQ1dggsFWG5CC
SECRET
:
EJ6qToT4T4u0B5Rb6qrta9WkyGHvGR
endpoint
:
http://oss-cn-shenzhen.aliyuncs.com
# accessKeyId: LTAI4FuaShJWQ1dggsFWG5CC
# accessKeySecret: EJ6qToT4T4u0B5Rb6qrta9WkyGHvGR
bucketName
:
8time-v2
bucketName_pri
:
8time-v2-private
project_package
:
8timer2.0/
expirationTime
:
3153600000000L
expirationTime_pri
:
600000L
esign
:
# e签宝
host
:
https://smlopenapi.esign.cn
# test
:
https://smlopenapi.esign.cn
# pro
:
https://openapi.esign.cn
PROJECT_ID
:
4438775940
PROJECT_SECRET
:
7b100813cca2746081c57837855ac5af
\ No newline at end of file
src/main/resources/application-pro.yml
View file @
7670d9c9
...
@@ -125,5 +125,20 @@ logging:
...
@@ -125,5 +125,20 @@ logging:
# ui-config:
# ui-config:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
configtest
:
config-8timer
:
patht
:
'
devPath-pro'
register-free-time
:
90
#系统赠送时间
\ No newline at end of file
Aliyun
:
# 阿里云
PROJECT_NAME
:
8小时人事管家
REGION_ID
:
cn-shenzhen
ACCESSKEY_ID
:
LTAI4FuaShJWQ1dggsFWG5CC
SECRET
:
EJ6qToT4T4u0B5Rb6qrta9WkyGHvGR
endpoint
:
http://oss-cn-shenzhen.aliyuncs.com
bucketName
:
8time-v2
bucketName_pri
:
8time-v2-private
project_package
:
8timer2.0/
expirationTime
:
3153600000000L
expirationTime_pri
:
600000L
esign
:
# e签宝
host
:
https://openapi.esign.cn
PROJECT_ID
:
4438775940
PROJECT_SECRET
:
7b100813cca2746081c57837855ac5af
\ No newline at end of file
src/main/resources/application-test.yml
View file @
7670d9c9
...
@@ -125,5 +125,20 @@ logging:
...
@@ -125,5 +125,20 @@ logging:
# ui-config:
# ui-config:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
configtest
:
config-8timer
:
patht
:
'
devPath-test'
register-free-time
:
90
#系统赠送时间
\ No newline at end of file
Aliyun
:
# 阿里云
PROJECT_NAME
:
8小时人事管家
REGION_ID
:
cn-shenzhen
ACCESSKEY_ID
:
LTAI4FuaShJWQ1dggsFWG5CC
SECRET
:
EJ6qToT4T4u0B5Rb6qrta9WkyGHvGR
endpoint
:
http://oss-cn-shenzhen.aliyuncs.com
bucketName
:
8time-v2
bucketName_pri
:
8time-v2-private
project_package
:
8timer2.0/
expirationTime
:
3153600000000L
expirationTime_pri
:
600000L
esign
:
# e签宝
host
:
https://smlopenapi.esign.cn
PROJECT_ID
:
4438775940
PROJECT_SECRET
:
7b100813cca2746081c57837855ac5af
\ No newline at end of file
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