From 7f5e6d6e4e4cfc76dfe862e87bdf78d9a428e78f Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Tue, 9 Jan 2024 17:28:28 +0800 Subject: [PATCH] =?UTF-8?q?rev:=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/agv/server/impl/AgvServiceImpl.java | 29 +++++++--- .../impl/AcsPointAngleServiceImpl.java | 13 ++--- .../angle/service/wql/ST_VEHICLE_IN_01.wql | 51 ++++++++++++++++++ .../java/org/nl/acs/device/wql/task_inst.xls | Bin 157696 -> 157696 bytes qd/src/views/acs/angle/index.vue | 6 +-- 5 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 hd/nladmin-system/src/main/java/org/nl/acs/angle/service/wql/ST_VEHICLE_IN_01.wql diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java index 9f8f6e7..f7fe431 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java @@ -88,7 +88,7 @@ public class AgvServiceImpl implements AgvService { @Autowired DeviceService deviceService; @Autowired - private static AcsPointAngleService acsPointAngleService; + AcsPointAngleService acsPointAngleService; private final LogServer logServer; @@ -231,7 +231,7 @@ public class AgvServiceImpl implements AgvService { * demo:destination("cz14", "JackUnload", "3", "") * @return */ - public static JSONObject destination2(String locationName, String operation, String propertiesType, String pro,Instruction dto) { + public JSONObject destination2(String locationName, String operation, String propertiesType, String pro,Instruction dto) { //新增业务订单 JSONObject destinationOrder = new JSONObject(); //目标工作站 @@ -246,16 +246,13 @@ public class AgvServiceImpl implements AgvService { properties.add(pro2); destinationOrder.put("properties", properties); } else if (propertiesType.equals("2")) {//Spin转动 - AcsPointAngleDto acsPointAngleDto = new AcsPointAngleDto(); - acsPointAngleDto = getAcsPointAngleDto(dto); + AcsPointAngleDto acsPointAngleDto = getAcsPointAngleDto(dto); if (ObjectUtil.isEmpty(acsPointAngleDto)){ throw new RuntimeException("沒有找到内容,无法下发"); } - BigDecimal next_point_angle = acsPointAngleDto.getNext_point_angle(); JSONArray properties = new JSONArray(); JSONObject pro1 = new JSONObject(); pro1.put("key", "global_spin_angle");//坐标系类型,global_spin_angle为全局坐标系 - pro1.put("value", next_point_angle);//弧度值,如3.14 properties.add(pro1); JSONObject pro2 = new JSONObject(); pro2.put("key", "spin_direction");//固定值 @@ -289,7 +286,7 @@ public class AgvServiceImpl implements AgvService { return destinationOrder; } - private static AcsPointAngleDto getAcsPointAngleDto(Instruction dto) { + private AcsPointAngleDto getAcsPointAngleDto(Instruction dto) { List list = acsPointAngleService.queryAll(new HashMap()); AcsPointAngleDto acsPointAngleDto = new AcsPointAngleDto(); for (int i = 0; i < list.size(); i++) { @@ -2231,6 +2228,23 @@ public class AgvServiceImpl implements AgvService { ja.add(jo3); } + //放货前下发旋转角度 + com.alibaba.fastjson.JSONObject json1 = new com.alibaba.fastjson.JSONObject(); + AcsPointAngleDto acsPointAngleDto = getAcsPointAngleDto(inst); + if (ObjectUtil.isEmpty(acsPointAngleDto)){ + throw new RuntimeException("沒有找到内容,无法下发"); + } + com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); + BigDecimal next_point_angle = acsPointAngleDto.getNext_point_angle(); + operation_args.put("move_angle",next_point_angle);//弧度值,如3.14 + operation_args.put("skill_name","GoByOdometer"); + operation_args.put("speed_w",1.57); + operation_args.put("loc_mode",1); + json1.put("blockId", IdUtil.simpleUUID()); + json1.put("location", inst.getNext_point_code() + "INPUT"); + json1.put("operation_args",operation_args); + ja.add(json1); + com.alibaba.fastjson.JSONObject jo4 = new com.alibaba.fastjson.JSONObject(); jo4.put("blockId", IdUtil.simpleUUID()); jo4.put("location", inst.getNext_point_code()); @@ -2257,7 +2271,6 @@ public class AgvServiceImpl implements AgvService { jo5.put("script_args", script_args5); ja.add(jo5); } - return ja; } diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/angle/service/impl/AcsPointAngleServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/angle/service/impl/AcsPointAngleServiceImpl.java index 97e1244..6586451 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/angle/service/impl/AcsPointAngleServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/angle/service/impl/AcsPointAngleServiceImpl.java @@ -5,17 +5,15 @@ import lombok.RequiredArgsConstructor; import org.nl.acs.angle.service.AcsPointAngleService; import org.nl.acs.angle.service.dto.AcsPointAngleDto; import org.nl.exception.BadRequestException; +import org.nl.wql.WQL; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.data.domain.Pageable; -import java.util.List; -import java.util.Map; +import java.util.*; import java.io.IOException; import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; @@ -41,9 +39,9 @@ public class AcsPointAngleServiceImpl implements AcsPointAngleService { @Override public Map queryAll(Map whereJson, Pageable page) { - WQLObject wo = WQLObject.getWQLObject("acs_point_angle"); - ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "", "update_time desc"); - final JSONObject json = rb.pageResult(); + HashMap map = new HashMap<>(); + map.put("flag", "1"); + JSONObject json = WQL.getWO("ST_VEHICLE_IN_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "create_time DESC"); return json; } @@ -100,7 +98,6 @@ public class AcsPointAngleServiceImpl implements AcsPointAngleService { String now = DateUtil.now(); dto.setUpdate_time(now); dto.setUpdate_by(currentUsername); - WQLObject wo = WQLObject.getWQLObject("acs_point_angle"); JSONObject json = JSONObject.fromObject(dto); wo.update(json); diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/angle/service/wql/ST_VEHICLE_IN_01.wql b/hd/nladmin-system/src/main/java/org/nl/acs/angle/service/wql/ST_VEHICLE_IN_01.wql new file mode 100644 index 0000000..8e99ec2 --- /dev/null +++ b/hd/nladmin-system/src/main/java/org/nl/acs/angle/service/wql/ST_VEHICLE_IN_01.wql @@ -0,0 +1,51 @@ +[交易说明] + 交易名: 空载具入库分页查询 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.bill_code TYPEAS s_string + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + IF 输入.flag = "1" + PAGEQUERY + SELECT + * + FROM + acs_point_angle + WHERE + 1=1 + ENDSELECT + ENDPAGEQUERY + ENDIF diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls b/hd/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls index d7e2130732e1fd16c2e208cb1b739d4c7d9fda77..c632b4105c1fd72841998d1834290b1592d5cda7 100644 GIT binary patch delta 158 zcmZp;z}awtb3+ab+lK1*g`7^Ci&%;n`4mn*1F~;1Lg>w(ST~$yG@hLJU4ze=ft`VY zfsw%(2-(>;-@M$eJlUj0lbe}=1uV|Yz`S|N_X~VzMzj~PF>WtnV=D4Nli2<#h)JJ^ cb=4}MecRRInN~2fnlTtM7;V3t#H7m#0NRi=H~;_u delta 160 zcmZp;z}awtb3+abTSC_iIRpL8MJz>(d - + - + - +