|
|
|
@ -12,6 +12,7 @@ import com.logpm.supervise.vo.ExportIndicatorsVO;
|
|
|
|
|
import com.logpm.supervise.vo.IndicatorsVO; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
|
import org.springblade.common.utils.CommonUtil; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
@ -68,24 +69,30 @@ public class IndicatorsServiceImpl extends BaseServiceImpl<IndicatorsMapper, Ind
|
|
|
|
|
Long createUser = record.getCreateUser(); |
|
|
|
|
Long assessUserId = record.getAssessUserId(); |
|
|
|
|
Long assessDept = record.getAssessDept(); |
|
|
|
|
if(userId.equals(createUser)){ |
|
|
|
|
record.setIsEdit(1); |
|
|
|
|
Integer indicatorsStatus = record.getIndicatorsStatus(); |
|
|
|
|
if(indicatorsStatus.equals(2)){ |
|
|
|
|
record.setIsEdit(0); |
|
|
|
|
}else{ |
|
|
|
|
if(Objects.isNull(assessUserId)){ |
|
|
|
|
Long deptId1 = Long.parseLong(AuthUtil.getDeptId()); |
|
|
|
|
if(deptId1.equals(assessDept)){ |
|
|
|
|
record.setIsEdit(2); |
|
|
|
|
}else{ |
|
|
|
|
record.setIsEdit(0); |
|
|
|
|
} |
|
|
|
|
if(userId.equals(createUser)){ |
|
|
|
|
record.setIsEdit(1); |
|
|
|
|
}else{ |
|
|
|
|
if(assessUserId.equals(userId)){ |
|
|
|
|
record.setIsEdit(2); |
|
|
|
|
if(Objects.isNull(assessUserId)){ |
|
|
|
|
Long deptId1 = Long.parseLong(AuthUtil.getDeptId()); |
|
|
|
|
if(deptId1.equals(assessDept)){ |
|
|
|
|
record.setIsEdit(2); |
|
|
|
|
}else{ |
|
|
|
|
record.setIsEdit(0); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
record.setIsEdit(0); |
|
|
|
|
if(assessUserId.equals(userId)){ |
|
|
|
|
record.setIsEdit(2); |
|
|
|
|
}else{ |
|
|
|
|
record.setIsEdit(0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
pages.setRecords(records); |
|
|
|
|
|
|
|
|
@ -117,6 +124,12 @@ public class IndicatorsServiceImpl extends BaseServiceImpl<IndicatorsMapper, Ind
|
|
|
|
|
return R.fail(405,"指标信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer indicatorsStatus = indicatorsEntity.getIndicatorsStatus(); |
|
|
|
|
if(indicatorsStatus.equals(2)){ |
|
|
|
|
log.warn("############updateIndicators: 考核已确认,不能编辑"); |
|
|
|
|
return R.fail(405,"考核已确认,不能编辑"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
indicatorsEntity.setAssessDept(indicatorsDTO.getAssessDept()); |
|
|
|
|
indicatorsEntity.setAssessDeptName(indicatorsDTO.getAssessDeptName()); |
|
|
|
|
indicatorsEntity.setAssessUserId(indicatorsDTO.getAssessUserId()); |
|
|
|
@ -134,6 +147,18 @@ public class IndicatorsServiceImpl extends BaseServiceImpl<IndicatorsMapper, Ind
|
|
|
|
|
@Override |
|
|
|
|
public void deleteById(Long id) { |
|
|
|
|
|
|
|
|
|
IndicatorsEntity indicatorsEntity = baseMapper.selectById(id); |
|
|
|
|
if(Objects.isNull(indicatorsEntity)){ |
|
|
|
|
log.warn("############deleteById: 未找到考核信息"); |
|
|
|
|
throw new CustomerException(405,"未找到考核信息"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer indicatorsStatus = indicatorsEntity.getIndicatorsStatus(); |
|
|
|
|
if(indicatorsStatus.equals(2)){ |
|
|
|
|
log.warn("############deleteById: 考核已确认,不能删除"); |
|
|
|
|
throw new CustomerException(405,"考核已确认,不能删除"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
baseMapper.deleteById(id); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|