Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
property-management
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
刘帅
property-management
Commits
3efebfd8
Commit
3efebfd8
authored
May 27, 2025
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.支付接口
parent
79ab4691
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
235 additions
and
43 deletions
+235
-43
ApiWxLiveBillController.java
.../web/controller/business/api/ApiWxLiveBillController.java
+2
-2
ApiWxPayRecordController.java
...web/controller/business/api/ApiWxPayRecordController.java
+10
-6
ApiWxRepairsController.java
...t/web/controller/business/api/ApiWxRepairsController.java
+0
-11
PayMerchantController.java
...yManagement/web/controller/pay/PayMerchantController.java
+17
-0
WxPayRecord.java
...a/com/propertyManagement/business/domain/WxPayRecord.java
+7
-3
WxPayRecordBo.java
.../propertyManagement/business/domain/bo/WxPayRecordBo.java
+8
-3
WxPayRecordVo.java
.../propertyManagement/business/domain/vo/WxPayRecordVo.java
+9
-4
PayBizEnum.java
...ava/com/propertyManagement/business/enums/PayBizEnum.java
+40
-0
IWxLiveBillService.java
...opertyManagement/business/service/IWxLiveBillService.java
+1
-1
IWxPayRecordService.java
...pertyManagement/business/service/IWxPayRecordService.java
+7
-0
WxLiveBillServiceImpl.java
...nagement/business/service/impl/WxLiveBillServiceImpl.java
+2
-2
WxPayRecordServiceImpl.java
...agement/business/service/impl/WxPayRecordServiceImpl.java
+102
-2
WxPayRecordMapper.xml
.../src/main/resources/mapper/business/WxPayRecordMapper.xml
+1
-1
PayState.java
...in/java/com/propertyManagement/common/enums/PayState.java
+3
-2
IPayMerchantService.java
...m/propertyManagement/pay/service/IPayMerchantService.java
+3
-0
PayMerchantServiceImpl.java
...tyManagement/pay/service/impl/PayMerchantServiceImpl.java
+17
-0
index.vue
propertyManagement-ui/src/views/business/payRecord/index.vue
+6
-6
No files found.
propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxLiveBillController.java
View file @
3efebfd8
...
@@ -49,8 +49,8 @@ public class ApiWxLiveBillController extends BaseController {
...
@@ -49,8 +49,8 @@ public class ApiWxLiveBillController extends BaseController {
* 创建缴费账单
* 创建缴费账单
*/
*/
@PostMapping
(
"/add"
)
@PostMapping
(
"/add"
)
public
R
<
Void
>
add
(
WxLiveBillBo
bo
)
{
public
R
<
WxLiveBillBo
>
add
(
WxLiveBillBo
bo
)
{
return
toAjax
(
iWxLiveBillService
.
add
(
bo
));
return
R
.
ok
(
iWxLiveBillService
.
add
(
bo
));
}
}
}
}
propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxPayRecordController.java
View file @
3efebfd8
...
@@ -9,10 +9,13 @@ import com.propertyManagement.common.core.controller.BaseController;
...
@@ -9,10 +9,13 @@ import com.propertyManagement.common.core.controller.BaseController;
import
com.propertyManagement.common.core.domain.R
;
import
com.propertyManagement.common.core.domain.R
;
import
com.propertyManagement.common.core.validate.AddGroup
;
import
com.propertyManagement.common.core.validate.AddGroup
;
import
com.propertyManagement.common.enums.PayState
;
import
com.propertyManagement.common.enums.PayState
;
import
com.propertyManagement.pay.support.pay.PayReqModel
;
import
com.siashan.unipay4j.core.Result
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -33,20 +36,21 @@ public class ApiWxPayRecordController extends BaseController {
...
@@ -33,20 +36,21 @@ public class ApiWxPayRecordController extends BaseController {
* 查询缴费记录列表
* 查询缴费记录列表
*/
*/
@GetMapping
(
"/listAll"
)
@GetMapping
(
"/listAll"
)
public
R
<
List
<
WxPayRecordVo
>>
listAll
()
{
public
R
<
List
<
WxPayRecordVo
>>
listAll
(
@NotNull
(
message
=
"类型不能为空"
)
Integer
type
)
{
WxPayRecordBo
recordBo
=
new
WxPayRecordBo
();
WxPayRecordBo
recordBo
=
new
WxPayRecordBo
();
recordBo
.
setProprietorId
(
AuthUtil
.
getWxUser
().
getProprietorId
());
recordBo
.
setProprietorId
(
AuthUtil
.
getWxUser
().
getProprietorId
());
recordBo
.
setPayState
(
PayState
.
NO
.
getCode
());
recordBo
.
setOrderType
(
type
);
// recordBo.setPayState(PayState.NO.getCode());
return
R
.
ok
(
iWxPayRecordService
.
queryList
(
recordBo
));
return
R
.
ok
(
iWxPayRecordService
.
queryList
(
recordBo
));
}
}
/**
/**
*
新增缴费记录
*
支付订单
*/
*/
@RepeatSubmit
()
@RepeatSubmit
()
@PostMapping
(
"/
add
"
)
@PostMapping
(
"/
pay
"
)
public
R
<
Void
>
add
(
@Validated
(
AddGroup
.
class
)
@RequestBody
WxPayRecordBo
bo
)
{
public
R
<
Result
<
Object
>>
add
(
@Validated
(
AddGroup
.
class
)
@RequestBody
PayReqModel
payReqModel
)
{
return
toAjax
(
iWxPayRecordService
.
insertByBo
(
bo
));
return
R
.
ok
(
iWxPayRecordService
.
pay
(
payReqModel
));
}
}
}
}
propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxRepairsController.java
View file @
3efebfd8
...
@@ -119,15 +119,4 @@ public class ApiWxRepairsController extends BaseController {
...
@@ -119,15 +119,4 @@ public class ApiWxRepairsController extends BaseController {
repairsBo
.
setState
(
RepairsState
.
TWO
.
getCode
());
repairsBo
.
setState
(
RepairsState
.
TWO
.
getCode
());
return
toAjax
(
iWxRepairsService
.
updateByBo
(
repairsBo
));
return
toAjax
(
iWxRepairsService
.
updateByBo
(
repairsBo
));
}
}
/**
* 支付报修单
*
* @param repairsId 主键
*/
@PutMapping
(
"/pay/{repairsId}"
)
public
R
<
Void
>
pay
(
@NotEmpty
(
message
=
"主键不能为空"
)
@PathVariable
Long
repairsId
)
{
return
toAjax
(
true
);
}
}
}
propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/pay/PayMerchantController.java
View file @
3efebfd8
...
@@ -13,6 +13,7 @@ import com.propertyManagement.common.core.validate.EditGroup;
...
@@ -13,6 +13,7 @@ import com.propertyManagement.common.core.validate.EditGroup;
import
com.propertyManagement.common.enums.BusinessType
;
import
com.propertyManagement.common.enums.BusinessType
;
import
com.propertyManagement.common.enums.IsEnableType
;
import
com.propertyManagement.common.enums.IsEnableType
;
import
com.propertyManagement.common.utils.poi.ExcelUtil
;
import
com.propertyManagement.common.utils.poi.ExcelUtil
;
import
com.propertyManagement.pay.domain.CmsPayMerchant
;
import
com.propertyManagement.pay.domain.bo.CmsPayMerchantBo
;
import
com.propertyManagement.pay.domain.bo.CmsPayMerchantBo
;
import
com.propertyManagement.pay.domain.vo.CmsPayMerchantVo
;
import
com.propertyManagement.pay.domain.vo.CmsPayMerchantVo
;
import
com.propertyManagement.pay.service.IPayMerchantService
;
import
com.propertyManagement.pay.service.IPayMerchantService
;
...
@@ -84,6 +85,22 @@ public class PayMerchantController extends BaseController {
...
@@ -84,6 +85,22 @@ public class PayMerchantController extends BaseController {
return
R
.
ok
(
iPayMerchantService
.
getByCode
(
code
));
return
R
.
ok
(
iPayMerchantService
.
getByCode
(
code
));
}
}
/**
* 修改支付商户
*
* @apiNote 同步商户配置信息到App应用配置
*
* @param cmsPayMerchant 参数
* @return 结果
*/
@SaCheckPermission
(
"@ss.hasPermi('cms:pay-merchant:edit')"
)
@PutMapping
(
"/syncEdit"
)
public
R
syncEdit
(
@RequestBody
CmsPayMerchantBo
cmsPayMerchant
)
{
iPayMerchantService
.
syncEdit
(
cmsPayMerchant
);
return
R
.
ok
();
}
/**
/**
* 新增支付商户
* 新增支付商户
*/
*/
...
...
propertyManagement-business/src/main/java/com/propertyManagement/business/domain/WxPayRecord.java
View file @
3efebfd8
...
@@ -39,7 +39,11 @@ public class WxPayRecord extends BaseEntity {
...
@@ -39,7 +39,11 @@ public class WxPayRecord extends BaseEntity {
/**
/**
* 小区名称
* 小区名称
*/
*/
private
Long
communityName
;
private
Long
communityId
;
/**
* 小区名称
*/
private
String
communityName
;
/**
/**
* 业主ID
* 业主ID
*/
*/
...
@@ -59,11 +63,11 @@ public class WxPayRecord extends BaseEntity {
...
@@ -59,11 +63,11 @@ public class WxPayRecord extends BaseEntity {
/**
/**
* 账单主键
* 账单主键
*/
*/
private
Long
bill
Id
;
private
Long
order
Id
;
/**
/**
* 订单类型
* 订单类型
*/
*/
private
String
orderType
;
private
Integer
orderType
;
/**
/**
* 支付渠道
* 支付渠道
*/
*/
...
...
propertyManagement-business/src/main/java/com/propertyManagement/business/domain/bo/WxPayRecordBo.java
View file @
3efebfd8
...
@@ -44,7 +44,12 @@ public class WxPayRecordBo extends BaseEntity {
...
@@ -44,7 +44,12 @@ public class WxPayRecordBo extends BaseEntity {
* 小区名称
* 小区名称
*/
*/
@NotNull
(
message
=
"小区名称不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
@NotNull
(
message
=
"小区名称不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Long
communityName
;
private
Long
communityId
;
/**
* 小区名称
*/
private
String
communityName
;
/**
/**
* 业主ID
* 业主ID
...
@@ -74,13 +79,13 @@ public class WxPayRecordBo extends BaseEntity {
...
@@ -74,13 +79,13 @@ public class WxPayRecordBo extends BaseEntity {
* 账单主键
* 账单主键
*/
*/
@NotNull
(
message
=
"账单主键不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
@NotNull
(
message
=
"账单主键不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Long
bill
Id
;
private
Long
order
Id
;
/**
/**
* 订单类型
* 订单类型
*/
*/
@NotBlank
(
message
=
"订单类型不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
@NotBlank
(
message
=
"订单类型不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
orderType
;
private
Integer
orderType
;
/**
/**
* 支付渠道
* 支付渠道
...
...
propertyManagement-business/src/main/java/com/propertyManagement/business/domain/vo/WxPayRecordVo.java
View file @
3efebfd8
...
@@ -32,11 +32,16 @@ public class WxPayRecordVo implements Serializable {
...
@@ -32,11 +32,16 @@ public class WxPayRecordVo implements Serializable {
@ExcelProperty
(
value
=
"用户名称"
)
@ExcelProperty
(
value
=
"用户名称"
)
private
String
userName
;
private
String
userName
;
/**
* 小区ID
*/
private
Long
communityId
;
/**
/**
* 小区名称
* 小区名称
*/
*/
@ExcelProperty
(
value
=
"小区名称"
)
@ExcelProperty
(
value
=
"小区名称"
)
private
Lo
ng
communityName
;
private
Stri
ng
communityName
;
/**
/**
* 业主ID
* 业主ID
...
@@ -65,8 +70,8 @@ public class WxPayRecordVo implements Serializable {
...
@@ -65,8 +70,8 @@ public class WxPayRecordVo implements Serializable {
* 订单类型
* 订单类型
*/
*/
@ExcelProperty
(
value
=
"订单类型"
,
converter
=
ExcelDictConvert
.
class
)
@ExcelProperty
(
value
=
"订单类型"
,
converter
=
ExcelDictConvert
.
class
)
@ExcelDictFormat
(
dictType
=
"wx_
live_bill
_type"
)
@ExcelDictFormat
(
dictType
=
"wx_
pay_record
_type"
)
private
String
orderType
;
private
Integer
orderType
;
/**
/**
* 支付渠道
* 支付渠道
...
@@ -108,7 +113,7 @@ public class WxPayRecordVo implements Serializable {
...
@@ -108,7 +113,7 @@ public class WxPayRecordVo implements Serializable {
* 支付状态
* 支付状态
*/
*/
@ExcelProperty
(
value
=
"支付状态"
,
converter
=
ExcelDictConvert
.
class
)
@ExcelProperty
(
value
=
"支付状态"
,
converter
=
ExcelDictConvert
.
class
)
@ExcelDictFormat
(
dictType
=
"wx_pay_record"
)
@ExcelDictFormat
(
dictType
=
"wx_pay_record
_state
"
)
private
Integer
payState
;
private
Integer
payState
;
/**
/**
...
...
propertyManagement-business/src/main/java/com/propertyManagement/business/enums/PayBizEnum.java
0 → 100644
View file @
3efebfd8
package
com
.
propertyManagement
.
business
.
enums
;
import
com.siashan.toolkit.core.enums.IBaseEnum
;
/**
* 支付业务枚举
*
* @author siashan
* @date 2023-11-11
*/
public
enum
PayBizEnum
implements
IBaseEnum
<
String
>
{
PRESTORE
(
"PRESTORE"
,
"预存支付"
),
MAINTAIN
(
"MAINTAIN"
,
"维修支付"
),
;
private
String
code
;
private
String
desp
;
PayBizEnum
(
String
code
,
String
desp
){
this
.
code
=
code
;
this
.
desp
=
desp
;
}
public
String
getCode
()
{
return
this
.
code
;
}
public
String
getDesp
()
{
return
this
.
desp
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
void
setDesp
(
String
desp
)
{
this
.
desp
=
desp
;
}
}
propertyManagement-business/src/main/java/com/propertyManagement/business/service/IWxLiveBillService.java
View file @
3efebfd8
...
@@ -35,7 +35,7 @@ public interface IWxLiveBillService {
...
@@ -35,7 +35,7 @@ public interface IWxLiveBillService {
/**
/**
* 创建缴费账单
* 创建缴费账单
*/
*/
Boolean
add
(
WxLiveBillBo
bo
);
WxLiveBillBo
add
(
WxLiveBillBo
bo
);
/**
/**
* 新增生活缴费账单
* 新增生活缴费账单
...
...
propertyManagement-business/src/main/java/com/propertyManagement/business/service/IWxPayRecordService.java
View file @
3efebfd8
...
@@ -5,6 +5,8 @@ import com.propertyManagement.business.domain.vo.WxPayRecordVo;
...
@@ -5,6 +5,8 @@ import com.propertyManagement.business.domain.vo.WxPayRecordVo;
import
com.propertyManagement.business.domain.bo.WxPayRecordBo
;
import
com.propertyManagement.business.domain.bo.WxPayRecordBo
;
import
com.propertyManagement.common.core.page.TableDataInfo
;
import
com.propertyManagement.common.core.page.TableDataInfo
;
import
com.propertyManagement.common.core.domain.PageQuery
;
import
com.propertyManagement.common.core.domain.PageQuery
;
import
com.propertyManagement.pay.support.pay.PayReqModel
;
import
com.siashan.unipay4j.core.Result
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
...
@@ -32,6 +34,11 @@ public interface IWxPayRecordService {
...
@@ -32,6 +34,11 @@ public interface IWxPayRecordService {
*/
*/
List
<
WxPayRecordVo
>
queryList
(
WxPayRecordBo
bo
);
List
<
WxPayRecordVo
>
queryList
(
WxPayRecordBo
bo
);
/**
* 新增缴费记录
*/
Result
<
Object
>
pay
(
PayReqModel
payReqModel
);
/**
/**
* 新增缴费记录
* 新增缴费记录
*/
*/
...
...
propertyManagement-business/src/main/java/com/propertyManagement/business/service/impl/WxLiveBillServiceImpl.java
View file @
3efebfd8
...
@@ -81,7 +81,7 @@ public class WxLiveBillServiceImpl implements IWxLiveBillService {
...
@@ -81,7 +81,7 @@ public class WxLiveBillServiceImpl implements IWxLiveBillService {
}
}
@Override
@Override
public
Boolean
add
(
WxLiveBillBo
bo
)
{
public
WxLiveBillBo
add
(
WxLiveBillBo
bo
)
{
WxLiveBill
add
=
BeanUtil
.
toBean
(
bo
,
WxLiveBill
.
class
);
WxLiveBill
add
=
BeanUtil
.
toBean
(
bo
,
WxLiveBill
.
class
);
LoginWxUser
wxUser
=
AuthUtil
.
getWxUser
();
LoginWxUser
wxUser
=
AuthUtil
.
getWxUser
();
add
.
setCommunityId
(
wxUser
.
getCommunityId
());
add
.
setCommunityId
(
wxUser
.
getCommunityId
());
...
@@ -97,7 +97,7 @@ public class WxLiveBillServiceImpl implements IWxLiveBillService {
...
@@ -97,7 +97,7 @@ public class WxLiveBillServiceImpl implements IWxLiveBillService {
if
(
flag
)
{
if
(
flag
)
{
bo
.
setBillId
(
add
.
getBillId
());
bo
.
setBillId
(
add
.
getBillId
());
}
}
return
flag
;
return
bo
;
}
}
/**
/**
...
...
propertyManagement-business/src/main/java/com/propertyManagement/business/service/impl/WxPayRecordServiceImpl.java
View file @
3efebfd8
package
com
.
propertyManagement
.
business
.
service
.
impl
;
package
com
.
propertyManagement
.
business
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.propertyManagement.business.domain.WxLiveBill
;
import
com.propertyManagement.business.domain.WxRepairs
;
import
com.propertyManagement.business.domain.vo.LoginWxUser
;
import
com.propertyManagement.business.enums.PayBizEnum
;
import
com.propertyManagement.business.mapper.WxLiveBillMapper
;
import
com.propertyManagement.business.mapper.WxRepairsMapper
;
import
com.propertyManagement.business.support.util.AuthUtil
;
import
com.propertyManagement.common.enums.LiveBillState
;
import
com.propertyManagement.common.enums.PayState
;
import
com.propertyManagement.common.enums.RepairsState
;
import
com.propertyManagement.common.utils.StringUtils
;
import
com.propertyManagement.common.utils.StringUtils
;
import
com.propertyManagement.common.core.page.TableDataInfo
;
import
com.propertyManagement.common.core.page.TableDataInfo
;
import
com.propertyManagement.common.core.domain.PageQuery
;
import
com.propertyManagement.common.core.domain.PageQuery
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.propertyManagement.common.utils.ip.IpUtils
;
import
com.propertyManagement.pay.support.pay.CmsUnipayProvider
;
import
com.propertyManagement.pay.support.pay.PayReqModel
;
import
com.siashan.toolkit.core.enums.EnumUtil
;
import
com.siashan.toolkit.core.wrapper.AjaxResult
;
import
com.siashan.unipay4j.core.Result
;
import
com.siashan.unipay4j.core.TradeStateEnum
;
import
com.siashan.unipay4j.core.pay.IPayment
;
import
com.siashan.unipay4j.core.pay.PayModel
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.propertyManagement.business.domain.bo.WxPayRecordBo
;
import
com.propertyManagement.business.domain.bo.WxPayRecordBo
;
...
@@ -15,6 +34,7 @@ import com.propertyManagement.business.domain.WxPayRecord;
...
@@ -15,6 +34,7 @@ import com.propertyManagement.business.domain.WxPayRecord;
import
com.propertyManagement.business.mapper.WxPayRecordMapper
;
import
com.propertyManagement.business.mapper.WxPayRecordMapper
;
import
com.propertyManagement.business.service.IWxPayRecordService
;
import
com.propertyManagement.business.service.IWxPayRecordService
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Collection
;
import
java.util.Collection
;
...
@@ -30,6 +50,8 @@ import java.util.Collection;
...
@@ -30,6 +50,8 @@ import java.util.Collection;
public
class
WxPayRecordServiceImpl
implements
IWxPayRecordService
{
public
class
WxPayRecordServiceImpl
implements
IWxPayRecordService
{
private
final
WxPayRecordMapper
baseMapper
;
private
final
WxPayRecordMapper
baseMapper
;
private
final
WxLiveBillMapper
liveBillMapper
;
private
final
WxRepairsMapper
repairsMapper
;
/**
/**
* 查询缴费记录
* 查询缴费记录
...
@@ -58,6 +80,84 @@ public class WxPayRecordServiceImpl implements IWxPayRecordService {
...
@@ -58,6 +80,84 @@ public class WxPayRecordServiceImpl implements IWxPayRecordService {
return
baseMapper
.
selectVoList
(
lqw
);
return
baseMapper
.
selectVoList
(
lqw
);
}
}
/**
* 新增缴费记录
*
* @param reqModel
*/
@Override
public
Result
<
Object
>
pay
(
PayReqModel
reqModel
)
{
PayBizEnum
payBiz
=
EnumUtil
.
getEnum
(
PayBizEnum
.
class
,
reqModel
.
getPayBizCode
());
Long
orderId
=
null
;
BigDecimal
payAmount
=
BigDecimal
.
ZERO
;
String
outTradeNo
=
null
;
switch
(
payBiz
)
{
case
PRESTORE:
WxLiveBill
wxLiveBill
=
liveBillMapper
.
selectById
(
reqModel
.
getOrderId
());
if
(
null
==
wxLiveBill
)
{
throw
new
RuntimeException
(
"订单信息不存在,请刷新后重试"
);
}
if
(
LiveBillState
.
YES
.
getCode
().
equals
(
wxLiveBill
.
getState
()))
{
throw
new
RuntimeException
(
"订单已支付,无需重新支付!"
);
}
if
(
reqModel
.
getAmount
().
doubleValue
()
!=
wxLiveBill
.
getMoney
().
doubleValue
())
{
throw
new
RuntimeException
(
"支付金额不匹配"
);
}
orderId
=
wxLiveBill
.
getBillId
();
payAmount
=
wxLiveBill
.
getMoney
();
break
;
case
MAINTAIN:
WxRepairs
wxRepairs
=
repairsMapper
.
selectById
(
reqModel
.
getOrderId
());
if
(
null
==
wxRepairs
)
{
throw
new
RuntimeException
(
"订单信息不存在,请刷新后重试"
);
}
if
(
RepairsState
.
TWO
.
getCode
().
equals
(
wxRepairs
.
getState
()))
{
throw
new
RuntimeException
(
"订单状态错误,请刷新后重试!"
);
}
if
(
reqModel
.
getAmount
().
doubleValue
()
!=
wxRepairs
.
getMoney
().
doubleValue
())
{
throw
new
RuntimeException
(
"支付金额不匹配"
);
}
orderId
=
wxRepairs
.
getRepairsId
();
payAmount
=
wxRepairs
.
getMoney
();
break
;
default
:
throw
new
RuntimeException
(
"支付失败,类型错误"
);
}
WxPayRecord
record
=
createPayRecord
(
orderId
,
payAmount
);
IPayment
payment
=
CmsUnipayProvider
.
getPayment
(
orderId
,
reqModel
.
getPayChannelCode
(),
reqModel
.
getPayMchCode
(),
reqModel
.
getPayAppCode
(),
reqModel
.
getPayBizCode
());
PayModel
payModel
=
getPayModel
(
record
);
return
payment
.
pay
(
payModel
);
}
private
WxPayRecord
createPayRecord
(
Long
orderId
,
BigDecimal
payAmount
)
{
LoginWxUser
wxUser
=
AuthUtil
.
getWxUser
();
WxPayRecord
record
=
new
WxPayRecord
();
record
.
setOrderId
(
orderId
);
record
.
setPayAmount
(
payAmount
);
record
.
setPayState
(
PayState
.
WAIT
.
getCode
());
record
.
setUserId
(
wxUser
.
getId
());
record
.
setUserName
(
wxUser
.
getNickName
());
record
.
setProprietorId
(
wxUser
.
getProprietorId
());
record
.
setProprietorName
(
wxUser
.
getName
());
record
.
setRoom
(
wxUser
.
getRoom
());
record
.
setCommunityId
(
wxUser
.
getCommunityId
());
record
.
setCommunityName
(
wxUser
.
getCommunityName
());
baseMapper
.
insert
(
record
);
return
record
;
}
private
PayModel
getPayModel
(
WxPayRecord
record
)
{
LoginWxUser
wxUser
=
AuthUtil
.
getWxUser
();
PayModel
payModel
=
new
PayModel
();
payModel
.
setPrice
(
record
.
getPayAmount
());
payModel
.
setOpenid
(
wxUser
.
getOpenId
());
payModel
.
setOutTradeNo
(
record
.
getOutTradeNo
());
payModel
.
setBody
(
"订单支付"
);
payModel
.
setSubject
(
"订单支付"
);
payModel
.
setSpbillCreateIp
(
IpUtils
.
getIpAddr
());
return
payModel
;
}
private
LambdaQueryWrapper
<
WxPayRecord
>
buildQueryWrapper
(
WxPayRecordBo
bo
)
{
private
LambdaQueryWrapper
<
WxPayRecord
>
buildQueryWrapper
(
WxPayRecordBo
bo
)
{
Map
<
String
,
Object
>
params
=
bo
.
getParams
();
Map
<
String
,
Object
>
params
=
bo
.
getParams
();
LambdaQueryWrapper
<
WxPayRecord
>
lqw
=
Wrappers
.
lambdaQuery
();
LambdaQueryWrapper
<
WxPayRecord
>
lqw
=
Wrappers
.
lambdaQuery
();
...
@@ -67,8 +167,8 @@ public class WxPayRecordServiceImpl implements IWxPayRecordService {
...
@@ -67,8 +167,8 @@ public class WxPayRecordServiceImpl implements IWxPayRecordService {
lqw
.
like
(
StringUtils
.
isNotBlank
(
bo
.
getProprietorName
()),
WxPayRecord:
:
getProprietorName
,
bo
.
getProprietorName
());
lqw
.
like
(
StringUtils
.
isNotBlank
(
bo
.
getProprietorName
()),
WxPayRecord:
:
getProprietorName
,
bo
.
getProprietorName
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getRoom
()),
WxPayRecord:
:
getRoom
,
bo
.
getRoom
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getRoom
()),
WxPayRecord:
:
getRoom
,
bo
.
getRoom
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPlateNumber
()),
WxPayRecord:
:
getPlateNumber
,
bo
.
getPlateNumber
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPlateNumber
()),
WxPayRecord:
:
getPlateNumber
,
bo
.
getPlateNumber
());
lqw
.
eq
(
bo
.
get
BillId
()
!=
null
,
WxPayRecord:
:
getBillId
,
bo
.
getBill
Id
());
lqw
.
eq
(
bo
.
get
OrderId
()
!=
null
,
WxPayRecord:
:
getOrderId
,
bo
.
getOrder
Id
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getOrderType
())
,
WxPayRecord:
:
getOrderType
,
bo
.
getOrderType
());
lqw
.
eq
(
bo
.
getOrderType
()
!=
null
,
WxPayRecord:
:
getOrderType
,
bo
.
getOrderType
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPayChannelCode
()),
WxPayRecord:
:
getPayChannelCode
,
bo
.
getPayChannelCode
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPayChannelCode
()),
WxPayRecord:
:
getPayChannelCode
,
bo
.
getPayChannelCode
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPayMchCode
()),
WxPayRecord:
:
getPayMchCode
,
bo
.
getPayMchCode
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPayMchCode
()),
WxPayRecord:
:
getPayMchCode
,
bo
.
getPayMchCode
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPayTradeType
()),
WxPayRecord:
:
getPayTradeType
,
bo
.
getPayTradeType
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPayTradeType
()),
WxPayRecord:
:
getPayTradeType
,
bo
.
getPayTradeType
());
...
...
propertyManagement-business/src/main/resources/mapper/business/WxPayRecordMapper.xml
View file @
3efebfd8
...
@@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"proprietorName"
column=
"proprietor_name"
/>
<result
property=
"proprietorName"
column=
"proprietor_name"
/>
<result
property=
"room"
column=
"room"
/>
<result
property=
"room"
column=
"room"
/>
<result
property=
"plateNumber"
column=
"plate_number"
/>
<result
property=
"plateNumber"
column=
"plate_number"
/>
<result
property=
"
billId"
column=
"bill
_id"
/>
<result
property=
"
orderId"
column=
"order
_id"
/>
<result
property=
"orderType"
column=
"order_type"
/>
<result
property=
"orderType"
column=
"order_type"
/>
<result
property=
"payChannelCode"
column=
"pay_channel_code"
/>
<result
property=
"payChannelCode"
column=
"pay_channel_code"
/>
<result
property=
"payMchCode"
column=
"pay_mch_code"
/>
<result
property=
"payMchCode"
column=
"pay_mch_code"
/>
...
...
propertyManagement-common/src/main/java/com/propertyManagement/common/enums/PayState.java
View file @
3efebfd8
...
@@ -6,8 +6,9 @@ package com.propertyManagement.common.enums;
...
@@ -6,8 +6,9 @@ package com.propertyManagement.common.enums;
* @author liushuai
* @author liushuai
*/
*/
public
enum
PayState
{
public
enum
PayState
{
NO
(
1
,
"支付成功"
),
WAIT
(
0
,
"待支付"
),
YES
(
2
,
"支付失败"
);
YES
(
1
,
"支付成功"
),
NO
(
2
,
"支付失败"
);
private
final
Integer
code
;
private
final
Integer
code
;
...
...
propertyManagement-pay/src/main/java/com/propertyManagement/pay/service/IPayMerchantService.java
View file @
3efebfd8
...
@@ -53,4 +53,7 @@ public interface IPayMerchantService {
...
@@ -53,4 +53,7 @@ public interface IPayMerchantService {
* 校验并批量删除支付商户信息
* 校验并批量删除支付商户信息
*/
*/
Boolean
deleteWithValidByIds
(
Collection
<
Long
>
ids
,
Boolean
isValid
);
Boolean
deleteWithValidByIds
(
Collection
<
Long
>
ids
,
Boolean
isValid
);
void
syncEdit
(
CmsPayMerchantBo
bo
);
}
}
propertyManagement-pay/src/main/java/com/propertyManagement/pay/service/impl/PayMerchantServiceImpl.java
View file @
3efebfd8
package
com
.
propertyManagement
.
pay
.
service
.
impl
;
package
com
.
propertyManagement
.
pay
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.propertyManagement.common.enums.IsEnableType
;
import
com.propertyManagement.common.enums.IsEnableType
;
import
com.propertyManagement.common.utils.StringUtils
;
import
com.propertyManagement.common.utils.StringUtils
;
import
com.propertyManagement.common.core.page.TableDataInfo
;
import
com.propertyManagement.common.core.page.TableDataInfo
;
...
@@ -8,6 +9,8 @@ import com.propertyManagement.common.core.domain.PageQuery;
...
@@ -8,6 +9,8 @@ import com.propertyManagement.common.core.domain.PageQuery;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.propertyManagement.pay.domain.CmsPayApp
;
import
com.propertyManagement.pay.mapper.PayAppMapper
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.propertyManagement.pay.domain.bo.CmsPayMerchantBo
;
import
com.propertyManagement.pay.domain.bo.CmsPayMerchantBo
;
...
@@ -31,6 +34,7 @@ import java.util.Collection;
...
@@ -31,6 +34,7 @@ import java.util.Collection;
public
class
PayMerchantServiceImpl
implements
IPayMerchantService
{
public
class
PayMerchantServiceImpl
implements
IPayMerchantService
{
private
final
PayMerchantMapper
baseMapper
;
private
final
PayMerchantMapper
baseMapper
;
private
final
PayAppMapper
payAppMapper
;
/**
/**
* 查询支付商户
* 查询支付商户
...
@@ -131,4 +135,17 @@ public class PayMerchantServiceImpl implements IPayMerchantService {
...
@@ -131,4 +135,17 @@ public class PayMerchantServiceImpl implements IPayMerchantService {
}
}
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
}
/**
* @param cmsPayMerchant
*/
@Override
public
void
syncEdit
(
CmsPayMerchantBo
cmsPayMerchant
)
{
updateByBo
(
cmsPayMerchant
);
LambdaUpdateWrapper
<
CmsPayApp
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
set
(
CmsPayApp:
:
getAppConfig
,
cmsPayMerchant
.
getMerchantConfig
());
wrapper
.
eq
(
CmsPayApp:
:
getMerchantCode
,
cmsPayMerchant
.
getMerchantCode
());
payAppMapper
.
update
(
wrapper
);
}
}
}
propertyManagement-ui/src/views/business/payRecord/index.vue
View file @
3efebfd8
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
<el-form-item
label=
"订单类型"
prop=
"orderType"
>
<el-form-item
label=
"订单类型"
prop=
"orderType"
>
<el-select
v-model=
"queryParams.orderType"
placeholder=
"请选择订单类型"
clearable
>
<el-select
v-model=
"queryParams.orderType"
placeholder=
"请选择订单类型"
clearable
>
<el-option
<el-option
v-for=
"dict in dict.type.wx_
live_bill
_type"
v-for=
"dict in dict.type.wx_
pay_record
_type"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<el-form-item
label=
"支付状态"
prop=
"payState"
>
<el-form-item
label=
"支付状态"
prop=
"payState"
>
<el-select
v-model=
"queryParams.payState"
placeholder=
"请选择支付状态"
clearable
>
<el-select
v-model=
"queryParams.payState"
placeholder=
"请选择支付状态"
clearable
>
<el-option
<el-option
v-for=
"dict in dict.type.wx_pay_record"
v-for=
"dict in dict.type.wx_pay_record
_state
"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -131,7 +131,7 @@
...
@@ -131,7 +131,7 @@
<el-table-column
label=
"订单金额"
align=
"center"
prop=
"payAmount"
/>
<el-table-column
label=
"订单金额"
align=
"center"
prop=
"payAmount"
/>
<el-table-column
label=
"支付状态"
align=
"center"
prop=
"payState"
>
<el-table-column
label=
"支付状态"
align=
"center"
prop=
"payState"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.wx_pay_record"
:value=
"scope.row.payState"
/>
<dict-tag
:options=
"dict.type.wx_pay_record
_state
"
:value=
"scope.row.payState"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"平台支付流水号"
align=
"center"
prop=
"outTradeNo"
/>
<el-table-column
label=
"平台支付流水号"
align=
"center"
prop=
"outTradeNo"
/>
...
@@ -191,7 +191,7 @@
...
@@ -191,7 +191,7 @@
<el-form-item
label=
"订单类型"
prop=
"orderType"
>
<el-form-item
label=
"订单类型"
prop=
"orderType"
>
<el-select
v-model=
"form.orderType"
placeholder=
"请选择订单类型"
>
<el-select
v-model=
"form.orderType"
placeholder=
"请选择订单类型"
>
<el-option
<el-option
v-for=
"dict in dict.type.wx_
live_bill
_type"
v-for=
"dict in dict.type.wx_
pay_record
_type"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -216,7 +216,7 @@
...
@@ -216,7 +216,7 @@
<el-form-item
label=
"支付状态"
prop=
"payState"
>
<el-form-item
label=
"支付状态"
prop=
"payState"
>
<el-select
v-model=
"form.payState"
placeholder=
"请选择支付状态"
>
<el-select
v-model=
"form.payState"
placeholder=
"请选择支付状态"
>
<el-option
<el-option
v-for=
"dict in dict.type.wx_pay_record"
v-for=
"dict in dict.type.wx_pay_record
_state
"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -244,7 +244,7 @@ import {listCommunityAll} from "@/api/business/community";
...
@@ -244,7 +244,7 @@ import {listCommunityAll} from "@/api/business/community";
export
default
{
export
default
{
name
:
"
PayRecord
"
,
name
:
"
PayRecord
"
,
dicts
:
[
'
wx_pay_record
'
,
'
wx_live_bill
_type
'
],
dicts
:
[
'
wx_pay_record
_state
'
,
'
wx_pay_record
_type
'
],
data
()
{
data
()
{
return
{
return
{
// 按钮loading
// 按钮loading
...
...
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