打印机接口修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.czg.account.dto.print.PrinterAddDTO;
|
||||
import com.czg.account.dto.print.PrinterDelDTO;
|
||||
import com.czg.account.dto.print.PrinterEditDTO;
|
||||
@@ -50,7 +51,13 @@ public class PrintMachineController {
|
||||
queryWrapper.eq(PrintMachine::getSubType, subType);
|
||||
}
|
||||
queryWrapper.orderBy(PrintMachine::getSort, true).orderBy(PrintMachine::getId, false);
|
||||
return CzgResult.success(printMachineService.page(PageUtil.buildPage(), queryWrapper));
|
||||
Page<PrintMachine> page = printMachineService.page(PageUtil.buildPage(), queryWrapper);
|
||||
page.getRecords().forEach(item -> {
|
||||
if (StrUtil.isNotBlank(item.getCategoryIds())) {
|
||||
item.setCategoryList(JSONArray.parse(item.getCategoryIds()));
|
||||
}
|
||||
});
|
||||
return CzgResult.success(page);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,7 +68,11 @@ public class PrintMachineController {
|
||||
@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())));
|
||||
PrintMachine printMachine = printMachineService.getOne(new QueryWrapper().eq(PrintMachine::getId, id).eq(PrintMachine::getShopId, StpKit.USER.getShopId()));
|
||||
if (printMachine != null && StrUtil.isNotBlank(printMachine.getCategoryIds())) {
|
||||
printMachine.setCategoryList(JSONArray.parse(printMachine.getCategoryIds()));
|
||||
}
|
||||
return CzgResult.success(printMachine);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user