diff --git a/cash-api/order-server/src/main/java/com/czg/controller/NotifyController.java b/cash-api/order-server/src/main/java/com/czg/controller/NotifyController.java index 435d84022..318f886ae 100644 --- a/cash-api/order-server/src/main/java/com/czg/controller/NotifyController.java +++ b/cash-api/order-server/src/main/java/com/czg/controller/NotifyController.java @@ -4,8 +4,12 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.IoUtil; import com.alibaba.fastjson2.JSONObject; import com.czg.CzgPayUtils; +import com.czg.account.service.ShopInfoService; import com.czg.entity.CzgBaseRespParams; +import com.czg.market.entity.MkShopConsumeDiscountRecord; import com.czg.market.service.MkDistributionUserService; +import com.czg.market.service.MkShopConsumeDiscountRecordService; +import com.czg.order.entity.OrderInfo; import com.czg.order.entity.OrderPayment; import com.czg.order.service.OrderInfoService; import com.czg.order.service.OrderPaymentService; @@ -15,8 +19,10 @@ import com.mybatisflex.core.query.QueryWrapper; import jakarta.annotation.Resource; import jakarta.servlet.http.HttpServletRequest; import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.io.IOException; @@ -41,6 +47,15 @@ public class NotifyController { private MkDistributionUserService distributionUserService; @Resource private OrderPaymentService paymentService; + @Resource + private MkShopConsumeDiscountRecordService consumeDiscountRecordService; + + @RequestMapping("clear") + public String clear(@RequestParam Integer shopId) { + consumeDiscountRecordService.remove(new QueryWrapper().eq(MkShopConsumeDiscountRecord::getShopId, shopId)); + orderInfoService.remove(new QueryWrapper().eq(OrderInfo::getShopId, shopId)); + return "success"; + } @RequestMapping("/payCallBack")