From 695a50f416c8095ca14bd37a30faeb5b4f7e07b7 Mon Sep 17 00:00:00 2001 From: 18188916393 <2562295436@qq.com> Date: Wed, 31 Aug 2022 14:19:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=81=E7=A9=BA=E6=89=98?= =?UTF-8?q?=E7=9B=98=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=B7=9Facs=E4=BA=A4=E4=BA=92=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/wms/common/PointUpdateUtil.java | 33 ++++++++++++++++++ .../wms/ext/acs/rest/WmsToAcsController.java | 8 +++++ .../wms/ext/acs/service/WmsToAcsService.java | 6 ++++ .../acs/service/impl/WmsToAcsServiceImpl.java | 10 ++++-- .../sch/manage/buss/CallEmptyVehicleTask.java | 3 +- .../src/main/java/org/nl/wms/wms.xls | Bin 399872 -> 399872 bytes 6 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java new file mode 100644 index 0000000..6a0e96d --- /dev/null +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java @@ -0,0 +1,33 @@ +package org.nl.wms.common; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.nl.modules.system.service.impl.ParamServiceImpl; +import org.nl.utils.SpringContextHolder; +import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl; +import org.nl.wql.core.bean.WQLObject; + +public class PointUpdateUtil { + public static void updatePoint(JSONArray arr) { + WmsToAcsServiceImpl wmsToAcsServiceImpl = new WmsToAcsServiceImpl(); + String isConnect = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("IS_CONNECT_ACS").getValue(); + if (StrUtil.equals("0", isConnect)) { + return; + } + JSONObject joo = wmsToAcsServiceImpl.queryPointStatus(arr); + JSONArray pointarr = joo.getJSONArray("data"); + WQLObject pointTable = WQLObject.getWQLObject("sch_base_point"); + for (int i = 0; i < pointarr.size(); i++) { + JSONObject pointjo = pointarr.getJSONObject(i); + String point_status = "0" + pointjo.getString("move"); + String device_code = pointjo.getString("device_code"); + pointjo.put("point_status", point_status); + JSONObject pointObj = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0); + pointObj.put("point_status", point_status); + pointTable.update(pointObj); + } + } + + +} diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java index bab4ed6..690b815 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java @@ -64,5 +64,13 @@ public class WmsToAcsController { return new ResponseEntity<>(wmsToAcsService.action(arr), HttpStatus.OK); } + @PostMapping("/queryPointStatus") + @Log("查询点位状态") + @ApiOperation("查询点位状态") + public ResponseEntity queryPointStatus(@RequestBody Map whereJson) { + JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data"))); + return new ResponseEntity<>(wmsToAcsService.queryPointStatus(arr), HttpStatus.OK); + } + } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java index b1f74c1..1bf1593 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java @@ -40,6 +40,12 @@ public interface WmsToAcsService { * @return */ Map action(JSONArray arr); + /** + * 下发动作信号 + * @param arr + * @return + */ + Map queryPointStatus(JSONArray arr); } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java index f957a5e..89cc9cc 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java @@ -40,9 +40,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { return AcsUtil.notifyAcs(api, arr); } - public static void main(String[] args) { - String format = DateUtil.format(new Date(), "yyyy-MM-dd"); - System.out.println(format); + @Override + public JSONObject queryPointStatus(JSONArray arr) { + String api = "api/wms/querydevice"; + return AcsUtil.notifyAcs(api, arr); + } + + } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java index ce19bed..d2b1f3d 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java @@ -212,7 +212,8 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { // 压制工序 case YZGX: vehicle_type = VehicleTypeEnum.GTP.getCode(); - start_area = AreaEnum.CYHJ.getCode(); + start_area = AreaEnum.KGTDDQ.getCode(); + break; //烧制工序 case SZGX: diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls b/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls index 467a391b41aa383abd8bfb6340a41b258e8f6e65..5b7382a3b9a08a6ee21b8da4768b726b5eb1a2aa 100644 GIT binary patch delta 45 ucmZqJBGIr#VnYrKn?TUw+eUkui&)x=SQvqr35c127{q7YUc|!ICkg;>^bTAA delta 45 ucmZqJBGIr#VnYrK+XTVq_hgne7qPS#u`mKL6A&{4F^JE)y@-XaPZR)rxDK`e