| | |
| | | private IProcessionDepartmentService processionDepartmentService; |
| | | @Autowired |
| | | private IMdcProductionService mdcProductionService; |
| | | @Autowired |
| | | private IDocRelativeService iDocRelativeService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | if(processStreams != null && !processStreams.isEmpty()) |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_PROCESS_EXIST); |
| | | boolean b = productPermissionService.deleteByProductId(id); |
| | | //验证是否存在文档 |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type","1").eq("attribution_id",id)); |
| | | if (!docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_DOC_EXIST); |
| | | } |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productDepartmentService.deleteByProductId(id); |
| | |
| | | b = permissionStreamService.deleteDepartPermsByProductId(id); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = docInfoService.deleteByProductId(id); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | //添加日志 |
| | | NcLogInfo ncLogInfo = new NcLogInfo(); |
| | | //模块 |
| | | ncLogInfo.setModuleInfo("产品结构树"); |
| | | //类型 |
| | | ncLogInfo.setOperateType(4); |
| | | //日志内容 |
| | | ncLogInfo.setLogContent("产品名称:"+productInfo.getProductName()); |
| | | iNcLogInfoService.saveLogNcInfos(ncLogInfo); |
| | | return super.removeById(id); |
| | | } |
| | | |
| | |
| | | |
| | | return ProductTreeWrapper.loadTree(productInfoList, componentExtList, partsInfos,processStreams,workSteps); |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteProductTree(String id, Integer type){ |
| | | switch (type) { |
| | | //产品 |
| | | case 1: |
| | | return deleteProductInfo(id); |
| | | //部门 |
| | | case 2: |
| | | return componentInfoService.deleteComponentInfo(id); |
| | | //零件 |
| | | case 3: |
| | | return partsInfoService.deletePartsInfo(id); |
| | | //工序 |
| | | case 5: |
| | | return processStreamService.deleteProcessStream(id); |
| | | //工步 |
| | | case 6: |
| | | return workStepService.deleteWorkStep(id); |
| | | default: |
| | | } |
| | | return false; |
| | | } |
| | | } |