111
k94314517
2024-01-29 c9df4cfec262ca54af52715af60a1276c37d08c5
server/service/src/main/java/com/doumee/service/business/impl/DuWorktypeServiceImpl.java
@@ -1,7 +1,10 @@
package com.doumee.service.business.impl;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.DuWorktypeMapper;
import com.doumee.dao.business.model.DuWorktype;
@@ -15,6 +18,7 @@
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Objects;
/**
 * 派遣单位方案管工种关联信息表Service实现
@@ -35,7 +39,16 @@
    @Override
    public void deleteById(Integer id) {
        duWorktypeMapper.deleteById(id);
        DuWorktype duWorktype = duWorktypeMapper.selectById(id);
        if(Objects.isNull(duWorktype)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(duWorktype.getStatus().equals(Constants.TWO)){
            duWorktypeMapper.deleteById(id);
        }else{
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前状态无法进行删除");
        }
    }
    @Override