Jelajahi Sumber

手动移动机器人

oyq28 5 bulan lalu
induk
melakukan
9ff93d7687

+ 10 - 11
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/collection/DeviceCollectionTaskJob.java

@@ -432,7 +432,7 @@ public class DeviceCollectionTaskJob {
         entries.stream().parallel().forEach(vo->{
             try{
                 long l = System.currentTimeMillis();
-                log.info("成航发-"+vo+"-机床报警信息数据采集——开始:"+l);
+                //log.info("成航发-"+vo+"-机床报警信息数据采集——开始:"+l);
                 BaseContextHandler.setTenant("0000");
 
                 String httpserverUrl="http://127.0.0.1:8010/opcua/";
@@ -442,17 +442,17 @@ public class DeviceCollectionTaskJob {
                 jsonParam.put("UserName","OpcUaClient");
                 jsonParam.put("Password","12345678");
                 jsonParam.put("Ip",vo.getKey());
-                log.info("成航-"+vo+"-发机床报警信息数据采集,已请求"+jsonParam);
+                //log.info("成航-"+vo+"-发机床报警信息数据采集,已请求"+jsonParam);
                 String resultData = msgUtil.httpForPost(httpserverUrl, jsonParam.toString());
                 //String resultData=vo.getValue();
-                log.info(vo+"_"+resultData);
-                long l1 = System.currentTimeMillis() - l;
+                //log.info(vo+"_"+resultData);
+                //long l1 = System.currentTimeMillis() - l;
                 ToolCostomAddressHistory toolCostomAddressHistory=new ToolCostomAddressHistory();
                 toolCostomAddressHistory.setValue(resultData);
                 toolCostomAddressHistory.setCreateTime(new Date());
                 toolCostomAddressHistory.setIp(vo.getKey());
                 toolCostomAddressHistoryMapper.insert(toolCostomAddressHistory);
-                log.info("成航-"+vo+"-发机床报警信息数据采集——结束,采集时长:"+l1);
+                //log.info("成航-"+vo+"-发机床报警信息数据采集——结束,采集时长:"+l1);
             }catch (Exception e){
                 log.error(e.getMessage(), e);
             }
@@ -475,19 +475,18 @@ public class DeviceCollectionTaskJob {
             }
 
             long l = System.currentTimeMillis();
-            log.info("成航发PLC报警信息数据采集——开始:"+l);
+            //log.info("成航发PLC报警信息数据采集——开始:"+l);
             BaseContextHandler.setTenant("0000");
             String httpserverUrl="http://localhost:8089/api/JobTasks/DataCollectS7JobWarn";
-            log.info("成航PLC报警信息数据采集,已请求");
+            //log.info("成航PLC报警信息数据采集,已请求");
             String resultData = msgUtil.httpForPost(httpserverUrl, null);
-            //String resultData=vo.getValue();
-            log.info("成航发PLC报警信息数据采集——返回:"+resultData);
-            long l1 = System.currentTimeMillis() - l;
+            //log.info("成航发PLC报警信息数据采集——返回:"+resultData);
+            //long l1 = System.currentTimeMillis() - l;
             PlcCostomAddressHistory plcCostomAddressHistory=new PlcCostomAddressHistory();
             plcCostomAddressHistory.setValue(resultData);
             plcCostomAddressHistory.setCreateTime(new Date());
             plcCostomAddressHistoryMapper.insert(plcCostomAddressHistory);
-            log.info("成航PLC报警信息数据采集——结束,采集时长:"+l1);
+            //log.info("成航PLC报警信息数据采集——结束,采集时长:"+l1);
         }catch (Exception e){
             log.error(e.getMessage(), e);
         }

+ 12 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/externalApi/service/impl/PlcServiceImpl.java

@@ -90,7 +90,7 @@ public class PlcServiceImpl implements PlcService {
 
         if("1".equals(flag)){
             //一键清零
-            Object pcToPlcPointObj = msgUtil.redis_get("PC_TO_PLC_POINT"); //PC 到 PLC的点位
+            /*Object pcToPlcPointObj = msgUtil.redis_get("PC_TO_PLC_POINT"); //PC 到 PLC的点位
             if(pcToPlcPointObj !=null) {
                 JSONArray jsonArray = JSONUtil.parseArray(pcToPlcPointObj);
                 List<Map> list = JSONUtil.toList(jsonArray, Map.class);
@@ -102,7 +102,17 @@ public class PlcServiceImpl implements PlcService {
                 Map<String,Object> map = new HashMap();
                 map.put("pointList",pointList);
                 param.put("data",map);
-            }
+            }*/
+            List<Object> pointList=new ArrayList<>();
+            pointList.add("DB2.2");
+            pointList.add("DB2.4");
+            pointList.add("DB2.6");
+            pointList.add("DB2.8");
+            pointList.add("DB2.10");
+            pointList.add("DB2.12");
+            Map<String,Object> map = new HashMap();
+            map.put("pointList",pointList);
+            param.put("data",map);
         }else {
             if(StringUtil.isEmpty(point)){
                 throw BizException.wrap(BASE_VALID_PARAM.build("请输入要清零的地址"));

+ 7 - 3
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/ToolbarController.java

@@ -13,6 +13,7 @@ import com.github.zuihou.base.R;
 import com.github.zuihou.business.DemoLine.DemoCacheKey;
 import com.github.zuihou.business.DemoLine.DemoLineConstant;
 import com.github.zuihou.business.DemoLine.YunjianConstant;
+import com.github.zuihou.business.edgeLibrary.dao.StockInfoMapper;
 import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
 import com.github.zuihou.business.edgeLibrary.entity.Storge;
 import com.github.zuihou.business.edgeLibrary.service.StockInfoService;
@@ -88,6 +89,8 @@ public class ToolbarController {
     @Autowired
     private ProductionresourceBizMapper productionresourceBizMapper;
     @Autowired
+    private StockInfoMapper stockInfoMapper;
+    @Autowired
     private AgvHikOrderInfoService agvHikOrderInfoService;
     @Autowired
     private ZZoneService zoneService;
@@ -201,12 +204,13 @@ public class ToolbarController {
         Long goodsId = stockInfoList.get(0).getGoodsId();
         //获取托盘信息
         Tray tray = trayService.getById(goodsId);
-
+        this.msgUtil.redis_set(DemoCacheKey.RFID+"1", tray.getNo()+"&", 2L, TimeUnit.DAYS);
         //取托盘
         JSONObject param = new JSONObject();
         param.put("url","10.161.30.248");
         param.put("port","102");
-
+        param.put("taskId","1");
+        param.put("taskNodeId","1");
         Map<String,Object> map = new HashMap<>();
         map.put("mode","256");
         map.put("taskType","1");
@@ -215,7 +219,7 @@ public class ToolbarController {
         map.put("carryType","1");
 
         param.put("data",map);
-        String result = msgUtil.httpForPost(CCS_URL + "HandRobotAction",param.toJSONString());
+        String result = msgUtil.httpForPost(CCS_URL + "RobotAction",param.toJSONString());
         if(StringUtil.isNotEmpty(result)){
             cn.hutool.json.JSONObject returnJson = JSONUtil.parseObj(result);
             if (returnJson.get("result") !=null &&"true".equals(returnJson.get("result"))) {