From 6855a36b5724c8531e1d81318e8b7dccb26c3853 Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Sun, 10 Jul 2022 16:50:52 +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 --- .../HaiLiangFeedingTrunkDeviceDriver.java | 1 + .../rest/ProduceshiftorderController.java | 17 +++ .../ProduceshiftorderdetailController.java | 10 +- .../service/ProduceshiftorderService.java | 19 +++ .../ProduceshiftorderdetailService.java | 8 ++ .../dto/ProduceshiftorderdetailDto.java | 7 + .../impl/ProduceshiftorderServiceImpl.java | 123 +++++++++++++----- .../ProduceshiftorderdetailServiceImpl.java | 41 ++++-- .../org/nl/acs/order/service/impl/Test.java | 2 +- .../org/nl/acs/order/service/wql/order.xls | Bin 200704 -> 200704 bytes .../run/LetteringSocketConnectionAutoRun.java | 20 +-- qd/src/api/acs/order/order.js | 10 +- qd/src/views/acs/order/sorting/index.vue | 4 +- 13 files changed, 205 insertions(+), 57 deletions(-) diff --git a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java index 54fea88..c203135 100644 --- a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java +++ b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java @@ -483,6 +483,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im last_lettering_frequency = lettering_frequency; last_one_speed = one_speed; last_coating_frequency = coating_frequency; + last_order_feeding_finish = order_feeding_finish; } diff --git a/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java b/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java index 06122be..43a6f57 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderController.java @@ -49,6 +49,8 @@ public class ProduceshiftorderController { return new ResponseEntity<>(produceshiftorderService.queryAll(whereJson, page), HttpStatus.OK); } + + @GetMapping(value = "/querySorting") @Log("查询分拣工单") @ApiOperation("查询分拣工单") @@ -173,6 +175,14 @@ public class ProduceshiftorderController { return new ResponseEntity<>(HttpStatus.OK); } + @Log("工单明细手动完成") + @ApiOperation("工单明细手动完成") + @PostMapping(value = "/manual_finish") + public ResponseEntity manual_finish(@Validated @RequestBody Map whereJson) { + produceshiftorderService.manual_finish(whereJson); + return new ResponseEntity<>(HttpStatus.OK); + } + @Log("工单强制完成") @ApiOperation("工单强制完成") @PostMapping(value = "/order_force_complete") @@ -236,6 +246,13 @@ public class ProduceshiftorderController { return new ResponseEntity<>(HttpStatus.OK); } + @Log("查询缓存所有工单") + @ApiOperation("查询缓存所有工单") + @PostMapping(value = "/findAllOrderFromCache") + public ResponseEntity findAllOrderFromCache() { + return new ResponseEntity<>(produceshiftorderService.findAllOrderFromCache(), HttpStatus.OK); + } + } diff --git a/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderdetailController.java b/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderdetailController.java index 4a13bf1..df9b2ce 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderdetailController.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/rest/ProduceshiftorderdetailController.java @@ -24,7 +24,7 @@ import lombok.extern.slf4j.Slf4j; **/ @RestController @RequiredArgsConstructor -@Api(tags = "order管理") +@Api(tags = "工单明细管理") @RequestMapping("/api/produceshiftorderdetail") @Slf4j public class ProduceshiftorderdetailController { @@ -73,4 +73,12 @@ public class ProduceshiftorderdetailController { public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException { produceshiftorderdetailService.download(produceshiftorderdetailService.queryAll(whereJson), response); } + + @Log("查询缓存所有工单明细") + @ApiOperation("查询缓存所有工单明细") + @PostMapping(value = "/findAllOrderDetailFromCache") + public ResponseEntity findAllOrderFromCache() { + return new ResponseEntity<>(produceshiftorderdetailService.findAllOrderDetailFromCache(), HttpStatus.OK); + } + } diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java b/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java index 915081f..54c4ef7 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java @@ -3,7 +3,9 @@ package org.nl.acs.order.service; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.order.service.dto.ProduceshiftorderDto; +import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto; import org.springframework.data.domain.Pageable; import javax.servlet.http.HttpServletResponse; @@ -174,12 +176,19 @@ public interface ProduceshiftorderService { */ void detail_pause(Map whereJson); + /** * 工单强制完成 * */ void order_force_complete(Map whereJson); + /** + * 工单明细手动完成 + * + */ + void manual_finish(Map whereJson); + /** * 工单明细强制完成 @@ -242,4 +251,14 @@ public interface ProduceshiftorderService { * @param whereJson */ Boolean print(JSONObject whereJson); + + + /** + * + * @return + */ + List findAllOrderFromCache(); + + + } diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderdetailService.java b/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderdetailService.java index bfed442..ed8e456 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderdetailService.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderdetailService.java @@ -88,4 +88,12 @@ public interface ProduceshiftorderdetailService { void reload(); + /** + * + * @return + */ + List findAllOrderDetailFromCache(); + + void upodateDetailStatus(String order_code,String status); + } diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java b/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java index 82135aa..ea95630 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java @@ -88,6 +88,13 @@ public class ProduceshiftorderdetailDto implements Serializable { private String length; /** 工单明细状态 */ + /** + * + 00-就绪、01-分拣中 + 02-下发工单明细暂停 03-工单明细暂停 + 04-下发强制完成 05-强制完成 + 06-自动完成 07-取消 + */ private String order_detail_status; /** 上料数量 */ diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java index de626da..bf847f8 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java @@ -11,7 +11,10 @@ import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.spire.xls.CellRange; +import com.spire.xls.PageSetup; import com.spire.xls.Workbook; +import com.spire.xls.Worksheet; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.device_driver.hailiang.hailiang_feeding_trunk.HaiLiangFeedingTrunkDeviceDriver; @@ -37,10 +40,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; -import java.awt.print.PageFormat; -import java.awt.print.Paper; -import java.awt.print.PrinterException; -import java.awt.print.PrinterJob; +import java.awt.print.*; import java.io.IOException; import java.util.*; @@ -71,7 +71,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A } public synchronized void reload() { - this.order = this.queryAllOrder("(order_status !='07' and order_status !='08' and order_status !='09') and is_deleted =0"); + order = this.queryAllOrder("(order_status !='07' and order_status !='08' and order_status !='09') and is_deleted =0"); produceshiftorderdetailService.reload(); } @@ -335,6 +335,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A if (!StrUtil.equals(dto.getOrder_id(), "07") && !StrUtil.equals(dto.getOrder_id(), "08") && !StrUtil.equals(dto.getOrder_id(), "09")) { order.add(dto); } + produceshiftorderdetailService.reload(); } @Override @@ -485,9 +486,23 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder"); JSONObject json= (JSONObject) JSONObject.toJSON(entity); wo.update(json); - HashMap map = new HashMap<>(); - map.put("order_detail_status","07"); - WQLObject.getWQLObject("acs_produceshiftorderdetail").update(map,"order_id = '"+ id + "'"); +// HashMap map = new HashMap<>(); +// map.put("order_detail_status","07"); +// WQLObject.getWQLObject("acs_produceshiftorderdetail").update(map,"order_id = '"+ id + "'"); + + produceshiftorderdetailService.upodateDetailStatus(entity.getOrder_code(),"05"); + Iterator iterator = order.iterator(); + while (iterator.hasNext()) { + ProduceshiftorderDto produceshiftorderDto = iterator.next(); + if (produceshiftorderDto.getOrder_id().equals(entity.getOrder_id())) { + iterator.remove(); + } + } + if (!StrUtil.equals(entity.getOrder_id(), "07") && !StrUtil.equals(entity.getOrder_id(), "08") && !StrUtil.equals(entity.getOrder_id(), "09")) { + order.add(entity); + } + + produceshiftorderdetailService.reload(); } @@ -551,12 +566,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A List deviceAll = deviceAppService.findDeviceDriver(HaiLiangFeedingTrunkDeviceDriver.class); if (deviceAll.get(0) instanceof HaiLiangFeedingTrunkDeviceDriver) { haiLiangFeedingTrunkDeviceDriver = (HaiLiangFeedingTrunkDeviceDriver) deviceAll.get(0); - if(haiLiangFeedingTrunkDeviceDriver.getMode() !=2){ - throw new BadRequestException("设备未联机,无法下发恢复!"); - } - if(haiLiangFeedingTrunkDeviceDriver.getPause() == 0 ){ - throw new BadRequestException("设备已处于恢复状态,无法下发恢复!"); - } haiLiangFeedingTrunkDeviceDriver.writing("to_pause","0"); } } @@ -568,10 +577,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A List deviceAll = deviceAppService.findDeviceDriver(HaiLiangFeedingTrunkDeviceDriver.class); if (deviceAll.get(0) instanceof HaiLiangFeedingTrunkDeviceDriver) { haiLiangFeedingTrunkDeviceDriver = (HaiLiangFeedingTrunkDeviceDriver) deviceAll.get(0); - if(haiLiangFeedingTrunkDeviceDriver.getMode() !=2){ - throw new BadRequestException("设备未联机,无法下发恢复!"); - } - haiLiangFeedingTrunkDeviceDriver.writing("to_pause","1"); } } @@ -601,6 +606,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A throw new BadRequestException("未找到对应工单明细!"); } + if(ObjectUtil.isEmpty(dto)){ + throw new BadRequestException("未找到对应工单!"); + } // 2.根据明细template_id 找到对应的模板 JSONObject jsonStor = WQL.getWO("QPRODUCESHIFTORDER").addParam("flag", "3").addParam("storage_id", detaildto.getTemplate_id()).process().uniqueResult(0); @@ -636,8 +644,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A jo.put("inspector",detaildto.getInspector()); jo.put("mg_weight",detaildto.getMg_weight()); //打印纸张大小 - jo.put("page_length","50"); - jo.put("page_height","40"); + //1cm = 118px + jo.put("page_length",590); + jo.put("page_height",472); print(jo); } @@ -753,6 +762,22 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A } + + @Override + public void manual_finish(Map whereJson) { + String order = whereJson.get("parent_order_code").toString(); + String detail = whereJson.get("order_code").toString(); + ProduceshiftorderdetailDto detaildto = produceshiftorderdetailService.findOrderDetailFromCache(order,detail); + if(ObjectUtil.isEmpty(detaildto)){ + throw new BadRequestException("未找到对应工单明细!"); + } + detaildto.setOrder_detail_status("05"); + HaiLiangFeedingTrunkDeviceDriver haiLiangFeedingTrunkDeviceDriver; + List deviceAll = deviceAppService.findDeviceDriver(HaiLiangFeedingTrunkDeviceDriver.class); + + produceshiftorderdetailService.update(detaildto); + } + @Override public void download(List dtos, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); @@ -863,7 +888,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A @Override public List findOrderByOrderStatusFromCache(String order_status) { List list = new ArrayList(); - Iterator var3 = order.iterator(); + Iterator var3 = this.order.iterator(); while (var3.hasNext()) { ProduceshiftorderDto oneorder = (ProduceshiftorderDto) var3.next(); if (StrUtil.equals(oneorder.getOrder_status(), order_status)) { @@ -1009,23 +1034,44 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A workBook.fill(map, sheet); workBook.finish(); - // 5.打印 - Workbook workbook = new Workbook(); - workbook.loadFromFile(pathName); - //创建 PrinterJob对象 - PrinterJob printerJob = PrinterJob.getPrinterJob(); - //指定打印页面为默认大小和方向 - PageFormat pageFormat = printerJob.defaultPage(); - //设置相关打印选项 - Paper paper = pageFormat.getPaper(); - paper.setSize(whereJson.getInteger("page_length"),whereJson.getInteger("page_height")); - paper.setImageableArea(0, 0, whereJson.getInteger("page_length"),whereJson.getInteger("page_height")); - pageFormat.setPaper(paper); - printerJob.setCopies(1); - printerJob.setPrintable(workbook, pageFormat); + Book book=new Book(); + Workbook loDoc = new Workbook(); + loDoc.loadFromFile(pathName); + Worksheet worksheet = loDoc.getWorksheets().get(0); + PageSetup pageSetup = worksheet.getPageSetup(); + String printArea="A2:B8"; + pageSetup.setPrintArea(printArea); + pageSetup.setLeftMargin(0); + pageSetup.setRightMargin(0); + pageSetup.setTopMargin(0); + pageSetup.setBottomMargin(0); + CellRange cellRanges = worksheet.getCellRange(printArea); + int height=0; + for (CellRange row : cellRanges.getRows()) { + height+= worksheet.getRowHeightPixels(row.getRow()); + } + + int width=0; + for (CellRange column : cellRanges.getColumns()) { + width+=worksheet.getColumnWidthPixels(column.getColumn()); + } + + PrinterJob loPrinterJob = PrinterJob.getPrinterJob(); + PageFormat loPageFormat = loPrinterJob.defaultPage(); + Paper loPaper = loPageFormat.getPaper(); + + loPaper.setImageableArea(0, 0, loPageFormat.getWidth(), loPageFormat.getHeight()); + + loPaper.setSize(142,113); +// loPaper.setSize(width/96.0*72,height/96.0*72); + loPageFormat.setPaper(loPaper); + loPrinterJob.setCopies(1); + loPrinterJob.setPrintable(loDoc, loPageFormat); + book.append(loDoc,loPageFormat); + loPrinterJob.setPageable(book); try { // 执行打印 - printerJob.print(); + loPrinterJob.print(); } catch (PrinterException e) { e.printStackTrace(); return false; @@ -1033,4 +1079,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A return true; } + @Override + public List findAllOrderFromCache() { + return order; + } + } \ No newline at end of file diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java index 77dab8c..f9ca9d9 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java @@ -121,8 +121,8 @@ public class ProduceshiftorderdetailServiceImpl implements Produceshiftorderdeta iterator.remove(); } } - if (!StrUtil.equals(dto.getOrder_detail_status(), "07") || !StrUtil.equals(dto.getOrder_detail_status(), "08") - ||!StrUtil.equals(dto.getOrder_detail_status(), "09")) { + if (!StrUtil.equals(dto.getOrder_detail_status(), "05") || !StrUtil.equals(dto.getOrder_detail_status(), "06") + ||!StrUtil.equals(dto.getOrder_detail_status(), "07")) { detail.add(dto); } @@ -206,7 +206,25 @@ public class ProduceshiftorderdetailServiceImpl implements Produceshiftorderdeta } public synchronized void reload() { - this.detail = this.queryAllOrderDteail(" (order_detail_status != '05' and order_detail_status != '06' and order_detail_status != '07') and is_deleted =0 order by order_detail_code"); + this.detail = this.queryAllOrderDteail(" (order_detail_status != '05' and and order_detail_status != '06' and order_detail_status != '07') and is_deleted =0 order by order_detail_code"); + } + + @Override + public void upodateDetailStatus(String order_code,String status){ + WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail"); + JSONArray arr = wo.query("order_code = "+ order_code).getResultJSONArray(0); + List list = arr.toJavaList(ProduceshiftorderdetailDto.class); + for(int i=0;i findAllOrderDetailFromCache() { + return detail; + } } diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/Test.java b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/Test.java index cc4d945..ff4657b 100644 --- a/nladmin-system/src/main/java/org/nl/acs/order/service/impl/Test.java +++ b/nladmin-system/src/main/java/org/nl/acs/order/service/impl/Test.java @@ -5,7 +5,7 @@ public class Test { public static void main(String[] args) { Process printProcess; - String printName ="Zebra ZE500-4 RH (300 dpi)"; + String printName ="PDF24"; try { printProcess = Runtime diff --git a/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls b/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls index 6f8f1ead7eb1751f800293564eab1e4ffae3d169..5bf003f355598ced21c9a38643e1616f7c450c51 100644 GIT binary patch delta 5721 zcmZ`-2V4|a6Q9{Tk3*yhHV~y*NJQi~X`d(@N3j7Sie1qFVu^(>K?FTCwumLVnx_$w z*s-D)T#14e3mQdZL1X(w5i|zuUB21n05!VrxBGwZKlA3zo1LB8y|k=GX<3bO#>o}_ z$I~jjm+_P3b2!x+{Lp8Y_|5LaHYWSFFTi!3k zf`2x!6Tc|X0%Q1`$ku$5LH0P3?-SKRA3kVO6U&^Vq74pl$VfIDEMOgfZh}?B(MuvL z$BD7uj!H>Qj}|4i4{Es5Fr4BrM&!(3mjx0j!_o5`r!^TaYQ41;89646-x1cJZ{a+V zi%aFz6Gyw0DdI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&?rLP@ER*!fWz@R>n@{0Us1^> zkjw>durV?mu63P2q3p z%D@PeRH}rNl)`(=B2#HNBa;lTs$?-r*=@E{DdU?maf8UVS|v;%;Q-2#x|dUj1o|j+ zM4>Aa=nK;ztYU{2VThzzr954!{EBs7OrP>CEP65KU@)s+jD2*46onHofd!z=@)C#xhouiwTmmDo{8E&Ul{1=22IkQ-Q)UaK;O) zLI5wSK;alT<0XFhHr%Hs-_w%4wg9K-*6Gb@``_naDp5YU0MCfkW(#SjlKC5oB5YVP_vV$1Pe7~9^eRm5CA^l z4!+vh$!>0BK4IvnQ{D zm8a5|kJ8efW^UxoPbu{^q$S+QnJcLaivD@8Rd+NC8VdJ)K-UC{n3g;QVxd z3ehdVQ5tAZu{nC$OMRpio~N6ipS_PS__{f{2KqV%Xu5jv^{crQU)@Ay;VW^oLz;2} z%DGWpauW5~@jINpw(#9v3~ID}Oo4?q3?9nsMp@U-2=bUecX?*9Y;yE|8gH&AGX&O<> z1+wZ|E+Z$=gbl3chBAYCt~a|;$9d!=MzPXbPMgKmaeZWO`$MbgF@qV^r-TV^)S+Tnl!+STVwc`=xS$2niJJu^?&&rj(cjoy7 zwF_*g`Ha4#-ZOB&bI{tf`qj^P+Xk*cEGm7f#dMoEOV-%P8M4)ll+*sH=F~8u_;6d<$rj?JrH59eQ6>WageW*uZxeXpNo%Y$G4SE7ypsIURKmx z9U@T}sGQSeZ+i)U Q_=@B?YSw&)mMBC0e`=g&WB>pF diff --git a/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java b/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java index ea0c5c0..4b2ab0a 100644 --- a/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java +++ b/nladmin-system/src/main/java/org/nl/start/auto/run/LetteringSocketConnectionAutoRun.java @@ -18,6 +18,7 @@ import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.math.BigInteger; import java.net.Socket; import java.util.Date; import java.util.List; @@ -36,6 +37,7 @@ public class LetteringSocketConnectionAutoRun extends AbstractAutoRunnable { boolean bConnected = true; @Autowired DeviceAppService deviceAppService; + public LetteringSocketConnectionAutoRun() { this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut); } @@ -78,7 +80,7 @@ public class LetteringSocketConnectionAutoRun extends AbstractAutoRunnable { // // } // if (StrUtil.equals(bs.toString(), "OK")) { - if(bs.toString().contains("OK")){ + if (bs.toString().contains("OK")) { HaiLiangFeedingTrunkDeviceDriver haiLiangFeedingTrunkDeviceDriver; List deviceAll = deviceAppService.findDeviceDriver(HaiLiangFeedingTrunkDeviceDriver.class); if (deviceAll.get(0) instanceof HaiLiangFeedingTrunkDeviceDriver) { @@ -91,7 +93,8 @@ public class LetteringSocketConnectionAutoRun extends AbstractAutoRunnable { public static void write(String str) throws IOException { System.out.println(str); - dos.write(hexStringToByte(bytesToHexString(stringToByte(str)))); +// dos.write(hexStringToByte(bytesToHexString(stringToByte(str)))); + dos.write(str.getBytes("UTF-8")); } public static byte[] stringToByte(String str) { @@ -101,12 +104,14 @@ public class LetteringSocketConnectionAutoRun extends AbstractAutoRunnable { public static String bytesToHexString(byte[] src) { StringBuilder builder = new StringBuilder(); + Byte[] bytes = new Byte[src.length]; for (int i = 0; i < src.length; i++) { int v = src[i] & 0xff; String hv = Integer.toHexString(v); if (hv.length() < 2) { builder.append(0); } + bytes[i] = Byte.parseByte(hv); builder.append(hv); } return builder.toString().toUpperCase(); @@ -150,10 +155,9 @@ public class LetteringSocketConnectionAutoRun extends AbstractAutoRunnable { public static void main(String[] args) throws UnsupportedEncodingException { - JSONObject jo = new JSONObject(); - jo.put("x",10.0); - jo.put("y",3.0); - jo.put("angle",0); - System.out.println(bytesToHexString(stringToByte(jo.toString()))); + String write = "SETTEXT S1 '111 > 222'" + "\r\n"; +// System.out.println(hexStringToByte(bytesToHexString(stringToByte(jo)))); +// System.out.println(bytesToHexString(stringToByte(jo.toString()))); + } -} +} \ No newline at end of file diff --git a/qd/src/api/acs/order/order.js b/qd/src/api/acs/order/order.js index a672ec9..0cbd50b 100644 --- a/qd/src/api/acs/order/order.js +++ b/qd/src/api/acs/order/order.js @@ -143,5 +143,13 @@ export function reload() { }) } +export function manual_finish(data) { + return request({ + url: 'api/produceshiftorder/manual_finish', + method: 'post', + data + }) +} + export default { add, edit, del, importExcel, getDtl, send, device_pause, device_restore, clear, stop, order_pause, order_force_complete, detail_pause, detail_force_complete, - selectTemplateList, selectColortypeList, reload, send_letteringMess, send_labelingMess } + selectTemplateList, selectColortypeList, reload, send_letteringMess, send_labelingMess, manual_finish } diff --git a/qd/src/views/acs/order/sorting/index.vue b/qd/src/views/acs/order/sorting/index.vue index 7eda9bf..b5cf4be 100644 --- a/qd/src/views/acs/order/sorting/index.vue +++ b/qd/src/views/acs/order/sorting/index.vue @@ -174,7 +174,7 @@ @@ -309,7 +309,7 @@ export default { } } else { if (flag === '3') { - crudProduceshiftorder.detail_pause(row).then(res => { + crudProduceshiftorder.manual_finish(row).then(res => { this.crud.toQuery() this.crud.notify(status + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS) }).catch(err => {