优惠券 出入

This commit is contained in:
2025-02-17 14:51:26 +08:00
parent 00f83f0e2d
commit ef3cbe85b1
34 changed files with 1224 additions and 24 deletions

View File

@@ -0,0 +1,54 @@
package com.czg.controller.admin;
import com.czg.account.dto.ShopActivateDTO;
import com.czg.account.service.ShopActivateService;
import com.czg.annotation.SaAdminCheckPermission;
import com.czg.resp.CzgResult;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 店铺充值活动管理
* @author ww
* @description
*/
@RestController
@RequestMapping("/admin/activate")
public class ShopActivateController {
@Resource
private ShopActivateService shopActivateService;
/**
* 店铺充值活动列表
* 权限标识: activate:list
*/
@SaAdminCheckPermission("activate:list")
@GetMapping
public CzgResult<List<ShopActivateDTO>> detail() {
return CzgResult.success(shopActivateService.getList());
}
/**
* 店铺充值活动新增
* 权限标识: activate:add
*/
@SaAdminCheckPermission("activate:add")
@PutMapping
public CzgResult<Boolean> add(@RequestBody @Validated ShopActivateDTO activateDTO) {
return CzgResult.success(shopActivateService.add(activateDTO));
}
/**
* 店铺充值活动修改
* 权限标识: activate:edit
*/
@SaAdminCheckPermission("activate:edit")
@PutMapping
public CzgResult<Boolean> edit(@RequestBody @Validated ShopActivateDTO activateDTO) {
return CzgResult.success(shopActivateService.edit(activateDTO));
}
}

View File

@@ -0,0 +1,20 @@
package com.czg.controller.admin;
import com.czg.account.service.ShopCouponService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author ww
* @description
*/
@RestController
@RequestMapping("/admin/coupon")
public class ShopCouponController {
@Resource
private ShopCouponService couponService;
}

View File

@@ -0,0 +1,31 @@
package com.czg.controller.user;
import com.czg.account.dto.ShopActivateDTO;
import com.czg.account.service.ShopActivateService;
import com.czg.resp.CzgResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 店铺充值活动管理
* @author ww
*/
@RestController
@RequestMapping("/user/activate")
public class UserShopActivateController {
@Resource
private ShopActivateService shopActivateService;
/**
* 店铺充值活动列表
*/
@GetMapping
public CzgResult<List<ShopActivateDTO>> detail() {
return CzgResult.success(shopActivateService.getList());
}
}

View File

@@ -1,9 +1,12 @@
package com.czg.controller.user;
import com.czg.order.dto.OrderInfoQueryDTO;
import com.czg.order.entity.OrderInfo;
import com.czg.order.service.OrderInfoService;
import com.czg.order.vo.OrderInfoVo;
import com.czg.resp.CzgResult;
import com.czg.sa.StpKit;
import com.czg.utils.AssertUtil;
import com.mybatisflex.core.paginate.Page;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
@@ -11,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
/**
* 订单管理
*
* @author ww
* @description
*/
@@ -25,7 +29,27 @@ public class UserOrderController {
* 订单列表
*/
@PostMapping
public CzgResult<Page<OrderInfoVo>> get(@RequestBody OrderInfoQueryDTO queryDTO) {
public CzgResult<Page<OrderInfoVo>> getOrderPage(@RequestBody OrderInfoQueryDTO queryDTO) {
queryDTO.setIsDel(1);
queryDTO.setUserId(StpKit.USER.getLoginIdAsLong());
return CzgResult.success(orderInfoService.getOrderByPage(queryDTO));
}
@PostMapping
public CzgResult<Void> createOrder(@RequestBody OrderInfoQueryDTO queryDTO) {
queryDTO.setIsDel(1);
queryDTO.setUserId(StpKit.USER.getLoginIdAsLong());
return CzgResult.success();
}
@PutMapping("{id}")
public CzgResult<Void> upOrderIsDel(@PathVariable("id") Long id) {
//效验数据
AssertUtil.isNull(id, "{}不能为空", "订单Id");
orderInfoService.updateChain()
.set(OrderInfo::getIsDel, 1)
.eq(OrderInfoVo::getId, id)
.update();
return CzgResult.success();
}
}

View File

@@ -18,6 +18,7 @@ public class RabbitmqReceiver {
/**
* 消费者监听,绑定队列
* Queue RabbitConfig类的 orderPrintQueue
*/
@RabbitListener(
bindings = @QueueBinding(value = @Queue(value = "#{orderPrintQueue.name}", durable = "true",
@@ -26,11 +27,9 @@ public class RabbitmqReceiver {
concurrency = "10"
)
@RabbitHandler
public void receiveOrderPrintQueue(Channel channel, String payload, Message message) throws IOException {
public void receiveOrderPrintQueue(Channel channel, String orderId, Message message) throws IOException {
try {
System.out.println("Topic模式(orderPrintQueue)消费者收到消息: " + message);
System.out.println(payload);
log.info("订单监听 消息体:{},消息内容:{}", message, orderId);
// 手动确认消息multiple 参数表示是否批量确认
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
} catch (Exception e) {