打印 调整

This commit is contained in:
2026-04-15 18:17:41 +08:00
parent 44f896168f
commit 45fbdd514e
33 changed files with 1887 additions and 1155 deletions

View File

@@ -102,8 +102,8 @@ public class HandoverRecordController {
@OperationLog("收银机-交班/关班")
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:handover", name = "收银机-交班/关班")
public CzgResult<Long> handover(@RequestParam Integer isPrint) {
Long id = handoverRecordService.handover();
handoverRecordService.printHandoverReceipt(id, isPrint);
return CzgResult.success(id);
HandoverRecord handoverRecord = handoverRecordService.handover();
handoverRecordService.printHandoverReceipt(handoverRecord, isPrint);
return CzgResult.success(handoverRecord.getId());
}
}

View File

@@ -1,11 +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;
import com.czg.account.dto.print.PrinterOrderDTO;
import com.czg.account.entity.PrintMachine;
import com.czg.account.service.PrintMachineService;
import com.czg.annotation.SaAdminCheckPermission;
@@ -48,15 +44,10 @@ public class PrintMachineController {
}
if (StrUtil.isNotBlank(subType)) {
queryWrapper.eq(PrintMachine::getSubType, subType);
queryWrapper.eq(PrintMachine::getPrintType, subType);
}
queryWrapper.orderBy(PrintMachine::getSort, true).orderBy(PrintMachine::getId, false);
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);
}
@@ -73,15 +64,10 @@ public class PrintMachineController {
}
queryWrapper.in(PrintMachine::getConnectionType, "USB", "局域网");
if (StrUtil.isNotBlank(subType)) {
queryWrapper.eq(PrintMachine::getSubType, subType);
queryWrapper.eq(PrintMachine::getPrintType, subType);
}
queryWrapper.orderBy(PrintMachine::getSort, true).orderBy(PrintMachine::getId, false);
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);
}
@@ -94,9 +80,6 @@ public class PrintMachineController {
@GetMapping("/detail")
public CzgResult<PrintMachine> detail(@RequestParam Integer id) {
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);
}
@@ -107,7 +90,7 @@ public class PrintMachineController {
*/
@SaAdminCheckPermission(parentName = "打印机管理", value = "printer:add", name = "打印机新增")
@PostMapping
public CzgResult<Boolean> add(@RequestBody @Validated PrinterAddDTO printerAddDTO) {
public CzgResult<Boolean> add(@RequestBody @Validated PrintMachine printerAddDTO) {
return CzgResult.success(printMachineService.add(StpKit.USER.getShopId(), printerAddDTO));
}
@@ -117,7 +100,7 @@ public class PrintMachineController {
*/
@SaAdminCheckPermission(parentName = "打印机管理", value = "printer:edit", name = "打印机编辑")
@PutMapping
public CzgResult<Boolean> edit(@RequestBody @Validated PrinterEditDTO printerEditDTO) {
public CzgResult<Boolean> edit(@RequestBody @Validated PrintMachine printerEditDTO) {
return CzgResult.success(printMachineService.edit(StpKit.USER.getShopId(), printerEditDTO));
}