Bladeren bron

后台功能处理

oyq28 4 dagen geleden
bovenliggende
commit
bbd466ceb9

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

@@ -445,7 +445,11 @@ public class TaskWorkNode {
 
                     //运行条件验证
                     conMap = checkCon(taskNode, tTask, queryMap);
-                    //conMap.put("result", true);
+                    if(!conMap.containsKey("result")){
+                        //处理需要丢弃的节点
+                        return;
+                    }
+
                     logger.info("节点{}检查资源返回{}",taskNode.getId(), conMap);
                     msgUtil.redis_set_map(CacheKey.TASK_CURRENT_NODE_CONDITION + "_" + taskNode.getId(), conMap);
 
@@ -683,8 +687,9 @@ public class TaskWorkNode {
                 //组装接口参数
                 HttpHeaders headers = new HttpHeaders();
                 headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
-                HttpEntity<String> formEntity = new HttpEntity<String>(callBackData.toJSONString(), headers);
-                restTemplate.postForObject(taskNodeCallbackUrl, formEntity, String.class);
+                //HttpEntity<String> formEntity = new HttpEntity<String>(callBackData.toJSONString(), headers);
+                //restTemplate.postForObject(taskNodeCallbackUrl, formEntity, String.class);
+                msgUtil.httpForPost(taskNodeCallbackUrl, callBackData.toJSONString());
             }
             if(lockFlag){
                 lock.unlock();

+ 1 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/MachineNodeServiceImpl.java

@@ -247,8 +247,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                     instructionUrl = instructionUrl.replace("8083","8081");
                     //打标
                     if(ObjectUtil.isNotEmpty(msgUtil.redis_get(YunjianConstant.YUNJIAN_LABEL_STATUS+"_"+task.getId().toString()))){
-                        map.put("result", false);
-                        return map;
+                        return Maps.newHashMap();
                     }
 
                     //获取打标指令编码imcs_t_workpiece

+ 4 - 5
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/MeasuringController.java

@@ -23,6 +23,7 @@ import jcifs.smb.NtlmPasswordAuthentication;
 import jcifs.smb.SmbFile;
 import jcifs.smb.SmbFileInputStream;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.validation.annotation.Validated;
@@ -94,14 +95,12 @@ public class MeasuringController extends SuperController<OrderQualityService, Lo
     @SysLog("下载远程质检报告")
     public R<File> downloadFile(HttpServletResponse response, @RequestBody  Map<String, Object> map) throws IOException, FileNotFoundException {
         String id  = map.get("id").toString();
-
-        /*TTask task = tTaskMapper.selectById(id);
-        String fileName = task.getCompleteBatchNo() + "_" + task.getProcedureNo() + ".csv";*/
-
         OrderQuality orderQuality = baseService.getById(id);
         String fileName = orderQuality.getMeasuringReport();
 
-        response.setHeader("content-type", "application/pdf");
+        String contentType = fileName.contains(".pdf")? "application/pdf" : "text/csv";
+
+        response.setHeader("content-type", contentType);
         response.setContentType("application/octet-stream");
         response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
         byte[] buff = new byte[1024];