Sfoglia il codice sorgente

后台业务代码更新

oyq28 2 anni fa
parent
commit
9d34effdb5

+ 17 - 9
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java

@@ -415,9 +415,9 @@ public class TaskWorkNode {
                                     }
                                     msgUtil.pushToNextMq(taskNode,3);
                                 }else{
-
-                                    String zoneType = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.ZONE_TYPE).toString());
-                                    if(zoneType.equals(ParameterKey.ZONE_YJ)){
+                                    /**
+                                     String zoneType = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.ZONE_TYPE).toString());
+                                     if(zoneType.equals(ParameterKey.ZONE_YJ)){
                                         if("3".equals(taskNode.getNodeType()) || "5".equals(taskNode.getNodeType())){
                                             // 云箭三坐标启动不由总控系统发起,节点跳过执行
                                             specialCallBackMyselfFlag = true;
@@ -428,10 +428,19 @@ public class TaskWorkNode {
                                             ret.put("result","true");
                                             returnData = ret.toJSONString();
                                         }
-                                    }
-
-                                    // 打标业务无需放
-                                    if("打标业务".equals(resourceBusiness.getName()) && "SendServoStacker".equals(method)){
+                                    } **/
+
+                                   if(resourceBusiness.getName().indexOf("三坐标")>-1 && "SendServoStacker".equals(method)){
+                                         // 判断三坐标质检或者三坐标偏置量检测 假放节点
+                                         specialCallBackMyselfFlag = true;
+                                         String jsonParam = getRequestParam(conMap);
+                                         //缓存执行当前节点传参
+                                         msgUtil.redis_set(CacheKey.TASK_CURRENT_NODE_PARAMS + "_" + taskNode.getId(), jsonParam);
+                                         JSONObject ret = new JSONObject();
+                                         ret.put("result","true");
+                                         returnData = ret.toJSONString();
+                                   }else if("打标业务".equals(resourceBusiness.getName()) && "SendServoStacker".equals(method)){
+                                        // 打标业务无需放
                                         specialCallBackMyselfFlag = true;
                                         String jsonParam = getRequestParam(conMap);
                                         //缓存执行当前节点传参
@@ -1414,9 +1423,8 @@ public class TaskWorkNode {
                                 String paramKey = zZone.getNo() + "_plc";
                                 String instructionUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(paramKey).toString());
                                 String requestUrl = instructionUrl + "/api/" + "QueryThreeCoordinatesFreePos";
-                                // TODO 先写死测试
                                 String canPutInfo = restTemplate.postForObject(requestUrl, formEntity, String.class);
-                                /*String canPutInfo ="{\"result\":\"L\"}";*/
+                                logger.error("三坐标允许放{}", canPutInfo);
                                 JSONObject canPutInfoObject = JSONObject.parseObject(canPutInfo);
                                 if("false".equals(canPutInfoObject.getString("result"))){
                                     targetList = null;

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java

@@ -2296,7 +2296,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
                 //调用接口
                 try {
                     JSONObject returnDataObject = new JSONObject();
-                    returnData = restTemplate.postForObject("http://192.168.170.156:8089", formEntity, String.class);
+                    returnData = restTemplate.postForObject("http://192.168.11.240:8089", formEntity, String.class);
                     returnDataObject = JSONObject.parseObject(returnData);
                     if ("0".equals(returnDataObject.get("code"))) {
                     } else {

+ 4 - 7
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/util/MsgUtil.java

@@ -208,12 +208,8 @@ public class MsgUtil implements ApplicationContextAware {
                     System.out.println("instructionUrl=" + instructionUrl);
                     System.out.println("jsonParam=" + jsonParam);
                     String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
-
-                    // TODO modify by yejian on 20220525 for 添加三坐标模拟
-                    Random random = new Random();
-                    Boolean measuringFlag = random.nextBoolean();
-//                int measuringResult = measuringFlag ? 0 : 1;
-                    int measuringResult = 1;
+                    //报告检测结果
+                    int measuringResult = (returnData=="1")? 0 : 1;
                     String measuringResultFile = filePath + taskNode.getCompleteBatchNo() + "_" + task.getProcedureNo() + ".csv";
                     List<String> fileContents = new ArrayList<>();
                     OrderQuality orderQuality = new OrderQuality();
@@ -332,7 +328,7 @@ public class MsgUtil implements ApplicationContextAware {
                     System.out.println("jsonParam=" + jsonParam);
                     String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
                     //获取检测结果
-                    int measuringResult = Integer.parseInt(returnData);
+                    int measuringResult = returnData=="1" ? 0 : 1;
                     //_pdfFileGraphic
                     //String measuringResultFile = filePath + bomProcedure.getThreeDimensionalPrograme() + "_" + taskNode.getProcedureNo() + "_" + task.getCompleteBatchNo() + "_" + taskNode.getId() +".pdf";
                     String date = DateUtil.dateToString0(new Date(), "yyyy-M-dd");
@@ -397,6 +393,7 @@ public class MsgUtil implements ApplicationContextAware {
                                 jsonObject.put("taskNodeId",taskNodes.get(0).getId());
                                 //强制下线
                                 jsonObject.put("bizType", BizConstant.MQ_TASK_NODE_TYPE_COMMON);
+                                logger.error("错误下料节点jsonObject "+jsonObject.toString());
                                 dynamicRabbitMq.sendMsg(taskNode.getResourceId().toString(),jsonObject.toString());
                                 return;
                             }

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/edgeLibrary/StorgeMapper.xml

@@ -20,7 +20,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id,create_time,update_user,create_user,update_time,
+        id,create_time,update_user,create_user,update_time,point_id,
         shelves_id, storge_type_id, no, name, status,weight,storgeTypeDesc,storgeNum,lock_status,org_id,resourceId
     </sql>
 

+ 3 - 2
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/externalApi/SynProductionStatus.java

@@ -161,7 +161,6 @@ public class SynProductionStatus {
 
         if(bizProductionResources.size()>0){
             List<Long> macResourceIds = macProductionResources.stream().map(com.github.zuihou.business.productionResourceCenter.entity.Productionresource::getId).collect(Collectors.toList());
-            List<Long> resourceIds = bizProductionResources.stream().map(com.github.zuihou.business.productionResourceCenter.entity.Productionresource::getId).collect(Collectors.toList());
             //获取线边库加工任务列表(模糊匹配舱体和框体线边库)
             List<Long> storgeIds = storgeService.list(new LbqWrapper<Storge>().eq(Storge::getLockStatus, "1").like(Storge::getName, "T_库位")).stream().map(Storge::getId).collect(Collectors.toList());
             //获取线边库零件编号
@@ -230,7 +229,9 @@ public class SynProductionStatus {
                 }
             }
 
+            /*
             //获取即将加工设备列表
+            List<Long> resourceIds = bizProductionResources.stream().map(com.github.zuihou.business.productionResourceCenter.entity.Productionresource::getId).collect(Collectors.toList());
             List<TTask> tasks = taskService.list(new LbqWrapper<TTask>().eq(TTask::getStatus,"2").like(TTask::getProcedureName,"上料"));
             Map<Long, List<TTask>> nextTaskMap = tasks.stream().map(item -> {
                 return taskService.getNNextTask(item, 1);
@@ -260,7 +261,7 @@ public class SynProductionStatus {
                     taskService.update(null, updateWrapper);
                 }
             }
-
+             */
         }
     }
 

+ 2 - 2
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/util/SmbShareFileUtil.java

@@ -365,7 +365,7 @@ public class SmbShareFileUtil {
 
     public static void main(String[] args) {
         String ip="192.168.11.245";
-        String url="smb://192.168.11.245/measuring/111.xls";
+        String url="smb://192.168.11.245/measuring/";
 		//String url="smb://192.168.170.23/measuring/abcd-1234.csv";
         String name="measuring";
         String password="Imcs@123456";
@@ -393,6 +393,6 @@ public class SmbShareFileUtil {
 //        content.add("OK");
 //        writeShareFileContent(url,content,name,password,ip);
 
-        findMeasuringFilesAndDownload(ip,name,password,url,"1d3e5efda0ef4036b9204d31d8813131_OP40","C:/data/projects/uploadfile/file/");
+        findMeasuringFilesAndDownload(ip,name,password,url,"111.xls","C:/data/projects/uploadfile/file/");
     }
 }