feat: bug修复
parent
ee8d366d51
commit
3e7c193996
|
|
@ -3,6 +3,7 @@ package org.qinan.safetyeval.adapter.web.institution.app;
|
|||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.qinan.safetyeval.client.api.institution.EvalSurveyApi;
|
||||
import org.qinan.safetyeval.client.co.institution.EvalProjectMemberCO;
|
||||
import org.qinan.safetyeval.client.co.institution.EvalSurveyCO;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
import org.qinan.safetyeval.client.dto.institution.EvalSurveySaveCmd;
|
||||
|
|
@ -30,4 +31,10 @@ public class AppEvalSurveyController {
|
|||
public SingleResponse<EvalSurveyCO> get(@RequestParam("projectId") String projectId) {
|
||||
return evalSurveyApi.get(projectId);
|
||||
}
|
||||
|
||||
@ApiOperation("获取当前项目组人员信息详情,以便打卡信息填充")
|
||||
@GetMapping("/getProjectCurrent")
|
||||
public SingleResponse<EvalProjectMemberCO> getProjectCurrent(@RequestParam("projectId") String projectId) {
|
||||
return evalSurveyApi.getProjectCurrent(projectId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,37 @@
|
|||
package org.qinan.safetyeval.app.executor.institution;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.qinan.safetyeval.app.convertor.EvalProjectMemberCmdConvertor;
|
||||
import org.qinan.safetyeval.app.convertor.EvalSurveyCmdConvertor;
|
||||
import org.qinan.safetyeval.client.api.institution.EvalSurveyApi;
|
||||
import org.qinan.safetyeval.client.co.institution.EvalProjectMemberCO;
|
||||
import org.qinan.safetyeval.client.co.institution.EvalSurveyCO;
|
||||
import org.qinan.safetyeval.client.dto.PageResponse;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
import org.qinan.safetyeval.client.dto.institution.EvalSurveyPageQuery;
|
||||
import org.qinan.safetyeval.client.dto.institution.EvalSurveySaveCmd;
|
||||
import org.qinan.safetyeval.domain.entity.EvalProjectMemberEntity;
|
||||
import org.qinan.safetyeval.domain.entity.EvalSurveyEntity;
|
||||
import org.qinan.safetyeval.domain.exception.ErrorCode;
|
||||
import org.qinan.safetyeval.domain.query.EvalSurveyQuery;
|
||||
import org.qinan.safetyeval.domain.query.PageResult;
|
||||
import org.qinan.safetyeval.domain.service.EvalSurveyDomainService;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.convertor.EvalProjectMemberDoConvertor;
|
||||
import org.qinan.safetyeval.infrastructure.convertor.EvalSurveyDoConvertor;
|
||||
import org.qinan.safetyeval.infrastructure.dataobject.EvalProjectMemberDO;
|
||||
import org.qinan.safetyeval.infrastructure.dataobject.EvalSurveyDO;
|
||||
import org.qinan.safetyeval.infrastructure.mapper.EvalProjectMemberMapper;
|
||||
import org.qinan.safetyeval.infrastructure.mapper.EvalSurveyMapper;
|
||||
import org.qinan.safetyeval.infrastructure.support.InstitutionOrgSupport;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class EvalSurveyExecutor implements EvalSurveyApi {
|
||||
|
|
@ -42,6 +51,13 @@ public class EvalSurveyExecutor implements EvalSurveyApi {
|
|||
private EvalSurveyMapper evalSurveyMapper;
|
||||
@Autowired
|
||||
private EvalSurveyDoConvertor evalSurveyDoConvertor;
|
||||
@Autowired
|
||||
private EvalProjectMemberMapper evalProjectMemberMapper;
|
||||
|
||||
@Resource
|
||||
private EvalProjectMemberDoConvertor evalProjectMemberDoConvertor;
|
||||
@Autowired
|
||||
private EvalProjectMemberCmdConvertor evalProjectMemberCmdConvertor;
|
||||
|
||||
@Override
|
||||
public SingleResponse<EvalSurveyCO> save(EvalSurveySaveCmd cmd) {
|
||||
|
|
@ -76,4 +92,17 @@ public class EvalSurveyExecutor implements EvalSurveyApi {
|
|||
EvalSurveyEntity evalSurveyEntity = evalSurveyDoConvertor.convertDoToE(evalSurveyDOS.get(0));
|
||||
return SingleResponse.success(evalSurveyCmdConvertor.convertEToCO(evalSurveyEntity));
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<EvalProjectMemberCO> getProjectCurrent(String projectId) {
|
||||
List<EvalProjectMemberDO> evalProjectMemberDOS = evalProjectMemberMapper.selectList(new LambdaQueryWrapper<EvalProjectMemberDO>()
|
||||
.eq(EvalProjectMemberDO::getProjectId, projectId)
|
||||
.eq(EvalProjectMemberDO::getPersonnelId, AuthUserContextAdapter.getCurrentUserId())
|
||||
.last("limit 1"));
|
||||
if (CollectionUtils.isEmpty(evalProjectMemberDOS)) {
|
||||
return SingleResponse.success(null);
|
||||
}
|
||||
List<EvalProjectMemberEntity> dbList = evalProjectMemberDOS.stream().map(evalProjectMemberDoConvertor::convertDoToE).collect(Collectors.toList());
|
||||
return SingleResponse.success(evalProjectMemberCmdConvertor.convertEListToCOList(dbList).get(0));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.qinan.safetyeval.client.api.institution;
|
||||
|
||||
import org.qinan.safetyeval.client.co.institution.EvalProjectMemberCO;
|
||||
import org.qinan.safetyeval.client.co.institution.EvalSurveyCO;
|
||||
import org.qinan.safetyeval.client.dto.PageResponse;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
|
|
@ -13,4 +14,6 @@ public interface EvalSurveyApi {
|
|||
PageResponse<EvalSurveyCO> page(EvalSurveyPageQuery query);
|
||||
|
||||
SingleResponse<EvalSurveyCO> get(String projectId);
|
||||
|
||||
SingleResponse<EvalProjectMemberCO> getProjectCurrent(String projectId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue