rev 更新工单和打印机驱动
This commit is contained in:
@@ -49,7 +49,18 @@
|
|||||||
<artifactId>tlog-all-spring-boot-starter</artifactId>
|
<artifactId>tlog-all-spring-boot-starter</artifactId>
|
||||||
<version>1.5.0</version>
|
<version>1.5.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-httpclient</groupId>
|
||||||
|
<artifactId>commons-httpclient</artifactId>
|
||||||
|
<version>3.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.freemarker</groupId>
|
||||||
|
<artifactId>freemarker</artifactId>
|
||||||
|
<version>2.3.32</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
<!-- 控制台高亮-->
|
<!-- 控制台高亮-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.fusesource.jansi</groupId>
|
<groupId>org.fusesource.jansi</groupId>
|
||||||
@@ -69,6 +80,23 @@
|
|||||||
<artifactId>ojdbc5</artifactId>
|
<artifactId>ojdbc5</artifactId>
|
||||||
<version>11.2.0.4</version>
|
<version>11.2.0.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.magese</groupId>
|
||||||
|
<artifactId>ik-analyzer</artifactId>
|
||||||
|
<version>${lucene.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- 获取系统信息 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.oshi</groupId>
|
||||||
|
<artifactId>oshi-core</artifactId>
|
||||||
|
<version>5.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Java图形验证码 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.whvcse</groupId>
|
||||||
|
<artifactId>easy-captcha</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</dependency>
|
||||||
<!-- dynamic-datasource -->
|
<!-- dynamic-datasource -->
|
||||||
<!-- https://onew.me/logback/2018/09/17/logback_win.html-->
|
<!-- https://onew.me/logback/2018/09/17/logback_win.html-->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -153,8 +153,8 @@ public class CartonLabelingMachineDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
status = this.itemProtocol.getStatus();
|
status = this.itemProtocol.getStatus();
|
||||||
error = this.itemProtocol.getError();
|
error = this.itemProtocol.getError();
|
||||||
move = this.itemProtocol.getMove();
|
move = this.itemProtocol.getMove();
|
||||||
weight=this.itemProtocol.getWeight();
|
weight = this.itemProtocol.getWeight();
|
||||||
if(mode != last_mode){
|
if (mode != last_mode) {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
}
|
}
|
||||||
} catch (Exception var17) {
|
} catch (Exception var17) {
|
||||||
@@ -179,8 +179,114 @@ public class CartonLabelingMachineDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
|
|
||||||
if (mode == 8 && move == 1 && !requireSucess) {
|
if (mode == 8 && move == 1 && !requireSucess) {
|
||||||
//TODO:将贴标信息下发,并反馈200
|
//TODO:将贴标信息下发,并反馈200
|
||||||
JSONObject template= ticketsMapper.template();
|
JSONObject template = ticketsMapper.template();
|
||||||
String jsonString = template.toString();
|
String jsonString = template.toString();
|
||||||
|
Tickets tickets = ticketsMapper.ticket();
|
||||||
|
//客户
|
||||||
|
String customer = tickets.getCustomer();
|
||||||
|
//纸箱装瓶数量
|
||||||
|
String carton_qty = tickets.getCarton_qty();
|
||||||
|
//计划数量
|
||||||
|
String planned_quantity = tickets.getPlanned_quantity();
|
||||||
|
//晶科每罐重量
|
||||||
|
String bottle_weight=null;
|
||||||
|
Integer bottle_weight1=0;
|
||||||
|
//当前纸箱完成数量
|
||||||
|
String fcarton_number = tickets.getFcarton_number();
|
||||||
|
Integer fcarton_number1 = Integer.parseInt(fcarton_number);
|
||||||
|
Integer planned_quantity1 = Integer.parseInt(planned_quantity);
|
||||||
|
Integer carton_qty1=Integer.parseInt(carton_qty);
|
||||||
|
// Float carton_qty1 = Float.parseFloat(carton_qty);
|
||||||
|
//总纸箱数
|
||||||
|
Integer sum_carton1 = (planned_quantity1+carton_qty1-1)/carton_qty1;
|
||||||
|
//总纸箱数(Integer)
|
||||||
|
//纸箱号
|
||||||
|
String carton_number = tickets.getCarton_number();
|
||||||
|
//瓶盖号
|
||||||
|
String bottle_number = tickets.getBottle_number();
|
||||||
|
//物料条码(瓶盖数据去掉后四位)
|
||||||
|
String material_number = null;
|
||||||
|
//纸箱前18位
|
||||||
|
String first_number = null;
|
||||||
|
//纸箱后2位
|
||||||
|
String last_number = null;
|
||||||
|
String zx1= "";
|
||||||
|
String zx2= "";
|
||||||
|
Integer last_number1 = 0;
|
||||||
|
//当前箱数
|
||||||
|
Integer real_carton = fcarton_number1;
|
||||||
|
if (customer.contains("晶科")) {
|
||||||
|
bottle_weight=tickets.getBottle_weight();
|
||||||
|
//
|
||||||
|
String last_number5="";
|
||||||
|
bottle_weight1=Integer.parseInt(bottle_weight);
|
||||||
|
//物料条码(瓶盖数据去掉后四位)
|
||||||
|
material_number = bottle_number.substring(0, 19);
|
||||||
|
first_number = carton_number.substring(0, 18);
|
||||||
|
zx1=carton_number.substring(18, 20);
|
||||||
|
zx2=carton_number.substring(20, 31);
|
||||||
|
last_number = carton_number.substring(31, 33);
|
||||||
|
last_number1 = Integer.parseInt(last_number);
|
||||||
|
last_number1 = last_number1 - fcarton_number1;
|
||||||
|
log.info("当前纸箱尾数{}",last_number1);
|
||||||
|
if (last_number1 > 9) {
|
||||||
|
last_number5 = String.valueOf(last_number1);
|
||||||
|
} else {
|
||||||
|
last_number5 = "0" + String.valueOf(last_number1);
|
||||||
|
}
|
||||||
|
last_number=last_number5;
|
||||||
|
}
|
||||||
|
//晶澳纸箱数据
|
||||||
|
String janumber = "";
|
||||||
|
if (customer.contains("晶澳")) {
|
||||||
|
//纸箱前16位
|
||||||
|
first_number = carton_number.substring(0, 16);
|
||||||
|
//纸箱后3位
|
||||||
|
last_number = carton_number.substring(16, 19);
|
||||||
|
if (fcarton_number1 == 0) {
|
||||||
|
Integer sum_number = sum_carton1 * carton_qty1;
|
||||||
|
Integer last1_number1 = carton_qty1 - (sum_number - planned_quantity1);
|
||||||
|
|
||||||
|
// Integer last1_number1 = Integer.valueOf(String.valueOf(last1_number));
|
||||||
|
for (Integer i = 0; i < last1_number1; i++) {
|
||||||
|
Integer last_number2 = 0;
|
||||||
|
last_number2 = Integer.parseInt(last_number);
|
||||||
|
String last_number3 = String.valueOf(last_number2);
|
||||||
|
if (last_number2 > 100) {
|
||||||
|
last_number2 = (last_number2 - carton_qty1*1) + i+2;
|
||||||
|
last_number3 = String.valueOf(last_number2);
|
||||||
|
last_number3 = last_number3 + String.valueOf(last_number2) + ",2;";
|
||||||
|
janumber=janumber+first_number+last_number3;
|
||||||
|
} else if (last_number2 > 10) {
|
||||||
|
last_number2 = (last_number2 - carton_qty1*1) + i+2;
|
||||||
|
last_number3 = last_number3 + "0" + String.valueOf(last_number2) + ",2;";
|
||||||
|
janumber=janumber+first_number+last_number3;
|
||||||
|
} else if (last_number2 > 0) {
|
||||||
|
last_number2 = (last_number2 - carton_qty1*1) + i+2;
|
||||||
|
last_number3 = last_number3 + "00" + String.valueOf(last_number2) + ",2;";
|
||||||
|
janumber=janumber+first_number+last_number3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (Integer i = 0; i < carton_qty1; i++) {
|
||||||
|
Integer last_number2 = Integer.parseInt(last_number);
|
||||||
|
last_number2=(sum_carton1-real_carton-1)*10+i+1;
|
||||||
|
String last_number3 = String.valueOf(last_number2);
|
||||||
|
if (last_number2 > 100) {
|
||||||
|
last_number3 = last_number3 + String.valueOf(last_number2) + ",2;";
|
||||||
|
janumber=janumber+first_number+last_number3;
|
||||||
|
}else if (last_number2 > 10) {
|
||||||
|
last_number3 = last_number3 + "0" + String.valueOf(last_number2) + ",2;";
|
||||||
|
janumber=janumber+first_number+last_number3;
|
||||||
|
} else if (last_number2 > 0) {
|
||||||
|
last_number3 = last_number3 + "00" + String.valueOf(last_number2) + ",2;";
|
||||||
|
janumber=janumber+first_number+last_number3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// String sum_carton1=String.valueOf(sum_carton);
|
||||||
|
// String real_carton1=String.valueOf(real_carton);
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
// 解析外部 JSON 字符串,获取 "template" 字段的值
|
// 解析外部 JSON 字符串,获取 "template" 字段的值
|
||||||
JsonNode rootNode = objectMapper.readTree(jsonString);
|
JsonNode rootNode = objectMapper.readTree(jsonString);
|
||||||
@@ -197,29 +303,74 @@ public class CartonLabelingMachineDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
for (int i = 0; i < printElements.size(); i++) {
|
for (int i = 0; i < printElements.size(); i++) {
|
||||||
JSONObject printElement = printElements.getJSONObject(i);
|
JSONObject printElement = printElements.getJSONObject(i);
|
||||||
JSONObject options = printElement.getJSONObject("options");
|
JSONObject options = printElement.getJSONObject("options");
|
||||||
if(options.containsKey("testData")){
|
if (options.containsKey("testData")) {
|
||||||
if(options.get("testData").equals("date")){
|
if (options.get("testData").equals("date")) {
|
||||||
LocalDate currentDate = LocalDate.now();
|
LocalDate currentDate = LocalDate.now();
|
||||||
options.put("title","日期: "+currentDate);
|
options.put("title", "日期: " + currentDate);
|
||||||
printElement.put("options",options);
|
printElement.put("options", options);
|
||||||
}
|
}
|
||||||
if(options.get("testData").equals("weight")){
|
if (options.get("testData").equals("weight")) {
|
||||||
options.put("title","重量: "+weight+"kg");
|
options.put("title", "重量: " + weight + "kg");
|
||||||
printElement.put("options",options);
|
printElement.put("options", options);
|
||||||
}
|
}
|
||||||
if(options.get("testData").equals("time")){
|
if (options.get("testData").equals("number")) {
|
||||||
|
real_carton=real_carton+1;
|
||||||
|
options.put("title", sum_carton1 + "——" + real_carton);
|
||||||
|
printElement.put("options", options);
|
||||||
|
}
|
||||||
|
if (options.get("testData").equals("纸箱号")) {
|
||||||
|
log.info("纸箱号{}{}", first_number, last_number);
|
||||||
|
String number="";
|
||||||
|
if(fcarton_number1==0){
|
||||||
|
number = first_number + zx1+zx2+last_number;
|
||||||
|
}else{
|
||||||
|
number = first_number +bottle_weight1*carton_qty1 +zx2+last_number;
|
||||||
|
}
|
||||||
|
options.put("title", number);
|
||||||
|
options.put("testData", number);
|
||||||
|
printElement.put("options", options);
|
||||||
|
}
|
||||||
|
if (options.get("testData").equals("晶澳纸箱号")) {
|
||||||
|
log.info("晶澳纸箱号{}{}",janumber);
|
||||||
|
String number = janumber;
|
||||||
|
options.put("testData", number);
|
||||||
|
printElement.put("options", options);
|
||||||
|
}
|
||||||
|
if (options.get("testData").equals("物料号")) {
|
||||||
|
log.info("物料号{}", material_number);
|
||||||
|
options.put("title", material_number);
|
||||||
|
options.put("testData", material_number);
|
||||||
|
printElement.put("options", options);
|
||||||
|
}
|
||||||
|
if (options.get("testData").equals("time")) {
|
||||||
LocalTime currentTime = LocalTime.now();
|
LocalTime currentTime = LocalTime.now();
|
||||||
options.put("title","时间: "+ currentTime.getHour() + ":" + currentTime.getMinute() + ":" + currentTime.getSecond());
|
String minute="";
|
||||||
printElement.put("options",options);
|
String second="";
|
||||||
|
if(currentTime.getMinute()<10){
|
||||||
|
minute="0"+currentTime.getMinute();
|
||||||
|
}else{
|
||||||
|
minute=String.valueOf(currentTime.getMinute());
|
||||||
|
}
|
||||||
|
if(currentTime.getSecond()<10){
|
||||||
|
second="0"+currentTime.getSecond();
|
||||||
|
}else{
|
||||||
|
second=String.valueOf(currentTime.getSecond());
|
||||||
|
}
|
||||||
|
options.put("title", "时间: " + currentTime.getHour() + ":" + minute + ":" + second);
|
||||||
|
printElement.put("options", options);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jsonObject.put("type", 2);
|
jsonObject.put("type", 2);
|
||||||
requireSucess=true;
|
requireSucess = true;
|
||||||
log.info("纸箱打印数据: " + jsonObject.toString());
|
log.info("纸箱打印数据: " + jsonObject.toString());
|
||||||
SendPrintSocket.sendPrint(jsonObject.toString());
|
Integer fcarton_number2 = fcarton_number1 + 1;
|
||||||
|
String fcarton_number3 = String.valueOf(fcarton_number2);
|
||||||
|
tickets.setFcarton_number(fcarton_number3);
|
||||||
|
ticketsMapper.updateById(tickets);
|
||||||
|
SendPrintSocket.sendPrint(jsonObject.toString());
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
map.put("to_command", 200);
|
map.put("to_command", 200);
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
@@ -228,70 +379,98 @@ public class CartonLabelingMachineDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
}
|
}
|
||||||
if (mode == 7 && move == 1 && !requireSucess) {
|
if (mode == 7 && move == 1 && !requireSucess) {
|
||||||
//TODO:将贴标信息下发,并反馈200
|
//TODO:将贴标信息下发,并反馈200
|
||||||
JSONObject template= ticketsMapper.template1();
|
JSONObject template = ticketsMapper.template1();
|
||||||
Tickets tickets=ticketsMapper.ticket();
|
Tickets tickets = ticketsMapper.ticket();
|
||||||
String bottle_number=tickets.getBottle_number();
|
String customer = tickets.getCustomer();
|
||||||
String fbottle_number=tickets.getFbottle_number();
|
String bottle_number = tickets.getBottle_number();
|
||||||
Integer fbottle_number1=Integer.parseInt(fbottle_number);
|
String fbottle_number = tickets.getFbottle_number();
|
||||||
String psletters = bottle_number.substring(0,18);
|
Integer fbottle_number1 = Integer.parseInt(fbottle_number);
|
||||||
String psdigits = bottle_number.substring(18,23);
|
String plan_qty=tickets.getPlanned_quantity();
|
||||||
Integer psdigits1=Integer.parseInt(psdigits)-fbottle_number1;
|
Integer plan_qty1=Integer.parseInt(plan_qty);
|
||||||
String jsonString = template.toString();
|
String psletters = null;
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
String psdigits = null;
|
||||||
// 解析外部 JSON 字符串,获取 "template" 字段的值
|
Integer psdigits1 = 0;
|
||||||
JsonNode rootNode = objectMapper.readTree(jsonString);
|
if (customer.contains("晶科")) {
|
||||||
String templateJson = rootNode.get("template").asText();
|
psletters = bottle_number.substring(0, 18);
|
||||||
// 解析嵌套的 "template" 字符串为 JSON 对象
|
psdigits = bottle_number.substring(18, 23);
|
||||||
JsonNode templateNode = objectMapper.readTree(templateJson);
|
psdigits1 = Integer.parseInt(psdigits) - fbottle_number1;
|
||||||
// 输出 panels 数据
|
|
||||||
JSONObject jsonObject = JSONObject.parseObject(templateNode.toString());
|
}
|
||||||
// 获取 panels 数组
|
if (customer.contains("晶澳")) {
|
||||||
JSONArray panels = jsonObject.getJSONArray("panels");
|
psletters = bottle_number.substring(0, bottle_number.length()-5);
|
||||||
JSONObject panel = panels.getJSONObject(0);
|
psdigits = bottle_number.substring(bottle_number.length()-5, bottle_number.length()-2);
|
||||||
// 获取 printElements 数组
|
if (Integer.parseInt(psdigits) >= 100) {
|
||||||
JSONArray printElements = panel.getJSONArray("printElements");
|
psdigits1 = Integer.parseInt(psdigits) - fbottle_number1-plan_qty1;
|
||||||
for (int i = 0; i < printElements.size(); i++) {
|
psdigits = String.valueOf(psdigits1);
|
||||||
JSONObject printElement = printElements.getJSONObject(i);
|
} else if (Integer.parseInt(psdigits) >= 10) {
|
||||||
JSONObject options = printElement.getJSONObject("options");
|
psdigits1 = Integer.parseInt(psdigits) - fbottle_number1-plan_qty1;
|
||||||
if(options.containsKey("testData")){
|
psdigits = "0" + String.valueOf(psdigits1);
|
||||||
if(options.get("title").equals("二维码")){
|
} else if (Integer.parseInt(psdigits) >= 0) {
|
||||||
String number1=psletters+psdigits1;
|
psdigits1 = Integer.parseInt(psdigits) - fbottle_number1-plan_qty1;
|
||||||
options.put("testData",number1);
|
psdigits = "00" + String.valueOf(psdigits1);
|
||||||
printElement.put("options",options);
|
|
||||||
}
|
|
||||||
else if(options.get("testData").equals("瓶号")){
|
|
||||||
String number1=psletters+psdigits1;
|
|
||||||
options.put("title",number1);
|
|
||||||
printElement.put("options",options);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jsonObject.put("type", 1);
|
String jsonString = template.toString();
|
||||||
requireSucess=true;
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
fbottle_number1=fbottle_number1+1;
|
// 解析外部 JSON 字符串,获取 "template" 字段的值
|
||||||
String fbottle_number2=String.valueOf(fbottle_number1);
|
JsonNode rootNode = objectMapper.readTree(jsonString);
|
||||||
// 输出 panels 数据
|
String templateJson = rootNode.get("template").asText();
|
||||||
SendPrintSocket.sendPrint(jsonObject.toString());
|
// 解析嵌套的 "template" 字符串为 JSON 对象
|
||||||
log.info("瓶盖打印数据: " + jsonObject.toString());
|
JsonNode templateNode = objectMapper.readTree(templateJson);
|
||||||
tickets.setFbottle_number(fbottle_number2);
|
// 输出 panels 数据
|
||||||
ticketsMapper.updateById(tickets);
|
JSONObject jsonObject = JSONObject.parseObject(templateNode.toString());
|
||||||
Map map = new HashMap();
|
// 获取 panels 数组
|
||||||
map.put("to_command", 200);
|
JSONArray panels = jsonObject.getJSONArray("panels");
|
||||||
map.put("to_message","");
|
JSONObject panel = panels.getJSONObject(0);
|
||||||
this.writing(map);
|
// 获取 printElements 数组
|
||||||
} else {
|
JSONArray printElements = panel.getJSONArray("printElements");
|
||||||
message = "无请求";
|
for (int i = 0; i < printElements.size(); i++) {
|
||||||
|
JSONObject printElement = printElements.getJSONObject(i);
|
||||||
|
JSONObject options = printElement.getJSONObject("options");
|
||||||
|
if (options.containsKey("testData")) {
|
||||||
|
if (options.get("title").equals("晶科二维码")) {
|
||||||
|
String number1 = psletters + psdigits1;
|
||||||
|
options.put("testData", number1);
|
||||||
|
options.put("title", "");
|
||||||
|
printElement.put("options", options);
|
||||||
|
} else if (options.get("testData").equals("瓶号")) {
|
||||||
|
String number1 = psletters + psdigits1;
|
||||||
|
options.put("title", number1);
|
||||||
|
printElement.put("options", options);
|
||||||
|
} else if (options.get("testData").equals("晶澳瓶号")) {
|
||||||
|
String number1 = psletters + psdigits;
|
||||||
|
options.put("testData", number1 + ",2");
|
||||||
|
printElement.put("options", options);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jsonObject.put("type", 1);
|
||||||
|
requireSucess = true;
|
||||||
|
// 输出 panels 数据
|
||||||
|
SendPrintSocket.sendPrint(jsonObject.toString());
|
||||||
|
log.info("瓶盖打印数据: " + jsonObject.toString());
|
||||||
|
fbottle_number1 = fbottle_number1 + 1;
|
||||||
|
String fbottle_number2 = String.valueOf(fbottle_number1);
|
||||||
|
tickets.setFbottle_number(fbottle_number2);
|
||||||
|
ticketsMapper.updateById(tickets);
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("to_command", 200);
|
||||||
|
map.put("to_message", "");
|
||||||
|
this.writing(map);
|
||||||
|
} else {
|
||||||
|
message = "无请求";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
last_mode = mode;
|
||||||
|
last_error = error;
|
||||||
|
last_move = move;
|
||||||
|
last_task = task;
|
||||||
|
last_weight = weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
last_mode = mode;
|
|
||||||
last_error = error;
|
|
||||||
last_move = move;
|
|
||||||
last_task = task;
|
|
||||||
last_weight = weight;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public boolean exe_error() {
|
public boolean exe_error() {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package org.nl.common.mnt.websocket;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.websocket.*;
|
import javax.websocket.*;
|
||||||
@@ -100,6 +101,9 @@ public class SendPrintSocket {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// throw new BadRequestException("当前打印系统未连接");
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ public class Tickets {
|
|||||||
* 计划数量
|
* 计划数量
|
||||||
*/
|
*/
|
||||||
private String planned_quantity;
|
private String planned_quantity;
|
||||||
|
/**
|
||||||
|
* 晶科每罐重量
|
||||||
|
*/
|
||||||
|
private String bottle_weight;
|
||||||
/**
|
/**
|
||||||
* 计划开始时间
|
* 计划开始时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -50,4 +50,6 @@ public class TicketsDto {
|
|||||||
private String fbatch_number;
|
private String fbatch_number;
|
||||||
|
|
||||||
private String fcarton_number;
|
private String fcarton_number;
|
||||||
|
|
||||||
|
private String bottle_weight;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> impl
|
|||||||
.eq("is_delete","1");
|
.eq("is_delete","1");
|
||||||
wrapper.gt(ObjectUtil.isNotEmpty(param.get("start_time")),"start_time",param.get("start_time"))
|
wrapper.gt(ObjectUtil.isNotEmpty(param.get("start_time")),"start_time",param.get("start_time"))
|
||||||
.le(ObjectUtil.isNotEmpty(param.get("end_time")),"end_time",param.get("end_time"));
|
.le(ObjectUtil.isNotEmpty(param.get("end_time")),"end_time",param.get("end_time"));
|
||||||
wrapper.orderByAsc("create_time");
|
wrapper.orderByDesc("create_time");
|
||||||
Page<Tickets> page1 = this.page(new Page<>(page.getPage() + 1, page.getSize()), wrapper);
|
Page<Tickets> page1 = this.page(new Page<>(page.getPage() + 1, page.getSize()), wrapper);
|
||||||
return page1;
|
return page1;
|
||||||
}
|
}
|
||||||
@@ -100,6 +100,14 @@ public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> impl
|
|||||||
String small_model=(String)param.get("small_model");
|
String small_model=(String)param.get("small_model");
|
||||||
String bottle_board=(String)param.get("bottle_board");
|
String bottle_board=(String)param.get("bottle_board");
|
||||||
String carton_board=(String)param.get("carton_board");
|
String carton_board=(String)param.get("carton_board");
|
||||||
|
if(customer.contains("晶科")){
|
||||||
|
if(bottle_number.length()!=23){
|
||||||
|
throw new BadRequestException("瓶盖号不对");
|
||||||
|
}
|
||||||
|
if(carton_number.length()!=33){
|
||||||
|
throw new BadRequestException("纸箱号不对");
|
||||||
|
}
|
||||||
|
}
|
||||||
Tickets tickets = BeanUtil.copyProperties(param, Tickets.class);
|
Tickets tickets = BeanUtil.copyProperties(param, Tickets.class);
|
||||||
// DateTime parse = DateUtil.parse(tickets.getStart_time());
|
// DateTime parse = DateUtil.parse(tickets.getStart_time());
|
||||||
// DateTime startTime = parse.setTimeZone(TimeZone.getTimeZone(ZoneId.of("Asia/Shanghai")));
|
// DateTime startTime = parse.setTimeZone(TimeZone.getTimeZone(ZoneId.of("Asia/Shanghai")));
|
||||||
@@ -116,33 +124,26 @@ public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> impl
|
|||||||
tickets.setFbottle_number("0");
|
tickets.setFbottle_number("0");
|
||||||
tickets.setFcarton_number("0");
|
tickets.setFcarton_number("0");
|
||||||
ticketsMapper.insert(tickets);
|
ticketsMapper.insert(tickets);
|
||||||
// if(StrUtil.isNotBlank(device_code)){
|
|
||||||
// Device device = deviceAppService.findDeviceByCode(device_code);
|
|
||||||
// if(ObjectUtil.isEmpty(device))throw new BadRequestException("请在系统参数中添加设备");
|
|
||||||
// if(device.getDeviceDriver() instanceof PrimaryDeviceConveyorDeviceDriver){
|
|
||||||
// PrimaryDeviceConveyorDeviceDriver primary = (PrimaryDeviceConveyorDeviceDriver) device.getDeviceDriver();
|
|
||||||
// Map<String, Object> map = new LinkedHashMap<>();
|
|
||||||
// map.put("to_order_No", ticket_id);
|
|
||||||
// map.put("to_command",100);
|
|
||||||
// primary.writing(map);
|
|
||||||
// log.info("工单下发成功工单号{}",ticket_id);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void submits(Tickets entity) {
|
public void submits(Tickets entity) {
|
||||||
Tickets tickets=ticketsMapper.selectById(entity.getTicket_id());
|
Tickets tickets=ticketsMapper.selectById(entity.getTicket_id());
|
||||||
|
Tickets tickets1=ticketsMapper.ticket();
|
||||||
if(entity.getTicket_status().equals("1")){
|
if(entity.getTicket_status().equals("1")){
|
||||||
throw new BadRequestException("当前工单已经下发");
|
throw new BadRequestException("当前工单已经下发");
|
||||||
}
|
}
|
||||||
|
if(tickets1!=null){
|
||||||
|
throw new BadRequestException("当前已经有正在生产的工单请先结束在下发");
|
||||||
|
}
|
||||||
Device device = deviceAppService.findDeviceByCode("ZPLC");
|
Device device = deviceAppService.findDeviceByCode("ZPLC");
|
||||||
if(device.getDeviceDriver() instanceof PrimaryDeviceConveyorDeviceDriver) {
|
if(device.getDeviceDriver() instanceof PrimaryDeviceConveyorDeviceDriver) {
|
||||||
PrimaryDeviceConveyorDeviceDriver primary = (PrimaryDeviceConveyorDeviceDriver) device.getDeviceDriver();
|
PrimaryDeviceConveyorDeviceDriver primary = (PrimaryDeviceConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
map.put("to_order_No", entity.getTicket_id());
|
map.put("to_order_No", entity.getTicket_id());
|
||||||
map.put("to_ice",entity.getIs_ice());
|
map.put("to_ice",entity.getIs_ice());
|
||||||
if(StrUtil.isBlank(entity.getBottle_number())){
|
map.put("to_qty",entity.getPlanned_quantity());
|
||||||
|
if(StrUtil.isBlank(entity.getBottle_board())){
|
||||||
map.put("is_printbottle",0);
|
map.put("is_printbottle",0);
|
||||||
}else{
|
}else{
|
||||||
map.put("is_printbottle",1);
|
map.put("is_printbottle",1);
|
||||||
@@ -161,6 +162,15 @@ public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> impl
|
|||||||
if(!entity.getTicket_status().equals("1")){
|
if(!entity.getTicket_status().equals("1")){
|
||||||
throw new BadRequestException("当前工单状态不是已开工");
|
throw new BadRequestException("当前工单状态不是已开工");
|
||||||
}
|
}
|
||||||
|
Device device = deviceAppService.findDeviceByCode("ZPLC");
|
||||||
|
if(device.getDeviceDriver() instanceof PrimaryDeviceConveyorDeviceDriver) {
|
||||||
|
PrimaryDeviceConveyorDeviceDriver primary = (PrimaryDeviceConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
map.put("to_order_No",0);
|
||||||
|
map.put("to_command",101);
|
||||||
|
primary.writing(map);
|
||||||
|
log.info("工单完成");
|
||||||
|
}
|
||||||
Tickets tickets=ticketsMapper.selectById(entity.getTicket_id());
|
Tickets tickets=ticketsMapper.selectById(entity.getTicket_id());
|
||||||
tickets.setTicket_status("2");
|
tickets.setTicket_status("2");
|
||||||
tickets.setActual_end_time(DateUtil.now());
|
tickets.setActual_end_time(DateUtil.now());
|
||||||
|
|||||||
@@ -84,17 +84,50 @@
|
|||||||
<el-form-item label="计划数量" prop="planned_quantity">
|
<el-form-item label="计划数量" prop="planned_quantity">
|
||||||
<el-input v-model="form.planned_quantity" style="width: 370px;" @change="isDisabled=false" />
|
<el-input v-model="form.planned_quantity" style="width: 370px;" @change="isDisabled=false" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="瓶身号" prop="bottle_number">
|
<el-form-item label="瓶盖号" prop="bottle_number">
|
||||||
<el-input v-model="form.bottle_number" style="width: 370px;" @change="isDisabled=false" />
|
<el-input v-model="form.bottle_number" style="width: 370px;" @change="isDisabled=false" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="纸箱号" prop="carton_number">
|
<el-form-item label="纸箱号" prop="carton_number">
|
||||||
<el-input v-model="form.carton_number" style="width: 370px;" @change="isDisabled=false" />
|
<el-input v-model="form.carton_number" style="width: 370px;" @change="isDisabled=false" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="瓶身关联标签模板" prop="bottle_board">
|
<el-form-item label="晶科每罐重量kg(选填)" prop="bottle_weight">
|
||||||
<el-input v-model="form.bottle_board" style="width: 370px;" @change="isDisabled=false" />
|
<el-input v-model="form.bottle_weight" style="width: 370px;" @change="isDisabled=false" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="瓶盖关联标签模板" prop="bottle_board">
|
||||||
|
<el-select
|
||||||
|
v-model="form.bottle_board"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 370px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in templateList"
|
||||||
|
:key="item.template_name"
|
||||||
|
:label="item.template_name"
|
||||||
|
:value="item.template_name"
|
||||||
|
>
|
||||||
|
<span style="float: left">{{ item.template_name }}</span>
|
||||||
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.bottle_board }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="纸箱关联标签模板" prop="carton_board">
|
<el-form-item label="纸箱关联标签模板" prop="carton_board">
|
||||||
<el-input v-model="form.carton_board" style="width: 370px;" @change="isDisabled=false" />
|
<el-select
|
||||||
|
v-model="form.carton_board"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 370px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in templateList1"
|
||||||
|
:key="item.template_name"
|
||||||
|
:label="item.template_name"
|
||||||
|
:value="item.template_name"
|
||||||
|
>
|
||||||
|
<span style="float: left">{{ item.template_name }}</span>
|
||||||
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.carton_board }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="纸箱装瓶数量" prop="carton_qty">
|
<el-form-item label="纸箱装瓶数量" prop="carton_qty">
|
||||||
<el-input v-model="form.carton_qty" style="width: 370px;" @change="isDisabled=false" />
|
<el-input v-model="form.carton_qty" style="width: 370px;" @change="isDisabled=false" />
|
||||||
@@ -137,13 +170,13 @@
|
|||||||
<el-form-item label="计划数量" prop="planned_quantity">
|
<el-form-item label="计划数量" prop="planned_quantity">
|
||||||
<el-input v-model="form.planned_quantity" style="width: 370px;" @change="isDisabled=false" />
|
<el-input v-model="form.planned_quantity" style="width: 370px;" @change="isDisabled=false" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="瓶身号" prop="bottle_number">
|
<el-form-item label="瓶盖号" prop="bottle_number">
|
||||||
<el-input v-model="form.bottle_number" style="width: 370px;" @change="isDisabled=false" />
|
<el-input v-model="form.bottle_number" style="width: 370px;" @change="isDisabled=false" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="纸箱号" prop="carton_number">
|
<el-form-item label="纸箱号" prop="carton_number">
|
||||||
<el-input v-model="form.carton_number" style="width: 370px;" @change="isDisabled=false" />
|
<el-input v-model="form.carton_number" style="width: 370px;" @change="isDisabled=false" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="瓶身关联标签模板" prop="bottle_board">
|
<el-form-item label="瓶盖关联标签模板" prop="bottle_board">
|
||||||
<el-input v-model="form.bottle_board" style="width: 370px;" @change="isDisabled=false" />
|
<el-input v-model="form.bottle_board" style="width: 370px;" @change="isDisabled=false" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="纸箱关联标签模板" prop="carton_board">
|
<el-form-item label="纸箱关联标签模板" prop="carton_board">
|
||||||
@@ -175,9 +208,9 @@
|
|||||||
<el-table-column prop="production_materials" label="实发型号" :min-width="flexWidth('production_materials',crud.data,'实发型号')" />
|
<el-table-column prop="production_materials" label="实发型号" :min-width="flexWidth('production_materials',crud.data,'实发型号')" />
|
||||||
<el-table-column prop="large_model" label="大型号" :min-width="flexWidth('large_model',crud.data,'大型号')" />
|
<el-table-column prop="large_model" label="大型号" :min-width="flexWidth('large_model',crud.data,'大型号')" />
|
||||||
<el-table-column prop="small_model" label="小型号" :min-width="flexWidth('small_model',crud.data,'小型号')" />
|
<el-table-column prop="small_model" label="小型号" :min-width="flexWidth('small_model',crud.data,'小型号')" />
|
||||||
<el-table-column prop="bottle_number" label="瓶身号" :min-width="flexWidth('bottle_number',crud.data,'瓶身号')" />
|
<el-table-column prop="bottle_number" label="瓶盖号" :min-width="flexWidth('bottle_number',crud.data,'瓶盖号')" />
|
||||||
<el-table-column prop="carton_number" label="纸箱号" :min-width="flexWidth('carton_number',crud.data,'纸箱号')" />
|
<el-table-column prop="carton_number" label="纸箱号" :min-width="flexWidth('carton_number',crud.data,'纸箱号')" />
|
||||||
<el-table-column prop="bottle_board" label="瓶身关联标签模板" :min-width="flexWidth('bottle_board',crud.data,'瓶身关联标签模板')" />
|
<el-table-column prop="bottle_board" label="瓶盖关联标签模板" :min-width="flexWidth('bottle_board',crud.data,'瓶盖关联标签模板')" />
|
||||||
<el-table-column prop="carton_board" label="纸箱关联标签模板" :min-width="flexWidth('carton_board',crud.data,'纸箱关联标签模板')" />
|
<el-table-column prop="carton_board" label="纸箱关联标签模板" :min-width="flexWidth('carton_board',crud.data,'纸箱关联标签模板')" />
|
||||||
<el-table-column prop="carton_qty" label="纸箱装瓶数量" :min-width="flexWidth('carton_qty',crud.data,'纸箱装瓶数量')" />
|
<el-table-column prop="carton_qty" label="纸箱装瓶数量" :min-width="flexWidth('carton_qty',crud.data,'纸箱装瓶数量')" />
|
||||||
<el-table-column prop="ticket_status" label="状态" width="80px">
|
<el-table-column prop="ticket_status" label="状态" width="80px">
|
||||||
@@ -235,6 +268,7 @@ import deviceCrud from '@/api/acs/device/device'
|
|||||||
import routeCurd from '@/api/acs/route/routePlan'
|
import routeCurd from '@/api/acs/route/routePlan'
|
||||||
import { getDicts } from '@/views/system/dict/dict'
|
import { getDicts } from '@/views/system/dict/dict'
|
||||||
import MaterialDialog from '@/views/acs/order/MaterialDialog.vue'
|
import MaterialDialog from '@/views/acs/order/MaterialDialog.vue'
|
||||||
|
import template from '@/api/acs/order/template'
|
||||||
export default {
|
export default {
|
||||||
name: 'Tickets',
|
name: 'Tickets',
|
||||||
components: { MaterialDialog,pagination, crudOperation, rrOperation },
|
components: { MaterialDialog,pagination, crudOperation, rrOperation },
|
||||||
@@ -261,6 +295,7 @@ export default {
|
|||||||
materialList: [],
|
materialList: [],
|
||||||
statusList: [],
|
statusList: [],
|
||||||
routeList: [],
|
routeList: [],
|
||||||
|
|
||||||
flag: 1,
|
flag: 1,
|
||||||
materialDialog: false,
|
materialDialog: false,
|
||||||
fullscreenLoading: false,
|
fullscreenLoading: false,
|
||||||
@@ -276,6 +311,8 @@ export default {
|
|||||||
toYList: [],
|
toYList: [],
|
||||||
toZList: [],
|
toZList: [],
|
||||||
operate: [],
|
operate: [],
|
||||||
|
templateList: [],
|
||||||
|
templateList1: [],
|
||||||
start_flag: false,
|
start_flag: false,
|
||||||
end_flag: false,
|
end_flag: false,
|
||||||
permission: {
|
permission: {
|
||||||
@@ -291,11 +328,14 @@ export default {
|
|||||||
form: {
|
form: {
|
||||||
ticket_id: null,
|
ticket_id: null,
|
||||||
batch_number: null,
|
batch_number: null,
|
||||||
|
bottle_weight: null,
|
||||||
device_code: null,
|
device_code: null,
|
||||||
production_orders: null,
|
production_orders: null,
|
||||||
production_materials: null,
|
production_materials: null,
|
||||||
planned_quantity: null,
|
planned_quantity: null,
|
||||||
bottle_number: null,
|
bottle_number: null,
|
||||||
|
templateList: [],
|
||||||
|
templateList1: [],
|
||||||
carton_number: null,
|
carton_number: null,
|
||||||
carton_form: null,
|
carton_form: null,
|
||||||
carton_qty: null,
|
carton_qty: null,
|
||||||
@@ -312,6 +352,7 @@ export default {
|
|||||||
form1: {
|
form1: {
|
||||||
ticket_id: null,
|
ticket_id: null,
|
||||||
batch_number: null,
|
batch_number: null,
|
||||||
|
bottle_weight: null,
|
||||||
device_code: null,
|
device_code: null,
|
||||||
production_orders: null,
|
production_orders: null,
|
||||||
production_materials: null,
|
production_materials: null,
|
||||||
@@ -382,6 +423,12 @@ export default {
|
|||||||
deviceCrud.selectDeviceList().then(data => {
|
deviceCrud.selectDeviceList().then(data => {
|
||||||
this.deviceList = data
|
this.deviceList = data
|
||||||
})
|
})
|
||||||
|
template.getTemplateList().then(data => {
|
||||||
|
this.templateList = data
|
||||||
|
})
|
||||||
|
template.getTemplateList1().then(data => {
|
||||||
|
this.templateList1 = data
|
||||||
|
})
|
||||||
routeCurd.selectList().then(data => {
|
routeCurd.selectList().then(data => {
|
||||||
this.routeList = data
|
this.routeList = data
|
||||||
})
|
})
|
||||||
@@ -403,6 +450,17 @@ export default {
|
|||||||
updateIsIce1() {
|
updateIsIce1() {
|
||||||
this.form1.weight_ok = this.concatenatedValue1
|
this.form1.weight_ok = this.concatenatedValue1
|
||||||
},
|
},
|
||||||
|
// getTemplateList() {
|
||||||
|
// console.log("111");
|
||||||
|
// template.getTemplateList().then(data => {
|
||||||
|
// this.templateList = data
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
// getTemplateList1() {
|
||||||
|
// template.getTemplateList1().then(data => {
|
||||||
|
// this.templateList1 = data
|
||||||
|
// })
|
||||||
|
// },
|
||||||
getMaterial(flag) {
|
getMaterial(flag) {
|
||||||
this.materialDialog = true
|
this.materialDialog = true
|
||||||
this.flag = flag
|
this.flag = flag
|
||||||
@@ -431,9 +489,10 @@ export default {
|
|||||||
this.form.production_materials=row.production_materials
|
this.form.production_materials=row.production_materials
|
||||||
this.form.large_model=row.large_model
|
this.form.large_model=row.large_model
|
||||||
this.form.small_model=row.small_model
|
this.form.small_model=row.small_model
|
||||||
this.form.planned_quantity=row.weight
|
this.form.planned_quantity=row.sum_qty
|
||||||
this.form.bottle_number=row.bottle_number
|
this.form.bottle_number=row.bottle_number
|
||||||
this.form.carton_number=row.carton_number
|
this.form.carton_number=row.carton_number
|
||||||
|
this.form.carton_qty=row.carton_qty
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleDateTimeChange() {
|
handleDateTimeChange() {
|
||||||
@@ -513,6 +572,7 @@ export default {
|
|||||||
ticket_id: null,
|
ticket_id: null,
|
||||||
device_code: null,
|
device_code: null,
|
||||||
batch_number: null,
|
batch_number: null,
|
||||||
|
bottle_weight: null,
|
||||||
production_orders: null,
|
production_orders: null,
|
||||||
production_materials: null,
|
production_materials: null,
|
||||||
planned_quantity: null,
|
planned_quantity: null,
|
||||||
@@ -527,6 +587,8 @@ export default {
|
|||||||
customer: null,
|
customer: null,
|
||||||
is_ice: null,
|
is_ice: null,
|
||||||
is_labeling: null,
|
is_labeling: null,
|
||||||
|
templateList: [],
|
||||||
|
templateList1: [],
|
||||||
weight_ok: null,
|
weight_ok: null,
|
||||||
ticket_status: null
|
ticket_status: null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
v-model="templateId"
|
v-model="templateId"
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择瓶盖模板"
|
placeholder="请选择瓶盖模板"
|
||||||
style="width: 150px;"
|
style="width: 250px;"
|
||||||
@change="getTemplateById"
|
@change="getTemplateById"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@@ -50,11 +50,11 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="templateId"
|
v-model="templateId1"
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择纸箱模板"
|
placeholder="请选择纸箱模板"
|
||||||
style="width: 150px;"
|
style="width: 250px;"
|
||||||
@change="getTemplateById"
|
@change="getTemplateById1"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in templateList1"
|
v-for="item in templateList1"
|
||||||
@@ -286,6 +286,7 @@ export default {
|
|||||||
templateList1: [],
|
templateList1: [],
|
||||||
ticketId: null,
|
ticketId: null,
|
||||||
templateId: null,
|
templateId: null,
|
||||||
|
templateId1: null,
|
||||||
templateLoading: false,
|
templateLoading: false,
|
||||||
curPaper: {
|
curPaper: {
|
||||||
type: 'A4',
|
type: 'A4',
|
||||||
@@ -366,7 +367,7 @@ export default {
|
|||||||
duration: 0
|
duration: 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const wsUri = window.g.prod.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/sendPrint/' + uuidv1()
|
const wsUri = window.g.dev.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/sendPrint/' + uuidv1()
|
||||||
this.websock = new WebSocket(wsUri)
|
this.websock = new WebSocket(wsUri)
|
||||||
this.websock.onmessage = this.webSocketOnMessage
|
this.websock.onmessage = this.webSocketOnMessage
|
||||||
},
|
},
|
||||||
@@ -460,6 +461,17 @@ if (typeValue === 2){
|
|||||||
})
|
})
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
|
getTemplateById1() {
|
||||||
|
// if (hiprintTemplate) {
|
||||||
|
template.see(this.templateId1).then(res => {
|
||||||
|
try {
|
||||||
|
this.hiprintTemplate.update(JSON.parse(res.template))
|
||||||
|
} catch (e) {
|
||||||
|
this.$message.error(`更新失败: ${e}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
|
||||||
otherPaper() {
|
otherPaper() {
|
||||||
this.hiprintTemplate.setPaper(this.paperWidth, this.paperHeight)
|
this.hiprintTemplate.setPaper(this.paperWidth, this.paperHeight)
|
||||||
|
|||||||
Reference in New Issue
Block a user