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