| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | 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.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | private IPermissionStreamService permissionStreamService; |
| | | @Autowired |
| | | private IProcessionDepartmentService processionDepartmentService; |
| | | @Autowired |
| | | private IWorkStepService workStepService; |
| | | @Autowired |
| | | private IDocRelativeService iDocRelativeService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | ProcessStream en = super.getById(id); |
| | | if(en == null) |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_NOT_EXIST); |
| | | boolean b = docInfoService.deleteByProcessId(en.getProcessId()); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | //添加日志 |
| | | NcLogInfo ncLogInfo = new NcLogInfo(); |
| | | //模块 |
| | | ncLogInfo.setModuleInfo("产品结构树"); |
| | | //类型 |
| | | ncLogInfo.setOperateType(4); |
| | | //日志内容 |
| | | ncLogInfo.setLogContent("工序号:"+en.getProcessCode()); |
| | | iNcLogInfoService.saveLogNcInfos(ncLogInfo); |
| | | //验证工序下是否有工步 |
| | | List<WorkStep> workStepList=workStepService.list(new QueryWrapper<WorkStep>().eq("process_id",id)); |
| | | if(workStepList != null && !workStepList.isEmpty()) { |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_HAS_DATA); |
| | | } |
| | | //验证是否存在文档 |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type","5").eq("attribution_id",id)); |
| | | if (!docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_HAS_DOC); |
| | | } |
| | | return super.removeById(id); |
| | | } |
| | | |