提交 00d8a877 编写于 作者: xinxu.wang's avatar xinxu.wang

Merge branch 'dev-accountPat-0522' into 'release'

Dev account pat 0522

See merge request !135
流水线 #52956 已失败 于阶段
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-client</artifactId>
<version>1.1.7-SNAPSHOT</version>
<version>1.1.8-SNAPSHOT</version>
<name>pica-cloud-account-client</name>
<packaging>jar</packaging>
......@@ -28,7 +28,7 @@
<dependency>
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.1.7-SNAPSHOT</version>
<version>1.1.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
......
package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.req.*;
import com.pica.cloud.account.account.common.resp.AcctPatIdResp;
import com.pica.cloud.account.account.common.resp.AcctSelfPatId;
import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
import com.pica.cloud.account.account.common.resp.*;
import com.pica.cloud.foundation.entity.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;
......@@ -18,12 +15,18 @@ public interface PatHealthPackClient {
@GetMapping(value = "/account/pat-health/acctId/unionId/{unionId}")
PicaResponse<Integer> getAcctIdByUnionId(@PathVariable("unionId") String unionId);
@GetMapping(value = "/account/pat-health/unionId/acctId/{acctId}")
PicaResponse<String> getUnionIdByAcctId(@PathVariable("acctId") Integer acctId);
@GetMapping(value = "/account/pat-health/acctId/patId/{patientId}")
PicaResponse<Integer> getAcctIdByPatId(@PathVariable("patientId") Integer patientId);
@GetMapping(value = "/account/pat-health/directPatIds/{patientId}")
PicaResponse<List<Integer>> getDirectPatIdsByPatId(@PathVariable("patientId") Integer patientId);
@GetMapping(value = "/account/pat-health/directPatIds/unionId")
PicaResponse<List<Integer>> getDirectPatIdsByUnionId(@RequestParam("unionId") String unionId);
@GetMapping(value = "/account/pat-health/familyPats/{acctId}/containAcct/{containAcct}")
PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId, @PathVariable("containAcct") Integer containAcct);
......@@ -39,6 +42,9 @@ public interface PatHealthPackClient {
@GetMapping(value = "/account/pat-health/familyAcct/patId/{patId}")
PicaResponse<Integer> getFamilyAcctPatId(@PathVariable("patId") Integer patId);
@GetMapping(value = "/account/pat-health/familyAcct/self/patId/{patId}")
PicaResponse<List<Integer>> getRelationSelfAcctPatId(@PathVariable("patId") Integer patId);
@PostMapping(value = "/account/pat-health/familyAcct/patIds")
PicaResponse<AcctPatIdResp> getFamilyAcctPatIds(@RequestBody AcctPatIdReq acctPatIdReq);
......@@ -57,4 +63,9 @@ public interface PatHealthPackClient {
@PostMapping(value = "/account/pat-health/acct/updatePatByAcctId")
PicaResponse<Boolean> updatePatByAcctId(@RequestBody UpdateAcctPatInfoReq req);
@GetMapping(value = "/account/pat-health/acctInfo/patId/{patientId}")
PicaResponse<List<AcctSelfPatInfoResp>> getAcctInfoByPatId(@PathVariable("patientId") Integer patientId);
@GetMapping(value = "/account/pat-health/acctInfo/patInfo/{unionId}")
PicaResponse<AcctSelfPatInfoResp> getAcctInfoByUnionId(@PathVariable("unionId") String unionId);
}
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.1.7-SNAPSHOT</version>
<version>1.1.8-SNAPSHOT</version>
<name>pica-cloud-account-common</name>
<packaging>jar</packaging>
......
package com.pica.cloud.account.account.common.resp;
public class AcctSelfPatInfoResp {
private Integer accId;
private Integer patientId;
private String name;
private String mobilePhone;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public Integer getAccId() {
return accId;
}
public void setAccId(Integer accId) {
this.accId = accId;
}
public Integer getPatientId() {
return patientId;
}
public void setPatientId(Integer patientId) {
this.patientId = patientId;
}
}
[2023-05-26 11:10:42.328] [INFO ] [main] org.springframework.context.support.AbstractApplicationContext.prepareRefresh - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@48c4245d: startup date [Fri May 26 11:10:42 CST 2023]; root of context hierarchy
[2023-05-26 11:10:42.635] [INFO ] [main] org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.<init> - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[2023-05-26 11:10:42.671] [INFO ] [main] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization - Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$f6c6f5d1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2023-05-26 11:10:42.957] [INFO ] [main] org.springframework.cloud.netflix.eureka.InstanceInfoFactory.create - Setting initial instance status as: STARTING
[2023-05-26 11:10:43.082] [INFO ] [main] com.netflix.discovery.DiscoveryClient.<init> - Initializing Eureka in region us-east-1
[2023-05-26 11:10:43.258] [INFO ] [main] com.netflix.discovery.provider.DiscoveryJerseyProvider.<init> - Using JSON encoding codec LegacyJacksonJson
[2023-05-26 11:10:43.258] [INFO ] [main] com.netflix.discovery.provider.DiscoveryJerseyProvider.<init> - Using JSON decoding codec LegacyJacksonJson
[2023-05-26 11:10:43.423] [INFO ] [main] com.netflix.discovery.provider.DiscoveryJerseyProvider.<init> - Using XML encoding codec XStreamXml
[2023-05-26 11:10:43.423] [INFO ] [main] com.netflix.discovery.provider.DiscoveryJerseyProvider.<init> - Using XML decoding codec XStreamXml
[2023-05-26 11:10:43.697] [INFO ] [main] com.netflix.discovery.shared.resolver.aws.ConfigClusterResolver.getClusterEndpoints - Resolving eureka endpoints via configuration
[2023-05-26 11:10:43.726] [INFO ] [main] com.netflix.discovery.DiscoveryClient.fetchRegistry - Disable delta property : false
[2023-05-26 11:10:43.726] [INFO ] [main] com.netflix.discovery.DiscoveryClient.fetchRegistry - Single vip registry refresh property : null
[2023-05-26 11:10:43.726] [INFO ] [main] com.netflix.discovery.DiscoveryClient.fetchRegistry - Force full registry fetch : false
[2023-05-26 11:10:43.727] [INFO ] [main] com.netflix.discovery.DiscoveryClient.fetchRegistry - Application is null : false
[2023-05-26 11:10:43.727] [INFO ] [main] com.netflix.discovery.DiscoveryClient.fetchRegistry - Registered Applications size is zero : true
[2023-05-26 11:10:43.727] [INFO ] [main] com.netflix.discovery.DiscoveryClient.fetchRegistry - Application version is -1: true
[2023-05-26 11:10:43.727] [INFO ] [main] com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry - Getting all instance registry info from the eureka server
[2023-05-26 11:10:43.932] [INFO ] [main] com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry - The response status is 200
[2023-05-26 11:10:43.935] [INFO ] [main] com.netflix.discovery.DiscoveryClient.initScheduledTasks - Not registering with Eureka server per configuration
[2023-05-26 11:10:43.941] [INFO ] [main] com.netflix.discovery.DiscoveryClient.<init> - Discovery Client initialized at timestamp 1685070643941 with initial instances count: 90
[2023-05-26 11:10:44.219] [INFO ] [main] org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate - Fetching config from server at: http://192.168.110.122:7892/
[2023-05-26 11:10:45.415] [INFO ] [main] org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate - Located environment: name=com.pica.cloud.account, profiles=[dev], label=publish, version=d0099e1dcf49dd68033b50965489f3dce8498752, state=null
[2023-05-26 11:10:45.416] [INFO ] [main] org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize - Located property source: CompositePropertySource [name='configService', propertySources=[MapPropertySource {name='configClient'}, MapPropertySource {name='http://192.168.110.53/com.pica.cloud.account/pica-cloud-configuration.git/application-dev.properties'}]]
......@@ -167,7 +167,7 @@
<dependency>
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.1.7-SNAPSHOT</version>
<version>1.1.8-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -2,10 +2,7 @@
package com.pica.cloud.account.account.server.controller;
import com.pica.cloud.account.account.common.req.*;
import com.pica.cloud.account.account.common.resp.AcctPatIdResp;
import com.pica.cloud.account.account.common.resp.AcctSelfPatId;
import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
import com.pica.cloud.account.account.common.resp.*;
import com.pica.cloud.account.account.server.service.AccountPatFamilyRecordService;
import com.pica.cloud.account.account.server.service.PatHealthPackService;
import com.pica.cloud.foundation.entity.PicaResponse;
......@@ -41,6 +38,12 @@ public class PatHealthPackController {
return PicaResponse.toResponse(packService.getAcctIdByUnionId(unionId));
}
@ApiOperation("获取unionId-根据主账户ID")
@GetMapping(value = "/unionId/acctId/{acctId}")
public PicaResponse<String> getUnionIdByAcctId(@PathVariable("acctId") Integer acctId) throws Exception {
return PicaResponse.toResponse(packService.getUnionIdByAcctId(acctId));
}
@ApiOperation("获取主账户ID-作为监护人自身patientId")
@GetMapping(value = "/acctId/patId/{patientId}")
public PicaResponse<Integer> getAcctIdByPatId(@PathVariable("patientId") Integer patientId) throws Exception {
......@@ -53,6 +56,12 @@ public class PatHealthPackController {
return PicaResponse.toResponse(packService.getDirectPatIdsByPatId(patientId));
}
@ApiOperation("所在家庭组的监护人 + 同级家庭成员 + 下级所有成员 patientId list,去除自身、去重;")
@GetMapping(value = "/directPatIds/unionId")
public PicaResponse<List<Integer>> getDirectPatIdsByUnionId(@RequestParam("unionId") String unionId) throws Exception {
return PicaResponse.toResponse(packService.getDirectPatIdsByUnionId(unionId));
}
@ApiOperation("根据accid获取自身家庭成员List;containAcct:0 包含自身 1 不包含自身")
@GetMapping(value = "/familyPats/{acctId}/containAcct/{containAcct}")
public PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId, @PathVariable("containAcct") Integer containAcct) throws Exception {
......@@ -84,6 +93,13 @@ public class PatHealthPackController {
return PicaResponse.toResponse(packService.getFamilyAcctPatId(patId));
}
@ApiOperation("根据patientId获取监护人acctId),本人成员(监护人patId)")
@GetMapping(value = "/familyAcct/self/patId/{patId}")
public PicaResponse<List<Integer>> getRelationSelfAcctPatId(@PathVariable("patId") Integer patId) throws Exception {
return PicaResponse.toResponse(packService.getFamilyAcctIdsPatId(patId));
}
@ApiOperation("根据patientIds 获取监护人-本人监护人(自身patId),本人成员(监护人patId)")
@PostMapping(value = "/familyAcct/patIds")
public PicaResponse<AcctPatIdResp> getFamilyAcctPatIds(@RequestBody AcctPatIdReq acctPatIdReq) throws Exception {
......@@ -121,4 +137,23 @@ public class PatHealthPackController {
return PicaResponse.toResponse(packService.updatePatByAcctId(req));
}
@ApiOperation("获取主账户-作为监护人自身patientId")
@GetMapping(value = "/acctInfo/patId/{patientId}")
public PicaResponse<List<AcctSelfPatInfoResp>> getAcctInfoByPatId(@PathVariable("patientId") Integer patientId) throws Exception {
return PicaResponse.toResponse(packService.getAcctInfoByPatId(patientId));
}
@ApiOperation("获取主账户-作为监护人自身patientId")
@GetMapping(value = "/acctInfo/patInfo/{unionId}")
public PicaResponse<AcctSelfPatInfoResp> getAcctInfoByUnionId(@PathVariable("unionId") String unionId) throws Exception {
return PicaResponse.toResponse(packService.getAcctInfoByUnionId(unionId));
}
@ApiOperation("更新accId 对应的患者信息")
@PostMapping(value = "/acct/updateAcct")
public PicaResponse updatePat(@RequestBody UpdateAcctPatInfoReq req) {
packService.updatePat(req);
return PicaResponse.toResponse();
}
}
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.common.req.AcctPatPageReq;
import com.pica.cloud.account.account.common.resp.AcctSelfPatInfoResp;
import com.pica.cloud.account.account.server.entity.AcctPatFamily;
import java.util.List;
......@@ -26,7 +26,7 @@ public interface AcctPatFamilyMapper {
List<AcctPatFamily> getListByPatIdSelfs(List<Integer> list);
/** 查询居民id所在家庭组监护人- 作为家庭成员、非主账户本人居民id,单条ok 多条异常数据 */
AcctPatFamily getByPatIdNotSelf(Integer patId);
List<AcctPatFamily> getByPatIdNotSelf(Integer patId);
List<AcctPatFamily> getListByPatIdNotSelfs(List<Integer> list);
......@@ -47,4 +47,9 @@ public interface AcctPatFamilyMapper {
List<AcctPatFamily> getMemberListByPatIds(List<Integer> patIds);
List<Integer> queryPatIdByPage(Map map);
List<AcctSelfPatInfoResp> getAcctInfoByPatIdSelf(Integer patId);
AcctSelfPatInfoResp getAcctInfoByUnionId(String unionId);
List<Integer> getPatIdsByUnionId(String unionId);
}
\ No newline at end of file
......@@ -2,10 +2,7 @@
package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.common.req.*;
import com.pica.cloud.account.account.common.resp.AcctPatIdResp;
import com.pica.cloud.account.account.common.resp.AcctSelfPatId;
import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
import com.pica.cloud.account.account.common.resp.*;
import io.swagger.models.auth.In;
import java.util.List;
......@@ -22,10 +19,14 @@ public interface PatHealthPackService {
Integer getAcctIdByUnionId(String unionId);
String getUnionIdByAcctId(Integer acctId);
Integer getAcctIdByPatId(Integer patientId);
List<Integer> getDirectPatIdsByPatId(Integer patientId);
List<Integer> getDirectPatIdsByUnionId(String unionId);
PatFamilyResp getFamilyPatsByAcctId(Integer acctId,Integer containAcct);
Integer saveAcct(AcctPatInfoReq patInfoReq);
......@@ -36,6 +37,8 @@ public interface PatHealthPackService {
Integer getFamilyAcctPatId(Integer patId);
List<Integer> getFamilyAcctIdsPatId(Integer patId);
AcctPatIdResp getFamilyAcctPatIds(AcctPatIdReq acctPatIdReq);
Integer initAccts(List<InitAcctReq> list);
......@@ -45,4 +48,10 @@ public interface PatHealthPackService {
AcctSelfPatId getAcctIdByMobile(String mobile);
boolean updatePatByAcctId(UpdateAcctPatInfoReq req);
void updatePat(UpdateAcctPatInfoReq req);
List<AcctSelfPatInfoResp> getAcctInfoByPatId(Integer patientId);
AcctSelfPatInfoResp getAcctInfoByUnionId(String unionId);
}
......@@ -174,7 +174,7 @@
from account_pat_family
where patient_id = #{patientId,jdbcType=INTEGER}
and relation = 1
and delete_flag = 1;
and delete_flag = 1 order by created_time desc limit 1
</select>
<select id="getListByPatIdSelfs" parameterType="java.util.List" resultMap="BaseResultMap" >
......@@ -195,7 +195,8 @@
from account_pat_family
where patient_id = #{patientId,jdbcType=INTEGER}
AND relation != 1
and delete_flag = 1;
and delete_flag = 1
order by modified_time desc
</select>
<select id="getListByPatIdNotSelfs" parameterType="java.util.List" resultMap="BaseResultMap" >
......@@ -270,4 +271,37 @@
limit #{begin},#{end}
</select>
<select id="getAcctInfoByPatIdSelf" parameterType="java.lang.Integer" resultType="com.pica.cloud.account.account.common.resp.AcctSelfPatInfoResp" >
select
api.id as accId, pf.patient_id as patientId, api.name , api.mobile_phone as mobilePhone
from account_pat_family pf, account_pat_info api
where pf.patient_id = #{patientId,jdbcType=INTEGER}
AND pf.relation = 1
and pf.delete_flag = 1
and pf.acct_id = api.id
and api.delete_flag = 1
</select>
<select id="getAcctInfoByUnionId" parameterType="java.lang.String" resultType="com.pica.cloud.account.account.common.resp.AcctSelfPatInfoResp" >
select
api.id as accId, pf.patient_id as patientId, api.name , api.mobile_phone as mobilePhone
from account_pat_family pf, account_pat_info api, account_pat_union pu
where pu.union_id = #{unionId} and pu.union_type = 1
and pu.acct_id = api.id
and pu.delete_flag = 1
AND pf.relation = 1
and pf.delete_flag = 1
and pf.acct_id = api.id
and api.delete_flag = 1
</select>
<select id="getPatIdsByUnionId" parameterType="java.lang.String" resultType="java.lang.Integer" >
select
distinct pf.patient_id as patientId
from account_pat_family pf, account_pat_union pu
where pu.union_id = #{unionId} and pu.union_type = 1
and pu.delete_flag = 1
and pf.delete_flag = 1
and pu.acct_id = pf.acct_id
</select>
</mapper>
\ No newline at end of file
......@@ -145,7 +145,8 @@
<include refid="Base_Column_List" />
from account_pat_union
where union_id = #{unionId,jdbcType=VARCHAR}
and delete_flag = 1;
and delete_flag = 1
order by modified_time desc limit 1
</select>
<select id="selectByAcctId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
......@@ -153,7 +154,8 @@
<include refid="Base_Column_List" />
from account_pat_union
where acct_id = #{acctId,jdbcType=INTEGER}
and delete_flag = 1;
and delete_flag = 1
order by modified_time desc limit 1
</select>
<insert id="initBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册