|
|
@ -1,34 +1,29 @@ |
|
|
package com.project.appeal.domain.service.Impl; |
|
|
package com.project.appeal.domain.service.Impl; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
|
import com.github.tingyugetc520.ali.dingtalk.error.DtErrorException; |
|
|
import com.github.tingyugetc520.ali.dingtalk.error.DtErrorException; |
|
|
import com.project.appeal.domain.dto.AppealDTO; |
|
|
import com.project.appeal.domain.dto.AppealDTO; |
|
|
import com.project.appeal.domain.entity.AppealEntity; |
|
|
import com.project.appeal.domain.entity.AppealEntity; |
|
|
import com.project.appeal.domain.enums.StatusEnum; |
|
|
import com.project.appeal.domain.enums.AppealStatusEnum; |
|
|
import com.project.appeal.domain.service.AppealBaseService; |
|
|
import com.project.appeal.domain.service.AppealBaseService; |
|
|
import com.project.appeal.domain.service.SaveAppealDomainService; |
|
|
import com.project.appeal.domain.service.SaveAppealDomainService; |
|
|
import com.project.base.domain.exception.BusinessErrorException; |
|
|
import com.project.base.domain.exception.BusinessErrorException; |
|
|
import com.project.base.domain.result.Result; |
|
|
import com.project.base.domain.result.Result; |
|
|
|
|
|
import com.project.ding.domain.dto.UserDTO; |
|
|
import com.project.ding.utils.DingUtil; |
|
|
import com.project.ding.utils.DingUtil; |
|
|
import com.project.ding.utils.SecurityUtils; |
|
|
import com.project.ding.utils.SecurityUtils; |
|
|
import com.project.exam.domain.dto.ExamRecordDTO; |
|
|
import com.project.exam.domain.dto.ExamRecordDTO; |
|
|
import com.project.exam.domain.entity.ExamRecordEntity; |
|
|
import com.project.exam.domain.entity.ExamRecordEntity; |
|
|
import com.project.exam.domain.service.ExamRecordBaseService; |
|
|
|
|
|
import com.project.exam.mapper.ExamRecordMapper; |
|
|
import com.project.exam.mapper.ExamRecordMapper; |
|
|
import com.project.task.domain.entity.TaskEntity; |
|
|
import com.project.task.domain.entity.TaskEntity; |
|
|
import com.project.task.domain.enums.QuestionTypeEnum; |
|
|
import com.project.task.domain.enums.QuestionTypeEnum; |
|
|
import com.project.task.mapper.TaskMapper; |
|
|
import com.project.task.mapper.TaskMapper; |
|
|
import org.redisson.mapreduce.Collector; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.math.RoundingMode; |
|
|
import java.math.RoundingMode; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Optional; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
public class SaveAppealDomainServiceImpl implements SaveAppealDomainService { |
|
|
public class SaveAppealDomainServiceImpl implements SaveAppealDomainService { |
|
|
@ -48,16 +43,21 @@ public class SaveAppealDomainServiceImpl implements SaveAppealDomainService { |
|
|
AppealEntity entity = appealDTO.toEntity(AppealEntity::new); |
|
|
AppealEntity entity = appealDTO.toEntity(AppealEntity::new); |
|
|
|
|
|
|
|
|
//设置审批人
|
|
|
//设置审批人
|
|
|
if (appealDTO.getStatus() != StatusEnum.PENDING_REVIEW.getValue()){ |
|
|
if (!appealDTO.getStatus().equals(AppealStatusEnum.PENDING_REVIEW.getValue())){ |
|
|
appealDTO.setAppealUserId(SecurityUtils.getUserId()); |
|
|
appealDTO.setAppealUserId(SecurityUtils.getUserId()); |
|
|
|
|
|
}else{ |
|
|
|
|
|
//设置申诉人
|
|
|
|
|
|
appealDTO.setAppealUserId(SecurityUtils.getUserId()); |
|
|
|
|
|
UserDTO user = dingUtil.getUserById(SecurityUtils.getUserId()); |
|
|
|
|
|
appealDTO.setUserName(user.getName()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
appealBaseService.saveOrUpdate(entity); |
|
|
appealBaseService.saveOrUpdate(entity); |
|
|
|
|
|
|
|
|
//如果审核通过,需要为用户加分
|
|
|
//如果审核通过,需要为用户加分
|
|
|
if (appealDTO.getStatus() != StatusEnum.PASS_REVIEW.getValue()) { |
|
|
if (!appealDTO.getStatus().equals(AppealStatusEnum.PASS_REVIEW.getValue())) { |
|
|
//审核拒绝,发送工作通知消息,告知用户
|
|
|
//审核拒绝,发送工作通知消息,告知用户
|
|
|
if (appealDTO.getStatus() == StatusEnum.REFUSE_REVIEW.getValue()) { |
|
|
if (appealDTO.getStatus().equals(AppealStatusEnum.REFUSE_REVIEW.getValue())) { |
|
|
dingUtil.sendWorkNotice(appealDTO); |
|
|
dingUtil.sendWorkNotice(appealDTO); |
|
|
} |
|
|
} |
|
|
return Result.success(appealDTO); |
|
|
return Result.success(appealDTO); |
|
|
|