| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.shiro.SecurityUtils; |
| | |
| | | private IDocInfoService docInfoService; |
| | | @Autowired |
| | | private INcLogInfoService iNcLogInfoService; |
| | | @Autowired |
| | | private IDocRelativeService iDocRelativeService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | if(processStreamList != null && !processStreamList.isEmpty()) { |
| | | ExceptionCast.cast(ComponentInfoCode.COMPONENT_PROCESS_EXIST); |
| | | } |
| | | //添加日志 |
| | | NcLogInfo ncLogInfo = new NcLogInfo(); |
| | | //模块 |
| | | ncLogInfo.setModuleInfo("产品结构树"); |
| | | //类型 |
| | | ncLogInfo.setOperateType(4); |
| | | //日志内容 |
| | | ncLogInfo.setLogContent("部件名称:"+componentInfo.getComponentName()); |
| | | iNcLogInfoService.saveLogNcInfos(ncLogInfo); |
| | | boolean b = docInfoService.deleteByComponentId(id); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | boolean b; |
| | | //验证是否存在文档 |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type","2").eq("attribution_id",id)); |
| | | if (!docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ComponentInfoCode.COMPONENT_DOC_EXIST); |
| | | } |
| | | b = componentPermissionService.deleteByComponentId(id); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |