Browse Source

12-31 退红包增加价格参数

milestone-20251215-红包修改
lijianlin 1 week ago
parent
commit
424219d375
  1. 4
      src/main/java/com/example/demo/controller/Temporary/RedController.java
  2. 2
      src/main/java/com/example/demo/service/Temporary/RedService.java
  3. 5
      src/main/java/com/example/demo/serviceImpl/Temporary/RedServiceImpl.java
  4. 2
      src/main/java/com/example/demo/serviceImpl/coin/AuditServiceImpl.java

4
src/main/java/com/example/demo/controller/Temporary/RedController.java

@ -50,11 +50,11 @@ public class RedController {
@RequestMapping("/RedTest")
public Result selectRedTest(@RequestBody AuditRequest request) throws Exception {
try {
redService.checkRed(request.getLinkId());
redService.checkRed(request.getPrice(),request.getLinkId());
}
catch (Exception e) {
return Result.error(e.getMessage());
}
return Result.success(redService.checkRed(request.getLinkId()));
return Result.success(redService.checkRed(request.getPrice(),request.getLinkId()));
}
}

2
src/main/java/com/example/demo/service/Temporary/RedService.java

@ -26,7 +26,7 @@ public interface RedService {
List<RedList> selectRedList(Integer jwcode);
//判断红包是否退票情况
String checkRed(String linkId) throws Exception;
String checkRed(BigDecimal price,String linkId) throws Exception;
//修改订单状态
void updateOrderStatus(String linkId) throws Exception;
}

5
src/main/java/com/example/demo/serviceImpl/Temporary/RedServiceImpl.java

@ -230,10 +230,11 @@ public class RedServiceImpl implements RedService {
}
@Override
public String checkRed(String linkId)throws Exception {
public String checkRed(BigDecimal price,String linkId)throws Exception {
try {
// 构造 参数order_id=L125
String body = "{\"order_id\":\"" + linkId + "\"}";
String body = "{\"order_id\":\"" + linkId + "\",\"amount\":" + price.divideToIntegralValue(BigDecimal.valueOf(100)).intValue() + "}";
/* // 从当前请求中获取 Authorization关键
ServletRequestAttributes attrs =

2
src/main/java/com/example/demo/serviceImpl/coin/AuditServiceImpl.java

@ -149,7 +149,7 @@ public class AuditServiceImpl implements AuditService {
}else if (order.getType()==2) { //退款
//退红包校验
try {
redService.checkRed(linkId);
redService.checkRed(price,linkId);
} catch (Exception e) {
log.error("红包退票失败");
updateOrder.setAuditStatus(4);

Loading…
Cancel
Save