| | |
| | | package com.ots.project.exam.restcontroller; |
| | | |
| | | import com.ots.project.exam.domain.EntDemographyInfo; |
| | | import com.ots.project.exam.domain.EntDemographyParam; |
| | | import com.ots.project.exam.domain.EntTestMember; |
| | |
| | | import com.ots.project.exam.service.MemberService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | public class MemberControllerImpl implements MemberController { |
| | | |
| | | @Autowired |
| | | private MemberService memberService; |
| | | |
| | | @Autowired |
| | | private IEntTestMemberService entTestMemberService; |
| | | |
| | | @Autowired |
| | | IEntDemographyParamService entDemographyParamService; |
| | | |
| | | @Autowired |
| | | private ITReportTemplateService itReportTemplateService; |
| | | |
| | | @Override |
| | | public RestResponse getdemographyParam(String token, String lang) { |
| | | try { |
| | | List<ParamDefine> collect = memberService.getParamDefines(token, lang); |
| | | |
| | | // 給姓名默认值 |
| | | getMemberNameValue(collect); |
| | | return RestResponse.ok(collect); |
| | | } catch (Exception ex) { |
| | | return RestResponse.fail(ex); |
| | | } |
| | | } |
| | | |
| | | private void getMemberNameValue(List<ParamDefine> collect) { |
| | | EntTestMember entTestMember = entTestMemberService.selectEntTestMemberById(collect.get(0).getMemberId()); |
| | | String paramIds = collect.stream().map(it -> { |
| | | return it.getParamId().toString(); |
| | | }).collect(Collectors.joining(",")); |
| | | |
| | | List<EntDemographyParam> entDemographyParams = entDemographyParamService.selectEntDemographyParamListByParamIn(paramIds); |
| | | Map<Long, String> entDemographyParamsMap = entDemographyParams.stream().collect( |
| | | Collectors.toMap(EntDemographyParam::getParamId, EntDemographyParam::getParamCode)); |
| | | |
| | | for (ParamDefine paramDefine : collect) { |
| | | System.out.println(entDemographyParamsMap.get(paramDefine.getParamId())); |
| | | if (Objects.equals(entDemographyParamsMap.get(paramDefine.getParamId()), "name")) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public RestResponse queryDemographyParamInfo(String token) { |
| | | try { |
| | |
| | | return RestResponse.fail(ex); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public RestResponse saveDemographyParamInfo(@Valid List<ParamsInfo> infos, String token, String langType) { |
| | | try { |
| | |
| | | return RestResponse.fail(ex); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public RestResponse memberAuth(String token) { |
| | | try { |
| | |
| | | return RestResponse.fail(ex); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public RestResponse queryLangList(String token, String reportTemplateId) { |
| | | try { |
| | | List<DictItemDto> resluts = memberService.queryLang(token); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 睿邻只有中文 |
| | | // List<TReportTemplate> tReportTemplateList = itReportTemplateService.selectTReportTemplates(reportTemplateId); |
| | | // // 睿邻的只有中文 |
| | | // for (TReportTemplate tReportTemplate : tReportTemplateList) { |
| | | // if ("RuiLin".equals(tReportTemplate.getReportType())) { |
| | | // for (DictItemDto dictData : resluts) { |
| | | // if ("Chinese".equals(dictData.getDictValue())) { |
| | | // List<DictItemDto> reslutChinese = new ArrayList<>(); |
| | | // reslutChinese.add(dictData); |
| | | // return RestResponse.ok(reslutChinese); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | return RestResponse.ok(resluts); |
| | | } catch (Exception ex) { |