提交 1842ed03 编写于 作者: yongbo.wang's avatar yongbo.wang

Merge branch 'release' into 'master'

Release



See merge request !66
流水线 #33365 已失败 于阶段
in 0 second
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-client</artifactId>
<version>1.0.4.3</version>
<version>1.0.4.5</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.0.1.7</version>
<version>1.0.1.9</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
......
......@@ -2,6 +2,7 @@ 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.foundation.entity.PicaResponse;
......@@ -47,4 +48,10 @@ public interface PatHealthPackClient {
@PostMapping(value = "/account/pat-health/patIds/query/page")
PicaResponse<List<Integer>> queryByPage(@RequestBody AcctPatPageReq patPageReq);
@GetMapping(value = "/account/pat-health/mobile/{mobile}")
PicaResponse<AcctSelfPatId> getAcctIdByMobile(@PathVariable("mobile") String mobile);
@PostMapping(value = "/account/pat-health/family/unusual/record")
PicaResponse saveUnusualFamilyRecord(@RequestBody PatFamilyRecordReq patFamilyRecordReq);
}
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1.7</version>
<version>1.0.1.9</version>
<name>pica-cloud-account-common</name>
<packaging>jar</packaging>
......
package com.pica.cloud.account.account.common.req;
public class PatFamilyRecordReq {
private Integer acctId;
private Integer selfPatientId;
private Integer patientId;
private Integer relation;
private Integer doctorId;
private Integer businessType;
private Integer createdId;
private Integer modifiedId;
public Integer getCreatedId() {
return createdId;
}
public void setCreatedId(Integer createdId) {
this.createdId = createdId;
}
public Integer getModifiedId() {
return modifiedId;
}
public void setModifiedId(Integer modifiedId) {
this.modifiedId = modifiedId;
}
public Integer getAcctId() {
return acctId;
}
public void setAcctId(Integer acctId) {
this.acctId = acctId;
}
public Integer getSelfPatientId() {
return selfPatientId;
}
public void setSelfPatientId(Integer selfPatientId) {
this.selfPatientId = selfPatientId;
}
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;
}
public Integer getDoctorId() {
return doctorId;
}
public void setDoctorId(Integer doctorId) {
this.doctorId = doctorId;
}
public Integer getBusinessType() {
return businessType;
}
public void setBusinessType(Integer businessType) {
this.businessType = businessType;
}
}
package com.pica.cloud.account.account.common.resp;
public class AcctSelfPatId {
private Integer accId;
private Integer selfPatId;
public Integer getAccId() {
return accId;
}
public void setAccId(Integer accId) {
this.accId = accId;
}
public Integer getSelfPatId() {
return selfPatId;
}
public void setSelfPatId(Integer selfPatId) {
this.selfPatId = selfPatId;
}
}
......@@ -20,6 +20,16 @@ public class PatFamilyResp {
private String failMsg;
private String code;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public List<AcctPatFamilyDto> getMemberList() {
return memberList;
}
......
......@@ -151,7 +151,7 @@
<dependency>
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1.7</version>
<version>1.0.1.9</version>
</dependency>
<dependency>
......
......@@ -3,8 +3,10 @@ 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.server.service.AccountPatFamilyRecordService;
import com.pica.cloud.account.account.server.service.PatHealthPackService;
import com.pica.cloud.foundation.entity.PicaResponse;
import io.swagger.annotations.Api;
......@@ -30,6 +32,9 @@ public class PatHealthPackController {
@Autowired
private PatHealthPackService packService;
@Autowired
private AccountPatFamilyRecordService accountPatFamilyRecordService;
@ApiOperation("获取主账户ID-根据unionId")
@GetMapping(value = "/acctId/unionId/{unionId}")
public PicaResponse<Integer> getAcctIdByUnionId(@PathVariable("unionId") String unionId) throws Exception {
......@@ -50,8 +55,8 @@ public class PatHealthPackController {
@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 {
return PicaResponse.toResponse(packService.getFamilyPatsByAcctId(acctId,containAcct));
public PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId, @PathVariable("containAcct") Integer containAcct) throws Exception {
return PicaResponse.toResponse(packService.getFamilyPatsByAcctId(acctId, containAcct));
}
@ApiOperation("保存主账户")
......@@ -97,4 +102,17 @@ public class PatHealthPackController {
return PicaResponse.toResponse(packService.queryByPage(patPageReq));
}
@ApiOperation("根据手机号获取数据账号id和本人居民id")
@GetMapping(value = "/mobile/{mobile}")
public PicaResponse<AcctSelfPatId> getAcctIdByMobile(@PathVariable("mobile") String mobile) {
return PicaResponse.toResponse(packService.getAcctIdByMobile(mobile));
}
@ApiOperation("存储存在问题的家庭关系")
@PostMapping(value = "/family/unusual/record")
public PicaResponse saveUnusualFamilyRecord(@RequestBody PatFamilyRecordReq patFamilyRecordReq) {
accountPatFamilyRecordService.saveRecord(patFamilyRecordReq);
return PicaResponse.toResponse();
}
}
package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class AccountPatFamilyRecord {
private Integer id;
private Integer acctId;
private Integer selfPatientId;
private Integer patientId;
private Integer doctorId;
private Integer businessType;
private Integer relation;
private Integer deleteFlag;
private Integer createdId;
private Date createdTime;
private Integer modifiedId;
private Date modifiedTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getAcctId() {
return acctId;
}
public void setAcctId(Integer acctId) {
this.acctId = acctId;
}
public Integer getSelfPatientId() {
return selfPatientId;
}
public void setSelfPatientId(Integer selfPatientId) {
this.selfPatientId = selfPatientId;
}
public Integer getPatientId() {
return patientId;
}
public void setPatientId(Integer patientId) {
this.patientId = patientId;
}
public Integer getDoctorId() {
return doctorId;
}
public void setDoctorId(Integer doctorId) {
this.doctorId = doctorId;
}
public Integer getBusinessType() {
return businessType;
}
public void setBusinessType(Integer businessType) {
this.businessType = businessType;
}
public Integer getRelation() {
return relation;
}
public void setRelation(Integer relation) {
this.relation = relation;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Integer getCreatedId() {
return createdId;
}
public void setCreatedId(Integer createdId) {
this.createdId = createdId;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Integer getModifiedId() {
return modifiedId;
}
public void setModifiedId(Integer modifiedId) {
this.modifiedId = modifiedId;
}
public Date getModifiedTime() {
return modifiedTime;
}
public void setModifiedTime(Date modifiedTime) {
this.modifiedTime = modifiedTime;
}
}
\ No newline at end of file
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.AccountPatFamilyRecord;
public interface AccountPatFamilyRecordMapper {
int insert(AccountPatFamilyRecord record);
int insertSelective(AccountPatFamilyRecord record);
AccountPatFamilyRecord selectByPrimaryKey(Integer id);
}
\ No newline at end of file
......@@ -19,7 +19,7 @@ public interface AcctPatInfoMapper {
int updateByPrimaryKey(AcctPatInfo record);
List<AcctPatInfo> selectByCondition(AcctPatInfo record);
AcctPatInfo selectByCondition(AcctPatInfo record);
int initBatch(List<AcctPatInfo> list);
......
package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.common.req.PatFamilyRecordReq;
public interface AccountPatFamilyRecordService {
void saveRecord(PatFamilyRecordReq patFamilyRecordReq);
}
......@@ -3,8 +3,10 @@ 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 io.swagger.models.auth.In;
import java.util.List;
......@@ -40,4 +42,5 @@ public interface PatHealthPackService {
List<Integer> queryByPage(AcctPatPageReq patPageReq);
AcctSelfPatId getAcctIdByMobile(String mobile);
}
package com.pica.cloud.account.account.server.service.impl;
import com.alibaba.fastjson.JSON;
import com.pica.cloud.account.account.common.req.PatFamilyRecordReq;
import com.pica.cloud.account.account.server.entity.AccountPatFamilyRecord;
import com.pica.cloud.account.account.server.mapper.AccountPatFamilyRecordMapper;
import com.pica.cloud.account.account.server.service.AccountPatFamilyRecordService;
import com.pica.cloud.account.account.server.service.CaptchaService;
import com.pica.cloud.account.account.server.util.MemcachedClientWrapper;
import com.pica.cloud.account.account.server.util.captcha.CaptchaGenerator;
import com.pica.cloud.account.account.server.util.captcha.CaptchaToken;
import com.pica.cloud.foundation.utils.constants.CommonConstants;
import org.apache.commons.codec.digest.DigestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.UUID;
@Component
public class AccountPatFamilyRecordServiceImpl implements AccountPatFamilyRecordService {
private static Logger logger = LoggerFactory.getLogger(AccountPatFamilyRecordServiceImpl.class);
@Autowired
private AccountPatFamilyRecordMapper accountPatFamilyRecordMapper;
@Override
public void saveRecord(PatFamilyRecordReq recordReq) {
logger.info("AccountPatFamilyRecordServiceImpl/saveRecord : " + JSON.toJSONString(recordReq));
if (recordReq != null) {
AccountPatFamilyRecord record = new AccountPatFamilyRecord();
BeanUtils.copyProperties(recordReq, record);
Date now = new Date();
record.setDeleteFlag(1);
record.setCreatedTime(now);
record.setModifiedTime(now);
accountPatFamilyRecordMapper.insert(record);
}
}
}
......@@ -4,6 +4,7 @@ package com.pica.cloud.account.account.server.service.impl;
import com.alibaba.fastjson.JSONObject;
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.server.entity.AcctPatFamily;
......@@ -307,6 +308,7 @@ public class PatHealthPackServiceIml implements PatHealthPackService {
failList.add(failOne);
successFlag = false;
resp.setFailMsg(AccountExceptionEnum.PAT_MEMBER_HAS_MORE.getMessage());
resp.setCode(AccountExceptionEnum.PAT_MEMBER_HAS_MORE.getCode());
} else {
//居民已被传入acctId关联为家庭成员,不需要再保存
AcctPatFamilyDto failOneRelated = new AcctPatFamilyDto();
......@@ -315,6 +317,7 @@ public class PatHealthPackServiceIml implements PatHealthPackService {
relatedPats.add(failOneRelated);
successFlag = false;
resp.setFailMsg(AccountExceptionEnum.PAT_MEMBER_HAS_BINDED_SELF.getMessage());
resp.setCode(AccountExceptionEnum.PAT_MEMBER_HAS_BINDED_SELF.getCode());
}
}
......@@ -527,4 +530,19 @@ public class PatHealthPackServiceIml implements PatHealthPackService {
}
@Override
public AcctSelfPatId getAcctIdByMobile(String mobile) {
AcctSelfPatId selfPatId = new AcctSelfPatId();
AcctPatInfo req = new AcctPatInfo();
req.setMobilePhone(EncryptUtils.encryptContent(mobile, EncryptConstants.ENCRYPT_TYPE_MOBILE));
AcctPatInfo info = patInfoMapper.selectByCondition(req);
if (info != null) {
selfPatId.setAccId(info.getId());
AcctPatFamily selfPat = patFamilyMapper.getSelfByAcctId(info.getId());
if (selfPat != null) {
selfPatId.setSelfPatId(selfPat.getPatientId());
}
}
return selfPatId;
}
}
......@@ -6,7 +6,8 @@
<generatorConfiguration>
<!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包-->
<classPathEntry location="D:\programer\reponsitory\maven\mysql\mysql-connector-java\5.1.39\mysql-connector-java-5.1.39.jar"/>
<!-- <classPathEntry location="/Users/wangyongbo/Downloads/software/mysql-connector-java-5.1.39.jar"/>-->
<!-- <classPathEntry location="D:\programer\reponsitory\maven\mysql\mysql-connector-java\5.1.39\mysql-connector-java-5.1.39.jar"/>-->
<!--<classPathEntry location="E:\mysql_jar/mysql-connector-java-5.1.39.jar"/>-->
<context id="tableEntity" targetRuntime="MyBatis3">
......@@ -40,8 +41,8 @@
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<table tableName="account_apple_info" domainObjectName="AccountAppleInfo" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<!-- <table tableName="account_apple_info" domainObjectName="AccountAppleInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
<!-- <table tableName="account_pat_family_record" domainObjectName="AccountPatFamilyRecord" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
</context>
</generatorConfiguration>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.pica.cloud.account.account.server.mapper.AccountPatFamilyRecordMapper" >
<resultMap id="BaseResultMap" type="com.pica.cloud.account.account.server.entity.AccountPatFamilyRecord" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="acct_id" property="acctId" jdbcType="INTEGER" />
<result column="self_patient_id" property="selfPatientId" jdbcType="INTEGER" />
<result column="patient_id" property="patientId" jdbcType="INTEGER" />
<result column="doctor_id" property="doctorId" jdbcType="INTEGER" />
<result column="business_type" property="businessType" jdbcType="INTEGER" />
<result column="relation" property="relation" jdbcType="INTEGER" />
<result column="delete_flag" property="deleteFlag" jdbcType="INTEGER" />
<result column="created_id" property="createdId" jdbcType="INTEGER" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="modified_id" property="modifiedId" jdbcType="INTEGER" />
<result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, acct_id, self_patient_id, patient_id, doctor_id, business_type, relation, delete_flag,
created_id, created_time, modified_id, modified_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from account_pat_family_record
where id = #{id,jdbcType=INTEGER}
</select>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AccountPatFamilyRecord" >
insert into account_pat_family_record (acct_id, self_patient_id,
patient_id, doctor_id, business_type,
relation, delete_flag, created_id,
created_time, modified_id, modified_time
)
values (#{acctId,jdbcType=INTEGER}, #{selfPatientId,jdbcType=INTEGER},
#{patientId,jdbcType=INTEGER}, #{doctorId,jdbcType=INTEGER}, #{businessType,jdbcType=INTEGER},
#{relation,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER},
#{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.AccountPatFamilyRecord" >
insert into account_pat_family_record
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="acctId != null" >
acct_id,
</if>
<if test="selfPatientId != null" >
self_patient_id,
</if>
<if test="patientId != null" >
patient_id,
</if>
<if test="doctorId != null" >
doctor_id,
</if>
<if test="businessType != null" >
business_type,
</if>
<if test="relation != null" >
relation,
</if>
<if test="deleteFlag != null" >
delete_flag,
</if>
<if test="createdId != null" >
created_id,
</if>
<if test="createdTime != null" >
created_time,
</if>
<if test="modifiedId != null" >
modified_id,
</if>
<if test="modifiedTime != null" >
modified_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="acctId != null" >
#{acctId,jdbcType=INTEGER},
</if>
<if test="selfPatientId != null" >
#{selfPatientId,jdbcType=INTEGER},
</if>
<if test="patientId != null" >
#{patientId,jdbcType=INTEGER},
</if>
<if test="doctorId != null" >
#{doctorId,jdbcType=INTEGER},
</if>
<if test="businessType != null" >
#{businessType,jdbcType=INTEGER},
</if>
<if test="relation != null" >
#{relation,jdbcType=INTEGER},
</if>
<if test="deleteFlag != null" >
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
#{createdId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
#{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedId != null" >
#{modifiedId,jdbcType=INTEGER},
</if>
<if test="modifiedTime != null" >
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
......@@ -229,6 +229,7 @@
<if test="mobilePhone != null" >
AND mobile_phone = #{mobilePhone,jdbcType=VARCHAR}
</if>
limit 0, 1
</select>
<select id="getListByMobiles" resultMap="BaseResultMap" parameterType="java.util.List" >
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册