From e4504da0e9db97af5e0ffbc38d55405e25db4f4d Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期四, 07 八月 2025 17:04:07 +0800 Subject: [PATCH] 修改返回值 --- lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/AssignFileStreamServiceImpl.java | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/AssignFileStreamServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/AssignFileStreamServiceImpl.java index 18f1a94..1b89f6f 100644 --- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/AssignFileStreamServiceImpl.java +++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/AssignFileStreamServiceImpl.java @@ -113,7 +113,7 @@ //鏌ヨ鏂囨。鐨勭姸鎬侊紝鎵瑰噯鐘舵�佹墠鍙互鎸囨淳 DocInfo docInfo=getDocInfo(stream); DocClassification docClassification=iDocClassificationService.getById(docInfo.getClassificationId()); - if (docInfo.getDocDispatchStatus()!=null&&docInfo.getDocDispatchStatus()!=3&&docClassification.getClassificationCode().equals("nc")){ + if (docInfo.getDocDispatchStatus()!=null&&docInfo.getDocDispatchStatus()!=3&&docInfo.getDocDispatchStatus()!=5&&docClassification.getClassificationCode().equals("nc")){ return Result.error("璇ユ枃浠剁姸鎬佷笉鍏佽鎸囨淳,璇峰厛瀹屾垚瀹$娴佺▼"); } if(flowableEnable) { @@ -182,14 +182,13 @@ validateParams(stream); DocInfo docInfo = getDocInfo(stream); MdcEquipment mdcEquipment = getMdcEquipment(stream); - DocFile docFile = docFileService.getById(stream.getFileId()); DocInfo deviceDoc = docInfoService.getByDocAttrAndDocId(stream.getDocId(), 7, stream.getDeviceId()); if (deviceDoc != null) { - handleExistingDeviceDoc(docFile, mdcEquipment, stream.getDeviceId()); + return Result.error("瀛樺湪鐩稿悓鏂囨。,涓嶅厑璁搁噸澶嶆寚娲撅紝璇峰垹闄ゅ悗鎸囨淳"); } deviceDoc = docInfoService.findByAttrAndDocName(docInfo.getDocName(), 7, stream.getDeviceId()); if (deviceDoc != null) { - handleExistingDeviceDoc(docFile, mdcEquipment, stream.getDeviceId()); + return Result.error("瀛樺湪鐩稿悓鏂囨。,涓嶅厑璁搁噸澶嶆寚娲撅紝璇峰垹闄ゅ悗鎸囨淳"); } PermissionStreamNew permissionStreams = getPermissionStreams(stream); if (permissionStreams==null){ @@ -199,7 +198,7 @@ String userId = user.getId(); saveBusinessObject(stream, userId); System.out.println("鎸囨淳NC鏂囨。鍒拌澶囨祦绋嬶細" + stream.getDocId()); - flowCommonService.initActBusiness("鎸囨淳NC鏂囨。鍒拌澶囨祦绋嬶細" +docInfo.getDocName()+"."+docInfo.getDocSuffix()+"鍒拌澶�->"+mdcEquipment.getEquipmentName() , + flowCommonService.initActBusiness("鎸囨淳NC鏂囨。鍒拌澶囨祦绋嬶細" +docInfo.getDocName()+"."+docInfo.getDocSuffix()+"鍒拌澶�->"+mdcEquipment.getEquipmentId() , stream.getStreamId(), "IAssignFileStreamService", "assign_nc_to_device", null); Map<String, Object> variables = new HashMap<>(); variables.put("dataId", stream.getStreamId()); @@ -266,9 +265,9 @@ } handleFileTransfer(mdcEquipment, docFile); //NC鏂囦欢鐨勬嫹璐� - handleFileProcessing(docFile, mdcEquipment, secretFolder); +// handleFileProcessing(docFile, mdcEquipment, secretFolder); //瀵瑰簲浜у搧缁撴瀯鏍戞嫹璐� - handleProductTree(docInfo,docRelativeList.get(0),mdcEquipment.getEquipmentId()); +// handleProductTree(docInfo,docRelativeList.get(0),mdcEquipment.getEquipmentId()); synchronizedFlagService.updateFlag(2); return Result.OK("鎿嶄綔鎴愬姛"); } @@ -405,9 +404,9 @@ //娑夊瘑缃戣繘琛孨C鏂囦欢鐨勬嫹璐� handleFileTransfer(mdcEquipment, docFile); //NC鏂囦欢鐨勬嫹璐� - handleFileProcessing(docFile, mdcEquipment, secretFolder); +// handleFileProcessing(docFile, mdcEquipment, secretFolder); //瀵瑰簲浜у搧缁撴瀯鏍戞嫹璐� - handleProductTree(docInfo,docRelativeList.get(0),mdcEquipment.getEquipmentId()); +// handleProductTree(docInfo,docRelativeList.get(0),mdcEquipment.getEquipmentId()); return synchronizedFlagService.updateFlag(1); }else if(up.getStatus() == 3) { //鎷掔粷鎿嶄綔 浠�涔堜篃涓嶅仛 @@ -532,16 +531,16 @@ } //鑾峰彇鏂囦欢 - private void handleExistingDeviceDoc(DocFile docFile, MdcEquipment mdcEquipment, String deviceId) { + private void handleExistingDeviceDoc(DocInfo docInfo,DocFile docFile, MdcEquipment mdcEquipment, String deviceId) { List<String> strings = iMdcProductionService.findListParentTreeAll(mdcEquipment.getId()); if (strings != null && !strings.isEmpty()) { String path = StringUtils.join(strings.toArray(), "/"); boolean copyFileNc = FileUtilS.copyFileNcToBak(path + "/" + mdcEquipment.getEquipmentId(), docFile.getFileName(), docFile.getFileSuffix()); if (!copyFileNc) { - ExceptionCast.cast(ActivitiCode.ACT_FILE_ERROR); + ExceptionCast.cast(ActivitiCode.ACT_DEVICE_DOC_ERROR); } else { - DocInfo deviceDoc = docInfoService.getByDocAttrAndDocId(deviceId, 7, deviceId); + DocInfo deviceDoc = docInfoService.getByDocAttrAndDocId(docInfo.getDocId(), 7, deviceId); boolean doc = docRelativeService.deleteDocByAttr(deviceDoc.getDocId(), 7, deviceId); if (!doc) { ExceptionCast.cast(ActivitiCode.ACT_DOC_ERROR_DELEVE); -- Gitblit v1.9.3