From 5a7d010c93a3d52a1bf41e7b51461f94c76f4fb9 Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Thu, 18 Aug 2022 08:52:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/acs/test/rest/TestController.java | 104 --------------- .../org/nl/acs/test/service/TestService.java | 72 ---------- .../test/service/impl/TestServiceImpl.java | 123 ------------------ 3 files changed, 299 deletions(-) delete mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/test/rest/TestController.java delete mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/TestService.java delete mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/impl/TestServiceImpl.java diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/rest/TestController.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/rest/TestController.java deleted file mode 100644 index 6d65380..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/rest/TestController.java +++ /dev/null @@ -1,104 +0,0 @@ - -package org.nl.acs.test.rest; - - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.test.service.TestService; -import org.nl.annotation.Log; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.io.IOException; -import java.util.Map; - -/** - * @author ldjun - * @date 2021-03-18 - **/ -@RestController -@RequiredArgsConstructor -@Api(tags = "任务管理") -@RequestMapping("/api/test") -@Slf4j -public class TestController { - - private final TestService testService; - - @Log("test1") - @ApiOperation("test1") - @PostMapping("/test1") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test1() throws IOException { - testService.test1(); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test2") - @ApiOperation("test2") - @PostMapping("/test2") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test2() throws IOException { - testService.test2(); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test3") - @ApiOperation("test3") - @PostMapping("/test3") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test3() throws IOException { - testService.test3(); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test4") - @ApiOperation("test4") - @PostMapping("/test4") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test4(@RequestBody Map map) throws IOException { - testService.test4(map); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test5") - @ApiOperation("test5") - @PostMapping("/test5") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test5() throws IOException { - testService.test5(); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test6") - @ApiOperation("test6") - @PostMapping("/test6") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test6(@RequestBody Map map) throws IOException { - testService.test6(map); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("test7") - @ApiOperation("test7") - @PostMapping("/test7") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity test7() throws IOException { - testService.test7(); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("print") - @ApiOperation("print") - @PostMapping("/print") - //@PreAuthorize("@el.check('task:add')") - public ResponseEntity print() throws IOException { - return new ResponseEntity<>(testService.print(), HttpStatus.OK); - } -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/TestService.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/TestService.java deleted file mode 100644 index ef80fe4..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/TestService.java +++ /dev/null @@ -1,72 +0,0 @@ - -package org.nl.acs.test.service; - - - -import com.alibaba.fastjson.JSONObject; - -import java.io.IOException; -import java.util.Map; - -/** - * @author ldjun - * @description 服务接口 - * @date 2021-03-18 - **/ -public interface TestService { - /** - * 初始化 - * - * @throws IOException - */ - void test1() throws IOException; - - /** - * 触发打印 - * - * @throws IOException - */ - void test2() throws IOException; - - /** - * 加载模板 - * - * @throws IOException - */ - void test3() throws IOException; - - /** - * 发送bufferdata缓存数据 - * - * @throws IOException - */ - void test4(Map map) throws IOException; - - /** - * 清空缓存 - * - * @throws IOException - */ - void test5() throws IOException; - - /** - * 发送settext指令 - * - * @throws IOException - */ - void test6(Map map) throws IOException; - - /** - * 事务发送 - * - * @throws IOException - */ - void test7() throws IOException; - - /** - * 发送打印 - * - * @throws IOException - */ - JSONObject print() throws IOException; -} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/impl/TestServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/impl/TestServiceImpl.java deleted file mode 100644 index e7a0570..0000000 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/test/service/impl/TestServiceImpl.java +++ /dev/null @@ -1,123 +0,0 @@ - -package org.nl.acs.test.service.impl; - - -import com.alibaba.fastjson.JSONObject; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.test.service.TestService; -import org.springframework.stereotype.Service; - -import java.io.IOException; -import java.util.Map; - -/** - * @author ldjun - * @description 服务实现 - * @date 2021-03-18 - **/ -@Service -@RequiredArgsConstructor -@Slf4j -public class TestServiceImpl implements TestService { - - @Override - public void test1() throws IOException { - - try { - //返回编译完成信号 - LetteringSocketConnectionAutoRun.write("SETMSG 26 1" + "\r\n"); - //返回打印开始信号 - LetteringSocketConnectionAutoRun.write("SETMSG 2 1" + "\r\n"); - //返回打印完成信号 - LetteringSocketConnectionAutoRun.write("SETMSG 3 1" + "\r\n"); - //返回每次打印的内容 - LetteringSocketConnectionAutoRun.write("SETMSG 24 1" + "\r\n"); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - - @Override - public void test2() throws IOException { - try { - LetteringSocketConnectionAutoRun.write("BUFFERCLEAR" + "\r\n"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void test3() throws IOException { - // LOADPROJECT "ZY.lbm" - //此处为模板名称 D310激光机,加载CS.lbm模版 - String str = "CS.lbm"; - try { - LetteringSocketConnectionAutoRun.write("LOADPROJECT" + " \"" + str + "\"" + "\r\n"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void test4(Map map) throws IOException { - String name = map.get("name").toString(); - String name2 = map.get("name2").toString(); - String name3 = map.get("name3").toString(); - String name4 = map.get("name4").toString(); - String yh = "\""; - try { - //先清空缓存 - LetteringSocketConnectionAutoRun.write("BUFFERCLEAR" + "\r\n"); -// test5(); -// LetteringSocketConnectionAutoRun.write("BUFFERDATA -1 "+ yh + name + yh +" " + yh + name2 + yh +" " -// +yh +name3 +yh + " " + yh + name4 + yh + "\r\n"); - - //两行 -// LetteringSocketConnectionAutoRun.write("BUFFERDATA -1 "+ yh + name + yh +" " + yh + name2 + yh +" " -// + "\r\n"); - - LetteringSocketConnectionAutoRun.write("BUFFERDATA -1 " + yh + name + yh + " " + "\r\n"); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void test5() throws IOException { - try { - LetteringSocketConnectionAutoRun.write("BUFFERCLEAR" + "\r\n"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void test6(Map map) throws IOException { - String yh = "\""; - String inst = map.get("inst").toString(); - String inst2 = map.get("inst2").toString(); - String strInst = "SETTEXT " + "S1" + " " + yh + inst + yh + "\r\n"; //2个变量 - String strInst2 = "SETTEXT " + "S2" + " " + yh + inst2 + yh + "\r\n"; //2个变量 - - LetteringSocketConnectionAutoRun.write(strInst); - LetteringSocketConnectionAutoRun.write(strInst2); - - } - - @Override - public void test7() throws IOException { - - } - - @Override - public JSONObject print() throws IOException { - JSONObject jo = new JSONObject(); - jo.put("cpbh", "A1111111111"); - jo.put("cpmc", "产品名称:A1111111111"); - return jo; - } -}