Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
d01122a2
Commit
d01122a2
authored
Mar 24, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug处理
parent
ca886b87
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
87 additions
and
57 deletions
+87
-57
LicenceOrderApiService.java
...an/manage/api/service/licence/LicenceOrderApiService.java
+3
-1
TabHaobanLicenceOrderMapper.java
...rvice/dao/mapper/licence/TabHaobanLicenceOrderMapper.java
+4
-1
LicenceOrderService.java
...n/manage/service/service/licence/LicenceOrderService.java
+3
-1
LicenceOrderServiceImpl.java
...service/service/licence/impl/LicenceOrderServiceImpl.java
+4
-2
LicenceOrderApiServiceImpl.java
.../service/out/impl/licence/LicenceOrderApiServiceImpl.java
+14
-4
TabHaobanLicenceOrderMapper.xml
.../resources/mapper/licence/TabHaobanLicenceOrderMapper.xml
+3
-0
LicenceOrderController.java
...manage/web/controller/licence/LicenceOrderController.java
+56
-48
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/licence/LicenceOrderApiService.java
View file @
d01122a2
...
@@ -7,6 +7,8 @@ import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO;
...
@@ -7,6 +7,8 @@ import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO;
import
com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO
;
import
java.util.Date
;
/**
/**
* <p>
* <p>
* 服务类
* 服务类
...
@@ -100,7 +102,7 @@ public interface LicenceOrderApiService {
...
@@ -100,7 +102,7 @@ public interface LicenceOrderApiService {
* @param wxOrderId 微信支付id
* @param wxOrderId 微信支付id
* @return
* @return
*/
*/
ServiceResponse
<
Boolean
>
saveTransactionCode
(
Long
orderId
,
String
transactionCode
,
String
prepayId
,
String
wxOrderId
);
ServiceResponse
<
Boolean
>
saveTransactionCode
(
Long
orderId
,
String
transactionCode
,
String
prepayId
,
String
wxOrderId
,
Date
payTime
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/licence/TabHaobanLicenceOrderMapper.java
View file @
d01122a2
...
@@ -4,6 +4,8 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
...
@@ -4,6 +4,8 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
import
com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder
;
import
com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
javax.xml.crypto.Data
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -84,7 +86,8 @@ public interface TabHaobanLicenceOrderMapper {
...
@@ -84,7 +86,8 @@ public interface TabHaobanLicenceOrderMapper {
List
<
TabHaobanLicenceOrder
>
getLicenceOrderPage
(
LicenceOrderPageQDTO
licenceOrderPageQDTO
);
List
<
TabHaobanLicenceOrder
>
getLicenceOrderPage
(
LicenceOrderPageQDTO
licenceOrderPageQDTO
);
Integer
saveTransactionCode
(
@Param
(
"orderId"
)
Long
orderId
,
@Param
(
"transactionCode"
)
String
transactionCode
,
@Param
(
"prepayId"
)
String
prepayId
,
@Param
(
"wxOrderId"
)
String
wxOrderId
);
Integer
saveTransactionCode
(
@Param
(
"orderId"
)
Long
orderId
,
@Param
(
"transactionCode"
)
String
transactionCode
,
@Param
(
"prepayId"
)
String
prepayId
,
@Param
(
"wxOrderId"
)
String
wxOrderId
,
@Param
(
"payTime"
)
Date
payTime
);
/**
/**
* 获取订单详情
* 获取订单详情
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/licence/LicenceOrderService.java
View file @
d01122a2
...
@@ -7,6 +7,8 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
...
@@ -7,6 +7,8 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
import
com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder
;
import
com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
/**
/**
* <p>
* <p>
* 企业微信许可账号购买
* 企业微信许可账号购买
...
@@ -84,7 +86,7 @@ public interface LicenceOrderService {
...
@@ -84,7 +86,7 @@ public interface LicenceOrderService {
* @param wxOrderId 微信支付id
* @param wxOrderId 微信支付id
* @return
* @return
*/
*/
Integer
saveTransactionCode
(
Long
orderId
,
String
transactionCode
,
String
prepayId
,
String
wxOrderId
);
Integer
saveTransactionCode
(
Long
orderId
,
String
transactionCode
,
String
prepayId
,
String
wxOrderId
,
Date
payTime
);
/**
/**
* 查询微信订单详情
* 查询微信订单详情
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/licence/impl/LicenceOrderServiceImpl.java
View file @
d01122a2
...
@@ -66,6 +66,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
...
@@ -66,6 +66,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
TabHaobanLicenceOrder
order
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
licenceOrderQDTO
),
TabHaobanLicenceOrder
.
class
);
TabHaobanLicenceOrder
order
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
licenceOrderQDTO
),
TabHaobanLicenceOrder
.
class
);
Date
now
=
new
Date
();
Date
now
=
new
Date
();
order
.
setOrderId
(
orderId
);
order
.
setOrderId
(
orderId
);
//默认支付状态为待支付
order
.
setOrderStatus
(
0
);
order
.
setCreateTime
(
now
);
order
.
setCreateTime
(
now
);
order
.
setUpdateTime
(
now
);
order
.
setUpdateTime
(
now
);
Date
expireTime
;
Date
expireTime
;
...
@@ -208,8 +210,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
...
@@ -208,8 +210,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
}
}
@Override
@Override
public
Integer
saveTransactionCode
(
Long
orderId
,
String
transactionCode
,
String
prepayId
,
String
wxOrderId
)
{
public
Integer
saveTransactionCode
(
Long
orderId
,
String
transactionCode
,
String
prepayId
,
String
wxOrderId
,
Date
payTime
)
{
return
tabHaobanLicenceOrderMapper
.
saveTransactionCode
(
orderId
,
transactionCode
,
prepayId
,
wxOrderId
);
return
tabHaobanLicenceOrderMapper
.
saveTransactionCode
(
orderId
,
transactionCode
,
prepayId
,
wxOrderId
,
payTime
);
}
}
@Override
@Override
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/licence/LicenceOrderApiServiceImpl.java
View file @
d01122a2
...
@@ -174,11 +174,21 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
...
@@ -174,11 +174,21 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
String
orderId
=
object
.
getString
(
"orderId"
);
String
orderId
=
object
.
getString
(
"orderId"
);
String
transactionId
=
object
.
getString
(
"transactionId"
);
String
transactionId
=
object
.
getString
(
"transactionId"
);
String
timeEnd
=
object
.
getString
(
"timeEnd"
);
String
timeEnd
=
object
.
getString
(
"timeEnd"
);
TabHaobanLicenceOrder
licenceOrder
=
licenceOrderService
.
selectByTransactionId
(
transactionId
);
TabHaobanLicenceOrder
licenceOrder
=
licenceOrderService
.
selectByTransactionId
(
orderId
);
if
(
licenceOrder
==
null
){
logger
.
info
(
"微信回调的订单编号:{}异常!!"
,
orderId
);
return
ServiceResponse
.
success
(
false
);
}
if
(
licenceOrder
.
getOrderStatus
()
==
1
){
//微信会多次回调
logger
.
info
(
"微信回调的订单已处理!"
);
return
ServiceResponse
.
success
(
false
);
}
Date
payTime
=
DateUtil
.
strToDate
(
DateUtil
.
FORMAT_DATETIME_14
,
timeEnd
);
//更新订单状态
//更新订单状态
licenceOrderService
.
updateLicenceOrderType
(
licenceOrder
.
getOrderId
(),
1
,
licenceOrder
.
getEnterpriseId
(),
licenceOrder
.
getWxEnterpriseId
(),
"系统"
,
1
);
licenceOrderService
.
updateLicenceOrderType
(
licenceOrder
.
getOrderId
(),
1
,
licenceOrder
.
getEnterpriseId
(),
licenceOrder
.
getWxEnterpriseId
(),
"系统"
,
1
);
//保存微信订单id
//保存微信订单id
licenceOrderService
.
saveTransactionCode
(
licenceOrder
.
getOrderId
(),
null
,
null
,
orderId
);
licenceOrderService
.
saveTransactionCode
(
licenceOrder
.
getOrderId
(),
null
,
null
,
transactionId
,
payTime
);
//生成企业微信订单
//生成企业微信订单
// payLicenceOrder(licenceOrder.getOrderId(),licenceOrder.getWxEnterpriseId());
// payLicenceOrder(licenceOrder.getOrderId(),licenceOrder.getWxEnterpriseId());
//查询gic品牌名称
//查询gic品牌名称
...
@@ -225,8 +235,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
...
@@ -225,8 +235,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
}
}
@Override
@Override
public
ServiceResponse
<
Boolean
>
saveTransactionCode
(
Long
orderId
,
String
transactionCode
,
String
prepayId
,
String
wxOrderId
)
{
public
ServiceResponse
<
Boolean
>
saveTransactionCode
(
Long
orderId
,
String
transactionCode
,
String
prepayId
,
String
wxOrderId
,
Date
payTime
)
{
licenceOrderService
.
saveTransactionCode
(
orderId
,
transactionCode
,
prepayId
,
wxOrderId
);
licenceOrderService
.
saveTransactionCode
(
orderId
,
transactionCode
,
prepayId
,
wxOrderId
,
payTime
);
return
ServiceResponse
.
success
(
true
);
return
ServiceResponse
.
success
(
true
);
}
}
}
}
haoban-manage3-service/src/main/resources/mapper/licence/TabHaobanLicenceOrderMapper.xml
View file @
d01122a2
...
@@ -243,6 +243,9 @@
...
@@ -243,6 +243,9 @@
<if
test=
"wxOrderId != null"
>
<if
test=
"wxOrderId != null"
>
wx_order_id = #{wxOrderId},
wx_order_id = #{wxOrderId},
</if>
</if>
<if
test=
"payTime != null"
>
pay_time = #{payTime},
</if>
update_time = now()
update_time = now()
WHERE order_id = #{orderId}
WHERE order_id = #{orderId}
and delete_flag = 0
and delete_flag = 0
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/licence/LicenceOrderController.java
View file @
d01122a2
...
@@ -28,11 +28,9 @@ import com.gic.haoban.manage.web.qo.licence.LicenceOrderPageQO;
...
@@ -28,11 +28,9 @@ import com.gic.haoban.manage.web.qo.licence.LicenceOrderPageQO;
import
com.gic.haoban.manage.web.qo.licence.LicenceOrderQO
;
import
com.gic.haoban.manage.web.qo.licence.LicenceOrderQO
;
import
com.gic.haoban.manage.web.vo.licence.LicenceOrderPageVO
;
import
com.gic.haoban.manage.web.vo.licence.LicenceOrderPageVO
;
import
com.gic.haoban.manage.web.vo.licence.LicenceOrderVO
;
import
com.gic.haoban.manage.web.vo.licence.LicenceOrderVO
;
import
com.gic.marketing.api.service.EnterpriseAccountInfoApiService
;
import
com.gic.thirdparty.api.dto.ScanPayReqDataDTO
;
import
com.gic.thirdparty.api.dto.ScanPayReqDataDTO
;
import
com.gic.thirdparty.api.dto.ScanPayResDataDTO
;
import
com.gic.thirdparty.api.dto.ScanPayResDataDTO
;
import
com.gic.thirdparty.api.service.Pay4WXService
;
import
com.gic.thirdparty.api.service.Pay4WXService
;
import
com.gic.thirdparty.api.service.RechargeCenterService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
...
@@ -49,6 +47,7 @@ import java.util.Map;
...
@@ -49,6 +47,7 @@ import java.util.Map;
/**
/**
* 企业微信许可账号购买
* 企业微信许可账号购买
*
* @author jx
* @author jx
* @since 2023-03-09
* @since 2023-03-09
*/
*/
...
@@ -68,46 +67,49 @@ public class LicenceOrderController {
...
@@ -68,46 +67,49 @@ public class LicenceOrderController {
private
Pay4WXService
pay4WXService
;
private
Pay4WXService
pay4WXService
;
@Autowired
@Autowired
private
Config
config
;
private
Config
config
;
/**
/**
* 查询订单详情
* 查询订单详情
*/
*/
@RequestMapping
(
"licence-order-detail"
)
@RequestMapping
(
"licence-order-detail"
)
public
RestResponse
<
LicenceOrderVO
>
getLicenceOrderDetail
(
@RequestParam
Long
orderId
)
{
public
RestResponse
<
LicenceOrderVO
>
getLicenceOrderDetail
(
@RequestParam
Long
orderId
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
())){
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
}
ServiceResponse
<
LicenceOrderDTO
>
licenceOrderDetail
=
licenceOrderApiService
.
getLicenceOrderDetail
(
orderId
,
1
);
ServiceResponse
<
LicenceOrderDTO
>
licenceOrderDetail
=
licenceOrderApiService
.
getLicenceOrderDetail
(
orderId
,
1
);
LicenceOrderVO
licenceOrderVO
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
licenceOrderDetail
.
getResult
()),
LicenceOrderVO
.
class
);
LicenceOrderVO
licenceOrderVO
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
licenceOrderDetail
.
getResult
()),
LicenceOrderVO
.
class
);
return
RestResponse
.
successResult
(
licenceOrderVO
);
return
RestResponse
.
successResult
(
licenceOrderVO
);
}
}
/**
/**
* 删除订单
* 删除订单
*/
*/
@RequestMapping
(
"licence-order-delete"
)
@RequestMapping
(
"licence-order-delete"
)
public
RestResponse
<
Boolean
>
deleteLicenceOrder
(
@RequestParam
Long
orderId
)
{
public
RestResponse
<
Boolean
>
deleteLicenceOrder
(
@RequestParam
Long
orderId
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
())){
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
}
ServiceResponse
<
Boolean
>
booleanServiceResponse
=
licenceOrderApiService
.
deleteLicenceOrder
(
orderId
);
ServiceResponse
<
Boolean
>
booleanServiceResponse
=
licenceOrderApiService
.
deleteLicenceOrder
(
orderId
);
return
RestResponse
.
successResult
(
booleanServiceResponse
.
getResult
());
return
RestResponse
.
successResult
(
booleanServiceResponse
.
getResult
());
}
}
/**
/**
* 新增或者修改订单
* 新增或者修改订单
*/
*/
@RequestMapping
(
"licence-order-saveOrUpdate"
)
@RequestMapping
(
"licence-order-saveOrUpdate"
)
public
RestResponse
<
String
>
saveOrUpdateLicenceOrder
(
@RequestBody
LicenceOrderQO
licenceOrderQO
)
{
public
RestResponse
<
String
>
saveOrUpdateLicenceOrder
(
@RequestBody
LicenceOrderQO
licenceOrderQO
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
())){
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
}
//金额校验
//金额校验
Integer
integer
=
licenceOrderQO
.
checkPrice
();
Integer
integer
=
licenceOrderQO
.
checkPrice
();
if
(
integer
==-
1
)
{
if
(
integer
==
-
1
)
{
return
RestResponse
.
failure
(
"-9999"
,
"许可账号数量有误!"
);
return
RestResponse
.
failure
(
"-9999"
,
"许可账号数量有误!"
);
}
else
if
(
integer
==
0
)
{
}
else
if
(
integer
==
0
)
{
return
RestResponse
.
failure
(
"-9999"
,
"购买金额计算有误!"
);
return
RestResponse
.
failure
(
"-9999"
,
"购买金额计算有误!"
);
}
}
LicenceOrderQDTO
licenceOrderQDTO
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
licenceOrderQO
),
LicenceOrderQDTO
.
class
);
LicenceOrderQDTO
licenceOrderQDTO
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
licenceOrderQO
),
LicenceOrderQDTO
.
class
);
licenceOrderQDTO
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
licenceOrderQDTO
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
...
@@ -117,14 +119,15 @@ public class LicenceOrderController {
...
@@ -117,14 +119,15 @@ public class LicenceOrderController {
String
result
=
licenceOrderApiService
.
saveOrUpdateLicenceOrder
(
licenceOrderQDTO
).
getResult
();
String
result
=
licenceOrderApiService
.
saveOrUpdateLicenceOrder
(
licenceOrderQDTO
).
getResult
();
return
RestResponse
.
successResult
(
result
);
return
RestResponse
.
successResult
(
result
);
}
}
/**
/**
* 分页查询订单列表
* 分页查询订单列表
*/
*/
@RequestMapping
(
"licence-order-page"
)
@RequestMapping
(
"licence-order-page"
)
public
RestResponse
<
Page
<
LicenceOrderPageVO
>>
getLicenceOrderPage
(
@RequestBody
LicenceOrderPageQO
licenceOrderPageQO
)
{
public
RestResponse
<
Page
<
LicenceOrderPageVO
>>
getLicenceOrderPage
(
@RequestBody
LicenceOrderPageQO
licenceOrderPageQO
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
())){
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
}
String
enterpriseId
=
loginUser
.
getEnterpriseId
();
String
enterpriseId
=
loginUser
.
getEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
...
@@ -137,51 +140,54 @@ public class LicenceOrderController {
...
@@ -137,51 +140,54 @@ public class LicenceOrderController {
Page
<
LicenceOrderPageVO
>
result
=
PageHelperUtils
.
changePageToCurrentPage
(
licenceOrderPage
.
getResult
(),
LicenceOrderPageVO
.
class
);
Page
<
LicenceOrderPageVO
>
result
=
PageHelperUtils
.
changePageToCurrentPage
(
licenceOrderPage
.
getResult
(),
LicenceOrderPageVO
.
class
);
return
RestResponse
.
successResult
(
result
);
return
RestResponse
.
successResult
(
result
);
}
}
/**
/**
* 取消订单/订单已经过期
* 取消订单/订单已经过期
*/
*/
@RequestMapping
(
"licence-order-cancel"
)
@RequestMapping
(
"licence-order-cancel"
)
public
RestResponse
<
Boolean
>
cancelLicenceOrder
(
@RequestParam
Long
orderId
,
Integer
type
)
{
public
RestResponse
<
Boolean
>
cancelLicenceOrder
(
@RequestParam
Long
orderId
,
Integer
type
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
())){
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
}
String
enterpriseId
=
loginUser
.
getEnterpriseId
();
String
enterpriseId
=
loginUser
.
getEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
clerkName
=
loginUser
.
getClerkName
();
String
clerkName
=
loginUser
.
getClerkName
();
Boolean
result
=
licenceOrderApiService
.
updateLicenceOrderType
(
orderId
,
type
,
enterpriseId
,
wxEnterpriseId
,
clerkName
,
1
).
getResult
();
Boolean
result
=
licenceOrderApiService
.
updateLicenceOrderType
(
orderId
,
type
,
enterpriseId
,
wxEnterpriseId
,
clerkName
,
1
).
getResult
();
return
RestResponse
.
successResult
(
result
);
return
RestResponse
.
successResult
(
result
);
}
}
/**
/**
* 订单凭证上传
* 订单凭证上传
*/
*/
@RequestMapping
(
"licence-order-voucher-upload"
)
@RequestMapping
(
"licence-order-voucher-upload"
)
public
RestResponse
<
Boolean
>
uploadLicenceOrderVoucher
(
@RequestParam
Long
orderId
,
String
voucher
)
{
public
RestResponse
<
Boolean
>
uploadLicenceOrderVoucher
(
@RequestParam
Long
orderId
,
String
voucher
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
())){
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
}
String
enterpriseId
=
loginUser
.
getEnterpriseId
();
String
enterpriseId
=
loginUser
.
getEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
clerkName
=
loginUser
.
getClerkName
();
String
clerkName
=
loginUser
.
getClerkName
();
Boolean
result
=
licenceOrderApiService
.
uploadLicenceOrderVoucher
(
orderId
,
voucher
,
enterpriseId
,
wxEnterpriseId
,
clerkName
).
getResult
();
Boolean
result
=
licenceOrderApiService
.
uploadLicenceOrderVoucher
(
orderId
,
voucher
,
enterpriseId
,
wxEnterpriseId
,
clerkName
).
getResult
();
return
RestResponse
.
successResult
(
result
);
return
RestResponse
.
successResult
(
result
);
}
}
/**
/**
* 支付订单
* 支付订单
*/
*/
@RequestMapping
(
"licence-order-pay-1"
)
@RequestMapping
(
"licence-order-pay-1"
)
public
RestResponse
<
Map
<
String
,
Object
>>
payLicenceOrder
(
@RequestParam
Long
orderId
)
{
public
RestResponse
<
Map
<
String
,
Object
>>
payLicenceOrder
(
@RequestParam
Long
orderId
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
())){
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
}
LicenceOrderDTO
result
=
licenceOrderApiService
.
getLicenceOrderDetail
(
orderId
,
1
).
getResult
();
LicenceOrderDTO
result
=
licenceOrderApiService
.
getLicenceOrderDetail
(
orderId
,
1
).
getResult
();
if
(
result
==
null
){
if
(
result
==
null
)
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_5
.
getCode
()),
HaoBanErrCode
.
ERR_5
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_5
.
getCode
()),
HaoBanErrCode
.
ERR_5
.
getMsg
());
}
}
Integer
money
=
result
.
getPrice
();
Integer
money
=
result
.
getPrice
();
if
(
null
!=
loginUser
.
getPhoneNumber
()
&&
Arrays
.
asList
(
"13456789987"
,
"13429152802"
).
contains
(
loginUser
.
getPhoneNumber
()))
{
if
(
null
!=
loginUser
.
getPhoneNumber
()
&&
Arrays
.
asList
(
"13456789987"
,
"13429152802"
).
contains
(
loginUser
.
getPhoneNumber
()))
{
//测试账号付款一分
//测试账号付款一分
money
=
1
;
money
=
1
;
}
}
...
@@ -197,37 +203,38 @@ public class LicenceOrderController {
...
@@ -197,37 +203,38 @@ public class LicenceOrderController {
int
lastIndex
=
host
.
lastIndexOf
(
"/"
);
int
lastIndex
=
host
.
lastIndexOf
(
"/"
);
// 倒数第二个分隔符位置
// 倒数第二个分隔符位置
int
secondLastIndex
=
host
.
lastIndexOf
(
"/"
,
lastIndex
-
1
);
int
secondLastIndex
=
host
.
lastIndexOf
(
"/"
,
lastIndex
-
1
);
String
subHost
=
host
.
substring
(
0
,
secondLastIndex
+
1
);
String
subHost
=
host
.
substring
(
0
,
secondLastIndex
+
1
);
String
url
=
subHost
+
"gic-thirdparty/weixin_payment_result_notice_qywx"
;
String
url
=
subHost
+
"gic-thirdparty/weixin_payment_result_notice_qywx"
;
scanPayReqData
.
setNotify_url
(
url
);
scanPayReqData
.
setNotify_url
(
url
);
ScanPayResDataDTO
prePaymentOrderForQYWX
=
pay4WXService
.
createPrePaymentOrderForQYWX
(
scanPayReqData
);
ScanPayResDataDTO
prePaymentOrderForQYWX
=
pay4WXService
.
createPrePaymentOrderForQYWX
(
scanPayReqData
);
logger
.
info
(
"微信预支付返回信息:{}"
,
JSON
.
toJSONString
(
prePaymentOrderForQYWX
));
logger
.
info
(
"微信预支付返回信息:{}"
,
JSON
.
toJSONString
(
prePaymentOrderForQYWX
));
if
(
prePaymentOrderForQYWX
==
null
)
{
if
(
prePaymentOrderForQYWX
==
null
)
{
logger
.
info
(
"微信预支付订单二维码生成失败!!"
);
logger
.
info
(
"微信预支付订单二维码生成失败!!"
);
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_100034
.
getCode
()),
HaoBanErrCode
.
ERR_100034
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_100034
.
getCode
()),
HaoBanErrCode
.
ERR_100034
.
getMsg
());
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"transactionCode"
,
transactionCode
);
map
.
put
(
"transactionCode"
,
transactionCode
);
map
.
put
(
"url"
,
prePaymentOrderForQYWX
.
getCode_url
());
map
.
put
(
"url"
,
prePaymentOrderForQYWX
.
getCode_url
());
map
.
put
(
"money"
,
money
);
map
.
put
(
"money"
,
money
);
//记录订单号transactionCode和预支付交易会话标识
//记录订单号transactionCode和预支付交易会话标识
licenceOrderApiService
.
saveTransactionCode
(
orderId
,
transactionCode
,
prePaymentOrderForQYWX
.
getPrepay_id
(),
null
);
licenceOrderApiService
.
saveTransactionCode
(
orderId
,
transactionCode
,
prePaymentOrderForQYWX
.
getPrepay_id
(),
null
,
null
);
return
RestResponse
.
successResult
(
map
);
return
RestResponse
.
successResult
(
map
);
}
}
/**
/**
* 支付订单-判断是否支付成功
* 支付订单-判断是否支付成功
*/
*/
@RequestMapping
(
"licence-order-pay-2"
)
@RequestMapping
(
"licence-order-pay-2"
)
public
RestResponse
<
Boolean
>
payLicenceOrder2
(
@RequestParam
Long
orderId
)
{
public
RestResponse
<
Boolean
>
payLicenceOrder2
(
@RequestParam
Long
orderId
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
())){
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
}
LicenceOrderDTO
result
=
licenceOrderApiService
.
getLicenceOrderDetail
(
orderId
,
1
).
getResult
();
LicenceOrderDTO
result
=
licenceOrderApiService
.
getLicenceOrderDetail
(
orderId
,
1
).
getResult
();
if
(
result
==
null
){
if
(
result
==
null
)
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_5
.
getCode
()),
HaoBanErrCode
.
ERR_5
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_5
.
getCode
()),
HaoBanErrCode
.
ERR_5
.
getMsg
());
}
}
if
(
result
.
getOrderStatus
()
==
1
){
if
(
result
.
getOrderStatus
()
==
1
)
{
return
RestResponse
.
successResult
(
true
);
return
RestResponse
.
successResult
(
true
);
}
}
return
RestResponse
.
successResult
(
false
);
return
RestResponse
.
successResult
(
false
);
...
@@ -239,31 +246,32 @@ public class LicenceOrderController {
...
@@ -239,31 +246,32 @@ public class LicenceOrderController {
@RequestMapping
(
"get-enterprise-name"
)
@RequestMapping
(
"get-enterprise-name"
)
public
RestResponse
<
HashMap
<
String
,
String
>>
getEnterpriseName
()
{
public
RestResponse
<
HashMap
<
String
,
String
>>
getEnterpriseName
()
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
())){
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
}
HashMap
<
String
,
String
>
result
=
new
HashMap
<>(
8
);
HashMap
<
String
,
String
>
result
=
new
HashMap
<>(
8
);
//查询gic品牌名称
//查询gic品牌名称
EnterpriseDTO
enterpriseDTO
=
enterpriseService
.
getEnterpriseById
(
loginUser
.
getEnterpriseId
());
EnterpriseDTO
enterpriseDTO
=
enterpriseService
.
getEnterpriseById
(
loginUser
.
getEnterpriseId
());
if
(
ObjectUtil
.
isNotNull
(
enterpriseDTO
)){
if
(
ObjectUtil
.
isNotNull
(
enterpriseDTO
))
{
logger
.
info
(
"gic企业查询返回实体:{}"
,
JSON
.
toJSONString
(
enterpriseDTO
));
logger
.
info
(
"gic企业查询返回实体:{}"
,
JSON
.
toJSONString
(
enterpriseDTO
));
result
.
put
(
"enterpriseName"
,
enterpriseDTO
.
getEnterpriseName
());
result
.
put
(
"enterpriseName"
,
enterpriseDTO
.
getEnterpriseName
());
}
}
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
loginUser
.
getWxEnterpriseId
());
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
loginUser
.
getWxEnterpriseId
());
if
(
ObjectUtil
.
isNotNull
(
wxEnterpriseDTO
)){
if
(
ObjectUtil
.
isNotNull
(
wxEnterpriseDTO
))
{
logger
.
info
(
"企业微信查询返回实体:{}"
,
JSON
.
toJSONString
(
wxEnterpriseDTO
));
logger
.
info
(
"企业微信查询返回实体:{}"
,
JSON
.
toJSONString
(
wxEnterpriseDTO
));
result
.
put
(
"wxEnterpriseName"
,
wxEnterpriseDTO
.
getCorpName
());
result
.
put
(
"wxEnterpriseName"
,
wxEnterpriseDTO
.
getCorpName
());
}
}
return
RestResponse
.
successResult
(
result
);
return
RestResponse
.
successResult
(
result
);
}
}
/**
/**
* 查询企业是否存在未支付订单
* 查询企业是否存在未支付订单
*/
*/
@RequestMapping
(
"licence-order-isPay"
)
@RequestMapping
(
"licence-order-isPay"
)
public
RestResponse
<
String
>
isPayLicenceOrder
()
{
public
RestResponse
<
String
>
isPayLicenceOrder
()
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
())){
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
}
ServiceResponse
<
String
>
payLicenceOrder
=
licenceOrderApiService
.
isPayLicenceOrder
(
loginUser
.
getWxEnterpriseId
());
ServiceResponse
<
String
>
payLicenceOrder
=
licenceOrderApiService
.
isPayLicenceOrder
(
loginUser
.
getWxEnterpriseId
());
return
RestResponse
.
successResult
(
payLicenceOrder
.
getResult
());
return
RestResponse
.
successResult
(
payLicenceOrder
.
getResult
());
...
...
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