Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -39,13 +39,13 @@ public class PadProdController {
|
||||
|
||||
/**
|
||||
* 获取点餐详情
|
||||
* @param padProductCategory tb_pad_product_category Id
|
||||
* @param id tb_pad_product_category Id
|
||||
* @return 数据
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "padProd:detail", name = "pad点餐详情")
|
||||
@GetMapping("/detail")
|
||||
public CzgResult<PadDetailDTO> detail(Long padProductCategory) {
|
||||
return CzgResult.success(padProdService.detail(StpKit.USER.getShopId(), padProductCategory));
|
||||
public CzgResult<PadDetailDTO> detail(Long id) {
|
||||
return CzgResult.success(padProdService.detail(StpKit.USER.getShopId(), id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,7 @@ public class PadProdController {
|
||||
}
|
||||
|
||||
/**
|
||||
* pad点餐修改
|
||||
* pad点餐删除
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "padProd:del", name = "pad点餐删除")
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.account.dto.print.PrinterAddDTO;
|
||||
import com.czg.account.dto.print.PrinterDelDTO;
|
||||
import com.czg.account.dto.print.PrinterEditDTO;
|
||||
import com.czg.account.entity.PrintMachine;
|
||||
import com.czg.account.service.PrintMachineService;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 打印机管理
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/printer")
|
||||
public class PrintMachineController {
|
||||
@Resource
|
||||
private PrintMachineService printMachineService;
|
||||
|
||||
|
||||
/**
|
||||
* 打印机列表
|
||||
* @param name 名称
|
||||
* @param connectionType 类型 USB 网络 蓝牙
|
||||
* @return 打印机列表
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "printer:list", name = "打印机列表获取")
|
||||
@GetMapping
|
||||
public CzgResult<Page<PrintMachine>> list(String name, String connectionType) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper().eq(PrintMachine::getShopId, StpKit.USER.getShopId());
|
||||
if (StrUtil.isNotBlank(name)) {
|
||||
queryWrapper.like(PrintMachine::getName, name);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(connectionType)) {
|
||||
queryWrapper.eq(PrintMachine::getConnectionType, connectionType);
|
||||
}
|
||||
queryWrapper.orderBy(PrintMachine::getSort, true).orderBy(PrintMachine::getId, false);
|
||||
return CzgResult.success(printMachineService.page(PageUtil.buildPage(), queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印机详情
|
||||
* @param id 打印机id
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "printer:detail", name = "打印机详情获取")
|
||||
@GetMapping("/detail")
|
||||
public CzgResult<PrintMachine> detail(@RequestParam Integer id) {
|
||||
return CzgResult.success(printMachineService.getOne(new QueryWrapper().eq(PrintMachine::getId, id).eq(PrintMachine::getShopId, StpKit.USER.getShopId())));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 打印机新增
|
||||
* @return 打印机列表
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "printer:add", name = "打印机新增")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> list(@RequestBody @Validated PrinterAddDTO printerAddDTO) {
|
||||
return CzgResult.success(printMachineService.add(StpKit.USER.getShopId(), printerAddDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印机修改
|
||||
* @return 打印机列表
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "printer:edit", name = "打印机编辑")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated PrinterEditDTO printerEditDTO) {
|
||||
return CzgResult.success(printMachineService.edit(StpKit.USER.getShopId(), printerEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印机删除
|
||||
* @return 打印机列表
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "printer:del", name = "打印机删除")
|
||||
@DeleteMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated PrinterDelDTO printerDelDTO) {
|
||||
return CzgResult.success(printMachineService.remove(new QueryWrapper().eq(PrintMachine::getShopId, StpKit.USER.getShopId()).eq(PrintMachine::getId, printerDelDTO.getId())));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.order.dto.OrderInfoAddDTO;
|
||||
import com.czg.order.dto.OrderInfoQueryDTO;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.czg.order.vo.OrderInfoCreateVo;
|
||||
import com.czg.order.vo.OrderInfoVo;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.utils.ServletUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -36,10 +39,12 @@ public class UserOrderController {
|
||||
}
|
||||
|
||||
@PostMapping("/createOrder")
|
||||
public CzgResult<Void> createOrder(@RequestBody OrderInfoQueryDTO queryDTO) {
|
||||
queryDTO.setIsDel(1);
|
||||
queryDTO.setUserId(StpKit.USER.getLoginIdAsLong());
|
||||
return CzgResult.success();
|
||||
public CzgResult<OrderInfoCreateVo> createOrder(@RequestBody OrderInfoAddDTO addDto) {
|
||||
addDto.setPlatformType(ServletUtil.getHeaderIgnoreCase(ServletUtil.getRequest(), "platformType"));
|
||||
addDto.setUserId(StpKit.USER.getLoginIdAsLong());
|
||||
addDto.setShopId(StpKit.USER.getShopId());
|
||||
addDto.setOrderType("miniapp");
|
||||
return CzgResult.success(orderInfoService.createOrder(addDto));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
|
||||
Reference in New Issue
Block a user