打印机维护

master
zpl 3 years ago
parent 90d507d83b
commit 338a4fbe40

@ -4,6 +4,7 @@ package com.foreverwin.mesnac.common.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.model.Printer; import com.foreverwin.mesnac.common.model.Printer;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.R; import com.foreverwin.modular.core.util.R;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -66,7 +67,7 @@ public class PrinterController {
@ResponseBody @ResponseBody
@PostMapping("/savePrinter") @PostMapping("/savePrinter")
public R savePrinter(Printer printer) { public R savePrinter(@RequestBody Printer printer) {
try { try {
LocalDateTime nowDate = LocalDateTime.now(); LocalDateTime nowDate = LocalDateTime.now();
String site = CommonMethods.getSite(); String site = CommonMethods.getSite();
@ -90,4 +91,22 @@ public class PrinterController {
return R.ok(); return R.ok();
} }
@ResponseBody
@PostMapping("/delPrinter")
public R delPrinter(Printer printer) {
try {
String site = CommonMethods.getSite();
String handle = HandleEnum.PRINT.getHandle(site, printer.getPrinter());
Printer printerModel = printerService.getById(handle);
if (printerModel == null) {
throw BusinessException.build("请先检索再删除!");
} else {
printerService.removeById(printerModel);
}
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok();
}
} }

@ -20,7 +20,7 @@ public enum HandleEnum {
/**物料清单**/ /**物料清单**/
BOM("BOMBO:","BOMBO:{0},{1},{2},{3}"), BOM("BOMBO:","BOMBO:{0},{1},{2},{3}"),
PRINT("PrintBO:", "StatusBO:{0},{1}"), PRINT("PrintBO:", "PrintBO:{0},{1}"),
/**叫料**/ /**叫料**/
CALL_ITEM("CallItemBO:", "CallItemBO:{0},{1}"), CALL_ITEM("CallItemBO:", "CallItemBO:{0},{1}"),

Loading…
Cancel
Save