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

fix interface

上级 ffec6bfa
流水线 #25561 已失败 于阶段
in 0 second
......@@ -26,8 +26,8 @@ public interface PatHealthPackClient {
@GetMapping(value = "/account/pat-health/directPatIds/{patientId}")
PicaResponse<List<Integer>> getDirectPatIdsByPatId(@PathVariable("patientId") Integer patientId);
@GetMapping(value = "/account/pat-health/familyPats/{acctId}")
PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId);
@GetMapping(value = "/account/pat-health/familyPats/{acctId}/containAcct/{containAcct}")
PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId, @PathVariable("containAcct") Integer containAcct);
@PostMapping(value = "/account/pat-health/acct")
PicaResponse<Integer> saveAcct(@RequestBody AcctPatInfoReq patInfoReq);
......
......@@ -14,10 +14,20 @@ public class PatFamilyResp {
private List<AcctPatFamilyDto> failMemberList;
private List<AcctPatFamilyDto> memberList;
private List<Integer> memberPatIds;
private String failMsg;
public List<AcctPatFamilyDto> getMemberList() {
return memberList;
}
public void setMemberList(List<AcctPatFamilyDto> memberList) {
this.memberList = memberList;
}
public String getFailMsg() {
return failMsg;
}
......
......@@ -49,9 +49,9 @@ public class PatHealthPackController {
}
@ApiOperation("根据accid获取家庭关系idList")
@GetMapping(value = "/familyPats/{acctId}")
public PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId) throws Exception {
return PicaResponse.toResponse(packService.getFamilyPatsByAcctId(acctId));
@GetMapping(value = "/familyPats/{acctId}/containAcct/{containAcct}")
public PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId,@PathVariable("containAcct") Integer containAcct) throws Exception {
return PicaResponse.toResponse(packService.getFamilyPatsByAcctId(acctId,containAcct));
}
@ApiOperation("保存主账户")
......
......@@ -24,7 +24,7 @@ public interface PatHealthPackService {
List<Integer> getDirectPatIdsByPatId(Integer patientId);
PatFamilyResp getFamilyPatsByAcctId(Integer acctId);
PatFamilyResp getFamilyPatsByAcctId(Integer acctId,Integer containAcct);
Integer saveAcct(AcctPatInfoReq patInfoReq);
......
......@@ -102,19 +102,43 @@ public class PatHealthPackServiceIml implements PatHealthPackService {
}
/**
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/19 18:03
* @ModifyDate 2020/5/19 18:03
* @Params [acctId, containAcct] containAcct:是否包含建立acct的账户
* @Return com.pica.cloud.account.account.common.resp.PatFamilyResp
*/
@Override
public PatFamilyResp getFamilyPatsByAcctId(Integer acctId) {
public PatFamilyResp getFamilyPatsByAcctId(Integer acctId, Integer containAcct) {
PatFamilyResp resp = new PatFamilyResp();
List<AcctPatFamily> patFamilyList = patFamilyMapper.getListByAcctId(acctId);
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);
List<Integer> allPadIds = patFamilyList.stream().map(obj ->obj.getPatientId()).collect(toList());
if(1 == containAcct){
resp.setMemberPatIds(allPadIds);
for(AcctPatFamily family : patFamilyList){
AcctPatFamilyDto dto = new AcctPatFamilyDto();
dto.setPatientId(family.getPatientId());
dto.setRelation(family.getRelation());
dtos.add(dto);
}
}else if(0 == containAcct){
//不包含建立acct账户的pat数据
patFamilyList = patFamilyMapper.getListByPatIds(allPadIds);
for(AcctPatFamily family : patFamilyList){
AcctPatFamilyDto dto = new AcctPatFamilyDto();
if(!dto.getRelation().equals(1)){
dto.setPatientId(family.getPatientId());
dto.setRelation(family.getRelation());
}
dtos.add(dto);
}
resp.setMemberPatIds(dtos.stream().map(obj ->obj.getPatientId()).collect(toList()));
}
resp.setFailMemberList(dtos);
resp.setMemberList(dtos);
return resp;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册