提交 fa5832eb 编写于 作者:  Peijun.zhao's avatar Peijun.zhao

fix family return

上级 c874d358
流水线 #25375 已失败 于阶段
in 0 second
...@@ -3,6 +3,7 @@ package com.pica.cloud.account.account.client; ...@@ -3,6 +3,7 @@ package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.req.AcctPatFamilyReq; import com.pica.cloud.account.account.common.req.AcctPatFamilyReq;
import com.pica.cloud.account.account.common.req.AcctPatInfoReq; import com.pica.cloud.account.account.common.req.AcctPatInfoReq;
import com.pica.cloud.account.account.common.resp.PatBindResp; import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.entity.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -26,7 +27,7 @@ public interface PatHealthPackClient { ...@@ -26,7 +27,7 @@ public interface PatHealthPackClient {
PicaResponse<List<Integer>> getDirectPatIdsByPatId(@PathVariable("patientId") Integer patientId); PicaResponse<List<Integer>> getDirectPatIdsByPatId(@PathVariable("patientId") Integer patientId);
@GetMapping(value = "/account/pat-health/familyPats/{acctId}") @GetMapping(value = "/account/pat-health/familyPats/{acctId}")
PicaResponse<List<Integer>> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId); PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId);
@PostMapping(value = "/account/pat-health/acct") @PostMapping(value = "/account/pat-health/acct")
PicaResponse saveAcct(@RequestBody AcctPatInfoReq patInfoReq); PicaResponse saveAcct(@RequestBody AcctPatInfoReq patInfoReq);
......
...@@ -14,6 +14,8 @@ public class PatFamilyResp { ...@@ -14,6 +14,8 @@ public class PatFamilyResp {
private List<AcctPatFamilyDto> failMemberList; private List<AcctPatFamilyDto> failMemberList;
private List<Integer> memberPatIds;
public boolean isSuccessFlag() { public boolean isSuccessFlag() {
return successFlag; return successFlag;
} }
...@@ -29,4 +31,12 @@ public class PatFamilyResp { ...@@ -29,4 +31,12 @@ public class PatFamilyResp {
public void setFailMemberList(List<AcctPatFamilyDto> failMemberList) { public void setFailMemberList(List<AcctPatFamilyDto> failMemberList) {
this.failMemberList = failMemberList; this.failMemberList = failMemberList;
} }
public List<Integer> getMemberPatIds() {
return memberPatIds;
}
public void setMemberPatIds(List<Integer> memberPatIds) {
this.memberPatIds = memberPatIds;
}
} }
...@@ -102,9 +102,19 @@ public class PatHealthPackController { ...@@ -102,9 +102,19 @@ public class PatHealthPackController {
@ApiOperation("根据accid获取家庭关系idList") @ApiOperation("根据accid获取家庭关系idList")
@GetMapping(value = "/familyPats/{acctId}") @GetMapping(value = "/familyPats/{acctId}")
public PicaResponse<List<Integer>> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId) throws Exception { public PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId) throws Exception {
PatFamilyResp resp = new PatFamilyResp();
List<AcctPatFamily> patFamilyList = patFamilyMapper.getListByAcctId(acctId); List<AcctPatFamily> patFamilyList = patFamilyMapper.getListByAcctId(acctId);
return PicaResponse.toResponse(patFamilyList); resp.setMemberPatIds(patFamilyList.stream().map(obj ->obj.getPatientId()).collect(toList()));
List<AcctPatFamilyDto> dtos = new ArrayList<>();
for(AcctPatFamily family : patFamilyList){
AcctPatFamilyDto dto = new AcctPatFamilyDto();
dto.setPatientId(family.getPatientId());
dto.setRelation(family.getRelation());
dtos.add(dto);
}
resp.setFailMemberList(dtos);
return PicaResponse.toResponse(resp);
} }
@ApiOperation("保存主账户") @ApiOperation("保存主账户")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册