fix(优化):退款订单新增照片和说明原因字段

This commit is contained in:
2025-05-13 11:40:57 +08:00
parent ab5e5414fc
commit b75884743f
10 changed files with 48 additions and 29 deletions
@@ -4,10 +4,10 @@ server:
spring: spring:
application: application:
name: device-center name: device-center
# cloud: cloud:
# nacos: nacos:
# discovery: discovery:
# ip: 119.45.169.13 ip: 119.45.169.13
# cloud: # cloud:
# nacos: # nacos:
# discovery: # discovery:
@@ -389,6 +389,7 @@ public class OrderController {
order.setFileMd5(deviceCenterService.getLineFileSign(waylineId)); order.setFileMd5(deviceCenterService.getLineFileSign(waylineId));
order.setWaylineLinkUrl(waylineFilePath); order.setWaylineLinkUrl(waylineFilePath);
order.setStreamUrls(deviceCenterService.getStreamUrls(order.getDeviceSn()));
return Result.succeed(order,"获取成功"); return Result.succeed(order,"获取成功");
} }
} }
@@ -559,7 +560,7 @@ public class OrderController {
detailMap.put("orderAmount", appendPriceStr(order.getOrderAmount())); detailMap.put("orderAmount", appendPriceStr(order.getOrderAmount()));
detailMap.put("createTime", sdf.format(order.getCreateTime())); detailMap.put("createTime", sdf.format(order.getCreateTime()));
detailMap.put("deviceSn", order.getDeviceSn()); detailMap.put("deviceSn", order.getDeviceSn());
detailMap.put("mobile", order.getMobile()); detailMap.put("mobile", userCenterService.findUserById(order.getUserId()).getMobile());
// 景区信息 // 景区信息
Map<String, Object> tourismMap = new HashMap<>(); Map<String, Object> tourismMap = new HashMap<>();
@@ -54,7 +54,7 @@ public class RefundController {
@Operation(summary = "创建退款单") @Operation(summary = "创建退款单")
@PostMapping("/{orderNo}") @PostMapping("/{orderNo}")
public Result<com.central.order.model.Refund> createRefundOrder(@PathVariable String orderNo) { public Result<com.central.order.model.Refund> createRefundOrder(@PathVariable String orderNo,@RequestBody com.central.order.model.Refund refundBody) {
Order order = orderService.getOrderByNumber(orderNo); Order order = orderService.getOrderByNumber(orderNo);
Assert.notNull(order,"ORDER DATA不存在"); Assert.notNull(order,"ORDER DATA不存在");
if (order.getOrderStatus().equals(OrderStatus.PAID.getId()) if (order.getOrderStatus().equals(OrderStatus.PAID.getId())
@@ -73,6 +73,8 @@ public class RefundController {
refund.setRefundAmount(order.getOrderAmount()); refund.setRefundAmount(order.getOrderAmount());
refund.setStatus(OrderStatus.REFUNDING.getId()); refund.setStatus(OrderStatus.REFUNDING.getId());
refund.setState(RefundState.APPROVING.getId()); refund.setState(RefundState.APPROVING.getId());
refund.setRefundReason(refundBody.getRefundReason());
refund.setRefundImgs(refundBody.getRefundImgs());
boolean res = refundService.createRefund(refund); boolean res = refundService.createRefund(refund);
if (res) { if (res) {
order.setOrderStatus(OrderStatus.REFUNDING.getId()); order.setOrderStatus(OrderStatus.REFUNDING.getId());
@@ -1,10 +1,12 @@
package com.central.order.feign; package com.central.order.feign;
import com.alibaba.fastjson.JSONObject;
import com.central.common.constant.ServiceNameConstants; import com.central.common.constant.ServiceNameConstants;
import com.central.order.feign.fallback.DeviceCenterServiceFallbackFactory; import com.central.order.feign.fallback.DeviceCenterServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
/** /**
* device-center模块远程调用 * device-center模块远程调用
@@ -26,4 +28,6 @@ public interface DeviceCenterService {
@GetMapping("/wayline/sign/{id}") @GetMapping("/wayline/sign/{id}")
String getLineFileSign(@PathVariable("id") String id); String getLineFileSign(@PathVariable("id") String id);
@GetMapping("/live/stream-urls")
JSONObject getStreamUrls(@RequestParam("deviceId") String deviceId) ;
} }
@@ -1,5 +1,6 @@
package com.central.order.feign.fallback; package com.central.order.feign.fallback;
import com.alibaba.fastjson.JSONObject;
import com.central.order.feign.DeviceCenterService; import com.central.order.feign.DeviceCenterService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.cloud.openfeign.FallbackFactory;
@@ -25,6 +26,11 @@ public class DeviceCenterServiceFallbackFactory implements FallbackFactory<Devic
public String getLineFileSign(String id) { public String getLineFileSign(String id) {
return ""; return "";
} }
@Override
public JSONObject getStreamUrls(String deviceId) {
return null;
}
}; };
} }
} }
@@ -154,6 +154,7 @@ public class OrderStatusChangeListener {
/** /**
* 处理支付成功逻辑 * 处理支付成功逻辑
*/ */
private void handlePaymentSuccess(Order order, Tourism tourism) { private void handlePaymentSuccess(Order order, Tourism tourism) {
try { try {
// 1. 发送微信通知 // 1. 发送微信通知
@@ -1,5 +1,6 @@
package com.central.order.model; package com.central.order.model;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
@@ -51,6 +52,7 @@ public class Order extends SuperEntity {
private Integer isDel; private Integer isDel;
private transient String waylineLinkUrl; private transient String waylineLinkUrl;
private transient JSONObject streamUrls;
} }
@@ -29,6 +29,9 @@ public class WxMiniSubscribeServiceImpl implements WxMiniSubscribeService {
@Autowired @Autowired
private IWxAccessTokenService wxAccessTokenService; private IWxAccessTokenService wxAccessTokenService;
// @Retryable(value = {ConnectException.class, SocketTimeoutException.class},
// maxAttempts = 3,
// backoff = @Backoff(delay = 2000))
@Override @Override
public void sendPaySuccessMsg(String openId, String orderName, String orderNo, String tip, String amount, String orderTime) { public void sendPaySuccessMsg(String openId, String orderName, String orderNo, String tip, String amount, String orderTime) {
try { try {
@@ -48,7 +51,7 @@ public class WxMiniSubscribeServiceImpl implements WxMiniSubscribeService {
body.put("touser", openId); body.put("touser", openId);
body.put("template_id", templateId); body.put("template_id", templateId);
body.put("data", data); body.put("data", data);
// body.put("page", "pages/order/detail?orderNo=" + orderNo); // 可选跳转 body.put("page", "pages/task/task"); // 可选跳转
String resp = restTemplate.postForObject(url, body, String.class); String resp = restTemplate.postForObject(url, body, String.class);
log.info("小程序支付成功订阅消息发送结果: {}", resp); log.info("小程序支付成功订阅消息发送结果: {}", resp);
@@ -1,13 +1,13 @@
########################## bootstrap级别通用配置 ########################## ########################## bootstrap级别通用配置 ##########################
# 默认开发环境 # 默认开发环境
spring.profiles.active=dev spring.profiles.active=prod
##### nacos(注册中心和配置中心)地址 ##### nacos(注册中心和配置中心)地址
#spring.cloud.nacos.server-addr=81.70.164.178:8848 spring.cloud.nacos.server-addr=81.70.164.178:8848
spring.cloud.nacos.server-addr=127.0.0.1:8848 #spring.cloud.nacos.server-addr=127.0.0.1:8848
spring.cloud.nacos.username=nacos spring.cloud.nacos.username=nacos
spring.cloud.nacos.password=nacos #spring.cloud.nacos.password=nacos
#spring.cloud.nacos.password=nacosGFLY spring.cloud.nacos.password=nacosGFLY
spring.cloud.nacos.config.file-extension=yml spring.cloud.nacos.config.file-extension=yml
spring.cloud.nacos.config.shared-configs[0].data-id=common.yml spring.cloud.nacos.config.shared-configs[0].data-id=common.yml
spring.cloud.nacos.config.shared-configs[0].refresh=true spring.cloud.nacos.config.shared-configs[0].refresh=true
@@ -9,43 +9,43 @@
export default { export default {
dev: { dev: {
'/api-uaa/': { '/api-uaa/': {
// target: 'http://119.45.169.13:9900', target: 'http://119.45.169.13:9900',
target: 'http://127.0.0.1:9900', // target: 'http://127.0.0.1:9900',
changeOrigin: true, changeOrigin: true,
}, },
'/api-user/': { '/api-user/': {
// target: 'http://119.45.169.13:9900', target: 'http://119.45.169.13:9900',
target: 'http://127.0.0.1:9900', // target: 'http://127.0.0.1:9900',
changeOrigin: true, changeOrigin: true,
}, },
'/api-log/': { '/api-log/': {
// target: 'http://119.45.169.13:9900', target: 'http://119.45.169.13:9900',
target: 'http://127.0.0.1:9900', // target: 'http://127.0.0.1:9900',
changeOrigin: true, changeOrigin: true,
}, },
'/api-search/': { '/api-search/': {
// target: 'http://119.45.169.13:9900', target: 'http://119.45.169.13:9900',
target: 'http://127.0.0.1:9900', // target: 'http://127.0.0.1:9900',
changeOrigin: true, changeOrigin: true,
}, },
'/api-generator/': { '/api-generator/': {
// target: 'http://119.45.169.13:9900', target: 'http://119.45.169.13:9900',
target: 'http://127.0.0.1:9900', // target: 'http://127.0.0.1:9900',
changeOrigin: true, changeOrigin: true,
}, },
'/api-file/': { '/api-file/': {
// target: 'http://119.45.169.13:9900', target: 'http://119.45.169.13:9900',
target: 'http://127.0.0.1:9900', // target: 'http://127.0.0.1:9900',
changeOrigin: true, changeOrigin: true,
}, },
'/api-order/': { '/api-order/': {
// target: 'http://119.45.169.13:9900', target: 'http://119.45.169.13:9900',
target: 'http://127.0.0.1:9900', // target: 'http://127.0.0.1:9900',
changeOrigin: true, changeOrigin: true,
}, },
'/api-device/': { '/api-device/': {
// target: 'http://119.45.169.13:9900', target: 'http://119.45.169.13:9900',
target: 'http://127.0.0.1:9900', // target: 'http://127.0.0.1:9900',
changeOrigin: true, changeOrigin: true,
}, },
}, },