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 467a391..5b7382a 100644 Binary files a/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls and b/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls differ