提交 8d102188 编写于 作者: wangyongbo's avatar wangyongbo

增加存储存在问题的家庭关系接口

上级 b91b8eb4
流水线 #33311 已失败 于阶段
in 0 second
......@@ -51,5 +51,7 @@ public interface PatHealthPackClient {
@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);
}
package com.pica.cloud.account.account.common.req;
public class PatFamilyRecordReq {
private Integer accId;
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 getAccId() {
return accId;
}
public void setAccId(Integer accId) {
this.accId = accId;
}
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;
}
}
......@@ -6,6 +6,7 @@ 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;
......@@ -31,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 {
......@@ -51,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("保存主账户")
......@@ -104,4 +108,11 @@ public class PatHealthPackController {
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
package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.common.req.PatFamilyRecordReq;
public interface AccountPatFamilyRecordService {
void saveRecord(PatFamilyRecordReq patFamilyRecordReq);
}
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);
}
}
}
......@@ -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
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册