PC打印机根据打印机类型 获取列表

This commit is contained in:
wangw 2024-04-03 15:48:52 +08:00
parent baedf85e77
commit 39a5096151
2 changed files with 27 additions and 0 deletions

View File

@ -37,6 +37,17 @@ public class TbPrintPCMachineController {
return tbPrintPCMachineService.queryByPage(tbPrintMachine);
}
/**
* 根据类型查询打印机列表
* subType 打印类型分类label标签cash小票kitchen出品
* connectionType local
* @return
*/
@GetMapping("/bySubType")
public Result queryBySubType(TbPrintPCMachine tbPrintPCMachine) {
return tbPrintPCMachineService.queryBySubType(tbPrintPCMachine);
}
/**
* 通过主键查询单条数据
*

View File

@ -79,6 +79,22 @@ public class TbPrintPCMachineService {
return Result.success(CodeEnum.SUCCESS, pageInfo);
}
public Result queryBySubType(TbPrintPCMachine tbPrintMachine) {
tbPrintMachine.setStatus(1);
List<TbPrintPCMachine> tbPrintMachines = tbPrintMachineMapper.queryAll(tbPrintMachine);
List<PrintMachineDto> printMachineList = new ArrayList<>();
for (TbPrintPCMachine printMachine : tbPrintMachines) {
PrintMachineDto tbPrintMachineVO = new PrintMachineDto();
if (StringUtils.isNotBlank(printMachine.getConfig())) {
tbPrintMachineVO.setConfig(JSON.parseObject(printMachine.getConfig(), PrintConfig.class));
}
BeanUtils.copyProperties(printMachine, tbPrintMachineVO);
printMachineList.add(tbPrintMachineVO);
}
return Result.success(CodeEnum.SUCCESS, printMachineList);
}
/**
* 新增数据
*