Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
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
吴学德
gdtel-gztel-school-center
Commits
485d413a
Commit
485d413a
authored
Feb 04, 2021
by
罗承锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改智能平台公共下单方法、添加一人一码用户数据同步、智能平台状态获取定时器、单宽进融签名
parent
fd8530f1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
276 additions
and
89 deletions
+276
-89
apply-net/src/main/java/com/winsun/controller/SingleBroadToIntegrateController.java
+15
-3
apply-net/src/main/java/com/winsun/controller/codeManagerController.java
+0
-1
common/src/main/java/com/winsun/bean/Constant.java
+1
-1
common/src/main/java/com/winsun/bean/SysUser.java
+1
-0
common/src/main/java/com/winsun/bean/ToIntegrateOrderParam.java
+5
-0
common/src/main/java/com/winsun/mapper/OrderMapper.java
+9
-0
common/src/main/java/com/winsun/outSideSystem/IntelligenceSendOrder.java
+54
-17
common/src/main/resources/com/winsun/mapper/mapping/OrderMapper.xml
+47
-43
migration/pom.xml
+3
-5
migration/src/main/java/com/winsun/migration/MigrationApplication.java
+1
-1
migration/src/main/java/com/winsun/migration/controller/MigrationDataController.java
+2
-0
migration/src/main/java/com/winsun/migration/datasource/DataSourceAspect.java
+14
-5
migration/src/main/java/com/winsun/migration/datasource/DataSourceConfig.java
+10
-2
migration/src/main/java/com/winsun/migration/mapper/db1/NewDatabases.java
+7
-6
migration/src/main/java/com/winsun/migration/mapper/db2/OldDatabases.java
+1
-0
migration/src/main/java/com/winsun/migration/service/impl/MigrationServiceImpl.java
+0
-0
service-manager/src/main/java/com/winsun/controller/PackageController.java
+3
-3
task/src/main/java/com/winsun/TimingTask/OrderTask.java
+66
-2
task/src/main/java/com/winsun/TimingTask/RhZhiNenTask.java
+37
-0
No files found.
apply-net/src/main/java/com/winsun/controller/SingleBroadToIntegrateController.java
View file @
485d413a
...
...
@@ -7,10 +7,12 @@ import com.netflix.discovery.converters.Auto;
import
com.winsun.auth.core.annotion.Permission
;
import
com.winsun.auth.core.common.model.ResponseData
;
import
com.winsun.bean.*
;
import
com.winsun.constant.FilePath
;
import
com.winsun.constant.OrderStatus
;
import
com.winsun.mapper.*
;
import
com.winsun.outSideSystem.IntelligenceSendOrder
;
import
com.winsun.smsUtils.SendSmsAndMail
;
import
com.winsun.utils.Base64ToImgUtils
;
import
com.winsun.utils.RandomUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -126,6 +128,8 @@ public class SingleBroadToIntegrateController {
return
ResponseData
.
error
(
"该号码不在优惠清单中"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
e
.
printStackTrace
();
return
ResponseData
.
error
(
"获取验证码失败"
);
}
return
ResponseData
.
success
(
null
,
"获取验证码成功"
);
...
...
@@ -185,6 +189,8 @@ public class SingleBroadToIntegrateController {
// 正常下单保存到数据库中
log
.
info
(
JSONObject
.
toJSONString
(
toIntegrateOrderParam
));
String
imgFilePath
=
""
;
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
// 查询订单类型为(3、5、9、10)的 !异常单
...
...
@@ -255,9 +261,14 @@ public class SingleBroadToIntegrateController {
orderView
.
setExpenses
(
universityInfo
.
getExpenses
());
// 套餐
orderViewMapper
.
insert
(
orderView
);
// TODO 获取签名图片地址
Base64ToImgUtils
base64ToImgUtils
=
new
Base64ToImgUtils
();
// 获取签名图片地址
if
(
StringUtils
.
isBlank
(
toIntegrateOrderParam
.
getImgUrl
())){
return
ResponseData
.
error
(
"签名失败!"
);
}
if
(
StringUtils
.
isNotBlank
(
toIntegrateOrderParam
.
getImgUrl
())){
imgFilePath
=
base64ToImgUtils
.
base64ToImg
(
toIntegrateOrderParam
.
getImgUrl
(),
FilePath
.
PATH
.
getValue
()+
FilePath
.
IMGURLPATH
.
getValue
());
}
// 保存到hhr_order
Order
order
=
new
Order
();
String
uuid
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
...
...
@@ -272,6 +283,7 @@ public class SingleBroadToIntegrateController {
order
.
setIdCard
(
toIntegrateOrderParam
.
getIdCard
());
// 客户身份证
order
.
setCreateTime
(
new
Date
());
// 订单创建时间
order
.
setKapin
(
"单宽进融"
);
// 卡品
order
.
setSignImg
(
imgFilePath
);
// 签名地址
order
.
setDmtNumber
(
dmt
);
// 宽带接入号
order
.
setUserType
(
"10"
);
// 订单类型-单宽进融
order
.
setKdOrderId
(
orderView
.
getOrderSeq
());
// 宽带id
...
...
apply-net/src/main/java/com/winsun/controller/codeManagerController.java
View file @
485d413a
...
...
@@ -9,7 +9,6 @@ import com.winsun.bean.*;
import
com.winsun.constant.OrderStatus
;
import
com.winsun.mapper.*
;
import
com.winsun.smsUtils.SendSmsAndMail
;
import
com.winsun.utils.MessageUtil
;
import
com.winsun.utils.MyBatisPlusUpdateUtils
;
import
com.winsun.utils.RandomUtil
;
import
lombok.extern.slf4j.Slf4j
;
...
...
common/src/main/java/com/winsun/bean/Constant.java
View file @
485d413a
...
...
@@ -24,7 +24,7 @@ public class Constant {
public
final
static
String
USERNAME
=
"apitest"
;
//智能平台提供测试的账号
public
final
static
String
USERNAMEKEY
=
"46b97294d4dac3f62ee42f3ab2804f68"
;
//智能平台提供的测试key
public
final
static
String
ZHENGSHIAUCCON
=
"ruany"
;
//智能平台提供的正式账号
public
final
static
String
ZHANGSHIKEY
=
"3df143292455bfea88bc613c53004d36"
;
//智能平台提供的正式key
public
final
static
String
ZHANGSHIKEY
=
"3df143292455bfea88bc613c53004d36"
;
//智能平台提供的正式key
// public final static String ZHENGSHIAUCCON = "xiaoykd"; //智能平台提供的正式账号
// public final static String ZHANGSHIKEY = "d345040accff0421d03f760a03e5cbd9"; //智能平台提供的正式key
public
final
static
String
ZHANGSHIURL
=
"https://ismart.mini189.cn/api/"
;
//智能平台提供的正式key
...
...
common/src/main/java/com/winsun/bean/SysUser.java
View file @
485d413a
...
...
@@ -131,6 +131,7 @@ public class SysUser implements Serializable {
@TableField
(
value
=
"deptidBelong"
)
private
String
deptidBelong
;
@TableField
(
exist
=
false
)
private
String
oldPassward
;
@TableField
(
exist
=
false
)
...
...
common/src/main/java/com/winsun/bean/ToIntegrateOrderParam.java
View file @
485d413a
...
...
@@ -44,4 +44,9 @@ public class ToIntegrateOrderParam {
* 融合时间
*/
private
String
rhTime
;
/**
* 签名图片
*/
private
String
imgUrl
;
}
common/src/main/java/com/winsun/mapper/OrderMapper.java
View file @
485d413a
...
...
@@ -139,4 +139,13 @@ public interface OrderMapper extends BaseMapper<Order> {
* @return
*/
int
updateCompleteOrder
();
/**
* 更新未下单并且融合时间小于当前时间的订单
* @return
*/
int
updateNosendAndRhTimeLtNowOrder
();
}
common/src/main/java/com/winsun/outSideSystem/IntelligenceSendOrder.java
View file @
485d413a
...
...
@@ -867,6 +867,13 @@ public class IntelligenceSendOrder {
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
rhTime
=
null
;
Date
date
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
0
);
Date
today
=
calendar
.
getTime
();
calendar
.
add
(
Calendar
.
DATE
,
1
);
if
(
order
.
getRhTime
()
==
null
)
{
log
.
info
(
"当前订单无融合时间,无法进行下单:"
+
JSONObject
.
toJSONString
(
order
));
return
;
...
...
@@ -877,7 +884,8 @@ public class IntelligenceSendOrder {
log
.
error
(
"融合日期转换错误"
+
JSONObject
.
toJSONString
(
order
));
return
;
}
if
(
rhTime
.
getTime
()
<=
date
.
getTime
())
{
// 融合时间小于当前时间
if
(
today
.
getTime
()
>
rhTime
.
getTime
())
{
log
.
info
(
"融合日期小于当前日期,改为待受理状态"
+
JSONObject
.
toJSONString
(
order
));
Wrapper
<
Order
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"id"
,
order
.
getId
());
...
...
@@ -887,6 +895,11 @@ public class IntelligenceSendOrder {
orderMapper
.
update
(
updateOrder
,
wrapper
);
return
;
}
// 融合时间大于等于 当前时间的第二天的0点
if
(
rhTime
.
getTime
()
>=
calendar
.
getTime
().
getTime
())
{
log
.
info
(
"融合日期超过当前时间,不下单:"
+
JSONObject
.
toJSONString
(
order
));
return
;
}
}
Map
<
String
,
Object
>
orderMap
=
null
;
...
...
@@ -962,9 +975,9 @@ public class IntelligenceSendOrder {
if
(
schoolMap
.
get
(
"identifying"
)
!=
null
)
{
expenses
=
schoolMap
.
get
(
"identifying"
).
toString
();
}
System
.
out
.
println
(
"----expenses---prices---:"
+
expenses
+
"------"
+
prices
);
log
.
info
(
"----expenses---prices---:"
+
expenses
+
"------"
+
prices
);
JSONArray
saleList
=
saleJsonObject
.
getJSONArray
(
"list"
);
System
.
out
.
println
(
"----saleList---:"
+
saleList
);
log
.
info
(
"----saleList---:"
+
saleList
);
for
(
int
i
=
0
;
i
<
saleList
.
size
();
i
++)
{
net
.
sf
.
json
.
JSONObject
itmeJson
=
net
.
sf
.
json
.
JSONObject
.
fromObject
(
saleList
.
get
(
i
));
...
...
@@ -1019,13 +1032,13 @@ public class IntelligenceSendOrder {
}
}
List
<
NameValuePair
>
qParams
=
new
ArrayList
<
NameValuePair
>();
//
HttpHost proxy = new HttpHost("172.18.101.170", 3128);
HttpHost
proxy
=
new
HttpHost
(
"172.18.101.170"
,
3128
);
RequestConfig
defaultRequestConfig
=
RequestConfig
.
custom
()
.
setSocketTimeout
(
500000
)
.
setConnectTimeout
(
500000
)
.
setConnectionRequestTimeout
(
500000
)
//
.setProxy(proxy)
.
setProxy
(
proxy
)
.
build
();
CloseableHttpClient
httpclient
=
HttpClients
.
custom
().
setDefaultRequestConfig
(
defaultRequestConfig
).
build
();
...
...
@@ -1273,7 +1286,7 @@ public class IntelligenceSendOrder {
||
ORDERAMOUNT
.
equals
(
"0.01"
)
||
ORDERAMOUNT
.
equals
(
"0.02"
))
{
paymentListMap2
.
put
(
"payType"
,
"2"
);
}
else
if
(
orderMap
.
get
(
"custome
Ri
d"
).
toString
().
equals
(
"xjzf"
))
{
}
else
if
(
orderMap
.
get
(
"custome
rI
d"
).
toString
().
equals
(
"xjzf"
))
{
paymentListMap2
.
put
(
"payType"
,
"2"
);
}
else
{
paymentListMap2
.
put
(
"payType"
,
"4"
);
// 缴费方式,必填(例:payType:3)3:代理商打款4:穗易付7:货到付款
...
...
@@ -1490,9 +1503,9 @@ public class IntelligenceSendOrder {
String
state
=
queryOrderJsonObject
.
getString
(
"state"
);
Wrapper
<
Order
>
orderWrapper
=
new
EntityWrapper
<>();
orderWrapper
.
eq
(
"kd_order_id"
,
order
Num
);
orderWrapper
.
eq
(
"kd_order_id"
,
order
Map
.
get
(
"orderSeq"
).
toString
()
);
Order
updateOrder
=
new
Order
();
updateOrder
.
setOrderId
(
order
Map
.
get
(
"orderSeq"
).
toString
()
);
updateOrder
.
setOrderId
(
order
Num
);
updateOrder
.
setOrderStatus
(
"审核中"
);
orderMapper
.
update
(
updateOrder
,
orderWrapper
);
...
...
@@ -1550,13 +1563,13 @@ public class IntelligenceSendOrder {
}
// 3、提交订单到智能平台
List
<
NameValuePair
>
qParams
=
new
ArrayList
<
NameValuePair
>();
//
HttpHost proxy = new HttpHost("172.18.101.170", 3128);
HttpHost
proxy
=
new
HttpHost
(
"172.18.101.170"
,
3128
);
RequestConfig
defaultRequestConfig
=
RequestConfig
.
custom
()
.
setSocketTimeout
(
500000
)
.
setConnectTimeout
(
500000
)
.
setConnectionRequestTimeout
(
500000
)
//
.setProxy(proxy)
.
setProxy
(
proxy
)
.
build
();
CloseableHttpClient
httpclient
=
HttpClients
.
custom
().
setDefaultRequestConfig
(
defaultRequestConfig
).
build
();
...
...
@@ -1794,7 +1807,7 @@ public class IntelligenceSendOrder {
HttpResponse
response
=
httpclient
.
execute
(
httpPost
);
entity
=
response
.
getEntity
();
String
httpResult
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
log
.
info
(
"宽叠移
定时器
下单接口,返回信息:"
+
httpResult
);
log
.
info
(
"宽叠移下单接口,返回信息:"
+
httpResult
);
resultDataJson
=
net
.
sf
.
json
.
JSONObject
.
fromObject
(
httpResult
);
}
catch
(
SSLHandshakeException
s
)
{
HttpResponse
response
=
httpclient
.
execute
(
httpPost
);
...
...
@@ -1845,12 +1858,26 @@ public class IntelligenceSendOrder {
}
/**
* 查询智能平台状态
* 查询智能平台状态
(两个参数只要填写一个,默认填写系统订单号即可)
*
* @param systemOrderNum 系统订单号
* @param orderNum 智能平台订单号
* @return 返回结果为json字符串,若错误则返回空字符串
* {
* msg=订单查询成功,
* wayBillNumber=,
* sourceBizEntity=1eue64bp0d5xl1jdkgms,
* stateName=收费【人工处理】,
* outBizEntity=1eue64bp0d5xl1jdkgms,
* orderStatus=受理成功【待收费】,
* remark=,
* state=48,
* bizEntity=THD20210110004759,
* deliveryNumber=,
* status=000001
* }
*/
public
String
queryStatus
(
String
orderNum
)
{
public
String
queryStatus
(
String
systemOrderNum
,
String
orderNum
)
{
ObjectMapper
OBJECT_MAPPER
=
new
ObjectMapper
();
List
<
BasicNameValuePair
>
qParams
=
new
ArrayList
<>();
Map
<
String
,
Object
>
signMap
=
new
HashMap
<>();
//待签名参数
...
...
@@ -1870,8 +1897,16 @@ public class IntelligenceSendOrder {
String
timeStamp
=
DateUtil
.
format
(
new
Date
(),
DateUtil
.
yyyyMMddHHmmss
);
qParams
.
add
(
new
BasicNameValuePair
(
"timeStamp"
,
timeStamp
));
signMap
.
put
(
"timeStamp"
,
timeStamp
);
qParams
.
add
(
new
BasicNameValuePair
(
"orderNumber"
,
orderNum
));
//智能平台订单编号,非必填
signMap
.
put
(
"orderNumber"
,
orderNum
);
if
(
StringUtils
.
isNotBlank
(
orderNum
))
{
qParams
.
add
(
new
BasicNameValuePair
(
"orderNumber"
,
orderNum
));
//智能平台订单编号,非必填
signMap
.
put
(
"orderNumber"
,
orderNum
);
}
if
(
StringUtils
.
isNotBlank
(
systemOrderNum
))
{
qParams
.
add
(
new
BasicNameValuePair
(
"outOrderNum"
,
systemOrderNum
));
//外部订单编号,非必填
signMap
.
put
(
"outOrderNum"
,
systemOrderNum
);
}
try
{
List
<
String
>
keys
=
new
ArrayList
<>();
keys
.
addAll
(
signMap
.
keySet
());
...
...
@@ -1895,8 +1930,10 @@ public class IntelligenceSendOrder {
// String 转化为 Map格式结果
HashMap
<
String
,
Object
>
mapData
=
new
HashMap
<>();
mapData
.
putAll
(
OBJECT_MAPPER
.
readValue
(
httpResult
,
mapData
.
getClass
()));
return
JSONObject
.
toJSONString
(
mapData
);
log
.
info
(
"智能平台请求状态返回数据:"
+
mapData
);
if
(
mapData
.
get
(
"status"
)
==
"000001"
)
{
return
JSONObject
.
toJSONString
(
mapData
);
}
}
catch
(
SocketTimeoutException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
)
{
...
...
common/src/main/resources/com/winsun/mapper/mapping/OrderMapper.xml
View file @
485d413a
...
...
@@ -37,49 +37,47 @@
<result
column=
"yj_count"
property=
"yjCount"
/>
<result
column=
"yj_type"
property=
"yjType"
/>
<result
column=
"tj_type"
property=
"tjType"
/>
<result
column=
"xb_type"
property=
"xbType"
/>
<result
column=
"net_number"
property=
"netNumber"
/>
<result
column=
"net_password"
property=
"netPassword"
/>
<result
column=
"userSchool"
property=
"userSchool"
/>
<result
column=
"check_fail"
property=
"checkFail"
/>
<result
column=
"expenses"
property=
"expenses"
/>
<result
column=
"identifying"
property=
"identifying"
/>
<result
column=
"kd_order_id"
property=
"kdOrderId"
/>
<result
column=
"gift_account"
property=
"giftAccount"
/>
<result
column=
"gift_password"
property=
"giftCypher"
/>
<result
column=
"hehuoren_area"
property=
"hehuorenArea"
/>
<result
column=
"hehuoren_name"
property=
"hehuorenName"
/>
<result
column=
"hehuoren_school"
property=
"hehuorenSchool"
/>
<result
column=
"hehuoren_phone"
property=
"hehuorenPhone"
/>
<result
column=
"supervisor_name"
property=
"supervisorName"
/>
<result
column=
"th_status"
property=
"thStatus"
/>
<result
column=
"rh_time"
property=
"rhTime"
/>
<result
column=
"orderSeq"
property=
"orderSeq"
/>
<result
column=
"productName"
property=
"productName"
/>
<result
column=
"order_set_meal"
property=
"orderSetMeal"
/>
<result
column=
"order_university_name"
property=
"orderUniversityName"
/>
<result
column=
"orderName"
property=
"orderName"
/>
<result
column=
"orderDate"
property=
"orderDate"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"order_region"
property=
"orderRegion"
/>
<result
column=
"ipay"
property=
"iPay"
/>
<result
column=
"payType"
property=
"payType"
/>
<result
column=
"webOrderAmount"
property=
"webOrderAmount"
/>
<result
column=
"order_payment_time"
property=
"orderPaymentTime"
/>
<result
column=
"orderReqtranSeq"
property=
"orderReqtranSeq"
/>
<result
column=
"customeRid"
property=
"customerId"
/>
<result
column=
"orderPhone"
property=
"orderPhone"
/>
<result
column=
"order_customer_type"
property=
"orderCustomerType"
/>
<result
column=
"order_customer_student_id"
property=
"orderCustomerStudentId"
/>
<result
column=
"order_customer_remarks"
property=
"orderCustomerRemarks"
/>
<result
column=
"order_customer_account"
property=
"orderCustomerAccount"
/>
<result
column=
"order_customer_pwd"
property=
"orderCustomerPwd"
/>
<result
column=
"uptranseq"
property=
"uptranseq"
/>
<result
column=
"expenses"
property=
"expenses"
/>
<result
column=
"order_rf2"
property=
"orderRf2"
></result>
<result
column=
"orderSeqTHD"
property=
"orderseqThd"
/>
<result
column=
"xb_type"
property=
"xbType"
/>
<result
column=
"net_number"
property=
"netNumber"
/>
<result
column=
"net_password"
property=
"netPassword"
/>
<result
column=
"userSchool"
property=
"userSchool"
/>
<result
column=
"check_fail"
property=
"checkFail"
/>
<result
column=
"expenses"
property=
"expenses"
/>
<result
column=
"identifying"
property=
"identifying"
/>
<result
column=
"kd_order_id"
property=
"kdOrderId"
/>
<result
column=
"gift_account"
property=
"giftAccount"
/>
<result
column=
"gift_password"
property=
"giftCypher"
/>
<result
column=
"hehuoren_area"
property=
"hehuorenArea"
/>
<result
column=
"hehuoren_name"
property=
"hehuorenName"
/>
<result
column=
"hehuoren_school"
property=
"hehuorenSchool"
/>
<result
column=
"hehuoren_phone"
property=
"hehuorenPhone"
/>
<result
column=
"supervisor_name"
property=
"supervisorName"
/>
<result
column=
"th_status"
property=
"thStatus"
/>
<result
column=
"rh_time"
property=
"rhTime"
/>
<result
column=
"orderSeq"
property=
"orderSeq"
/>
<result
column=
"productName"
property=
"productName"
/>
<result
column=
"order_set_meal"
property=
"orderSetMeal"
/>
<result
column=
"order_university_name"
property=
"orderUniversityName"
/>
<result
column=
"orderName"
property=
"orderName"
/>
<result
column=
"orderDate"
property=
"orderDate"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"order_region"
property=
"orderRegion"
/>
<result
column=
"ipay"
property=
"iPay"
/>
<result
column=
"payType"
property=
"payType"
/>
<result
column=
"webOrderAmount"
property=
"webOrderAmount"
/>
<result
column=
"order_payment_time"
property=
"orderPaymentTime"
/>
<result
column=
"orderReqtranSeq"
property=
"orderReqtranSeq"
/>
<result
column=
"customeRid"
property=
"customerId"
/>
<result
column=
"orderPhone"
property=
"orderPhone"
/>
<result
column=
"order_customer_type"
property=
"orderCustomerType"
/>
<result
column=
"order_customer_student_id"
property=
"orderCustomerStudentId"
/>
<result
column=
"order_customer_remarks"
property=
"orderCustomerRemarks"
/>
<result
column=
"order_customer_account"
property=
"orderCustomerAccount"
/>
<result
column=
"order_customer_pwd"
property=
"orderCustomerPwd"
/>
<result
column=
"uptranseq"
property=
"uptranseq"
/>
<result
column=
"expenses"
property=
"expenses"
/>
<result
column=
"order_rf2"
property=
"orderRf2"
></result>
<result
column=
"orderSeqTHD"
property=
"orderseqThd"
/>
</resultMap>
<select
id=
"selectBroadBandOrderList"
resultMap=
"broadBandOrder"
>
...
...
@@ -193,4 +191,9 @@
select * from hhr_order where order_status !='异常单' and kd_order_id = #{KdOrderID}
</select>
<!-- 更新未下单并且融合时间小于当前时间的订单 -->
<update
id=
"updateNosendAndRhTimeLtNowOrder"
>
update hhr_order set order_status = "待受理" where DATE_FORMAT(rh_time, "%y-%m-%d")
<
date_format(now(), "%y-%m-%d") and order_status = "未下单"
</update>
</mapper>
\ No newline at end of file
migration/pom.xml
View file @
485d413a
...
...
@@ -84,12 +84,10 @@
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-
compiler
-plugin
</artifactId>
<version>
3.8.1
</version>
<artifactId>
maven-
surefire
-plugin
</artifactId>
<version>
2.5
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
<encoding>
UTF-8
</encoding>
<skip>
true
</skip>
</configuration>
</plugin>
<plugin>
...
...
migration/src/main/java/com/winsun/migration/MigrationApplication.java
View file @
485d413a
...
...
@@ -12,7 +12,7 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
})
@RefreshScope
@EnableEurekaClient
@MapperScan
(
basePackages
=
{
"com.winsun.
*.mapper"
,
"com.winsun.mapper"
,
"com.winsun.migration.mapper"
,
"com.winsun.mapper.activity
"
})
@MapperScan
(
basePackages
=
{
"com.winsun.
item.modular.*.dao"
,
"com.winsun.mapper
"
})
public
class
MigrationApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
migration/src/main/java/com/winsun/migration/controller/MigrationDataController.java
View file @
485d413a
...
...
@@ -39,4 +39,6 @@ public class MigrationDataController {
migrationService
.
migrationActivityRecord
();
return
"成功!"
;
}
}
migration/src/main/java/com/winsun/migration/datasource/DataSourceAspect.java
View file @
485d413a
...
...
@@ -12,16 +12,19 @@ import org.springframework.stereotype.Component;
@Slf4j
@Aspect
public
class
DataSourceAspect
{
@Pointcut
(
"execution(* com.winsun.migration.mapper.db1..*.*(..))
"
+
"|| execution(* com.winsun.mapper.*.*(..)) || execution(* com.winsun.mapper.activity.*.*(..
))"
)
@Pointcut
(
"execution(* com.winsun.migration.mapper.db1..*.*(..))
|| "
+
"execution(* com.winsun.mapper.SysUserMapper.*(..)) || execution(* com.winsun.mapper.SchoolPackageMapper.*(
))"
)
private
void
db1Aspect
()
{
}
@Pointcut
(
"execution(* com.winsun.migration.mapper.db2..*.*(..))"
)
@Pointcut
(
"execution(* com.winsun.migration.mapper.db2..*.*(..))"
)
private
void
db2Aspect
()
{
}
@Pointcut
(
"execution(* com.winsun.migration.mapper.db3..*.*(..))"
)
private
void
db3Aspect
()
{
}
@Before
(
"db1Aspect()"
)
public
void
db1
()
{
System
.
out
.
println
(
"切换到新框架数据源"
);
...
...
@@ -30,7 +33,13 @@ public class DataSourceAspect {
@Before
(
"db2Aspect()"
)
public
void
db2
()
{
System
.
out
.
println
(
"切换到
旧框架数据源
"
);
System
.
out
.
println
(
"切换到
合伙人
"
);
DataSourceContextHolder
.
setDbType
(
"dzqd"
);
}
@Before
(
"db3Aspect()"
)
public
void
db3
()
{
System
.
out
.
println
(
"切换到一人一码"
);
DataSourceContextHolder
.
setDbType
(
"yrym"
);
}
}
migration/src/main/java/com/winsun/migration/datasource/DataSourceConfig.java
View file @
485d413a
...
...
@@ -45,6 +45,12 @@ public class DataSourceConfig {
return
DataSourceBuilder
.
create
().
build
();
}
@Bean
(
name
=
"yrym"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.db3"
)
public
DataSource
dataSource3
()
{
return
DataSourceBuilder
.
create
().
build
();
}
/**
* 动态数据源配置
*
...
...
@@ -53,11 +59,13 @@ public class DataSourceConfig {
@Bean
@Primary
public
DataSource
multipleDataSource
(
@Qualifier
(
"schoolCenter"
)
DataSource
db1
,
@Qualifier
(
"xyjl"
)
DataSource
db2
)
{
@Qualifier
(
"xyjl"
)
DataSource
db2
,
@Qualifier
(
"yrym"
)
DataSource
db3
)
{
DynamicDataSource
dynamicDataSource
=
new
DynamicDataSource
();
Map
<
Object
,
Object
>
targetDataSources
=
new
HashMap
<>();
targetDataSources
.
put
(
"schoolCenter"
,
db1
);
targetDataSources
.
put
(
"xyjl"
,
db2
);
targetDataSources
.
put
(
"yrym"
,
db3
);
dynamicDataSource
.
setTargetDataSources
(
targetDataSources
);
dynamicDataSource
.
setDefaultTargetDataSource
(
db2
);
// 程序默认数据源,这个要根据程序调用数据源频次,经常把常调用的数据源作为默认
return
dynamicDataSource
;
...
...
@@ -66,7 +74,7 @@ public class DataSourceConfig {
@Bean
(
"sqlSessionFactory"
)
public
SqlSessionFactory
sqlSessionFactory
()
throws
Exception
{
MybatisSqlSessionFactoryBean
sqlSessionFactory
=
new
MybatisSqlSessionFactoryBean
();
sqlSessionFactory
.
setDataSource
(
multipleDataSource
(
dataSource1
(),
dataSource2
()));
sqlSessionFactory
.
setDataSource
(
multipleDataSource
(
dataSource1
(),
dataSource2
()
,
dataSource3
()
));
MybatisConfiguration
configuration
=
new
MybatisConfiguration
();
configuration
.
setJdbcTypeForNull
(
JdbcType
.
NULL
);
...
...
migration/src/main/java/com/winsun/migration/mapper/db1/NewDatabases.java
View file @
485d413a
...
...
@@ -15,28 +15,29 @@ import java.util.Map;
public
interface
NewDatabases
{
@Select
(
"select * from sys_user where id = 1"
)
public
List
<
Map
<
String
,
Object
>>
getUser
();
List
<
Map
<
String
,
Object
>>
getUser
();
@Insert
({
"insert into sys_user(id, account, password, salt, name, sex, phone, roleid, deptid, status, createtime, substName) "
+
"value(#{id}, #{account}, #{password}, #{salt}, #{name}, #{sex}, #{phone}, #{roleid}, #{deptid}, #{status}, #{createtime}, #{substName} )"
})
public
int
insert
(
SysUser
user
);
int
insert
(
SysUser
user
);
@Insert
({
"insert into hhr_user(id, id_card, ysm, wx_head_img_url, wx_nick_name, open_id, upload_state, grade, position, parent_id, parent_ids, is_active) "
+
"value(#{id}, #{idCard}, #{ysm}, #{wxHeadImgUrl}, #{wxNickName}, #{openId}, #{uploadState}, #{grade}, #{position}, #{parentId}, #{parentIds}, #{isActive})"
})
public
int
insertHhr
(
HhrUser
user
);
int
insertHhr
(
HhrUser
user
);
@Insert
({
"insert into hhr_activity(id, `title`, `desc`, integral, image_url, activity_type, subclass, `range`, `status`, `sort`, create_time, creator, del_flag) "
+
" value(#{id}, #{title}, #{desc}, #{integral}, #{imageUrl}, #{activityType}, #{subclass}, #{range}, #{status}, #{sort}, #{createTime}, #{creator}, #{delFlag})"
})
public
int
insertActivity
(
HhrActivity
hhrActivity
);
int
insertActivity
(
HhrActivity
hhrActivity
);
@Insert
({
"insert into hhr_activity_record(id, activity_id, record_integral, status, remark, image_url, message, create_time, create_id, creator, is_repeal) "
+
" value(#{id}, #{activityId}, #{recordIntegral}, #{status}, #{remark}, #{imageUrl}, #{message}, #{createTime}, #{createId}, #{creator}, #{isRepeal})"
})
public
int
insertActivityRecord
(
HhrActivityRecord
hhrActivityRecord
);
int
insertActivityRecord
(
HhrActivityRecord
hhrActivityRecord
);
@Insert
({
"insert into migration_log(table_name, object, `status`, message, create_time) "
+
"value(#{tableName}, #{object}, #{status}, #{message}, now())"
})
public
int
insertLog
(
@Param
(
"tableName"
)
String
tableName
,
int
insertLog
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"object"
)
Object
object
,
@Param
(
"status"
)
String
status
,
@Param
(
"message"
)
String
message
);
}
migration/src/main/java/com/winsun/migration/mapper/db2/OldDatabases.java
View file @
485d413a
...
...
@@ -33,6 +33,7 @@ public interface OldDatabases {
" ys.wx_head_img_url, "
+
" ys.wx_nick_name, "
+
" ys.grade, "
+
" ys.register_time, "
+
" ys.id_card, "
+
" xsr.parent_user_id, "
+
" xsr.position, "
+
...
...
migration/src/main/java/com/winsun/migration/service/impl/MigrationServiceImpl.java
View file @
485d413a
This diff is collapsed.
Click to expand it.
service-manager/src/main/java/com/winsun/controller/PackageController.java
View file @
485d413a
...
...
@@ -193,7 +193,7 @@ public class PackageController extends BaseController {
@Permission
(
menuname
=
"上传背景图"
,
value
=
"backgroundUpload"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
backgroundUpload
(
@RequestParam
(
value
=
"file"
)
MultipartFile
file
,
@RequestParam
(
value
=
"id"
,
required
=
false
)
String
id
)
{
public
ResponseData
<
String
>
backgroundUpload
(
MultipartFile
file
,
@RequestParam
(
value
=
"id"
,
required
=
false
)
String
id
)
{
if
(!
StringUtils
.
endsWithAny
(
file
.
getOriginalFilename
(),
"jpg"
,
"jpeg"
,
"png"
,
"gif"
))
{
return
ResponseData
.
error
(
"上传失败,仅支持jpg、jpeg、png"
);
}
...
...
@@ -201,7 +201,7 @@ public class PackageController extends BaseController {
return
ResponseData
.
error
(
"文件过大,无法上传"
);
}
StringBuilder
basePath
=
new
StringBuilder
();
basePath
.
append
(
"enclosure"
).
append
(
File
.
separator
).
append
(
DEFAULTPATH
).
append
(
File
.
separator
);
basePath
.
append
(
"enclosure"
).
append
(
DEFAULTPATH
).
append
(
File
.
separator
);
if
(
StringUtils
.
isBlank
(
id
))
{
EntityWrapper
<
Package
>
packagewrapper
=
new
EntityWrapper
<>();
packagewrapper
.
setSqlSelect
(
"max(id) as id"
);
...
...
@@ -211,7 +211,7 @@ public class PackageController extends BaseController {
Package
aPackage
=
packageMapper
.
selectById
(
id
);
basePath
.
append
(
aPackage
.
getId
());
}
File
dir
=
new
File
(
FilePattern
.
matcher
(
basePath
.
toString
()).
replaceAll
(
""
));
File
dir
=
new
File
(
basePath
.
toString
(
));
if
(!
dir
.
exists
())
{
dir
.
mkdirs
();
}
...
...
task/src/main/java/com/winsun/TimingTask/OrderTask.java
View file @
485d413a
...
...
@@ -5,10 +5,15 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.winsun.bean.Order
;
import
com.winsun.bean.OrderHistory
;
import
com.winsun.mapper.OrderHistoryMapper
;
import
com.winsun.mapper.OrderMapper
;
import
com.winsun.outSideSystem.IntelligenceSendOrder
;
import
com.winsun.smsUtils.SendSmsAndMail
;
import
com.winsun.utils.MyBatisPlusUpdateUtils
;
import
com.winsun.utils.XbkUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
...
...
@@ -29,6 +34,11 @@ import java.util.Map;
public
class
OrderTask
{
private
static
OrderMapper
orderMapper
;
@Autowired
private
IntelligenceSendOrder
intelligenceSendOrder
;
@Autowired
private
OrderHistoryMapper
orderHistoryMapper
;
@Autowired
public
OrderTask
(
OrderMapper
orderMapper
)
{
...
...
@@ -41,8 +51,62 @@ public class OrderTask {
@Scheduled
(
cron
=
"0 0/5 * * * ? "
)
public
void
updateBeSendOrder
()
{
log
.
info
(
"开始更新已发货超过7天订单"
);
orderMapper
.
updateCompleteOrder
();
log
.
info
(
"更新已送货订单"
);
int
i
=
orderMapper
.
updateCompleteOrder
();
log
.
info
(
"更新已送货订单成功:"
+
i
);
}
/**
* 定时器更新智能平台状态
*/
@Scheduled
(
cron
=
"0 0/5 * * * ?"
)
// @Scheduled(fixedRate=28800000)
public
void
updateStatus
()
{
// 获取审核中的订单
Wrapper
<
Order
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"order_status"
,
"审核中"
);
List
<
Order
>
orders
=
orderMapper
.
selectList
(
wrapper
);
// 循环请求获取数据
for
(
Order
order
:
orders
)
{
if
(
StringUtils
.
isNotBlank
(
order
.
getKdOrderId
()))
{
String
s
=
intelligenceSendOrder
.
queryStatus
(
order
.
getKdOrderId
(),
null
);
if
(
StringUtils
.
isNotBlank
(
s
))
{
Order
update
=
new
Order
();
update
.
setId
(
order
.
getId
());
update
.
setUpdateTime
(
new
Date
());
JSONObject
json
=
JSONObject
.
parseObject
(
s
);
OrderHistory
orderHistory
=
new
OrderHistory
();
orderHistory
.
setOrderId
(
order
.
getId
());
orderHistory
.
setCreateDate
(
new
Date
());
orderHistory
.
setStatus
(
"智能平台状态获取"
);
// 未获取到需要的状态不做更新
if
(
"归档"
.
equals
(
json
.
get
(
"orderStatus"
))
||
"受理成功【待收费】"
.
equals
(
json
.
get
(
"orderStatus"
))
||
"已收费【待竣工】"
.
equals
(
json
.
get
(
"orderStatus"
))
||
"受理成功"
.
equals
(
json
.
get
(
"orderStatus"
)))
{
orderHistory
.
setStatus
(
"订单已完成"
);
orderHistoryMapper
.
insert
(
orderHistory
);
update
.
setThStatus
(
json
.
get
(
"orderStatus"
).
toString
());
update
.
setOrderStatus
(
"已完成"
);
orderMapper
.
updateById
(
update
);
// 下发短信
SendSmsAndMail
.
sendSms2
(
order
.
getContactNumber
(),
order
.
getNetNumber
(),
order
.
getNetPassword
(),
"12"
);
}
else
if
(
"作废"
.
equals
(
json
.
get
(
"orderStatus"
))
||
"受理异常"
.
equals
(
json
.
get
(
"orderStatus"
))){
orderHistory
.
setStatus
(
"订单异常请联系管理员"
);
orderHistoryMapper
.
insert
(
orderHistory
);
update
.
setThStatus
(
json
.
get
(
"orderStatus"
).
toString
());
update
.
setOrderStatus
(
"异常单"
);
orderMapper
.
updateById
(
update
);
}
}
}
}
}
@Scheduled
(
cron
=
"0 0 0 * * ? "
)
...
...
task/src/main/java/com/winsun/TimingTask/RhZhiNenTask.java
View file @
485d413a
...
...
@@ -10,6 +10,7 @@ import com.winsun.constant.Constant;
import
com.winsun.mapper.OrderMapper
;
import
com.winsun.mapper.OrderViewMapper
;
import
com.winsun.mapper.UniversityInfoMapper
;
import
com.winsun.outSideSystem.IntelligenceSendOrder
;
import
com.winsun.utils.BeanUtil
;
import
com.winsun.utils.MD5Utils
;
import
com.winsun.utils.MyBatisPlusUpdateUtils
;
...
...
@@ -50,6 +51,42 @@ public class RhZhiNenTask {
private
OrderViewMapper
orderViewMapper
;
@Autowired
private
OrderMapper
orderMapper
;
@Autowired
private
IntelligenceSendOrder
intelligenceSendOrder
;
/**
* 下发智能平台订单
*
*/
@Scheduled
(
cron
=
"0 0/5 0 * * ? "
)
// @Scheduled(fixedRate=2800000)
public
void
sendZhiNengOrder
()
{
log
.
info
(
"智能平台定时器下单启动"
);
try
{
// 更新融合时间小于当前时间的未下单订单 更新为待受理
int
updateNum
=
orderMapper
.
updateNosendAndRhTimeLtNowOrder
();
log
.
info
(
"更新待受理订单数:"
+
updateNum
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
calendar
=
Calendar
.
getInstance
();
// 查询未下单并且融合时间为今天的订单
Wrapper
<
Order
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"order_status"
,
"未下单"
);
wrapper
.
ge
(
"rh_time"
,
sdf
.
format
(
calendar
.
getTime
()));
calendar
.
add
(
Calendar
.
DATE
,
1
);
wrapper
.
lt
(
"rh_time"
,
sdf
.
format
(
calendar
.
getTime
()));
List
<
Order
>
orders
=
orderMapper
.
selectList
(
wrapper
);
// 发送下单请求
for
(
int
i
=
0
;
i
<
orders
.
size
();
++
i
)
{
intelligenceSendOrder
.
integrateSendOrder
(
orders
.
get
(
i
),
false
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"智能平台定时器下单异常"
);
log
.
error
(
e
.
getMessage
());
}
}
// @Scheduled(cron = "0 0 0 * * ? ")
...
...
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