| | |
| | | import cn.gistack.sm.sg.service.SgGxStepService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Override |
| | | public void delete(String id) { |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(id); |
| | | if (!new LambdaQueryChainWrapper<>(sgGxRoleMapper).eq(SgGxRoleDO::getGxStepId,id).list().isEmpty()){ |
| | | throw new ServiceException(sgGxStepDO.getGxStepName()+ "已绑定角色,无法删除"); |
| | | } |
| | | List<SgGxStepDO> list= sgGxStepMapper.selectByGxInfoId(sgGxStepDO.getGxInfoId()); |
| | | if (!sgGxStepDO.getGxStepNum().equals(list.get(0).getGxStepNum())){ |
| | | throw new ServiceException("请按顺序删除工序步骤"); |