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 6f8f1ea..5bf003f 100644 Binary files a/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls and b/nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls differ 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 => {