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

居民账户7个接口 业务实现类 todo

上级 6a8a3329
流水线 #25364 已失败 于阶段
in 0 second
package com.pica.cloud.account.account.client;
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.resp.PatBindResp;
import com.pica.cloud.foundation.entity.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@FeignClient(name = "13201-pica-cloud-account")
public interface PatHealthPackClient {
@GetMapping(value = "/account/pat-health/acctId/unionId/{unionId}")
PicaResponse<Integer> getAcctIdByUnionId(@PathVariable("unionId") String unionId);
@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/familyPats/{acctId}")
PicaResponse<List<Integer>> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId);
@PostMapping(value = "/account/pat-health/acct")
PicaResponse saveAcct(@RequestBody AcctPatInfoReq patInfoReq);
@PostMapping(value = "/account/pat-health/acct/bindUnion")
PicaResponse<PatBindResp> bindUnion(@RequestBody AcctPatInfoReq patInfoReq);
@PostMapping(value = "/account/pat-health/family/member")
PicaResponse saveMember(@RequestBody AcctPatFamilyReq familyReqReq);
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.req;
/**
* @ClassName AcctPatFamilyDto
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/14 13:21
* @ModifyDate 2020/5/14 13:21
* @Version 1.0
*/
public class AcctPatFamilyDto {
private Integer patientId;
private Integer relation;
public Integer getPatientId() {
return patientId;
}
public void setPatientId(Integer patientId) {
this.patientId = patientId;
}
public Integer getRelation() {
return relation;
}
public void setRelation(Integer relation) {
this.relation = relation;
}
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.req;
import io.swagger.annotations.ApiModel;
import java.util.List;
/**
* @ClassName AcctPatFamilyReq
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/14 13:21
* @ModifyDate 2020/5/14 13:21
* @Version 1.0
*/
@ApiModel
public class AcctPatFamilyReq {
private Integer acctId;
private List<AcctPatFamilyDto> memberList;
public Integer getAcctId() {
return acctId;
}
public void setAcctId(Integer acctId) {
this.acctId = acctId;
}
public List<AcctPatFamilyDto> getMemberList() {
return memberList;
}
public void setMemberList(List<AcctPatFamilyDto> memberList) {
this.memberList = memberList;
}
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.req;
import com.sun.istack.internal.NotNull;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @ClassName AcctPatInfoReq
......@@ -14,16 +16,24 @@ import io.swagger.annotations.ApiModel;
@ApiModel
public class AcctPatInfoReq {
// @NotNull
private String name;
// @NotNull
private String mobile;
private String unionId;
private Integer acctId;
@ApiModelProperty("1.云鹊健康小程序")
private Integer type;
private Integer patientId;
@ApiModelProperty("1:本人 2:父母 3:子女 4:配偶 5:其他")
private Integer memberType;
public String getName() {
return name;
}
......@@ -63,4 +73,20 @@ public class AcctPatInfoReq {
public void setType(Integer type) {
this.type = type;
}
public Integer getPatientId() {
return patientId;
}
public void setPatientId(Integer patientId) {
this.patientId = patientId;
}
public Integer getMemberType() {
return memberType;
}
public void setMemberType(Integer memberType) {
this.memberType = memberType;
}
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.resp;
import io.swagger.annotations.ApiModel;
/**
* @ClassName PatBindResp
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/13 13:24
* @ModifyDate 2020/5/13 13:24
* @Version 1.0
*/
@ApiModel(description = "建立微信与账号关联关系-resp")
public class PatBindResp {
private boolean bindStatus;
private String msg;
public boolean isBindStatus() {
return bindStatus;
}
public void setBindStatus(boolean bindStatus) {
this.bindStatus = bindStatus;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.resp;
import com.pica.cloud.account.account.common.req.AcctPatFamilyDto;
import io.swagger.annotations.ApiModel;
import java.util.List;
@ApiModel(description = "建立家庭服务关系-resp")
public class PatFamilyResp {
private boolean successFlag;
private List<AcctPatFamilyDto> failMemberList;
public boolean isSuccessFlag() {
return successFlag;
}
public void setSuccessFlag(boolean successFlag) {
this.successFlag = successFlag;
}
public List<AcctPatFamilyDto> getFailMemberList() {
return failMemberList;
}
public void setFailMemberList(List<AcctPatFamilyDto> failMemberList) {
this.failMemberList = failMemberList;
}
}
......@@ -56,6 +56,8 @@ public enum AccountExceptionEnum {
PICA_MOBILE_NOT_SETED_PASSWORD_H5("216548", "该手机号尚未设置密码,设置密码请前往云鹊医APP,或使用其他方式登录。"),
PICA_PWD_MISMATCH_5_H5("216549", "该账号密码错误次数已达上限请24小时后再试,或请使用其他登录方式"),
PAT_ACCT_HAS_EXIST("216550","账号已存在"),
xxx_xxx("","");
......
......@@ -2,6 +2,8 @@ package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.AcctPatFamily;
import java.util.List;
public interface AcctPatFamilyMapper {
int deleteByPrimaryKey(Integer id);
......@@ -14,4 +16,20 @@ public interface AcctPatFamilyMapper {
int updateByPrimaryKeySelective(AcctPatFamily record);
int updateByPrimaryKey(AcctPatFamily record);
/** 获取居民id是本人的家庭组记录- 作为家庭主账户、本人居民id,单条ok 多条异常数据 */
List<AcctPatFamily> getByPatIdSelf(Integer patId);
/** 查询居民id所在家庭组监护人- 作为家庭成员、非主账户本人居民id,单条ok 多条异常数据 */
List<AcctPatFamily> getByPatIdNotSelf(Integer patId);
/** 获取主账户下所有家庭成员 */
List<AcctPatFamily> getListByAcctId(Integer acctId);
/** 根据账户id 获取主账户居民id */
AcctPatFamily getSelfByAcctId(Integer acctId);
List<AcctPatFamily> getListByPatIds(List<Integer> patIds);
}
\ No newline at end of file
......@@ -2,6 +2,9 @@ package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.AcctPatInfo;
import java.util.List;
import java.util.Map;
public interface AcctPatInfoMapper {
int deleteByPrimaryKey(Integer id);
......@@ -14,4 +17,7 @@ public interface AcctPatInfoMapper {
int updateByPrimaryKeySelective(AcctPatInfo record);
int updateByPrimaryKey(AcctPatInfo record);
List<AcctPatInfo> selectByCondition(AcctPatInfo record);
}
\ No newline at end of file
......@@ -14,4 +14,8 @@ public interface AcctPatUnionMapper {
int updateByPrimaryKeySelective(AcctPatUnion record);
int updateByPrimaryKey(AcctPatUnion record);
AcctPatUnion selectByUnionId(String unionId);
AcctPatUnion selectByAcctId(Integer acctId);
}
\ No newline at end of file
......@@ -139,4 +139,50 @@
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getListByAcctId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where acct_id = #{acctId,jdbcType=INTEGER}
and delete_flag = 1;
</select>
<select id="getSelfByAcctId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where acct_id = #{acctId,jdbcType=INTEGER} and relation = 1
and delete_flag = 1;
</select>
<select id="getByPatIdSelf" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where patient_id = #{patientId,jdbcType=INTEGER}
and relation = 1
and delete_flag = 1;
</select>
<select id="getByPatIdNotSelf" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where patient_id = #{patientId,jdbcType=INTEGER}
AND relation != 1
and delete_flag = 1;
</select>
<select id="getListByPatIds" parameterType="java.util.List" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where patient_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
and delete_flag = 1;
</select>
</mapper>
\ No newline at end of file
......@@ -33,7 +33,7 @@
delete from account_pat_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AcctPatInfo" >
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AcctPatInfo" useGeneratedKeys="true" keyProperty="id" >
insert into account_pat_info (id, name, mobile_phone,
password, register_product, register_source,
birthday, age, sex, id_card,
......@@ -220,4 +220,16 @@
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.pica.cloud.account.account.server.entity.AcctPatInfo" >
select
<include refid="Base_Column_List" />
from account_pat_info
where delete_flag = 1
<if test="mobilePhone != null" >
AND mobile_phone = #{mobilePhone,jdbcType=VARCHAR}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -139,4 +139,20 @@
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByUnionId" parameterType="java.lang.String" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_union
where union_id = #{unionId,jdbcType=VARCHAR}
and delete_flag = 1;
</select>
<select id="selectByAcctId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_union
where acct_id = #{acctId,jdbcType=INTEGER}
and delete_flag = 1;
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册