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
e1ce4de9
Commit
e1ce4de9
authored
Jun 26, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应用订单购买接口
parent
c81919ca
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
568 additions
and
51 deletions
+568
-51
AppOrderApiService.java
...haoban/manage/api/service/licence/AppOrderApiService.java
+11
-0
LicenceOrderApiService.java
...an/manage/api/service/licence/LicenceOrderApiService.java
+1
-1
LicenceOrderController.java
.../haoban/manage/web/controller/LicenceOrderController.java
+1
-1
Config.java
...ain/java/com/gic/haoban/manage/service/config/Config.java
+34
-0
TabHaobanAppOrderMapper.java
...an/manage/service/dao/mapper/TabHaobanAppOrderMapper.java
+8
-8
TabHaobanAppOrder.java
...m/gic/haoban/manage/service/entity/TabHaobanAppOrder.java
+12
-1
LicenceOrderService.java
...n/manage/service/service/licence/LicenceOrderService.java
+1
-1
LicenceOrderServiceImpl.java
...service/service/licence/impl/LicenceOrderServiceImpl.java
+7
-1
AppOrderApiServiceImpl.java
...vice/service/out/impl/licence/AppOrderApiServiceImpl.java
+19
-0
SignatureGetterUtil.java
...m/gic/haoban/manage/service/util/SignatureGetterUtil.java
+77
-0
TabHaobanAppOrderMapper.xml
...ice/src/main/resources/mapper/TabHaobanAppOrderMapper.xml
+24
-35
AppOrderController.java
...ban/manage/web/controller/licence/AppOrderController.java
+108
-0
LicenceOrderController.java
...manage/web/controller/licence/LicenceOrderController.java
+5
-3
AppOrderPageQO.java
.../com/gic/haoban/manage/web/qo/licence/AppOrderPageQO.java
+31
-0
AppOrderQO.java
...java/com/gic/haoban/manage/web/qo/licence/AppOrderQO.java
+42
-0
AppOrderCheckVO.java
...com/gic/haoban/manage/web/vo/licence/AppOrderCheckVO.java
+47
-0
AppOrderNoticeVO.java
...om/gic/haoban/manage/web/vo/licence/AppOrderNoticeVO.java
+40
-0
AppOrderPageVO.java
.../com/gic/haoban/manage/web/vo/licence/AppOrderPageVO.java
+100
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/licence/AppOrderApiService.java
0 → 100644
View file @
e1ce4de9
package
com
.
gic
.
haoban
.
manage
.
api
.
service
.
licence
;
/**
* @description: 订单应用购买
* @Author: wenhua
* @Date: 2023/6/25 15:43
*/
public
interface
AppOrderApiService
{
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/licence/LicenceOrderApiService.java
View file @
e1ce4de9
...
@@ -115,7 +115,7 @@ public interface LicenceOrderApiService {
...
@@ -115,7 +115,7 @@ public interface LicenceOrderApiService {
* 查询订单编号id
* 查询订单编号id
*
*
* @param param 查询参数
* @param param 查询参数
* @param type 0 订单编号 1 企业微信订单编号 2微信订单编号
* @param type 0 订单编号 1 企业微信订单编号 2微信订单编号
3付费应用企业微信订单编号
* @param wxEnterpriseId
* @param wxEnterpriseId
* @return
* @return
*/
*/
...
...
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/LicenceOrderController.java
View file @
e1ce4de9
...
@@ -154,7 +154,7 @@ public class LicenceOrderController {
...
@@ -154,7 +154,7 @@ public class LicenceOrderController {
* 订单编号和企业微信订单编号模糊搜索
* 订单编号和企业微信订单编号模糊搜索
*
*
* @param param 模糊查询
* @param param 模糊查询
* @param type 0 订单编号 1 企业微信订单编号 2微信订单编号
* @param type 0 订单编号 1 企业微信订单编号 2微信订单编号
3付费应用企业微信订单编号
* @return
* @return
*/
*/
@RequestMapping
(
"get-order-id-list"
)
@RequestMapping
(
"get-order-id-list"
)
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/config/Config.java
View file @
e1ce4de9
...
@@ -44,6 +44,40 @@ public class Config {
...
@@ -44,6 +44,40 @@ public class Config {
@Value
(
"${dingUrl}"
)
@Value
(
"${dingUrl}"
)
private
String
dingUrl
;
private
String
dingUrl
;
/**
* 企业微信付费应用购买信息
*/
@Value
(
"${qywxCashierSecret}"
)
private
String
qywxCashierSecret
;
@Value
(
"${promotionCaseId}"
)
private
String
promotionCaseId
;
@Value
(
"${promotionCaseName}"
)
private
String
promotionCaseName
;
public
String
getQywxCashierSecret
()
{
return
qywxCashierSecret
;
}
public
void
setQywxCashierSecret
(
String
qywxCashierSecret
)
{
this
.
qywxCashierSecret
=
qywxCashierSecret
;
}
public
String
getPromotionCaseId
()
{
return
promotionCaseId
;
}
public
void
setPromotionCaseId
(
String
promotionCaseId
)
{
this
.
promotionCaseId
=
promotionCaseId
;
}
public
String
getPromotionCaseName
()
{
return
promotionCaseName
;
}
public
void
setPromotionCaseName
(
String
promotionCaseName
)
{
this
.
promotionCaseName
=
promotionCaseName
;
}
public
String
getDingUrl
()
{
public
String
getDingUrl
()
{
return
dingUrl
;
return
dingUrl
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanAppOrderMapper.java
View file @
e1ce4de9
...
@@ -54,14 +54,6 @@ public interface TabHaobanAppOrderMapper {
...
@@ -54,14 +54,6 @@ public interface TabHaobanAppOrderMapper {
*/
*/
int
insertBatch
(
@Param
(
"entities"
)
List
<
TabHaobanAppOrder
>
entities
);
int
insertBatch
(
@Param
(
"entities"
)
List
<
TabHaobanAppOrder
>
entities
);
/**
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
*
* @param entities List<TabHaobanAppOrder> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
*/
int
insertOrUpdateBatch
(
@Param
(
"entities"
)
List
<
TabHaobanAppOrder
>
entities
);
/**
/**
* 修改数据
* 修改数据
...
@@ -79,5 +71,13 @@ public interface TabHaobanAppOrderMapper {
...
@@ -79,5 +71,13 @@ public interface TabHaobanAppOrderMapper {
*/
*/
int
deleteById
(
Long
id
);
int
deleteById
(
Long
id
);
/**
* 查询企业微信订单id
* @param qywxOrderId
* @param wxEnterpriseId
* @return
*/
List
<
String
>
getQywxOrderId
(
@Param
(
"qywxOrderId"
)
String
qywxOrderId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanAppOrder.java
View file @
e1ce4de9
...
@@ -28,7 +28,7 @@ public class TabHaobanAppOrder implements Serializable {
...
@@ -28,7 +28,7 @@ public class TabHaobanAppOrder implements Serializable {
*/
*/
private
Integer
orderStatus
;
private
Integer
orderStatus
;
/**
/**
* 订单类型 0 新购、1
续期、2 扩容
* 订单类型 0 新购、1
扩容、2 续期
*/
*/
private
Integer
orderType
;
private
Integer
orderType
;
/**
/**
...
@@ -83,7 +83,18 @@ public class TabHaobanAppOrder implements Serializable {
...
@@ -83,7 +83,18 @@ public class TabHaobanAppOrder implements Serializable {
* 创建人名称
* 创建人名称
*/
*/
private
String
creatorName
;
private
String
creatorName
;
/**
* 订单支付到期时间
*/
private
Date
expireTime
;
public
Date
getExpireTime
()
{
return
expireTime
;
}
public
void
setExpireTime
(
Date
expireTime
)
{
this
.
expireTime
=
expireTime
;
}
public
Long
getId
()
{
public
Long
getId
()
{
return
id
;
return
id
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/licence/LicenceOrderService.java
View file @
e1ce4de9
...
@@ -117,7 +117,7 @@ public interface LicenceOrderService {
...
@@ -117,7 +117,7 @@ public interface LicenceOrderService {
/**
/**
* 查询订单编号id
* 查询订单编号id
* @param param 查询参数
* @param param 查询参数
* @param type 0
微信订单编号 1
企业微信订单编号
* @param type 0
订单编号 1 企业微信订单编号 2微信订单编号 3付费应用
企业微信订单编号
* @param wxEnterpriseId
* @param wxEnterpriseId
* @return
* @return
*/
*/
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/licence/impl/LicenceOrderServiceImpl.java
View file @
e1ce4de9
...
@@ -19,6 +19,7 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
...
@@ -19,6 +19,7 @@ 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
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanAppOrderMapper
;
import
com.gic.haoban.manage.service.dao.mapper.licence.TabHaobanLicenceOrderMapper
;
import
com.gic.haoban.manage.service.dao.mapper.licence.TabHaobanLicenceOrderMapper
;
import
com.gic.haoban.manage.service.dao.mapper.licence.TabHaobanLicenceOrderProgressMapper
;
import
com.gic.haoban.manage.service.dao.mapper.licence.TabHaobanLicenceOrderProgressMapper
;
import
com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder
;
import
com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder
;
...
@@ -61,6 +62,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
...
@@ -61,6 +62,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
@Autowired
@Autowired
private
Config
config
;
private
Config
config
;
@Autowired
private
TabHaobanAppOrderMapper
tabHaobanAppOrderMapper
;
@Override
@Override
public
TabHaobanLicenceOrder
getLicenceOrderDetail
(
Long
orderId
)
{
public
TabHaobanLicenceOrder
getLicenceOrderDetail
(
Long
orderId
)
{
...
@@ -258,8 +261,11 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
...
@@ -258,8 +261,11 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
result
=
tabHaobanLicenceOrderMapper
.
getTransactionIdList
(
param
,
wxEnterpriseId
);
result
=
tabHaobanLicenceOrderMapper
.
getTransactionIdList
(
param
,
wxEnterpriseId
);
}
else
if
(
type
==
1
){
}
else
if
(
type
==
1
){
result
=
tabHaobanLicenceOrderMapper
.
getQywxOrderId
(
param
,
wxEnterpriseId
);
result
=
tabHaobanLicenceOrderMapper
.
getQywxOrderId
(
param
,
wxEnterpriseId
);
}
else
{
}
else
if
(
type
==
2
)
{
result
=
tabHaobanLicenceOrderMapper
.
getWxOrderId
(
param
,
wxEnterpriseId
);
result
=
tabHaobanLicenceOrderMapper
.
getWxOrderId
(
param
,
wxEnterpriseId
);
}
else
if
(
type
==
3
){
//查询付费应用企业微信订单id
result
=
tabHaobanAppOrderMapper
.
getQywxOrderId
(
param
,
wxEnterpriseId
);
}
}
return
result
;
return
result
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/licence/AppOrderApiServiceImpl.java
0 → 100644
View file @
e1ce4de9
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
licence
;
import
com.gic.haoban.manage.api.service.licence.AppOrderApiService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.stereotype.Service
;
/**
* @description:
* @Author: wenhua
* @Date: 2023/6/25 15:44
*/
@Service
(
"AppOrderApiServiceImpl"
)
public
class
AppOrderApiServiceImpl
implements
AppOrderApiService
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
AppOrderApiServiceImpl
.
class
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/SignatureGetterUtil.java
0 → 100644
View file @
e1ce4de9
package
com
.
gic
.
haoban
.
manage
.
service
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
javax.crypto.Mac
;
import
javax.crypto.spec.SecretKeySpec
;
import
java.nio.charset.StandardCharsets
;
import
java.util.*
;
public
class
SignatureGetterUtil
{
private
String
secret
;
public
SignatureGetterUtil
(
String
secret
)
{
this
.
secret
=
secret
;
}
public
String
get
(
String
jsonStr
)
throws
Exception
{
Map
<
String
,
Object
>
jsonDict
=
new
HashMap
<>();
jsonDict
=
JSONObject
.
parseObject
(
jsonStr
,
jsonDict
.
getClass
());
List
<
String
>
paramList
=
new
ArrayList
<>();
json2List
(
jsonDict
,
paramList
);
Collections
.
sort
(
paramList
);
return
hmacSha256
(
list2String
(
paramList
));
}
private
String
list2String
(
List
<
String
>
paramList
)
{
String
str
=
""
;
for
(
String
param
:
paramList
)
{
if
(
param
.
startsWith
(
"sig="
))
{
continue
;
// ignore sig self
}
str
+=
param
+
"&"
;
}
System
.
out
.
println
(
str
);
return
str
.
substring
(
0
,
str
.
length
()
-
1
);
}
private
String
hmacSha256
(
String
data
)
throws
Exception
{
Mac
mac
=
Mac
.
getInstance
(
"HmacSHA256"
);
SecretKeySpec
secretKeySpec
=
new
SecretKeySpec
(
secret
.
getBytes
(
"UTF-8"
),
"HmacSHA256"
);
mac
.
init
(
secretKeySpec
);
byte
[]
signature
=
mac
.
doFinal
(
data
.
getBytes
(
"UTF-8"
));
return
Base64
.
getEncoder
().
encodeToString
(
signature
);
}
private
void
json2List
(
Map
<
String
,
Object
>
jsonDict
,
List
<
String
>
paramList
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
jsonDict
.
entrySet
())
{
String
k
=
entry
.
getKey
();
Object
v
=
entry
.
getValue
();
if
(
v
instanceof
List
)
{
for
(
Object
item
:
(
List
<?>)
v
)
{
json2List
((
Map
<
String
,
Object
>)
item
,
paramList
);
}
}
else
{
paramList
.
add
(
k
+
"="
+
v
);
}
}
}
/**
* 模拟生成随机 nonce 字符串
*
* @return 随机字符串
*/
public
String
genNonce
()
{
return
bytesToHex
(
Long
.
toString
(
System
.
nanoTime
()).
getBytes
(
StandardCharsets
.
UTF_8
));
}
private
String
bytesToHex
(
final
byte
[]
hash
)
{
Formatter
formatter
=
new
Formatter
();
for
(
byte
b
:
hash
)
{
formatter
.
format
(
"%02x"
,
b
);
}
String
result
=
formatter
.
toString
();
formatter
.
close
();
return
result
;
}
}
haoban-manage3-service/src/main/resources/mapper/TabHaobanAppOrderMapper.xml
View file @
e1ce4de9
...
@@ -21,12 +21,13 @@
...
@@ -21,12 +21,13 @@
<result
property=
"updateTime"
column=
"update_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updateTime"
column=
"update_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"creatorId"
column=
"creator_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"creatorId"
column=
"creator_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"creatorName"
column=
"creator_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"creatorName"
column=
"creator_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"expireTime"
column=
"expire_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
</resultMap>
<!--查询单个-->
<!--查询单个-->
<select
id=
"queryById"
resultMap=
"TabHaobanAppOrderMap"
>
<select
id=
"queryById"
resultMap=
"TabHaobanAppOrderMap"
>
select
select
id, wx_enterprise_id, order_id, order_status, order_type, user_num, duration, begin_time, end_time, pay_time, origin_price, paid_price, order_url, delete_flag, create_time, update_time, creator_id, creator_name
id, wx_enterprise_id, order_id, order_status, order_type, user_num, duration, begin_time, end_time, pay_time, origin_price, paid_price, order_url, delete_flag, create_time, update_time, creator_id, creator_name
,expire_time
from tab_haoban_app_order
from tab_haoban_app_order
where id = #{id}
where id = #{id}
</select>
</select>
...
@@ -34,7 +35,7 @@
...
@@ -34,7 +35,7 @@
<!--查询指定行数据-->
<!--查询指定行数据-->
<select
id=
"queryAllByLimit"
resultMap=
"TabHaobanAppOrderMap"
>
<select
id=
"queryAllByLimit"
resultMap=
"TabHaobanAppOrderMap"
>
select
select
id, wx_enterprise_id, order_id, order_status, order_type, user_num, duration, begin_time, end_time, pay_time, origin_price, paid_price, order_url, delete_flag, create_time, update_time, creator_id, creator_name
id, wx_enterprise_id, order_id, order_status, order_type, user_num, duration, begin_time, end_time, pay_time, origin_price, paid_price, order_url, delete_flag, create_time, update_time, creator_id, creator_name
,expire_time
from tab_haoban_app_order
from tab_haoban_app_order
<where>
<where>
<if
test=
"id != null"
>
<if
test=
"id != null"
>
...
@@ -159,44 +160,18 @@
...
@@ -159,44 +160,18 @@
<!--新增所有列-->
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into tab_haoban_app_order(
wx_enterprise_id, order_id, order_status, order_type, user_num, duration, begin_time, end_time, pay_time, origin_price, paid_price, order_url, delete_flag, create_time, update_time, creator_id, creator_na
me)
insert into tab_haoban_app_order(
id,wx_enterprise_id, order_id, order_status, order_type, user_num, duration, begin_time, end_time, pay_time, origin_price, paid_price, order_url, delete_flag, create_time, update_time, creator_id, creator_name,expire_ti
me)
values (#{
wxEnterpriseId}, #{orderId}, #{orderStatus}, #{orderType}, #{userNum}, #{duration}, #{beginTime}, #{endTime}, #{payTime}, #{originPrice}, #{paidPrice}, #{orderUrl}, #{deleteFlag}, #{createTime}, #{updateTime}, #{creatorId}, #{creatorNa
me})
values (#{
id},#{wxEnterpriseId}, #{orderId}, #{orderStatus}, #{orderType}, #{userNum}, #{duration}, #{beginTime}, #{endTime}, #{payTime}, #{originPrice}, #{paidPrice}, #{orderUrl}, #{deleteFlag}, #{createTime}, #{updateTime}, #{creatorId}, #{creatorName},#{expireTi
me})
</insert>
</insert>
<insert
id=
"insertBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
<insert
id=
"insertBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into tab_haoban_app_order(
wx_enterprise_id, order_id, order_status, order_type, user_num, duration, begin_time, end_time, pay_time, origin_price, paid_price, order_url, delete_flag, create_time, update_time, creator_id, creator_na
me)
insert into tab_haoban_app_order(
id,wx_enterprise_id, order_id, order_status, order_type, user_num, duration, begin_time, end_time, pay_time, origin_price, paid_price, order_url, delete_flag, create_time, update_time, creator_id, creator_name,expire_ti
me)
values
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.
wxEnterpriseId}, #{entity.orderId}, #{entity.orderStatus}, #{entity.orderType}, #{entity.userNum}, #{entity.duration}, #{entity.beginTime}, #{entity.endTime}, #{entity.payTime}, #{entity.originPrice}, #{entity.paidPrice}, #{entity.orderUrl}, #{entity.deleteFlag}, #{entity.createTime}, #{entity.updateTime}, #{entity.creatorId}, #{entity.creatorNa
me})
(#{entity.
id},#{entity.wxEnterpriseId}, #{entity.orderId}, #{entity.orderStatus}, #{entity.orderType}, #{entity.userNum}, #{entity.duration}, #{entity.beginTime}, #{entity.endTime}, #{entity.payTime}, #{entity.originPrice}, #{entity.paidPrice}, #{entity.orderUrl}, #{entity.deleteFlag}, #{entity.createTime}, #{entity.updateTime}, #{entity.creatorId}, #{entity.creatorName},#{entity.expireTi
me})
</foreach>
</foreach>
</insert>
</insert>
<insert
id=
"insertOrUpdateBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into tab_haoban_app_order(wx_enterprise_id, order_id, order_status, order_type, user_num, duration, begin_time, end_time, pay_time, origin_price, paid_price, order_url, delete_flag, create_time, update_time, creator_id, creator_name)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.wxEnterpriseId}, #{entity.orderId}, #{entity.orderStatus}, #{entity.orderType}, #{entity.userNum}, #{entity.duration}, #{entity.beginTime}, #{entity.endTime}, #{entity.payTime}, #{entity.originPrice}, #{entity.paidPrice}, #{entity.orderUrl}, #{entity.deleteFlag}, #{entity.createTime}, #{entity.updateTime}, #{entity.creatorId}, #{entity.creatorName})
</foreach>
on duplicate key update
wx_enterprise_id = values(wx_enterprise_id),
order_id = values(order_id),
order_status = values(order_status),
order_type = values(order_type),
user_num = values(user_num),
duration = values(duration),
begin_time = values(begin_time),
end_time = values(end_time),
pay_time = values(pay_time),
origin_price = values(origin_price),
paid_price = values(paid_price),
order_url = values(order_url),
delete_flag = values(delete_flag),
create_time = values(create_time),
update_time = values(update_time),
creator_id = values(creator_id),
creator_name = values(creator_name)
</insert>
<!--通过主键修改数据-->
<!--通过主键修改数据-->
<update
id=
"update"
>
<update
id=
"update"
>
update tab_haoban_app_order
update tab_haoban_app_order
...
@@ -252,14 +227,28 @@
...
@@ -252,14 +227,28 @@
<if
test=
"creatorName != null and creatorName != ''"
>
<if
test=
"creatorName != null and creatorName != ''"
>
creator_name = #{creatorName},
creator_name = #{creatorName},
</if>
</if>
<if
test=
"expireTime != null"
>
expire_time = #{expireTime},
</if>
</set>
</set>
where id = #{id}
where id = #{id}
</update>
</update>
<!--通过主键删除-->
<!--通过主键删除-->
<delete
id=
"deleteById"
>
<update
id=
"deleteById"
>
delete from tab_haoban_app_order where id = #{id}
update tab_haoban_app_order
</delete>
set delete_flag = 1,update_time = now()
where id = #{id}
</update>
<select
id=
"getQywxOrderId"
resultType=
"string"
>
SELECT
order_id
FROM tab_haoban_app_order WHERE order_id like concat (#{qywxOrderId},'%') and delete_flag=0
<if
test=
"wxEnterpriseId != null and wxEnterpriseId !='' "
>
and wx_enterprise_id = #{wxEnterpriseId}
</if>
</select>
</mapper>
</mapper>
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/licence/AppOrderController.java
0 → 100644
View file @
e1ce4de9
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
licence
;
import
cn.hutool.core.convert.Convert
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.licence.AppOrderPageQO
;
import
com.gic.haoban.manage.web.qo.licence.AppOrderQO
;
import
com.gic.haoban.manage.web.vo.licence.AppOrderCheckVO
;
import
com.gic.haoban.manage.web.vo.licence.AppOrderNoticeVO
;
import
com.gic.haoban.manage.web.vo.licence.AppOrderPageVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @description:
* @Author: wenhua
* @Date: 2023/6/25 15:54
*/
@RestController
@RequestMapping
(
"/app-order"
)
public
class
AppOrderController
{
private
static
Logger
logger
=
LogManager
.
getLogger
(
AppOrderController
.
class
);
/**
* 分页查询应用订单列表
*/
@RequestMapping
(
"app-order-page"
)
public
RestResponse
<
Page
<
AppOrderPageVO
>>
getAppOrderPage
(
@RequestBody
AppOrderPageQO
qo
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
String
enterpriseId
=
loginUser
.
getEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
clerkName
=
loginUser
.
getClerkName
();
LicenceOrderPageQDTO
qdto
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
qo
),
LicenceOrderPageQDTO
.
class
);
qdto
.
setEnterpriseId
(
enterpriseId
);
qdto
.
setWxEnterpriseId
(
wxEnterpriseId
);
qdto
.
setCreatorName
(
clerkName
);
qdto
.
setType
(
1
);
return
RestResponse
.
successResult
(
null
);
}
/**
* 新增订单
*/
@RequestMapping
(
"app-order-save"
)
public
RestResponse
<
JSONObject
>
saveAppOrder
(
@RequestBody
AppOrderQO
qo
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
return
RestResponse
.
successResult
(
null
);
}
/**
* 取消订单
*/
@RequestMapping
(
"app-order-cancel"
)
public
RestResponse
<
Boolean
>
cancelAppOrder
(
@RequestParam
Long
orderId
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
return
RestResponse
.
successResult
(
null
);
}
/**
* 购买弹窗校验
*/
@RequestMapping
(
"app-order-check"
)
public
RestResponse
<
AppOrderCheckVO
>
checkAppOrder
()
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
return
RestResponse
.
successResult
(
null
);
}
/**
* 登录好办弹窗校验
*/
@RequestMapping
(
"app-order-notice"
)
public
RestResponse
<
AppOrderNoticeVO
>
noticeAppOrder
()
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
return
RestResponse
.
successResult
(
null
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/licence/LicenceOrderController.java
View file @
e1ce4de9
...
@@ -29,6 +29,7 @@ import com.gic.haoban.manage.web.log.LogRecordUserServiceImpl;
...
@@ -29,6 +29,7 @@ import com.gic.haoban.manage.web.log.LogRecordUserServiceImpl;
import
com.gic.haoban.manage.web.qo.licence.LicenceOrderPageQO
;
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.qo.licence.RenewalUserQO
;
import
com.gic.haoban.manage.web.qo.licence.RenewalUserQO
;
import
com.gic.haoban.manage.web.vo.licence.AppOrderNoticeVO
;
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.haoban.manage.web.vo.licence.RenewalUserVO
;
import
com.gic.haoban.manage.web.vo.licence.RenewalUserVO
;
...
@@ -344,13 +345,14 @@ public class LicenceOrderController {
...
@@ -344,13 +345,14 @@ public class LicenceOrderController {
* 查询企业是否存在未支付订单
* 查询企业是否存在未支付订单
*/
*/
@RequestMapping
(
"licence-order-isPay"
)
@RequestMapping
(
"licence-order-isPay"
)
public
RestResponse
<
String
>
isPayLicenceOrder
()
{
public
RestResponse
<
AppOrderNoticeVO
>
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
());
//todo 判断续期订单
return
RestResponse
.
successResult
(
null
);
}
}
/**
/**
...
@@ -373,7 +375,7 @@ public class LicenceOrderController {
...
@@ -373,7 +375,7 @@ public class LicenceOrderController {
* 订单编号和企业微信订单编号模糊搜索
* 订单编号和企业微信订单编号模糊搜索
*
*
* @param param 模糊查询
* @param param 模糊查询
* @param type 0 微信订单编号 1 企业微信订单编号
* @param type 0 微信订单编号 1 企业微信订单编号
2微信订单编号 3付费应用企业微信订单编号
* @return
* @return
*/
*/
@RequestMapping
(
"get-order-id-list"
)
@RequestMapping
(
"get-order-id-list"
)
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/qo/licence/AppOrderPageQO.java
0 → 100644
View file @
e1ce4de9
package
com
.
gic
.
haoban
.
manage
.
web
.
qo
.
licence
;
import
com.gic.api.base.commons.BasePageInfo
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
/**
* <p>
*
* </p>
*
* @author jx
* @since 2023-03-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
AppOrderPageQO
extends
BasePageInfo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 订单状态1 - 待支付2 - 已支付3 - 订单取消4 - 支付过期5 - 退款申请中6 - 已退款7 - 交易完成8 - 待企业确认9 - 已部分退款
*/
private
Integer
orderStatus
;
/**
* 企业微信订单id
*/
private
Long
orderId
;
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/qo/licence/AppOrderQO.java
0 → 100644
View file @
e1ce4de9
package
com
.
gic
.
haoban
.
manage
.
web
.
qo
.
licence
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author jx
* @since 2023-03-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
AppOrderQO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 订单类型 0 新购、1 扩容、2 续期
*/
private
Integer
orderType
;
/**
* 购买人数
*/
private
Integer
userNum
;
/**
* 购买时长
*/
private
Integer
duration
;
/**
* 购买生效期的开始时间
*/
private
Date
beginTime
;
/**
* 购买生效期的结束时间
*/
private
Date
endTime
;
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/licence/AppOrderCheckVO.java
0 → 100644
View file @
e1ce4de9
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
licence
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author jx
* @since 2023-03-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
AppOrderCheckVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 弹窗类型 0 正常 1新购 2 续期
*/
private
Integer
type
;
/**
* 已购买人数
*/
private
Integer
userNum
;
/**
* 购买生效期的开始时间
*/
private
Date
beginTime
;
/**
* 购买生效期的结束时间
*/
private
Date
endTime
;
/**
* 合同到期天数
*/
private
Integer
contractDay
;
/**
* 当前时间
*/
private
Date
now
;
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/licence/AppOrderNoticeVO.java
0 → 100644
View file @
e1ce4de9
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
licence
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author jx
* @since 2023-03-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
AppOrderNoticeVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 弹窗类型 0 无需弹窗 1 未购买付费应用弹窗 2付费应用已过期弹窗 3 查询购买许可账号是否存在未支付订单
*/
private
Integer
type
;
/**
* 是否支付 0否 1是
*/
private
Integer
payFlag
;
/**
* 未支付订单id
*/
private
Long
orderId
;
/**
* 支付的url
*/
private
String
orderUrl
;
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/licence/AppOrderPageVO.java
0 → 100644
View file @
e1ce4de9
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
licence
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author jx
* @since 2023-03-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
AppOrderPageVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
private
Long
id
;
/**
* wx企业Id
*/
private
String
wxEnterpriseId
;
/**
* 企业微信订单id
*/
private
Long
orderId
;
/**
* 订单状态1 - 待支付2 - 已支付3 - 订单取消4 - 支付过期5 - 退款申请中6 - 已退款7 - 交易完成8 - 待企业确认9 - 已部分退款
*/
private
Integer
orderStatus
;
/**
* 订单类型 0 新购、1 扩容、2 续期
*/
private
Integer
orderType
;
/**
* 购买人数
*/
private
Integer
userNum
;
/**
* 购买时长
*/
private
Integer
duration
;
/**
* 购买生效期的开始时间
*/
private
Date
beginTime
;
/**
* 购买生效期的结束时间
*/
private
Date
endTime
;
/**
* 支付时间
*/
private
Date
payTime
;
/**
* 原价,单位分
*/
private
Integer
originPrice
;
/**
* 折后价,单位分
*/
private
Integer
paidPrice
;
/**
* 收款订单链接
*/
private
String
orderUrl
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 创建人
*/
private
String
creatorId
;
/**
* 创建人名称
*/
private
String
creatorName
;
/**
* 订单支付到期时间
*/
private
Date
expireTime
;
/**
* 有效状态 0 -- 1待生效 2生效中 3已失效
*/
private
Integer
effectiveState
;
}
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