|
|
@@ -1366,16 +1366,16 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public R<Boolean> applyRefund(Integer clientUserId, Integer orderId, String applyRefundReason) {
|
|
|
+ public R<Boolean> applyRefund(String clientUserId, String orderId, String applyRefundReason) {
|
|
|
log.info("开始申请退款,用户ID={}, 订单ID={}", clientUserId, orderId);
|
|
|
|
|
|
// 1. 参数校验
|
|
|
- if (clientUserId == null || clientUserId <= 0) {
|
|
|
+ if (!StringUtils.hasText(clientUserId)) {
|
|
|
log.warn("申请退款失败:用户ID为空或无效,clientUserId={}", clientUserId);
|
|
|
return R.fail("用户ID不能为空");
|
|
|
}
|
|
|
|
|
|
- if (orderId == null || orderId <= 0) {
|
|
|
+ if (!StringUtils.hasText(orderId)) {
|
|
|
log.warn("申请退款失败:订单ID为空或无效,orderId={}", orderId);
|
|
|
return R.fail("订单ID不能为空");
|
|
|
}
|
|
|
@@ -1388,7 +1388,7 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
}
|
|
|
|
|
|
// 3. 订单归属校验:订单必须属于该用户
|
|
|
- if (!clientUserId.equals(order.getClientUserId())) {
|
|
|
+ if (!clientUserId.equals(order.getClientUserId().toString())) {
|
|
|
log.warn("申请退款失败:订单不属于该用户,订单ID={}, 订单用户ID={}, 请求用户ID={}",
|
|
|
orderId, order.getClientUserId(), clientUserId);
|
|
|
return R.fail("订单不属于该用户,无法申请退款");
|
|
|
@@ -1457,16 +1457,16 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public R<Boolean> completeOrder(Integer clientUserId, Integer orderId) {
|
|
|
+ public R<Boolean> completeOrder(String clientUserId, String orderId) {
|
|
|
log.info("开始完成订单,用户ID={}, 订单ID={}", clientUserId, orderId);
|
|
|
|
|
|
// 1. 参数校验
|
|
|
- if (clientUserId == null || clientUserId <= 0) {
|
|
|
+ if (StringUtils.isEmpty(clientUserId)) {
|
|
|
log.warn("完成订单失败:用户ID为空或无效,clientUserId={}", clientUserId);
|
|
|
return R.fail("用户ID不能为空");
|
|
|
}
|
|
|
|
|
|
- if (orderId == null || orderId <= 0) {
|
|
|
+ if (StringUtils.isEmpty(orderId)) {
|
|
|
log.warn("完成订单失败:订单ID为空或无效,orderId={}", orderId);
|
|
|
return R.fail("订单ID不能为空");
|
|
|
}
|
|
|
@@ -1479,7 +1479,7 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
}
|
|
|
|
|
|
// 3. 订单归属校验:订单必须属于该用户
|
|
|
- if (!clientUserId.equals(order.getClientUserId())) {
|
|
|
+ if (!clientUserId.equals(order.getClientUserId().toString())) {
|
|
|
log.warn("完成订单失败:订单不属于该用户,订单ID={}, 订单用户ID={}, 请求用户ID={}",
|
|
|
orderId, order.getClientUserId(), clientUserId);
|
|
|
return R.fail("订单不属于该用户,无法完成订单");
|
|
|
@@ -1539,7 +1539,7 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
* @param order 订单对象
|
|
|
* @param clientUserId 客户端用户ID
|
|
|
*/
|
|
|
- private void sendRefundApplyNotice(LawyerConsultationOrder order, Integer clientUserId) {
|
|
|
+ private void sendRefundApplyNotice(LawyerConsultationOrder order, String clientUserId) {
|
|
|
try {
|
|
|
LifeNotice lifeNotice = createRefundApplyNotice(order, clientUserId);
|
|
|
if (lifeNotice == null) {
|
|
|
@@ -1573,7 +1573,7 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
* @param clientUserId 客户端用户ID
|
|
|
* @return 通知对象,如果生成失败返回null
|
|
|
*/
|
|
|
- private LifeNotice createRefundApplyNotice(LawyerConsultationOrder order, Integer clientUserId) {
|
|
|
+ private LifeNotice createRefundApplyNotice(LawyerConsultationOrder order, String clientUserId) {
|
|
|
if (order == null || clientUserId == null) {
|
|
|
log.warn("创建退款申请通知失败,订单或用户ID为空");
|
|
|
return null;
|
|
|
@@ -1619,12 +1619,7 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
* @param clientUserId 客户端用户ID
|
|
|
* @return 接收人ID,格式:user_ + 手机号
|
|
|
*/
|
|
|
- private String getClientReceiverId(Integer clientUserId) {
|
|
|
- if (clientUserId == null || clientUserId <= 0) {
|
|
|
- log.warn("客户端用户ID为空或无效");
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
+ private String getClientReceiverId(String clientUserId) {
|
|
|
try {
|
|
|
LifeUser lifeUser = lifeUserMapper.selectById(clientUserId);
|
|
|
if (lifeUser != null && org.apache.commons.lang3.StringUtils.isNotEmpty(lifeUser.getUserPhone())) {
|