| | |
| | | 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; |
| | | } |