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
5992c732
Commit
5992c732
authored
Mar 14, 2022
by
伍思炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新手机端预制卡业务填写ICCID后下单地址
parent
acb4da97
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
642 additions
and
367 deletions
+642
-367
apply-net/src/main/java/com/winsun/controller/SingleBroadToIntegrateController.java
+3
-0
common/src/main/java/com/winsun/outSideSystem/IntelligenceSendOrders.java
+40
-53
common/src/main/java/com/winsun/utils/OrderManage.java
+460
-286
common/src/main/java/com/winsun/utils/WxInterfacesUtil.java
+1
-1
core-service/src/main/java/com/winsun/item/modular/system/controller/LoginPwdController.java
+1
-1
service-manager/src/main/java/com/winsun/controller/AuthCodeController.java
+11
-5
service-manager/src/main/java/com/winsun/controller/supervisorController.java
+126
-21
No files found.
apply-net/src/main/java/com/winsun/controller/SingleBroadToIntegrateController.java
View file @
5992c732
...
...
@@ -198,6 +198,7 @@ public class SingleBroadToIntegrateController {
@RequestParam
(
"rhTime"
)
String
rhTime
,
@RequestParam
(
"hehuorenId"
)
String
hehuorenId
,
@RequestParam
(
"imgUrl"
)
String
imgUrl
,
@RequestParam
(
"customerStudentId"
)
String
customerStudentId
,
@RequestParam
(
value
=
"sell"
,
required
=
false
)
String
sell
)
{
ToIntegrateOrderParam
toIntegrateOrderParam
=
new
ToIntegrateOrderParam
();
toIntegrateOrderParam
.
setName
(
name
);
...
...
@@ -264,7 +265,9 @@ public class SingleBroadToIntegrateController {
orderView
.
setProductName
(
product
.
getProductTitle
());
// 产品名称
orderView
.
setOrderSetMeal
(
universityInfo
.
getExpenses
());
// 套餐
orderView
.
setOrderUniversityName
(
universityInfo
.
getUniversityName
());
// 学校
orderView
.
setOrderCustomerStudentId
(
customerStudentId
);
orderView
.
setOrderName
(
toIntegrateOrderParam
.
getName
());
// 姓名
orderView
.
setHehuorenId
(
toIntegrateOrderParam
.
getHehuorenId
());
// 合伙人ID
orderView
.
setOrderDate
(
new
Date
());
// 提交时间
orderView
.
setStatus
(
OrderStatus
.
PENDINGSUBMISSION
.
getId
());
// 订单状态(待提交)
orderView
.
setOrderRegion
(
universityInfo
.
getUniversityRegion
());
// 区域
...
...
common/src/main/java/com/winsun/outSideSystem/IntelligenceSendOrders.java
View file @
5992c732
...
...
@@ -207,7 +207,7 @@ public class IntelligenceSendOrders {
+
" orderNum:"
+
submitOrderJsonObject
.
getBody
());
if
(
submitOrderJsonObject
.
getStatus
()
!=
200
){
if
(
submitOrderJsonObject
.
getStatus
()
!=
200
)
{
Wrapper
<
Order
>
orderWrapper
=
new
EntityWrapper
<>();
orderWrapper
.
eq
(
"kd_order_id"
,
orderMap
.
get
(
"kd_order_id"
));
Order
updateOrder
=
new
Order
();
...
...
@@ -252,9 +252,9 @@ public class IntelligenceSendOrders {
updateOrder
.
setOrderId
(
orderNum
);
updateOrder
.
setThStatus
((
String
)
orderStatus
.
get
(
"订单状态名称"
));
updateOrder
.
setOrderStatus
(
"待处理"
);
if
(
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"停机"
)
||
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"欠费"
))
{
if
(
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"停机"
)
||
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"欠费"
))
{
updateOrder
.
setMsg
(
"停机/名下欠费"
);
}
else
if
(
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"黑名单"
))
{
}
else
if
(
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"黑名单"
))
{
updateOrder
.
setMsg
(
"身份证黑名单"
);
}
orderMapper
.
update
(
updateOrder
,
orderWrapper
);
...
...
@@ -393,8 +393,7 @@ public class IntelligenceSendOrders {
order_data
.
put
(
"付费类型"
,
"预付费"
);
//预付费、后付费、其他 选填
}
System
.
out
.
println
(
orderViewMap
.
get
(
"hehuorenId"
));
Map
<
String
,
String
>
school
=
schoolMapper
.
selectByHeHuorenId
(
String
.
valueOf
(
orderViewMap
.
get
(
"hehuorenId"
)));
Map
<
String
,
Object
>
packageInformation
=
new
HashMap
<>();
//揽装信息
packageInformation
.
put
(
"揽装姓名"
,
school
.
get
(
"lz_user"
));
...
...
@@ -487,12 +486,12 @@ public class IntelligenceSendOrders {
attributeList
.
add
(
AddressID
);
if
(
businessType
==
3
||
businessType
==
10
)
{
if
(
businessType
==
3
)
{
AttributeList
type
=
new
AttributeList
();
type
.
setName
(
"单宽带"
);
if
(
shoolNames
.
contains
(
orderViewMap
.
get
(
"orderUniversityName"
))){
if
(
shoolNames
.
contains
(
orderViewMap
.
get
(
"orderUniversityName"
)))
{
type
.
setValue
(
"校园宽带(免月租)."
);
}
else
if
(((
String
)
orderViewMap
.
get
(
"orderSetMeal"
)).
contains
(
"包年"
))
{
}
else
if
(((
String
)
orderViewMap
.
get
(
"orderSetMeal"
)).
contains
(
"包年"
))
{
type
.
setValue
(
"校园宽带300元/年."
);
}
else
if
(((
String
)
orderViewMap
.
get
(
"orderSetMeal"
)).
contains
(
"包月"
))
{
type
.
setValue
(
"校园宽带30元/月."
);
...
...
@@ -513,7 +512,7 @@ public class IntelligenceSendOrders {
AttributeList
schoolName
=
new
AttributeList
();
schoolName
.
setName
(
"学校名称"
);
schoolName
.
setValue
((
String
)
orderViewMap
.
get
(
"orderUniversityName"
).
toString
().
replace
(
" "
,
""
));
schoolName
.
setValue
((
String
)
orderViewMap
.
get
(
"orderUniversityName"
).
toString
().
replace
(
" "
,
""
));
attributeList
.
add
(
schoolName
);
AttributeList
handlingNumber
=
new
AttributeList
();
...
...
@@ -522,7 +521,7 @@ public class IntelligenceSendOrders {
/*handleNumber.setName("关联第三方账户接入号");
handleNumber.setValue((String) orderViewMap.get("orderPhone"));*/
handlingNumber
.
setName
(
"关联移动号码"
);
handlingNumber
.
setValue
((
String
)
orderViewMap
.
get
(
"order
Phone
"
));
handlingNumber
.
setValue
((
String
)
orderViewMap
.
get
(
"order
CustomerRemarks
"
));
/*attributeList.add(handleNumber);*/
attributeList
.
add
(
handlingNumber
);
}
...
...
@@ -552,10 +551,12 @@ public class IntelligenceSendOrders {
customerAccount
.
setValue
((
String
)
orderViewMap
.
get
(
"orderCustomerAccount"
));
attributeList
.
add
(
customerAccount
);
AttributeList
customerPwd
=
new
AttributeList
();
customerPwd
.
setName
(
"多媒体账号密码"
);
customerPwd
.
setValue
((
String
)
orderViewMap
.
get
(
"orderCustomerPwd"
));
attributeList
.
add
(
customerPwd
);
if
(
businessType
!=
10
)
{
AttributeList
customerPwd
=
new
AttributeList
();
customerPwd
.
setName
(
"多媒体账号密码"
);
customerPwd
.
setValue
((
String
)
orderViewMap
.
get
(
"orderCustomerPwd"
));
attributeList
.
add
(
customerPwd
);
}
AttributeList
onlineNumber
=
new
AttributeList
();
onlineNumber
.
setName
(
"最大在线数"
);
...
...
@@ -591,23 +592,20 @@ public class IntelligenceSendOrders {
order_data
.
put
(
"订购产品"
,
orderingProducts
);
if
(
businessType
==
3
)
{
if
(
businessType
==
3
||
businessType
==
10
)
{
order_data
.
put
(
"业务类型"
,
"融合业务"
);
//业务类型
}
else
if
(
businessType
==
5
)
{
order_data
.
put
(
"业务类型"
,
"单宽业务"
);
//业务类型
}
else
if
(
businessType
==
10
)
{
order_data
.
put
(
"业务类型"
,
"增值业务"
);
//业务类型
}
if
(
businessType
==
3
||
businessType
==
10
)
{
if
(
businessType
==
3
||
businessType
==
10
)
{
List
<
HashMap
<
String
,
Object
>>
mobileAccessList
=
new
ArrayList
<>();
HashMap
<
String
,
Object
>
mobileAccess
=
new
HashMap
<>();
//移动接入
mobileAccess
.
put
(
"订购类型"
,
"已有"
);
mobileAccess
.
put
(
"移动接入号"
,(
String
)
orderViewMap
.
get
(
"orderPhone"
));
mobileAccess
.
put
(
"号码类型"
,
"主卡"
);
mobileAccess
.
put
(
"订购类型"
,
"已有"
);
mobileAccess
.
put
(
"移动接入号"
,
(
String
)
orderViewMap
.
get
(
"orderPhone"
));
mobileAccess
.
put
(
"号码类型"
,
"主卡"
);
mobileAccessList
.
add
(
mobileAccess
);
order_data
.
put
(
"移动接入"
,
mobileAccessList
);
order_data
.
put
(
"移动接入"
,
mobileAccessList
);
}
HashMap
<
String
,
Object
>
broadbandInstalledCapacity
=
new
HashMap
<>();
//宽带装机
...
...
@@ -616,6 +614,12 @@ public class IntelligenceSendOrders {
broadbandInstalledCapacity
.
put
(
"市"
,
"广州市"
);
broadbandInstalledCapacity
.
put
(
"区"
,
addressDistrict
);
broadbandInstalledCapacity
.
put
(
"装机地址ID"
,
addressID
);
broadbandInstalledCapacity
.
put
(
"宽带接入号"
,
"新装"
);
broadbandInstalledCapacity
.
put
(
"订购类型"
,
"新装"
);
if
(
businessType
==
10
){
broadbandInstalledCapacity
.
put
(
"宽带接入号"
,
"已有"
);
broadbandInstalledCapacity
.
put
(
"订购类型"
,
"已有"
);
}
order_data
.
put
(
"宽带装机"
,
broadbandInstalledCapacity
);
HashMap
<
Object
,
Object
>
monthlyFeeItems
=
new
HashMap
<>();
//月租费用项
...
...
@@ -637,23 +641,6 @@ public class IntelligenceSendOrders {
monthlyFeeItems
.
put
(
"缴费方式"
,
"现金支付"
);
}
else
{
monthlyFeeItems
.
put
(
"缴费方式"
,
"原套餐缴费方式"
);
/*EasyPay easyPay = new EasyPay();
easyPay.set穗易付订单号(ORDERREQTRANSEQ);
// suipayPaymentMap.put("穗易付订单号", ORDERREQTRANSEQ);
String payPlatform = (String) orderViewMap.get("iPay");
if (StringUtils.isNotBlank(payPlatform)) {
if ("1".equals(payPlatform)) {
easyPay.set穗易付支付平台( "支付宝"); // 支付平台,缴费方式为“穗易付”时必填
} else {
easyPay.set穗易付支付平台("微信"); // 支付平台,缴费方式为“穗易付”时必填
}
} else {
easyPay.set穗易付支付平台("翼支付"); // 支付平台,缴费方式为“穗易付”时必填
}
easyPay.set穗易付支付金额(ORDERAMOUNT);
easyPay.set穗易付支付流水号(UPTRANSEQ);
// suipayPayment.add(suipayPaymentMap);
monthlyFeeItems.put("穗易付支付", easyPay);*/
}
expenseItemsList
.
add
(
expenseItemsMap
);
monthlyFeeItems
.
put
(
"费用项列表"
,
expenseItemsList
);
...
...
@@ -673,7 +660,7 @@ public class IntelligenceSendOrders {
OneExpenseItemsMap
.
put
(
"费用项类型"
,
"年租"
);
}
ORDERAMOUNT
=
ORDERAMOUNT
.
replace
(
"元"
,
""
);
if
(
ORDERAMOUNT
.
equals
(
"0.01"
)
||
ORDERAMOUNT
.
equals
(
"0.02"
))
{
if
(
ORDERAMOUNT
.
equals
(
"0.01"
)
||
ORDERAMOUNT
.
equals
(
"0.02"
)
||
"0"
.
equals
(
orderViewMap
.
get
(
"webOrderAmount"
).
toString
())
)
{
OneExpenseItems
.
put
(
"缴费方式"
,
"现金支付"
);
// 缴费方式,必填(例:payType:1);1:银行划账2:现金支付3:代理商打款4:穗易付5:原套餐缴费方式6:支付宝划扣8:装维上门收取
}
else
if
(
"xjzf"
.
equals
(
orderViewMap
.
get
(
"customerId"
)))
{
OneExpenseItems
.
put
(
"缴费方式"
,
"现金支付"
);
...
...
@@ -727,7 +714,7 @@ public class IntelligenceSendOrders {
.
asString
();
if
(
businessType
==
5
)
{
log
.
info
(
"单宽带下单接口,返回信息:"
+
responese
.
getBody
());
}
else
{
}
else
{
log
.
info
(
"融合下单接口,返回信息:"
+
responese
.
getBody
());
}
}
catch
(
ResourceAccessException
e
)
{
...
...
@@ -748,14 +735,14 @@ public class IntelligenceSendOrders {
}
else
{
if
(
businessType
==
5
)
{
log
.
info
(
"单宽带下单接口,返回信息:"
+
responese
.
getBody
());
}
else
{
}
else
{
log
.
info
(
"融合下单接口,返回信息:"
+
responese
.
getBody
());
}
}
}
catch
(
Exception
e
)
{
if
(
businessType
==
5
)
{
log
.
info
(
"单宽带下单接口异常"
);
}
else
{
}
else
{
log
.
info
(
"融合下单接口异常"
);
}
e
.
printStackTrace
();
...
...
@@ -827,7 +814,7 @@ public class IntelligenceSendOrders {
log
.
info
(
"提交参数:"
+
data
);
Constant
.
trustEveryone
();
kong
.
unirest
.
HttpResponse
<
String
>
responese
=
Unirest
.
get
(
"http://132.97.20.21/query/query-order-info?"
+
url_data
)
//kong.unirest.HttpResponse<String> responese = Unirest.get("https://applet.mini189.cn/prod/query/query-order-info?" + url_data)
//kong.unirest.HttpResponse<String> responese = Unirest.get("https://applet.mini189.cn/prod/query/query-order-info?" + url_data)
.
header
(
"Content-Type"
,
"application/json"
)
.
header
(
"X-Sign"
,
sign
)
.
asString
();
...
...
@@ -880,7 +867,7 @@ public class IntelligenceSendOrders {
/**
* 公共方法
*
* @param orderMap
hhr_order 表的map数据
* @param orderMap hhr_order 表的map数据
* @param rightNowSend 是否马上下单,是则无视融合时间,不是则判断融合时间是否当天
* @throws Exception
*/
...
...
@@ -974,9 +961,9 @@ public class IntelligenceSendOrders {
ORDERREQTRANSEQ
,
//穗易付订单号
3
,
//下单类型(3:融合业务;5:单宽业务;10:单宽进融)
0
);
}
else
if
(
orderMap
.
get
(
"
UserT
ype"
).
equals
(
"10"
))
{
}
else
if
(
orderMap
.
get
(
"
user_t
ype"
).
equals
(
"10"
))
{
String
productName
=
"校园融合
宽带提速包
"
;
String
productName
=
"校园融合
套餐
"
;
// 3、提交订单到智能平台
submitOrderJsonObject
=
getOrderInfo
(
schoolMap
,
//宽带订单对应的学校信息
...
...
@@ -998,7 +985,7 @@ public class IntelligenceSendOrders {
+
" orderNum:"
+
submitOrderJsonObject
.
getBody
());
if
(
submitOrderJsonObject
.
getStatus
()
!=
200
){
if
(
submitOrderJsonObject
.
getStatus
()
!=
200
)
{
Wrapper
<
Order
>
orderWrapper
=
new
EntityWrapper
<>();
orderWrapper
.
eq
(
"kd_order_id"
,
orderMap
.
get
(
"kd_order_id"
));
Order
updateOrder
=
new
Order
();
...
...
@@ -1023,9 +1010,9 @@ public class IntelligenceSendOrders {
updateOrder
.
setOrderId
(
orderNum
);
updateOrder
.
setThStatus
(
ztStatus
);
updateOrder
.
setOrderStatus
(
"异常单"
);
if
(
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"停机"
)
||
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"欠费"
))
{
if
(
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"停机"
)
||
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"欠费"
))
{
updateOrder
.
setMsg
(
"停机/名下欠费"
);
}
else
if
(
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"黑名单"
))
{
}
else
if
(
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
().
contains
(
"黑名单"
))
{
updateOrder
.
setMsg
(
"身份证黑名单"
);
}
orderMapper
.
update
(
updateOrder
,
wrapper
);
...
...
@@ -1035,7 +1022,7 @@ public class IntelligenceSendOrders {
orderHistory
.
setCreateDate
(
new
Date
());
orderHistory
.
setStatus
(
"智能平台下单失败"
+
orderNum
);
orderHistoryMapper
.
insert
(
orderHistory
);
}
else
{
}
else
{
//5、更新数据库
Wrapper
<
Order
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"id"
,
orderMap
.
get
(
"id"
));
...
...
@@ -1103,7 +1090,7 @@ public class IntelligenceSendOrders {
log
.
info
(
"提交参数:"
+
data
);
Constant
.
trustEveryone
();
responese
=
Unirest
.
get
(
"http://132.97.20.21/query/query-order-info?"
+
url_data
)
//responese = Unirest.get("https://applet.mini189.cn/prod/query/query-order-info?" + url_data)
//responese = Unirest.get("https://applet.mini189.cn/prod/query/query-order-info?" + url_data)
.
header
(
"Content-Type"
,
"application/json"
)
.
header
(
"X-Sign"
,
sign
)
.
asString
();
...
...
common/src/main/java/com/winsun/utils/OrderManage.java
View file @
5992c732
package
com
.
winsun
.
utils
;
import
com.winsun.bean.AttributeList
;
import
com.winsun.constant.Constant
;
import
com.winsun.constant.FilePath
;
import
com.winsun.mapper.OrderCardAddressMapper
;
import
kong.unirest.Unirest
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
...
...
@@ -21,7 +24,10 @@ import org.apache.http.impl.client.HttpClients;
import
org.apache.http.message.BasicNameValuePair
;
import
org.apache.http.protocol.HTTP
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.client.ResourceAccessException
;
import
sun.misc.BASE64Encoder
;
import
javax.net.ssl.SSLHandshakeException
;
import
java.io.File
;
...
...
@@ -36,10 +42,23 @@ import java.util.*;
@Slf4j
public
class
OrderManage
{
@Autowired
private
OrderCardAddressMapper
orderCardAddressMapper
;
final
String
publicKey
=
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAok8DnvM2OBwtzNoJb4nA"
+
"jn4lgCkSxLyRw5lLiUfsi+40h00CGAC1arvbinTTbtrSnm4YDYlaJwveiOeDKdk0"
+
"f2Yglb/8loEbNTqb1OqNxUeM1wYLRBXvAkkZ5fZllajWzFMkoNU/JQ4+T8sMATxm"
+
"1d1XRcgM6zlgVwX6siDoLZ5Dm23CTS7SXhyMLtS9cgLefHcOckPQyXoB/IJqb0K1"
+
"P0Sk0PE1OSRzpsI9JVzhsSW164fwYpxEbygj9O9JAmAszixwItt2j5zLJ6zRnK3R"
+
"OrcAVMN/vpXTN2dCLGZXQrsTK9sAWASzIWTiQRzmnwxsQY7y4u2h+k41n8Z5tw03"
+
"wwIDAQAB"
;
// 预实名接口发起
public
String
sendOrder
(
Map
<
String
,
Object
>
map
)
{
String
str
=
""
;
public
kong
.
unirest
.
HttpResponse
<
String
>
sendOrder
(
Map
<
String
,
Object
>
map
)
{
//String str = "";
kong
.
unirest
.
HttpResponse
<
String
>
stringHttpResponse
=
null
;
try
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
);
String
timeStr
=
simpleDateFormat
.
format
(
new
Date
());
...
...
@@ -57,310 +76,465 @@ public class OrderManage {
}
map
.
put
(
"timeStr"
,
timeStr
);
str
=
sendAitransOrder
(
map
,
0
);
map
.
put
(
"orderNum"
,
"XY"
+
timeStr
);
map
.
put
(
"imgUrl1"
,
(
String
)
map
.
get
(
"idCardUrl1"
));
map
.
put
(
"imgUrl2"
,
(
String
)
map
.
get
(
"idCardUrl2"
));
map
.
put
(
"imgUrl3"
,
(
String
)
map
.
get
(
"idCardUrl3"
));
map
.
put
(
"imgUrl4"
,
(
String
)
map
.
get
(
"idCardUrl4"
));
//str = sendAitransOrder(map, 0);
stringHttpResponse
=
sendAitransOrder
(
map
,
0
);
}
catch
(
Exception
e
)
{
log
.
error
(
"预实名接口发起异常"
,
e
.
getMessage
());
}
return
str
;
return
str
ingHttpResponse
;
}
/**
* @param map
* @param count
* @return
* @throws Exception
*/
// 保存卡品认证信息
public
String
sendAitransOrder
(
Map
<
String
,
Object
>
map
,
int
count
)
throws
NoSuchAlgorithmException
,
UnsupportedEncodingException
{
RequestConfig
defaultRequestConfig
=
RequestConfig
.
custom
().
setSocketTimeout
(
600000
).
setConnectTimeout
(
600000
)
.
setConnectionRequestTimeout
(
600000
)
.
build
();
CloseableHttpClient
httpclient
=
HttpClients
.
custom
().
setDefaultRequestConfig
(
defaultRequestConfig
).
build
();
public
kong
.
unirest
.
HttpResponse
<
String
>
sendAitransOrder
(
Map
<
String
,
Object
>
map
,
int
count
)
throws
Exception
{
log
.
info
(
"移动下单前已有参数:"
+
JSONObject
.
fromObject
(
map
).
toString
());
String
resultStr
=
""
;
HttpEntity
entity
=
null
;
// https://icloud.mini189.cn/api/create-order.action
// https://ismarttest.mini189.cn/api/create-order.action
HttpPost
httpPost
=
new
HttpPost
(
"https://icloud.mini189.cn/api/create-order.action"
);
RequestConfig
requestConfig
=
RequestConfig
.
copy
(
defaultRequestConfig
).
build
();
httpPost
.
setConfig
(
requestConfig
);
Map
<
String
,
String
>
signMap
=
new
HashMap
<
String
,
String
>();
MultipartEntityBuilder
builder
=
MultipartEntityBuilder
.
create
();
ContentType
contentType
=
ContentType
.
create
(
HTTP
.
PLAIN_TEXT_TYPE
,
Charset
.
forName
(
"UTF-8"
));
builder
.
addTextBody
(
"service"
,
"order.prepaidgift.create"
,
contentType
);
// api标识,必填且唯一
signMap
.
put
(
"service"
,
"order.prepaidgift.create"
);
builder
.
addTextBody
(
"userName"
,
(
String
)
map
.
get
(
"ysmUser"
),
contentType
);
// 用户名,必填
signMap
.
put
(
"userName"
,
(
String
)
map
.
get
(
"ysmUser"
));
builder
.
addTextBody
(
"timeStamp"
,
(
String
)
map
.
get
(
"timeStr"
),
contentType
);
// 时间戳(YYYYMMDDHHMMSS),必填
signMap
.
put
(
"timeStamp"
,
(
String
)
map
.
get
(
"timeStr"
));
builder
.
addTextBody
(
"productCategory"
,
"预付费礼包"
,
contentType
);
// 业务类型,必填且唯一
signMap
.
put
(
"productCategory"
,
"预付费礼包"
);
builder
.
addTextBody
(
"govEntCustomer"
,
"0"
,
contentType
);
// 是否政企客户下单:0:否,1:是,必填
signMap
.
put
(
"govEntCustomer"
,
"0"
);
builder
.
addTextBody
(
"agentName"
,
""
,
contentType
);
// 代办人姓名(若是政企客户下单必填)
signMap
.
put
(
"agentName"
,
""
);
builder
.
addTextBody
(
"agentCardNum"
,
""
,
contentType
);
// 代办人身份证号码(若是政企客户下单必填)
signMap
.
put
(
"agentCardNum"
,
""
);
builder
.
addTextBody
(
"customerName"
,
(
String
)
map
.
get
(
"userName"
),
contentType
);
// 客户姓名,必填
signMap
.
put
(
"customerName"
,
(
String
)
map
.
get
(
"userName"
));
builder
.
addTextBody
(
"customerPhone"
,
(
String
)
map
.
get
(
"linkPhone"
),
contentType
);
// 客户(代办人)电话,必填
signMap
.
put
(
"customerPhone"
,
(
String
)
map
.
get
(
"linkPhone"
));
builder
.
addTextBody
(
"customerCardType"
,
"身份证"
,
contentType
);
// 证件类型,必填
signMap
.
put
(
"customerCardType"
,
"身份证"
);
builder
.
addTextBody
(
"customerCardNum"
,
(
String
)
map
.
get
(
"idCard"
),
contentType
);
// 证件号码,必填
signMap
.
put
(
"customerCardNum"
,
(
String
)
map
.
get
(
"idCard"
));
builder
.
addTextBody
(
"landId"
,
"44094951"
,
contentType
);
// 揽装工号,必填
signMap
.
put
(
"landId"
,
"44094951"
);
builder
.
addTextBody
(
"comarketingLanId"
,
""
,
contentType
);
// 协销工号,选填
signMap
.
put
(
"comarketingLanId"
,
""
);
builder
.
addTextBody
(
"groupComarketingLanId"
,
""
,
contentType
);
//集团协销工号,选填
signMap
.
put
(
"groupComarketingLanId"
,
""
);
builder
.
addTextBody
(
"orderOutNum"
,
(
String
)
map
.
get
(
"orderNum"
),
contentType
);
//外部订单编号,选填!;
//通过API接口下单,必须传入一个外部接入商的订单编号,该编号与智能营销系统编号一一对应
signMap
.
put
(
"orderOutNum"
,
(
String
)
map
.
get
(
"orderNum"
));
builder
.
addTextBody
(
"orderSource"
,
""
,
contentType
);
// 订单来源 ,选填
signMap
.
put
(
"orderSource"
,
""
);
builder
.
addTextBody
(
"orderSourceNum"
,
""
,
contentType
);
//
//订单来源单号,选填;与订单来源对应,用于业务上记录订单的来源订单编号
signMap
.
put
(
"orderSourceNum"
,
""
);
builder
.
addTextBody
(
"salePointCode"
,
""
,
contentType
);
// 销售点编码,选填
signMap
.
put
(
"salePointCode"
,
""
);
builder
.
addTextBody
(
"personCode"
,
""
,
contentType
);
// 人员编码,选填
signMap
.
put
(
"personCode"
,
""
);
builder
.
addTextBody
(
"distributorSmsReceive"
,
""
,
contentType
);
// 分销商短信接收号码,选填
signMap
.
put
(
"distributorSmsReceive"
,
""
);
builder
.
addTextBody
(
"batchPickUp"
,
"0"
,
contentType
);
// 是否批量提货,必填
// 0:否,1:是
signMap
.
put
(
"batchPickUp"
,
"0"
);
builder
.
addTextBody
(
"deliveryProvince"
,
(
String
)
map
.
get
(
"sheng"
),
contentType
);
// 配送地址-省,必填
signMap
.
put
(
"deliveryProvince"
,
(
String
)
map
.
get
(
"sheng"
));
builder
.
addTextBody
(
"deliveryCity"
,
(
String
)
map
.
get
(
"shi"
),
contentType
);
// 配送地址-市,必填
signMap
.
put
(
"deliveryCity"
,
(
String
)
map
.
get
(
"shi"
));
builder
.
addTextBody
(
"deliveryDistrict"
,
(
String
)
map
.
get
(
"xian"
),
contentType
);
// 配送地址-区,必填
signMap
.
put
(
"deliveryDistrict"
,
(
String
)
map
.
get
(
"xian"
));
builder
.
addTextBody
(
"deliveryAddress"
,
(
String
)
map
.
get
(
"address"
),
contentType
);
// 配送地址-详细地址,必填
signMap
.
put
(
"deliveryAddress"
,
(
String
)
map
.
get
(
"address"
));
builder
.
addTextBody
(
"deliveryContact"
,
(
String
)
map
.
get
(
"userName"
),
contentType
);
// 联系人,必填
signMap
.
put
(
"deliveryContact"
,
(
String
)
map
.
get
(
"userName"
));
builder
.
addTextBody
(
"deliveryContactPhone"
,
(
String
)
map
.
get
(
"linkPhone"
),
contentType
);
// 联系电话,必填
signMap
.
put
(
"deliveryContactPhone"
,
(
String
)
map
.
get
(
"linkPhone"
));
builder
.
addTextBody
(
"deliveryContactPhone2"
,
""
,
contentType
);
// 联系电话2,选填
signMap
.
put
(
"deliveryContactPhone2"
,
""
);
builder
.
addTextBody
(
"invoiced"
,
"0"
,
contentType
);
// 是否需要发票,必填 0:不需要;1:一次性发票;2:分月发票
signMap
.
put
(
"invoiced"
,
"0"
);
builder
.
addTextBody
(
"invoiceTitle"
,
""
,
contentType
);
// 发票抬头,若需要发票必填
signMap
.
put
(
"invoiceTitle"
,
""
);
builder
.
addTextBody
(
"invoiceDeliveryAddress"
,
""
,
contentType
);
// 电子邮箱,若需要发票必填
signMap
.
put
(
"invoiceDeliveryAddress"
,
""
);
builder
.
addTextBody
(
"deliveryType"
,
"代理商自行发货"
,
contentType
);
// 发货类型,必填,填写只能填同德仓发货或者代理商自行发货或者 现场派卡(其它信息的要求与代理商自行发货类似)
signMap
.
put
(
"deliveryType"
,
"代理商自行发货"
);
// 若填写代理商自行发货或现场派卡,则下单时有几个产品,就需要填写多少个实物串号
builder
.
addTextBody
(
"deliveryCompany"
,
""
,
contentType
);
// 配送公司,必填,填写只能填顺丰速运或者如风达或者京东快递或者EMS
signMap
.
put
(
"deliveryCompany"
,
""
);
// 若发货类型选择代理商自行发货,则不用填写(填写也无效)
builder
.
addTextBody
(
"collection"
,
""
,
contentType
);
// 回收资料,选填,若填写只能填写1(表示身份证复印件)
signMap
.
put
(
"collection"
,
""
);
builder
.
addTextBody
(
"gift"
,
""
,
contentType
);
// 礼品,选填,请通过礼品列表接口获取
signMap
.
put
(
"gift"
,
""
);
builder
.
addTextBody
(
"giftNum"
,
""
,
contentType
);
// 礼品数量,选填,若礼品填写则必填且为正整数
signMap
.
put
(
"giftNum"
,
""
);
List
<
Map
<
String
,
Object
>>
productList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
// 产品信息
List
<
Map
<
String
,
Object
>>
paymentList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
// 销售品信息(费用项)
List
<
Map
<
String
,
Object
>>
inPropertyList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
// 产品属性
List
<
Map
<
String
,
Object
>>
appendPropertyList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
// 产品附加扩展属性
List
<
Map
<
String
,
Object
>>
addPropertyList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
// 自定义产品属性
// 下单产品(如有多个请建立多个map,但产品总数不能超过5个)
Map
<
String
,
Object
>
productMap
=
new
HashMap
<
String
,
Object
>();
// 产品
productMap
.
put
(
"productId"
,
map
.
get
(
"productId"
));
// 产品id,必填,请通过产品列表接口获取
productMap
.
put
(
"count"
,
""
);
// 产品数量,选填(若不填默认为1)
// 该数量仅供发货类型为同德仓发货且批量提货为否时填写,若选择代理商自行发货或批量提货为是,则填写无效
productMap
.
put
(
"count2"
,
""
);
// 产品数量,选填(若不填默认为1);该数量仅供批量提货为是时使用
// 若选择批量提货为否时,则填写无效
productMap
.
put
(
"sn"
,
map
.
get
(
"iccId"
));
// 实物串号,选填(若选择代理商自行发货,必填;其他情况填写无效)
// 销售品信息(费用项)必填,若有终端,请将费用项填写在此
Map
<
String
,
Object
>
paymentListMap
=
new
HashMap
<
String
,
Object
>();
paymentListMap
.
put
(
"id"
,
map
.
get
(
"salesId"
));
// 收费项ID,选填;请通过销售品列表接口获取,若不填表示终端补收款
paymentListMap
.
put
(
"saleName"
,
""
);
// 销售品名称,选填,若id不填写此项必填写,且只能为终端补收款
// paymentListMap.put("saleAmount", "");// 售价,选填
paymentListMap
.
put
(
"payType"
,
"3"
);
// 缴费方式,必填(例:payType:3)3:代理商打款4:穗易付7:货到付款9:第三方托收
paymentListMap
.
put
(
"payAmount"
,
"0"
);
// 打款金额(支付金额),若选择代理商打款或者穗易付,此项必填
paymentListMap
.
put
(
"saleAmount"
,
""
);
// 打款金额,若选择货到付款,此项必填
paymentListMap
.
put
(
"payPlatform"
,
""
);
// 支付平台,若选择穗易付,此项必填
paymentListMap
.
put
(
"electronicPayNumber"
,
""
);
// 支付流水号,若选择穗易付,此项必填
paymentListMap
.
put
(
"payOrderNumber"
,
""
);
// 穗易付订单号,若选择穗易付,此项必填
paymentListMap
.
put
(
"monthUserid"
,
""
);
//用户ID,缴费方式为“第三方托收”时必填
paymentListMap
.
put
(
"monthPlatform"
,
""
);
//签约平台,缴费方式为“第三方托收”时必填
paymentListMap
.
put
(
"monthFlowno"
,
""
);
//签约流水号,缴费方式为“第三方托收”时必填
paymentListMap
.
put
(
"monthNumber"
,
""
);
//签约协议号,缴费方式为“第三方托收”时必填
paymentListMap
.
put
(
"monthTime"
,
""
);
//签约时间,缴费方式为“第三方托收”时必填
paymentListMap
.
put
(
"monthEffectiveTime"
,
""
);
//签约生效时间,缴费方式为“第三方托收”时必填
paymentListMap
.
put
(
"monthUneffectiveTime"
,
""
);
//签约失效时间,缴费方式为“第三方托收”时必填
paymentList
.
add
(
paymentListMap
);
productMap
.
put
(
"payment"
,
paymentList
);
// 产品属性 必填业务号码属性,name=业务号码,value=11位数字或者随机;若还有其他属性可建立多个map添加
// 若发货类型选择代理商自行发货,则该value值必须填写11位数字
Map
<
String
,
Object
>
inPropertyListMap
=
new
HashMap
<
String
,
Object
>();
inPropertyListMap
.
put
(
"name"
,
"业务号码"
);
inPropertyListMap
.
put
(
"value"
,
map
.
get
(
"orderPhone"
));
inPropertyList
.
add
(
inPropertyListMap
);
productMap
.
put
(
"inpProperties"
,
inPropertyList
);
// 产品自定义属性;选填,没有则为null
// 注:若填写请属性名和属性值都填写,若只填写其中一项则无效
Map
<
String
,
Object
>
addPropertyListMap
=
new
HashMap
<
String
,
Object
>();
addPropertyListMap
.
put
(
"name"
,
null
);
addPropertyListMap
.
put
(
"value"
,
null
);
addPropertyList
.
add
(
addPropertyListMap
);
productMap
.
put
(
"addProperties"
,
addPropertyList
);
productList
.
add
(
productMap
);
// 将对象装换为json字符串
String
productJson
=
JSONArray
.
fromObject
(
productList
).
toString
();
log
.
info
(
"移动下单产品参数:"
+
productJson
);
try
{
builder
.
addTextBody
(
"productJson"
,
URLEncoder
.
encode
(
productJson
,
"UTF-8"
),
contentType
);
// 产品信息,必填
signMap
.
put
(
"productJson"
,
URLEncoder
.
encode
(
productJson
,
"UTF-8"
));
}
catch
(
UnsupportedEncodingException
e1
)
{
e1
.
printStackTrace
();
}
//身份证正面,选填
File
file1
=
new
File
(
map
.
get
(
"imgUrl1"
).
toString
().
replace
(
"manager/ciop"
,
FilePath
.
BACKGROUNDIMG
.
getValue
()).
replace
(
"\\"
,
"/"
));
//身份证背面,选填
File
file2
=
new
File
(
map
.
get
(
"imgUrl2"
).
toString
().
replace
(
"manager/ciop"
,
FilePath
.
BACKGROUNDIMG
.
getValue
()).
replace
(
"\\"
,
"/"
));
//手持证件,选填
File
file3
=
new
File
(
map
.
get
(
"imgUrl3"
).
toString
().
replace
(
"manager/ciop"
,
FilePath
.
BACKGROUNDIMG
.
getValue
()).
replace
(
"\\"
,
"/"
));
//手持证件2,选填
File
file4
=
new
File
(
map
.
get
(
"imgUrl4"
).
toString
().
replace
(
"manager/ciop"
,
FilePath
.
BACKGROUNDIMG
.
getValue
()).
replace
(
"\\"
,
"/"
));
if
(
file1
!=
null
)
{
ContentBody
sfzzmFile
=
new
FileBody
(
file1
);
builder
.
addPart
(
"sfzzmFile"
,
sfzzmFile
);
}
if
(
file2
!=
null
)
{
ContentBody
sfzbmFile
=
new
FileBody
(
file2
);
builder
.
addPart
(
"sfzbmFile"
,
sfzbmFile
);
}
if
(
file3
!=
null
)
{
ContentBody
sfzscFile
=
new
FileBody
(
file3
);
builder
.
addPart
(
"sfzscFile"
,
sfzscFile
);
}
if
(
file4
!=
null
)
{
ContentBody
sfzsc2File
=
new
FileBody
(
file4
);
builder
.
addPart
(
"sfzsc2File"
,
sfzsc2File
);
}
List
<
String
>
keys
=
new
ArrayList
<
String
>();
keys
.
addAll
(
signMap
.
keySet
());
Collections
.
sort
(
keys
);
// key按字符串升序
String
value
,
plaintext
=
""
;
for
(
String
key
:
keys
)
{
value
=
signMap
.
get
(
key
);
plaintext
=
plaintext
.
concat
(
value
);
}
plaintext
=
plaintext
.
concat
((
String
)
map
.
get
(
"sign"
));
String
sign
=
CommonMd5
.
encryption
(
plaintext
);
// md5加密
builder
.
addTextBody
(
"sign"
,
sign
,
contentType
);
// 签名,必填
log
.
info
(
"移动智能平台下单参数:"
+
plaintext
);
Map
<
String
,
String
>
return_data
=
new
HashMap
<>();
return_data
.
put
(
"code"
,
""
);
return_data
.
put
(
"route"
,
"提交下单"
);
//[提交下单] [订单保存] [提交审核] 默认为提交下单
return_data
.
put
(
"微信openId"
,
""
);
return_data
.
put
(
"微信appId"
,
""
);
map
.
put
(
"return_data"
,
return_data
);
String
cardAddress
=
orderCardAddressMapper
.
selectByOrderId
(
map
.
get
(
"order_id"
));
Map
<
String
,
Object
>
order_data
=
new
HashMap
<>();
Map
<
String
,
Object
>
attachment
=
new
HashMap
<>();
// 附件
attachment
.
put
(
"身份证照1"
,
map
.
get
(
"imgUrl1"
));
attachment
.
put
(
"身份证照2"
,
map
.
get
(
"imgUrl2"
));
attachment
.
put
(
"身份证照3"
,
map
.
get
(
"imgUrl3"
));
attachment
.
put
(
"身份证照4"
,
map
.
get
(
"imgUrl4"
));
order_data
.
put
(
"附件"
,
attachment
);
order_data
.
put
(
"代理商账号"
,
"hyoujian"
);
order_data
.
put
(
"使用人姓名"
,
"黄友健"
);
order_data
.
put
(
"使用人证件号"
,
"440802199006080830"
);
Map
<
String
,
Object
>
customerInformation
=
new
HashMap
<>();
//客户信息
customerInformation
.
put
(
"联系人"
,
(
String
)
map
.
get
(
"userName"
));
customerInformation
.
put
(
"客户证件号码"
,
(
String
)
map
.
get
(
"idCard"
));
customerInformation
.
put
(
"客户证件姓名"
,
(
String
)
map
.
get
(
"userName"
));
customerInformation
.
put
(
"联系电话"
,
(
String
)
map
.
get
(
"linkPhone"
));
customerInformation
.
put
(
"客户证件地址"
,
cardAddress
);
customerInformation
.
put
(
"客户证件类型"
,
"身份证"
);
customerInformation
.
put
(
"通讯地址"
,
(
String
)
map
.
get
(
"address"
));
order_data
.
put
(
"客户信息"
,
customerInformation
);
order_data
.
put
(
"订单来源单号"
,
(
String
)
map
.
get
(
"orderNum"
));
// 订单来源单号,必填; 与订单来源对应,用于业务上记录订单的来源订单编号
order_data
.
put
(
"订单备注"
,
""
);
order_data
.
put
(
"付费类型"
,
"预付费"
);
//预付费、后付费、其他 选填
Map
<
String
,
Object
>
packageInformation
=
new
HashMap
<>();
//揽装信息
packageInformation
.
put
(
"揽装姓名"
,
map
.
get
(
"lzUser"
));
packageInformation
.
put
(
"揽装工号"
,
map
.
get
(
"lzgh"
));
order_data
.
put
(
"揽装信息"
,
packageInformation
);
HashMap
<
String
,
Object
>
invoiceInformation
=
new
HashMap
<>();
//发票信息
invoiceInformation
.
put
(
"发票抬头"
,
""
);
//若发票投递方式为不需要,可以不填值,但必须有参数
invoiceInformation
.
put
(
"发票投递方式"
,
"不需要"
);
// 必填 一次性发票,分月发票,不需要
invoiceInformation
.
put
(
"电子邮箱"
,
""
);
//若发票投递方式为不需要,可以不填值,但必须有参数
order_data
.
put
(
"发票信息"
,
invoiceInformation
);
order_data
.
put
(
"接口下单账号"
,
"xiaoyuan"
);
//接口下单账号
HashMap
<
String
,
Object
>
orderingProducts
=
new
HashMap
<>();
//订购产品
orderingProducts
.
put
(
"产品名称"
,
map
.
get
(
"cardType"
));
orderingProducts
.
put
(
"付费类型"
,
"预付费"
);
// 属性列表
AttributeList
userCategory
=
new
AttributeList
();
userCategory
.
setName
(
"用户类别"
);
userCategory
.
setValue
(
"学生"
);
AttributeList
studentID
=
new
AttributeList
();
studentID
.
setName
(
"学生证号"
);
studentID
.
setValue
((
String
)
map
.
get
(
"idCard"
));
AttributeList
userType
=
new
AttributeList
();
userType
.
setName
(
"用户类型"
);
userType
.
setValue
((
String
)
map
.
get
(
"cardType"
));
AttributeList
[]
attributeList
=
new
AttributeList
[]{
userCategory
,
studentID
,
userType
};
//属性列表
orderingProducts
.
put
(
"属性列表"
,
attributeList
);
order_data
.
put
(
"订购产品"
,
orderingProducts
);
Map
<
Object
,
Object
>
logisticsInformation
=
new
HashMap
<>();
//物流信息
logisticsInformation
.
put
(
"受理类型"
,
"不受理"
);
logisticsInformation
.
put
(
"发货类型"
,
"代理商自行发货"
);
order_data
.
put
(
"业务类型"
,
"移动业务"
);
//业务类型
order_data
.
put
(
"办理类型"
,
"新装主卡"
);
//业务类型
List
<
Map
<
String
,
Object
>>
mobileAccessList
=
new
ArrayList
<>();
//移动接入
Map
<
String
,
Object
>
mobileAccess
=
new
HashMap
<>();
mobileAccess
.
put
(
"订购类型"
,
"新装"
);
mobileAccess
.
put
(
"UIM实物串号"
,
map
.
get
(
"iccId"
));
mobileAccess
.
put
(
"号码类型"
,
"主卡"
);
mobileAccess
.
put
(
"移动接入号"
,
map
.
get
(
"orderPhone"
));
mobileAccessList
.
add
(
mobileAccess
);
order_data
.
put
(
"移动接入"
,
mobileAccessList
);
Map
<
String
,
Object
>
realNameInformation
=
new
HashMap
<>();
//实名信息
realNameInformation
.
put
(
"姓名"
,
"主卡"
);
realNameInformation
.
put
(
"身份证号"
,
map
.
get
(
"idCard"
));
realNameInformation
.
put
(
"ICCID"
,
map
.
get
(
"iccId"
));
realNameInformation
.
put
(
"证件地址"
,
cardAddress
);
order_data
.
put
(
"实名信息"
,
realNameInformation
);
Map
<
String
,
Object
>
logistics
=
new
HashMap
<>();
//物流信息
logistics
.
put
(
"发货类型"
,
"代理商自行发货"
);
order_data
.
put
(
"物流信息"
,
logistics
);
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
map1
.
put
(
"order_data"
,
order_data
);
String
order_dataJSON
=
com
.
alibaba
.
fastjson
.
JSONObject
.
toJSONString
(
map1
);
// 获得md5串
String
sign
=
MD5Util
.
MD5Encode
(
order_dataJSON
,
"Utf-8"
);
// 获得小写md5串
sign
=
sign
.
toLowerCase
();
// RSA加密
byte
[]
encodedData
=
RSAUtils
.
encryptByPublicKey
(
sign
,
publicKey
);
sign
=
(
new
BASE64Encoder
()).
encodeBuffer
(
encodedData
);
//去除换行
sign
=
sign
.
replaceAll
(
"\\r|\\n"
,
""
);
log
.
info
(
"移动下单接口中的携带的签名:"
+
sign
);
kong
.
unirest
.
HttpResponse
<
String
>
responese
=
null
;
try
{
//httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
httpPost
.
setEntity
(
builder
.
build
());
//System.out.println("[CREATE_ORDER]移动产品下单接口,提交参数" + EntityUtils.toString(httpPost.getEntity(), "UTF-8"));
long
startTime
=
System
.
currentTimeMillis
();
Constant
.
trustEveryone
();
HttpResponse
response
=
httpclient
.
execute
(
httpPost
);
long
endTime
=
System
.
currentTimeMillis
();
log
.
info
(
"接口调用时间:"
+
(
endTime
-
startTime
)
+
"ms"
);
entity
=
response
.
getEntity
();
String
httpResult
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
resultStr
=
httpResult
;
log
.
info
(
"[CREATE_ORDER]预付费下单接口,返回信息:"
+
httpResult
);
httpclient
.
close
();
JSONObject
resultDataJson
=
JSONObject
.
fromObject
(
httpResult
);
String
isSuccess
=
resultDataJson
.
getString
(
"status"
);
String
orderNum
=
resultDataJson
.
getString
(
"orderNumber"
);
if
(
"000001"
.
equals
(
isSuccess
))
{
log
.
info
(
"[CREATE_ORDER]下单成功,orderNum="
+
orderNum
);
}
}
catch
(
SSLHandshakeException
s
)
{
log
.
info
(
"提交参数:"
+
order_dataJSON
);
com
.
winsun
.
constant
.
Constant
.
trustEveryone
();
responese
=
Unirest
.
put
(
"http://132.97.20.20/function/id-generator-snowflake.prod-fn?turbo=1"
)
.
header
(
"Content-Type"
,
"application/json;charset=UTF-8"
)
.
header
(
"X-Sign"
,
sign
)
.
body
(
order_dataJSON
)
.
asString
();
log
.
info
(
"移动下单接口,返回信息:"
+
responese
.
getBody
());
}
catch
(
ResourceAccessException
e
)
{
count
++;
if
(
count
<
20
)
{
res
ultStr
=
sendAitransOrder
(
map
,
count
);
res
ponese
=
sendAitransOrder
(
map
,
count
);
}
else
{
log
.
error
(
"
[HTTP] [CREATE_ORDER] 预付费下单接口异常20次
"
);
log
.
error
(
"
移动(预付费、移动、融合、续约、增值)下单接口异常尝试20次失误。请检查接口
"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"[HTTP] [CREATE_ORDER] 预付费下单接口异常"
);
e
.
printStackTrace
();
}
finally
{
httpPost
.
releaseConnection
();
}
return
res
ultStr
;
return
res
ponese
;
}
// 保存卡品认证信息
// public String sendAitransOrder(Map<String, Object> map, int count) throws NoSuchAlgorithmException, UnsupportedEncodingException {
// RequestConfig defaultRequestConfig = RequestConfig.custom().setSocketTimeout(600000).setConnectTimeout(600000)
// .setConnectionRequestTimeout(600000)
// .build();
//
// CloseableHttpClient httpclient = HttpClients.custom().setDefaultRequestConfig(defaultRequestConfig).build();
//
// log.info("移动下单前已有参数:" + JSONObject.fromObject(map).toString());
// String resultStr = "";
//
// HttpEntity entity = null;
// // https://icloud.mini189.cn/api/create-order.action
// // https://ismarttest.mini189.cn/api/create-order.action
// HttpPost httpPost = new HttpPost("https://icloud.mini189.cn/api/create-order.action");
//
// RequestConfig requestConfig = RequestConfig.copy(defaultRequestConfig).build();
// httpPost.setConfig(requestConfig);
//
// Map<String, String> signMap = new HashMap<String, String>();
// MultipartEntityBuilder builder = MultipartEntityBuilder.create();
// ContentType contentType = ContentType.create(HTTP.PLAIN_TEXT_TYPE, Charset.forName("UTF-8"));
//
// builder.addTextBody("service", "order.prepaidgift.create", contentType);// api标识,必填且唯一
// signMap.put("service", "order.prepaidgift.create");
//
//
// builder.addTextBody("userName", (String) map.get("ysmUser"), contentType);// 用户名,必填
// signMap.put("userName", (String) map.get("ysmUser"));
//
//
// builder.addTextBody("timeStamp", (String) map.get("timeStr"), contentType);// 时间戳(YYYYMMDDHHMMSS),必填
//
// signMap.put("timeStamp", (String) map.get("timeStr"));
//
// builder.addTextBody("productCategory", "预付费礼包", contentType);// 业务类型,必填且唯一
//
// signMap.put("productCategory", "预付费礼包");
//
// builder.addTextBody("govEntCustomer", "0", contentType);// 是否政企客户下单:0:否,1:是,必填
//
// signMap.put("govEntCustomer", "0");
//
// builder.addTextBody("agentName", "", contentType);// 代办人姓名(若是政企客户下单必填)
// signMap.put("agentName", "");
//
// builder.addTextBody("agentCardNum", "", contentType);// 代办人身份证号码(若是政企客户下单必填)
// signMap.put("agentCardNum", "");
//
// builder.addTextBody("customerName", (String) map.get("userName"), contentType);// 客户姓名,必填
// signMap.put("customerName", (String) map.get("userName"));
//
// builder.addTextBody("customerPhone", (String) map.get("linkPhone"), contentType);// 客户(代办人)电话,必填
// signMap.put("customerPhone", (String) map.get("linkPhone"));
//
// builder.addTextBody("customerCardType", "身份证", contentType);// 证件类型,必填
// signMap.put("customerCardType", "身份证");
//
// builder.addTextBody("customerCardNum", (String) map.get("idCard"), contentType);// 证件号码,必填
// signMap.put("customerCardNum", (String) map.get("idCard"));
//
// builder.addTextBody("landId", "44094951", contentType);// 揽装工号,必填
// signMap.put("landId", "44094951");
//
// builder.addTextBody("comarketingLanId", "", contentType);// 协销工号,选填
// signMap.put("comarketingLanId", "");
//
// builder.addTextBody("groupComarketingLanId", "", contentType);//集团协销工号,选填
// signMap.put("groupComarketingLanId", "");
//
// builder.addTextBody("orderOutNum", (String) map.get("orderNum"), contentType);//外部订单编号,选填!;
// //通过API接口下单,必须传入一个外部接入商的订单编号,该编号与智能营销系统编号一一对应
// signMap.put("orderOutNum", (String) map.get("orderNum"));
//
// builder.addTextBody("orderSource", "", contentType);// 订单来源 ,选填
// signMap.put("orderSource", "");
//
// builder.addTextBody("orderSourceNum", "", contentType);//
// //订单来源单号,选填;与订单来源对应,用于业务上记录订单的来源订单编号
// signMap.put("orderSourceNum", "");
//
// builder.addTextBody("salePointCode", "", contentType);// 销售点编码,选填
// signMap.put("salePointCode", "");
//
// builder.addTextBody("personCode", "", contentType);// 人员编码,选填
// signMap.put("personCode", "");
//
// builder.addTextBody("distributorSmsReceive", "", contentType);// 分销商短信接收号码,选填
// signMap.put("distributorSmsReceive", "");
//
//
// builder.addTextBody("batchPickUp", "0", contentType);// 是否批量提货,必填
// // 0:否,1:是
// signMap.put("batchPickUp", "0");
//
// builder.addTextBody("deliveryProvince", (String) map.get("sheng"), contentType);// 配送地址-省,必填
// signMap.put("deliveryProvince", (String) map.get("sheng"));
//
// builder.addTextBody("deliveryCity", (String) map.get("shi"), contentType);// 配送地址-市,必填
// signMap.put("deliveryCity", (String) map.get("shi"));
//
// builder.addTextBody("deliveryDistrict", (String) map.get("xian"), contentType);// 配送地址-区,必填
// signMap.put("deliveryDistrict", (String) map.get("xian"));
//
// builder.addTextBody("deliveryAddress", (String) map.get("address"), contentType);// 配送地址-详细地址,必填
// signMap.put("deliveryAddress", (String) map.get("address"));
//
// builder.addTextBody("deliveryContact", (String) map.get("userName"), contentType);// 联系人,必填
// signMap.put("deliveryContact", (String) map.get("userName"));
//
// builder.addTextBody("deliveryContactPhone", (String) map.get("linkPhone"), contentType);// 联系电话,必填
// signMap.put("deliveryContactPhone", (String) map.get("linkPhone"));
//
// builder.addTextBody("deliveryContactPhone2", "", contentType);// 联系电话2,选填
// signMap.put("deliveryContactPhone2", "");
//
// builder.addTextBody("invoiced", "0", contentType);// 是否需要发票,必填 0:不需要;1:一次性发票;2:分月发票
//
// signMap.put("invoiced", "0");
//
// builder.addTextBody("invoiceTitle", "", contentType);// 发票抬头,若需要发票必填
// signMap.put("invoiceTitle", "");
//
// builder.addTextBody("invoiceDeliveryAddress", "", contentType);// 电子邮箱,若需要发票必填
// signMap.put("invoiceDeliveryAddress", "");
//
// builder.addTextBody("deliveryType", "代理商自行发货", contentType);// 发货类型,必填,填写只能填同德仓发货或者代理商自行发货或者 现场派卡(其它信息的要求与代理商自行发货类似)
// signMap.put("deliveryType", "代理商自行发货");// 若填写代理商自行发货或现场派卡,则下单时有几个产品,就需要填写多少个实物串号
//
// builder.addTextBody("deliveryCompany", "", contentType);// 配送公司,必填,填写只能填顺丰速运或者如风达或者京东快递或者EMS
// signMap.put("deliveryCompany", "");// 若发货类型选择代理商自行发货,则不用填写(填写也无效)
//
// builder.addTextBody("collection", "", contentType);// 回收资料,选填,若填写只能填写1(表示身份证复印件)
// signMap.put("collection", "");
//
// builder.addTextBody("gift", "", contentType);// 礼品,选填,请通过礼品列表接口获取
// signMap.put("gift", "");
//
// builder.addTextBody("giftNum", "", contentType);// 礼品数量,选填,若礼品填写则必填且为正整数
// signMap.put("giftNum", "");
//
// List<Map<String, Object>> productList = new ArrayList<Map<String, Object>>();// 产品信息
// List<Map<String, Object>> paymentList = new ArrayList<Map<String, Object>>();// 销售品信息(费用项)
// List<Map<String, Object>> inPropertyList = new ArrayList<Map<String, Object>>();// 产品属性
// List<Map<String, Object>> appendPropertyList = new ArrayList<Map<String, Object>>();// 产品附加扩展属性
// List<Map<String, Object>> addPropertyList = new ArrayList<Map<String, Object>>();// 自定义产品属性
// // 下单产品(如有多个请建立多个map,但产品总数不能超过5个)
// Map<String, Object> productMap = new HashMap<String, Object>();
// // 产品
// productMap.put("productId", map.get("productId"));// 产品id,必填,请通过产品列表接口获取
// productMap.put("count", "");// 产品数量,选填(若不填默认为1)
// // 该数量仅供发货类型为同德仓发货且批量提货为否时填写,若选择代理商自行发货或批量提货为是,则填写无效
// productMap.put("count2", "");// 产品数量,选填(若不填默认为1);该数量仅供批量提货为是时使用
// // 若选择批量提货为否时,则填写无效
// productMap.put("sn", map.get("iccId"));// 实物串号,选填(若选择代理商自行发货,必填;其他情况填写无效)
//
// // 销售品信息(费用项)必填,若有终端,请将费用项填写在此
// Map<String, Object> paymentListMap = new HashMap<String, Object>();
// paymentListMap.put("id", map.get("salesId"));// 收费项ID,选填;请通过销售品列表接口获取,若不填表示终端补收款
// paymentListMap.put("saleName", "");// 销售品名称,选填,若id不填写此项必填写,且只能为终端补收款
//// paymentListMap.put("saleAmount", "");// 售价,选填
// paymentListMap.put("payType", "3");// 缴费方式,必填(例:payType:3)3:代理商打款4:穗易付7:货到付款9:第三方托收
// paymentListMap.put("payAmount", "0");// 打款金额(支付金额),若选择代理商打款或者穗易付,此项必填
// paymentListMap.put("saleAmount", "");// 打款金额,若选择货到付款,此项必填
// paymentListMap.put("payPlatform", "");// 支付平台,若选择穗易付,此项必填
// paymentListMap.put("electronicPayNumber", "");// 支付流水号,若选择穗易付,此项必填
// paymentListMap.put("payOrderNumber", "");// 穗易付订单号,若选择穗易付,此项必填
// paymentListMap.put("monthUserid", "");//用户ID,缴费方式为“第三方托收”时必填
// paymentListMap.put("monthPlatform", "");//签约平台,缴费方式为“第三方托收”时必填
// paymentListMap.put("monthFlowno", "");//签约流水号,缴费方式为“第三方托收”时必填
// paymentListMap.put("monthNumber", "");//签约协议号,缴费方式为“第三方托收”时必填
// paymentListMap.put("monthTime", "");//签约时间,缴费方式为“第三方托收”时必填
// paymentListMap.put("monthEffectiveTime", "");//签约生效时间,缴费方式为“第三方托收”时必填
// paymentListMap.put("monthUneffectiveTime", "");//签约失效时间,缴费方式为“第三方托收”时必填
//
// paymentList.add(paymentListMap);
//
// productMap.put("payment", paymentList);
//
// // 产品属性 必填业务号码属性,name=业务号码,value=11位数字或者随机;若还有其他属性可建立多个map添加
// // 若发货类型选择代理商自行发货,则该value值必须填写11位数字
// Map<String, Object> inPropertyListMap = new HashMap<String, Object>();
// inPropertyListMap.put("name", "业务号码");
// inPropertyListMap.put("value", map.get("orderPhone"));
// inPropertyList.add(inPropertyListMap);
// productMap.put("inpProperties", inPropertyList);
//
// // 产品自定义属性;选填,没有则为null
// // 注:若填写请属性名和属性值都填写,若只填写其中一项则无效
// Map<String, Object> addPropertyListMap = new HashMap<String, Object>();
// addPropertyListMap.put("name", null);
// addPropertyListMap.put("value", null);
// addPropertyList.add(addPropertyListMap);
// productMap.put("addProperties", addPropertyList);
//
// productList.add(productMap);
//
// // 将对象装换为json字符串
// String productJson = JSONArray.fromObject(productList).toString();
//
// log.info("移动下单产品参数:" + productJson);
//
// try {
// builder.addTextBody("productJson", URLEncoder.encode(productJson, "UTF-8"), contentType);// 产品信息,必填
// signMap.put("productJson", URLEncoder.encode(productJson, "UTF-8"));
// } catch (UnsupportedEncodingException e1) {
// e1.printStackTrace();
// }
//
// //身份证正面,选填
// File file1 = new File(map.get("imgUrl1").toString().replace("manager/ciop", FilePath.BACKGROUNDIMG.getValue()).replace("\\", "/"));
// //身份证背面,选填
// File file2 = new File(map.get("imgUrl2").toString().replace("manager/ciop", FilePath.BACKGROUNDIMG.getValue()).replace("\\", "/"));
// //手持证件,选填
// File file3 = new File(map.get("imgUrl3").toString().replace("manager/ciop", FilePath.BACKGROUNDIMG.getValue()).replace("\\", "/"));
// //手持证件2,选填
// File file4 = new File(map.get("imgUrl4").toString().replace("manager/ciop", FilePath.BACKGROUNDIMG.getValue()).replace("\\", "/"));
//
// if (file1 != null) {
// ContentBody sfzzmFile = new FileBody(file1);
// builder.addPart("sfzzmFile", sfzzmFile);
// }
// if (file2 != null) {
// ContentBody sfzbmFile = new FileBody(file2);
// builder.addPart("sfzbmFile", sfzbmFile);
// }
// if (file3 != null) {
// ContentBody sfzscFile = new FileBody(file3);
// builder.addPart("sfzscFile", sfzscFile);
// }
// if (file4 != null) {
// ContentBody sfzsc2File = new FileBody(file4);
// builder.addPart("sfzsc2File", sfzsc2File);
// }
//
// List<String> keys = new ArrayList<String>();
// keys.addAll(signMap.keySet());
// Collections.sort(keys);// key按字符串升序
// String value, plaintext = "";
//
// for (String key : keys) {
// value = signMap.get(key);
// plaintext = plaintext.concat(value);
// }
//
// plaintext = plaintext.concat((String) map.get("sign"));
//
// String sign = CommonMd5.encryption(plaintext);// md5加密
// builder.addTextBody("sign", sign, contentType);// 签名,必填
//
// log.info("移动智能平台下单参数:" + plaintext);
//
// try {
//
// //httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
// httpPost.setEntity(builder.build());
// //System.out.println("[CREATE_ORDER]移动产品下单接口,提交参数" + EntityUtils.toString(httpPost.getEntity(), "UTF-8"));
//
// long startTime = System.currentTimeMillis();
// Constant.trustEveryone();
// HttpResponse response = httpclient.execute(httpPost);
// long endTime = System.currentTimeMillis();
// log.info("接口调用时间:" + (endTime - startTime) + "ms");
//
//
// entity = response.getEntity();
//
// String httpResult = EntityUtils.toString(entity, "UTF-8");
// resultStr = httpResult;
//
// log.info("[CREATE_ORDER]预付费下单接口,返回信息:" + httpResult);
// httpclient.close();
// JSONObject resultDataJson = JSONObject.fromObject(httpResult);
//
// String isSuccess = resultDataJson.getString("status");
// String orderNum = resultDataJson.getString("orderNumber");
// if ("000001".equals(isSuccess)) {
// log.info("[CREATE_ORDER]下单成功,orderNum=" + orderNum);
// }
// } catch (SSLHandshakeException s) {
// count++;
// if (count < 20) {
// resultStr = sendAitransOrder(map, count);
// } else {
// log.error("[HTTP] [CREATE_ORDER] 预付费下单接口异常20次");
// }
// } catch (Exception e) {
// log.error("[HTTP] [CREATE_ORDER] 预付费下单接口异常");
// e.printStackTrace();
// } finally {
// httpPost.releaseConnection();
// }
//
// return resultStr;
// }
// 查询移互平台产品列表
public
String
queryProduct
()
throws
NoSuchAlgorithmException
,
UnsupportedEncodingException
{
List
<
NameValuePair
>
qParams
=
new
ArrayList
<
NameValuePair
>();
...
...
common/src/main/java/com/winsun/utils/WxInterfacesUtil.java
View file @
5992c732
...
...
@@ -162,7 +162,7 @@ public class WxInterfacesUtil {
String
url
=
"https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token="
+
access_token
;
JSONObject
obj
=
new
JSONObject
();
obj
.
put
(
"group"
,
"
网迅
"
);
obj
.
put
(
"group"
,
""
);
obj
.
put
(
"msgtype"
,
"news"
);
JSONObject
newsObj
=
new
JSONObject
();
...
...
core-service/src/main/java/com/winsun/item/modular/system/controller/LoginPwdController.java
View file @
5992c732
...
...
@@ -558,7 +558,7 @@ public class LoginPwdController extends BaseController {
paramsMap
.
put
(
"apph5"
,
"1"
);
//APPH5标识 固定:1
paramsMap
.
put
(
"appid"
,
appId
);
// 终端编码
paramsMap
.
put
(
"apph5Type"
,
"1"
);
// 入口类型
网迅
固定:1
paramsMap
.
put
(
"apph5Type"
,
"1"
);
// 入口类型 固定:1
paramsMap
.
put
(
"lzstaffcity"
,
""
);
// 揽装人县分
paramsMap
.
put
(
"lzstaffmsc"
,
""
);
// 揽装人营服
paramsMap
.
put
(
"lzstaffname"
,
""
);
// 揽装人姓名
...
...
service-manager/src/main/java/com/winsun/controller/AuthCodeController.java
View file @
5992c732
...
...
@@ -3,8 +3,10 @@ package com.winsun.controller;
import
com.winsun.auth.core.annotion.Permission
;
import
com.winsun.auth.core.base.controller.BaseController
;
import
com.winsun.auth.core.common.model.ResponseData
;
import
com.winsun.auth.core.shiro.ShiroUser
;
import
com.winsun.bean.AuthCode
;
import
com.winsun.mapper.AuthCodeMapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
...
@@ -24,14 +26,18 @@ public class AuthCodeController extends BaseController {
private
static
AuthCodeMapper
authCodeMapper
;
// 查询验证码
@Permission
(
menuname
=
"查询验证码"
,
value
=
"queryAuthCode"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
List
<
AuthCode
>>
queryAuthCodeList
(
@RequestParam
(
name
=
"id"
,
required
=
false
)
String
id
){
@Permission
(
menuname
=
"查询验证码"
,
value
=
"queryAuthCode"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
List
<
AuthCode
>>
queryAuthCodeList
(
@RequestParam
(
name
=
"id"
,
required
=
false
)
String
id
)
{
ShiroUser
shiroUser
=
getShiroUser
();
if
(!
shiroUser
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
,
"系统管理员"
,
"验证码"
)))
{
ResponseData
.
error
(
"无权限修改订单"
);
}
List
<
AuthCode
>
queryAuthCodeList
=
authCodeMapper
.
queryAuthCode
(
id
);
return
ResponseData
.
success
(
queryAuthCodeList
,
"查询完毕!"
);
return
ResponseData
.
success
(
queryAuthCodeList
,
"查询完毕!"
);
}
@Autowired
public
AuthCodeController
(
AuthCodeMapper
authCodeMapper
){
public
AuthCodeController
(
AuthCodeMapper
authCodeMapper
)
{
AuthCodeController
.
authCodeMapper
=
authCodeMapper
;
}
}
service-manager/src/main/java/com/winsun/controller/supervisorController.java
View file @
5992c732
...
...
@@ -2,8 +2,10 @@ package com.winsun.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.winsun.auth.core.annotion.Permission
;
import
com.winsun.auth.core.base.controller.BaseController
;
import
com.winsun.auth.core.common.model.ResponseData
;
...
...
@@ -11,17 +13,25 @@ import com.winsun.auth.core.shiro.ShiroUser;
import
com.winsun.bean.Order
;
import
com.winsun.bean.Package
;
import
com.winsun.bean.YsmUser
;
import
com.winsun.constant.Constant
;
import
com.winsun.mapper.OrderMapper
;
import
com.winsun.mapper.PackageMapper
;
import
com.winsun.mapper.SchoolMapper
;
import
com.winsun.mapper.YsmUserMapper
;
import
com.winsun.smsUtils.SendSmsAndMail
;
import
com.winsun.utils.MD5Utils
;
import
com.winsun.utils.MyBatisPlusUpdateUtils
;
import
com.winsun.utils.OrderManage
;
import
com.winsun.utils.RSAUtils
;
import
kong.unirest.Unirest
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.ResourceAccessException
;
import
sun.misc.BASE64Encoder
;
import
java.net.URLEncoder
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -36,7 +46,7 @@ import java.util.Map;
@RequestMapping
(
"/supervisor"
)
public
class
supervisorController
extends
BaseController
{
private
static
String
REPLACE
=
"new/ciop"
;
private
static
String
REPLACE
=
"new/ciop"
;
private
static
PackageMapper
packageMapper
;
...
...
@@ -45,6 +55,18 @@ public class supervisorController extends BaseController {
private
static
YsmUserMapper
ysmUserMapper
;
@Autowired
private
SchoolMapper
schoolMapper
;
final
String
publicKey
=
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAok8DnvM2OBwtzNoJb4nA"
+
"jn4lgCkSxLyRw5lLiUfsi+40h00CGAC1arvbinTTbtrSnm4YDYlaJwveiOeDKdk0"
+
"f2Yglb/8loEbNTqb1OqNxUeM1wYLRBXvAkkZ5fZllajWzFMkoNU/JQ4+T8sMATxm"
+
"1d1XRcgM6zlgVwX6siDoLZ5Dm23CTS7SXhyMLtS9cgLefHcOckPQyXoB/IJqb0K1"
+
"P0Sk0PE1OSRzpsI9JVzhsSW164fwYpxEbygj9O9JAmAszixwItt2j5zLJ6zRnK3R"
+
"OrcAVMN/vpXTN2dCLGZXQrsTK9sAWASzIWTiQRzmnwxsQY7y4u2h+k41n8Z5tw03"
+
"wwIDAQAB"
;
@Autowired
public
supervisorController
(
PackageMapper
packageMapper
,
OrderMapper
orderMapper
,
YsmUserMapper
ysmUserMapper
)
{
supervisorController
.
packageMapper
=
packageMapper
;
supervisorController
.
orderMapper
=
orderMapper
;
...
...
@@ -57,7 +79,7 @@ public class supervisorController extends BaseController {
* @param orderId
* @return
*/
@Permission
(
menuname
=
"督导订单详情查询"
,
value
=
"selectOrderInfo"
,
method
=
RequestMethod
.
POST
)
@Permission
(
menuname
=
"督导订单详情查询"
,
value
=
"selectOrderInfo"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
Map
<
String
,
Object
>>
selectOrderInfo
(
@RequestParam
(
"orderId"
)
String
orderId
)
{
/* ShiroUser user = getShiroUser();
if (!user.getRoleNames().stream().anyMatch(roleName -> StringUtils.equalsAny(roleName, "超级管理员"))) {
...
...
@@ -109,7 +131,7 @@ public class supervisorController extends BaseController {
* @param orderId
* @return
*/
@Permission
(
menuname
=
"督导订单置为异常单"
,
value
=
"updateOrderState"
,
method
=
RequestMethod
.
POST
)
@Permission
(
menuname
=
"督导订单置为异常单"
,
value
=
"updateOrderState"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
updateOrderState
(
@RequestParam
(
"orderId"
)
String
orderId
)
{
/* ShiroUser user = getShiroUser();
if (!user.getRoleNames().stream().anyMatch(roleName -> StringUtils.equalsAny(roleName, "超级管理员"))) {
...
...
@@ -145,7 +167,7 @@ public class supervisorController extends BaseController {
* @param type 0 是线上 1是线下
* @return
*/
@Permission
(
menuname
=
"待处理"
,
value
=
"daichuliUpdate"
,
method
=
RequestMethod
.
POST
)
@Permission
(
menuname
=
"待处理"
,
value
=
"daichuliUpdate"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
daiChuLiUpdate
(
@RequestParam
(
"orderId"
)
String
orderId
,
@RequestParam
(
"type"
)
String
type
)
{
/* ShiroUser user = getShiroUser();
if (!user.getRoleNames().stream().anyMatch(roleName -> StringUtils.equalsAny(roleName, "超级管理员"))) {
...
...
@@ -199,8 +221,8 @@ public class supervisorController extends BaseController {
* @param orderId
* @return
*/
@Permission
(
menuname
=
"待选号"
,
value
=
"daiXuanHaoUpdate"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
daiXuanHaoUpdate
(
@RequestParam
(
"orderId"
)
String
orderId
,
@RequestParam
(
"businessNumber"
)
String
businessNumber
,
@RequestParam
(
value
=
"iccid"
,
required
=
false
)
String
iccid
)
{
@Permission
(
menuname
=
"待选号"
,
value
=
"daiXuanHaoUpdate"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
daiXuanHaoUpdate
(
@RequestParam
(
"orderId"
)
String
orderId
,
@RequestParam
(
"businessNumber"
)
String
businessNumber
,
@RequestParam
(
value
=
"iccid"
,
required
=
false
)
String
iccid
)
throws
Exception
{
/* ShiroUser user = getShiroUser();
if (!user.getRoleNames().stream().anyMatch(roleName -> StringUtils.equalsAny(roleName, "超级管理员"))) {
return ResponseData.error("无数据权限");
...
...
@@ -217,19 +239,26 @@ public class supervisorController extends BaseController {
if
(
StringUtils
.
isBlank
(
businessNumber
))
{
return
ResponseData
.
error
(
"请输入办理号码!"
);
}
String
s
=
yZPlaceAnOrder
(
orderId
,
businessNumber
,
iccid
);
Map
map
=
JSON
.
parseObject
(
s
,
Map
.
class
);
if
(
s
==
null
){
return
ResponseData
.
error
(
"选号失败!"
);
//String s = yZPlaceAnOrder(orderId, businessNumber, iccid);
kong
.
unirest
.
HttpResponse
<
String
>
response
=
yZPlaceAnOrder
(
orderId
,
businessNumber
,
iccid
);
//Map map = JSON.parseObject(s, Map.class);
if
(
response
.
getStatus
()
!=
200
)
{
return
ResponseData
.
error
(
"选号失败!下单不成功请联系管理员"
);
}
if
(
map
.
get
(
"msg"
)
!=
null
&&
StringUtils
.
isNotBlank
(
map
.
get
(
"msg"
).
toString
())){
orderMapper
.
inserOrderHis
(
orderId
,
"选号提交失败,"
+
map
.
get
(
"msg"
).
toString
(),
new
Date
(),
"测试"
);
return
ResponseData
.
error
(
map
.
get
(
"msg"
).
toString
());
String
orderNum
=
response
.
getBody
();
JSONObject
queryOrderJsonObject
=
getQueryOrderInfo
(
orderNum
,
1
);
Map
<
String
,
Object
>
map
=
JSONObject
.
parseObject
(
queryOrderJsonObject
.
getString
(
"data"
));
List
<
Object
>
list
=
(
List
<
Object
>)
map
.
get
(
"q"
);
Map
<
String
,
Object
>
q
=
(
Map
<
String
,
Object
>)
list
.
get
(
0
);
Map
<
String
,
Object
>
orderStatus
=
(
Map
<
String
,
Object
>)
q
.
get
(
"订单当前状态"
);
if
(
orderStatus
.
containsKey
(
"订单当前状态|状态备注"
))
{
orderMapper
.
inserOrderHis
(
orderId
,
"选号提交失败,"
+
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
(),
new
Date
(),
"测试"
);
return
ResponseData
.
error
(
orderStatus
.
get
(
"订单当前状态|状态备注"
).
toString
());
}
Wrapper
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"id"
,
orderId
);
Map
<
String
,
Object
>
dataMapping
=
new
HashMap
<>();
dataMapping
.
put
(
"order_id"
,
map
.
get
(
"orderNumber"
).
toString
()
);
dataMapping
.
put
(
"order_id"
,
orderNum
);
if
(
"快递"
.
equals
(
order
.
getSendType
()))
{
dataMapping
.
put
(
"order_status"
,
"审核中"
);
dataMapping
.
put
(
"business_iccid"
,
iccid
);
...
...
@@ -254,7 +283,7 @@ public class supervisorController extends BaseController {
* @param orderId
* @return
*/
@Permission
(
menuname
=
"待配送"
,
value
=
"daiPeiSongUpdate"
,
method
=
RequestMethod
.
POST
)
@Permission
(
menuname
=
"待配送"
,
value
=
"daiPeiSongUpdate"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
daiPeiSongUpdate
(
@RequestParam
(
"orderId"
)
String
orderId
,
@RequestParam
(
"kuaidiOrder"
)
String
kuaidiOrder
,
@RequestParam
(
value
=
"expressDelivery"
)
String
expressDelivery
)
throws
Exception
{
/* ShiroUser user = getShiroUser();
if (!user.getRoleNames().stream().anyMatch(roleName -> StringUtils.equalsAny(roleName, "超级管理员"))) {
...
...
@@ -327,7 +356,7 @@ public class supervisorController extends BaseController {
* @param iccid
* @return
*/
public
String
yZPlaceAnOrder
(
String
orderId
,
String
businessNumber
,
String
iccid
)
{
public
kong
.
unirest
.
HttpResponse
<
String
>
yZPlaceAnOrder
(
String
orderId
,
String
businessNumber
,
String
iccid
)
{
Order
order
=
orderMapper
.
selectById
(
orderId
);
String
s
=
orderMapper
.
selectYsmById
(
order
.
getHehuorenId
());
YsmUser
ysmUser
=
ysmUserMapper
.
selectById
(
s
);
...
...
@@ -343,18 +372,33 @@ public class supervisorController extends BaseController {
map
.
put
(
"iccId"
,
iccid
);
map
.
put
(
"orderPhone"
,
order
.
getBusinessNumber
());
map
.
put
(
"orderNum"
,
order
.
getOrderNumber
());
map
.
put
(
"imgUrl1"
,
order
.
getIdCardz
());
/*
map.put("imgUrl1", order.getIdCardz());
map.put("imgUrl2", order.getIdCardf());
map
.
put
(
"imgUrl3"
,
order
.
getIdCardzs
());
map.put("imgUrl3", order.getIdCardzs());*/
map
.
put
(
"idCardUrl1"
,
order
.
getIdCardz
().
replace
(
"manager"
,
"app"
));
map
.
put
(
"idCardUrl2"
,
order
.
getIdCardf
().
replace
(
"manager"
,
"app"
));
map
.
put
(
"idCardUrl3"
,
order
.
getIdCardzs
().
replace
(
"manager"
,
"app"
));
if
(
order
.
getPackageId
().
equals
(
"49"
))
{
map
.
put
(
"userName"
,
order
.
getParentName
());
map
.
put
(
"imgUrl4"
,
order
.
getIdCardzs
());
map
.
put
(
"idCardUrl4"
,
order
.
getIdCardzs
().
replace
(
"manager"
,
"app"
));
//map.put("imgUrl4", order.getIdCardzs());
}
else
{
map
.
put
(
"userName"
,
order
.
getCustomerName
());
// 客户姓名,必填// 联系人,必填
map
.
put
(
"imgUrl4"
,
order
.
getStudenCard
());
map
.
put
(
"idCardUrl4"
,
order
.
getStudenCard
().
replace
(
"manager"
,
"app"
));
//map.put("imgUrl4", order.getStudenCard());
}
map
.
put
(
"sign"
,
ysmUser
.
getSign
());
map
.
put
(
"cardType"
,
order
.
getKapin
());
map
.
put
(
"cardType"
,
order
.
getKapin
());
map
.
put
(
"address"
,
order
.
getAddress
());
Map
<
String
,
String
>
schoolMap
=
schoolMapper
.
selectByHeHuorenId
(
order
.
getHehuorenId
());
if
(
StringUtils
.
isNotEmpty
(
schoolMap
.
get
(
"lzgh"
))
&&
StringUtils
.
isNotEmpty
(
schoolMap
.
get
(
"lz_user"
)))
{
map
.
put
(
"lzgh"
,
schoolMap
.
get
(
"lzgh"
));
map
.
put
(
"lzUser"
,
schoolMap
.
get
(
"lz_user"
));
}
else
{
map
.
put
(
"lzgh"
,
"44100621"
);
map
.
put
(
"lzUser"
,
"黄友健"
);
}
try
{
OrderManage
orderManage
=
new
OrderManage
();
return
orderManage
.
sendOrder
(
map
);
...
...
@@ -363,4 +407,65 @@ public class supervisorController extends BaseController {
}
return
null
;
}
public
JSONObject
getQueryOrderInfo
(
String
orderNum
,
int
count
)
throws
Exception
{
ObjectMapper
OBJECT_MAPPER
=
new
ObjectMapper
();
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"route"
,
"代理商订单信息查询"
);
data
.
put
(
"代理商账号"
,
"hyoujian"
);
data
.
put
(
"订单编码"
,
orderNum
);
data
.
put
(
"使用人证件号"
,
"440802199006080830"
);
data
.
put
(
"使用人姓名"
,
"黄友健"
);
String
bodyJson
=
JSONObject
.
toJSONString
(
data
);
String
eurl_data
=
URLEncoder
.
encode
(
bodyJson
,
"UTF-8"
);
String
url_data
=
"data="
+
eurl_data
;
// 获得md5串
String
sign
=
MD5Utils
.
md5
(
url_data
);
// 获得小写md5串
sign
=
sign
.
toLowerCase
();
// RSA加密
byte
[]
encodedData
=
RSAUtils
.
encryptByPublicKey
(
sign
,
publicKey
);
sign
=
(
new
BASE64Encoder
()).
encodeBuffer
(
encodedData
);
log
.
info
(
"签名:"
+
sign
);
//去除换行
sign
=
sign
.
replaceAll
(
"\\r|\\n"
,
""
);
log
.
info
(
"签名2 :"
+
sign
);
JSONObject
jsonObject
=
null
;
try
{
log
.
info
(
"提交参数:"
+
data
);
Constant
.
trustEveryone
();
kong
.
unirest
.
HttpResponse
<
String
>
responese
=
Unirest
.
get
(
"http://132.97.20.21/query/query-order-info?"
+
url_data
)
//kong.unirest.HttpResponse<String> responese = Unirest.get("https://applet.mini189.cn/prod/query/query-order-info?" + url_data)
.
header
(
"Content-Type"
,
"application/json"
)
.
header
(
"X-Sign"
,
sign
)
.
asString
();
log
.
info
(
"宽带订单状态查询接口,返回信息:"
+
responese
.
getBody
());
String
body
=
responese
.
getBody
();
jsonObject
=
JSONObject
.
parseObject
(
body
);
Map
<
String
,
Object
>
dataJson
=
(
Map
<
String
,
Object
>)
jsonObject
.
get
(
"data"
);
if
(
StringUtils
.
isEmpty
(
JSON
.
toJSONString
(
dataJson
.
get
(
"q"
))))
{
count
++;
if
(
count
<
20
)
{
getQueryOrderInfo
(
orderNum
,
count
);
}
else
{
log
.
error
(
"宽带订单状态查询接口尝试20次未查询到订单。请重新下单或检查下单接口"
);
}
}
}
catch
(
ResourceAccessException
s
)
{
count
++;
if
(
count
<
20
)
{
getQueryOrderInfo
(
orderNum
,
count
);
}
else
{
log
.
error
(
"单宽订单状态查询接口尝试20次失误。请检查接口"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"接口异常 "
+
e
.
getMessage
());
e
.
printStackTrace
();
}
return
jsonObject
;
}
}
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