| | |
| | | <!--spring boot ç»æ--> |
| | | <!--æä¹
å± æ°æ®åº è¿æ¥æ± å¼å§--> |
| | | <!--æ°æ®åºè¿æ¥å¨springbootä¸å®ä¹äºï¼æä»¥å¯ä»¥ç®¡çå
ççæ¬--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.microsoft.sqlserver</groupId>--> |
| | | <!-- <artifactId>mssql-jdbc</artifactId>--> |
| | | <!-- <scope>runtime</scope>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>mssql-jdbc</artifactId> |
| | | <scope>runtime</scope> |
| | | </dependency> |
| | | <!-- <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | <version>${mysql-connector-java.version}</version> |
| | | </dependency>--> |
| | | <!-- è¾¾æ¢¦æ°æ®åº --> |
| | | <dependency> |
| | | <groupId>com.dameng</groupId> |
| | | <artifactId>DmJdbcDriver18</artifactId> |
| | | <version>8.1.1.193</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.dameng</groupId>--> |
| | | <!-- <artifactId>DmJdbcDriver18</artifactId>--> |
| | | <!-- <version>8.1.1.193</version>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | |
| | | import com.lxzn.framework.domain.activiti.request.AssignFileRequest; |
| | | import com.lxzn.framework.domain.activiti.request.AssignFileStreamQueryRequest; |
| | | import com.lxzn.framework.domain.activiti.response.ActivitiCode; |
| | | import com.lxzn.framework.domain.nc.DocInfo; |
| | | import com.lxzn.framework.domain.plm.PdmProgramSource; |
| | | import com.lxzn.framework.model.response.QueryPageResponseResult; |
| | | import com.lxzn.framework.model.response.ResponseResult; |
| | | |
| | |
| | | String partsCode, String processCode, |
| | | String description,String id); |
| | | |
| | | boolean saveListNcFromPdm(DocInfo docInfo, PdmProgramSource source); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.lxzn.framework.domain.activiti.ToEquipmentTask; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IToEquipmentTaskService extends IService<ToEquipmentTask> { |
| | | |
| | | //åéæä»¶å°å¯æ æä»¶å¤¹ |
| | | void updateNcFileFromTask(); |
| | | |
| | | /** |
| | | * æ¥è¯¢æä¸ç±»æä»¶ |
| | | * @param syncFlag |
| | | * @return |
| | | */ |
| | | List<ToEquipmentTask> selectTaskSyncFlag(Integer syncFlag); |
| | | |
| | | /** |
| | | * éè¿æä»¶åç§°ä¸ç¶æç¡®å®æ¯å¦å¯ä»¥å é¤ |
| | | * @param filePath,fileEncodeName,yncFlag |
| | | * @return |
| | | */ |
| | | List<ToEquipmentTask> selectTaskByNameAndSyncFlag(String filePath,String fileEncodeName,Integer syncFlag); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.lxzn.activiti.dao.AssignFileStreamMapper; |
| | | import com.lxzn.activiti.service.IActivitiDefinitionService; |
| | | import com.lxzn.activiti.service.IAssignFileStreamService; |
| | |
| | | import com.lxzn.framework.domain.nc.*; |
| | | import com.lxzn.framework.domain.nc.response.DeviceCode; |
| | | import com.lxzn.framework.domain.nc.response.DocumentCode; |
| | | import com.lxzn.framework.domain.plm.PdmProgramSource; |
| | | import com.lxzn.framework.domain.ucenter.Department; |
| | | import com.lxzn.framework.domain.ucenter.response.UcenterCode; |
| | | import com.lxzn.framework.exception.ExceptionCast; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private String serverIp; |
| | | @Value("${securedoc.serverPort}") |
| | | private int serverPort; |
| | | @Value("${ncPdm.file_path}") |
| | | private String localFilePath; |
| | | @Value("${fileHomePath}") |
| | | private String fileHomePath; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | dncLogService.save(dncLog); |
| | | return false; |
| | | } |
| | | //å·¥åºå¤©å é»è¾ |
| | | processCode = processCode.split("_")[0]; |
| | | ProcessStream stream = processStreamService.findByProcessEquipment(equipmentId, |
| | | processCode,description,compTotal.getComponentId(),part.getPartsId()); |
| | |
| | | dncLogService.save(dncLog); |
| | | return synchronizedFlagService.updateFlag(0); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param docInfo |
| | | * @param source |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean saveListNcFromPdm(DocInfo docInfo, PdmProgramSource source) { |
| | | |
| | | DncLog dncLog = new DncLog(); |
| | | DeviceInfo deviceInfo = deviceInfoService.getByDeviceNo("PDMMES"); |
| | | if(deviceInfo == null) { |
| | | dncLog.setRemarks("DNCä¸è®¾å¤ä¸åå¨,æ æ¤è®¾å¤çç¨åºä¸å_PDMMES" ); |
| | | dncLogService.save(dncLog); |
| | | return false; |
| | | } |
| | | DocFile docFile = docFileService.getById(docInfo.getPublishFileId()); |
| | | if(docFile == null) { |
| | | return false; |
| | | } |
| | | String id = IdWorker.getIdStr(); |
| | | String name = DateUtil.format(DateUtil.getNow(),DateUtil.STR_YEARMONTHDAY); |
| | | String newPath = "/securedoc" + docFile.getFilePath(); |
| | | String loFilePath = fileHomePath + newPath + "\\" + name +"_" + id; |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | | String json = mapper.writeValueAsString(source); |
| | | try { |
| | | FileUtil.fileWriterSql(loFilePath,json); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | //æå
¥ææ¡£å°è®¾å¤åéææ¡£ |
| | | DocClassification classification = classificationService.getByCode(SEND_CODE); |
| | | if(classification == null) |
| | | return false; |
| | | DocRelative docRelative = new DocRelative(); |
| | | docRelative.setDocId(docInfo.getDocId()); |
| | | docRelative.setClassificationId(classification.getClassificationId()); |
| | | docRelative.setAttributionType(4); |
| | | docRelative.setAttributionId(deviceInfo.getDeviceId()); |
| | | boolean b = docRelativeService.save(docRelative); |
| | | if(!b) { |
| | | return false; |
| | | } |
| | | |
| | | //å¤å¶æä»¶ï¼è¿è¡é¢å®å¯ |
| | | b = FileUtil.copyFile(docFile.getFilePath(), newPath, docFile.getFileEncodeName()); |
| | | if(!b){ |
| | | return false; |
| | | } |
| | | |
| | | String absPath = FileUtil.getFileAbsPath(newPath, docFile.getFileEncodeName()); |
| | | if(absPath == null){ |
| | | return false; |
| | | } |
| | | try { |
| | | secureDocService.binByFileLable(absPath); |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | try { |
| | | secureDocService.editLabelByPath(absPath); |
| | | }catch (Exception e) { |
| | | return false; |
| | | } |
| | | //æå
¥æä»¶ä¼ è¾ä»»å¡è¡¨ |
| | | ToEquipmentTask equipmentTask = new ToEquipmentTask(); |
| | | //ä¸è½ç´æ¥ä»doc䏿¿fileId åversion å¯è½ä¼åå¨åæ´ |
| | | |
| | | //equipmentTask.setFileId(docInfo.getPublishFileId()); |
| | | //equipmentTask.setDocVersion(docInfo.getPublishVersion()); |
| | | equipmentTask.setDocId(docInfo.getDocId()); |
| | | equipmentTask.setSyncFlag(1); |
| | | equipmentTask.setDeviceNo(deviceInfo.getDeviceNo()); |
| | | equipmentTask.setDeviceId(deviceInfo.getDeviceId()); |
| | | equipmentTask.setDepartId(deviceInfo.getDepartId()); |
| | | //æä»¶ç¸å
³ä¿¡æ¯ |
| | | equipmentTask.setFileId(docFile.getFileId()); |
| | | equipmentTask.setDocVersion(docFile.getDocVersion()); |
| | | equipmentTask.setFileName(docInfo.getDocName()); |
| | | equipmentTask.setFileEncodeName(docFile.getFileEncodeName()); |
| | | equipmentTask.setFilePath(docFile.getFilePath()); |
| | | equipmentTask.setFileSuffix(docFile.getFileSuffix()); |
| | | equipmentTask.setFileSize(docFile.getFileSize()); |
| | | b = equipmentTaskService.save(equipmentTask); |
| | | if(!b) { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | //TODO |
| | | //å¤å¶æä»¶ï¼è¿è¡é¢å®å¯ |
| | | String absPathTxt = FileUtil.getFileAbsPathTxt(loFilePath); |
| | | if(absPathTxt == null){ |
| | | return false; |
| | | } |
| | | try { |
| | | secureDocService.binByFileLable(absPathTxt); |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | try { |
| | | secureDocService.editLabelByPath(absPathTxt); |
| | | }catch (Exception e) { |
| | | return false; |
| | | } |
| | | |
| | | ToEquipmentTask equipmentTaskTxt = new ToEquipmentTask(); |
| | | /*equipmentTaskTxt.setDocId(docInfo.getDocId());*/ |
| | | equipmentTaskTxt.setSyncFlag(1); |
| | | equipmentTaskTxt.setDeviceNo(deviceInfo.getDeviceNo()); |
| | | equipmentTaskTxt.setDeviceId(deviceInfo.getDeviceId()); |
| | | equipmentTaskTxt.setDepartId(deviceInfo.getDepartId()); |
| | | //æä»¶ç¸å
³ä¿¡æ¯ |
| | | /*equipmentTaskTxt.setFileId(docFile.getFileId());*/ |
| | | equipmentTaskTxt.setDocVersion("a.1"); |
| | | equipmentTaskTxt.setFileName( name +"_" + id); |
| | | equipmentTaskTxt.setFileEncodeName( name +"_" + id); |
| | | equipmentTaskTxt.setFilePath(docFile.getFilePath()); |
| | | equipmentTaskTxt.setFileSuffix("txt"); |
| | | equipmentTaskTxt.setFileSize(FileUtil.selectFileSize(new File(loFilePath))); |
| | | boolean txt = equipmentTaskService.save(equipmentTaskTxt); |
| | | if(!txt) { |
| | | return false; |
| | | } |
| | | |
| | | dncLog.setIsSuccess(LogCodeUtil.success_is_true); |
| | | dncLog.setRemarks("ä¸åæå"); |
| | | dncLogService.save(dncLog); |
| | | return synchronizedFlagService.updateFlag(0); |
| | | } |
| | | } |
| | |
| | | import com.lxzn.activiti.dao.ToEquipmentTaskMapper; |
| | | import com.lxzn.activiti.service.IToEquipmentTaskService; |
| | | import com.lxzn.framework.domain.activiti.ToEquipmentTask; |
| | | import com.lxzn.framework.domain.activiti.response.ActivitiCode; |
| | | import com.lxzn.framework.domain.nc.DeviceInfo; |
| | | import com.lxzn.framework.exception.ExceptionCast; |
| | | import com.lxzn.framework.utils.ValidateUtil; |
| | | import com.lxzn.framework.utils.file.FileUtil; |
| | | import com.lxzn.nc.service.IDeviceGroupService; |
| | | import com.lxzn.nc.service.IDeviceInfoService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.security.core.parameters.P; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class ToEquipmentTaskServiceImpl extends ServiceImpl<ToEquipmentTaskMapper, ToEquipmentTask> implements IToEquipmentTaskService { |
| | | |
| | | @Autowired |
| | | private IDeviceInfoService deviceInfoService; |
| | | @Autowired |
| | | private IDeviceGroupService deviceGroupService; |
| | | |
| | | @Override |
| | | @Scheduled(cron = "${taskSync}") |
| | | public void updateNcFileFromTask() { |
| | | List<ToEquipmentTask> taskList = this.selectTaskSyncFlag(1); |
| | | if (taskList == null || taskList.isEmpty()) { |
| | | return; |
| | | } |
| | | List<ToEquipmentTask> successTasks = new ArrayList<>(); |
| | | |
| | | for (ToEquipmentTask task : taskList) { |
| | | DeviceInfo deviceInfo = deviceInfoService.getByDeviceNo(task.getDeviceNo()); |
| | | if (deviceInfo == null) { |
| | | continue; |
| | | } |
| | | List<String> pathList = deviceGroupService.findListParentTreeAll(deviceInfo.getGroupId()); |
| | | if (pathList == null || pathList.isEmpty()) { |
| | | continue; |
| | | } |
| | | String targetPath = StringUtils.join(pathList.toArray(), "/") |
| | | + "/" + deviceInfo.getDeviceNo() |
| | | + "/send/" |
| | | + task.getFileName(); |
| | | String sourceFilePath = task.getFilePath() + "/" + task.getFileEncodeName(); |
| | | Boolean copySuccess = FileUtil.copyFileUpName(sourceFilePath, targetPath, task.getFileSuffix()); |
| | | if (copySuccess) { |
| | | task.setSyncFlag(2); |
| | | successTasks.add(task); |
| | | } |
| | | } |
| | | if (!successTasks.isEmpty()) { |
| | | super.saveOrUpdateBatch(successTasks); |
| | | } |
| | | deleteSourceFilesAfterBatchUpdate(taskList); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ´æ°åæ£æ¥å¹¶å 餿ºæä»¶ |
| | | */ |
| | | private void deleteSourceFilesAfterBatchUpdate(List<ToEquipmentTask> allTasks) { |
| | | Map<String, String> filePathMap = new HashMap<>(); |
| | | |
| | | for (ToEquipmentTask task : allTasks) { |
| | | if (task.getSyncFlag() == 2) { |
| | | String key = task.getFilePath() + "_" + task.getFileEncodeName(); |
| | | if (!filePathMap.containsKey(key)) { |
| | | filePathMap.put(key, task.getFilePath() + "/" + task.getFileEncodeName()); |
| | | } |
| | | } |
| | | } |
| | | for (Map.Entry<String, String> entry : filePathMap.entrySet()) { |
| | | String[] parts = entry.getKey().split("_"); |
| | | if (parts.length >= 2) { |
| | | String filePath = parts[0]; |
| | | String fileEncodeName = parts[1]; |
| | | List<ToEquipmentTask> remainingTasks = this.selectTaskByNameAndSyncFlag( |
| | | filePath, |
| | | fileEncodeName, |
| | | 1 |
| | | ); |
| | | if (remainingTasks == null || remainingTasks.isEmpty()) { |
| | | FileUtil.deleteNcFile(entry.getValue()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<ToEquipmentTask> selectTaskSyncFlag(Integer syncFlag) { |
| | | if (!ValidateUtil.validateInteger(syncFlag)) { |
| | | return null; |
| | | } |
| | | return super.lambdaQuery() |
| | | .eq(ToEquipmentTask::getSyncFlag, syncFlag) |
| | | .list(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ToEquipmentTask> selectTaskByNameAndSyncFlag(String filePath, String fileEncodeName, Integer syncFlag) { |
| | | if (!ValidateUtil.validateInteger(syncFlag) |
| | | || !ValidateUtil.validateString(filePath) |
| | | || !ValidateUtil.validateString(fileEncodeName)) { |
| | | return null; |
| | | } |
| | | return super.lambdaQuery() |
| | | .eq(ToEquipmentTask::getSyncFlag, syncFlag) |
| | | .eq(ToEquipmentTask::getFilePath, filePath) |
| | | .eq(ToEquipmentTask::getFileEncodeName, fileEncodeName) |
| | | .list(); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void configure(WebSecurity web) { |
| | | web.ignoring().antMatchers("/auth/user/login","/auth/user/logout","/auth/user/jwt", "/services/**","/auth//user/updatePd"); |
| | | web.ignoring().antMatchers("/auth/user/login","/auth/user/logout","/auth/user/jwt", "/services/**","/auth/user/updatePd"); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author joetao |
| | |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | .apiInfo(apiInfo()) |
| | | //.securitySchemes(Arrays.asList(apiKey())) |
| | | .securitySchemes(Collections.singletonList(securityScheme())) |
| | | .securityContexts(Collections.singletonList(securityContext())); |
| | | } |
| | |
| | | .build(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è¿éæ¯åå
许认è¯çscope |
| | | */ |
| | |
| | | new AuthorizationScope("all", "All scope is trusted!") |
| | | }; |
| | | } |
| | | |
| | | private ApiKey apiKey() { |
| | | return new ApiKey("apiKey", "api_key", "header"); |
| | | } |
| | | /*private SecurityContext securityContext() { |
| | | return SecurityContext.builder() |
| | | .securityReferences(defaultAuth()) |
| | | .forPaths(PathSelectors.any()) |
| | | .build(); |
| | | }*/ |
| | | |
| | | List<SecurityReference> defaultAuth() { |
| | | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); |
| | | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; |
| | | authorizationScopes[0] = authorizationScope; |
| | | return Arrays.asList(new SecurityReference("apiKey", authorizationScopes)); |
| | | } |
| | | } |
| | |
| | | ACT_DOC_ID_NONE(false, 21014, "ææ¡£ç¼å·ä¸åå¨ï¼"), |
| | | ACT_DOC_ERROR(false,21015,"å¯å¨æµç¨å¤±è´¥ï¼ææ¡£ä¿¡æ¯é误ï¼"), |
| | | ACT_DEVICE_DOC_ERROR(false,21016,"å¯å¨æµç¨å¤±è´¥ï¼è®¾å¤å·²åå¨è¯¥ææ¡£ï¼"), |
| | | ACT_DEVICE_DOC_FILELABLE(false,21016,"坿 ç³»ç»å¼å¸¸ï¼"); |
| | | ACT_DEVICE_DOC_FILELABLE(false,21017,"坿 ç³»ç»å¼å¸¸,ï¼"); |
| | | |
| | | //æä½ä»£ç |
| | | @ApiModelProperty(value = "æä½æ¯å¦æå", example = "true", required = true) |
| | |
| | | private String ae8ncModelNo; |
| | | @TableField(value = "SQZT") |
| | | private String sqzt; |
| | | /**/ |
| | | @TableField(exist = false) |
| | | private String fileName; |
| | | |
| | | |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private Date createTime; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lxzn.framework.domain.plm.ext; |
| | | |
| | | /** |
| | | * @author clown |
| | | * * @date 2024/3/25 |
| | | */ |
| | | public class PdmProgramInfoExt { |
| | | } |
| | |
| | | public static final String STR_DATE_TIME_FULL = "yyyyMMddHHmmssSSS"; |
| | | public static final String STR_DATE_TIME_SHE = "yyyyMMddHHmmss"; |
| | | public static final String STR_YEARMONTH = "yyyyMM"; |
| | | public static final String STR_YEARMONTHDAY = "yyyyMMdd"; |
| | | public static final String STR_YEAR = "yyyy"; |
| | | |
| | | /** |
| | |
| | | import com.lxzn.framework.exception.ExceptionCast; |
| | | import com.lxzn.framework.utils.SHA256Util; |
| | | import com.lxzn.framework.utils.date.DateUtil; |
| | | import lombok.SneakyThrows; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import java.net.URLEncoder; |
| | | import java.nio.channels.FileChannel; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | | import java.nio.file.StandardCopyOption; |
| | | import java.security.MessageDigest; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | public class FileUtil { |
| | | |
| | | private static String fileUploadFolder; |
| | | private static String fileNcGateway; |
| | | @Value("${fileNcGateway}") |
| | | public void setFileNcGateway(String fileNcGateway) { |
| | | FileUtil.fileNcGateway = fileNcGateway; |
| | | } |
| | | |
| | | @Value("${fileHomePath}") |
| | | public void setFileUploadFolder(String fileUploadFolder) { |
| | |
| | | dto.setFileSize(fileSize); |
| | | dto.setFileSuffix(suffix); |
| | | return dto; |
| | | } |
| | | |
| | | /** |
| | | * æ¹æ³ä¸:ä½¿ç¨ FileWriter åæä»¶ |
| | | * @param filepath æä»¶ç®å½ |
| | | * @param content å¾
åå
¥å
容 |
| | | * @throws IOException |
| | | */ |
| | | public static void fileWriterSql(String filepath, String content) throws IOException { |
| | | OutputStreamWriter outputStreamWriter = null; |
| | | try { |
| | | File file = new File(filepath); |
| | | if (!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileOutputStream outputStream = new FileOutputStream(file); |
| | | if (outputStream != null){ |
| | | outputStreamWriter = new OutputStreamWriter(outputStream, "utf-8"); |
| | | outputStreamWriter.write(content); |
| | | outputStreamWriter.flush(); |
| | | } |
| | | try { |
| | | if (outputStreamWriter != null){ |
| | | outputStreamWriter.close(); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | catch (IOException e) { |
| | | e.getMessage(); |
| | | } |
| | | finally { |
| | | try { |
| | | if (outputStreamWriter != null){ |
| | | outputStreamWriter.close(); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å 餿件 |
| | | * |
| | | * @param filePath |
| | | * @return |
| | | */ |
| | | public static boolean deleteNcFile(String filePath) { |
| | | String lastFileReName = fileUploadFolder + "/" + filePath ; |
| | | boolean flag = false; |
| | | File file = new File(lastFileReName); |
| | | if (!file.exists()) { |
| | | return flag; |
| | | } |
| | | boolean b = file.delete(); |
| | | if (!b) { |
| | | System.out.println("æä»¶å é¤å¤±è´¥ï¼ " + filePath); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * å¤å¶æä»¶ï¼å¸¦éè¯ã大尿 ¡éªåMD5æ ¡éªï¼ç¡®ä¿å¤å¶å®æ´æ§ä¸å¯é æ§ï¼ |
| | | * ä» fileUploadFolder ä¸çæºè·¯å¾å¤å¶å° fileNcGateway ä¸çç®æ è·¯å¾ï¼å¯æå®æ°çæä»¶æ©å±å |
| | | * @param lastFile æºæä»¶çç¸å¯¹è·¯å¾ï¼ç¸å¯¹äº fileUploadFolderï¼ |
| | | * @param newFile ç®æ æä»¶çç¸å¯¹è·¯å¾ï¼ç¸å¯¹äº fileNcGatewayï¼ |
| | | * @param ncFix ï¼å¯éï¼ç®æ æä»¶çæ°æ©å±åï¼ä¸å¸¦ç¹ï¼å¦ "txt"ï¼ï¼ä¼ å
¥ null æç©ºå符串åä¸ä¿®æ¹åæ©å±å |
| | | * @return å¤å¶æåè¿å trueï¼å¦åè¿å false |
| | | */ |
| | | public static boolean copyFileUpName(String lastFile, String newFile, String ncFix) { |
| | | // 1. æå»ºæºæä»¶åç®æ æä»¶çç»å¯¹è·¯å¾ |
| | | String sourceFilePath = fileUploadFolder + "/" + lastFile; |
| | | String targetFilePath = fileNcGateway + "/" + newFile; |
| | | |
| | | // 2. 妿æå®äºæ°çæ©å±åï¼åéå å°ç®æ æä»¶å |
| | | if (StringUtils.isNotBlank(ncFix)) { |
| | | targetFilePath = targetFilePath + "." + ncFix; |
| | | } |
| | | |
| | | // 3. åå»ºç®æ æä»¶å¤¹ |
| | | File targetFile = new File(targetFilePath); |
| | | File targetParentDir = targetFile.getParentFile(); |
| | | if (!targetParentDir.exists() && !targetParentDir.mkdirs()) { |
| | | log.error("æ æ³åå»ºç®æ æä»¶å¤¹: {}", targetParentDir.getAbsolutePath()); |
| | | return false; |
| | | } |
| | | |
| | | // 4. è·åæºæä»¶é¢æå¤§å° |
| | | long expectedSize = -1; |
| | | File sourceFile = new File(sourceFilePath); |
| | | if (!sourceFile.exists()) { |
| | | log.error("æºæä»¶ä¸åå¨: {}", sourceFilePath); |
| | | return false; |
| | | } |
| | | try { |
| | | expectedSize = sourceFile.length(); |
| | | log.info("æä»¶å¤å¶: æº={}, ç®æ ={}, 大å°={}åè", sourceFilePath, targetFilePath, expectedSize); |
| | | } catch (SecurityException e) { |
| | | log.error("æ æ³è®¿é®æºæä»¶: {}", sourceFilePath, e); |
| | | return false; |
| | | } |
| | | |
| | | // 5. å¤å¶æä½ï¼æå¤éè¯3æ¬¡ï¼ |
| | | int maxRetries = 3; |
| | | int attempt = 0; |
| | | boolean copySuccess = false; |
| | | |
| | | while (attempt < maxRetries && !copySuccess) { |
| | | attempt++; |
| | | try { |
| | | log.info("---- å¼å§ç¬¬{}次å¤å¶å°è¯ ----", attempt); |
| | | |
| | | // 6. æ§è¡å¤å¶æä½ï¼ä½¿ç¨NIO FileChannel以æé«æçï¼ |
| | | long startTime = System.currentTimeMillis(); |
| | | try (FileChannel in = new FileInputStream(sourceFilePath).getChannel(); |
| | | FileChannel out = new FileOutputStream(targetFilePath).getChannel()) { |
| | | out.transferFrom(in, 0, in.size()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | log.info("æä»¶ä¼ è¾å®æï¼èæ¶: {}毫ç§", (endTime - startTime)); |
| | | |
| | | // 7. æä»¶å¤§å°éªè¯ |
| | | File copiedFile = new File(targetFilePath); |
| | | long actualSize = copiedFile.length(); |
| | | |
| | | if (expectedSize != actualSize) { |
| | | log.warn("大å°ä¸ä¸è´! 颿: {}B, å®é
: {}B (å·®å¼: {}B)", |
| | | expectedSize, actualSize, Math.abs(actualSize - expectedSize)); |
| | | } else { |
| | | log.info("æä»¶å¤§å°éªè¯æå: {}B", actualSize); |
| | | copySuccess = true; |
| | | } |
| | | |
| | | // 8. MD5æ ¡éª |
| | | if (copySuccess) { |
| | | String sourceMd5 = calculateMD5(sourceFilePath); |
| | | String targetMd5 = calculateMD5(targetFilePath); |
| | | |
| | | if (!sourceMd5.equals(targetMd5)) { |
| | | log.warn("MD5ä¸ä¸è´! æº: {}, ç®æ : {}", sourceMd5, targetMd5); |
| | | copySuccess = false; |
| | | } else { |
| | | log.info("MD5éªè¯æå"); |
| | | } |
| | | } |
| | | |
| | | } catch (IOException | SecurityException e) { |
| | | log.error("第{}次å¤å¶å¤±è´¥", attempt, e); |
| | | } |
| | | |
| | | // 9. éè¯é´éå¤ç |
| | | if (!copySuccess && attempt < maxRetries) { |
| | | try { |
| | | int delay = 200 * attempt; // éå¢å»¶è¿ï¼200ms, 400ms |
| | | log.info("çå¾
{}ms åéè¯", delay); |
| | | Thread.sleep(delay); |
| | | } catch (InterruptedException ie) { |
| | | Thread.currentThread().interrupt(); |
| | | log.warn("éè¯çå¾
è¢«ä¸æ", ie); |
| | | break; // å¦æçº¿ç¨è¢«ä¸æï¼åéåºéè¯å¾ªç¯ |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (copySuccess) { |
| | | log.info("æä»¶å¤å¶å®æ: {}", targetFilePath); |
| | | } else { |
| | | log.error("æä»¶å¤å¶å¤±è´¥ï¼å·²å°è¯{}æ¬¡ãæºæä»¶: {}, ç®æ æä»¶: {}", maxRetries, sourceFilePath, targetFilePath); |
| | | } |
| | | |
| | | return copySuccess; |
| | | } |
| | | |
| | | public static FileUploadResult uploadFile(String fileName, InputStream fis) { |
| | |
| | | log.error(e.getMessage()); |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * å 餿件 |
| | | * |
| | | * @param filePath |
| | | * @return |
| | | */ |
| | | public static boolean deleteFile(String filePath) { |
| | | boolean flag = false; |
| | | File file = new File(filePath); |
| | | if (!file.exists()) { |
| | | return flag; |
| | | } |
| | | boolean b = file.delete(); |
| | | if (!b) { |
| | | try { |
| | | System.gc(); |
| | | Path path = Paths.get(filePath); |
| | | Files.deleteIfExists(path); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @param file |
| | | * @return |
| | | */ |
| | | public static long selectFileSize(File file) { |
| | | try (FileInputStream fis = new FileInputStream(file)) { |
| | | long size = 0; |
| | | int read; |
| | | byte[] buffer = new byte[1024]; |
| | | while ((read = fis.read(buffer)) != -1) { |
| | | size += read; |
| | | } |
| | | return size; |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public static String getFileAbsPath(String path, String fileName){ |
| | | path = fileUploadFolder + path; |
| | | File file = new File(path, fileName); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static String getFileAbsPathTxt(String path){ |
| | | File file = new File(path); |
| | | if(file.exists()){ |
| | | return file.getAbsolutePath(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | boolean editDeviceGroup(String id, DeviceGroup deviceGroup); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææç¶èç¹åæ¬èç¹åç§° |
| | | * @param groupId |
| | | * @return |
| | | */ |
| | | List<String> findListParentTreeAll(String groupId); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææç¶èç¹åç§° |
| | | * @param parentId |
| | | * @param stringList |
| | | * @return |
| | | */ |
| | | List<String> findListParentTree(String parentId,List<String> stringList); |
| | | |
| | | /** |
| | | * å é¤è®¾å¤åç» |
| | | * @param id |
| | | * @return |
| | |
| | | import com.lxzn.nc.dao.DeviceGroupMapper; |
| | | import com.lxzn.nc.service.*; |
| | | import com.lxzn.ucenter.service.IDepartmentService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<String> findListParentTreeAll(String groupId) { |
| | | if ( StringUtils.isEmpty(groupId)) { |
| | | return null; |
| | | } |
| | | List<String> strings = new ArrayList<>(); |
| | | DeviceGroup en = super.getById(groupId); |
| | | if (en == null) { |
| | | return null; |
| | | } |
| | | strings.add(en.getGroupName()); |
| | | if (StringUtils.isEmpty(en.getParentId())) { |
| | | return strings; |
| | | } else { |
| | | return findListParentTree(en.getParentId(),strings); |
| | | } |
| | | } |
| | | @Override |
| | | public List<String> findListParentTree(String parentId,List<String> stringList){ |
| | | if (StringUtils.isEmpty(parentId)) { |
| | | return null; |
| | | } |
| | | if (stringList == null || stringList.isEmpty()) { |
| | | stringList = new ArrayList<>(); |
| | | } |
| | | boolean p = true; |
| | | if (p) { |
| | | DeviceGroup en = super.getById(parentId); |
| | | if (en != null) { |
| | | stringList.add(0,en.getGroupName()); |
| | | } |
| | | if (StringUtils.isNotBlank(en.getParentId())) { |
| | | parentId = en.getParentId(); |
| | | findListParentTree(parentId,stringList); |
| | | } else { |
| | | p = false; |
| | | return stringList; |
| | | } |
| | | } |
| | | return stringList; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean deleteDeviceGroup(String id) { |
| | | if(!ValidateUtil.validateString(id)) |
| | |
| | | import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.lxzn.activiti.service.IAssignFileStreamService; |
| | | import com.lxzn.base.service.IDncLogService; |
| | | import com.lxzn.base.service.IEquipmentClassService; |
| | | import com.lxzn.framework.domain.base.DncLog; |
| | |
| | | private IDncLogService dncLogService; |
| | | @Autowired |
| | | private IEquipmentClassService equipmentClassService; |
| | | @Autowired |
| | | private IAssignFileStreamService assignFileStreamService; |
| | | |
| | | |
| | | @Value("${ncPdm.file_path}") |
| | |
| | | JsonMapper mapper = new JsonMapper(); |
| | | try { |
| | | Object[] objects = new Object[]{ncLog.getSkgxId(),ncLog.getSkgxRevId(),ncLog.getSqzt(),"",""}; |
| | | //String program = "{\"code\":1,\"message\":\"\",\"response\":[{\"skgx_id\":\"CXä¿¡æ¯ä¸å¿10000070\",\"skgx_rev_id\":\"1\",\"skgx_name\":\"çæ¥æ°æ§ç¨åº\",\"sqzt\":\"Sç¶æ\",\"ae8nc_cxno\":\"CXä¿¡æ¯ä¸å¿10000070\",\"ae8nc_gfrev\":\"1\",\"ae8nc_sbno\":\"2240080\",\"ae8nc_jcid\":\"QJK006\",\"ae8nc_os\":\"å䏿°æ§-HNC848C\",\"ae8nc_filename\":\"107052PA5\",\"ae8nc_cxfz\":\"è®¡ç®æºä»¿ç\",\"ae8nc_operator\":\"\",\"ae8nc_inspect\":\"\",\"ae8nc_acceptview\":\"\",\"ae8nc_cxno_unit\":\"ä¿¡æ¯ä¸å¿\",\"ae8nc_filename_unit\":\"PA\",\"ae8gallery\":\"\",\"ae8nc_plant\":\"ä¿¡æ¯ä¸å¿\",\"ae8nc_modelno\":\"jx\",\"ae8nc_batchno\":\"\",\"meop_id\":\"OPHJ000000000049108\",\"meop_rev_id\":\"A\",\"meop_name\":\"çæ¥\",\"meop_type\":\"AE8Operation Revision\",\"ae8gx_no\":\"5\",\"process_id\":\"JZG2022008107653\",\"process_rev_id\":\"1\",\"process_name\":\"107052\",\"ae8part_no\":\"107052\",\"ae8stageidentifying\":\"L\",\"ae8gy_type\":\"æºå å·¥èºè®¾è®¡\",\"ae8plant\":\"ä¿¡æ¯ä¸å¿\",\"part_id\":\"1047051\",\"part_rev_id\":\"01\",\"part_name\":\"éææµè¯ä»¶\",\"create_by\":\"ç¨æ·2(user2)\",\"create_date\":\"02-9æ-22 17:15:14\",\"filename\":\"DNC-CXä¿¡æ¯ä¸å¿10000070-1.zip\",\"filepath\":\"http://192.168.2.234:8081/ncprogram/202209/DNC-CXä¿¡æ¯ä¸å¿10000070-1.zip\"}]}\n"; |
| | | //String program = "{\"code\":1,\"message\":\"\",\"response\":[{\"skgx_id\":\"CXä¿¡æ¯ä¸å¿10000070\",\"skgx_rev_id\":\"1\",\"skgx_name\":\"çæ¥æ°æ§ç¨åº\",\"sqzt\":\"Sç¶æ\",\"ae8nc_cxno\":\"CXä¿¡æ¯ä¸å¿10000070\",\"ae8nc_gfrev\":\"1\",\"ae8nc_sbno\":\"2240080\",\"ae8nc_jcid\":\"QJK006\",\"ae8nc_os\":\"å䏿°æ§-HNC848C\",\"ae8nc_filename\":\"107052PA5\",\"ae8nc_cxfz\":\"è®¡ç®æºä»¿ç\",\"ae8nc_operator\":\"\",\"ae8nc_inspect\":\"\",\"ae8nc_acceptview\":\"\",\"ae8nc_cxno_unit\":\"ä¿¡æ¯ä¸å¿\",\"ae8nc_filename_unit\":\"PA\",\"ae8gallery\":\"\",\"ae8nc_plant\":\"ä¿¡æ¯ä¸å¿\",\"ae8nc_modelno\":\"jx\",\"ae8nc_batchno\":\"\",\"meop_id\":\"OPHJ000000000049108\",\"meop_rev_id\":\"A\",\"meop_name\":\"çæ¥\",\"meop_type\":\"AE8Operation Revision\",\"ae8gx_no\":\"5\",\"process_id\":\"JZG2022008107653\",\"process_rev_id\":\"1\",\"process_name\":\"107052\",\"ae8part_no\":\"107052\",\"ae8stageidentifying\":\"L\",\"ae8gy_type\":\"æºå å·¥èºè®¾è®¡\",\"ae8plant\":\"ä¿¡æ¯ä¸å¿\",\"part_id\":\"1047051\",\"part_rev_id\":\"01\",\"part_name\":\"éææµè¯ä»¶\",\"create_by\":\"ç¨æ·2(user2)\",\"create_date\":\"02-9æ-22 17:15:14\",\"filename\":\"DNC-CXä¿¡æ¯ä¸å¿10000070-1.zip\",\"filepath\":\"http://localhost:9099/resources/images/login/bj_bak.png\"}]}\n"; |
| | | String program =pdmWebClientApi.queryNcProgramAttrInfo(objects); |
| | | if (StringUtils.isEmpty(program)) { |
| | | log.error("======= æ "+ ncLog.getSkgxId() +" æ°å¢è®°å½======="); |
| | |
| | | PdmProgramSource source = new PdmProgramSource(); |
| | | try { |
| | | Object[] objects = new Object[]{ncLog.getSkgxId(),ncLog.getSkgxRevId(),ncLog.getSqzt(),"",""}; |
| | | //String program = "{\"code\":1,\"message\":\"\",\"response\":[{\"skgx_id\":\"CXä¿¡æ¯ä¸å¿10000070\",\"skgx_rev_id\":\"1\",\"skgx_name\":\"çæ¥æ°æ§ç¨åº\",\"sqzt\":\"Sç¶æ\",\"ae8nc_cxno\":\"CXä¿¡æ¯ä¸å¿10000070\",\"ae8nc_gfrev\":\"1\",\"ae8nc_sbno\":\"2240080\",\"ae8nc_jcid\":\"QJK006\",\"ae8nc_os\":\"å䏿°æ§-HNC848C\",\"ae8nc_filename\":\"107052PA5\",\"ae8nc_cxfz\":\"è®¡ç®æºä»¿ç\",\"ae8nc_operator\":\"\",\"ae8nc_inspect\":\"\",\"ae8nc_acceptview\":\"\",\"ae8nc_cxno_unit\":\"401\",\"ae8nc_filename_unit\":\"PA\",\"ae8gallery\":\"\",\"ae8nc_plant\":\"401\",\"ae8nc_modelno\":\"jx\",\"ae8nc_batchno\":\"\",\"meop_id\":\"OPHJ000000000049108\",\"meop_rev_id\":\"A\",\"meop_name\":\"çæ¥\",\"meop_type\":\"AE8Operation Revision\",\"ae8gx_no\":\"5\",\"process_id\":\"JZG2022008107653\",\"process_rev_id\":\"1\",\"process_name\":\"107052\",\"ae8part_no\":\"107052\",\"ae8stageidentifying\":\"L\",\"ae8gy_type\":\"æºå å·¥èºè®¾è®¡\",\"ae8plant\":\"ä¿¡æ¯ä¸å¿\",\"part_id\":\"1047051\",\"part_rev_id\":\"01\",\"part_name\":\"éææµè¯ä»¶\",\"create_by\":\"ç¨æ·2(user2)\",\"create_date\":\"02-9æ-22 17:15:14\",\"filename\":\"DNC-CXä¿¡æ¯ä¸å¿10000070-1.zip\",\"filepath\":\"http://192.168.2.234:8081/ncprogram/202209/DNC-CXä¿¡æ¯ä¸å¿10000070-1.zip\"}]}\n"; |
| | | String program =pdmWebClientApi.queryNcProgramAttrInfo(objects); |
| | | String program = "{\"code\":1,\"message\":\"\",\"response\":[{\"skgx_id\":\"CXä¿¡æ¯ä¸å¿10000070\",\"skgx_rev_id\":\"1\",\"skgx_name\":\"çæ¥æ°æ§ç¨åº\",\"sqzt\":\"Sç¶æ\",\"ae8nc_cxno\":\"CXä¿¡æ¯ä¸å¿10000070\",\"ae8nc_gfrev\":\"1\",\"ae8nc_sbno\":\"2240080\",\"ae8nc_jcid\":\"QJK006\",\"ae8nc_os\":\"å䏿°æ§-HNC848C\",\"ae8nc_filename\":\"107052PA5\",\"ae8nc_cxfz\":\"è®¡ç®æºä»¿ç\",\"ae8nc_operator\":\"\",\"ae8nc_inspect\":\"\",\"ae8nc_acceptview\":\"\",\"ae8nc_cxno_unit\":\"ä¿¡æ¯ä¸å¿\",\"ae8nc_filename_unit\":\"PA\",\"ae8gallery\":\"\",\"ae8nc_plant\":\"ä¿¡æ¯ä¸å¿\",\"ae8nc_modelno\":\"jx\",\"ae8nc_batchno\":\"\",\"meop_id\":\"OPHJ000000000049108\",\"meop_rev_id\":\"A\",\"meop_name\":\"çæ¥\",\"meop_type\":\"AE8Operation Revision\",\"ae8gx_no\":\"5\",\"process_id\":\"JZG2022008107653\",\"process_rev_id\":\"1\",\"process_name\":\"107052\",\"ae8part_no\":\"107052\",\"ae8stageidentifying\":\"L\",\"ae8gy_type\":\"æºå å·¥èºè®¾è®¡\",\"ae8plant\":\"ä¿¡æ¯ä¸å¿\",\"part_id\":\"1047051\",\"part_rev_id\":\"01\",\"part_name\":\"éææµè¯ä»¶\",\"create_by\":\"ç¨æ·2(user2)\",\"create_date\":\"02-9æ-22 17:15:14\",\"filename\":\"DNC-CXä¿¡æ¯ä¸å¿10000070-1.zip\",\"filepath\":\"http://localhost:9099/outer/test/download.xhtml\"}]}\n"; |
| | | //String program =pdmWebClientApi.queryNcProgramAttrInfo(objects); |
| | | if (StringUtils.isEmpty(program)) { |
| | | log.error("======= æ "+ ncLog.getSkgxId() +" æ°å¢è®°å½======="); |
| | | return false; |
| | |
| | | if (suffix.contentEquals("docx") || suffix.contentEquals("pdf") ) { |
| | | continue; |
| | | } |
| | | source.setFileName(entry.getKey()); |
| | | DocInfo docInfo = docInfoService.findByAttrAndDocName(FileUtil.getFilenameNonSuffix(entry.getKey()), 5, |
| | | stream.getProcessId(),suffix); |
| | | //æ°å¢ |
| | |
| | | docInfo.setPublishVersion(docFile.getDocVersion()); |
| | | docInfo.setPublishFileId(docFile.getFileId()); |
| | | b = docInfoService.save(docInfo); |
| | | boolean pdm = assignFileStreamService.saveListNcFromPdm(docInfo,source); |
| | | if(!b){ |
| | | return false; |
| | | } |
| | |
| | | docInfo.setPublishVersion(docFile.getDocVersion()); |
| | | docInfo.setPublishFileId(docFile.getFileId()); |
| | | b = docInfoService.updateById(docInfo); |
| | | // |
| | | boolean pdm = assignFileStreamService.saveListNcFromPdm(docInfo,source); |
| | | if(!b) { |
| | | return false; |
| | | } |
| | |
| | | try { |
| | | Map<String,String> map = new HashMap<>(); |
| | | Object[] objects = new Object[]{returnLog.getStartDateNum(),returnLog.getEndDateNum(),"","","",""}; |
| | | //String name = "{\"code\": 1, \"message\": \"\", \"response\": [{ \"log_id\": \"20230213080002\", \"skgx_id\": \"CX408-1545\", \"skgx_rev_id\": \"1\", \"sqzt\": \"Sç¶æ\" }]}" ; |
| | | String name = pdmWebClientApi.pdmDncProgram(objects); |
| | | String name = "{\"code\": 1, \"message\": \"\", \"response\": [{ \"log_id\": \"20230213080002\", \"skgx_id\": \"CX408-1545\", \"skgx_rev_id\": \"1\", \"sqzt\": \"Sç¶æ\" }]}" ; |
| | | //String name = pdmWebClientApi.pdmDncProgram(objects); |
| | | if (StringUtils.isEmpty(name)) { |
| | | log.error("æ æ°æ®___ç©ºæ°æ®"); |
| | | return null; |
| | |
| | | dialect: org.hibernate.dialect.Oracle10gDialect |
| | | show-sql: ture |
| | | datasource: |
| | | driver-class-name: dm.jdbc.driver.DmDriver |
| | | url: jdbc:dm://LOCALHOST:5236?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&schema=LXZN_NC_ADMIN_430 |
| | | username: SYSDBA |
| | | password: Lyh10225217 |
| | | url: ${MSSQL_URL:jdbc:sqlserver://127.0.0.1:1433;databaseName=lxzn_nc_430} |
| | | username: sa |
| | | password: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | initialSize: 5 #åå§å»ºç«è¿æ¥æ°é |
| | | minIdle: 5 #æå°è¿æ¥æ°é |
| | | maxActive: 20 #æå¤§è¿æ¥æ°é |
| | |
| | | #æä»¶ä¸ä¼ ç®å½ï¼æ³¨æLinuxåWindowsä¸çç®å½ç»æä¸åï¼ |
| | | #file.uploadFolder=/root/uploadFiles/ |
| | | fileHomePath: ${UPLOAD_FOLDER:d://lxzn_storage} |
| | | fileNcGateway: ${UPLOAD_FOLDER:d://abc} |
| | | #staticAccessPath: /api/file/** # å½å项ç®çéæèµæºè®¿é®é
ç½®å¨nginxä¸ |
| | | activiti: |
| | | enable: true # true å¯ç¨å®¡æ¹ false ä¸å¯ç¨å®¡æ¹ |
| | |
| | | uri: http://192.168.2.234:8081/YZHTCNCProgram/PLMServices?wsdl |
| | | ncPdm: |
| | | file_path: |
| | | d://lxzn_storage/plm |
| | | dnc//lxzn_storage/plm |
| | | product: |
| | | root: 1580366134186582017 |
| | | root: 1583346581232537602 |
| | | user: |
| | | userIdYml: 1254966905669160962 |
| | | userIdYml: 1583346581232537602 |
| | |
| | | ####忥宿¶ä»»å¡æ§è¡å¨åæ° |
| | | plmCron=0 */2 * * * ? |
| | | ####??????????? 0*/2***? |
| | | plmCron=0 */2 * * * ? |
| | | ####??????????? 20m |
| | | taskSync=0/20 * * * * ? |