feat:ms439打印机相关接口,增加小票打印机获取接口
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.dpkj.modules.print.controller;
|
||||
|
||||
import com.dpkj.common.dto.LexMarkResultDTO;
|
||||
import com.dpkj.common.vo.Result;
|
||||
import com.dpkj.modules.print.request.MS439Request;
|
||||
import com.dpkj.modules.print.service.MS439PrintService;
|
||||
import com.dpkj.modules.print.vo.PrinterStatus;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* MS439控制层,利盟打印机
|
||||
*
|
||||
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
|
||||
* @version 1.0
|
||||
* @since 2025-03-03 10:47:06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ms439")
|
||||
public class MS439Controller {
|
||||
|
||||
@Autowired
|
||||
private MS439PrintService ms439PrintService;
|
||||
|
||||
@PostMapping("/print")
|
||||
public Result<LexMarkResultDTO<?>> print(@Validated @RequestBody MS439Request request){
|
||||
return Result.ok(ms439PrintService.printImage(request));
|
||||
}
|
||||
|
||||
@PostMapping("/getStatus")
|
||||
public Result<String> print(){
|
||||
this.ms439PrintService.getStatus();
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.dpkj.common.dto.LexMarkResultDTO;
|
||||
import com.dpkj.common.vo.Result;
|
||||
import com.dpkj.modules.print.service.PrintService;
|
||||
import com.dpkj.modules.print.vo.PrinterStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -14,7 +15,7 @@ import javax.annotation.Resource;
|
||||
* @since 2025-02-08 11:49:46
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/print")
|
||||
@RequestMapping("/receipt")
|
||||
public class RegisterController {
|
||||
|
||||
@Resource(name = "registerService")
|
||||
@@ -40,5 +41,13 @@ public class RegisterController {
|
||||
return Result.ok((LexMarkResultDTO)printService.printImage(null, null, 0, 0, filePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取小票打印机状态
|
||||
*/
|
||||
@PostMapping("/getStatus")
|
||||
public Result<String> getStatus(){
|
||||
this.printService.getStatus();
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user